get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 26609,
    "url": "https://patches.dpdk.org/api/patches/26609/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/18d221e9fb75a05eedf5243da8dbe170b9c79cc2.1499384906.git.gaetan.rivet@6wind.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": "<18d221e9fb75a05eedf5243da8dbe170b9c79cc2.1499384906.git.gaetan.rivet@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/18d221e9fb75a05eedf5243da8dbe170b9c79cc2.1499384906.git.gaetan.rivet@6wind.com",
    "date": "2017-07-07T00:09:35",
    "name": "[dpdk-dev,v6,19/23] net/failsafe: support offload capabilities",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "188658276b46e2803429cc5e4c7365a77e1af1cd",
    "submitter": {
        "id": 269,
        "url": "https://patches.dpdk.org/api/people/269/?format=api",
        "name": "Gaëtan Rivet",
        "email": "gaetan.rivet@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/18d221e9fb75a05eedf5243da8dbe170b9c79cc2.1499384906.git.gaetan.rivet@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/26609/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/26609/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 0ED277CBC;\n\tFri,  7 Jul 2017 02:11:10 +0200 (CEST)",
            "from mail-wr0-f181.google.com (mail-wr0-f181.google.com\n\t[209.85.128.181]) by dpdk.org (Postfix) with ESMTP id 41C0A7CC9\n\tfor <dev@dpdk.org>; Fri,  7 Jul 2017 02:10:27 +0200 (CEST)",
            "by mail-wr0-f181.google.com with SMTP id 77so24333032wrb.1\n\tfor <dev@dpdk.org>; Thu, 06 Jul 2017 17:10:27 -0700 (PDT)",
            "from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\tf45sm2391166wrf.2.2017.07.06.17.10.25\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 06 Jul 2017 17:10:25 -0700 (PDT)"
        ],
        "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\t:in-reply-to:references;\n\tbh=NPCn59SnhmVWUxD5xbmVfZUcS+OK4XXg0o2WVTdcbpA=;\n\tb=hK8x9SWOelyDQ3ZsH18p8B4mUl7edUJFH3p1/zB0DNA/4mgGMysrlYCXTYrjldh+x1\n\t416tvLTW81pSiDYRkj4teKUbUZ+naB5ZudVRoS9wLA7vzBmGQfUJLe7t1Qxgzio2cSVP\n\tZv4hV7kOQVpg/7HmAJYWhvtG+0pP3uYAQZjfsJlTv1U3TC8UJ9OKdnukZbC0DZ1513yh\n\tnyHg5/30eKKptk+UORK6FDkZUMwGfQ/PHhcPy7WbZdQCBsqi3ravZ+HlO2PwS+vCv9pv\n\typtWv286VaDrv8mv5PaxckkThMpgwFKaVGijNWKCbYGG9B/1TftIT7A6744rhFVqQpEN\n\tz2ew==",
        "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:in-reply-to:references;\n\tbh=NPCn59SnhmVWUxD5xbmVfZUcS+OK4XXg0o2WVTdcbpA=;\n\tb=A9rrS3Ib1D2XvUOHdW1MSAjyLdRyFJCybxkeYfSIOCuSap/FiHFGlf8c+aICmpn5D0\n\tPPl1uJOTW5Jrv6lGqsSQtw1uabmMmcR3rYehquiuz//UeQyQkF2fClg0KKrOBNavzoOG\n\tmLwHy12NXpIu03KuOV0FnD7Q/zbRG/A5unMlMEodq5usmq3ttopteWwyN+Gwa4gh/KxE\n\trD1ZosTazEzky1d9zODACxcnaJWwcjx2Qw/B+HYO2ODd2lhQaXgzHLtSVLNvxAttbmNh\n\t9BpX/7eZOtzUVHZx1RWwnxLAKCS/iVJxvbGTgHCFb4PReA/AuqPum/FuJwXlyKyB7IYX\n\tVhGA==",
        "X-Gm-Message-State": "AIVw1137mEwrE6NvbHwFObOAh8NUe92Ms7YRu5gBQJqvrDkfK3OnBNbQ\n\tjSWQbtmu2dYKS0LY/z4=",
        "X-Received": "by 10.28.15.8 with SMTP id 8mr309959wmp.80.1499386226613;\n\tThu, 06 Jul 2017 17:10:26 -0700 (PDT)",
        "From": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "Date": "Fri,  7 Jul 2017 02:09:35 +0200",
        "Message-Id": "<18d221e9fb75a05eedf5243da8dbe170b9c79cc2.1499384906.git.gaetan.rivet@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": [
            "<cover.1499385281.git.gaetan.rivet@6wind.com>",
            "<cover.1499384906.git.gaetan.rivet@6wind.com>"
        ],
        "References": [
            "<cover.1496877105.git.gaetan.rivet@6wind.com>\n\t<cover.1499385281.git.gaetan.rivet@6wind.com>",
            "<cover.1499384906.git.gaetan.rivet@6wind.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v6 19/23] net/failsafe: support offload\n\tcapabilities",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>\nAcked-by: Olga Shern <olgas@mellanox.com>\n---\n doc/guides/nics/features/failsafe.ini |   6 ++\n drivers/net/failsafe/failsafe_ops.c   | 131 +++++++++++++++++++++++++++++++++-\n 2 files changed, 135 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/features/failsafe.ini b/doc/guides/nics/features/failsafe.ini\nindex 9167b59..257f579 100644\n--- a/doc/guides/nics/features/failsafe.ini\n+++ b/doc/guides/nics/features/failsafe.ini\n@@ -14,6 +14,12 @@ Unicast MAC filter   = Y\n Multicast MAC filter = Y\n VLAN filter          = Y\n Flow API             = Y\n+VLAN offload         = Y\n+QinQ offload         = Y\n+L3 checksum offload  = Y\n+L4 checksum offload  = Y\n+Inner L3 checksum    = Y\n+Inner L4 checksum    = Y\n Packet type parsing  = Y\n Basic stats          = Y\n Stats per queue      = Y\ndiff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c\nindex 4cb2e90..5fb0135 100644\n--- a/drivers/net/failsafe/failsafe_ops.c\n+++ b/drivers/net/failsafe/failsafe_ops.c\n@@ -63,22 +63,149 @@ static struct rte_eth_dev_info default_infos = {\n \t\t.nb_seg_max = UINT16_MAX,\n \t\t.nb_mtu_seg_max = UINT16_MAX,\n \t},\n-\t/* Set of understood capabilities */\n-\t.rx_offload_capa = 0x0,\n+\t/*\n+\t * Set of capabilities that can be verified upon\n+\t * configuring a sub-device.\n+\t */\n+\t.rx_offload_capa =\n+\t\tDEV_RX_OFFLOAD_VLAN_STRIP |\n+\t\tDEV_RX_OFFLOAD_QINQ_STRIP |\n+\t\tDEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t\tDEV_RX_OFFLOAD_UDP_CKSUM |\n+\t\tDEV_RX_OFFLOAD_TCP_CKSUM |\n+\t\tDEV_RX_OFFLOAD_TCP_LRO,\n \t.tx_offload_capa = 0x0,\n \t.flow_type_rss_offloads = 0x0,\n };\n \n+/**\n+ * Check whether a specific offloading capability\n+ * is supported by a sub_device.\n+ *\n+ * @return\n+ *   0: all requested capabilities are supported by the sub_device\n+ *   positive value: This flag at least is not supported by the sub_device\n+ */\n+static int\n+fs_port_offload_validate(struct rte_eth_dev *dev,\n+\t\t\t struct sub_device *sdev)\n+{\n+\tstruct rte_eth_dev_info infos = {0};\n+\tstruct rte_eth_conf *cf;\n+\tuint32_t cap;\n+\n+\tcf = &dev->data->dev_conf;\n+\tSUBOPS(sdev, dev_infos_get)(ETH(sdev), &infos);\n+\t/* RX capabilities */\n+\tcap = infos.rx_offload_capa;\n+\tif (cf->rxmode.hw_vlan_strip &&\n+\t    ((cap & DEV_RX_OFFLOAD_VLAN_STRIP) == 0)) {\n+\t\tWARN(\"VLAN stripping offload requested but not supported by sub_device %d\",\n+\t\t      SUB_ID(sdev));\n+\t\treturn DEV_RX_OFFLOAD_VLAN_STRIP;\n+\t}\n+\tif (cf->rxmode.hw_ip_checksum &&\n+\t    ((cap & (DEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t\t     DEV_RX_OFFLOAD_UDP_CKSUM |\n+\t\t     DEV_RX_OFFLOAD_TCP_CKSUM)) !=\n+\t     (DEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t      DEV_RX_OFFLOAD_UDP_CKSUM |\n+\t      DEV_RX_OFFLOAD_TCP_CKSUM))) {\n+\t\tWARN(\"IP checksum offload requested but not supported by sub_device %d\",\n+\t\t      SUB_ID(sdev));\n+\t\treturn DEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t\t       DEV_RX_OFFLOAD_UDP_CKSUM |\n+\t\t       DEV_RX_OFFLOAD_TCP_CKSUM;\n+\t}\n+\tif (cf->rxmode.enable_lro &&\n+\t    ((cap & DEV_RX_OFFLOAD_TCP_LRO) == 0)) {\n+\t\tWARN(\"TCP LRO offload requested but not supported by sub_device %d\",\n+\t\t      SUB_ID(sdev));\n+\t\treturn DEV_RX_OFFLOAD_TCP_LRO;\n+\t}\n+\tif (cf->rxmode.hw_vlan_extend &&\n+\t    ((cap & DEV_RX_OFFLOAD_QINQ_STRIP) == 0)) {\n+\t\tWARN(\"Stacked VLAN stripping offload requested but not supported by sub_device %d\",\n+\t\t      SUB_ID(sdev));\n+\t\treturn DEV_RX_OFFLOAD_QINQ_STRIP;\n+\t}\n+\t/* TX capabilities */\n+\t/* Nothing to do, no tx capa supported */\n+\treturn 0;\n+}\n+\n+/*\n+ * Disable the dev_conf flag related to an offload capability flag\n+ * within an ethdev configuration.\n+ */\n+static int\n+fs_port_disable_offload(struct rte_eth_conf *cf,\n+\t\t\tuint32_t ol_cap)\n+{\n+\tswitch (ol_cap) {\n+\tcase DEV_RX_OFFLOAD_VLAN_STRIP:\n+\t\tINFO(\"Disabling VLAN stripping offload\");\n+\t\tcf->rxmode.hw_vlan_strip = 0;\n+\t\tbreak;\n+\tcase DEV_RX_OFFLOAD_IPV4_CKSUM:\n+\tcase DEV_RX_OFFLOAD_UDP_CKSUM:\n+\tcase DEV_RX_OFFLOAD_TCP_CKSUM:\n+\tcase (DEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t      DEV_RX_OFFLOAD_UDP_CKSUM |\n+\t      DEV_RX_OFFLOAD_TCP_CKSUM):\n+\t\tINFO(\"Disabling IP checksum offload\");\n+\t\tcf->rxmode.hw_ip_checksum = 0;\n+\t\tbreak;\n+\tcase DEV_RX_OFFLOAD_TCP_LRO:\n+\t\tINFO(\"Disabling TCP LRO offload\");\n+\t\tcf->rxmode.enable_lro = 0;\n+\t\tbreak;\n+\tcase DEV_RX_OFFLOAD_QINQ_STRIP:\n+\t\tINFO(\"Disabling stacked VLAN stripping offload\");\n+\t\tcf->rxmode.hw_vlan_extend = 0;\n+\t\tbreak;\n+\tdefault:\n+\t\tDEBUG(\"Unable to disable offload capability: %\" PRIx32,\n+\t\t      ol_cap);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n static int\n fs_dev_configure(struct rte_eth_dev *dev)\n {\n \tstruct sub_device *sdev;\n \tuint8_t i;\n+\tint capa_flag;\n \tint ret;\n \n \tFOREACH_SUBDEV(sdev, i, dev) {\n \t\tif (sdev->state != DEV_PROBED)\n \t\t\tcontinue;\n+\t\tDEBUG(\"Checking capabilities for sub_device %d\", i);\n+\t\twhile ((capa_flag = fs_port_offload_validate(dev, sdev))) {\n+\t\t\t/*\n+\t\t\t * Refuse to change configuration if multiple devices\n+\t\t\t * are present and we already have configured at least\n+\t\t\t * some of them.\n+\t\t\t */\n+\t\t\tif (PRIV(dev)->state >= DEV_ACTIVE &&\n+\t\t\t    PRIV(dev)->subs_tail > 1) {\n+\t\t\t\tERROR(\"device already configured, cannot fix live configuration\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tret = fs_port_disable_offload(&dev->data->dev_conf,\n+\t\t\t\t\t\t      capa_flag);\n+\t\t\tif (ret) {\n+\t\t\t\tERROR(\"Unable to disable offload capability\");\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n+\t}\n+\tFOREACH_SUBDEV(sdev, i, dev) {\n+\t\tif (sdev->state != DEV_PROBED)\n+\t\t\tcontinue;\n \t\tDEBUG(\"Configuring sub-device %d\", i);\n \t\tret = rte_eth_dev_configure(PORT_ID(sdev),\n \t\t\t\t\tdev->data->nb_rx_queues,\n",
    "prefixes": [
        "dpdk-dev",
        "v6",
        "19/23"
    ]
}