get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 46177,
    "url": "http://patches.dpdk.org/api/patches/46177/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1538750823-26291-2-git-send-email-arybchenko@solarflare.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": "<1538750823-26291-2-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1538750823-26291-2-git-send-email-arybchenko@solarflare.com",
    "date": "2018-10-05T14:47:01",
    "name": "[1/3] net/sfc: put generalised TSO declarations in a header",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "28e7726020ab518c182f817cb292453c90fd9393",
    "submitter": {
        "id": 607,
        "url": "http://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1538750823-26291-2-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 1721,
            "url": "http://patches.dpdk.org/api/series/1721/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1721",
            "date": "2018-10-05T14:47:00",
            "name": "net/sfc: support more features in EF10 Tx",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1721/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/46177/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/46177/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 522BE1B2AB;\n\tFri,  5 Oct 2018 16:47:16 +0200 (CEST)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n\t[148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 1FA7C1B135\n\tfor <dev@dpdk.org>; Fri,  5 Oct 2018 16:47:12 +0200 (CEST)",
            "from webmail.solarflare.com (webmail.solarflare.com\n\t[12.187.104.26])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with\n\tESMTPS id BE7C3B40084; Fri,  5 Oct 2018 14:47:10 +0000 (UTC)",
            "from ocex03.SolarFlarecom.com (10.20.40.36) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id 15.0.1395.4; Fri, 5 Oct 2018 07:47:08 -0700",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id\n\t15.0.1395.4 via Frontend Transport; Fri, 5 Oct 2018 07:47:07 -0700",
            "from ukv-loginhost.uk.solarflarecom.com\n\t(ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n\tby opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tw95El6Fc018894; Fri, 5 Oct 2018 15:47:06 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\t5358D1626D2; Fri,  5 Oct 2018 15:47:06 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Igor Romanov <Igor.Romanov@oktetlabs.ru>",
        "Date": "Fri, 5 Oct 2018 15:47:01 +0100",
        "Message-ID": "<1538750823-26291-2-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1538750823-26291-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1538750823-26291-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-TM-AS-Product-Ver": "SMEX-12.5.0.1300-8.5.1010-24136.004",
        "X-TM-AS-Result": "No-9.287800-4.000000-10",
        "X-TMASE-MatchedRID": "6QDoz0YEpeCjqaJ4m4ncdU1Wvi92YKnOUAjrAJWsTe9ct5jgLX72gKB3\n\twfMR5ciTYK2MeoqGYrtM8qdoCvOVvj13WcdbGR6QAoNa2r+Edw2PmFSaq6xM+OeB5is8slOZJ7o\n\tvlkPXpS3AGzIFxUDKkuMX7wX+rbXfxkSgnHUeW2UMH4SsGvRsA7mnDa2zGPi080VZ5SgxdNDqCC\n\tiMStZu129ouIygpjDSO29ybNxer1TZDqKcMoCKOcLPXKYZysJR3b6LzJtd3JWbKItl61J/yZ+in\n\tTK0bC9eKrauXd3MZDVfr1DNZ8uC4Ok4ePTIKOfxcWh1mwgtSfWvkktlSkRgeeIUB9yTBqCYwL6S\n\txPpr1/I=",
        "X-TM-AS-User-Approved-Sender": "No",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--9.287800-4.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24136.004",
        "X-MDID": "1538750831-QjFWRbwOIwD9",
        "Subject": "[dpdk-dev] [PATCH 1/3] net/sfc: put generalised TSO declarations in\n\ta header",
        "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": "From: Igor Romanov <Igor.Romanov@oktetlabs.ru>\n\nMove general TSO declarations in a separate header to be able to use\nthem in other datapaths (not only EFX). Also update the function that\nprepares TSO header to make it useful in other datapaths.\n\nSigned-off-by: Igor Romanov <Igor.Romanov@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/sfc/sfc_tso.c | 25 ++++++++++++-------------\n drivers/net/sfc/sfc_tso.h | 17 +++++++++++++++++\n 2 files changed, 29 insertions(+), 13 deletions(-)\n create mode 100644 drivers/net/sfc/sfc_tso.h",
    "diff": "diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c\nindex effe98539..076a25d44 100644\n--- a/drivers/net/sfc/sfc_tso.c\n+++ b/drivers/net/sfc/sfc_tso.c\n@@ -14,12 +14,7 @@\n #include \"sfc_debug.h\"\n #include \"sfc_tx.h\"\n #include \"sfc_ev.h\"\n-\n-/** Standard TSO header length */\n-#define SFC_TSOH_STD_LEN        256\n-\n-/** The number of TSO option descriptors that precede the packet descriptors */\n-#define SFC_TSO_OPDESCS_IDX_SHIFT\t2\n+#include \"sfc_tso.h\"\n \n int\n sfc_efx_tso_alloc_tsoh_objs(struct sfc_efx_tx_sw_desc *sw_ring,\n@@ -57,13 +52,14 @@ sfc_efx_tso_free_tsoh_objs(struct sfc_efx_tx_sw_desc *sw_ring,\n \t}\n }\n \n-static void\n-sfc_efx_tso_prepare_header(struct sfc_efx_txq *txq, struct rte_mbuf **in_seg,\n-\t\t\t   size_t *in_off, unsigned int idx, size_t bytes_left)\n+unsigned int\n+sfc_tso_prepare_header(uint8_t *tsoh, size_t header_len,\n+\t\t       struct rte_mbuf **in_seg, size_t *in_off)\n {\n \tstruct rte_mbuf *m = *in_seg;\n \tsize_t bytes_to_copy = 0;\n-\tuint8_t *tsoh = txq->sw_ring[idx & txq->ptr_mask].tsoh;\n+\tsize_t bytes_left = header_len;\n+\tunsigned int segments_copied = 0;\n \n \tdo {\n \t\tbytes_to_copy = MIN(bytes_left, m->data_len);\n@@ -77,16 +73,20 @@ sfc_efx_tso_prepare_header(struct sfc_efx_txq *txq, struct rte_mbuf **in_seg,\n \t\tif (bytes_left > 0) {\n \t\t\tm = m->next;\n \t\t\tSFC_ASSERT(m != NULL);\n+\t\t\tsegments_copied++;\n \t\t}\n \t} while (bytes_left > 0);\n \n \tif (bytes_to_copy == m->data_len) {\n \t\t*in_seg = m->next;\n \t\t*in_off = 0;\n+\t\tsegments_copied++;\n \t} else {\n \t\t*in_seg = m;\n \t\t*in_off = bytes_to_copy;\n \t}\n+\n+\treturn segments_copied;\n }\n \n int\n@@ -105,7 +105,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,\n \tsize_t header_len = m->l2_len + m->l3_len + m->l4_len;\n \tconst efx_nic_cfg_t *encp = efx_nic_cfg_get(txq->evq->sa->nic);\n \n-\tidx += SFC_TSO_OPDESCS_IDX_SHIFT;\n+\tidx += SFC_TSO_OPT_DESCS_NUM;\n \n \t/* Packets which have too big headers should be discarded */\n \tif (unlikely(header_len > SFC_TSOH_STD_LEN))\n@@ -129,9 +129,8 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,\n \t * limitations on address boundaries crossing by DMA descriptor data.\n \t */\n \tif (m->data_len < header_len) {\n-\t\tsfc_efx_tso_prepare_header(txq, in_seg, in_off, idx,\n-\t\t\t\t\t   header_len);\n \t\ttsoh = txq->sw_ring[idx & txq->ptr_mask].tsoh;\n+\t\tsfc_tso_prepare_header(tsoh, header_len, in_seg, in_off);\n \n \t\theader_paddr = rte_malloc_virt2iova((void *)tsoh);\n \t} else {\ndiff --git a/drivers/net/sfc/sfc_tso.h b/drivers/net/sfc/sfc_tso.h\nnew file mode 100644\nindex 000000000..e8b558f50\n--- /dev/null\n+++ b/drivers/net/sfc/sfc_tso.h\n@@ -0,0 +1,17 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * Copyright (c) 2018 Solarflare Communications Inc.\n+ * All rights reserved.\n+ *\n+ * This software was jointly developed between OKTET Labs (under contract\n+ * for Solarflare) and Solarflare Communications, Inc.\n+ */\n+\n+/** Standard TSO header length */\n+#define SFC_TSOH_STD_LEN\t256\n+\n+/** The number of TSO option descriptors that precede the packet descriptors */\n+#define SFC_TSO_OPT_DESCS_NUM\t2\n+\n+unsigned int sfc_tso_prepare_header(uint8_t *tsoh, size_t header_len,\n+\t\t\t\t    struct rte_mbuf **in_seg, size_t *in_off);\n",
    "prefixes": [
        "1/3"
    ]
}