Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1041526/?format=api
{ "id": 1041526, "url": "http://patchwork.ozlabs.org/api/patches/1041526/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190213185115.25877-4-anirudh.venkataramanan@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": "<20190213185115.25877-4-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-02-13T18:51:03", "name": "[S14,03/15] ice: Get rid of ice_pull_tail", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "71470963fc33a78c32fa4fb49ef567c54f404542", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@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/20190213185115.25877-4-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 91786, "url": "http://patchwork.ozlabs.org/api/series/91786/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=91786", "date": "2019-02-13T18:51:02", "name": "Implementation updates for ice", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/91786/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1041526/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1041526/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;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 4407w10vG7z9s2P\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Feb 2019 05:53:36 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id EB80886A2E;\n\tWed, 13 Feb 2019 18:53:34 +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 h9xARsXrriLi; Wed, 13 Feb 2019 18:53:31 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 1E80A8243D;\n\tWed, 13 Feb 2019 18:53:30 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 7FF0D1BF98C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:24 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id C276B22C31\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:19 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id YfOF8U9pnYt2 for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:17 +0000 (UTC)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 47DBF228B3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:17 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Feb 2019 10:51:16 -0800", "from shasta.jf.intel.com ([10.166.241.11])\n\tby orsmga001.jf.intel.com with ESMTP; 13 Feb 2019 10:51:16 -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.58,366,1544515200\"; d=\"scan'208\";a=\"138354235\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 13 Feb 2019 10:51:03 -0800", "Message-Id": "<20190213185115.25877-4-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.14.5", "In-Reply-To": "<20190213185115.25877-1-anirudh.venkataramanan@intel.com>", "References": "<20190213185115.25877-1-anirudh.venkataramanan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH S14 03/15] ice: Get rid of ice_pull_tail", "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": "From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>\n\nInstead of adding a frag and later when dealing with EOP frame accessing\nthat frag in order to copy the headers onto linear part of skb, we can do\nthis in ice_add_rx_frag in case where the data_len is still 0 and frame\nwon't fit onto the linear part as a whole.\n\nFunction comment of ice_pull_tail was a bit misleading because of\nmentioned optimizations that can be performed (drop a frag/maintaining\naccurate truesize of skb) - it seems that this part of logic was dropped\nand the comment was not updated to reflect this change.\n\nSigned-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_txrx.c | 70 +++++++++++--------------------\n 1 file changed, 24 insertions(+), 46 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c\nindex d1f4aef9bcc2..03dddbd8c108 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx.c\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c\n@@ -562,13 +562,17 @@ ice_add_rx_frag(struct ice_rx_buf *rx_buf, struct sk_buff *skb,\n \tunsigned int truesize = ALIGN(size, L1_CACHE_BYTES);\n #endif /* PAGE_SIZE < 8192) */\n \tstruct page *page = rx_buf->page;\n+\tunsigned int pull_len;\n+\tunsigned char *va;\n+\n+\tva = page_address(page) + rx_buf->page_offset;\n+\tif (unlikely(skb_is_nonlinear(skb)))\n+\t\tgoto add_tail_frag;\n \n \t/* will the data fit in the skb we allocated? if so, just\n \t * copy it as it is pretty small anyway\n \t */\n-\tif (size <= ICE_RX_HDR_SIZE && !skb_is_nonlinear(skb)) {\n-\t\tunsigned char *va = page_address(page) + rx_buf->page_offset;\n-\n+\tif (size <= ICE_RX_HDR_SIZE) {\n \t\tmemcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));\n \n \t\t/* page is not reserved, we can reuse buffer as-is */\n@@ -580,8 +584,24 @@ ice_add_rx_frag(struct ice_rx_buf *rx_buf, struct sk_buff *skb,\n \t\treturn false;\n \t}\n \n+\t/* we need the header to contain the greater of either ETH_HLEN or\n+\t * 60 bytes if the skb->len is less than 60 for skb_pad.\n+\t */\n+\tpull_len = eth_get_headlen(va, ICE_RX_HDR_SIZE);\n+\n+\t/* align pull length to size of long to optimize memcpy performance */\n+\tmemcpy(__skb_put(skb, pull_len), va, ALIGN(pull_len, sizeof(long)));\n+\n+\t/* the header from the frame that we're adding as a frag was added to\n+\t * linear part of skb so move the pointer past that header and\n+\t * reduce the size of data\n+\t */\n+\tva += pull_len;\n+\tsize -= pull_len;\n+\n+add_tail_frag:\n \tskb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,\n-\t\t\trx_buf->page_offset, size, truesize);\n+\t\t\t(unsigned long)va & ~PAGE_MASK, size, truesize);\n \n \treturn ice_can_reuse_rx_page(rx_buf, truesize);\n }\n@@ -691,44 +711,6 @@ ice_fetch_rx_buf(struct ice_ring *rx_ring, struct ice_rx_buf *rx_buf,\n \treturn skb;\n }\n \n-/**\n- * ice_pull_tail - ice specific version of skb_pull_tail\n- * @skb: pointer to current skb being adjusted\n- *\n- * This function is an ice specific version of __pskb_pull_tail. The\n- * main difference between this version and the original function is that\n- * this function can make several assumptions about the state of things\n- * that allow for significant optimizations versus the standard function.\n- * As a result we can do things like drop a frag and maintain an accurate\n- * truesize for the skb.\n- */\n-static void ice_pull_tail(struct sk_buff *skb)\n-{\n-\tstruct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];\n-\tunsigned int pull_len;\n-\tunsigned char *va;\n-\n-\t/* it is valid to use page_address instead of kmap since we are\n-\t * working with pages allocated out of the lomem pool per\n-\t * alloc_page(GFP_ATOMIC)\n-\t */\n-\tva = skb_frag_address(frag);\n-\n-\t/* we need the header to contain the greater of either ETH_HLEN or\n-\t * 60 bytes if the skb->len is less than 60 for skb_pad.\n-\t */\n-\tpull_len = eth_get_headlen(va, ICE_RX_HDR_SIZE);\n-\n-\t/* align pull length to size of long to optimize memcpy performance */\n-\tskb_copy_to_linear_data(skb, va, ALIGN(pull_len, sizeof(long)));\n-\n-\t/* update all of the pointers */\n-\tskb_frag_size_sub(frag, pull_len);\n-\tfrag->page_offset += pull_len;\n-\tskb->data_len -= pull_len;\n-\tskb->tail += pull_len;\n-}\n-\n /**\n * ice_cleanup_headers - Correct empty headers\n * @skb: pointer to current skb being fixed\n@@ -743,10 +725,6 @@ static void ice_pull_tail(struct sk_buff *skb)\n */\n static bool ice_cleanup_headers(struct sk_buff *skb)\n {\n-\t/* place header in linear portion of buffer */\n-\tif (skb_is_nonlinear(skb))\n-\t\tice_pull_tail(skb);\n-\n \t/* if eth_skb_pad returns an error the skb was freed */\n \tif (eth_skb_pad(skb))\n \t\treturn true;\n", "prefixes": [ "S14", "03/15" ] }