cxgb4vf: Fix netdev_features flag
Subsystems (3)
PATCH 1/1 cxgb4vf: Fix netdev_features flag
From: Arjun Vynipadath <[email protected]>
GRO is not supported by Chelsio HW when rx_csum is disabled. Update the netdev features flag when rx_csum is modified.
--- drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +11 -0
@@ -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, };/*
Signature · 1 line
2.1.0
David Miller
maintainerFrom: Ganesh Goudar <[email protected]>
Date: Mon, 23 Oct 2017 15:33:30 +0530
Quoted 7 lines
From: Arjun Vynipadath <[email protected]>
GRO is not supported by Chelsio HW when
rx_csumis disabled. Update the netdev features flag whenrx_csumis modified.Signed-off-by Arjun Vynipadath <[email protected]>Signed-off-by Ganesh Goudar <[email protected]>
This doesn't even compile:
CC [M] drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.odrivers/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
kbuild test robot
build boturl: 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…
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