Show a patch.

GET /api/patches/41919/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 41919,
    "url": "http://patches.dpdk.org/api/patches/41919/?format=api",
    "web_url": "http://patches.dpdk.org/patch/41919/",
    "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"
    },
    "msgid": "<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://patches.dpdk.org/api/people/359/?format=api",
        "name": "John Daley",
        "email": "johndale@cisco.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/41919/mbox/",
    "series": [
        {
            "id": 308,
            "url": "http://patches.dpdk.org/api/series/308/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=308",
            "date": "2018-06-29T09:29:29",
            "name": "enic PMD fixes and performance improvements",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/308/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41919/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/41919/checks/",
    "tags": {},
    "headers": {
        "X-Mailer": "git-send-email 2.16.2",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "From": "John Daley <johndale@cisco.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "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-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Cc": "dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>",
        "To": "ferruh.yigit@intel.com",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<20180628031940.17397-1-johndale@cisco.com>\n\t<20180629092944.15576-1-johndale@cisco.com>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,285,1526342400\"; d=\"scan'208\";a=\"416855744\"",
        "List-Post": "<mailto:dev@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)"
        ],
        "Date": "Fri, 29 Jun 2018 02:29:35 -0700",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v2 06/15] net/enic: add devarg to specify ingress\n\tVLAN rewrite mode",
        "In-Reply-To": "<20180629092944.15576-1-johndale@cisco.com>",
        "Message-Id": "<20180629092944.15576-7-johndale@cisco.com>",
        "Precedence": "list",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Original-To": "patchwork@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"
    ]
}