get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 35416,
    "url": "https://patches.dpdk.org/api/patches/35416/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180226150947.107179-7-xuemingl@mellanox.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": "<20180226150947.107179-7-xuemingl@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180226150947.107179-7-xuemingl@mellanox.com",
    "date": "2018-02-26T15:09:35",
    "name": "[dpdk-dev,06/18] net/mlx5: fix tunnel offloads cap query",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "604a7007933d427ea9edf8f4bba8ba9d95f211ae",
    "submitter": {
        "id": 814,
        "url": "https://patches.dpdk.org/api/people/814/?format=api",
        "name": "Xueming Li",
        "email": "xuemingl@mellanox.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180226150947.107179-7-xuemingl@mellanox.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/35416/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/35416/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 5DC654D3A;\n\tMon, 26 Feb 2018 16:10:28 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id B12834CC0\n\tfor <dev@dpdk.org>; Mon, 26 Feb 2018 16:10:25 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\txuemingl@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 26 Feb 2018 17:10:43 +0200",
            "from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx\n\t[10.12.205.180])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w1QFANsA021405;\n\tMon, 26 Feb 2018 17:10:24 +0200",
            "from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1])\n\tby dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id\n\tw1QFANY9107273; Mon, 26 Feb 2018 23:10:23 +0800",
            "(from xuemingl@localhost)\n\tby dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id\n\tw1QFANl3107272; Mon, 26 Feb 2018 23:10:23 +0800"
        ],
        "From": "Xueming Li <xuemingl@mellanox.com>",
        "To": "Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, \n\tThomas Monjalon <thomas@monjalon.net>,\n\tNelio Laranjeiro <nelio.laranjeiro@6wind.com>,\n\tAdrien Mazarguil <adrien.mazarguil@6wind.com>,\n\tShahaf Shuler <shahafs@mellanox.com>",
        "Cc": "dev@dpdk.org, stable@dpdk.org",
        "Date": "Mon, 26 Feb 2018 23:09:35 +0800",
        "Message-Id": "<20180226150947.107179-7-xuemingl@mellanox.com>",
        "X-Mailer": "git-send-email 2.13.3",
        "In-Reply-To": "<20180226150947.107179-1-xuemingl@mellanox.com>",
        "References": "<20180226150947.107179-1-xuemingl@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 06/18] net/mlx5: fix tunnel offloads cap query",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://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": "<https://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": "From: Shahaf Shuler <shahafs@mellanox.com>\n\nThe query for the tunnel stateless offloads is wrongly implemented\nbecause of:\n\n1. It was using the device id to query for the offloads.\n2. It was using a compilation flag for Verbs which no longer exits.\n\nThe main reason was lack of proper API from Verbs.\n\nFixing the query to use rdma-core API. The capability returned from\nrdma-core refer to both Tx and Rx sides.\nEventhough there is a separate cap for GRE and VXLAN, implementation merge\nthem into a single flag in order to simplify the checks on the data\npath.\n\nFixes: 43e9d9794cde (\"net/mlx5: support upstream rdma-core\")\nFixes: f5fde5205101 (\"net/mlx5: add hardware checksum offload for tunnel packets\")\nCc: stable@dpdk.org\n\nSigned-off-by: Shahaf Shuler <shahafs@mellanox.com>\n---\n drivers/net/mlx5/Makefile   |  6 +++---\n drivers/net/mlx5/mlx5.c     | 39 +++++++++++++++------------------------\n drivers/net/mlx5/mlx5.h     |  4 ++--\n drivers/net/mlx5/mlx5_rxq.c |  2 +-\n 4 files changed, 21 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile\nindex 3bc9736..afda411 100644\n--- a/drivers/net/mlx5/Makefile\n+++ b/drivers/net/mlx5/Makefile\n@@ -125,9 +125,9 @@ mlx5_autoconf.h.new: FORCE\n mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh\n \t$Q $(RM) -f -- '$@'\n \t$Q sh -- '$<' '$@' \\\n-\t\tHAVE_IBV_DEVICE_VXLAN_SUPPORT \\\n-\t\tinfiniband/verbs.h \\\n-\t\tenum IBV_DEVICE_VXLAN_SUPPORT \\\n+\t\tHAVE_IBV_DEVICE_TUNNEL_SUPPORT \\\n+\t\tinfiniband/mlx5dv.h \\\n+\t\tenum MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS \\\n \t\t$(AUTOCONF_OUTPUT)\n \t$Q sh -- '$<' '$@' \\\n \t\tHAVE_IBV_WQ_FLAG_RX_END_PADDING \\\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 6c0985b..61cb931 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -584,7 +584,7 @@\n \tunsigned int tunnel_en = 0;\n \tint idx;\n \tint i;\n-\tstruct mlx5dv_context attrs_out;\n+\tstruct mlx5dv_context attrs_out = {0};\n #ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT\n \tstruct ibv_counter_set_description cs_desc;\n #endif\n@@ -633,20 +633,6 @@\n \t\t       PCI_DEVICE_ID_MELLANOX_CONNECTX5VF) ||\n \t\t      (pci_dev->id.device_id ==\n \t\t       PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF));\n-\t\tswitch (pci_dev->id.device_id) {\n-\t\tcase PCI_DEVICE_ID_MELLANOX_CONNECTX4:\n-\t\t\ttunnel_en = 1;\n-\t\t\tbreak;\n-\t\tcase PCI_DEVICE_ID_MELLANOX_CONNECTX4LX:\n-\t\tcase PCI_DEVICE_ID_MELLANOX_CONNECTX5:\n-\t\tcase PCI_DEVICE_ID_MELLANOX_CONNECTX5VF:\n-\t\tcase PCI_DEVICE_ID_MELLANOX_CONNECTX5EX:\n-\t\tcase PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF:\n-\t\t\ttunnel_en = 1;\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tbreak;\n-\t\t}\n \t\tINFO(\"PCI information matches, using device \\\"%s\\\"\"\n \t\t     \" (SR-IOV: %s)\",\n \t\t     list[i]->name,\n@@ -675,6 +661,9 @@\n \t * Multi-packet send is supported by ConnectX-4 Lx PF as well\n \t * as all ConnectX-5 devices.\n \t */\n+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT\n+\tattrs_out.comp_mask |= MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS;\n+#endif\n \tmlx5_glue->dv_query_device(attr_ctx, &attrs_out);\n \tif (attrs_out.flags & MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED) {\n \t\tif (attrs_out.flags & MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW) {\n@@ -693,6 +682,17 @@\n \t\tcqe_comp = 0;\n \telse\n \t\tcqe_comp = 1;\n+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT\n+\tif (attrs_out.comp_mask & MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS) {\n+\t\ttunnel_en = ((attrs_out.tunnel_offloads_caps &\n+\t\t\t      MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN) &&\n+\t\t\t     (attrs_out.tunnel_offloads_caps &\n+\t\t\t      MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE));\n+\t}\n+\tDEBUG(\"Tunnel offloading is %ssupported\", tunnel_en ? \"\" : \"not \");\n+#else\n+\tWARN(\"Tunnel offloading disabled due to old OFED/rdma-core version\");\n+#endif\n \tif (mlx5_glue->query_device_ex(attr_ctx, NULL, &device_attr))\n \t\tgoto error;\n \tINFO(\"%u port(s) detected\", device_attr.orig_attr.phys_port_cnt);\n@@ -838,15 +838,6 @@\n \t\t\t\t    IBV_DEVICE_RAW_IP_CSUM);\n \t\tDEBUG(\"checksum offloading is %ssupported\",\n \t\t      (config.hw_csum ? \"\" : \"not \"));\n-\n-#ifdef HAVE_IBV_DEVICE_VXLAN_SUPPORT\n-\t\tconfig.hw_csum_l2tun =\n-\t\t\t\t!!(exp_device_attr.exp_device_cap_flags &\n-\t\t\t\t   IBV_DEVICE_VXLAN_SUPPORT);\n-#endif\n-\t\tDEBUG(\"Rx L2 tunnel checksum offloads are %ssupported\",\n-\t\t      (config.hw_csum_l2tun ? \"\" : \"not \"));\n-\n #ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT\n \t\tconfig.flow_counter_en = !!(device_attr.max_counter_sets);\n \t\tmlx5_glue->describe_counter_set(ctx, 0, &cs_desc);\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 965c19f..3e2d96a 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -75,13 +75,13 @@ struct mlx5_xstats_ctrl {\n  */\n struct mlx5_dev_config {\n \tunsigned int hw_csum:1; /* Checksum offload is supported. */\n-\tunsigned int hw_csum_l2tun:1; /* Same for L2 tunnels. */\n \tunsigned int hw_vlan_strip:1; /* VLAN stripping is supported. */\n \tunsigned int hw_fcs_strip:1; /* FCS stripping is supported. */\n \tunsigned int hw_padding:1; /* End alignment padding is supported. */\n \tunsigned int sriov:1; /* This is a VF or PF with VF devices. */\n \tunsigned int mps:2; /* Multi-packet send supported mode. */\n-\tunsigned int tunnel_en:1; /* Whether tunnel is supported. */\n+\tunsigned int tunnel_en:1;\n+\t/* Whether tunnel stateless offloads are supported. */\n \tunsigned int flow_counter_en:1; /* Whether flow counter is supported. */\n \tunsigned int cqe_comp:1; /* CQE compression is enabled. */\n \tunsigned int tso:1; /* Whether TSO is supported. */\ndiff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c\nindex ff58c49..238fa7e 100644\n--- a/drivers/net/mlx5/mlx5_rxq.c\n+++ b/drivers/net/mlx5/mlx5_rxq.c\n@@ -1006,7 +1006,7 @@ struct mlx5_rxq_ctrl*\n \t/* Toggle RX checksum offload if hardware supports it. */\n \ttmpl->rxq.csum = !!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM);\n \ttmpl->rxq.csum_l2tun = (!!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM) &&\n-\t\t\t\tpriv->config.hw_csum_l2tun);\n+\t\t\t\tpriv->config.tunnel_en);\n \ttmpl->rxq.hw_timestamp = !!(conf->offloads & DEV_RX_OFFLOAD_TIMESTAMP);\n \t/* Configure VLAN stripping. */\n \ttmpl->rxq.vlan_strip = !!(conf->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);\n",
    "prefixes": [
        "dpdk-dev",
        "06/18"
    ]
}