Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/126585/?format=api
http://patches.dpdk.org/api/patches/126585/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230427062001.478032-19-qiming.yang@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20230427062001.478032-19-qiming.yang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230427062001.478032-19-qiming.yang@intel.com", "date": "2023-04-27T06:19:49", "name": "[18/30] net/ice/base: add VLAN TPID in switchdev", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "735c85469492bab3a70013dd3fe3673bfb54e0c8", "submitter": { "id": 522, "url": "http://patches.dpdk.org/api/people/522/?format=api", "name": "Qiming Yang", "email": "qiming.yang@intel.com" }, "delegate": { "id": 1540, "url": "http://patches.dpdk.org/api/users/1540/?format=api", "username": "qzhan15", "first_name": "Qi", "last_name": "Zhang", "email": "qi.z.zhang@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230427062001.478032-19-qiming.yang@intel.com/mbox/", "series": [ { "id": 27885, "url": "http://patches.dpdk.org/api/series/27885/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27885", "date": "2023-04-27T06:19:31", "name": "net/ice/base: share code update", "version": 1, "mbox": "http://patches.dpdk.org/series/27885/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/126585/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/126585/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A8B6842A08;\n\tThu, 27 Apr 2023 08:40:00 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E212242F94;\n\tThu, 27 Apr 2023 08:38:20 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id BD25942D3A\n for <dev@dpdk.org>; Thu, 27 Apr 2023 08:38:17 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Apr 2023 23:38:17 -0700", "from dpdk-qiming3.sh.intel.com ([10.67.111.4])\n by fmsmga002.fm.intel.com with ESMTP; 26 Apr 2023 23:38:15 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1682577497; x=1714113497;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=MjWhC7VZYtPdCh4n5rHXZQMN8wG5qkc10CrKLnzWpUo=;\n b=ltvaPxQBKIffizvovvLvc7gPXyGPm2EWa3tCA8PMR1SYW18XkXUmQ7zb\n NTt6lpjmrHxTOAcgA0uGHrKWiirVjuFV+MRR+jNGCe0A6Lmry7JAnFfgH\n P9T+NRCy/vKIR93wJ2fnPTMJJl5OgDB9FaiWmw2PEI0O8tlJ6/1ebs40J\n wnp+Isj8eGSoqq0bvR8j+j60NVUGTrtnSjoPGXrEA+tNUFVdb/cpaBVTx\n IVo4x3DdOi62wZdpCPheA90/6OxGkbzbuw9eWX9MEkKY/A0CUR295xNB1\n E6/DFoNcOwDG5tLzTuCAwyduxSPmVGRFRZ2PRWrBVKSaL9CSQBXiIPSki A==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10692\"; a=\"375324352\"", "E=Sophos;i=\"5.99,230,1677571200\"; d=\"scan'208\";a=\"375324352\"", "E=McAfee;i=\"6600,9927,10692\"; a=\"805845833\"", "E=Sophos;i=\"5.99,230,1677571200\"; d=\"scan'208\";a=\"805845833\"" ], "X-ExtLoop1": "1", "From": "Qiming Yang <qiming.yang@intel.com>", "To": "dev@dpdk.org", "Cc": "qi.z.zhang@intel.com,\n\tQiming Yang <qiming.yang@intel.com>", "Subject": "[PATCH 18/30] net/ice/base: add VLAN TPID in switchdev", "Date": "Thu, 27 Apr 2023 06:19:49 +0000", "Message-Id": "<20230427062001.478032-19-qiming.yang@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230427062001.478032-1-qiming.yang@intel.com>", "References": "<20230427062001.478032-1-qiming.yang@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Signed-off-by: Qiming Yang <qiming.yang@intel.com>\n---\n drivers/net/ice/base/ice_protocol_type.h | 6 +++-\n drivers/net/ice/base/ice_switch.c | 42 ++++++++++++++++++------\n drivers/net/ice/base/ice_switch.h | 1 +\n 3 files changed, 38 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h\nindex 1d9baea624..7f5f5069b6 100644\n--- a/drivers/net/ice/base/ice_protocol_type.h\n+++ b/drivers/net/ice/base/ice_protocol_type.h\n@@ -215,7 +215,7 @@ enum ice_prot_id {\n */\n #define ICE_UDP_OF_HW\t52 /* UDP Tunnels */\n #define ICE_GRE_OF_HW\t64 /* NVGRE */\n-#define ICE_META_DATA_ID_HW 255 /* this is used for tunnel type */\n+#define ICE_META_DATA_ID_HW 255 /* this is used for tunnel and VLAN type */\n \n #define ICE_MDID_SIZE 2\n #define ICE_TUN_FLAG_MDID 20\n@@ -226,6 +226,10 @@ enum ice_prot_id {\n #define ICE_TUN_FLAG_VLAN_MASK 0x01\n #define ICE_TUN_FLAG_FV_IND 2\n \n+#define ICE_VLAN_FLAG_MDID 20\n+#define ICE_VLAN_FLAG_MDID_OFF (ICE_MDID_SIZE * ICE_VLAN_FLAG_MDID)\n+#define ICE_PKT_FLAGS_0_TO_15_VLAN_FLAGS_MASK 0xD000\n+\n #define ICE_PROTOCOL_MAX_ENTRIES 16\n \n /* Mapping of software defined protocol ID to hardware defined protocol ID */\ndiff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c\nindex 1b8311fdc7..7b3c367e94 100644\n--- a/drivers/net/ice/base/ice_switch.c\n+++ b/drivers/net/ice/base/ice_switch.c\n@@ -7502,13 +7502,14 @@ ice_create_recipe_group(struct ice_hw *hw, struct ice_sw_recipe *rm,\n \n /**\n * ice_tun_type_match_word - determine if tun type needs a match mask\n- * @tun_type: tunnel type\n+ * @rinfo: other information regarding the rule e.g. priority and action info\n * @off: offset of packet flag\n * @mask: mask to be used for the tunnel\n */\n-static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *off, u16 *mask)\n+static bool\n+ice_tun_type_match_word(struct ice_adv_rule_info *rinfo, u16 *off, u16 *mask)\n {\n-\tswitch (tun_type) {\n+\tswitch (rinfo->tun_type) {\n \tcase ICE_SW_TUN_VXLAN_GPE:\n \tcase ICE_SW_TUN_GENEVE:\n \tcase ICE_SW_TUN_VXLAN:\n@@ -7526,9 +7527,14 @@ static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *off,\n \t\treturn true;\n \n \tcase ICE_SW_TUN_AND_NON_TUN:\n-\t\t*mask = ICE_DIR_FLAG_MASK;\n-\t\t*off = ICE_TUN_FLAG_MDID_OFF(0);\n-\t\treturn true;\n+\t\tif (rinfo->add_dir_lkup) {\n+\t\t\t*mask = ICE_DIR_FLAG_MASK;\n+\t\t\t*off = ICE_TUN_FLAG_MDID_OFF(0);\n+\t\t\treturn true;\n+\t\t}\n+\t\t*mask = 0;\n+\t\t*off = 0;\n+\t\treturn false;\n \n \tcase ICE_SW_TUN_GENEVE_VLAN:\n \tcase ICE_SW_TUN_VXLAN_VLAN:\n@@ -7548,10 +7554,11 @@ static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *off,\n * ice_add_special_words - Add words that are not protocols, such as metadata\n * @rinfo: other information regarding the rule e.g. priority and action info\n * @lkup_exts: lookup word structure\n+ * @dvm_ena: is double VLAN mode enabled\n */\n static enum ice_status\n ice_add_special_words(struct ice_adv_rule_info *rinfo,\n-\t\t struct ice_prot_lkup_ext *lkup_exts)\n+\t\t struct ice_prot_lkup_ext *lkup_exts, bool dvm_ena)\n {\n \tu16 mask;\n \tu16 off;\n@@ -7560,7 +7567,7 @@ ice_add_special_words(struct ice_adv_rule_info *rinfo,\n \t * tunnel bit in the packet metadata flags. If this is a tun_and_non_tun\n \t * packet, then add recipe index to match the direction bit in the flag.\n \t */\n-\tif (ice_tun_type_match_word(rinfo->tun_type, &off, &mask)) {\n+\tif (ice_tun_type_match_word(rinfo, &off, &mask)) {\n \t\tif (lkup_exts->n_val_words < ICE_MAX_CHAIN_WORDS) {\n \t\t\tu8 word = lkup_exts->n_val_words++;\n \n@@ -7572,6 +7579,19 @@ ice_add_special_words(struct ice_adv_rule_info *rinfo,\n \t\t}\n \t}\n \n+\tif (rinfo->vlan_type != 0 && dvm_ena) {\n+\t\tif (lkup_exts->n_val_words < ICE_MAX_CHAIN_WORDS) {\n+\t\t\tu8 word = lkup_exts->n_val_words++;\n+\n+\t\t\tlkup_exts->fv_words[word].prot_id = ICE_META_DATA_ID_HW;\n+\t\t\tlkup_exts->fv_words[word].off = ICE_VLAN_FLAG_MDID_OFF;\n+\t\t\tlkup_exts->field_mask[word] =\n+\t\t\t\t\tICE_PKT_FLAGS_0_TO_15_VLAN_FLAGS_MASK;\n+\t\t} else {\n+\t\t\treturn ICE_ERR_MAX_LIMIT;\n+\t\t}\n+\t}\n+\n \treturn ICE_SUCCESS;\n }\n \n@@ -7898,7 +7918,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,\n \t/* Create any special protocol/offset pairs, such as looking at tunnel\n \t * bits by extracting metadata\n \t */\n-\tstatus = ice_add_special_words(rinfo, lkup_exts);\n+\tstatus = ice_add_special_words(rinfo, lkup_exts, ice_is_dvm_ena(hw));\n \tif (status)\n \t\tgoto err_free_lkup_exts;\n \n@@ -8745,6 +8765,7 @@ ice_find_adv_rule_entry(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,\n \t\t\t}\n \t\tif (rinfo->sw_act.flag == list_itr->rule_info.sw_act.flag &&\n \t\t rinfo->tun_type == list_itr->rule_info.tun_type &&\n+\t\t rinfo->vlan_type == list_itr->rule_info.vlan_type &&\n \t\t lkups_matched)\n \t\t\treturn list_itr;\n \t}\n@@ -9240,6 +9261,7 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,\n \t} else {\n \t\tadv_fltr->lkups = NULL;\n \t}\n+\n \tif (!adv_fltr->lkups && !prof_rule) {\n \t\tstatus = ICE_ERR_NO_MEMORY;\n \t\tgoto err_ice_add_adv_rule;\n@@ -9410,7 +9432,7 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,\n \t/* Create any special protocol/offset pairs, such as looking at tunnel\n \t * bits by extracting metadata\n \t */\n-\tstatus = ice_add_special_words(rinfo, &lkup_exts);\n+\tstatus = ice_add_special_words(rinfo, &lkup_exts, ice_is_dvm_ena(hw));\n \tif (status)\n \t\treturn status;\n \ndiff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h\nindex adb467eb66..366b9bb425 100644\n--- a/drivers/net/ice/base/ice_switch.h\n+++ b/drivers/net/ice/base/ice_switch.h\n@@ -300,6 +300,7 @@ struct ice_adv_rule_info {\n \tstruct ice_sw_act_ctrl sw_act;\n \tu32 priority;\n \tu8 rx; /* true means LOOKUP_RX otherwise LOOKUP_TX */\n+\tu8 add_dir_lkup;\n \tu16 fltr_rule_id;\n \tu16 lg_id;\n \tu16 vlan_type;\n", "prefixes": [ "18/30" ] }{ "id": 126585, "url": "