From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D720EC49ED6 for ; Wed, 11 Sep 2019 17:26:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B551B2085B for ; Wed, 11 Sep 2019 17:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729559AbfIKR0f (ORCPT ); Wed, 11 Sep 2019 13:26:35 -0400 Received: from mga02.intel.com ([134.134.136.20]:44405 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728897AbfIKR0f (ORCPT ); Wed, 11 Sep 2019 13:26:35 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Sep 2019 10:26:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,489,1559545200"; d="scan'208";a="384772689" Received: from silpixa00399839.ir.intel.com (HELO localhost.localdomain) ([10.237.223.65]) by fmsmga005.fm.intel.com with ESMTP; 11 Sep 2019 10:26:31 -0700 From: Ciara Loftus To: netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, bjorn.topel@intel.com, magnus.karlsson@intel.com, jonathan.lemon@gmail.com Cc: bruce.richardson@intel.com, bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, kevin.laatz@intel.com, Ciara Loftus Subject: [PATCH bpf-next 1/3] i40e: fix xdp handle calculations Date: Wed, 11 Sep 2019 17:24:33 +0000 Message-Id: <20190911172435.21042-1-ciara.loftus@intel.com> X-Mailer: git-send-email 2.17.1 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Commit 4c5d9a7fa149 ("i40e: fix xdp handle calculations") reintroduced the addition of the umem headroom to the xdp handle in the i40e_zca_free, i40e_alloc_buffer_slow_zc and i40e_alloc_buffer_zc functions. However, the headroom is already added to the handle in the function i40_run_xdp_zc. This commit removes the latter addition and fixes the case where the headroom is non-zero. Fixes: 4c5d9a7fa149 ("i40e: fix xdp handle calculations") Signed-off-by: Ciara Loftus --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c index 0373bc6c7e61..5f285ba1f1f9 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c +++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c @@ -192,7 +192,7 @@ static int i40e_run_xdp_zc(struct i40e_ring *rx_ring, struct xdp_buff *xdp) { struct xdp_umem *umem = rx_ring->xsk_umem; int err, result = I40E_XDP_PASS; - u64 offset = umem->headroom; + u64 offset; struct i40e_ring *xdp_ring; struct bpf_prog *xdp_prog; u32 act; @@ -203,7 +203,7 @@ static int i40e_run_xdp_zc(struct i40e_ring *rx_ring, struct xdp_buff *xdp) */ xdp_prog = READ_ONCE(rx_ring->xdp_prog); act = bpf_prog_run_xdp(xdp_prog, xdp); - offset += xdp->data - xdp->data_hard_start; + offset = xdp->data - xdp->data_hard_start; xdp->handle = xsk_umem_adjust_offset(umem, xdp->handle, offset); -- 2.17.1