Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1041536/?format=api
{ "id": 1041536, "url": "http://patchwork.ozlabs.org/api/patches/1041536/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190213185115.25877-2-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-2-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-02-13T18:51:01", "name": "[S14,01/15] ice: Retrieve rx_buf in separate function", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "a9e726d929db689f38db233489de8802267a2e27", "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-2-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/1041536/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1041536/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 4407wZ6ccDz9s1l\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Feb 2019 05:54:06 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 81308820A1;\n\tWed, 13 Feb 2019 18:54:05 +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 P+5UZIBfXx32; Wed, 13 Feb 2019 18:54:01 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2AD1186AD4;\n\tWed, 13 Feb 2019 18:54:01 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 803A01BF98D\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 80C9E22CC6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:20 +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 m-vyZbu5zbUO 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 361752284C\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=\"138354233\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 13 Feb 2019 10:51:01 -0800", "Message-Id": "<20190213185115.25877-2-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 01/15] ice: Retrieve rx_buf in\n\tseparate function", "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\nIntroduce ice_get_rx_buf, which will fetch the rx buffer and do the DMA\nsynchronization. Length of the packet that hardware rx descriptor\ncontains is now read in ice_clean_rx_irq, so we can feed ice_get_rx_buf\nwith it and resign from rx_desc passed as argument in ice_fetch_rx_buf\nand ice_add_rx_frag.\n\nSigned-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n[Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> cleaned up commit message]\n---\n drivers/net/ethernet/intel/ice/ice_txrx.c | 75 +++++++++++++++++--------------\n 1 file changed, 42 insertions(+), 33 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c\nindex 64baedee6336..8c0a8b63670b 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx.c\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c\n@@ -499,8 +499,8 @@ static bool ice_page_is_reserved(struct page *page)\n /**\n * ice_add_rx_frag - Add contents of Rx buffer to sk_buff\n * @rx_buf: buffer containing page to add\n- * @rx_desc: descriptor containing length of buffer written by hardware\n * @skb: sk_buf to place the data into\n+ * @size: the length of the packet\n *\n * This function will add the data contained in rx_buf->page to the skb.\n * This is done either through a direct copy if the data in the buffer is\n@@ -511,8 +511,8 @@ static bool ice_page_is_reserved(struct page *page)\n * true if the buffer can be reused by the adapter.\n */\n static bool\n-ice_add_rx_frag(struct ice_rx_buf *rx_buf, union ice_32b_rx_flex_desc *rx_desc,\n-\t\tstruct sk_buff *skb)\n+ice_add_rx_frag(struct ice_rx_buf *rx_buf, struct sk_buff *skb,\n+\t\tunsigned int size)\n {\n #if (PAGE_SIZE < 8192)\n \tunsigned int truesize = ICE_RXBUF_2048;\n@@ -522,10 +522,6 @@ ice_add_rx_frag(struct ice_rx_buf *rx_buf, union ice_32b_rx_flex_desc *rx_desc,\n #endif /* PAGE_SIZE < 8192) */\n \n \tstruct page *page;\n-\tunsigned int size;\n-\n-\tsize = le16_to_cpu(rx_desc->wb.pkt_len) &\n-\t\tICE_RX_FLX_DESC_PKT_LEN_M;\n \n \tpage = rx_buf->page;\n \n@@ -603,10 +599,35 @@ ice_reuse_rx_page(struct ice_ring *rx_ring, struct ice_rx_buf *old_buf)\n \t*new_buf = *old_buf;\n }\n \n+/**\n+ * ice_get_rx_buf - Fetch Rx buffer and synchronize data for use\n+ * @rx_ring: Rx descriptor ring to transact packets on\n+ * @size: size of buffer to add to skb\n+ *\n+ * This function will pull an Rx buffer from the ring and synchronize it\n+ * for use by the CPU.\n+ */\n+static struct ice_rx_buf *\n+ice_get_rx_buf(struct ice_ring *rx_ring, const unsigned int size)\n+{\n+\tstruct ice_rx_buf *rx_buf;\n+\n+\trx_buf = &rx_ring->rx_buf[rx_ring->next_to_clean];\n+\tprefetchw(rx_buf->page);\n+\n+\t/* we are reusing so sync this buffer for CPU use */\n+\tdma_sync_single_range_for_cpu(rx_ring->dev, rx_buf->dma,\n+\t\t\t\t rx_buf->page_offset, size,\n+\t\t\t\t DMA_FROM_DEVICE);\n+\n+\treturn rx_buf;\n+}\n+\n /**\n * ice_fetch_rx_buf - Allocate skb and populate it\n * @rx_ring: Rx descriptor ring to transact packets on\n- * @rx_desc: descriptor containing info written by hardware\n+ * @rx_buf: Rx buffer to pull data from\n+ * @size: the length of the packet\n *\n * This function allocates an skb on the fly, and populates it with the page\n * data from the current receive descriptor, taking care to set up the skb\n@@ -614,20 +635,14 @@ ice_reuse_rx_page(struct ice_ring *rx_ring, struct ice_rx_buf *old_buf)\n * necessary.\n */\n static struct sk_buff *\n-ice_fetch_rx_buf(struct ice_ring *rx_ring, union ice_32b_rx_flex_desc *rx_desc)\n+ice_fetch_rx_buf(struct ice_ring *rx_ring, struct ice_rx_buf *rx_buf,\n+\t\t unsigned int size)\n {\n-\tstruct ice_rx_buf *rx_buf;\n-\tstruct sk_buff *skb;\n-\tstruct page *page;\n-\n-\trx_buf = &rx_ring->rx_buf[rx_ring->next_to_clean];\n-\tpage = rx_buf->page;\n-\tprefetchw(page);\n-\n-\tskb = rx_buf->skb;\n+\tstruct sk_buff *skb = rx_buf->skb;\n \n \tif (likely(!skb)) {\n-\t\tu8 *page_addr = page_address(page) + rx_buf->page_offset;\n+\t\tu8 *page_addr = page_address(rx_buf->page) +\n+\t\t\t\trx_buf->page_offset;\n \n \t\t/* prefetch first cache line of first page */\n \t\tprefetch(page_addr);\n@@ -644,25 +659,13 @@ ice_fetch_rx_buf(struct ice_ring *rx_ring, union ice_32b_rx_flex_desc *rx_desc)\n \t\t\treturn NULL;\n \t\t}\n \n-\t\t/* we will be copying header into skb->data in\n-\t\t * pskb_may_pull so it is in our interest to prefetch\n-\t\t * it now to avoid a possible cache miss\n-\t\t */\n-\t\tprefetchw(skb->data);\n-\n \t\tskb_record_rx_queue(skb, rx_ring->q_index);\n \t} else {\n-\t\t/* we are reusing so sync this buffer for CPU use */\n-\t\tdma_sync_single_range_for_cpu(rx_ring->dev, rx_buf->dma,\n-\t\t\t\t\t rx_buf->page_offset,\n-\t\t\t\t\t ICE_RXBUF_2048,\n-\t\t\t\t\t DMA_FROM_DEVICE);\n-\n \t\trx_buf->skb = NULL;\n \t}\n \n \t/* pull page into skb */\n-\tif (ice_add_rx_frag(rx_buf, rx_desc, skb)) {\n+\tif (ice_add_rx_frag(rx_buf, skb, size)) {\n \t\t/* hand second half of page back to the ring */\n \t\tice_reuse_rx_page(rx_ring, rx_buf);\n \t\trx_ring->rx_stats.page_reuse_count++;\n@@ -963,7 +966,9 @@ static int ice_clean_rx_irq(struct ice_ring *rx_ring, int budget)\n \t/* start the loop to process RX packets bounded by 'budget' */\n \twhile (likely(total_rx_pkts < (unsigned int)budget)) {\n \t\tunion ice_32b_rx_flex_desc *rx_desc;\n+\t\tstruct ice_rx_buf *rx_buf;\n \t\tstruct sk_buff *skb;\n+\t\tunsigned int size;\n \t\tu16 stat_err_bits;\n \t\tu16 vlan_tag = 0;\n \t\tu8 rx_ptype;\n@@ -993,8 +998,12 @@ static int ice_clean_rx_irq(struct ice_ring *rx_ring, int budget)\n \t\t */\n \t\tdma_rmb();\n \n+\t\tsize = le16_to_cpu(rx_desc->wb.pkt_len) &\n+\t\t\tICE_RX_FLX_DESC_PKT_LEN_M;\n+\n+\t\trx_buf = ice_get_rx_buf(rx_ring, size);\n \t\t/* allocate (if needed) and populate skb */\n-\t\tskb = ice_fetch_rx_buf(rx_ring, rx_desc);\n+\t\tskb = ice_fetch_rx_buf(rx_ring, rx_buf, size);\n \t\tif (!skb)\n \t\t\tbreak;\n \n", "prefixes": [ "S14", "01/15" ] }