Skip to content

Commit d1611c3

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Fix compile warnings when CONFIG_INET is not set.
bnxt_gro_skb() has unused variables when CONFIG_INET is not set. We really cannot support hardware GRO if CONFIG_INET is not set, so compile out bnxt_gro_skb() completely and define BNXT_FLAG_GRO to be 0 if CONFIG_INET is not set. This will effectively always disable hardware GRO if CONFIG_INET is not set. Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3ed770f commit d1611c3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ static inline struct sk_buff *bnxt_gro_skb(struct bnxt_tpa_info *tpa_info,
852852
struct rx_tpa_end_cmp_ext *tpa_end1,
853853
struct sk_buff *skb)
854854
{
855+
#ifdef CONFIG_INET
855856
struct tcphdr *th;
856857
int payload_off, tcp_opt_len = 0;
857858
int len, nw_off;
@@ -866,7 +867,6 @@ static inline struct sk_buff *bnxt_gro_skb(struct bnxt_tpa_info *tpa_info,
866867
if (TPA_END_GRO_TS(tpa_end))
867868
tcp_opt_len = 12;
868869

869-
#ifdef CONFIG_INET
870870
if (tpa_info->gso_type == SKB_GSO_TCPV4) {
871871
struct iphdr *iph;
872872

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,12 @@ struct bnxt {
855855
#define BNXT_FLAG_DCB_ENABLED 0x1
856856
#define BNXT_FLAG_VF 0x2
857857
#define BNXT_FLAG_LRO 0x4
858+
#ifdef CONFIG_INET
858859
#define BNXT_FLAG_GRO 0x8
860+
#else
861+
/* Cannot support hardware GRO if CONFIG_INET is not set */
862+
#define BNXT_FLAG_GRO 0x0
863+
#endif
859864
#define BNXT_FLAG_TPA (BNXT_FLAG_LRO | BNXT_FLAG_GRO)
860865
#define BNXT_FLAG_JUMBO 0x10
861866
#define BNXT_FLAG_STRIP_VLAN 0x20

0 commit comments

Comments
 (0)