Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/127824/?format=api
https://patches.dpdk.org/api/patches/127824/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230601081203.70142-3-artemii.morozov@arknetworks.am/", "project": { "id": 1, "url": "https://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": "<20230601081203.70142-3-artemii.morozov@arknetworks.am>", "list_archive_url": "https://inbox.dpdk.org/dev/20230601081203.70142-3-artemii.morozov@arknetworks.am", "date": "2023-06-01T08:12:02", "name": "[v2,2/3] common/sfc_efx/base: add support to enable VLAN stripping", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "718347cc22248159cbbcd9f1863be8c3ea70635d", "submitter": { "id": 3083, "url": "https://patches.dpdk.org/api/people/3083/?format=api", "name": "Artemii Morozov", "email": "Artemii.Morozov@arknetworks.am" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230601081203.70142-3-artemii.morozov@arknetworks.am/mbox/", "series": [ { "id": 28294, "url": "https://patches.dpdk.org/api/series/28294/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=28294", "date": "2023-06-01T08:12:00", "name": "net/sfc: support VLAN stripping offload", "version": 2, "mbox": "https://patches.dpdk.org/series/28294/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/127824/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/127824/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 CEA4942C01;\n\tThu, 1 Jun 2023 10:12:17 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 95D0042D0B;\n\tThu, 1 Jun 2023 10:12:09 +0200 (CEST)", "from agw.arknetworks.am (agw.arknetworks.am [79.141.165.80])\n by mails.dpdk.org (Postfix) with ESMTP id A2366406A2\n for <dev@dpdk.org>; Thu, 1 Jun 2023 10:12:07 +0200 (CEST)", "from localhost.localdomain (unknown [37.252.88.144])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by agw.arknetworks.am (Postfix) with ESMTPSA id 230CAE11EC;\n Thu, 1 Jun 2023 12:12:07 +0400 (+04)" ], "From": "Artemii Morozov <artemii.morozov@arknetworks.am>", "To": "dev@dpdk.org", "Cc": "Ivan Malov <ivan.malov@arknetworks.am>,\n Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Andy Moreton <amoreton@xilinx.com>", "Subject": "[PATCH v2 2/3] common/sfc_efx/base: add support to enable VLAN\n stripping", "Date": "Thu, 1 Jun 2023 12:12:02 +0400", "Message-Id": "<20230601081203.70142-3-artemii.morozov@arknetworks.am>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230601081203.70142-1-artemii.morozov@arknetworks.am>", "References": "<20230531134122.119508-2-artemii.morozov@arknetworks.am>\n <20230601081203.70142-1-artemii.morozov@arknetworks.am>", "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": "To enable VLAN stripping, two conditions must be met:\nthe corresponding flag must be set and the appropriate\nRX prefix should be requested.\nVLAN stripping is supported for ef100 datapath only.\n\nSigned-off-by: Artemii Morozov <artemii.morozov@arknetworks.am>\nReviewed-by: Ivan Malov <ivan.malov@arknetworks.am>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/common/sfc_efx/base/ef10_filter.c | 21 +++++++++++++++++++++\n drivers/common/sfc_efx/base/ef10_impl.h | 1 +\n drivers/common/sfc_efx/base/efx.h | 9 +++++++++\n drivers/common/sfc_efx/base/efx_filter.c | 3 ++-\n drivers/common/sfc_efx/base/efx_impl.h | 1 +\n drivers/common/sfc_efx/base/efx_rx.c | 17 +++++++++++++++++\n drivers/common/sfc_efx/base/rhead_rx.c | 3 +++\n 7 files changed, 54 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/common/sfc_efx/base/ef10_filter.c b/drivers/common/sfc_efx/base/ef10_filter.c\nindex d6940011c0..7371451098 100644\n--- a/drivers/common/sfc_efx/base/ef10_filter.c\n+++ b/drivers/common/sfc_efx/base/ef10_filter.c\n@@ -338,6 +338,11 @@ efx_mcdi_filter_op_add(\n \t\t FILTER_OP_V3_IN_MATCH_SET_FLAG, 1);\n \t}\n \n+\tif (spec->efs_flags & EFX_FILTER_FLAG_VLAN_STRIP) {\n+\t\tMCDI_IN_SET_DWORD_FIELD(req, FILTER_OP_V3_IN_MATCH_ACTION_FLAGS,\n+\t\t\tFILTER_OP_V3_IN_MATCH_STRIP_VLAN, 1);\n+\t}\n+\n \tefx_mcdi_execute(enp, &req);\n \n \tif (req.emr_rc != 0) {\n@@ -852,6 +857,16 @@ ef10_filter_add_internal(\n \n \thash = ef10_filter_hash(spec);\n \n+\t/*\n+\t * VLAN stripping is offload at the device level, and it should be\n+\t * applied to all filters if it has been applied at least once before.\n+\t * Knowledge of device level vlan strip offload being enabled comes from\n+\t * the default RxQ flags, albeit the flag may be set on any queue.\n+\t * But only default RxQ affects this 'eft_strip_vlan' decision.\n+\t */\n+\tif (eftp->eft_strip_vlan)\n+\t\tspec->efs_flags |= EFX_FILTER_FLAG_VLAN_STRIP;\n+\n \t/*\n \t * FIXME: Add support for inserting filters of different priorities\n \t * and removing lower priority multicast filters (bug 42378)\n@@ -2010,6 +2025,9 @@ ef10_filter_reconfigure(\n \telse\n \t\tfilter_flags = 0;\n \n+\tif (table->eft_strip_vlan)\n+\t\tfilter_flags |= EFX_FILTER_FLAG_VLAN_STRIP;\n+\n \t/* Mark old filters which may need to be removed */\n \tef10_filter_mark_old_filters(enp);\n \n@@ -2142,6 +2160,8 @@ ef10_filter_default_rxq_set(\n \tEFSYS_ASSERT(using_rss == B_FALSE);\n \ttable->eft_using_rss = B_FALSE;\n #endif\n+\tif (erp->er_flags & EFX_RXQ_FLAG_VLAN_STRIP)\n+\t\ttable->eft_strip_vlan = B_TRUE;\n \ttable->eft_default_rxq = erp;\n }\n \n@@ -2153,6 +2173,7 @@ ef10_filter_default_rxq_clear(\n \n \ttable->eft_default_rxq = NULL;\n \ttable->eft_using_rss = B_FALSE;\n+\ttable->eft_strip_vlan = B_FALSE;\n }\n \n \ndiff --git a/drivers/common/sfc_efx/base/ef10_impl.h b/drivers/common/sfc_efx/base/ef10_impl.h\nindex 877aedad45..017e561f19 100644\n--- a/drivers/common/sfc_efx/base/ef10_impl.h\n+++ b/drivers/common/sfc_efx/base/ef10_impl.h\n@@ -1287,6 +1287,7 @@ typedef struct ef10_filter_table_s {\n \tef10_filter_entry_t\teft_entry[EFX_EF10_FILTER_TBL_ROWS];\n \tefx_rxq_t\t\t*eft_default_rxq;\n \tboolean_t\t\teft_using_rss;\n+\tboolean_t\t\teft_strip_vlan;\n \tuint32_t\t\teft_unicst_filter_indexes[\n \t EFX_EF10_FILTER_UNICAST_FILTERS_MAX];\n \tuint32_t\t\teft_unicst_filter_count;\ndiff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex ac89b418e0..508d0a802d 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -3101,6 +3101,10 @@ typedef enum efx_rxq_type_e {\n * Request user flag field in the Rx prefix of a queue.\n */\n #define\tEFX_RXQ_FLAG_USER_FLAG\t\t0x20\n+/*\n+ * Request vlan tci field in the Rx prefix of a queue.\n+ */\n+#define\tEFX_RXQ_FLAG_VLAN_STRIP\t\t0x40\n \n LIBEFX_API\n extern\t__checkReturn\tefx_rc_t\n@@ -3455,6 +3459,11 @@ efx_tx_qdestroy(\n #define\tEFX_FILTER_FLAG_ACTION_FLAG\t0x20\n /* Set match mark on the received packet */\n #define\tEFX_FILTER_FLAG_ACTION_MARK\t0x40\n+/*\n+ * Request that the first tag in the outer L2 header be stripped\n+ * and TCI be indicated in Rx prefix.\n+ */\n+#define\tEFX_FILTER_FLAG_VLAN_STRIP\t0x80\n \n typedef uint8_t efx_filter_flags_t;\n \ndiff --git a/drivers/common/sfc_efx/base/efx_filter.c b/drivers/common/sfc_efx/base/efx_filter.c\nindex 83c37ff859..778ed0c370 100644\n--- a/drivers/common/sfc_efx/base/efx_filter.c\n+++ b/drivers/common/sfc_efx/base/efx_filter.c\n@@ -322,7 +322,8 @@ efx_filter_spec_init_rx(\n \tEFSYS_ASSERT3P(spec, !=, NULL);\n \tEFSYS_ASSERT3P(erp, !=, NULL);\n \tEFSYS_ASSERT((flags & ~(EFX_FILTER_FLAG_RX_RSS |\n-\t\t\t\tEFX_FILTER_FLAG_RX_SCATTER)) == 0);\n+\t\t\t\tEFX_FILTER_FLAG_RX_SCATTER |\n+\t\t\t\tEFX_FILTER_FLAG_VLAN_STRIP)) == 0);\n \n \tmemset(spec, 0, sizeof (*spec));\n \tspec->efs_priority = priority;\ndiff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h\nindex 45e99d01c5..c45669e077 100644\n--- a/drivers/common/sfc_efx/base/efx_impl.h\n+++ b/drivers/common/sfc_efx/base/efx_impl.h\n@@ -1045,6 +1045,7 @@ struct efx_rxq_s {\n \tefsys_mem_t\t\t\t*er_esmp;\n \tefx_evq_rxq_state_t\t\t*er_ev_qstate;\n \tefx_rx_prefix_layout_t\t\ter_prefix_layout;\n+\tuint16_t\t\t\ter_flags;\n };\n \n #define\tEFX_RXQ_MAGIC\t0x15022005\ndiff --git a/drivers/common/sfc_efx/base/efx_rx.c b/drivers/common/sfc_efx/base/efx_rx.c\nindex 61726a9f0b..55ffa82033 100644\n--- a/drivers/common/sfc_efx/base/efx_rx.c\n+++ b/drivers/common/sfc_efx/base/efx_rx.c\n@@ -925,6 +925,7 @@ efx_rx_qcreate_internal(\n \terp->er_index = index;\n \terp->er_mask = ndescs - 1;\n \terp->er_esmp = esmp;\n+\terp->er_flags = 0;\n \n \tif ((rc = erxop->erxo_qcreate(enp, index, label, type, type_data, esmp,\n \t ndescs, id, flags, eep, erp)) != 0)\n@@ -943,11 +944,27 @@ efx_rx_qcreate_internal(\n \t\t}\n \t}\n \n+\tif (flags & EFX_RXQ_FLAG_VLAN_STRIP) {\n+\t\tconst efx_rx_prefix_layout_t *erplp = &erp->er_prefix_layout;\n+\t\tconst efx_rx_prefix_field_info_t *vlan_tci_field;\n+\n+\t\tvlan_tci_field =\n+\t\t &erplp->erpl_fields[EFX_RX_PREFIX_FIELD_VLAN_STRIP_TCI];\n+\t\tif (vlan_tci_field->erpfi_width_bits == 0) {\n+\t\t\trc = ENOTSUP;\n+\t\t\tgoto fail6;\n+\t\t}\n+\n+\t\terp->er_flags |= EFX_RXQ_FLAG_VLAN_STRIP;\n+\t}\n+\n \tenp->en_rx_qcount++;\n \t*erpp = erp;\n \n \treturn (0);\n \n+fail6:\n+\tEFSYS_PROBE(fail6);\n fail5:\n \tEFSYS_PROBE(fail5);\n \ndiff --git a/drivers/common/sfc_efx/base/rhead_rx.c b/drivers/common/sfc_efx/base/rhead_rx.c\nindex d0ac5c02f8..3453227388 100644\n--- a/drivers/common/sfc_efx/base/rhead_rx.c\n+++ b/drivers/common/sfc_efx/base/rhead_rx.c\n@@ -640,6 +640,9 @@ rhead_rx_qcreate(\n \tif (flags & EFX_RXQ_FLAG_USER_FLAG)\n \t\tfields_mask |= 1U << EFX_RX_PREFIX_FIELD_USER_FLAG;\n \n+\tif (flags & EFX_RXQ_FLAG_VLAN_STRIP)\n+\t\tfields_mask |= 1U << EFX_RX_PREFIX_FIELD_VLAN_STRIP_TCI;\n+\n \t/*\n \t * LENGTH is required in EF100 host interface, as receive events\n \t * do not include the packet length.\n", "prefixes": [ "v2", "2/3" ] }{ "id": 127824, "url": "