Show a patch.

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

{
    "id": 42960,
    "url": "http://patches.dpdk.org/api/patches/42960/",
    "web_url": "http://patches.dpdk.org/patch/42960/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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": "<fe40d08854c3c17c265fec472cf906982dd1d0e8.1531387413.git.nelio.laranjeiro@6wind.com>",
    "date": "2018-07-12T09:30:59",
    "name": "[v4,13/21] net/mlx5: use a macro for the RSS key size",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f77207e62f4eb3c455e1281fa09fc866d2cddd3d",
    "submitter": {
        "id": 243,
        "url": "http://patches.dpdk.org/api/people/243/",
        "name": "Nélio Laranjeiro",
        "email": "nelio.laranjeiro@6wind.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/patch/42960/mbox/",
    "series": [
        {
            "id": 544,
            "url": "http://patches.dpdk.org/api/series/544/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=544",
            "date": "2018-07-12T09:30:46",
            "name": "net/mlx5: flow rework",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/544/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42960/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/42960/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "In-Reply-To": "<cover.1531387413.git.nelio.laranjeiro@6wind.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.18.0",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 208071B617;\n\tThu, 12 Jul 2018 11:31:58 +0200 (CEST)",
            "from mail-wm0-f66.google.com (mail-wm0-f66.google.com\n\t[74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 932B51B5A2\n\tfor <dev@dpdk.org>; Thu, 12 Jul 2018 11:31:36 +0200 (CEST)",
            "by mail-wm0-f66.google.com with SMTP id b188-v6so4994635wme.3\n\tfor <dev@dpdk.org>; Thu, 12 Jul 2018 02:31:36 -0700 (PDT)",
            "from laranjeiro-vm.dev.6wind.com\n\t(host.78.145.23.62.rev.coltfrance.com. [62.23.145.78])\n\tby smtp.gmail.com with ESMTPSA id\n\ts2-v6sm18717603wrn.75.2018.07.12.02.31.35\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 12 Jul 2018 02:31:35 -0700 (PDT)"
        ],
        "References": "<cover.1531293415.git.nelio.laranjeiro@6wind.com>\n\t<cover.1531387413.git.nelio.laranjeiro@6wind.com>",
        "X-Google-Smtp-Source": "AAOMgpdfdDzOscqrUK1ifh/OObkWcDjLeHj08WGdFtj4/xVxLsDWECzNiKBYiB0Qh8tiy0KKNU1FeQ==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=0LXeOfGq4kjioVT3AUhreD9gU/SW7w8Df7PhnvFOCEI=;\n\tb=h9te3ljniuORVRB0+u3R4OJbNYkLJ43pMPW8D9CwQWvZjYBxqfe2wjbw91orpupDQq\n\tx+yuc8Jr0h0FziYWAh8e5A27CqSJ1wri9Iqkc+e/Hk3AkAHIAT1n2NUj9MfFdqjPtlTy\n\t2Dx4tutKwVFV4vcUyvXj+qxDs/ku4JCXfIacQmv8x81hENygocevzi8o6oSGgIlBawfS\n\tlZJusU0MtkQ8NAlvbGHa51PLD4RGimg5l5tIEmwIC9qfe4F4zBblwRVUGCTq2t2p3pL1\n\t/PDvpsZfcOg0Zfe6RIgVbS4PTUvdzt3N/UHLwXb1bEiLGp7hHwJMzQYdgXWz08jA9Iyr\n\tOvhg==",
        "X-BeenThere": "dev@dpdk.org",
        "X-Received": "by 2002:a1c:3f45:: with SMTP id\n\tm66-v6mr804845wma.37.1531387896119; \n\tThu, 12 Jul 2018 02:31:36 -0700 (PDT)",
        "Message-Id": "<fe40d08854c3c17c265fec472cf906982dd1d0e8.1531387413.git.nelio.laranjeiro@6wind.com>",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=0LXeOfGq4kjioVT3AUhreD9gU/SW7w8Df7PhnvFOCEI=;\n\tb=PcHpstN6vWUhSr6vcnkI+f8uN9nrJALjnH7pXidZDK5As6JtI2Udb7CwAAuXRmVU+R\n\tZdiyVh1yS7kIg/ItwwjRB4cKaLXGhVfhW7MiyGd5s0HO20hXPhKN0bzEkdrHl8Td+wVx\n\tyXa3UDK5rQnLnmrgzPVOvJdRbc04YYhfszLNcaXZuGr1LYaKtQ8IWq8qQiZXzG04+ls7\n\tYxJ47kD7vZ+zHCiUN8UPOOw2XdA3nwmGCQzBEZN/kvWF/ugt8A3EP04A4iSGEfVBFpam\n\tPsT/qXtn/kHT5bHWEtWps1JQIbyRKa+3ijVCZdVFbzakqt7ieA0YLSIw49JJazaBSAmV\n\tNLng==",
        "Delivered-To": "patchwork@dpdk.org",
        "Precedence": "list",
        "From": "Nelio Laranjeiro <nelio.laranjeiro@6wind.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@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>",
        "To": "dev@dpdk.org,\n\tYongseok Koh <yskoh@mellanox.com>",
        "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>",
        "Date": "Thu, 12 Jul 2018 11:30:59 +0200",
        "X-Gm-Message-State": "AOUpUlFfjzC5ux7hymh6ahd3nH9aggQXj6x00B+odmWdWFw33DWg9YDw\n\t3Dk8wr/xdyFv38G0yOnic6tmlQek8g==",
        "Cc": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v4 13/21] net/mlx5: use a macro for the RSS key\n\tsize"
    },
    "content": "ConnectX 4-5 support only 40 bytes of RSS key, using a compiled size\nhash key is not necessary.\n\nSigned-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>\nAcked-by: Yongseok Koh <yskoh@mellanox.com>\n---\n drivers/net/mlx5/mlx5_ethdev.c | 14 +++++++-------\n drivers/net/mlx5/mlx5_flow.c   |  4 ++--\n drivers/net/mlx5/mlx5_prm.h    |  3 +++\n drivers/net/mlx5/mlx5_rss.c    |  7 ++++---\n drivers/net/mlx5/mlx5_rxq.c    | 12 +++++++-----\n drivers/net/mlx5/mlx5_rxtx.h   |  1 -\n 6 files changed, 23 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex 05f66f7b6..6e44d5ff0 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -377,15 +377,15 @@ mlx5_dev_configure(struct rte_eth_dev *dev)\n \n \tif (use_app_rss_key &&\n \t    (dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len !=\n-\t     rss_hash_default_key_len)) {\n-\t\tDRV_LOG(ERR, \"port %u RSS key len must be %zu Bytes long\",\n-\t\t\tdev->data->port_id, rss_hash_default_key_len);\n+\t     MLX5_RSS_HASH_KEY_LEN)) {\n+\t\tDRV_LOG(ERR, \"port %u RSS key len must be %s Bytes long\",\n+\t\t\tdev->data->port_id, RTE_STR(MLX5_RSS_HASH_KEY_LEN));\n \t\trte_errno = EINVAL;\n \t\treturn -rte_errno;\n \t}\n \tpriv->rss_conf.rss_key =\n \t\trte_realloc(priv->rss_conf.rss_key,\n-\t\t\t    rss_hash_default_key_len, 0);\n+\t\t\t    MLX5_RSS_HASH_KEY_LEN, 0);\n \tif (!priv->rss_conf.rss_key) {\n \t\tDRV_LOG(ERR, \"port %u cannot allocate RSS hash key memory (%u)\",\n \t\t\tdev->data->port_id, rxqs_n);\n@@ -396,8 +396,8 @@ mlx5_dev_configure(struct rte_eth_dev *dev)\n \t       use_app_rss_key ?\n \t       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :\n \t       rss_hash_default_key,\n-\t       rss_hash_default_key_len);\n-\tpriv->rss_conf.rss_key_len = rss_hash_default_key_len;\n+\t       MLX5_RSS_HASH_KEY_LEN);\n+\tpriv->rss_conf.rss_key_len = MLX5_RSS_HASH_KEY_LEN;\n \tpriv->rss_conf.rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;\n \tpriv->rxqs = (void *)dev->data->rx_queues;\n \tpriv->txqs = (void *)dev->data->tx_queues;\n@@ -515,7 +515,7 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)\n \t\tinfo->if_index = if_nametoindex(ifname);\n \tinfo->reta_size = priv->reta_idx_n ?\n \t\tpriv->reta_idx_n : config->ind_table_max_size;\n-\tinfo->hash_key_size = rss_hash_default_key_len;\n+\tinfo->hash_key_size = MLX5_RSS_HASH_KEY_LEN;\n \tinfo->speed_capa = priv->link_speed_capa;\n \tinfo->flow_type_rss_offloads = ~MLX5_RSS_HF_MASK;\n \tmlx5_set_default_params(dev, info);\ndiff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 1280db486..77483bd1f 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -1493,11 +1493,11 @@ mlx5_flow_apply(struct rte_eth_dev *dev, struct rte_flow *flow,\n \t\tstruct mlx5_hrxq *hrxq;\n \n \t\thrxq = mlx5_hrxq_get(dev, rss_hash_default_key,\n-\t\t\t\t     rss_hash_default_key_len, 0,\n+\t\t\t\t     MLX5_RSS_HASH_KEY_LEN, 0,\n \t\t\t\t     &flow->queue, 1, 0, 0);\n \t\tif (!hrxq)\n \t\t\thrxq = mlx5_hrxq_new(dev, rss_hash_default_key,\n-\t\t\t\t\t     rss_hash_default_key_len, 0,\n+\t\t\t\t\t     MLX5_RSS_HASH_KEY_LEN, 0,\n \t\t\t\t\t     &flow->queue, 1, 0, 0);\n \t\tif (!hrxq)\n \t\t\treturn rte_flow_error_set(error, rte_errno,\ndiff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h\nindex f9fae1e50..0870d32fd 100644\n--- a/drivers/net/mlx5/mlx5_prm.h\n+++ b/drivers/net/mlx5/mlx5_prm.h\n@@ -21,6 +21,9 @@\n #include <rte_vect.h>\n #include \"mlx5_autoconf.h\"\n \n+/* RSS hash key size. */\n+#define MLX5_RSS_HASH_KEY_LEN 40\n+\n /* Get CQE owner bit. */\n #define MLX5_CQE_OWNER(op_own) ((op_own) & MLX5_CQE_OWNER_MASK)\n \ndiff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c\nindex d69b4c09e..b95778a8c 100644\n--- a/drivers/net/mlx5/mlx5_rss.c\n+++ b/drivers/net/mlx5/mlx5_rss.c\n@@ -50,10 +50,11 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,\n \t\treturn -rte_errno;\n \t}\n \tif (rss_conf->rss_key && rss_conf->rss_key_len) {\n-\t\tif (rss_conf->rss_key_len != rss_hash_default_key_len) {\n+\t\tif (rss_conf->rss_key_len != MLX5_RSS_HASH_KEY_LEN) {\n \t\t\tDRV_LOG(ERR,\n-\t\t\t\t\"port %u RSS key len must be %zu Bytes long\",\n-\t\t\t\tdev->data->port_id, rss_hash_default_key_len);\n+\t\t\t\t\"port %u RSS key len must be %s Bytes long\",\n+\t\t\t\tdev->data->port_id,\n+\t\t\t\tRTE_STR(MLX5_RSS_HASH_KEY_LEN));\n \t\t\trte_errno = EINVAL;\n \t\t\treturn -rte_errno;\n \t\t}\ndiff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c\nindex d960daa43..d50b82c69 100644\n--- a/drivers/net/mlx5/mlx5_rxq.c\n+++ b/drivers/net/mlx5/mlx5_rxq.c\n@@ -52,7 +52,9 @@ uint8_t rss_hash_default_key[] = {\n };\n \n /* Length of the default RSS hash key. */\n-const size_t rss_hash_default_key_len = sizeof(rss_hash_default_key);\n+static_assert(MLX5_RSS_HASH_KEY_LEN ==\n+\t      (unsigned int)sizeof(rss_hash_default_key),\n+\t      \"wrong RSS default key size.\");\n \n /**\n  * Check whether Multi-Packet RQ can be enabled for the device.\n@@ -1771,7 +1773,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev,\n \t\treturn NULL;\n \t}\n \tif (!rss_key_len) {\n-\t\trss_key_len = rss_hash_default_key_len;\n+\t\trss_key_len = MLX5_RSS_HASH_KEY_LEN;\n \t\trss_key = rss_hash_default_key;\n \t}\n #ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT\n@@ -1791,7 +1793,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev,\n \t\t\t.rx_hash_conf = (struct ibv_rx_hash_conf){\n \t\t\t\t.rx_hash_function = IBV_RX_HASH_FUNC_TOEPLITZ,\n \t\t\t\t.rx_hash_key_len = rss_key_len ? rss_key_len :\n-\t\t\t\t\t\t   rss_hash_default_key_len,\n+\t\t\t\t\t\t   MLX5_RSS_HASH_KEY_LEN,\n \t\t\t\t.rx_hash_key = rss_key ?\n \t\t\t\t\t       (void *)(uintptr_t)rss_key :\n \t\t\t\t\t       rss_hash_default_key,\n@@ -1815,7 +1817,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev,\n \t\t\t.rx_hash_conf = (struct ibv_rx_hash_conf){\n \t\t\t\t.rx_hash_function = IBV_RX_HASH_FUNC_TOEPLITZ,\n \t\t\t\t.rx_hash_key_len = rss_key_len ? rss_key_len :\n-\t\t\t\t\t\t   rss_hash_default_key_len,\n+\t\t\t\t\t\t   MLX5_RSS_HASH_KEY_LEN,\n \t\t\t\t.rx_hash_key = rss_key ?\n \t\t\t\t\t       (void *)(uintptr_t)rss_key :\n \t\t\t\t\t       rss_hash_default_key,\n@@ -2138,7 +2140,7 @@ mlx5_hrxq_drop_new(struct rte_eth_dev *dev)\n \t\t\t.rx_hash_conf = (struct ibv_rx_hash_conf){\n \t\t\t\t.rx_hash_function =\n \t\t\t\t\tIBV_RX_HASH_FUNC_TOEPLITZ,\n-\t\t\t\t.rx_hash_key_len = rss_hash_default_key_len,\n+\t\t\t\t.rx_hash_key_len = MLX5_RSS_HASH_KEY_LEN,\n \t\t\t\t.rx_hash_key = rss_hash_default_key,\n \t\t\t\t.rx_hash_fields_mask = 0,\n \t\t\t\t},\ndiff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h\nindex 99b769d8a..59e374d8d 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.h\n+++ b/drivers/net/mlx5/mlx5_rxtx.h\n@@ -225,7 +225,6 @@ struct mlx5_txq_ctrl {\n /* mlx5_rxq.c */\n \n extern uint8_t rss_hash_default_key[];\n-extern const size_t rss_hash_default_key_len;\n \n int mlx5_check_mprq_support(struct rte_eth_dev *dev);\n int mlx5_rxq_mprq_enabled(struct mlx5_rxq_data *rxq);\n",
    "prefixes": [
        "v4",
        "13/21"
    ]
}