get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1251,
    "url": "https://patches.dpdk.org/api/patches/1251/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415635166-1364-8-git-send-email-olivier.matz@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": "<1415635166-1364-8-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415635166-1364-8-git-send-email-olivier.matz@6wind.com",
    "date": "2014-11-10T15:59:21",
    "name": "[dpdk-dev,07/12] mbuf: generic support for TCP segmentation offload",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e711566736e59c3de4c30c2c54d2ab832141f6b9",
    "submitter": {
        "id": 8,
        "url": "https://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415635166-1364-8-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1251/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1251/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 D3E1F7F68;\n\tMon, 10 Nov 2014 16:58:23 +0100 (CET)",
            "from mail-wg0-f45.google.com (mail-wg0-f45.google.com\n\t[74.125.82.45]) by dpdk.org (Postfix) with ESMTP id A46107F65\n\tfor <dev@dpdk.org>; Mon, 10 Nov 2014 16:58:21 +0100 (CET)",
            "by mail-wg0-f45.google.com with SMTP id x12so9265457wgg.32\n\tfor <dev@dpdk.org>; Mon, 10 Nov 2014 08:08:07 -0800 (PST)",
            "from glumotte.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net.\n\t[82.239.227.177]) by mx.google.com with ESMTPSA id\n\tll2sm10966561wjb.11.2014.11.10.07.59.55 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 10 Nov 2014 07:59:55 -0800 (PST)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=M0GISSKm8jA0/uiPbi90kU4kpPnKMbU7viYeFyKKkI4=;\n\tb=mvzrcWbU8rEc+DRSomrVbTZ/W0t+Y053W6I1x6mS21xTtjKPGVXjqfxZC5zLvEbc2D\n\tg6DE3BmBeHN/potqzgAm/Wk5aYphavF6Bf9jQDFD9iN30cHSWqsc8N1Qvj/CAC+GP6Aw\n\t23ORyPjEkOlqAEHYDHl/wtAGyqutvHjU4VYEaIhGd2qnMAo5JlyscUC4PZMlrBHYBjwn\n\tK7vMft7EalzON/7aS0SvjpirCVg31vkt5ZF9OPewPCU0ecwAh5XTlrSaPOUoe6yxNBjQ\n\t99c7LW5IYlBUG2KyweEUY69GJuNDsJb6ilfIMeRoIozFEPA8I09K9qGh2utPKdTvfdHH\n\tTGtw==",
        "X-Gm-Message-State": "ALoCoQnR6a8ZmBOG8H+i3dSW54Jl47iPNtfcXE8i6SW5lskKJ7MNZhYSk17WZq15tiP5n6NU7uqG",
        "X-Received": "by 10.180.85.6 with SMTP id d6mr32082303wiz.82.1415635196243;\n\tMon, 10 Nov 2014 07:59:56 -0800 (PST)",
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 10 Nov 2014 16:59:21 +0100",
        "Message-Id": "<1415635166-1364-8-git-send-email-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "In-Reply-To": "<1415635166-1364-1-git-send-email-olivier.matz@6wind.com>",
        "References": "<1415635166-1364-1-git-send-email-olivier.matz@6wind.com>",
        "Cc": "jigsaw@gmail.com",
        "Subject": "[dpdk-dev] [PATCH 07/12] mbuf: generic support for TCP segmentation\n\toffload",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "Some of the NICs supported by DPDK have a possibility to accelerate TCP\ntraffic by using segmentation offload. The application prepares a packet\nwith valid TCP header with size up to 64K and deleguates the\nsegmentation to the NIC.\n\nImplement the generic part of TCP segmentation offload in rte_mbuf. It\nintroduces 2 new fields in rte_mbuf: l4_len (length of L4 header in bytes)\nand tso_segsz (MSS of packets).\n\nTo delegate the TCP segmentation to the hardware, the user has to:\n\n- set the PKT_TX_TCP_SEG flag in mbuf->ol_flags (this flag implies\n  PKT_TX_TCP_CKSUM)\n- set PKT_TX_IP_CKSUM if it's IPv4, and set the IP checksum to 0 in\n  the packet\n- fill the mbuf offload information: l2_len, l3_len, l4_len, tso_segsz\n- calculate the pseudo header checksum and set it in the TCP header,\n  as required when doing hardware TCP checksum offload\n\nThe API is inspired from ixgbe hardware (the next commit adds the\nsupport for ixgbe), but it seems generic enough to be used for other\nhw/drivers in the future.\n\nThis commit also reworks the way l2_len and l3_len are used in igb\nand ixgbe drivers as the l2_l3_len is not available anymore in mbuf.\n\nSigned-off-by: Mirek Walukiewicz <miroslaw.walukiewicz@intel.com>\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n app/test-pmd/testpmd.c            |  3 ++-\n examples/ipv4_multicast/main.c    |  3 ++-\n lib/librte_mbuf/rte_mbuf.h        | 44 +++++++++++++++++++++++----------------\n lib/librte_pmd_e1000/igb_rxtx.c   | 11 +++++++++-\n lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 11 +++++++++-\n 5 files changed, 50 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 12adafa..a831e31 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -408,7 +408,8 @@ testpmd_mbuf_ctor(struct rte_mempool *mp,\n \tmb->ol_flags     = 0;\n \tmb->data_off     = RTE_PKTMBUF_HEADROOM;\n \tmb->nb_segs      = 1;\n-\tmb->l2_l3_len       = 0;\n+\tmb->l2_len       = 0;\n+\tmb->l3_len       = 0;\n \tmb->vlan_tci     = 0;\n \tmb->hash.rss     = 0;\n }\ndiff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c\nindex de5e6be..a31d43d 100644\n--- a/examples/ipv4_multicast/main.c\n+++ b/examples/ipv4_multicast/main.c\n@@ -302,7 +302,8 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)\n \t/* copy metadata from source packet*/\n \thdr->port = pkt->port;\n \thdr->vlan_tci = pkt->vlan_tci;\n-\thdr->l2_l3_len = pkt->l2_l3_len;\n+\thdr->l2_len = pkt->l2_len;\n+\thdr->l3_len = pkt->l3_len;\n \thdr->hash = pkt->hash;\n \n \thdr->ol_flags = pkt->ol_flags;\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\nindex bcd8996..f76b768 100644\n--- a/lib/librte_mbuf/rte_mbuf.h\n+++ b/lib/librte_mbuf/rte_mbuf.h\n@@ -126,6 +126,19 @@ extern \"C\" {\n \n #define PKT_TX_VXLAN_CKSUM   (1ULL << 50) /**< TX checksum of VXLAN computed by NIC */\n \n+/**\n+ * TCP segmentation offload. To enable this offload feature for a\n+ * packet to be transmitted on hardware supporting TSO:\n+ *  - set the PKT_TX_TCP_SEG flag in mbuf->ol_flags (this flag implies\n+ *    PKT_TX_TCP_CKSUM)\n+ *  - if it's IPv4, set the PKT_TX_IP_CKSUM flag and write the IP checksum\n+ *    to 0 in the packet\n+ *  - fill the mbuf offload information: l2_len, l3_len, l4_len, tso_segsz\n+ *  - calculate the pseudo header checksum and set it in the TCP header,\n+ *    as required when doing hardware TCP checksum offload\n+ */\n+#define PKT_TX_TCP_SEG       (1ULL << 49)\n+\n /* Use final bit of flags to indicate a control mbuf */\n #define CTRL_MBUF_FLAG       (1ULL << 63) /**< Mbuf contains control data */\n \n@@ -185,6 +198,7 @@ static inline const char *rte_get_tx_ol_flag_name(uint64_t mask)\n \tcase PKT_TX_UDP_CKSUM: return \"PKT_TX_UDP_CKSUM\";\n \tcase PKT_TX_IEEE1588_TMST: return \"PKT_TX_IEEE1588_TMST\";\n \tcase PKT_TX_VXLAN_CKSUM: return \"PKT_TX_VXLAN_CKSUM\";\n+\tcase PKT_TX_TCP_SEG: return \"PKT_TX_TCP_SEG\";\n \tdefault: return NULL;\n \t}\n }\n@@ -264,22 +278,18 @@ struct rte_mbuf {\n \n \t/* fields to support TX offloads */\n \tunion {\n-\t\tuint16_t l2_l3_len; /**< combined l2/l3 lengths as single var */\n+\t\tuint64_t tx_offload;       /**< combined for easy fetch */\n \t\tstruct {\n-\t\t\tuint16_t l3_len:9;      /**< L3 (IP) Header Length. */\n-\t\t\tuint16_t l2_len:7;      /**< L2 (MAC) Header Length. */\n-\t\t};\n-\t};\n+\t\t\tuint64_t l2_len:7; /**< L2 (MAC) Header Length. */\n+\t\t\tuint64_t l3_len:9; /**< L3 (IP) Header Length. */\n+\t\t\tuint64_t l4_len:8; /**< L4 (TCP/UDP) Header Length. */\n+\t\t\tuint64_t tso_segsz:16; /**< TCP TSO segment size */\n \n-\t/* fields for TX offloading of tunnels */\n-\tunion {\n-\t\tuint16_t inner_l2_l3_len;\n-\t\t/**< combined inner l2/l3 lengths as single var */\n-\t\tstruct {\n-\t\t\tuint16_t inner_l3_len:9;\n-\t\t\t/**< inner L3 (IP) Header Length. */\n-\t\t\tuint16_t inner_l2_len:7;\n-\t\t\t/**< inner L2 (MAC) Header Length. */\n+\t\t\t/* fields for TX offloading of tunnels */\n+\t\t\tuint16_t inner_l3_len:9; /**< inner L3 (IP) Hdr Length. */\n+\t\t\tuint16_t inner_l2_len:7; /**< inner L2 (MAC) Hdr Length. */\n+\n+\t\t\t/* uint64_t unused:8; */\n \t\t};\n \t};\n } __rte_cache_aligned;\n@@ -631,8 +641,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)\n {\n \tm->next = NULL;\n \tm->pkt_len = 0;\n-\tm->l2_l3_len = 0;\n-\tm->inner_l2_l3_len = 0;\n+\tm->tx_offload = 0;\n \tm->vlan_tci = 0;\n \tm->nb_segs = 1;\n \tm->port = 0xff;\n@@ -701,8 +710,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *md)\n \tmi->data_len = md->data_len;\n \tmi->port = md->port;\n \tmi->vlan_tci = md->vlan_tci;\n-\tmi->l2_l3_len = md->l2_l3_len;\n-\tmi->inner_l2_l3_len = md->inner_l2_l3_len;\n+\tmi->tx_offload = md->tx_offload;\n \tmi->hash = md->hash;\n \n \tmi->next = NULL;\ndiff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c\nindex dbf5074..0a9447e 100644\n--- a/lib/librte_pmd_e1000/igb_rxtx.c\n+++ b/lib/librte_pmd_e1000/igb_rxtx.c\n@@ -361,6 +361,13 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \tstruct rte_mbuf     *tx_pkt;\n \tstruct rte_mbuf     *m_seg;\n \tunion igb_vlan_macip vlan_macip_lens;\n+\tunion {\n+\t\tuint16_t u16;\n+\t\tstruct {\n+\t\t\tuint16_t l3_len:9;\n+\t\t\tuint16_t l2_len:7;\n+\t\t};\n+\t} l2_l3_len;\n \tuint64_t buf_dma_addr;\n \tuint32_t olinfo_status;\n \tuint32_t cmd_type_len;\n@@ -398,8 +405,10 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\ttx_last = (uint16_t) (tx_id + tx_pkt->nb_segs - 1);\n \n \t\tol_flags = tx_pkt->ol_flags;\n+\t\tl2_l3_len.l2_len = tx_pkt->l2_len;\n+\t\tl2_l3_len.l3_len = tx_pkt->l3_len;\n \t\tvlan_macip_lens.f.vlan_tci = tx_pkt->vlan_tci;\n-\t\tvlan_macip_lens.f.l2_l3_len = tx_pkt->l2_l3_len;\n+\t\tvlan_macip_lens.f.l2_l3_len = l2_l3_len.u16;\n \t\ttx_ol_req = ol_flags & (PKT_TX_VLAN_PKT | PKT_TX_IP_CKSUM |\n \t\t\tPKT_TX_L4_MASK);\n \ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\nindex 70ca254..54a0fc1 100644\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\n@@ -540,6 +540,13 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \tstruct rte_mbuf     *tx_pkt;\n \tstruct rte_mbuf     *m_seg;\n \tunion ixgbe_vlan_macip vlan_macip_lens;\n+\tunion {\n+\t\tuint16_t u16;\n+\t\tstruct {\n+\t\t\tuint16_t l3_len:9;\n+\t\t\tuint16_t l2_len:7;\n+\t\t};\n+\t} l2_l3_len;\n \tuint64_t buf_dma_addr;\n \tuint32_t olinfo_status;\n \tuint32_t cmd_type_len;\n@@ -583,8 +590,10 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\ttx_ol_req = ol_flags & (PKT_TX_VLAN_PKT | PKT_TX_IP_CKSUM |\n \t\t\tPKT_TX_L4_MASK);\n \t\tif (tx_ol_req) {\n+\t\t\tl2_l3_len.l2_len = tx_pkt->l2_len;\n+\t\t\tl2_l3_len.l3_len = tx_pkt->l3_len;\n \t\t\tvlan_macip_lens.f.vlan_tci = tx_pkt->vlan_tci;\n-\t\t\tvlan_macip_lens.f.l2_l3_len = tx_pkt->l2_l3_len;\n+\t\t\tvlan_macip_lens.f.l2_l3_len = l2_l3_len.u16;\n \n \t\t\t/* If new context need be built or reuse the exist ctx. */\n \t\t\tctx = what_advctx_update(txq, tx_ol_req,\n",
    "prefixes": [
        "dpdk-dev",
        "07/12"
    ]
}