Commit 1a86a77a authored by Fei Qin's avatar Fei Qin Committed by Jakub Kicinski
Browse files

nfp: using napi_build_skb() to replace build_skb()



The napi_build_skb() can reuse the skb in skb cache per CPU or
can allocate skbs in bulk, which helps improve the performance.

Signed-off-by: default avatarFei Qin <fei.qin@corigine.com>
Signed-off-by: default avatarLouis Peens <louis.peens@corigine.com>
Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
Link: https://lore.kernel.org/r/20231026080058.22810-1-louis.peens@corigine.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 796dc3c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1070,7 +1070,7 @@ static int nfp_nfd3_rx(struct nfp_net_rx_ring *rx_ring, int budget)
				nfp_repr_inc_rx_stats(netdev, pkt_len);
		}

		skb = build_skb(rxbuf->frag, true_bufsz);
		skb = napi_build_skb(rxbuf->frag, true_bufsz);
		if (unlikely(!skb)) {
			nfp_nfd3_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
			continue;
+1 −1
Original line number Diff line number Diff line
@@ -1189,7 +1189,7 @@ static int nfp_nfdk_rx(struct nfp_net_rx_ring *rx_ring, int budget)
				nfp_repr_inc_rx_stats(netdev, pkt_len);
		}

		skb = build_skb(rxbuf->frag, true_bufsz);
		skb = napi_build_skb(rxbuf->frag, true_bufsz);
		if (unlikely(!skb)) {
			nfp_nfdk_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
			continue;