Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v2 net-next 7/8] ice: skip NULL check against XDP prog in ZC path
Date: Mon, 14 Dec 2020 16:13:07 +0100	[thread overview]
Message-ID: <20201214151308.15275-8-maciej.fijalkowski@intel.com> (raw)
In-Reply-To: <20201214151308.15275-1-maciej.fijalkowski@intel.com>

Whole zero-copy variant of clean Rx irq is executed when xsk_pool is
attached to rx_ring and it can happen only when XDP program is present
on interface. Therefore it is safe to assume that program is always
!NULL and there is no need for checking it in ice_run_xdp_zc.

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_xsk.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
index 797886524054..9aea97ca4a04 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -514,11 +514,10 @@ ice_run_xdp_zc(struct ice_ring *rx_ring, struct xdp_buff *xdp)
 	u32 act;
 
 	rcu_read_lock();
+	/* ZC patch is enabled only when XDP program is set,
+	 * so here it can not be NULL
+	 */
 	xdp_prog = READ_ONCE(rx_ring->xdp_prog);
-	if (!xdp_prog) {
-		rcu_read_unlock();
-		return ICE_XDP_PASS;
-	}
 
 	act = bpf_prog_run_xdp(xdp_prog, xdp);
 	switch (act) {
-- 
2.20.1


  parent reply	other threads:[~2020-12-14 15:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 15:13 [Intel-wired-lan] [PATCH v2 net-next 0/8] i40e/ice cleanups Maciej Fijalkowski
2020-12-14 15:13 ` [Intel-wired-lan] [PATCH v2 net-next 1/8] i40e: drop redundant check when setting xdp prog Maciej Fijalkowski
2020-12-14 15:13 ` [Intel-wired-lan] [PATCH v2 net-next 2/8] i40e: drop misleading function comments Maciej Fijalkowski
2020-12-14 15:13 ` [Intel-wired-lan] [PATCH v2 net-next 3/8] i40e: adjust i40e_is_non_eop Maciej Fijalkowski
2020-12-14 15:13 ` [Intel-wired-lan] [PATCH v2 net-next 4/8] ice: simplify ice_run_xdp Maciej Fijalkowski
2020-12-14 15:13 ` [Intel-wired-lan] [PATCH v2 net-next 5/8] ice: move skb pointer from rx_buf to rx_ring Maciej Fijalkowski
2020-12-14 15:13 ` [Intel-wired-lan] [PATCH v2 net-next 6/8] ice: remove redundant checks in ice_change_mtu Maciej Fijalkowski
2020-12-14 15:13 ` Maciej Fijalkowski [this message]
2020-12-14 15:13 ` [Intel-wired-lan] [PATCH v2 net-next 8/8] i40e, xsk: Simplify the do-while allocation loop Maciej Fijalkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201214151308.15275-8-maciej.fijalkowski@intel.com \
    --to=maciej.fijalkowski@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox