Message ID | 20250228012534.3460918-6-kuba@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | eth: bnxt: maintain basic pkt/byte counters in SW | expand |
On Thu, Feb 27, 2025 at 5:25 PM Jakub Kicinski <kuba@kernel.org> wrote: > > Use IS_ENABLED(CONFIG_INET) to make the code easier to refactor. > Now all packets which did not go thru GRO will exit in the same > branch. > > Signed-off-by: Jakub Kicinski <kuba@kernel.org> In the old days, tcp_gro_complete() was undefined without CONFIG_INET and that's why we needed the #ifdef. Now there is a stub for tcp_gro_complete() so this will work. Reviewed-by: Michael Chan <michael.chan@broadcom.com>
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 854e7ec5390b..d8a24a8bcfe8 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -1740,12 +1740,11 @@ static inline struct sk_buff *bnxt_gro_skb(struct bnxt *bp, struct rx_tpa_end_cmp_ext *tpa_end1, struct sk_buff *skb) { -#ifdef CONFIG_INET int payload_off; u16 segs; segs = TPA_END_TPA_SEGS(tpa_end); - if (segs == 1) + if (segs == 1 || !IS_ENABLED(CONFIG_INET)) return skb; NAPI_GRO_CB(skb)->count = segs; @@ -1759,7 +1758,6 @@ static inline struct sk_buff *bnxt_gro_skb(struct bnxt *bp, skb = bp->gro_func(tpa_info, payload_off, TPA_END_GRO_TS(tpa_end), skb); if (likely(skb)) tcp_gro_complete(skb); -#endif return skb; }
Use IS_ENABLED(CONFIG_INET) to make the code easier to refactor. Now all packets which did not go thru GRO will exit in the same branch. Signed-off-by: Jakub Kicinski <kuba@kernel.org> --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)