netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: netdev@vger.kernel.org
Cc: lorenzo.bianconi@redhat.com, davem@davemloft.net,
	kuba@kernel.org, brouer@redhat.com, echaudro@redhat.com,
	john.fastabend@gmail.com
Subject: [PATCH net-next 1/3] net: mvneta: avoid unnecessary xdp_buff initialization
Date: Fri, 20 Nov 2020 18:05:42 +0100	[thread overview]
Message-ID: <611eb5973eb88b0a7a342f44c818b3bcb6e94c8c.1605889259.git.lorenzo@kernel.org> (raw)
In-Reply-To: <cover.1605889258.git.lorenzo@kernel.org>

Explicitly initialize mandatory fields defining xdp_buff struct
in mvneta_rx_swbm routine

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/marvell/mvneta.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 5d559117f78c..60a285f3a55f 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2347,13 +2347,14 @@ static int mvneta_rx_swbm(struct napi_struct *napi,
 {
 	int rx_proc = 0, rx_todo, refill, size = 0;
 	struct net_device *dev = pp->dev;
-	struct xdp_buff xdp_buf = {
-		.frame_sz = PAGE_SIZE,
-		.rxq = &rxq->xdp_rxq,
-	};
 	struct mvneta_stats ps = {};
 	struct bpf_prog *xdp_prog;
 	u32 desc_status, frame_sz;
+	struct xdp_buff xdp_buf;
+
+	xdp_buf.data_hard_start = NULL;
+	xdp_buf.frame_sz = PAGE_SIZE;
+	xdp_buf.rxq = &rxq->xdp_rxq;
 
 	/* Get number of received packets */
 	rx_todo = mvneta_rxq_busy_desc_num_get(pp, rxq);
-- 
2.26.2


  reply	other threads:[~2020-11-20 17:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 17:05 [PATCH net-next 0/3] mvneta: access skb_shared_info only on last frag Lorenzo Bianconi
2020-11-20 17:05 ` Lorenzo Bianconi [this message]
2020-11-20 17:05 ` [PATCH net-next 2/3] net: mvneta: move skb_shared_info in mvneta_xdp_put_buff caller Lorenzo Bianconi
2020-11-20 17:05 ` [PATCH net-next 3/3] net: mvneta: alloc skb_shared_info on the mvneta_rx_swbm stack Lorenzo Bianconi
2020-11-20 23:10 ` [PATCH net-next 0/3] mvneta: access skb_shared_info only on last frag Jesse Brandeburg
2020-11-24 20:26 ` Jakub Kicinski
2020-11-24 22:18   ` Lorenzo Bianconi
2020-11-24 22:25     ` Daniel Borkmann
2020-11-24 22:30       ` Jakub Kicinski
2020-11-24 23:00         ` Daniel Borkmann
2020-11-24 23:10           ` Jakub Kicinski

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=611eb5973eb88b0a7a342f44c818b3bcb6e94c8c.1605889259.git.lorenzo@kernel.org \
    --to=lorenzo@kernel.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=echaudro@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).