Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1132624/?format=api
{ "id": 1132624, "url": "http://patchwork.ozlabs.org/api/patches/1132624/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190716030637.5634-5-kevin.laatz@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": "<20190716030637.5634-5-kevin.laatz@intel.com>", "list_archive_url": null, "date": "2019-07-16T03:06:31", "name": "[v2,04/10] i40e: modify driver for handling offsets", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "969cc57b9537986c52b80b91f4a19e650efa0e4e", "submitter": { "id": 76901, "url": "http://patchwork.ozlabs.org/api/people/76901/?format=api", "name": "Laatz, Kevin", "email": "kevin.laatz@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/20190716030637.5634-5-kevin.laatz@intel.com/mbox/", "series": [ { "id": 119750, "url": "http://patchwork.ozlabs.org/api/series/119750/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=119750", "date": "2019-07-16T03:06:28", "name": "[v2,01/10] i40e: simplify Rx buffer recycle", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/119750/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1132624/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1132624/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 45nyfN5yLyz9s7T\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 16 Jul 2019 21:22:04 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 295B487D40;\n\tTue, 16 Jul 2019 11:22:02 +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 um7TBL0ZK1nx; Tue, 16 Jul 2019 11:22:00 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 95B7287C66;\n\tTue, 16 Jul 2019 11:22:00 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 0AF931BF82D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Jul 2019 11:21:59 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 071BF86044\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Jul 2019 11:21:59 +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 dGQxX4CxKHGO for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Jul 2019 11:21:58 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 0CEE786027\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Jul 2019 11:21:58 +0000 (UTC)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Jul 2019 04:21:57 -0700", "from silpixa00399838.ir.intel.com (HELO\n\tsilpixa00399838.ger.corp.intel.com) ([10.237.223.10])\n\tby fmsmga006.fm.intel.com with ESMTP; 16 Jul 2019 04:21:54 -0700" ], "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.63,498,1557212400\"; d=\"scan'208\";a=\"366631430\"", "From": "Kevin Laatz <kevin.laatz@intel.com>", "To": "netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,\n\tbjorn.topel@intel.com, magnus.karlsson@intel.com,\n\tjakub.kicinski@netronome.com, jonathan.lemon@gmail.com", "Date": "Tue, 16 Jul 2019 03:06:31 +0000", "Message-Id": "<20190716030637.5634-5-kevin.laatz@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190716030637.5634-1-kevin.laatz@intel.com>", "References": "<20190620090958.2135-1-kevin.laatz@intel.com>\n\t<20190716030637.5634-1-kevin.laatz@intel.com>", "Subject": "[Intel-wired-lan] [PATCH v2 04/10] i40e: modify driver for handling\n\toffsets", "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>", "Cc": "bruce.richardson@intel.com, ciara.loftus@intel.com,\n\tintel-wired-lan@lists.osuosl.org, bpf@vger.kernel.org,\n\tKevin Laatz <kevin.laatz@intel.com>", "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": "With the addition of the unaligned chunks option, we need to make sure we\nhandle the offsets accordingly based on the mode we are currently running\nin. This patch modifies the driver to appropriately mask the address for\neach case.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_xsk.c | 26 +++++++++++++++++-----\n 1 file changed, 21 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c\nindex dfa096db2244..b8316e9ba159 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c\n@@ -190,7 +190,9 @@ int i40e_xsk_umem_setup(struct i40e_vsi *vsi, struct xdp_umem *umem,\n **/\n static int i40e_run_xdp_zc(struct i40e_ring *rx_ring, struct xdp_buff *xdp)\n {\n+\tstruct xdp_umem *umem = rx_ring->xsk_umem;\n \tint err, result = I40E_XDP_PASS;\n+\tu64 offset = umem->headroom;\n \tstruct i40e_ring *xdp_ring;\n \tstruct bpf_prog *xdp_prog;\n \tu32 act;\n@@ -201,7 +203,13 @@ static int i40e_run_xdp_zc(struct i40e_ring *rx_ring, struct xdp_buff *xdp)\n \t */\n \txdp_prog = READ_ONCE(rx_ring->xdp_prog);\n \tact = bpf_prog_run_xdp(xdp_prog, xdp);\n-\txdp->handle += xdp->data - xdp->data_hard_start;\n+\toffset += xdp->data - xdp->data_hard_start;\n+\n+\tif (umem->flags & XDP_UMEM_UNALIGNED_CHUNKS)\n+\t\txdp->handle |= (offset << XSK_UNALIGNED_BUF_OFFSET_SHIFT);\n+\telse\n+\t\txdp->handle += offset;\n+\n \tswitch (act) {\n \tcase XDP_PASS:\n \t\tbreak;\n@@ -262,7 +270,7 @@ static bool i40e_alloc_buffer_zc(struct i40e_ring *rx_ring,\n \tbi->addr = xdp_umem_get_data(umem, handle);\n \tbi->addr += hr;\n \n-\tbi->handle = handle + umem->headroom;\n+\tbi->handle = handle;\n \n \txsk_umem_discard_addr(umem);\n \treturn true;\n@@ -299,7 +307,7 @@ static bool i40e_alloc_buffer_slow_zc(struct i40e_ring *rx_ring,\n \tbi->addr = xdp_umem_get_data(umem, handle);\n \tbi->addr += hr;\n \n-\tbi->handle = handle + umem->headroom;\n+\tbi->handle = handle;\n \n \txsk_umem_discard_addr_rq(umem);\n \treturn true;\n@@ -456,7 +464,10 @@ void i40e_zca_free(struct zero_copy_allocator *alloc, unsigned long handle)\n \tnta++;\n \trx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0;\n \n-\thandle &= mask;\n+\tif (rx_ring->xsk_umem->flags & XDP_UMEM_UNALIGNED_CHUNKS)\n+\t\thandle &= XSK_UNALIGNED_BUF_ADDR_MASK;\n+\telse\n+\t\thandle &= mask;\n \n \tbi->dma = xdp_umem_get_dma(rx_ring->xsk_umem, handle);\n \tbi->dma += hr;\n@@ -635,6 +646,7 @@ static bool i40e_xmit_zc(struct i40e_ring *xdp_ring, unsigned int budget)\n \tstruct i40e_tx_buffer *tx_bi;\n \tbool work_done = true;\n \tstruct xdp_desc desc;\n+\tu64 addr, offset;\n \tdma_addr_t dma;\n \n \twhile (budget-- > 0) {\n@@ -647,7 +659,11 @@ static bool i40e_xmit_zc(struct i40e_ring *xdp_ring, unsigned int budget)\n \t\tif (!xsk_umem_consume_tx(xdp_ring->xsk_umem, &desc))\n \t\t\tbreak;\n \n-\t\tdma = xdp_umem_get_dma(xdp_ring->xsk_umem, desc.addr);\n+\t\t/* for unaligned chunks need to take offset from upper bits */\n+\t\toffset = (desc.addr >> XSK_UNALIGNED_BUF_OFFSET_SHIFT);\n+\t\taddr = (desc.addr & XSK_UNALIGNED_BUF_ADDR_MASK);\n+\n+\t\tdma = xdp_umem_get_dma(xdp_ring->xsk_umem, addr + offset);\n \n \t\tdma_sync_single_for_device(xdp_ring->dev, dma, desc.len,\n \t\t\t\t\t DMA_BIDIRECTIONAL);\n", "prefixes": [ "v2", "04/10" ] }