get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 700226,
    "url": "http://patchwork.ozlabs.org/api/patches/700226/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1480377971-23412-3-git-send-email-bimmy.pujari@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": "<1480377971-23412-3-git-send-email-bimmy.pujari@intel.com>",
    "list_archive_url": null,
    "date": "2016-11-29T00:05:59",
    "name": "[next,S55,02/14] i40e: Quick refactor to start moving data off stack and into Tx buffer info",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "da08af206f28942df880eb24d3f8d063ed8821b4",
    "submitter": {
        "id": 68919,
        "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api",
        "name": "Pujari, Bimmy",
        "email": "bimmy.pujari@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/1480377971-23412-3-git-send-email-bimmy.pujari@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/700226/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/700226/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.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"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3tSP5F3XTwz9tlW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Nov 2016 11:08:01 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 15EB58891A;\n\tTue, 29 Nov 2016 00:08:00 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id m6iB-OCTeNvx; Tue, 29 Nov 2016 00:07:55 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D700888931;\n\tTue, 29 Nov 2016 00:07:52 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id A15181C0975\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Nov 2016 00:07:49 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 9C8F393AEC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Nov 2016 00:07:49 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id se-fHThp0y8g for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Nov 2016 00:07:48 +0000 (UTC)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 591D793ACD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Nov 2016 00:07:48 +0000 (UTC)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby orsmga104.jf.intel.com with ESMTP; 28 Nov 2016 16:07:47 -0800",
            "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([134.134.2.167])\n\tby orsmga004.jf.intel.com with ESMTP; 28 Nov 2016 16:07:47 -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-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.31,565,1473145200\"; d=\"scan'208\";a=\"35284049\"",
        "From": "Bimmy Pujari <bimmy.pujari@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 28 Nov 2016 16:05:59 -0800",
        "Message-Id": "<1480377971-23412-3-git-send-email-bimmy.pujari@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1480377971-23412-1-git-send-email-bimmy.pujari@intel.com>",
        "References": "<1480377971-23412-1-git-send-email-bimmy.pujari@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S55 02/14] i40e: Quick refactor to\n\tstart moving data off stack and into Tx buffer info",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.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@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "From: Alexander Duyck <alexander.h.duyck@intel.com>\n\nThis patch does some quick work to pull some of the data off of the stack\nand hopefully start storing it in the Tx buffer info section of the Tx\nring.  Ideally we should be moving away from having to store much of\nanything on the stack and can just maintain it all in the descriptor rings.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\nChange-ID: I4b4715ea1920e122502482b3f9e56a9a6cb1e9fe\n---\nTesting Hints:\n        This should not break the transmit path and should have no\n        signficant impact on Tx performance.  It brings us closer to what\n        is already in ixgbe and enables us to add support for a workaround\n        needed to deal with gso_size less than 64.\n\n drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 47 +++++++++++++++------------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 47 +++++++++++++++------------\n 2 files changed, 54 insertions(+), 40 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 352cf7c..a347d08 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -2251,14 +2251,16 @@ static inline int i40e_tx_prepare_vlan_flags(struct sk_buff *skb,\n \n /**\n  * i40e_tso - set up the tso context descriptor\n- * @skb:      ptr to the skb we're sending\n+ * @first:    pointer to first Tx buffer for xmit\n  * @hdr_len:  ptr to the size of the packet header\n  * @cd_type_cmd_tso_mss: Quad Word 1\n  *\n  * Returns 0 if no TSO can happen, 1 if tso is going, or error\n  **/\n-static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)\n+static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len,\n+\t\t    u64 *cd_type_cmd_tso_mss)\n {\n+\tstruct sk_buff *skb = first->skb;\n \tu64 cd_cmd, cd_tso_len, cd_mss;\n \tunion {\n \t\tstruct iphdr *v4;\n@@ -2271,6 +2273,7 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)\n \t\tunsigned char *hdr;\n \t} l4;\n \tu32 paylen, l4_offset;\n+\tu16 gso_segs, gso_size;\n \tint err;\n \n \tif (skb->ip_summed != CHECKSUM_PARTIAL)\n@@ -2335,10 +2338,18 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)\n \t/* compute length of segmentation header */\n \t*hdr_len = (l4.tcp->doff * 4) + l4_offset;\n \n+\t/* pull values out of skb_shinfo */\n+\tgso_size = skb_shinfo(skb)->gso_size;\n+\tgso_segs = skb_shinfo(skb)->gso_segs;\n+\n+\t/* update gso size and bytecount with header size */\n+\tfirst->gso_segs = gso_segs;\n+\tfirst->bytecount += (first->gso_segs - 1) * *hdr_len;\n+\n \t/* find the field values */\n \tcd_cmd = I40E_TX_CTX_DESC_TSO;\n \tcd_tso_len = skb->len - *hdr_len;\n-\tcd_mss = skb_shinfo(skb)->gso_size;\n+\tcd_mss = gso_size;\n \t*cd_type_cmd_tso_mss |= (cd_cmd << I40E_TXD_CTX_QW1_CMD_SHIFT) |\n \t\t\t\t(cd_tso_len << I40E_TXD_CTX_QW1_TSO_LEN_SHIFT) |\n \t\t\t\t(cd_mss << I40E_TXD_CTX_QW1_MSS_SHIFT);\n@@ -2699,7 +2710,6 @@ static inline void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \tu16 i = tx_ring->next_to_use;\n \tu32 td_tag = 0;\n \tdma_addr_t dma;\n-\tu16 gso_segs;\n \tu16 desc_count = 1;\n \n \tif (tx_flags & I40E_TX_FLAGS_HW_VLAN) {\n@@ -2708,15 +2718,6 @@ static inline void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \t\t\t I40E_TX_FLAGS_VLAN_SHIFT;\n \t}\n \n-\tif (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO))\n-\t\tgso_segs = skb_shinfo(skb)->gso_segs;\n-\telse\n-\t\tgso_segs = 1;\n-\n-\t/* multiply data chunks by size of headers */\n-\tfirst->bytecount = skb->len - hdr_len + (gso_segs * hdr_len);\n-\tfirst->gso_segs = gso_segs;\n-\tfirst->skb = skb;\n \tfirst->tx_flags = tx_flags;\n \n \tdma = dma_map_single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE);\n@@ -2902,8 +2903,10 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \n \tcount = i40e_xmit_descriptor_count(skb);\n \tif (i40e_chk_linearize(skb, count)) {\n-\t\tif (__skb_linearize(skb))\n-\t\t\tgoto out_drop;\n+\t\tif (__skb_linearize(skb)) {\n+\t\t\tdev_kfree_skb_any(skb);\n+\t\t\treturn NETDEV_TX_OK;\n+\t\t}\n \t\tcount = i40e_txd_use_count(skb->len);\n \t\ttx_ring->tx_stats.tx_linearize++;\n \t}\n@@ -2919,6 +2922,12 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \t\treturn NETDEV_TX_BUSY;\n \t}\n \n+\t/* record the location of the first descriptor for this packet */\n+\tfirst = &tx_ring->tx_bi[tx_ring->next_to_use];\n+\tfirst->skb = skb;\n+\tfirst->bytecount = skb->len;\n+\tfirst->gso_segs = 1;\n+\n \t/* prepare the xmit flags */\n \tif (i40e_tx_prepare_vlan_flags(skb, tx_ring, &tx_flags))\n \t\tgoto out_drop;\n@@ -2926,16 +2935,13 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \t/* obtain protocol of skb */\n \tprotocol = vlan_get_protocol(skb);\n \n-\t/* record the location of the first descriptor for this packet */\n-\tfirst = &tx_ring->tx_bi[tx_ring->next_to_use];\n-\n \t/* setup IPv4/IPv6 offloads */\n \tif (protocol == htons(ETH_P_IP))\n \t\ttx_flags |= I40E_TX_FLAGS_IPV4;\n \telse if (protocol == htons(ETH_P_IPV6))\n \t\ttx_flags |= I40E_TX_FLAGS_IPV6;\n \n-\ttso = i40e_tso(skb, &hdr_len, &cd_type_cmd_tso_mss);\n+\ttso = i40e_tso(first, &hdr_len, &cd_type_cmd_tso_mss);\n \n \tif (tso < 0)\n \t\tgoto out_drop;\n@@ -2973,7 +2979,8 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \treturn NETDEV_TX_OK;\n \n out_drop:\n-\tdev_kfree_skb_any(skb);\n+\tdev_kfree_skb_any(first->skb);\n+\tfirst->skb = NULL;\n \treturn NETDEV_TX_OK;\n }\n \ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex df67ef3..1818cdf 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -1549,14 +1549,16 @@ static inline int i40evf_tx_prepare_vlan_flags(struct sk_buff *skb,\n \n /**\n  * i40e_tso - set up the tso context descriptor\n- * @skb:      ptr to the skb we're sending\n+ * @first:    pointer to first Tx buffer for xmit\n  * @hdr_len:  ptr to the size of the packet header\n  * @cd_type_cmd_tso_mss: Quad Word 1\n  *\n  * Returns 0 if no TSO can happen, 1 if tso is going, or error\n  **/\n-static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)\n+static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len,\n+\t\t    u64 *cd_type_cmd_tso_mss)\n {\n+\tstruct sk_buff *skb = first->skb;\n \tu64 cd_cmd, cd_tso_len, cd_mss;\n \tunion {\n \t\tstruct iphdr *v4;\n@@ -1569,6 +1571,7 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)\n \t\tunsigned char *hdr;\n \t} l4;\n \tu32 paylen, l4_offset;\n+\tu16 gso_segs, gso_size;\n \tint err;\n \n \tif (skb->ip_summed != CHECKSUM_PARTIAL)\n@@ -1633,10 +1636,18 @@ static int i40e_tso(struct sk_buff *skb, u8 *hdr_len, u64 *cd_type_cmd_tso_mss)\n \t/* compute length of segmentation header */\n \t*hdr_len = (l4.tcp->doff * 4) + l4_offset;\n \n+\t/* pull values out of skb_shinfo */\n+\tgso_size = skb_shinfo(skb)->gso_size;\n+\tgso_segs = skb_shinfo(skb)->gso_segs;\n+\n+\t/* update gso size and bytecount with header size */\n+\tfirst->gso_segs = gso_segs;\n+\tfirst->bytecount += (first->gso_segs - 1) * *hdr_len;\n+\n \t/* find the field values */\n \tcd_cmd = I40E_TX_CTX_DESC_TSO;\n \tcd_tso_len = skb->len - *hdr_len;\n-\tcd_mss = skb_shinfo(skb)->gso_size;\n+\tcd_mss = gso_size;\n \t*cd_type_cmd_tso_mss |= (cd_cmd << I40E_TXD_CTX_QW1_CMD_SHIFT) |\n \t\t\t\t(cd_tso_len << I40E_TXD_CTX_QW1_TSO_LEN_SHIFT) |\n \t\t\t\t(cd_mss << I40E_TXD_CTX_QW1_MSS_SHIFT);\n@@ -1949,7 +1960,6 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \tu16 i = tx_ring->next_to_use;\n \tu32 td_tag = 0;\n \tdma_addr_t dma;\n-\tu16 gso_segs;\n \tu16 desc_count = 1;\n \n \tif (tx_flags & I40E_TX_FLAGS_HW_VLAN) {\n@@ -1958,15 +1968,6 @@ static inline void i40evf_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \t\t\t I40E_TX_FLAGS_VLAN_SHIFT;\n \t}\n \n-\tif (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO))\n-\t\tgso_segs = skb_shinfo(skb)->gso_segs;\n-\telse\n-\t\tgso_segs = 1;\n-\n-\t/* multiply data chunks by size of headers */\n-\tfirst->bytecount = skb->len - hdr_len + (gso_segs * hdr_len);\n-\tfirst->gso_segs = gso_segs;\n-\tfirst->skb = skb;\n \tfirst->tx_flags = tx_flags;\n \n \tdma = dma_map_single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE);\n@@ -2151,8 +2152,10 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \n \tcount = i40e_xmit_descriptor_count(skb);\n \tif (i40e_chk_linearize(skb, count)) {\n-\t\tif (__skb_linearize(skb))\n-\t\t\tgoto out_drop;\n+\t\tif (__skb_linearize(skb)) {\n+\t\t\tdev_kfree_skb_any(skb);\n+\t\t\treturn NETDEV_TX_OK;\n+\t\t}\n \t\tcount = i40e_txd_use_count(skb->len);\n \t\ttx_ring->tx_stats.tx_linearize++;\n \t}\n@@ -2168,6 +2171,12 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \t\treturn NETDEV_TX_BUSY;\n \t}\n \n+\t/* record the location of the first descriptor for this packet */\n+\tfirst = &tx_ring->tx_bi[tx_ring->next_to_use];\n+\tfirst->skb = skb;\n+\tfirst->bytecount = skb->len;\n+\tfirst->gso_segs = 1;\n+\n \t/* prepare the xmit flags */\n \tif (i40evf_tx_prepare_vlan_flags(skb, tx_ring, &tx_flags))\n \t\tgoto out_drop;\n@@ -2175,16 +2184,13 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \t/* obtain protocol of skb */\n \tprotocol = vlan_get_protocol(skb);\n \n-\t/* record the location of the first descriptor for this packet */\n-\tfirst = &tx_ring->tx_bi[tx_ring->next_to_use];\n-\n \t/* setup IPv4/IPv6 offloads */\n \tif (protocol == htons(ETH_P_IP))\n \t\ttx_flags |= I40E_TX_FLAGS_IPV4;\n \telse if (protocol == htons(ETH_P_IPV6))\n \t\ttx_flags |= I40E_TX_FLAGS_IPV6;\n \n-\ttso = i40e_tso(skb, &hdr_len, &cd_type_cmd_tso_mss);\n+\ttso = i40e_tso(first, &hdr_len, &cd_type_cmd_tso_mss);\n \n \tif (tso < 0)\n \t\tgoto out_drop;\n@@ -2211,7 +2217,8 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \treturn NETDEV_TX_OK;\n \n out_drop:\n-\tdev_kfree_skb_any(skb);\n+\tdev_kfree_skb_any(first->skb);\n+\tfirst->skb = NULL;\n \treturn NETDEV_TX_OK;\n }\n \n",
    "prefixes": [
        "next",
        "S55",
        "02/14"
    ]
}