[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210514183954.7129-2-mcroce@linux.microsoft.com>
Date: Fri, 14 May 2021 20:39:52 +0200
From: Matteo Croce <mcroce@...ux.microsoft.com>
To: netdev@...r.kernel.org, bpf@...r.kernel.org,
intel-wired-lan@...ts.osuosl.org,
linux-stm32@...md-mailman.stormreply.com, kvm@...r.kernel.org,
virtualization@...ts.linux-foundation.org
Cc: linux-kernel@...r.kernel.org,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>
Subject: [PATCH net-next 1/3] stmmac: use XDP helpers
From: Matteo Croce <mcroce@...rosoft.com>
Make use of the xdp_{init,prepare}_buff() helpers instead of
an open-coded version.
Signed-off-by: Matteo Croce <mcroce@...rosoft.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 345b4c6d1fd4..bf9fe25fed69 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5167,12 +5167,9 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
dma_sync_single_for_cpu(priv->device, buf->addr,
buf1_len, dma_dir);
- xdp.data = page_address(buf->page) + buf->page_offset;
- xdp.data_end = xdp.data + buf1_len;
- xdp.data_hard_start = page_address(buf->page);
- xdp_set_data_meta_invalid(&xdp);
- xdp.frame_sz = buf_sz;
- xdp.rxq = &rx_q->xdp_rxq;
+ xdp_init_buff(&xdp, buf_sz, &rx_q->xdp_rxq);
+ xdp_prepare_buff(&xdp, page_address(buf->page),
+ buf->page_offset, buf1_len, false);
pre_len = xdp.data_end - xdp.data_hard_start -
buf->page_offset;
--
2.31.1
Powered by blists - more mailing lists