Message ID | 20231207000551.138584-3-michael.chan@broadcom.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | bnxt_en: Misc. fixes | expand |
On Wed, 6 Dec 2023 16:05:49 -0800 Michael Chan wrote: > Receive SKBs can go through the VF-rep path or the normal path. > skb_mark_for_recycle() is only called for the normal path. Fix it > to do it for both paths to fix possible stalled page pool shutdown > errors. This patch is probably fine, but since I'm complaining - IMHO it may be better to mark the skbs right after they are allocated. Catching all "exit points" seems very error prone...
On Thu, 7 Dec 2023 10:21:44 -0800 Jakub Kicinski wrote: > On Wed, 6 Dec 2023 16:05:49 -0800 Michael Chan wrote: > > Receive SKBs can go through the VF-rep path or the normal path. > > skb_mark_for_recycle() is only called for the normal path. Fix it > > to do it for both paths to fix possible stalled page pool shutdown > > errors. > > This patch is probably fine, but since I'm complaining - > IMHO it may be better to mark the skbs right after they > are allocated. Catching all "exit points" seems very error > prone... To be 100% clear - I mean that as a suggestion for a potential net-next cleanup.
On Thu, Dec 07, 2023 at 10:21:44AM -0800, Jakub Kicinski wrote: > On Wed, 6 Dec 2023 16:05:49 -0800 Michael Chan wrote: > > Receive SKBs can go through the VF-rep path or the normal path. > > skb_mark_for_recycle() is only called for the normal path. Fix it > > to do it for both paths to fix possible stalled page pool shutdown > > errors. > > This patch is probably fine, but since I'm complaining - > IMHO it may be better to mark the skbs right after they > are allocated. Catching all "exit points" seems very error > prone... That's a good suggestion. To take it a step further...what about a third arg (bool) to build_skb that would automatically call skb_mark_for_recycle if the new 3rd arg was true? I don't love the extra arg, but that would avoid duplicating the need to call skb_mark_for_recycle for all drivers that use the page pool for all data.
On Thu, 7 Dec 2023 13:37:40 -0500 Andy Gospodarek wrote: > That's a good suggestion. To take it a step further...what about a > third arg (bool) to build_skb that would automatically call > skb_mark_for_recycle if the new 3rd arg was true? I don't love the > extra arg, but that would avoid duplicating the need to call > skb_mark_for_recycle for all drivers that use the page pool for all > data. 2x yes, would be great to have a function which just sets as recycling by default; also don't love the extra arg / I could not come up with a nice API quickly :(
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 72f2fc983940..b4a5311bdeb5 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -1748,13 +1748,14 @@ static void bnxt_tpa_agg(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, static void bnxt_deliver_skb(struct bnxt *bp, struct bnxt_napi *bnapi, struct sk_buff *skb) { + skb_mark_for_recycle(skb); + if (skb->dev != bp->dev) { /* this packet belongs to a vf-rep */ bnxt_vf_rep_rx(bp, skb); return; } skb_record_rx_queue(skb, bnapi->index); - skb_mark_for_recycle(skb); napi_gro_receive(&bnapi->napi, skb); }