DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wei Zhao <wei.zhao1@intel.com>
To: dev@dpdk.org
Cc: qi.z.zhang@intel.com, wei zhao <wei.zhao1@intel.com>
Subject: [dpdk-dev] [PATCH v3] net/ice: fix item number when pattern has ETH
Date: Tue, 16 Jul 2019 10:36:38 +0800	[thread overview]
Message-ID: <1563244598-63808-1-git-send-email-wei.zhao1@intel.com> (raw)
In-Reply-To: <1563242909-62810-1-git-send-email-wei.zhao1@intel.com>

When pattern has ETH, maybe it will contain
MAC and ethertype two kinds of lookup parameters,
so add more item number for memory malloc in order
to reserve one more memory slot for ETH which may
consume 2 lookup items.

Fixes: 24dc00c30907 ("net/ice: enable switch filter")
Signed-off-by: wei zhao <wei.zhao1@intel.com>
---
 drivers/net/ice/ice_switch_filter.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 5424223..b88b4f5 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -435,6 +435,11 @@ ice_create_switch_filter(struct ice_pf *pf,
 			tun_type = ICE_SW_TUN_VXLAN;
 		if (item->type == RTE_FLOW_ITEM_TYPE_NVGRE)
 			tun_type = ICE_SW_TUN_NVGRE;
+		/* reserve one more memory slot for ETH which may
+		 * consume 2 lookup items.
+		 */
+		if (item->type == RTE_FLOW_ITEM_TYPE_ETH)
+			item_num++;
 	}
 	rule_info.tun_type = tun_type;
 
-- 
2.7.5


  reply	other threads:[~2019-07-16  3:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15  9:02 [dpdk-dev] [PATCH] " Wei Zhao
2019-07-16  1:13 ` Zhang, Qi Z
2019-07-16  2:08 ` [dpdk-dev] [PATCH v2] " Wei Zhao
2019-07-16  2:36   ` Wei Zhao [this message]
2019-07-16  7:30     ` [dpdk-dev] [PATCH v3] " Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1563244598-63808-1-git-send-email-wei.zhao1@intel.com \
    --to=wei.zhao1@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).