From: Wei Zhao <wei.zhao1@intel.com>
To: dev@dpdk.org
Cc: qi.z.zhang@intel.com, nannan.lu@intel.com, stable@dpdk.org,
Wei Zhao <wei.zhao1@intel.com>
Subject: [dpdk-dev] [PATCH 2/2] net/ice/base: fix add special words for tunnel rule
Date: Tue, 7 Jul 2020 17:40:48 +0800 [thread overview]
Message-ID: <20200707094048.17690-3-wei.zhao1@intel.com> (raw)
In-Reply-To: <20200707094048.17690-1-wei.zhao1@intel.com>
if we download a NVGRE rule like "eth / ipv4 / nvgre / eth / ipv4 src
is 192.168.1.2 dst is 192.168.1.3 / end actions queue index 3 / end"
the special word will not be added because of rm->n_grp_count = 1,
so we have to change the ice_add_special_words() function before
ice_create_recipe_group(), then the special words will be add
into rm->rg_list, btw the flag match_tun_mask is useless now
and no need to add special words in function
ice_add_sw_recipe() duplicatly.
Fixes: eda40e22b858 ("net/ice/base: improve switch chained recipe")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
drivers/net/ice/base/ice_switch.c | 38 ++++++++-----------------------
1 file changed, 9 insertions(+), 29 deletions(-)
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index caa080da2..296aa5484 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -5993,12 +5993,11 @@ ice_find_free_recp_res_idx(struct ice_hw *hw, const ice_bitmap_t *profiles,
* ice_add_sw_recipe - function to call AQ calls to create switch recipe
* @hw: pointer to hardware structure
* @rm: recipe management list entry
- * @match_tun_mask: tunnel mask that needs to be programmed
* @profiles: bitmap of profiles that will be associated.
*/
static enum ice_status
ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
- u16 match_tun_mask, ice_bitmap_t *profiles)
+ ice_bitmap_t *profiles)
{
ice_declare_bitmap(result_idx_bm, ICE_MAX_FV_WORDS);
struct ice_aqc_recipe_data_elem *tmp;
@@ -6213,15 +6212,6 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
}
buf[recps].content.act_ctrl_fwd_priority = rm->priority;
- /* To differentiate among different UDP tunnels, a meta data ID
- * flag is used.
- */
- if (match_tun_mask) {
- buf[recps].content.lkup_indx[i] = ICE_TUN_FLAG_FV_IND;
- buf[recps].content.mask[i] =
- CPU_TO_LE16(match_tun_mask);
- }
-
recps++;
rm->root_rid = (u8)rid;
}
@@ -6596,8 +6586,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
struct ice_sw_fv_list_entry *tmp;
enum ice_status status = ICE_SUCCESS;
struct ice_sw_recipe *rm;
- u16 match_tun_mask = 0;
- u16 mask;
u8 i;
if (!ice_is_prof_rule(rinfo->tun_type) && !lkups_cnt)
@@ -6648,6 +6636,13 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
if (status)
goto err_unroll;
+ /* Create any special protocol/offset pairs, such as looking at tunnel
+ * bits by extracting metadata
+ */
+ status = ice_add_special_words(rinfo, lkup_exts);
+ if (status)
+ goto err_free_lkup_exts;
+
/* Group match words into recipes using preferred recipe grouping
* criteria.
*/
@@ -6655,14 +6650,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
if (status)
goto err_unroll;
- /* For certain tunnel types it is necessary to use a metadata ID flag to
- * differentiate different tunnel types. A separate recipe needs to be
- * used for the metadata.
- */
- if (ice_tun_type_match_word(rinfo->tun_type, &mask) &&
- rm->n_grp_count > 1)
- match_tun_mask = mask;
-
/* set the recipe priority if specified */
rm->priority = (u8)rinfo->priority;
@@ -6701,13 +6688,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
ice_set_bit((u16)fvit->profile_id, profiles);
}
- /* Create any special protocol/offset pairs, such as looking at tunnel
- * bits by extracting metadata
- */
- status = ice_add_special_words(rinfo, lkup_exts);
- if (status)
- goto err_free_lkup_exts;
-
/* Look for a recipe which matches our requested fv / mask list */
*rid = ice_find_recp(hw, lkup_exts, rinfo->tun_type);
if (*rid < ICE_MAX_NUM_RECIPES)
@@ -6716,7 +6696,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
rm->tun_type = rinfo->tun_type;
/* Recipe we need does not exist, add a recipe */
- status = ice_add_sw_recipe(hw, rm, match_tun_mask, profiles);
+ status = ice_add_sw_recipe(hw, rm, profiles);
if (status)
goto err_unroll;
--
2.19.1
next prev parent reply other threads:[~2020-07-07 10:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-07 9:40 [dpdk-dev] [PATCH 0/2] update base code batch 4 Wei Zhao
2020-07-07 9:40 ` [dpdk-dev] [PATCH 1/2] net/ice/base: fix tunnel type check for PPPoE Wei Zhao
2020-07-07 9:40 ` Wei Zhao [this message]
2020-07-08 0:39 ` [dpdk-dev] [PATCH 0/2] update base code batch 4 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=20200707094048.17690-3-wei.zhao1@intel.com \
--to=wei.zhao1@intel.com \
--cc=dev@dpdk.org \
--cc=nannan.lu@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=stable@dpdk.org \
/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).