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

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.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 796dc3c7
...@@ -1070,7 +1070,7 @@ static int nfp_nfd3_rx(struct nfp_net_rx_ring *rx_ring, int budget) ...@@ -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); 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)) { if (unlikely(!skb)) {
nfp_nfd3_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL); nfp_nfd3_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
continue; continue;
......
...@@ -1189,7 +1189,7 @@ static int nfp_nfdk_rx(struct nfp_net_rx_ring *rx_ring, int budget) ...@@ -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); 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)) { if (unlikely(!skb)) {
nfp_nfdk_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL); nfp_nfdk_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment