get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17187,
    "url": "http://patchwork.dpdk.org/api/patches/17187/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1479922585-8640-5-git-send-email-tomaszx.kulasek@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<1479922585-8640-5-git-send-email-tomaszx.kulasek@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1479922585-8640-5-git-send-email-tomaszx.kulasek@intel.com",
    "date": "2016-11-23T17:36:23",
    "name": "[dpdk-dev,v12,4/6] i40e: add Tx preparation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f298921adebc7cc9def7b9ed69dc7c3a8d70a728",
    "submitter": {
        "id": 155,
        "url": "http://patchwork.dpdk.org/api/people/155/?format=api",
        "name": "Tomasz Kulasek",
        "email": "tomaszx.kulasek@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1479922585-8640-5-git-send-email-tomaszx.kulasek@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.dpdk.org/api/patches/17187/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/17187/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 A70D7568A;\n\tWed, 23 Nov 2016 18:40:18 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 887F55686\n\tfor <dev@dpdk.org>; Wed, 23 Nov 2016 18:40:16 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga102.fm.intel.com with ESMTP; 23 Nov 2016 09:40:15 -0800",
            "from unknown (HELO Sent) ([10.103.102.79])\n\tby fmsmga002.fm.intel.com with SMTP; 23 Nov 2016 09:40:13 -0800",
            "by Sent (sSMTP sendmail emulation); Wed, 23 Nov 2016 18:39:30 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.31,539,1473145200\"; d=\"scan'208\";\n\ta=\"1089549760\"",
        "From": "Tomasz Kulasek <tomaszx.kulasek@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "konstantin.ananyev@intel.com,\n\tolivier.matz@6wind.com",
        "Date": "Wed, 23 Nov 2016 18:36:23 +0100",
        "Message-Id": "<1479922585-8640-5-git-send-email-tomaszx.kulasek@intel.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1479922585-8640-1-git-send-email-tomaszx.kulasek@intel.com>",
        "References": "<1477486575-25148-1-git-send-email-tomaszx.kulasek@intel.com>\n\t<1479922585-8640-1-git-send-email-tomaszx.kulasek@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v12 4/6] i40e: add Tx preparation",
        "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": "Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>\nAcked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n drivers/net/i40e/i40e_ethdev.c |    3 ++\n drivers/net/i40e/i40e_rxtx.c   |   72 +++++++++++++++++++++++++++++++++++++++-\n drivers/net/i40e/i40e_rxtx.h   |    8 +++++\n 3 files changed, 82 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 67778ba..5761357 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -943,6 +943,7 @@ static inline void i40e_GLQF_reg_init(struct i40e_hw *hw)\n \tdev->dev_ops = &i40e_eth_dev_ops;\n \tdev->rx_pkt_burst = i40e_recv_pkts;\n \tdev->tx_pkt_burst = i40e_xmit_pkts;\n+\tdev->tx_pkt_prepare = i40e_prep_pkts;\n \n \t/* for secondary processes, we don't initialise any further as primary\n \t * has already done this work. Only check we don't need a different\n@@ -2645,6 +2646,8 @@ static int i40e_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,\n \t\t.nb_max = I40E_MAX_RING_DESC,\n \t\t.nb_min = I40E_MIN_RING_DESC,\n \t\t.nb_align = I40E_ALIGN_RING_DESC,\n+\t\t.nb_seg_max = I40E_TX_MAX_SEG,\n+\t\t.nb_mtu_seg_max = I40E_TX_MAX_MTU_SEG,\n \t};\n \n \tif (pf->flags & I40E_FLAG_VMDQ) {\ndiff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c\nindex 7ae7d9f..5827f2f 100644\n--- a/drivers/net/i40e/i40e_rxtx.c\n+++ b/drivers/net/i40e/i40e_rxtx.c\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.\n  *   All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n@@ -50,6 +50,8 @@\n #include <rte_tcp.h>\n #include <rte_sctp.h>\n #include <rte_udp.h>\n+#include <rte_ip.h>\n+#include <rte_net.h>\n \n #include \"i40e_logs.h\"\n #include \"base/i40e_prototype.h\"\n@@ -79,6 +81,17 @@\n \t\tPKT_TX_TCP_SEG |\t\t \\\n \t\tPKT_TX_OUTER_IP_CKSUM)\n \n+#define I40E_TX_OFFLOAD_MASK (  \\\n+\t\tPKT_TX_IP_CKSUM |       \\\n+\t\tPKT_TX_L4_MASK |        \\\n+\t\tPKT_TX_OUTER_IP_CKSUM | \\\n+\t\tPKT_TX_TCP_SEG |        \\\n+\t\tPKT_TX_QINQ_PKT |       \\\n+\t\tPKT_TX_VLAN_PKT)\n+\n+#define I40E_TX_OFFLOAD_NOTSUP_MASK \\\n+\t\t(PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK)\n+\n static uint16_t i40e_xmit_pkts_simple(void *tx_queue,\n \t\t\t\t      struct rte_mbuf **tx_pkts,\n \t\t\t\t      uint16_t nb_pkts);\n@@ -1411,6 +1424,61 @@ static inline int __attribute__((always_inline))\n \treturn nb_tx;\n }\n \n+/*********************************************************************\n+ *\n+ *  TX prep functions\n+ *\n+ **********************************************************************/\n+uint16_t\n+i40e_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n+\t\tuint16_t nb_pkts)\n+{\n+\tint i, ret;\n+\tuint64_t ol_flags;\n+\tstruct rte_mbuf *m;\n+\n+\tfor (i = 0; i < nb_pkts; i++) {\n+\t\tm = tx_pkts[i];\n+\t\tol_flags = m->ol_flags;\n+\n+\t\t/**\n+\t\t * m->nb_segs is uint8_t, so m->nb_segs is always less than\n+\t\t * I40E_TX_MAX_SEG.\n+\t\t * We check only a condition for m->nb_segs > I40E_TX_MAX_MTU_SEG.\n+\t\t */\n+\t\tif (!(ol_flags & PKT_TX_TCP_SEG)) {\n+\t\t\tif (m->nb_segs > I40E_TX_MAX_MTU_SEG) {\n+\t\t\t\trte_errno = -EINVAL;\n+\t\t\t\treturn i;\n+\t\t\t}\n+\t\t} else if ((m->tso_segsz < I40E_MIN_TSO_MSS) ||\n+\t\t\t\t(m->tso_segsz > I40E_MAX_TSO_MSS)) {\n+\t\t\t/* MSS outside the range (256B - 9674B) are considered malicious */\n+\t\t\trte_errno = -EINVAL;\n+\t\t\treturn i;\n+\t\t}\n+\n+\t\tif (ol_flags & I40E_TX_OFFLOAD_NOTSUP_MASK) {\n+\t\t\trte_errno = -ENOTSUP;\n+\t\t\treturn i;\n+\t\t}\n+\n+#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n+\t\tret = rte_validate_tx_offload(m);\n+\t\tif (ret != 0) {\n+\t\t\trte_errno = ret;\n+\t\t\treturn i;\n+\t\t}\n+#endif\n+\t\tret = rte_net_intel_cksum_prepare(m);\n+\t\tif (ret != 0) {\n+\t\t\trte_errno = ret;\n+\t\t\treturn i;\n+\t\t}\n+\t}\n+\treturn i;\n+}\n+\n /*\n  * Find the VSI the queue belongs to. 'queue_idx' is the queue index\n  * application used, which assume having sequential ones. But from driver's\n@@ -2763,9 +2831,11 @@ void __attribute__((cold))\n \t\t\tPMD_INIT_LOG(DEBUG, \"Simple tx finally be used.\");\n \t\t\tdev->tx_pkt_burst = i40e_xmit_pkts_simple;\n \t\t}\n+\t\tdev->tx_pkt_prepare = NULL;\n \t} else {\n \t\tPMD_INIT_LOG(DEBUG, \"Xmit tx finally be used.\");\n \t\tdev->tx_pkt_burst = i40e_xmit_pkts;\n+\t\tdev->tx_pkt_prepare = i40e_prep_pkts;\n \t}\n }\n \ndiff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h\nindex ecdb13c..9df8a56 100644\n--- a/drivers/net/i40e/i40e_rxtx.h\n+++ b/drivers/net/i40e/i40e_rxtx.h\n@@ -63,6 +63,12 @@\n #define\tI40E_MIN_RING_DESC\t64\n #define\tI40E_MAX_RING_DESC\t4096\n \n+#define I40E_MIN_TSO_MSS          256\n+#define I40E_MAX_TSO_MSS          9674\n+\n+#define I40E_TX_MAX_SEG     UINT8_MAX\n+#define I40E_TX_MAX_MTU_SEG 8\n+\n #undef container_of\n #define container_of(ptr, type, member) ({ \\\n \t\ttypeof(((type *)0)->member)(*__mptr) = (ptr); \\\n@@ -223,6 +229,8 @@ uint16_t i40e_recv_scattered_pkts(void *rx_queue,\n uint16_t i40e_xmit_pkts(void *tx_queue,\n \t\t\tstruct rte_mbuf **tx_pkts,\n \t\t\tuint16_t nb_pkts);\n+uint16_t i40e_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n+\t\tuint16_t nb_pkts);\n int i40e_tx_queue_init(struct i40e_tx_queue *txq);\n int i40e_rx_queue_init(struct i40e_rx_queue *rxq);\n void i40e_free_tx_resources(struct i40e_tx_queue *txq);\n",
    "prefixes": [
        "dpdk-dev",
        "v12",
        "4/6"
    ]
}