Show a patch.

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

{
    "id": 41915,
    "url": "http://patches.dpdk.org/api/patches/41915/?format=api",
    "web_url": "http://patches.dpdk.org/patch/41915/",
    "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-3-johndale@cisco.com>",
    "date": "2018-06-29T09:29:31",
    "name": "[v2,02/15] net/enic: update the UDP RSS detection mechanism",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0830361258b4c79fb8ca566fc752f7fb473b57f0",
    "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/41915/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/41915/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/41915/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=9759; q=dns/txt; s=iport;\n\tt=1530264642; x=1531474242;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=fLZadybVczHXilsrCUPhfnRRTP2sKheZv0dBBnPPJzE=;\n\tb=lAf0ExyjQmdu/p1PGd33ghcky8SjS3diULOQddhvjP1k3rdNA7pN+tPz\n\tdMvltPpwpgdlV9jT4Vpfy3yJ3G4l4cOSCJ/XhBVX9tHJK0WGABTwV1KxR\n\tb6fvBHq0M0X4K7gMYYV8iqHzEI1zME5ufL51bSeqCRJejUT4/fv71hRxV Q=;",
        "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=\"406604308\"",
        "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 A0B1C1B027;\n\tFri, 29 Jun 2018 11:30:44 +0200 (CEST)",
            "from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74])\n\tby dpdk.org (Postfix) with ESMTP id A30015F2D\n\tfor <dev@dpdk.org>; Fri, 29 Jun 2018 11:30:42 +0200 (CEST)",
            "from alln-core-4.cisco.com ([173.36.13.137])\n\tby rcdn-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t29 Jun 2018 09:30:41 +0000",
            "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby alln-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id w5T9UfCE004230;\n\tFri, 29 Jun 2018 09:30:41 GMT",
            "by cisco.com (Postfix, from userid 392789)\n\tid 8091C20F2001; Fri, 29 Jun 2018 02:30:41 -0700 (PDT)"
        ],
        "Date": "Fri, 29 Jun 2018 02:29:31 -0700",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v2 02/15] net/enic: update the UDP RSS detection\n\tmechanism",
        "In-Reply-To": "<20180629092944.15576-1-johndale@cisco.com>",
        "Message-Id": "<20180629092944.15576-3-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\nThe UDP RSS interface has changed in the release firmware for 100G VIC\nadapters. The capability bit is now in NIC_CFG. Also the driver is\nsupposed to use CMD_NIC_CFG_CHK and check if RSS config is\nsuccessful. No more changes are expected with respect to UDP RSS API.\n\nFixes: 94c351895888 (\"net/enic: update UDP RSS controls\")\n\nSigned-off-by: Hyong Youb Kim <hyonkim@cisco.com>\nReviewed-by: John Daley <johndale@cisco.com>\n---\n drivers/net/enic/base/vnic_dev.c    | 16 ++++++++++++++++\n drivers/net/enic/base/vnic_dev.h    |  4 ++++\n drivers/net/enic/base/vnic_devcmd.h | 23 ++++++++++++++++++++++-\n drivers/net/enic/base/vnic_enet.h   |  5 ++---\n drivers/net/enic/base/vnic_nic.h    |  4 ++--\n drivers/net/enic/enic.h             |  2 ++\n drivers/net/enic/enic_main.c        |  9 ++++++---\n drivers/net/enic/enic_res.c         | 11 +++++++----\n 8 files changed, 61 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/net/enic/base/vnic_dev.c b/drivers/net/enic/base/vnic_dev.c\nindex 8483f76f3..16e8814a6 100644\n--- a/drivers/net/enic/base/vnic_dev.c\n+++ b/drivers/net/enic/base/vnic_dev.c\n@@ -528,6 +528,22 @@ int vnic_dev_capable_filter_mode(struct vnic_dev *vdev, u32 *mode,\n \treturn 0;\n }\n \n+void vnic_dev_capable_udp_rss_weak(struct vnic_dev *vdev, bool *cfg_chk,\n+\t\t\t\t   bool *weak)\n+{\n+\tu64 a0 = CMD_NIC_CFG, a1 = 0;\n+\tint wait = 1000;\n+\tint err;\n+\n+\t*cfg_chk = false;\n+\t*weak = false;\n+\terr = vnic_dev_cmd(vdev, CMD_CAPABILITY, &a0, &a1, wait);\n+\tif (err == 0 && a0 != 0 && a1 != 0) {\n+\t\t*cfg_chk = true;\n+\t\t*weak = !!((a1 >> 32) & CMD_NIC_CFG_CAPF_UDP_WEAK);\n+\t}\n+}\n+\n int vnic_dev_capable(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd)\n {\n \tu64 a0 = (u32)cmd, a1 = 0;\ndiff --git a/drivers/net/enic/base/vnic_dev.h b/drivers/net/enic/base/vnic_dev.h\nindex 3c9084304..270a47bd2 100644\n--- a/drivers/net/enic/base/vnic_dev.h\n+++ b/drivers/net/enic/base/vnic_dev.h\n@@ -6,6 +6,8 @@\n #ifndef _VNIC_DEV_H_\n #define _VNIC_DEV_H_\n \n+#include <stdbool.h>\n+\n #include <rte_pci.h>\n #include <rte_bus_pci.h>\n \n@@ -109,6 +111,8 @@ int vnic_dev_capable_adv_filters(struct vnic_dev *vdev);\n int vnic_dev_capable(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd);\n int vnic_dev_capable_filter_mode(struct vnic_dev *vdev, u32 *mode,\n \t\t\t\t u8 *filter_actions);\n+void vnic_dev_capable_udp_rss_weak(struct vnic_dev *vdev, bool *cfg_chk,\n+\t\t\t\t   bool *weak);\n int vnic_dev_asic_info(struct vnic_dev *vdev, u16 *asic_type, u16 *asic_rev);\n int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, size_t size,\n \tvoid *value);\ndiff --git a/drivers/net/enic/base/vnic_devcmd.h b/drivers/net/enic/base/vnic_devcmd.h\nindex 2865eb4d4..a22d8a76c 100644\n--- a/drivers/net/enic/base/vnic_devcmd.h\n+++ b/drivers/net/enic/base/vnic_devcmd.h\n@@ -138,9 +138,27 @@ enum vnic_devcmd_cmd {\n \t/* del VLAN id in (u16)a0 */\n \tCMD_VLAN_DEL            = _CMDCNW(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 15),\n \n-\t/* nic_cfg in (u32)a0 */\n+\t/*\n+\t * nic_cfg in (u32)a0\n+\t *\n+\t * Capability query:\n+\t * out: (u64) a0= 1 if a1 is valid\n+\t *      (u64) a1= (NIC_CFG bits supported) | (flags << 32)\n+\t *                              (flags are CMD_NIC_CFG_CAPF_xxx)\n+\t */\n \tCMD_NIC_CFG             = _CMDCNW(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 16),\n \n+\t/*\n+\t * nic_cfg_chk  (same as nic_cfg, but may return error)\n+\t * in (u32)a0\n+\t *\n+\t * Capability query:\n+\t * out: (u64) a0= 1 if a1 is valid\n+\t *      (u64) a1= (NIC_CFG bits supported) | (flags << 32)\n+\t *                              (flags are CMD_NIC_CFG_CAPF_xxx)\n+\t */\n+\tCMD_NIC_CFG_CHK         = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 16),\n+\n \t/* union vnic_rss_key in mem: (u64)a0=paddr, (u16)a1=len */\n \tCMD_RSS_KEY             = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 17),\n \n@@ -605,6 +623,9 @@ enum filter_cap_mode {\n /* flags for CMD_INIT */\n #define CMD_INITF_DEFAULT_MAC\t0x1\t/* init with default mac addr */\n \n+/* flags for CMD_NIC_CFG */\n+#define CMD_NIC_CFG_CAPF_UDP_WEAK\t(1ULL << 0) /* Bodega-style UDP RSS */\n+\n /* flags for CMD_PACKET_FILTER */\n #define CMD_PFILTER_DIRECTED\t\t0x01\n #define CMD_PFILTER_MULTICAST\t\t0x02\ndiff --git a/drivers/net/enic/base/vnic_enet.h b/drivers/net/enic/base/vnic_enet.h\nindex 49504a7da..901f3b46e 100644\n--- a/drivers/net/enic/base/vnic_enet.h\n+++ b/drivers/net/enic/base/vnic_enet.h\n@@ -53,9 +53,8 @@ struct vnic_enet_config {\n #define VENETF_NVGRE    0x20000 /* NVGRE offload */\n #define VENETF_GRPINTR  0x40000 /* group interrupt */\n #define VENETF_NICSWITCH        0x80000 /* NICSWITCH enabled */\n-#define VENETF_RSSHASH_UDP_WEAK 0x100000 /* VIC has Bodega-style UDP RSS */\n-#define VENETF_RSSHASH_UDPIPV4  0x200000 /* Hash on UDP + IPv4 fields */\n-#define VENETF_RSSHASH_UDPIPV6  0x400000 /* Hash on UDP + IPv6 fields */\n+#define VENETF_RSSHASH_UDPIPV4  0x100000 /* Hash on UDP + IPv4 fields */\n+#define VENETF_RSSHASH_UDPIPV6  0x200000 /* Hash on UDP + IPv6 fields */\n \n #define VENET_INTR_TYPE_MIN\t0\t/* Timer specs min interrupt spacing */\n #define VENET_INTR_TYPE_IDLE\t1\t/* Timer specs idle time before irq */\ndiff --git a/drivers/net/enic/base/vnic_nic.h b/drivers/net/enic/base/vnic_nic.h\nindex e318d0cb5..160408522 100644\n--- a/drivers/net/enic/base/vnic_nic.h\n+++ b/drivers/net/enic/base/vnic_nic.h\n@@ -32,8 +32,8 @@\n #define NIC_CFG_RSS_HASH_TYPE_TCP_IPV4\t\t(1 << 2)\n #define NIC_CFG_RSS_HASH_TYPE_IPV6\t\t(1 << 3)\n #define NIC_CFG_RSS_HASH_TYPE_TCP_IPV6\t\t(1 << 4)\n-#define NIC_CFG_RSS_HASH_TYPE_IPV6_EX\t\t(1 << 5)\n-#define NIC_CFG_RSS_HASH_TYPE_TCP_IPV6_EX\t(1 << 6)\n+#define NIC_CFG_RSS_HASH_TYPE_RSVD1\t\t(1 << 5)\n+#define NIC_CFG_RSS_HASH_TYPE_RSVD2\t\t(1 << 6)\n #define NIC_CFG_RSS_HASH_TYPE_UDP_IPV6\t\t(1 << 7)\n \n static inline void vnic_set_nic_cfg(u32 *nic_cfg,\ndiff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h\nindex ee83fe573..ea0a688d3 100644\n--- a/drivers/net/enic/enic.h\n+++ b/drivers/net/enic/enic.h\n@@ -123,6 +123,8 @@ struct enic {\n \tu8 filter_actions; /* HW supported actions */\n \tbool vxlan;\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 \n \tunsigned int flags;\n \tunsigned int priv_flags;\ndiff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c\nindex a25d303de..899603fa7 100644\n--- a/drivers/net/enic/enic_main.c\n+++ b/drivers/net/enic/enic_main.c\n@@ -1197,7 +1197,7 @@ int enic_set_rss_conf(struct enic *enic, struct rte_eth_rss_conf *rss_conf)\n \t\t\trss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV4;\n \t\tif (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) {\n \t\t\trss_hash_type |= NIC_CFG_RSS_HASH_TYPE_UDP_IPV4;\n-\t\t\tif (ENIC_SETTING(enic, RSSHASH_UDP_WEAK)) {\n+\t\t\tif (enic->udp_rss_weak) {\n \t\t\t\t/*\n \t\t\t\t * 'TCP' is not a typo. The \"weak\" version of\n \t\t\t\t * UDP RSS requires both the TCP and UDP bits\n@@ -1213,7 +1213,7 @@ int enic_set_rss_conf(struct enic *enic, struct rte_eth_rss_conf *rss_conf)\n \t\t\trss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV6;\n \t\tif (rss_hf & (ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_IPV6_UDP_EX)) {\n \t\t\trss_hash_type |= NIC_CFG_RSS_HASH_TYPE_UDP_IPV6;\n-\t\t\tif (ENIC_SETTING(enic, RSSHASH_UDP_WEAK))\n+\t\t\tif (enic->udp_rss_weak)\n \t\t\t\trss_hash_type |= NIC_CFG_RSS_HASH_TYPE_TCP_IPV6;\n \t\t}\n \t} else {\n@@ -1237,8 +1237,11 @@ int enic_set_rss_conf(struct enic *enic, struct rte_eth_rss_conf *rss_conf)\n \t\tenic->rss_hf = rss_hf;\n \t\tenic->rss_hash_type = rss_hash_type;\n \t\tenic->rss_enable = rss_enable;\n+\t} else {\n+\t\tdev_err(enic, \"Failed to update RSS configurations.\"\n+\t\t\t\" hash=0x%x\\n\", rss_hash_type);\n \t}\n-\treturn 0;\n+\treturn ret;\n }\n \n int enic_set_vlan_strip(struct enic *enic)\ndiff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c\nindex 6b404c3c0..d1113b2f1 100644\n--- a/drivers/net/enic/enic_res.c\n+++ b/drivers/net/enic/enic_res.c\n@@ -82,6 +82,8 @@ int enic_get_vnic_config(struct enic *enic)\n \t\t\t\"Error getting filter modes, %d\\n\", err);\n \t\treturn err;\n \t}\n+\tvnic_dev_capable_udp_rss_weak(enic->vdev, &enic->nic_cfg_chk,\n+\t\t\t\t      &enic->udp_rss_weak);\n \n \tdev_info(enic, \"Flow api filter mode: %s Actions: %s%s%s\\n\",\n \t\t((enic->flow_filter_mode == FILTER_DPDK_1) ? \"DPDK\" :\n@@ -124,7 +126,7 @@ int enic_get_vnic_config(struct enic *enic)\n \t\tENIC_SETTING(enic, RXCSUM) ? \"yes\" : \"no\",\n \t\tENIC_SETTING(enic, RSS) ?\n \t\t\t(ENIC_SETTING(enic, RSSHASH_UDPIPV4) ? \"+UDP\" :\n-\t\t\t((ENIC_SETTING(enic, RSSHASH_UDP_WEAK) ? \"+udp\" :\n+\t\t\t((enic->udp_rss_weak ? \"+udp\" :\n \t\t\t\"yes\"))) : \"no\",\n \t\tc->intr_mode == VENET_INTR_MODE_INTX ? \"INTx\" :\n \t\tc->intr_mode == VENET_INTR_MODE_MSI ? \"MSI\" :\n@@ -161,7 +163,7 @@ int enic_get_vnic_config(struct enic *enic)\n \tif (ENIC_SETTING(enic, RSSHASH_TCPIPV6))\n \t\tenic->flow_type_rss_offloads |= ETH_RSS_NONFRAG_IPV6_TCP |\n \t\t\tETH_RSS_IPV6_TCP_EX;\n-\tif (ENIC_SETTING(enic, RSSHASH_UDP_WEAK))\n+\tif (enic->udp_rss_weak)\n \t\tenic->flow_type_rss_offloads |=\n \t\t\tETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV6_UDP |\n \t\t\tETH_RSS_IPV6_UDP_EX;\n@@ -235,6 +237,7 @@ int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type,\n \tu8 rss_hash_bits, u8 rss_base_cpu, u8 rss_enable, u8 tso_ipid_split_en,\n \tu8 ig_vlan_strip_en)\n {\n+\tenum vnic_devcmd_cmd cmd;\n \tu64 a0, a1;\n \tu32 nic_cfg;\n \tint wait = 1000;\n@@ -245,8 +248,8 @@ int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type,\n \n \ta0 = nic_cfg;\n \ta1 = 0;\n-\n-\treturn vnic_dev_cmd(enic->vdev, CMD_NIC_CFG, &a0, &a1, wait);\n+\tcmd = enic->nic_cfg_chk ? CMD_NIC_CFG_CHK : CMD_NIC_CFG;\n+\treturn vnic_dev_cmd(enic->vdev, cmd, &a0, &a1, wait);\n }\n \n int enic_set_rss_key(struct enic *enic, dma_addr_t key_pa, u64 len)\n",
    "prefixes": [
        "v2",
        "02/15"
    ]
}