get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52086,
    "url": "http://patches.dpdk.org/api/patches/52086/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1554197324-32391-8-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": "<1554197324-32391-8-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1554197324-32391-8-git-send-email-arybchenko@solarflare.com",
    "date": "2019-04-02T09:28:39",
    "name": "[07/12] net/sfc: move TSO header checks from Tx burst to Tx prepare",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "1a20c733330526714512a767ed67bf6af645511f",
    "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/1554197324-32391-8-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 4050,
            "url": "http://patches.dpdk.org/api/series/4050/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4050",
            "date": "2019-04-02T09:28:33",
            "name": "net/sfc: add Tx prepare and encapsulated TSO",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4050/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52086/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52086/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 12D225F1A;\n\tTue,  2 Apr 2019 11:29:23 +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 180E44C8F\n\tfor <dev@dpdk.org>; Tue,  2 Apr 2019 11:29:05 +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-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with\n\tESMTPS id 5363010007E; Tue,  2 Apr 2019 09:28:58 +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; Tue, 2 Apr 2019 02:28:55 -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; Tue, 2 Apr 2019 02:28:55 -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\tx329Sr5u028269; Tue, 2 Apr 2019 10:28:53 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\tDBE23161610; Tue,  2 Apr 2019 10:28:53 +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": "Tue, 2 Apr 2019 10:28:39 +0100",
        "Message-ID": "<1554197324-32391-8-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1554197324-32391-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1554197324-32391-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-24526.005",
        "X-TM-AS-Result": "No-11.733300-4.000000-10",
        "X-TMASE-MatchedRID": "hBctg3n6uw8yEYUlBvqHoh+WEMjoO9WWTJDl9FKHbrkKogmGusPLb7hM\n\tKKwx1memJLJED3bHtl7TCjYGJ20tiX/6I2TJrPffdXu122+iJtrGYnoF/CTeZeVLofsFQv6xOUy\n\teBugoF8X0shYcMYIWz9e9LQYmNJh4oRBuyTyY0I2QOktEo73GFDfwU1OWX2US/NpLPdn/hpo6cg\n\twTFeDdf0v7BxPBPjToQr7W/2h+I70fE8yM4pjsDwtuKBGekqUpI/NGWt0UYPAd1/kjzLMiBuHEa\n\tii5fXWSAbEzkJrNVraaG2DktqYnJnzvDlMXZnfD",
        "X-TM-AS-User-Approved-Sender": "No",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--11.733300-4.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24526.005",
        "X-MDID": "1554197339-K5jL7idS81C7",
        "Subject": "[dpdk-dev] [PATCH 07/12] net/sfc: move TSO header checks from Tx\n\tburst to Tx prepare",
        "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\nTx offloads checks should be done in Tx prepare.\n\nSigned-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/sfc/sfc_dp_tx.h   | 12 +++++++++---\n drivers/net/sfc/sfc_ef10_tx.c |  9 ++++-----\n drivers/net/sfc/sfc_tso.c     |  9 ---------\n drivers/net/sfc/sfc_tx.c      | 20 ++++++++++----------\n 4 files changed, 23 insertions(+), 27 deletions(-)",
    "diff": "diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h\nindex 885094b67..c42d0d01f 100644\n--- a/drivers/net/sfc/sfc_dp_tx.h\n+++ b/drivers/net/sfc/sfc_dp_tx.h\n@@ -195,7 +195,8 @@ sfc_dp_find_tx_by_caps(struct sfc_dp_list *head, unsigned int avail_caps)\n const struct sfc_dp_tx *sfc_dp_tx_by_dp_txq(const struct sfc_dp_txq *dp_txq);\n \n static inline int\n-sfc_dp_tx_prepare_pkt(struct rte_mbuf *m)\n+sfc_dp_tx_prepare_pkt(struct rte_mbuf *m,\n+\t\t\t   uint32_t tso_tcp_header_offset_limit)\n {\n #ifdef RTE_LIBRTE_SFC_EFX_DEBUG\n \tint ret;\n@@ -209,10 +210,15 @@ sfc_dp_tx_prepare_pkt(struct rte_mbuf *m)\n \t\tSFC_ASSERT(ret < 0);\n \t\treturn -ret;\n \t}\n-#else\n-\tRTE_SET_USED(m);\n #endif\n \n+\tif (m->ol_flags & PKT_TX_TCP_SEG) {\n+\t\tunsigned int tcph_off = m->l2_len + m->l3_len;\n+\n+\t\tif (unlikely(tcph_off > tso_tcp_header_offset_limit))\n+\t\t\treturn EINVAL;\n+\t}\n+\n \treturn 0;\n }\n \ndiff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c\nindex b317997ca..3d6ba4292 100644\n--- a/drivers/net/sfc/sfc_ef10_tx.c\n+++ b/drivers/net/sfc/sfc_ef10_tx.c\n@@ -320,9 +320,10 @@ sfc_ef10_try_reap(struct sfc_ef10_txq * const txq, unsigned int added,\n }\n \n static uint16_t\n-sfc_ef10_prepare_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n+sfc_ef10_prepare_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t      uint16_t nb_pkts)\n {\n+\tstruct sfc_ef10_txq * const txq = sfc_ef10_txq_by_dp_txq(tx_queue);\n \tuint16_t i;\n \n \tfor (i = 0; i < nb_pkts; i++) {\n@@ -347,7 +348,8 @@ sfc_ef10_prepare_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t\t}\n \t\t}\n #endif\n-\t\tret = sfc_dp_tx_prepare_pkt(m);\n+\t\tret = sfc_dp_tx_prepare_pkt(m,\n+\t\t\t\ttxq->tso_tcp_header_offset_limit);\n \t\tif (unlikely(ret != 0)) {\n \t\t\trte_errno = ret;\n \t\t\tbreak;\n@@ -378,9 +380,6 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,\n \tstruct rte_mbuf *m_seg_to_free_up_to = first_m_seg;\n \tbool eop;\n \n-\tif (unlikely(tcph_off > txq->tso_tcp_header_offset_limit))\n-\t\treturn EMSGSIZE;\n-\n \t/*\n \t * Preliminary estimation of required DMA descriptors, including extra\n \t * descriptor for TSO header that is needed when the header is\ndiff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c\nindex 2c03c0837..f46c0e912 100644\n--- a/drivers/net/sfc/sfc_tso.c\n+++ b/drivers/net/sfc/sfc_tso.c\n@@ -103,18 +103,9 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,\n \tsize_t nh_off = m->l2_len; /* IP header offset */\n \tsize_t tcph_off = m->l2_len + m->l3_len; /* TCP header offset */\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_EF10_TSO_OPT_DESCS_NUM;\n \n-\t/*\n-\t * The TCP header must start at most 208 bytes into the frame.\n-\t * If it starts later than this then the NIC won't realise\n-\t * it's a TCP packet and TSO edits won't be applied\n-\t */\n-\tif (unlikely(tcph_off > encp->enc_tx_tso_tcp_header_offset_limit))\n-\t\treturn EMSGSIZE;\n-\n \theader_paddr = rte_pktmbuf_iova(m);\n \n \t/*\ndiff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c\nindex 16fd220bf..e128bff90 100644\n--- a/drivers/net/sfc/sfc_tx.c\n+++ b/drivers/net/sfc/sfc_tx.c\n@@ -698,15 +698,19 @@ sfc_efx_tx_maybe_insert_tag(struct sfc_efx_txq *txq, struct rte_mbuf *m,\n }\n \n static uint16_t\n-sfc_efx_prepare_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n+sfc_efx_prepare_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t     uint16_t nb_pkts)\n {\n+\tstruct sfc_dp_txq *dp_txq = tx_queue;\n+\tstruct sfc_efx_txq *txq = sfc_efx_txq_by_dp_txq(dp_txq);\n+\tconst efx_nic_cfg_t *encp = efx_nic_cfg_get(txq->evq->sa->nic);\n \tuint16_t i;\n \n \tfor (i = 0; i < nb_pkts; i++) {\n \t\tint ret;\n \n-\t\tret = sfc_dp_tx_prepare_pkt(tx_pkts[i]);\n+\t\tret = sfc_dp_tx_prepare_pkt(tx_pkts[i],\n+\t\t\t\tencp->enc_tx_tso_tcp_header_offset_limit);\n \t\tif (unlikely(ret != 0)) {\n \t\t\trte_errno = ret;\n \t\t\tbreak;\n@@ -776,14 +780,10 @@ sfc_efx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n \t\t\t */\n \t\t\tif (sfc_efx_tso_do(txq, added, &m_seg, &in_off, &pend,\n \t\t\t\t\t   &pkt_descs, &pkt_len) != 0) {\n-\t\t\t\t/* We may have reached this place for\n-\t\t\t\t * one of the following reasons:\n-\t\t\t\t *\n-\t\t\t\t * 1) Packet header linearization is needed\n-\t\t\t\t *    and the header length is greater\n-\t\t\t\t *    than SFC_TSOH_STD_LEN\n-\t\t\t\t * 2) TCP header starts at more then\n-\t\t\t\t *    208 bytes into the frame\n+\t\t\t\t/* We may have reached this place if packet\n+\t\t\t\t * header linearization is needed but the\n+\t\t\t\t * header length is greater than\n+\t\t\t\t * SFC_TSOH_STD_LEN\n \t\t\t\t *\n \t\t\t\t * We will deceive RTE saying that we have sent\n \t\t\t\t * the packet, but we will actually drop it.\n",
    "prefixes": [
        "07/12"
    ]
}