From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org,
michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
przemyslaw.kitszel@intel.com, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v3 05/10] eth: bnxt: don't use ifdef to check for CONFIG_INET in GRO
Date: Wed, 5 Mar 2025 14:52:10 -0800 [thread overview]
Message-ID: <20250305225215.1567043-6-kuba@kernel.org> (raw)
In-Reply-To: <20250305225215.1567043-1-kuba@kernel.org>
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.
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
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;
}
--
2.48.1
next prev parent reply other threads:[~2025-03-05 22:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 22:52 [PATCH net-next v3 00/10] eth: bnxt: maintain basic pkt/byte counters in SW Jakub Kicinski
2025-03-05 22:52 ` [PATCH net-next v3 01/10] eth: bnxt: use napi_consume_skb() Jakub Kicinski
2025-03-05 22:52 ` [PATCH net-next v3 02/10] eth: bnxt: don't run xdp programs on fallback traffic Jakub Kicinski
2025-03-05 22:52 ` [PATCH net-next v3 03/10] eth: bnxt: rename ring_err_stats -> ring_drv_stats Jakub Kicinski
2025-03-05 22:52 ` [PATCH net-next v3 04/10] eth: bnxt: snapshot driver stats Jakub Kicinski
2025-03-05 22:52 ` Jakub Kicinski [this message]
2025-03-05 22:52 ` [PATCH net-next v3 06/10] eth: bnxt: consolidate the GRO-but-not-really paths in bnxt_gro_skb() Jakub Kicinski
2025-03-05 22:52 ` [PATCH net-next v3 07/10] eth: bnxt: extract VLAN info early on Jakub Kicinski
2025-03-05 22:52 ` [PATCH net-next v3 08/10] eth: bnxt: maintain rx pkt/byte stats in SW Jakub Kicinski
2025-03-05 22:52 ` [PATCH net-next v3 09/10] eth: bnxt: maintain tx " Jakub Kicinski
2025-03-09 8:25 ` Michael Chan
2025-03-05 22:52 ` [PATCH net-next v3 10/10] eth: bnxt: count xdp xmit packets Jakub Kicinski
2025-03-06 10:54 ` [PATCH net-next v3 00/10] eth: bnxt: maintain basic pkt/byte counters in SW Taehee Yoo
2025-03-06 15:24 ` Jakub Kicinski
2025-03-06 19:25 ` Michael Chan
2025-03-07 5:25 ` Taehee Yoo
2025-03-07 5:30 ` Michael Chan
2025-03-07 16:43 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250305225215.1567043-6-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).