nfp: using napi_build_skb() to replace build_skb()
authorFei Qin <fei.qin@corigine.com>
Thu, 26 Oct 2023 08:00:58 +0000 (10:00 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 27 Oct 2023 21:48:13 +0000 (14:48 -0700)
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: Fei Qin <fei.qin@corigine.com>
Signed-off-by: Louis Peens <louis.peens@corigine.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Link: https://lore.kernel.org/r/20231026080058.22810-1-louis.peens@corigine.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/netronome/nfp/nfd3/dp.c
drivers/net/ethernet/netronome/nfp/nfdk/dp.c

index 0cc026b0aefd47d33f665b43e64ccd731cccc9af..17381bfc15d722d73bcb495e16724547e3f06306 100644 (file)
@@ -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;
index 33b6d74adb4b55a90b0d98895860de8c4cbacafa..8d78c6faefa8aa9f6a0a43f0a76b7fdd2512538f 100644 (file)
@@ -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;