get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 47669,
    "url": "http://patches.dpdk.org/api/patches/47669/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1541074741-41368-10-git-send-email-viacheslavo@mellanox.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1541074741-41368-10-git-send-email-viacheslavo@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1541074741-41368-10-git-send-email-viacheslavo@mellanox.com",
    "date": "2018-11-01T12:19:31",
    "name": "[v3,09/13] net/mlx5: e-switch VXLAN netlink routines update",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0b0cf5c2b648b92da457495361fca3d76ea4fa2c",
    "submitter": {
        "id": 1102,
        "url": "http://patches.dpdk.org/api/people/1102/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@mellanox.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1541074741-41368-10-git-send-email-viacheslavo@mellanox.com/mbox/",
    "series": [
        {
            "id": 2204,
            "url": "http://patches.dpdk.org/api/series/2204/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2204",
            "date": "2018-11-01T12:19:21",
            "name": "net/mlx5: e-switch VXLAN encap/decap hardware offload",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/2204/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/47669/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/47669/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 28F5B1B202;\n\tThu,  1 Nov 2018 13:19:41 +0100 (CET)",
            "from EUR03-AM5-obe.outbound.protection.outlook.com\n\t(mail-eopbgr30082.outbound.protection.outlook.com [40.107.3.82])\n\tby dpdk.org (Postfix) with ESMTP id 4BA771B160\n\tfor <dev@dpdk.org>; Thu,  1 Nov 2018 13:19:32 +0100 (CET)",
            "from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by\n\tAM4PR05MB1457.eurprd05.prod.outlook.com (10.164.79.27) with Microsoft\n\tSMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1273.20; Thu, 1 Nov 2018 12:19:31 +0000",
            "from AM4PR05MB3265.eurprd05.prod.outlook.com\n\t([fe80::544b:a68d:e6a5:ba6e]) by\n\tAM4PR05MB3265.eurprd05.prod.outlook.com\n\t([fe80::544b:a68d:e6a5:ba6e%2]) with mapi id 15.20.1273.030;\n\tThu, 1 Nov 2018 12:19:31 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n\ts=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=YR/DzuHbpjBZZgNRj5PjC5GUc6f/qV07aXMyo56gIuM=;\n\tb=ocoGihNY9pepxx4c4jssKlvCPJpHBafYfjnR3YoMjV8aYBZUMxgpf6AjctSLv+vTl9PhxCc1yIZkdDMZivO6hxUlrTPlW5GR61b2wVuUjQazCVipFHEtIujaE+JwnEf9Vd0pIMB3GKpd7dRpUiS4p4ZcMo3J9FixtLmsFfRqzyw=",
        "From": "Slava Ovsiienko <viacheslavo@mellanox.com>",
        "To": "Shahaf Shuler <shahafs@mellanox.com>",
        "CC": "\"dev@dpdk.org\" <dev@dpdk.org>, Yongseok Koh <yskoh@mellanox.com>, Slava\n\tOvsiienko <viacheslavo@mellanox.com>",
        "Thread-Topic": "[PATCH v3 09/13] net/mlx5: e-switch VXLAN netlink routines\n\tupdate",
        "Thread-Index": "AQHUcd0kQ9gGFhzyLUufqv7H3lbsqQ==",
        "Date": "Thu, 1 Nov 2018 12:19:31 +0000",
        "Message-ID": "<1541074741-41368-10-git-send-email-viacheslavo@mellanox.com>",
        "References": "<1539612815-47199-1-git-send-email-viacheslavo@mellanox.com>\n\t<1541074741-41368-1-git-send-email-viacheslavo@mellanox.com>",
        "In-Reply-To": "<1541074741-41368-1-git-send-email-viacheslavo@mellanox.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-clientproxiedby": "LO2P265CA0079.GBRP265.PROD.OUTLOOK.COM\n\t(2603:10a6:600:8::19) To AM4PR05MB3265.eurprd05.prod.outlook.com\n\t(2603:10a6:205:4::22)",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=viacheslavo@mellanox.com; ",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "x-originating-ip": "[37.142.13.130]",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-exchange-diagnostics": "1; AM4PR05MB1457;\n\t6:StEDUsr8mJkazExub3AKuhsGBfxIJK4kGIabIPMk9dMuJlnEGQ5zasfQ6LDEMHM8oLOiUYPW2rSfTWhaQ/NVsF9MZQOE/oR1ZwFk5IhqB9Gqwnn+dEfgNiGI0qx+MDQEk2wDtgAadmagPMhCc3u5LkilI/sI0tttxW8gS4eHEoI1xceifFsbVAz5xiru9w1Dgbu5VrGTbulImBCu1hfn6CHYotH+Yluyn+b9TavxuePplrlJXgQaTSoU4f5lWl4nbaVSnizw9q2/cK1BD14ZPmFV8jGs+H3IUdqfjqOphJhuXaNdehTgh2rt+6a2RFbTfEp8krLnQyRj9zLhwBmGUGkEh64w2LXtb55Amm9h+DxeYzUwpBdQNAfbwhfMD5gwjZsRGjwBJFSxQDIs+w5P6n9jp9WfC75yHqoLTlRMDhidxa5JUUQxh3wPvCqUbaD1fCiFIp/lo9f/KdJVg67DDg==;\n\t5:E3ORuxu6dZK/Ezc/vIZ9MlAHVhZc1+Wkn5jJstSUL2LS/JoKutRWStyOPpVYq+91RXJDhztSYNbem5W159cO2aQa02i/1eKmfO/zmhNkiggk1UoUkEeOLOSuRHSjSs3q5b66zwoGIX9CHuyovsDtX+F14qexXIJcxaAzZ9wSBOM=;\n\t7:kNjM3SIOUeaaxBJwmPJkA/68J9zW8B8A8MuU5tLA4ur/mikWGNM0k1yP3h5k+JhzvehhQcEpaJkerTDmM4dm14bAqMs69KfFFOnmGnb9tQyJeIhA0/fG1b4rVak6gxQ3jdPdbYLrRNXQzuPGpihaGw==",
        "x-ms-office365-filtering-correlation-id": "e208cec2-eb5d-4908-bbfb-08d63ff44682",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);\n\tSRVR:AM4PR05MB1457; ",
        "x-ms-traffictypediagnostic": "AM4PR05MB1457:",
        "x-microsoft-antispam-prvs": "<AM4PR05MB1457789C68A8780FDDBEAA36D2CE0@AM4PR05MB1457.eurprd05.prod.outlook.com>",
        "x-exchange-antispam-report-test": "UriScan:;",
        "x-ms-exchange-senderadcheck": "1",
        "x-exchange-antispam-report-cfa-test": "BCL:0; PCL:0;\n\tRULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095);\n\tSRVR:AM4PR05MB1457; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1457; ",
        "x-forefront-prvs": "0843C17679",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(979002)(376002)(396003)(39860400002)(346002)(136003)(366004)(199004)(189003)(11346002)(446003)(106356001)(476003)(105586002)(4326008)(97736004)(2616005)(478600001)(6636002)(5250100002)(99286004)(486006)(66066001)(6862004)(2900100001)(25786009)(15650500001)(37006003)(54906003)(5660300001)(316002)(8936002)(8676002)(81156014)(81166006)(68736007)(7736002)(305945005)(3846002)(6116002)(76176011)(2906002)(102836004)(26005)(186003)(386003)(6506007)(107886003)(14454004)(6486002)(52116002)(6512007)(53936002)(6436002)(36756003)(86362001)(71190400001)(71200400001)(14444005)(256004)(969003)(989001)(999001)(1009001)(1019001);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1457;\n\tH:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en;\n\tPTR:InfoNoRecords; A:1; MX:1; ",
        "received-spf": "None (protection.outlook.com: mellanox.com does not designate\n\tpermitted sender hosts)",
        "x-microsoft-antispam-message-info": "EJ4CpXktf+a/Lc2328tfva9kYWYwj7t61qrcmjOkHEZdILxXZhEQIdPZjW62U7bw/x9lHlI89rcl3+qnZQ1VwquB3E8Xk/zpQeT0m+zmkZZOyHRbWSpWSuBBZN2GOwjiz3OO+PZp1K2BvLULXBqsTCKZtKsJDZCjJf0RyB4ywIbh01ghHDJK2i0k4zJLPKeSFlAYTu0Yv0r6byHpfweRU+8nFT7uxIPxGz9iud1qXuYlx3GRWlA0//1frsZarYREOTan3st8oDk+jZVG5I84ATUvNKxHo6U3/cCujrl0BvuMxblXiMSDaQAHLvgpmtIDI0VG8qctFC7e4/IyuHqVE/XgPYQJZ+8z+azCORmXlHQ=",
        "spamdiagnosticoutput": "1:99",
        "spamdiagnosticmetadata": "NSPM",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "Mellanox.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "e208cec2-eb5d-4908-bbfb-08d63ff44682",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "01 Nov 2018 12:19:31.0796\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "a652971c-7d2e-4d9b-a6a4-d149256f461b",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM4PR05MB1457",
        "Subject": "[dpdk-dev] [PATCH v3 09/13] net/mlx5: e-switch VXLAN netlink\n\troutines update",
        "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://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@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>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This part of patchset updates Netlink exchange routine. Message\nsequence numbers became not random ones, the multipart reply messages\nare supported, not propagating errors to the following socket calls,\nNetlink replies buffer size is increased to MNL_SOCKET_BUFFER_SIZE\nand now is preallocated at context creation time instead of stack\nusage. This update is needed to support Netlink query operations.\n\nSuggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow_tcf.c | 83 +++++++++++++++++++++++++++++-----------\n 1 file changed, 61 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c\nindex c404a63..67a6ff3 100644\n--- a/drivers/net/mlx5/mlx5_flow_tcf.c\n+++ b/drivers/net/mlx5/mlx5_flow_tcf.c\n@@ -3678,37 +3678,76 @@ struct pedit_parser {\n /**\n  * Send Netlink message with acknowledgment.\n  *\n- * @param ctx\n+ * @param tcf\n  *   Flow context to use.\n  * @param nlh\n  *   Message to send. This function always raises the NLM_F_ACK flag before\n  *   sending.\n+ * @param[in] msglen\n+ *   Message length. Message buffer may contain multiple commands and\n+ *   nlmsg_len field not always corresponds to actual message length.\n+ *   If 0 specified the nlmsg_len field in header is used as message length.\n+ * @param[in] cb\n+ *   Callback handler for received message.\n+ * @param[in] arg\n+ *   Context pointer for callback handler.\n  *\n  * @return\n  *   0 on success, a negative errno value otherwise and rte_errno is set.\n  */\n static int\n-flow_tcf_nl_ack(struct mlx5_flow_tcf_context *ctx, struct nlmsghdr *nlh)\n+flow_tcf_nl_ack(struct mlx5_flow_tcf_context *tcf,\n+\t\tstruct nlmsghdr *nlh,\n+\t\tuint32_t msglen,\n+\t\tmnl_cb_t cb, void *arg)\n {\n-\talignas(struct nlmsghdr)\n-\tuint8_t ans[mnl_nlmsg_size(sizeof(struct nlmsgerr)) +\n-\t\t    nlh->nlmsg_len - sizeof(*nlh)];\n-\tuint32_t seq = ctx->seq++;\n-\tstruct mnl_socket *nl = ctx->nl;\n-\tint ret;\n-\n-\tnlh->nlmsg_flags |= NLM_F_ACK;\n+\tunsigned int portid = mnl_socket_get_portid(tcf->nl);\n+\tuint32_t seq = tcf->seq++;\n+\tint err, ret;\n+\n+\tassert(tcf->nl);\n+\tassert(tcf->buf);\n+\tif (!seq)\n+\t\t/* seq 0 is reserved for kernel event-driven notifications. */\n+\t\tseq = tcf->seq++;\n \tnlh->nlmsg_seq = seq;\n-\tret = mnl_socket_sendto(nl, nlh, nlh->nlmsg_len);\n-\tif (ret != -1)\n-\t\tret = mnl_socket_recvfrom(nl, ans, sizeof(ans));\n-\tif (ret != -1)\n-\t\tret = mnl_cb_run\n-\t\t\t(ans, ret, seq, mnl_socket_get_portid(nl), NULL, NULL);\n+\tif (!msglen) {\n+\t\tmsglen = nlh->nlmsg_len;\n+\t\tnlh->nlmsg_flags |= NLM_F_ACK;\n+\t}\n+\tret = mnl_socket_sendto(tcf->nl, nlh, msglen);\n+\terr = (ret <= 0) ? errno : 0;\n+\tnlh = (struct nlmsghdr *)(tcf->buf);\n+\t/*\n+\t * The following loop postpones non-fatal errors until multipart\n+\t * messages are complete.\n+\t */\n \tif (ret > 0)\n+\t\twhile (true) {\n+\t\t\tret = mnl_socket_recvfrom(tcf->nl, tcf->buf,\n+\t\t\t\t\t\t  tcf->buf_size);\n+\t\t\tif (ret < 0) {\n+\t\t\t\terr = errno;\n+\t\t\t\tif (err != ENOSPC)\n+\t\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tif (!err) {\n+\t\t\t\tret = mnl_cb_run(nlh, ret, seq, portid,\n+\t\t\t\t\t\t cb, arg);\n+\t\t\t\tif (ret < 0) {\n+\t\t\t\t\terr = errno;\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\t/* Will receive till end of multipart message */\n+\t\t\tif (!(nlh->nlmsg_flags & NLM_F_MULTI) ||\n+\t\t\t      nlh->nlmsg_type == NLMSG_DONE)\n+\t\t\t\tbreak;\n+\t\t}\n+\tif (!err)\n \t\treturn 0;\n-\trte_errno = errno;\n-\treturn -rte_errno;\n+\trte_errno = err;\n+\treturn -err;\n }\n \n /**\n@@ -3739,7 +3778,7 @@ struct pedit_parser {\n \tnlh = dev_flow->tcf.nlh;\n \tnlh->nlmsg_type = RTM_NEWTFILTER;\n \tnlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL;\n-\tif (!flow_tcf_nl_ack(ctx, nlh))\n+\tif (!flow_tcf_nl_ack(ctx, nlh, 0, NULL, NULL))\n \t\treturn 0;\n \treturn rte_flow_error_set(error, rte_errno,\n \t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n@@ -3778,7 +3817,7 @@ struct pedit_parser {\n \tnlh = dev_flow->tcf.nlh;\n \tnlh->nlmsg_type = RTM_DELTFILTER;\n \tnlh->nlmsg_flags = NLM_F_REQUEST;\n-\tflow_tcf_nl_ack(ctx, nlh);\n+\tflow_tcf_nl_ack(ctx, nlh, 0, NULL, NULL);\n }\n \n /**\n@@ -4311,7 +4350,7 @@ struct pedit_parser {\n \ttcm->tcm_handle = TC_H_MAKE(TC_H_INGRESS, 0);\n \ttcm->tcm_parent = TC_H_INGRESS;\n \t/* Ignore errors when qdisc is already absent. */\n-\tif (flow_tcf_nl_ack(ctx, nlh) &&\n+\tif (flow_tcf_nl_ack(ctx, nlh, 0, NULL, NULL) &&\n \t    rte_errno != EINVAL && rte_errno != ENOENT)\n \t\treturn rte_flow_error_set(error, rte_errno,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n@@ -4327,7 +4366,7 @@ struct pedit_parser {\n \ttcm->tcm_handle = TC_H_MAKE(TC_H_INGRESS, 0);\n \ttcm->tcm_parent = TC_H_INGRESS;\n \tmnl_attr_put_strz_check(nlh, sizeof(buf), TCA_KIND, \"ingress\");\n-\tif (flow_tcf_nl_ack(ctx, nlh))\n+\tif (flow_tcf_nl_ack(ctx, nlh, 0, NULL, NULL))\n \t\treturn rte_flow_error_set(error, rte_errno,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n \t\t\t\t\t  \"netlink: failed to create ingress\"\n",
    "prefixes": [
        "v3",
        "09/13"
    ]
}