Skip to content

Commit

Permalink
bnxt_en: Fix compile warnings when CONFIG_INET is not set.
Browse files Browse the repository at this point in the history
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 <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Chan authored and David S. Miller committed Oct 26, 2015
1 parent 3ed770f commit d1611c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ static inline struct sk_buff *bnxt_gro_skb(struct bnxt_tpa_info *tpa_info,
struct rx_tpa_end_cmp_ext *tpa_end1,
struct sk_buff *skb)
{
#ifdef CONFIG_INET
struct tcphdr *th;
int payload_off, tcp_opt_len = 0;
int len, nw_off;
Expand All @@ -866,7 +867,6 @@ static inline struct sk_buff *bnxt_gro_skb(struct bnxt_tpa_info *tpa_info,
if (TPA_END_GRO_TS(tpa_end))
tcp_opt_len = 12;

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

Expand Down
5 changes: 5 additions & 0 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,12 @@ struct bnxt {
#define BNXT_FLAG_DCB_ENABLED 0x1
#define BNXT_FLAG_VF 0x2
#define BNXT_FLAG_LRO 0x4
#ifdef CONFIG_INET
#define BNXT_FLAG_GRO 0x8
#else
/* Cannot support hardware GRO if CONFIG_INET is not set */
#define BNXT_FLAG_GRO 0x0
#endif
#define BNXT_FLAG_TPA (BNXT_FLAG_LRO | BNXT_FLAG_GRO)
#define BNXT_FLAG_JUMBO 0x10
#define BNXT_FLAG_STRIP_VLAN 0x20
Expand Down

0 comments on commit d1611c3

Please sign in to comment.