netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] cxgb4vf: Fix netdev_features flag
@ 2017-10-23 10:03 Ganesh Goudar
  2017-10-23 12:13 ` David Miller
  2017-10-23 13:08 ` kbuild test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Ganesh Goudar @ 2017-10-23 10:03 UTC (permalink / raw)
  To: netdev, davem
  Cc: nirranjan, indranil, venkatesh, Arjun Vynipadath, Ganesh Goudar

From: Arjun Vynipadath <arjun@chelsio.com>

GRO is not supported by Chelsio HW when rx_csum is disabled.
Update the netdev features flag when rx_csum is modified.

Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 8996ebb..d6d26bf 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2762,6 +2762,16 @@ static int enable_msix(struct adapter *adapter)
 	return 0;
 }
 
+static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
+					      netdev_features_t features)
+{
+	/* Disable GRO, if RX_CSUM is disabled */
+	if (!(features & NETIF_F_RXCSUM))
+		features &= ~NETIF_F_GRO;
+
+	return features;
+}
+
 static const struct net_device_ops cxgb4vf_netdev_ops	= {
 	.ndo_open		= cxgb4vf_open,
 	.ndo_stop		= cxgb4vf_stop,
@@ -2777,6 +2787,7 @@ static const struct net_device_ops cxgb4vf_netdev_ops	= {
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	= cxgb4vf_poll_controller,
 #endif
+	.ndo_fix_features	= cxgb4vf_fix_features,
 };
 
 /*
-- 
2.1.0

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

* Re: [PATCH net-next] cxgb4vf: Fix netdev_features flag
  2017-10-23 10:03 Ganesh Goudar
@ 2017-10-23 12:13 ` David Miller
  2017-10-23 13:08 ` kbuild test robot
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2017-10-23 12:13 UTC (permalink / raw)
  To: ganeshgr; +Cc: netdev, nirranjan, indranil, venkatesh, arjun

From: Ganesh Goudar <ganeshgr@chelsio.com>
Date: Mon, 23 Oct 2017 15:33:30 +0530

> From: Arjun Vynipadath <arjun@chelsio.com>
> 
> GRO is not supported by Chelsio HW when rx_csum is disabled.
> Update the netdev features flag when rx_csum is modified.
> 
> Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>

This doesn't even compile:

  CC [M]  drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.o
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c:2765:26: error: redefinition of ‘cxgb4vf_fix_features’
 static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
                          ^~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c:1114:26: note: previous definition of ‘cxgb4vf_fix_features’ was here
 static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
                          ^~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c:1114:26: warning: ‘cxgb4vf_fix_features’ defined but not used [-Wunused-function]
scripts/Makefile.build:313: recipe for target 'drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.o' failed
make[1]: *** [drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.o] Error 1
Makefile:1653: recipe for target 'drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.o' failed
make: *** [drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.o] Error 2

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

* Re: [PATCH net-next] cxgb4vf: Fix netdev_features flag
  2017-10-23 10:03 Ganesh Goudar
  2017-10-23 12:13 ` David Miller
@ 2017-10-23 13:08 ` kbuild test robot
  1 sibling, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2017-10-23 13:08 UTC (permalink / raw)
  To: Ganesh Goudar
  Cc: kbuild-all, netdev, davem, nirranjan, indranil, venkatesh,
	Arjun Vynipadath, Ganesh Goudar

[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

Hi Arjun,

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Ganesh-Goudar/cxgb4vf-Fix-netdev_features-flag/20171023-201033
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c:2765:26: error: redefinition of 'cxgb4vf_fix_features'
    static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
                             ^
   drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c:1114:26: note: previous definition of 'cxgb4vf_fix_features' was here
    static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
                             ^
   drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c:1114:26: warning: 'cxgb4vf_fix_features' defined but not used [-Wunused-function]

vim +/cxgb4vf_fix_features +2765 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

  2764	
> 2765	static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
  2766						      netdev_features_t features)
  2767	{
  2768		/* Disable GRO, if RX_CSUM is disabled */
  2769		if (!(features & NETIF_F_RXCSUM))
  2770			features &= ~NETIF_F_GRO;
  2771	
  2772		return features;
  2773	}
  2774	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 51684 bytes --]

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

* [PATCH net-next] cxgb4vf: Fix netdev_features flag
@ 2017-12-01 14:59 Ganesh Goudar
  2017-12-01 15:16 ` Alexander Duyck
  0 siblings, 1 reply; 6+ messages in thread
From: Ganesh Goudar @ 2017-12-01 14:59 UTC (permalink / raw)
  To: netdev, davem
  Cc: nirranjan, indranil, venkatesh, Ganesh Goudar, Arjun Vynipadath

GRO is not supported by Chelsio HW when rx_csum is disabled.
Update the netdev features flag when rx_csum is modified.

Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index b48361c..8e993ac 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -1114,6 +1114,10 @@ static int cxgb4vf_change_mtu(struct net_device *dev, int new_mtu)
 static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
 	netdev_features_t features)
 {
+	/* Disable GRO, if RX_CSUM is disabled */
+	if (!(features & NETIF_F_RXCSUM))
+		features &= ~NETIF_F_GRO;
+
 	/*
 	 * Since there is no support for separate rx/tx vlan accel
 	 * enable/disable make sure tx flag is always in same state as rx.
-- 
2.1.0

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

* Re: [PATCH net-next] cxgb4vf: Fix netdev_features flag
  2017-12-01 14:59 [PATCH net-next] cxgb4vf: Fix netdev_features flag Ganesh Goudar
@ 2017-12-01 15:16 ` Alexander Duyck
  2017-12-01 15:58   ` Ganesh Goudar
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Duyck @ 2017-12-01 15:16 UTC (permalink / raw)
  To: Ganesh Goudar
  Cc: Netdev, David Miller, nirranjan, indranil, venkatesh,
	Arjun Vynipadath

On Fri, Dec 1, 2017 at 6:59 AM, Ganesh Goudar <ganeshgr@chelsio.com> wrote:
> GRO is not supported by Chelsio HW when rx_csum is disabled.
> Update the netdev features flag when rx_csum is modified.
>
> Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
> ---
>  drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
> index b48361c..8e993ac 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
> @@ -1114,6 +1114,10 @@ static int cxgb4vf_change_mtu(struct net_device *dev, int new_mtu)
>  static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
>         netdev_features_t features)
>  {
> +       /* Disable GRO, if RX_CSUM is disabled */
> +       if (!(features & NETIF_F_RXCSUM))
> +               features &= ~NETIF_F_GRO;
> +
>         /*
>          * Since there is no support for separate rx/tx vlan accel
>          * enable/disable make sure tx flag is always in same state as rx.

Wouldn't it make more sense to just put this in netdev_fix_features? I
would thing GRO cannot be supported on any device if RX_CSUM is
disabled since GRO depends on checksum validation from the hardware
before it can aggregate the frame.

- Alex

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

* Re: [PATCH net-next] cxgb4vf: Fix netdev_features flag
  2017-12-01 15:16 ` Alexander Duyck
@ 2017-12-01 15:58   ` Ganesh Goudar
  0 siblings, 0 replies; 6+ messages in thread
From: Ganesh Goudar @ 2017-12-01 15:58 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: Netdev, David Miller, nirranjan, indranil, venkatesh,
	Arjun Vynipadath

On Friday, December 12/01/17, 2017 at 07:16:38 -0800, Alexander Duyck wrote:
> On Fri, Dec 1, 2017 at 6:59 AM, Ganesh Goudar <ganeshgr@chelsio.com> wrote:
> > GRO is not supported by Chelsio HW when rx_csum is disabled.
> > Update the netdev features flag when rx_csum is modified.
> >
> > Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
> > Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
> > ---
> >  drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
> > index b48361c..8e993ac 100644
> > --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
> > +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
> > @@ -1114,6 +1114,10 @@ static int cxgb4vf_change_mtu(struct net_device *dev, int new_mtu)
> >  static netdev_features_t cxgb4vf_fix_features(struct net_device *dev,
> >         netdev_features_t features)
> >  {
> > +       /* Disable GRO, if RX_CSUM is disabled */
> > +       if (!(features & NETIF_F_RXCSUM))
> > +               features &= ~NETIF_F_GRO;
> > +
> >         /*
> >          * Since there is no support for separate rx/tx vlan accel
> >          * enable/disable make sure tx flag is always in same state as rx.
> 
> Wouldn't it make more sense to just put this in netdev_fix_features? I
> would thing GRO cannot be supported on any device if RX_CSUM is
> disabled since GRO depends on checksum validation from the hardware
> before it can aggregate the frame.
> 
> - Alex
Makes sense, but let us see what others has to say.

Ganesh

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

end of thread, other threads:[~2017-12-01 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-01 14:59 [PATCH net-next] cxgb4vf: Fix netdev_features flag Ganesh Goudar
2017-12-01 15:16 ` Alexander Duyck
2017-12-01 15:58   ` Ganesh Goudar
  -- strict thread matches above, loose matches on Subject: below --
2017-10-23 10:03 Ganesh Goudar
2017-10-23 12:13 ` David Miller
2017-10-23 13:08 ` kbuild test robot

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