Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/41919/?format=api
http://patchwork.dpdk.org/api/patches/41919/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180629092944.15576-7-johndale@cisco.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20180629092944.15576-7-johndale@cisco.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180629092944.15576-7-johndale@cisco.com", "date": "2018-06-29T09:29:35", "name": "[v2,06/15] net/enic: add devarg to specify ingress VLAN rewrite mode", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "9603aa85594f64f62faa4169fdc54640e2b064ac", "submitter": { "id": 359, "url": "http://patchwork.dpdk.org/api/people/359/?format=api", "name": "John Daley (johndale)", "email": "johndale@cisco.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20180629092944.15576-7-johndale@cisco.com/mbox/", "series": [ { "id": 308, "url": "http://patchwork.dpdk.org/api/series/308/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=308", "date": "2018-06-29T09:29:29", "name": "enic PMD fixes and performance improvements", "version": 2, "mbox": "http://patchwork.dpdk.org/series/308/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/41919/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/41919/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 167341B45F;\n\tFri, 29 Jun 2018 11:32:06 +0200 (CEST)", "from rcdn-iport-4.cisco.com (rcdn-iport-4.cisco.com [173.37.86.75])\n\tby dpdk.org (Postfix) with ESMTP id AD6551B3AE\n\tfor <dev@dpdk.org>; Fri, 29 Jun 2018 11:32:04 +0200 (CEST)", "from rcdn-core-2.cisco.com ([173.37.93.153])\n\tby rcdn-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t29 Jun 2018 09:32:03 +0000", "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby rcdn-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id w5T9W3Mw028831;\n\tFri, 29 Jun 2018 09:32:03 GMT", "by cisco.com (Postfix, from userid 392789)\n\tid 93A5120F2001; Fri, 29 Jun 2018 02:32:03 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=6808; q=dns/txt; s=iport;\n\tt=1530264724; x=1531474324;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=PQs2r0OTJm4UUim2OPFZdnwsE3382i2PQgC8R1StF+0=;\n\tb=X2phlDUQqO20qWK+k7Ay9MlHReHFfBY4Dq6gm0U+bvHONBn2gwqtkGOR\n\tcy17+uREhSK8Z8y7oKfdToRXRk429zGJuNP0IJeLoalas0G9XkvdAtgjP\n\tVbT3qX1ZWsPoh9/pl3aKcp6aXGVdyQDJKvJEYK+pgOIsQtcXh/php4swk k=;", "X-IronPort-AV": "E=Sophos;i=\"5.51,285,1526342400\"; d=\"scan'208\";a=\"416855744\"", "From": "John Daley <johndale@cisco.com>", "To": "ferruh.yigit@intel.com", "Cc": "dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>", "Date": "Fri, 29 Jun 2018 02:29:35 -0700", "Message-Id": "<20180629092944.15576-7-johndale@cisco.com>", "X-Mailer": "git-send-email 2.16.2", "In-Reply-To": "<20180629092944.15576-1-johndale@cisco.com>", "References": "<20180628031940.17397-1-johndale@cisco.com>\n\t<20180629092944.15576-1-johndale@cisco.com>", "Subject": "[dpdk-dev] [PATCH v2 06/15] net/enic: add devarg to specify ingress\n\tVLAN rewrite mode", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Hyong Youb Kim <hyonkim@cisco.com>\n\nAdd a new devarg \"ig-vlan-rewrite\" to allow the user to set\nnon-default rewrite mode. The UCS VIC may add/remove/modify the VLAN\nheader of an ingress packet depending on the ingress VLAN rewrite\nmode.\n\nBy default, the driver sets the pass-through mode, which tells the NIC\n\"do not touch VLAN header and preserve it as is\". This mode is usually\nsufficient, but can complicate deployments for certain environments.\nFor example, OVS-DPDK in UCS blade environments may want to use \"untag\ndefault VLAN mode\", which removes the VLAN header from an ingress\npacket if it matches vNIC's default VLAN.\n\nSigned-off-by: Hyong Youb Kim <hyonkim@cisco.com>\nReviewed-by: John Daley <johndale@cisco.com>\n---\n\nv2: documented new devarg in enic driver documentation.\n\n doc/guides/nics/enic.rst | 15 +++++++++++---\n drivers/net/enic/enic.h | 1 +\n drivers/net/enic/enic_ethdev.c | 46 +++++++++++++++++++++++++++++++++++++++---\n drivers/net/enic/enic_main.c | 4 +++-\n 4 files changed, 59 insertions(+), 7 deletions(-)", "diff": "diff --git a/doc/guides/nics/enic.rst b/doc/guides/nics/enic.rst\nindex d650ba0f7..7764c8648 100644\n--- a/doc/guides/nics/enic.rst\n+++ b/doc/guides/nics/enic.rst\n@@ -351,9 +351,10 @@ Limitations\n In test setups where an Ethernet port of a Cisco adapter in TRUNK mode is\n connected point-to-point to another adapter port or connected though a router\n instead of a switch, all ingress packets will be VLAN tagged. Programs such\n- as l3fwd which do not account for VLAN tags in packets will misbehave. The\n- solution is to enable VLAN stripping on ingress. The following code fragment is\n- an example of how to accomplish this:\n+ as l3fwd may not account for VLAN tags in packets and may misbehave. One\n+ solution is to enable VLAN stripping on ingress so the VLAN tag is removed\n+ from the packet and put into the mbuf->vlan_tci field. Here is an example\n+ of how to accomplish this:\n \n .. code-block:: console\n \n@@ -361,6 +362,14 @@ Limitations\n vlan_offload |= ETH_VLAN_STRIP_OFFLOAD;\n rte_eth_dev_set_vlan_offload(port, vlan_offload);\n \n+Another alternative is modify the adapter's ingress VLAN rewrite mode so that\n+packets with the default VLAN tag are stripped by the adapter and presented to\n+DPDK as untagged packets. In this case mbuf->vlan_tci and the PKT_RX_VLAN and\n+PKT_RX_VLAN_STRIPPED mbuf flags would not be set. This mode is enabled with the\n+``devargs`` parameter ``ig-vlan-rewrite=1``. For example::\n+\n+ -w 12:00.0,ig-vlan-rewrite=1\n+\n - Limited flow director support on 1200 series and 1300 series Cisco VIC\n adapters with old firmware. Please see :ref:`enic-flow-director`.\n \ndiff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h\nindex ea0a688d3..f1895fe70 100644\n--- a/drivers/net/enic/enic.h\n+++ b/drivers/net/enic/enic.h\n@@ -125,6 +125,7 @@ struct enic {\n \tbool disable_overlay; /* devargs disable_overlay=1 */\n \tbool nic_cfg_chk; /* NIC_CFG_CHK available */\n \tbool udp_rss_weak; /* Bodega style UDP RSS */\n+\tuint8_t ig_vlan_rewrite_mode; /* devargs ig-vlan-rewrite */\n \n \tunsigned int flags;\n \tunsigned int priv_flags;\ndiff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c\nindex 697dd6508..111bdc82c 100644\n--- a/drivers/net/enic/enic_ethdev.c\n+++ b/drivers/net/enic/enic_ethdev.c\n@@ -41,6 +41,7 @@ static const struct rte_pci_id pci_id_enic_map[] = {\n };\n \n #define ENIC_DEVARG_DISABLE_OVERLAY \"disable-overlay\"\n+#define ENIC_DEVARG_IG_VLAN_REWRITE \"ig-vlan-rewrite\"\n \n RTE_INIT(enicpmd_init_log);\n static void\n@@ -858,23 +859,61 @@ static int enic_parse_disable_overlay(__rte_unused const char *key,\n \treturn 0;\n }\n \n+static int enic_parse_ig_vlan_rewrite(__rte_unused const char *key,\n+\t\t\t\t const char *value,\n+\t\t\t\t void *opaque)\n+{\n+\tstruct enic *enic;\n+\n+\tenic = (struct enic *)opaque;\n+\tif (strcmp(value, \"trunk\") == 0) {\n+\t\t/* Trunk mode: always tag */\n+\t\tenic->ig_vlan_rewrite_mode = IG_VLAN_REWRITE_MODE_DEFAULT_TRUNK;\n+\t} else if (strcmp(value, \"untag\") == 0) {\n+\t\t/* Untag default VLAN mode: untag if VLAN = default VLAN */\n+\t\tenic->ig_vlan_rewrite_mode =\n+\t\t\tIG_VLAN_REWRITE_MODE_UNTAG_DEFAULT_VLAN;\n+\t} else if (strcmp(value, \"priority\") == 0) {\n+\t\t/*\n+\t\t * Priority-tag default VLAN mode: priority tag (VLAN header\n+\t\t * with ID=0) if VLAN = default\n+\t\t */\n+\t\tenic->ig_vlan_rewrite_mode =\n+\t\t\tIG_VLAN_REWRITE_MODE_PRIORITY_TAG_DEFAULT_VLAN;\n+\t} else if (strcmp(value, \"pass\") == 0) {\n+\t\t/* Pass through mode: do not touch tags */\n+\t\tenic->ig_vlan_rewrite_mode = IG_VLAN_REWRITE_MODE_PASS_THRU;\n+\t} else {\n+\t\tdev_err(enic, \"Invalid value for \" ENIC_DEVARG_IG_VLAN_REWRITE\n+\t\t\t\": expected=trunk|untag|priority|pass given=%s\\n\",\n+\t\t\tvalue);\n+\t\treturn -EINVAL;\n+\t}\n+\treturn 0;\n+}\n+\n static int enic_check_devargs(struct rte_eth_dev *dev)\n {\n \tstatic const char *const valid_keys[] = {\n-\t\tENIC_DEVARG_DISABLE_OVERLAY, NULL};\n+\t\tENIC_DEVARG_DISABLE_OVERLAY,\n+\t\tENIC_DEVARG_IG_VLAN_REWRITE,\n+\t\tNULL};\n \tstruct enic *enic = pmd_priv(dev);\n \tstruct rte_kvargs *kvlist;\n \n \tENICPMD_FUNC_TRACE();\n \n \tenic->disable_overlay = false;\n+\tenic->ig_vlan_rewrite_mode = IG_VLAN_REWRITE_MODE_PASS_THRU;\n \tif (!dev->device->devargs)\n \t\treturn 0;\n \tkvlist = rte_kvargs_parse(dev->device->devargs->args, valid_keys);\n \tif (!kvlist)\n \t\treturn -EINVAL;\n \tif (rte_kvargs_process(kvlist, ENIC_DEVARG_DISABLE_OVERLAY,\n-\t\t\t enic_parse_disable_overlay, enic) < 0) {\n+\t\t\t enic_parse_disable_overlay, enic) < 0 ||\n+\t rte_kvargs_process(kvlist, ENIC_DEVARG_IG_VLAN_REWRITE,\n+\t\t\t enic_parse_ig_vlan_rewrite, enic) < 0) {\n \t\trte_kvargs_free(kvlist);\n \t\treturn -EINVAL;\n \t}\n@@ -939,4 +978,5 @@ RTE_PMD_REGISTER_PCI(net_enic, rte_enic_pmd);\n RTE_PMD_REGISTER_PCI_TABLE(net_enic, pci_id_enic_map);\n RTE_PMD_REGISTER_KMOD_DEP(net_enic, \"* igb_uio | uio_pci_generic | vfio-pci\");\n RTE_PMD_REGISTER_PARAM_STRING(net_enic,\n-\t\t\t ENIC_DEVARG_DISABLE_OVERLAY \"=<0|1> \");\n+\tENIC_DEVARG_DISABLE_OVERLAY \"=0|1 \"\n+\tENIC_DEVARG_IG_VLAN_REWRITE \"=trunk|untag|priority|pass\");\ndiff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c\nindex 2cd85168d..24de38d5e 100644\n--- a/drivers/net/enic/enic_main.c\n+++ b/drivers/net/enic/enic_main.c\n@@ -1637,8 +1637,10 @@ int enic_probe(struct enic *enic)\n \t}\n \n \t/* Set ingress vlan rewrite mode before vnic initialization */\n+\tdev_debug(enic, \"Set ig_vlan_rewrite_mode=%u\\n\",\n+\t\t enic->ig_vlan_rewrite_mode);\n \terr = vnic_dev_set_ig_vlan_rewrite_mode(enic->vdev,\n-\t\tIG_VLAN_REWRITE_MODE_PASS_THRU);\n+\t\tenic->ig_vlan_rewrite_mode);\n \tif (err) {\n \t\tdev_err(enic,\n \t\t\t\"Failed to set ingress vlan rewrite mode, aborting.\\n\");\n", "prefixes": [ "v2", "06/15" ] }{ "id": 41919, "url": "