get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7210,
    "url": "https://patches.dpdk.org/api/patches/7210/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1443426751-4906-4-git-send-email-wenzhuo.lu@intel.com/",
    "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": "<1443426751-4906-4-git-send-email-wenzhuo.lu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1443426751-4906-4-git-send-email-wenzhuo.lu@intel.com",
    "date": "2015-09-28T07:52:30",
    "name": "[dpdk-dev,3/4] ixgbe: VF RSS hash query and update",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "46e41fb31a69fee09fcbcaf87fd4e4d3f00425c6",
    "submitter": {
        "id": 258,
        "url": "https://patches.dpdk.org/api/people/258/?format=api",
        "name": "Wenzhuo Lu",
        "email": "wenzhuo.lu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1443426751-4906-4-git-send-email-wenzhuo.lu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7210/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7210/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 85D688D8A;\n\tMon, 28 Sep 2015 09:52:47 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id D12335A44\n\tfor <dev@dpdk.org>; Mon, 28 Sep 2015 09:52:44 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga101.fm.intel.com with ESMTP; 28 Sep 2015 00:52:44 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga002.fm.intel.com with ESMTP; 28 Sep 2015 00:52:43 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t8S7qfbi028609;\n\tMon, 28 Sep 2015 15:52:41 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t8S7qdrX004965; Mon, 28 Sep 2015 15:52:41 +0800",
            "(from wenzhuol@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t8S7qd9M004961; \n\tMon, 28 Sep 2015 15:52:39 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.17,602,1437462000\"; d=\"scan'208\";a=\"814316465\"",
        "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 28 Sep 2015 15:52:30 +0800",
        "Message-Id": "<1443426751-4906-4-git-send-email-wenzhuo.lu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1443426751-4906-1-git-send-email-wenzhuo.lu@intel.com>",
        "References": "<1443426751-4906-1-git-send-email-wenzhuo.lu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 3/4] ixgbe: VF RSS hash query and update",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch implements the VF RSS hash query and update function on 10G\nNICs. But the update function is only provided for x550. Because the\nother NICs don't have the separate registers for VF, we don't want to\nlet a VF NIC change the shared RSS hash registers. It may cause PF and\nother VF NICs' behavior change without being noticed.\n\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\n---\n drivers/net/ixgbe/ixgbe_ethdev.c |  2 +\n drivers/net/ixgbe/ixgbe_ethdev.h |  6 +++\n drivers/net/ixgbe/ixgbe_rxtx.c   | 95 ++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 103 insertions(+)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex a1ef26f..5e50ee6 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -497,6 +497,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = {\n \t.mac_addr_set         = ixgbevf_set_default_mac_addr,\n \t.get_reg_length       = ixgbevf_get_reg_length,\n \t.get_reg              = ixgbevf_get_regs,\n+\t.rss_hash_update      = ixgbevf_dev_rss_hash_update,\n+\t.rss_hash_conf_get    = ixgbevf_dev_rss_hash_conf_get,\n };\n \n /* store statistics names and its offset in stats structure */\ndiff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h\nindex c3d4f4f..30952b6 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.h\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.h\n@@ -377,6 +377,12 @@ int ixgbe_dev_rss_hash_update(struct rte_eth_dev *dev,\n int ixgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,\n \t\t\t\tstruct rte_eth_rss_conf *rss_conf);\n \n+int ixgbevf_dev_rss_hash_update(struct rte_eth_dev *dev,\n+\t\t\t\tstruct rte_eth_rss_conf *rss_conf);\n+\n+int ixgbevf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,\n+\t\t\t\t  struct rte_eth_rss_conf *rss_conf);\n+\n /*\n  * Flow director function prototypes\n  */\ndiff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c\nindex 4a2d24a..5b64ece 100644\n--- a/drivers/net/ixgbe/ixgbe_rxtx.c\n+++ b/drivers/net/ixgbe/ixgbe_rxtx.c\n@@ -2895,6 +2895,101 @@ ixgbevf_hw_rss_hash_set_x550(struct ixgbe_hw *hw,\n \tIXGBE_WRITE_REG(hw, IXGBE_VFMRQC, vfmrqc);\n }\n \n+int\n+ixgbevf_dev_rss_hash_update(struct rte_eth_dev *dev,\n+\t\t\t    struct rte_eth_rss_conf *rss_conf)\n+{\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tuint32_t vfmrqc;\n+\tuint64_t rss_hf;\n+\n+\tif (hw->mac.type != ixgbe_mac_X550_vf &&\n+\t\thw->mac.type != ixgbe_mac_X550EM_x_vf) {\n+\t\tPMD_DRV_LOG(ERR, \"RSS hash update is not supported on this \"\n+\t\t\t\"VF NIC.\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\t/*\n+\t * There's hardware limitation:\n+\t *     \"RSS enabling cannot be done dynamically while it must be\n+\t *      preceded by a software reset\"\n+\t * Before changing anything, first check that the update RSS operation\n+\t * does not attempt to disable RSS, if RSS was enabled at\n+\t * initialization time, or does not attempt to enable RSS, if RSS was\n+\t * disabled at initialization time.\n+\t */\n+\trss_hf = rss_conf->rss_hf & IXGBE_RSS_OFFLOAD_ALL;\n+\tvfmrqc = IXGBE_READ_REG(hw, IXGBE_VFMRQC);\n+\tif (!(vfmrqc & IXGBE_MRQC_RSSEN)) { /* RSS disabled */\n+\t\tif (rss_hf != 0) /* Enable RSS */\n+\t\t\treturn -(EINVAL);\n+\t\treturn 0; /* Nothing to do */\n+\t}\n+\t/* RSS enabled */\n+\tif (rss_hf == 0) /* Disable RSS */\n+\t\treturn -(EINVAL);\n+\tixgbevf_hw_rss_hash_set_x550(hw, rss_conf);\n+\treturn 0;\n+}\n+\n+int\n+ixgbevf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,\n+\t\t\t      struct rte_eth_rss_conf *rss_conf)\n+{\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tuint8_t *hash_key;\n+\tuint32_t vfmrqc;\n+\tuint32_t rss_key;\n+\tuint64_t rss_hf;\n+\tuint16_t i;\n+\n+\tif (hw->mac.type != ixgbe_mac_X550_vf &&\n+\t\thw->mac.type != ixgbe_mac_X550EM_x_vf) {\n+\t\treturn ixgbe_dev_rss_hash_conf_get(dev, rss_conf);\n+\t}\n+\n+\thash_key = rss_conf->rss_key;\n+\tif (hash_key != NULL) {\n+\t\t/* Return RSS hash key */\n+\t\tfor (i = 0; i < 10; i++) {\n+\t\t\trss_key = IXGBE_READ_REG_ARRAY(hw, IXGBE_VFRSSRK(0), i);\n+\t\t\thash_key[(i * 4)] = rss_key & 0x000000FF;\n+\t\t\thash_key[(i * 4) + 1] = (rss_key >> 8) & 0x000000FF;\n+\t\t\thash_key[(i * 4) + 2] = (rss_key >> 16) & 0x000000FF;\n+\t\t\thash_key[(i * 4) + 3] = (rss_key >> 24) & 0x000000FF;\n+\t\t}\n+\t}\n+\n+\t/* Get RSS functions configured in VFMRQC register */\n+\tvfmrqc = IXGBE_READ_REG(hw, IXGBE_VFMRQC);\n+\tif ((vfmrqc & IXGBE_MRQC_RSSEN) == 0) { /* RSS is disabled */\n+\t\trss_conf->rss_hf = 0;\n+\t\treturn 0;\n+\t}\n+\trss_hf = 0;\n+\tif (vfmrqc & IXGBE_MRQC_RSS_FIELD_IPV4)\n+\t\trss_hf |= ETH_RSS_IPV4;\n+\tif (vfmrqc & IXGBE_MRQC_RSS_FIELD_IPV4_TCP)\n+\t\trss_hf |= ETH_RSS_NONFRAG_IPV4_TCP;\n+\tif (vfmrqc & IXGBE_MRQC_RSS_FIELD_IPV6)\n+\t\trss_hf |= ETH_RSS_IPV6;\n+\tif (vfmrqc & IXGBE_MRQC_RSS_FIELD_IPV6_EX)\n+\t\trss_hf |= ETH_RSS_IPV6_EX;\n+\tif (vfmrqc & IXGBE_MRQC_RSS_FIELD_IPV6_TCP)\n+\t\trss_hf |= ETH_RSS_NONFRAG_IPV6_TCP;\n+\tif (vfmrqc & IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP)\n+\t\trss_hf |= ETH_RSS_IPV6_TCP_EX;\n+\tif (vfmrqc & IXGBE_MRQC_RSS_FIELD_IPV4_UDP)\n+\t\trss_hf |= ETH_RSS_NONFRAG_IPV4_UDP;\n+\tif (vfmrqc & IXGBE_MRQC_RSS_FIELD_IPV6_UDP)\n+\t\trss_hf |= ETH_RSS_NONFRAG_IPV6_UDP;\n+\tif (vfmrqc & IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP)\n+\t\trss_hf |= ETH_RSS_IPV6_UDP_EX;\n+\trss_conf->rss_hf = rss_hf;\n+\treturn 0;\n+}\n+\n static void\n ixgbevf_rss_configure_x550(struct rte_eth_dev *dev)\n {\n",
    "prefixes": [
        "dpdk-dev",
        "3/4"
    ]
}