Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] bnxt_en: Fix randconfig build errors.
@ 2017-10-28  5:56 Michael Chan
  2017-10-28  6:05 ` Yunsheng Lin
  2017-10-28  9:24 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Chan @ 2017-10-28  5:56 UTC (permalink / raw)
  To: davem; +Cc: kubakici, netdev

Fix undefined symbols when CONFIG_VLAN_8021Q or CONFIG_INET is not set.

Fixes: 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")
Reported-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
index 798d139..d5031f4 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
@@ -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,
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] bnxt_en: Fix randconfig build errors.
  2017-10-28  5:56 [PATCH net-next] bnxt_en: Fix randconfig build errors Michael Chan
@ 2017-10-28  6:05 ` Yunsheng Lin
  2017-10-28  6:15   ` Jakub Kicinski
  2017-10-28  9:24 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Yunsheng Lin @ 2017-10-28  6:05 UTC (permalink / raw)
  To: Michael Chan, davem; +Cc: kubakici, netdev

Hi, Michael

On 2017/10/28 13:56, Michael Chan wrote:
> Fix undefined symbols when CONFIG_VLAN_8021Q or CONFIG_INET is not set.
> 
> Fixes: 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")
> Reported-by: Jakub Kicinski <kubakici@wp.pl>
> Signed-off-by: Michael Chan <michael.chan@broadcom.com>
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
> index 798d139..d5031f4 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
> @@ -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

>  	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,
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] bnxt_en: Fix randconfig build errors.
  2017-10-28  6:05 ` Yunsheng Lin
@ 2017-10-28  6:15   ` Jakub Kicinski
  2017-10-28  6:41     ` Michael Chan
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2017-10-28  6:15 UTC (permalink / raw)
  To: Yunsheng Lin; +Cc: Michael Chan, davem, netdev

On Sat, 28 Oct 2017 14:05:04 +0800, Yunsheng Lin wrote:
> Hi, Michael
> 
> On 2017/10/28 13:56, Michael Chan wrote:
> > Fix undefined symbols when CONFIG_VLAN_8021Q or CONFIG_INET is not set.
> > 
> > Fixes: 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")
> > Reported-by: Jakub Kicinski <kubakici@wp.pl>
> > Signed-off-by: Michael Chan <michael.chan@broadcom.com>
> > ---
> >  drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
> > index 798d139..d5031f4 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
> > @@ -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.

It's OK, CONFIG_INET can't be a module.

> >  	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)

But here you should perhaps use IS_REACHABLE() otherwise when bnxt is
built in and 8021q is a module there could be trouble, no?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] bnxt_en: Fix randconfig build errors.
  2017-10-28  6:15   ` Jakub Kicinski
@ 2017-10-28  6:41     ` Michael Chan
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2017-10-28  6:41 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: Yunsheng Lin, David Miller, Netdev

On Fri, Oct 27, 2017 at 11:15 PM, Jakub Kicinski <kubakici@wp.pl> wrote:
> On Sat, 28 Oct 2017 14:05:04 +0800, Yunsheng Lin wrote:
>> Hi, Michael
>>
>> On 2017/10/28 13:56, Michael Chan wrote:
>> > Fix undefined symbols when CONFIG_VLAN_8021Q or CONFIG_INET is not set.
>> >
>> > Fixes: 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")
>> > Reported-by: Jakub Kicinski <kubakici@wp.pl>
>> > Signed-off-by: Michael Chan <michael.chan@broadcom.com>
>> > ---
>> >  drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 6 ++++++
>> >  1 file changed, 6 insertions(+)
>> >
>> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
>> > index 798d139..d5031f4 100644
>> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
>> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
>> > @@ -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.
>
> It's OK, CONFIG_INET can't be a module.
>
>> >     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)
>
> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] bnxt_en: Fix randconfig build errors.
  2017-10-28  5:56 [PATCH net-next] bnxt_en: Fix randconfig build errors Michael Chan
  2017-10-28  6:05 ` Yunsheng Lin
@ 2017-10-28  9:24 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2017-10-28  9:24 UTC (permalink / raw)
  To: michael.chan; +Cc: kubakici, netdev

From: Michael Chan <michael.chan@broadcom.com>
Date: Sat, 28 Oct 2017 01:56:10 -0400

> Fix undefined symbols when CONFIG_VLAN_8021Q or CONFIG_INET is not set.
> 
> Fixes: 8c95f773b4a3 ("bnxt_en: add support for Flower based vxlan encap/decap offload")
> Reported-by: Jakub Kicinski <kubakici@wp.pl>
> Signed-off-by: Michael Chan <michael.chan@broadcom.com>

Applied, thanks Michael.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-28  9:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-28  5:56 [PATCH net-next] bnxt_en: Fix randconfig build errors Michael Chan
2017-10-28  6:05 ` Yunsheng Lin
2017-10-28  6:15   ` Jakub Kicinski
2017-10-28  6:41     ` Michael Chan
2017-10-28  9:24 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox