bnxt_en: Fix randconfig build errors.
Michael Chan
maintainerPATCH 1/1 bnxt_en: Fix randconfig build errors.
Fix undefined symbols when CONFIG_VLAN_8021Q or CONFIG_INET is not set.
--- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +6 -0
@@ -904,6 +904,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp,struct bnxt_tc_l2_key *l2_info, struct net_device *real_dst_dev) { +#ifdef CONFIG_INET struct flowi4 flow = { {0} };struct net_device *dst_dev;struct neighbour *nbr;
@@ -925,6 +926,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp,*/ dst_dev = rt->dst.dev;if (is_vlan_dev (dst_dev)) { +#if IS_ENABLED (CONFIG_VLAN_8021Q )struct vlan_dev_priv *vlan =vlan_dev_priv (dst_dev);if (vlan->real_dev != real_dst_dev) {
@@ -938,6 +940,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, l2_info->inner_vlan_tci =htons (vlan->vlan_id); l2_info->inner_vlan_tpid = vlan->vlan_proto; l2_info->num_vlans =1 ; +#endif }else if (dst_dev != real_dst_dev) { netdev_info(bp->dev, "dst_dev(%s) for %pI4b is not PF-if(%s)",
@@ -966,6 +969,9 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, put_rt:ip_rt_put (rt);return rc; +#else +return -EOPNOTSUPP ; +#endif } static int bnxt_tc_get_decap_handle(struct bnxt *bp, struct bnxt_tc_flow *flow,
Signature · 1 line
1.8.3.1
Hi, Michael
Quoted 14 lines · Michael Chan
Fix undefined symbols when
CONFIG_VLAN_8021QorCONFIG_INETis not set.Fixes 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")Reported-by Jakub Kicinski <[email protected]>Signed-off-by Michael Chan <[email protected]>--- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +0
-0
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, · line 907
Quoted 4 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +1
-0@@ -904,6 +904,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp,struct bnxt_tc_l2_key *l2_info, struct net_device *real_dst_dev) { +#ifdef CONFIG_INET
Can we use #if IS_ENABLED(CONFIG_INET) here too?
I am not familiar with IS_ENABLED, just thought it would be good to be constistent because you are using IS_ENABLED below.
Best Regards
Yunsheng Lin
Quoted 30 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +5
-0struct flowi4 flow = { {0 } };struct net_device *dst_dev;struct neighbour *nbr;@@ -925,6 +926,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp,*/ dst_dev = rt->dst.dev;if (is_vlan_dev (dst_dev)) { +#if IS_ENABLED (CONFIG_VLAN_8021Q )struct vlan_dev_priv *vlan =vlan_dev_priv (dst_dev);if (vlan->real_dev != real_dst_dev) {@@ -938,6 +940,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, l2_info->inner_vlan_tci =htons (vlan->vlan_id); l2_info->inner_vlan_tpid = vlan->vlan_proto; l2_info->num_vlans =1 ; +#endif }else if (dst_dev != real_dst_dev) { netdev_info(bp->dev, "dst_dev(%s) for %pI4b is not PF-if(%s)",@@ -966,6 +969,9 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, put_rt:ip_rt_put (rt);return rc; +#else +return -EOPNOTSUPP ; +#endif } static int bnxt_tc_get_decap_handle(struct bnxt *bp, struct bnxt_tc_flow *flow,
Quoted 24 lines · Yunsheng Lin
Hi, Michael
Quoted 14 lines · Michael Chan
Fix undefined symbols when
CONFIG_VLAN_8021QorCONFIG_INETis not set.Fixes 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")Reported-by Jakub Kicinski <[email protected]>Signed-off-by Michael Chan <[email protected]>--- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +0
-0drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, · line 907
Quoted 4 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +1
-0@@ -904,6 +904,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp,struct bnxt_tc_l2_key *l2_info, struct net_device *real_dst_dev) { +#ifdef CONFIG_INETCan we use #if
IS_ENABLED(CONFIG_INET)here too?
Quoted 2 lines
I am not familiar with
IS_ENABLED, just thought it would be good to be constistent because you are usingIS_ENABLEDbelow.
It's OK, CONFIG_INET can't be a module.
Quoted 8 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, · line 929
Quoted 8 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +1
-0struct flowi4 flow = { {0 } };struct net_device *dst_dev;struct neighbour *nbr;@@ -925,6 +926,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp,*/ dst_dev = rt->dst.dev;if (is_vlan_dev (dst_dev)) { +#if IS_ENABLED (CONFIG_VLAN_8021Q )
But here you should perhaps use IS_REACHABLE() otherwise when bnxt is built in and 8021q is a module there could be trouble, no?
Michael Chan
maintainerQuoted 30 lines · Jakub Kicinski
Quoted 24 lines · Yunsheng Lin
Hi, Michael
Quoted 14 lines · Michael Chan
Fix undefined symbols when
CONFIG_VLAN_8021QorCONFIG_INETis not set.Fixes 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")Reported-by Jakub Kicinski <[email protected]>Signed-off-by Michael Chan <[email protected]>--- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +0
-0drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, · line 907
Quoted 4 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +1
-0@@ -904,6 +904,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp,struct bnxt_tc_l2_key *l2_info, struct net_device *real_dst_dev) { +#ifdef CONFIG_INETCan we use #if
IS_ENABLED(CONFIG_INET)here too?Quoted 2 lines
I am not familiar with
IS_ENABLED, just thought it would be good to be constistent because you are usingIS_ENABLEDbelow.It's OK,
CONFIG_INETcan't be a module.
Quoted 11 lines
Quoted 8 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp, · line 929
Quoted 8 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +1
-0struct flowi4 flow = { {0 } };struct net_device *dst_dev;struct neighbour *nbr;@@ -925,6 +926,7 @@ static int bnxt_tc_resolve_tunnel_hdrs(struct bnxt *bp,*/ dst_dev = rt->dst.dev;if (is_vlan_dev (dst_dev)) { +#if IS_ENABLED (CONFIG_VLAN_8021Q )But here you should perhaps use
IS_REACHABLE()otherwise when bnxt is built in and 8021q is a module there could be trouble, no?
I believe there shouldn't be trouble because the vlan_core code is always builtin if CONFIG_VLAN_8021Q is m or y. The symbols we need are in vlan_core.
From: Michael Chan <[email protected]>
Date: Sat, 28 Oct 2017 01:56:10 -0400
Quoted 5 lines
Fix undefined symbols when
CONFIG_VLAN_8021QorCONFIG_INETis not set.Fixes 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")Reported-by Jakub Kicinski <[email protected]>Signed-off-by Michael Chan <[email protected]>
Applied, thanks Michael.