get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1217740,
    "url": "http://patchwork.ozlabs.org/api/patches/1217740/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200105122053.2512-1-sasha.neftin@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20200105122053.2512-1-sasha.neftin@intel.com>",
    "list_archive_url": null,
    "date": "2020-01-05T12:20:53",
    "name": "[v1] igc: Add support for TSO",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "050031785a348c18b6d6188d75dc52dca26b0584",
    "submitter": {
        "id": 69860,
        "url": "http://patchwork.ozlabs.org/api/people/69860/?format=api",
        "name": "Sasha Neftin",
        "email": "sasha.neftin@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200105122053.2512-1-sasha.neftin@intel.com/mbox/",
    "series": [
        {
            "id": 151268,
            "url": "http://patchwork.ozlabs.org/api/series/151268/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=151268",
            "date": "2020-01-05T12:20:53",
            "name": "[v1] igc: Add support for TSO",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/151268/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1217740/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1217740/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.137;\n\thelo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 47rJ084m7mz9sPK\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun,  5 Jan 2020 23:31:03 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 793C285C4B;\n\tSun,  5 Jan 2020 12:31:01 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 6QNyQbekmq2H; Sun,  5 Jan 2020 12:31:00 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 4F67C85C1D;\n\tSun,  5 Jan 2020 12:31:00 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id AB0A51BF422\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSun,  5 Jan 2020 12:30:58 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id A440785C1D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSun,  5 Jan 2020 12:30:58 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id xVcvwRSFilFb for <intel-wired-lan@lists.osuosl.org>;\n\tSun,  5 Jan 2020 12:30:57 +0000 (UTC)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id A200C851C0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSun,  5 Jan 2020 12:30:57 +0000 (UTC)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Jan 2020 04:30:56 -0800",
            "from ccdlinuxdev08.iil.intel.com ([143.185.161.150])\n\tby orsmga005.jf.intel.com with ESMTP; 05 Jan 2020 04:20:53 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.69,398,1571727600\"; d=\"scan'208\";a=\"394766297\"",
        "From": "Sasha Neftin <sasha.neftin@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Sun,  5 Jan 2020 14:20:53 +0200",
        "Message-Id": "<20200105122053.2512-1-sasha.neftin@intel.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "Subject": "[Intel-wired-lan] [PATCH v1] igc: Add support for TSO",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "TCP segmentation offload allows a device to segment a single frame\ninto multiple frames with a data payload size specified in socket buffer.\nAs a result we can now send data approximately up to seven percents fast\nthan was previously possible on my system.\n\nSigned-off-by: Sasha Neftin <sasha.neftin@intel.com>\n---\n drivers/net/ethernet/intel/igc/igc_defines.h |   4 +\n drivers/net/ethernet/intel/igc/igc_main.c    | 113 ++++++++++++++++++++++++++-\n 2 files changed, 116 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h\nindex 2121fc34e300..9e34b0969322 100644\n--- a/drivers/net/ethernet/intel/igc/igc_defines.h\n+++ b/drivers/net/ethernet/intel/igc/igc_defines.h\n@@ -282,6 +282,10 @@\n #define IGC_TXD_STAT_TC\t\t0x00000004 /* Tx Underrun */\n #define IGC_TXD_EXTCMD_TSTAMP\t0x00000010 /* IEEE1588 Timestamp packet */\n \n+/* IPSec Encrypt Enable */\n+#define IGC_ADVTXD_L4LEN_SHIFT\t8  /* Adv ctxt L4LEN shift */\n+#define IGC_ADVTXD_MSS_SHIFT\t16 /* Adv ctxt MSS shift */\n+\n /* Transmit Control */\n #define IGC_TCTL_EN\t\t0x00000002 /* enable Tx */\n #define IGC_TCTL_PSP\t\t0x00000008 /* pad short packets */\ndiff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex 37d2d242c3a6..607bf89ecd71 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -1000,6 +1000,10 @@ static u32 igc_tx_cmd_type(struct sk_buff *skb, u32 tx_flags)\n \t\t       IGC_ADVTXD_DCMD_DEXT |\n \t\t       IGC_ADVTXD_DCMD_IFCS;\n \n+\t/* set segmentation bits for TSO */\n+\tcmd_type |= IGC_SET_FLAG(tx_flags, IGC_TX_FLAGS_TSO,\n+\t\t\t\t (IGC_ADVTXD_DCMD_TSE));\n+\n \t/* set timestamp bit if present */\n \tcmd_type |= IGC_SET_FLAG(tx_flags, IGC_TX_FLAGS_TSTAMP,\n \t\t\t\t (IGC_ADVTXD_MAC_TSTAMP));\n@@ -1171,6 +1175,100 @@ static int igc_tx_map(struct igc_ring *tx_ring,\n \treturn -1;\n }\n \n+static int igc_tso(struct igc_ring *tx_ring,\n+\t\t   struct igc_tx_buffer *first,\n+\t\t   u8 *hdr_len)\n+{\n+\tu32 vlan_macip_lens, type_tucmd, mss_l4len_idx;\n+\tstruct sk_buff *skb = first->skb;\n+\tunion {\n+\t\tstruct iphdr *v4;\n+\t\tstruct ipv6hdr *v6;\n+\t\tunsigned char *hdr;\n+\t} ip;\n+\tunion {\n+\t\tstruct tcphdr *tcp;\n+\t\tstruct udphdr *udp;\n+\t\tunsigned char *hdr;\n+\t} l4;\n+\tu32 paylen, l4_offset;\n+\tint err;\n+\n+\tif (skb->ip_summed != CHECKSUM_PARTIAL)\n+\t\treturn 0;\n+\n+\tif (!skb_is_gso(skb))\n+\t\treturn 0;\n+\n+\terr = skb_cow_head(skb, 0);\n+\tif (err < 0)\n+\t\treturn err;\n+\n+\tip.hdr = skb_network_header(skb);\n+\tl4.hdr = skb_checksum_start(skb);\n+\n+\t/* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */\n+\ttype_tucmd = IGC_ADVTXD_TUCMD_L4T_TCP;\n+\n+\t/* initialize outer IP header fields */\n+\tif (ip.v4->version == 4) {\n+\t\tunsigned char *csum_start = skb_checksum_start(skb);\n+\t\tunsigned char *trans_start = ip.hdr + (ip.v4->ihl * 4);\n+\n+\t\t/* IP header will have to cancel out any data that\n+\t\t * is not a part of the outer IP header\n+\t\t */\n+\t\tip.v4->check = csum_fold(csum_partial(trans_start,\n+\t\t\t\t\t\t      csum_start - trans_start,\n+\t\t\t\t\t\t      0));\n+\t\ttype_tucmd |= IGC_ADVTXD_TUCMD_IPV4;\n+\n+\t\tip.v4->tot_len = 0;\n+\t\tfirst->tx_flags |= IGC_TX_FLAGS_TSO |\n+\t\t\t\t   IGC_TX_FLAGS_CSUM |\n+\t\t\t\t   IGC_TX_FLAGS_IPV4;\n+\t} else {\n+\t\tip.v6->payload_len = 0;\n+\t\tfirst->tx_flags |= IGC_TX_FLAGS_TSO |\n+\t\t\t\t   IGC_TX_FLAGS_CSUM;\n+\t}\n+\n+\t/* determine offset of inner transport header */\n+\tl4_offset = l4.hdr - skb->data;\n+\n+\t/* remove payload length from inner checksum */\n+\tpaylen = skb->len - l4_offset;\n+\tif (type_tucmd & IGC_ADVTXD_TUCMD_L4T_TCP) {\n+\t\t/* compute length of segmentation header */\n+\t\t*hdr_len = (l4.tcp->doff * 4) + l4_offset;\n+\t\tcsum_replace_by_diff(&l4.tcp->check,\n+\t\t\t\t     (__force __wsum)htonl(paylen));\n+\t} else {\n+\t\t/* compute length of segmentation header */\n+\t\t*hdr_len = sizeof(*l4.udp) + l4_offset;\n+\t\tcsum_replace_by_diff(&l4.udp->check,\n+\t\t\t\t     (__force __wsum)htonl(paylen));\n+\t}\n+\n+\t/* update gso size and bytecount with header size */\n+\tfirst->gso_segs = skb_shinfo(skb)->gso_segs;\n+\tfirst->bytecount += (first->gso_segs - 1) * *hdr_len;\n+\n+\t/* MSS L4LEN IDX */\n+\tmss_l4len_idx = (*hdr_len - l4_offset) << IGC_ADVTXD_L4LEN_SHIFT;\n+\tmss_l4len_idx |= skb_shinfo(skb)->gso_size << IGC_ADVTXD_MSS_SHIFT;\n+\n+\t/* VLAN MACLEN IPLEN */\n+\tvlan_macip_lens = l4.hdr - ip.hdr;\n+\tvlan_macip_lens |= (ip.hdr - skb->data) << IGC_ADVTXD_MACLEN_SHIFT;\n+\tvlan_macip_lens |= first->tx_flags & IGC_TX_FLAGS_VLAN_MASK;\n+\n+\tigc_tx_ctxtdesc(tx_ring, first, vlan_macip_lens,\n+\t\t\ttype_tucmd, mss_l4len_idx);\n+\n+\treturn 1;\n+}\n+\n static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,\n \t\t\t\t       struct igc_ring *tx_ring)\n {\n@@ -1180,6 +1278,7 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,\n \tu32 tx_flags = 0;\n \tunsigned short f;\n \tu8 hdr_len = 0;\n+\tint tso = 0;\n \n \t/* need: 1 descriptor per page * PAGE_SIZE/IGC_MAX_DATA_PER_TXD,\n \t *\t+ 1 desc for skb_headlen/IGC_MAX_DATA_PER_TXD,\n@@ -1226,11 +1325,21 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,\n \tfirst->tx_flags = tx_flags;\n \tfirst->protocol = protocol;\n \n-\tigc_tx_csum(tx_ring, first);\n+\ttso = igc_tso(tx_ring, first, &hdr_len);\n+\tif (tso < 0)\n+\t\tgoto out_drop;\n+\telse if (!tso)\n+\t\tigc_tx_csum(tx_ring, first);\n \n \tigc_tx_map(tx_ring, first, hdr_len);\n \n \treturn NETDEV_TX_OK;\n+\n+out_drop:\n+\tdev_kfree_skb_any(first->skb);\n+\tfirst->skb = NULL;\n+\n+\treturn NETDEV_TX_OK;\n }\n \n static inline struct igc_ring *igc_tx_queue_mapping(struct igc_adapter *adapter,\n@@ -4588,6 +4697,8 @@ static int igc_probe(struct pci_dev *pdev,\n \n \t/* Add supported features to the features list*/\n \tnetdev->features |= NETIF_F_SG;\n+\tnetdev->features |= NETIF_F_TSO;\n+\tnetdev->features |= NETIF_F_TSO6;\n \tnetdev->features |= NETIF_F_RXCSUM;\n \tnetdev->features |= NETIF_F_HW_CSUM;\n \tnetdev->features |= NETIF_F_SCTP_CRC;\n",
    "prefixes": [
        "v1"
    ]
}