From: Lorenzo Bianconi Date: Fri, 20 Nov 2020 17:05:42 +0000 (+0100) Subject: net: mvneta: avoid unnecessary xdp_buff initialization X-Git-Tag: v5.11-rc1~169^2~178^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05c748f7d09ab1104b309a110f61560945f73f8b;p=thirdparty%2Fkernel%2Flinux.git net: mvneta: avoid unnecessary xdp_buff initialization Explicitly initialize mandatory fields defining xdp_buff struct in mvneta_rx_swbm routine Signed-off-by: Lorenzo Bianconi Reviewed-by: Jesse Brandeburg Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 5d559117f78cc..60a285f3a55f1 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);