iavf: Fix handling of vlan strip virtual channel messages
Subsystems (2)
PATCH 1/1 iavf: Fix handling of vlan strip virtual channel messages
Modify netdev->features for vlan stripping based on virtual channel messages received from the PF. Change is needed to synchronize vlan strip status between PF sysfs and iavf ethtool.
---
v2: commit message and comments corrected
note that splitting lines is necessary because the number of allowable characters on the line is exceeded
--- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +43 -1
@@ -1456,6 +1456,22 @@ void iavf_request_reset(struct iavf_adapter *adapter) adapter->current_op =VIRTCHNL_OP_UNKNOWN ; } +/** +* iavf_netdev_features_vlan_strip_set +* @netdev: ptr to netdev being adjusted +* @enable: enable or disable vlan strip +* +* Helper function to change vlan strip status in netdev->features. +**/ +static void iavf_netdev_features_vlan_strip_set (struct net_device *netdev, +const bool enable) +{ +if (enable) + netdev->features |=NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_RX ; +else + netdev->features &= ~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX ; +} +/** * iavf_virtchnl_completion * @adapter: adapter structure
@@ -1679,8 +1695,20 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, }break ;case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING : +dev_warn (&adapter->pdev->dev, +"Changing VLAN Stripping is not allowed when Port VLAN is configured\n" ); +/*Vlan stripping could not be enabled by ethtool. +* Disable it in netdev->features. +*/ +iavf_netdev_features_vlan_strip_set (netdev, false); +break ;case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING : -dev_warn (&adapter->pdev->dev,"Changing VLAN Stripping is not allowed when Port VLAN is configured\n" ); +dev_warn (&adapter->pdev->dev, +"Changing VLAN Stripping is not allowed when Port VLAN is configured\n" ); +/*Vlan stripping could not be disabled by ethtool. +* Enable it in netdev->features. +*/ +iavf_netdev_features_vlan_strip_set (netdev, true);break ;default : dev_err(&adapter->pdev->dev, "PF returned error %d (%s) to our request %d\n",
@@ -1897,6 +1925,20 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,spin_unlock_bh (&adapter->adv_rss_lock); }break ; +case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING : +/*Got information that PF enabled vlan strip on this VF. +* Update netdev->features if needed to be in sync with ethtool. +*/ +if (!v_retval) +iavf_netdev_features_vlan_strip_set (netdev, true); +break ; +case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING : +/* Got information that PF disabled vlan strip on this VF. +* Update netdev->features if needed to be in sync with ethtool. +*/ +if (!v_retval) +iavf_netdev_features_vlan_strip_set (netdev, false); +break ;default :if (adapter->current_op && (v_opcode != adapter->current_op)) dev_dbg(&adapter->pdev->dev, "Expected response %d from PF, received %d\n",
Signature · 1 line
2.27.0
Nguyen
PATCH 1/1 iavf: Fix handling of vlan strip virtual channel messages
Quoted 6 lines · Michal Maloszewski
Modify
netdev->featuresfor vlan stripping based on virtual channel messages received from the PF. Change is needed to synchronize vlan strip status between PF sysfs and iavf ethtool.Fixes 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return thenumber of pages it actually freed")
I don't see the relation between this patch and the Fixes. If I'm missing something, can you explain?
Quoted 4 lines
Signed-off-by Norbert Ciosek <[email protected]>Signed-off-by Michal Maloszewski <[email protected]>---
v2: commit message and comments corrected
Your title has v1, but there's a v2 here?
Quoted 2 lines
??? note that splitting lines is necessary because the number of allowable characters on the line is exceeded
Strings are not part of the character limit rule. If you run checkpatch, you will notice nothing is reported.
Also, please run checkpatch on your patches:
CHECK: Alignment should match open parenthesis
#112: FILE: drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1467:
+static void iavf_netdev_features_vlan_strip_set(struct net_device *netdev,
+ const bool enable)
WARNING: suspect code indent for conditional statements (8, 13) #114: FILE: drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1469:
+ if (enable)
+ netdev->features |= NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_RX;
WARNING: suspect code indent for conditional statements (8, 13) #116: FILE: drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1471:
+ else
+ netdev->features &= ~NETIF_F_HW_VLAN_CTAG_RX &
~NETIF_F_HW_VLAN_RX;
This also still does not apply. Are you using the correct tree? rebasing?
Quoted 98 lines
---
?.../net/ethernet/intel/iavf/iavf_virtchnl.c?? | 44
++++++++++++++++++-
?1 file changed, 43 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +0
-0@@ -1456,6 +1456,22 @@ void iavf_request_reset(struct iavf_adapter *adapter) ????????adapter->current_op = VIRTCHNL_OP_UNKNOWN; ?}?
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +8
-0+/** +* iavf_netdev_features_vlan_strip_set +* @netdev: ptr to netdev being adjusted +* @enable: enable or disable vlan strip +* +* Helper function to change vlan strip status in netdev->features. +**/ +static void iavf_netdev_features_vlan_strip_set(struct net_device*netdev,
+????????????????????????????????????????????? const bool enable) +{
+???????if (enable)
+???????????netdev->features|=NETIF_F_HW_VLAN_CTAG_RX|NETIF_F_HW_VLAN_RX;
+???????else
+???????????netdev->features&= ~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +2
-0+} +?/**
? *iavf_virtchnl_completion
? * @adapter: adapter structuredrivers/net/ethernet/intel/iavf/iavf_virtchnl.c +0
-0@@ -1679,8 +1695,20 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, ????????????????????????} ????????????????????????break;????????????????case
VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:
+???????????????????????dev_warn(&adapter->pdev->dev, +??????????????????????????????? "Changing VLAN Stripping is not allowed when Port VLAN is configured\n"); +???????????????????????/*Vlan stripping could not be enabled by ethtool.
+??????????????????????? * Disable it innetdev->features. +??????????????????????? */ +???????????????????????iavf_netdev_features_vlan_strip_set(netdev, false);
+???????????????????????break;
????????????????caseVIRTCHNL_OP_DISABLE_VLAN_STRIPPING:
-???????????????????????dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured\n"); +???????????????????????dev_warn(&adapter->pdev->dev, +??????????????????????????????? "Changing VLAN Stripping is not allowed when Port VLAN is configured\n"); +???????????????????????/*Vlan stripping could not be disabled by ethtool.
+??????????????????????? * Enable it innetdev->features. +??????????????????????? */ +???????????????????????iavf_netdev_features_vlan_strip_set(netdev, true);
????????????????????????break;
????????????????default:
????????????????????????dev_err(&adapter->pdev->dev, "PF returned error %d (%s) to our request %d\n",drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +2
-0@@ -1897,6 +1925,20 @@ void iavf_virtchnl_completion(structiavf_adapter *adapter, ????????????????spin_unlock_bh(&adapter->adv_rss_lock); ????????????????} ????????????????break; +???????case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING: +???????????????/*Got information that PF enabled vlan strip on thisVF.
+??????????????? * Updatenetdev->featuresif needed to be in sync with ethtool.
+??????????????? */
+???????????????if (!v_retval) +???????????????????????iavf_netdev_features_vlan_strip_set(netdev, true);
+???????????????break;
+???????caseVIRTCHNL_OP_DISABLE_VLAN_STRIPPING:
+???????????????/* Got information that PF disabled vlan strip on this VF.
+??????????????? * Updatenetdev->featuresif needed to be in sync with ethtool.
+??????????????? */
+???????????????if (!v_retval) +???????????????????????iavf_netdev_features_vlan_strip_set(netdev, false);
+???????????????break;
????????default:
????????????????if (adapter->current_op&& (v_opcode!= adapter-Quoted 1 line
current_op))????????????????????????dev_dbg(&adapter->pdev->dev, "Expected response %d from PF, received %d\n",
kernel test robot
build botThank you for the patch! Yet something to improve:
Hi Michal,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tnguy-next-queue/dev-queue]
[also build test ERROR on v5.15-rc5 next-20211012]
[cannot apply to net/master]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Michal-Maloszewski/iavf-Fix-handling-of-vlan-strip-virtual-channel-messages/20211012-215003 base: https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue config: riscv-randconfig-c006-20211012 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dcf39554dbea780d6cb7e12239451ba47a2668)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/da86d18f37a7ff9c6223f103e20908b9ee6a8b0c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Michal-Maloszewski/iavf-Fix-handling-of-vlan-strip-virtual-channel-messages/20211012-215003 git checkout da86d18f37a7ff9c6223f103e20908b9ee6a8b0c
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/net/ethernet/intel/iavf/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/byteorder/generic.h:142:18: note: expanded from macro 'ntohs'
#define ntohs(x) ___ntohs(x)
^~~~~~~~~~~
include/linux/byteorder/generic.h:137:21: note: expanded from macro '___ntohs'
#define ___ntohs(x) __be16_to_cpu(x)
^~~~~~~~~~~~~~~~
include/uapi/linux/byteorder/little_endian.h:42:26: note: expanded from macro '__be16_to_cpu'
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1141:5: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
ntohs(f->data.tcp_spec.src_port));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/byteorder/generic.h:142:18: note: expanded from macro 'ntohs'
#define ntohs(x) ___ntohs(x)
^~~~~~~~~~~
include/linux/byteorder/generic.h:137:21: note: expanded from macro '___ntohs'
#define ___ntohs(x) __be16_to_cpu(x)
^~~~~~~~~~~~~~~~
include/uapi/linux/byteorder/little_endian.h:42:26: note: expanded from macro '__be16_to_cpu'
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1147:5: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
ntohs(f->data.tcp_spec.vlan_id),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/byteorder/generic.h:142:18: note: expanded from macro 'ntohs'
#define ntohs(x) ___ntohs(x)
^~~~~~~~~~~
include/linux/byteorder/generic.h:137:21: note: expanded from macro '___ntohs'
#define ___ntohs(x) __be16_to_cpu(x)
^~~~~~~~~~~~~~~~
include/uapi/linux/byteorder/little_endian.h:42:26: note: expanded from macro '__be16_to_cpu'
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1150:5: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
ntohs(f->data.tcp_spec.dst_port),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/byteorder/generic.h:142:18: note: expanded from macro 'ntohs'
#define ntohs(x) ___ntohs(x)
^~~~~~~~~~~
include/linux/byteorder/generic.h:137:21: note: expanded from macro '___ntohs'
#define ___ntohs(x) __be16_to_cpu(x)
^~~~~~~~~~~~~~~~
include/uapi/linux/byteorder/little_endian.h:42:26: note: expanded from macro '__be16_to_cpu'
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1151:5: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
ntohs(f->data.tcp_spec.src_port));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/byteorder/generic.h:142:18: note: expanded from macro 'ntohs'
#define ntohs(x) ___ntohs(x)
^~~~~~~~~~~
include/linux/byteorder/generic.h:137:21: note: expanded from macro '___ntohs'
#define ___ntohs(x) __be16_to_cpu(x)
^~~~~~~~~~~~~~~~
include/uapi/linux/byteorder/little_endian.h:42:26: note: expanded from macro '__be16_to_cpu'
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1470:53: error: use of undeclared identifier 'NETIF_F_HW_VLAN_RX'
netdev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
^
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1472:55: error: use of undeclared identifier 'NETIF_F_HW_VLAN_RX'
netdev->features &= ~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
^6 warnings and 2 errors generated.
vim +/NETIF_F_HW_VLAN_RX +1470 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
1458
1459 /**
1460 * iavf_netdev_features_vlan_strip_set
1461 * @netdev: ptr to netdev being adjusted
1462 * @enable: enable or disable vlan strip
1463 *
1464 * Helper function to change vlan strip status in netdev->features.
1465 **/
1466 static void iavf_netdev_features_vlan_strip_set(struct net_device *netdev,
1467 const bool enable)
1468 {
1469 if (enable)
> 1470 netdev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
1471 else
1472 netdev->features &= ~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
1473 }
1474
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 39049 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20211013/c4253d0a/attachment-0001.bin>