get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7710,
    "url": "https://patches.dpdk.org/api/patches/7710/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1445000741-12799-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": "<1445000741-12799-4-git-send-email-wenzhuo.lu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1445000741-12799-4-git-send-email-wenzhuo.lu@intel.com",
    "date": "2015-10-16T13:05:40",
    "name": "[dpdk-dev,v2,3/4] ixgbe: VF RSS reta/hash query and update",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a251fcfe57c877aac4f5bf547b815bb25fdfdc4d",
    "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/1445000741-12799-4-git-send-email-wenzhuo.lu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7710/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7710/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 54DD78E9A;\n\tFri, 16 Oct 2015 15:06:12 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 704838E94\n\tfor <dev@dpdk.org>; Fri, 16 Oct 2015 15:06:08 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga101.fm.intel.com with ESMTP; 16 Oct 2015 06:05:55 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 16 Oct 2015 06:05:54 -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 t9GD5qtX026213;\n\tFri, 16 Oct 2015 21:05:52 +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 t9GD5nuw012855; Fri, 16 Oct 2015 21:05:51 +0800",
            "(from wenzhuol@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9GD5nAm012851; \n\tFri, 16 Oct 2015 21:05:49 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.17,689,1437462000\"; d=\"scan'208\";a=\"812571235\"",
        "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 16 Oct 2015 21:05:40 +0800",
        "Message-Id": "<1445000741-12799-4-git-send-email-wenzhuo.lu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1445000741-12799-1-git-send-email-wenzhuo.lu@intel.com>",
        "References": "<1443426751-4906-1-git-send-email-wenzhuo.lu@intel.com>\n\t<1445000741-12799-1-git-send-email-wenzhuo.lu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 3/4] ixgbe: VF RSS reta/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 reta/hash query and update function\non 10G NICs. But the update function is only provided for x550. Because\nthe other NICs don't have the separate registers for VF, we don't want\nto let a VF NIC change the shared RSS reta/hash registers. It may cause\nPF and other 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 | 23 +++++++++++++++++++++++\n drivers/net/ixgbe/ixgbe_ethdev.h |  2 ++\n drivers/net/ixgbe/ixgbe_rxtx.c   | 18 +++++++++++++++---\n 3 files changed, 40 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex e2fbcfc..f4d823e 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -497,6 +497,10 @@ 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.reta_update          = ixgbe_dev_rss_reta_update,\n+\t.reta_query           = ixgbe_dev_rss_reta_query,\n+\t.rss_hash_update      = ixgbe_dev_rss_hash_update,\n+\t.rss_hash_conf_get    = ixgbe_dev_rss_hash_conf_get,\n };\n \n /* store statistics names and its offset in stats structure */\n@@ -3207,6 +3211,13 @@ ixgbe_dev_rss_reta_update(struct rte_eth_dev *dev,\n \tuint32_t reta_reg;\n \n \tPMD_INIT_FUNC_TRACE();\n+\n+\tif (!ixgbe_rss_update_sp(hw->mac.type)) {\n+\t\tPMD_DRV_LOG(ERR, \"RSS reta update is not supported on this \"\n+\t\t\t\"NIC.\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n \tsp_reta_size = ixgbe_reta_size_get(hw->mac.type);\n \tif (reta_size != sp_reta_size) {\n \t\tPMD_DRV_LOG(ERR, \"The size of hash lookup table configured \"\n@@ -5534,6 +5545,18 @@ ixgbe_rssrk_reg_get(enum ixgbe_mac_type mac_type, uint8_t i) {\n \t}\n }\n \n+bool\n+ixgbe_rss_update_sp(enum ixgbe_mac_type mac_type) {\n+\tswitch (mac_type) {\n+\tcase ixgbe_mac_82599_vf:\n+\tcase ixgbe_mac_X540_vf:\n+\t\treturn 0;\n+\tdefault:\n+\t\treturn 1;\n+\t}\n+}\n+\n+\n static struct rte_driver rte_ixgbe_driver = {\n \t.type = PMD_PDEV,\n \t.init = rte_ixgbe_pmd_init,\ndiff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h\nindex 441a17f..bfc1c01 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.h\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.h\n@@ -385,6 +385,8 @@ uint32_t ixgbe_mrqc_reg_get(enum ixgbe_mac_type mac_type);\n \n uint32_t ixgbe_rssrk_reg_get(enum ixgbe_mac_type mac_type, uint8_t i);\n \n+bool ixgbe_rss_update_sp(enum ixgbe_mac_type mac_type);\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 0b8ca18..1158562 100644\n--- a/drivers/net/ixgbe/ixgbe_rxtx.c\n+++ b/drivers/net/ixgbe/ixgbe_rxtx.c\n@@ -2713,9 +2713,17 @@ ixgbe_dev_rss_hash_update(struct rte_eth_dev *dev,\n \tstruct ixgbe_hw *hw;\n \tuint32_t mrqc;\n \tuint64_t rss_hf;\n+\tuint32_t mrqc_reg;\n \n \thw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \n+\tif (!ixgbe_rss_update_sp(hw->mac.type)) {\n+\t\tPMD_DRV_LOG(ERR, \"RSS hash update is not supported on this \"\n+\t\t\t\"NIC.\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\tmrqc_reg = ixgbe_mrqc_reg_get(hw->mac.type);\n+\n \t/*\n \t * Excerpt from section 7.1.2.8 Receive-Side Scaling (RSS):\n \t *     \"RSS enabling cannot be done dynamically while it must be\n@@ -2726,7 +2734,7 @@ ixgbe_dev_rss_hash_update(struct rte_eth_dev *dev,\n \t * disabled at initialization time.\n \t */\n \trss_hf = rss_conf->rss_hf & IXGBE_RSS_OFFLOAD_ALL;\n-\tmrqc = IXGBE_READ_REG(hw, IXGBE_MRQC);\n+\tmrqc = IXGBE_READ_REG(hw, mrqc_reg);\n \tif (!(mrqc & IXGBE_MRQC_RSSEN)) { /* RSS disabled */\n \t\tif (rss_hf != 0) /* Enable RSS */\n \t\t\treturn -(EINVAL);\n@@ -2749,13 +2757,17 @@ ixgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,\n \tuint32_t rss_key;\n \tuint64_t rss_hf;\n \tuint16_t i;\n+\tuint32_t mrqc_reg;\n+\tuint32_t rssrk_reg;\n \n \thw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tmrqc_reg = ixgbe_mrqc_reg_get(hw->mac.type);\n+\trssrk_reg = ixgbe_rssrk_reg_get(hw->mac.type, 0);\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_RSSRK(0), i);\n+\t\t\trss_key = IXGBE_READ_REG_ARRAY(hw, rssrk_reg, 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@@ -2764,7 +2776,7 @@ ixgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,\n \t}\n \n \t/* Get RSS functions configured in MRQC register */\n-\tmrqc = IXGBE_READ_REG(hw, IXGBE_MRQC);\n+\tmrqc = IXGBE_READ_REG(hw, mrqc_reg);\n \tif ((mrqc & IXGBE_MRQC_RSSEN) == 0) { /* RSS is disabled */\n \t\trss_conf->rss_hf = 0;\n \t\treturn 0;\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "3/4"
    ]
}