All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2022-01-13 13:48 Michal Maloszewski
  2022-01-14 23:07 ` Nguyen, Anthony L
  0 siblings, 1 reply; 19+ messages in thread
From: Michal Maloszewski @ 2022-01-13 13:48 UTC (permalink / raw)
  To: intel-wired-lan

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.

Fixes: 310a2ad92e3f ("virtchnl: rename i40e to generic virtchnl")
Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
---
v3: NETIF_F_HW_VLAN_RX changed into NETIF_F_HW_VLAN_CTAG_RX because there's
no such definition since Linux 3.10. The code is the same as the one from OOT.
Code successfully passed inner review. netdev_update_features() function is not added 
because it causes infinite loop.
 .../net/ethernet/intel/iavf/iavf_virtchnl.c   | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index a40e29455f7d..1805c1ae3bf4 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -1490,6 +1490,24 @@ void iavf_request_reset(struct iavf_adapter *adapter)
 	adapter->current_op = VIRTCHNL_OP_UNKNOWN;
 }
 
+/**
+ * iavf_netdev_features_vlan_strip_set - update vlan strip status
+ * @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_CTAG_RX;
+	else
+		netdev->features &=
+			~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_CTAG_RX;
+}
+
 /**
  * iavf_virtchnl_completion
  * @adapter: adapter structure
@@ -1713,8 +1731,18 @@ 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");
+			/* 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",
@@ -1960,6 +1988,20 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
 		spin_unlock_bh(&adapter->adv_rss_lock);
 		}
 		break;
+	case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:
+		/* 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:
+		/* 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_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n",
-- 
2.27.0


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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
  2022-01-13 13:48 [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages Michal Maloszewski
@ 2022-01-14 23:07 ` Nguyen, Anthony L
  0 siblings, 0 replies; 19+ messages in thread
From: Nguyen, Anthony L @ 2022-01-14 23:07 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, 2022-01-13 at 13:48 +0000, Michal Maloszewski wrote:
> 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.
> 
> Fixes: 310a2ad92e3f ("virtchnl: rename i40e to generic virtchnl")

Please use the commit that introduced the functional issue, not a
rename patch.

> Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
> Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
> Signed-off-by: Brett Creeley <brett.creeley@intel.com>
> ---
> v3: NETIF_F_HW_VLAN_RX changed into NETIF_F_HW_VLAN_CTAG_RX because
> there's
> no such definition since Linux 3.10. The code is the same as the one
> from OOT.
> Code successfully passed inner review. netdev_update_features()
> function is not added 
> because it causes infinite loop.

This is a v1, but there's a v3 changelog?

> ?.../net/ethernet/intel/iavf/iavf_virtchnl.c?? | 42
> +++++++++++++++++++
> ?1 file changed, 42 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> index a40e29455f7d..1805c1ae3bf4 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> @@ -1490,6 +1490,24 @@ void iavf_request_reset(struct iavf_adapter
> *adapter)
> ????????adapter->current_op = VIRTCHNL_OP_UNKNOWN;
> ?}
> ?
> +/**
> + * iavf_netdev_features_vlan_strip_set - update vlan strip status
> + * @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_CTAG_RX;

These are the same flag.

> +???????else
> +???????????????netdev->features &=
> +???????????????????????~NETIF_F_HW_VLAN_CTAG_RX &
> ~NETIF_F_HW_VLAN_CTAG_RX;

Same here.

> +}
> +
> ?/**
> ? * iavf_virtchnl_completion
> ? * @adapter: adapter structure


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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2022-01-13 13:51 Michal Maloszewski
  0 siblings, 0 replies; 19+ messages in thread
From: Michal Maloszewski @ 2022-01-13 13:51 UTC (permalink / raw)
  To: intel-wired-lan

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.

Fixes: 310a2ad92e3f ("virtchnl: rename i40e to generic virtchnl")
Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
---
v3: NETIF_F_HW_VLAN_RX changed into NETIF_F_HW_VLAN_CTAG_RX because there's
no such definition since Linux 3.10. The code is the same as the one from OOT.
Code successfully passed inner review. netdev_update_features() function is not added 
because it causes infinite loop.
---
 .../net/ethernet/intel/iavf/iavf_virtchnl.c   | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index a40e29455f7d..1805c1ae3bf4 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -1490,6 +1490,24 @@ void iavf_request_reset(struct iavf_adapter *adapter)
 	adapter->current_op = VIRTCHNL_OP_UNKNOWN;
 }
 
+/**
+ * iavf_netdev_features_vlan_strip_set - update vlan strip status
+ * @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_CTAG_RX;
+	else
+		netdev->features &=
+			~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_CTAG_RX;
+}
+
 /**
  * iavf_virtchnl_completion
  * @adapter: adapter structure
@@ -1713,8 +1731,18 @@ 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");
+			/* 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",
@@ -1960,6 +1988,20 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
 		spin_unlock_bh(&adapter->adv_rss_lock);
 		}
 		break;
+	case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:
+		/* 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:
+		/* 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_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n",
-- 
2.27.0


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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
  2021-10-28 10:41 Michal Maloszewski
@ 2021-11-01  7:23   ` kernel test robot
  2021-10-31 13:19   ` kernel test robot
  2021-11-01  7:23   ` kernel test robot
  2 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-11-01  7:23 UTC (permalink / raw)
  To: intel-wired-lan

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 next-20211029]
[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/20211028-190947
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 11.2.0
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
        # https://github.com/0day-ci/linux/commit/a899b5944ecc501aa3c6075c2edfe0ec702802f7
        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/20211028-190947
        git checkout a899b5944ecc501aa3c6075c2edfe0ec702802f7
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/net/ethernet/intel/iavf/iavf_virtchnl.c: In function 'iavf_netdev_features_vlan_strip_set':
>> drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1471:51: error: 'NETIF_F_HW_VLAN_RX' undeclared (first use in this function); did you mean 'NETIF_F_HW_TLS_RX'?
    1471 |                         NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
         |                                                   ^~~~~~~~~~~~~~~~~~
         |                                                   NETIF_F_HW_TLS_RX
   drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1471:51: note: each undeclared identifier is reported only once for each function it appears in


vim +1471 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

  1458	
  1459	/**
  1460	 * iavf_netdev_features_vlan_strip_set - update vlan strip status
  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 |=
> 1471				NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
  1472		else
  1473			netdev->features &=
  1474				~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
  1475	}
  1476	

---
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: 67922 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20211101/f61ea037/attachment-0001.bin>

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

* Re: [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2021-11-01  7:23   ` kernel test robot
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-11-01  7:23 UTC (permalink / raw)
  To: kbuild-all

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

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 next-20211029]
[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/20211028-190947
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 11.2.0
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
        # https://github.com/0day-ci/linux/commit/a899b5944ecc501aa3c6075c2edfe0ec702802f7
        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/20211028-190947
        git checkout a899b5944ecc501aa3c6075c2edfe0ec702802f7
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/net/ethernet/intel/iavf/iavf_virtchnl.c: In function 'iavf_netdev_features_vlan_strip_set':
>> drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1471:51: error: 'NETIF_F_HW_VLAN_RX' undeclared (first use in this function); did you mean 'NETIF_F_HW_TLS_RX'?
    1471 |                         NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
         |                                                   ^~~~~~~~~~~~~~~~~~
         |                                                   NETIF_F_HW_TLS_RX
   drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1471:51: note: each undeclared identifier is reported only once for each function it appears in


vim +1471 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

  1458	
  1459	/**
  1460	 * iavf_netdev_features_vlan_strip_set - update vlan strip status
  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 |=
> 1471				NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
  1472		else
  1473			netdev->features &=
  1474				~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
  1475	}
  1476	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

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

* Re: [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
  2021-10-28 10:41 Michal Maloszewski
  2021-10-29  0:02 ` Nguyen, Anthony L
@ 2021-10-31 13:19   ` kernel test robot
  2021-11-01  7:23   ` kernel test robot
  2 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-10-31 13:19 UTC (permalink / raw)
  To: Michal Maloszewski, intel-wired-lan
  Cc: llvm, kbuild-all, Michal Maloszewski, Norbert Ciosek

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

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-rc7 next-20211029]
[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/20211028-190947
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
config: x86_64-randconfig-a011-20211031 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d321548c3ce987f4f21350ba1c81fdb5d4354224)
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
        # https://github.com/0day-ci/linux/commit/a899b5944ecc501aa3c6075c2edfe0ec702802f7
        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/20211028-190947
        git checkout a899b5944ecc501aa3c6075c2edfe0ec702802f7
        # 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=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1471:30: error: use of undeclared identifier 'NETIF_F_HW_VLAN_RX'
                           NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
                                                     ^
   drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1474:32: error: use of undeclared identifier 'NETIF_F_HW_VLAN_RX'
                           ~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
                                                       ^
   2 errors generated.


vim +/NETIF_F_HW_VLAN_RX +1471 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

  1458	
  1459	/**
  1460	 * iavf_netdev_features_vlan_strip_set - update vlan strip status
  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 |=
> 1471				NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
  1472		else
  1473			netdev->features &=
  1474				~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
  1475	}
  1476	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2021-10-31 13:19   ` kernel test robot
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-10-31 13:19 UTC (permalink / raw)
  To: intel-wired-lan

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-rc7 next-20211029]
[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/20211028-190947
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
config: x86_64-randconfig-a011-20211031 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d321548c3ce987f4f21350ba1c81fdb5d4354224)
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
        # https://github.com/0day-ci/linux/commit/a899b5944ecc501aa3c6075c2edfe0ec702802f7
        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/20211028-190947
        git checkout a899b5944ecc501aa3c6075c2edfe0ec702802f7
        # 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=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1471:30: error: use of undeclared identifier 'NETIF_F_HW_VLAN_RX'
                           NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
                                                     ^
   drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1474:32: error: use of undeclared identifier 'NETIF_F_HW_VLAN_RX'
                           ~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
                                                       ^
   2 errors generated.


vim +/NETIF_F_HW_VLAN_RX +1471 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

  1458	
  1459	/**
  1460	 * iavf_netdev_features_vlan_strip_set - update vlan strip status
  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 |=
> 1471				NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
  1472		else
  1473			netdev->features &=
  1474				~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
  1475	}
  1476	

---
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: 34630 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20211031/87d1b25c/attachment-0001.bin>

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

* Re: [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2021-10-31 13:19   ` kernel test robot
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-10-31 13:19 UTC (permalink / raw)
  To: kbuild-all

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

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-rc7 next-20211029]
[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/20211028-190947
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
config: x86_64-randconfig-a011-20211031 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d321548c3ce987f4f21350ba1c81fdb5d4354224)
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
        # https://github.com/0day-ci/linux/commit/a899b5944ecc501aa3c6075c2edfe0ec702802f7
        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/20211028-190947
        git checkout a899b5944ecc501aa3c6075c2edfe0ec702802f7
        # 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=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1471:30: error: use of undeclared identifier 'NETIF_F_HW_VLAN_RX'
                           NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
                                                     ^
   drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1474:32: error: use of undeclared identifier 'NETIF_F_HW_VLAN_RX'
                           ~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
                                                       ^
   2 errors generated.


vim +/NETIF_F_HW_VLAN_RX +1471 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

  1458	
  1459	/**
  1460	 * iavf_netdev_features_vlan_strip_set - update vlan strip status
  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 |=
> 1471				NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_RX;
  1472		else
  1473			netdev->features &=
  1474				~NETIF_F_HW_VLAN_CTAG_RX & ~NETIF_F_HW_VLAN_RX;
  1475	}
  1476	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
  2021-10-28 10:41 Michal Maloszewski
@ 2021-10-29  0:02 ` Nguyen, Anthony L
  2021-10-31 13:19   ` kernel test robot
  2021-11-01  7:23   ` kernel test robot
  2 siblings, 0 replies; 19+ messages in thread
From: Nguyen, Anthony L @ 2021-10-29  0:02 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, 2021-10-28 at 10:41 +0000, Michal Maloszewski wrote:
> 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.
> 
> Fixes: 310a2ad92e3f ("virtchnl: rename i40e to generic virtchnl")
> Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
> Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
> Signed-off-by: Brett Creeley <brett.creeley@intel.com>
> ---

Since this an update to a previous patch, this should be a v2 and
include changelog.

Also, this doesn't seem to address Jesse's comment on
netdev_update_features()

> ?.../net/ethernet/intel/iavf/iavf_virtchnl.c?? | 42
> +++++++++++++++++++
> ?1 file changed, 42 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> index bdc6040361..ed1c8bc3f4 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> @@ -1456,6 +1456,24 @@ void iavf_request_reset(struct iavf_adapter
> *adapter)
> ????????adapter->current_op = VIRTCHNL_OP_UNKNOWN;
> ?}
> ?
> +/**
> + * iavf_netdev_features_vlan_strip_set - update vlan strip status
> + * @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 +1697,18 @@ 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");
> +???????????????????????/* 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:
> +???????????????/* 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:
> +???????????????/* 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",


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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2021-10-28 10:41 Michal Maloszewski
  2021-10-29  0:02 ` Nguyen, Anthony L
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Michal Maloszewski @ 2021-10-28 10:41 UTC (permalink / raw)
  To: intel-wired-lan

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.

Fixes: 310a2ad92e3f ("virtchnl: rename i40e to generic virtchnl")
Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
---
 .../net/ethernet/intel/iavf/iavf_virtchnl.c   | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index bdc6040361..ed1c8bc3f4 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -1456,6 +1456,24 @@ void iavf_request_reset(struct iavf_adapter *adapter)
 	adapter->current_op = VIRTCHNL_OP_UNKNOWN;
 }
 
+/**
+ * iavf_netdev_features_vlan_strip_set - update vlan strip status
+ * @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 +1697,18 @@ 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");
+			/* 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:
+		/* 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:
+		/* 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",
-- 
2.27.0


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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
  2021-10-27 14:48 Michal Maloszewski
@ 2021-10-27 19:54 ` Jesse Brandeburg
  0 siblings, 0 replies; 19+ messages in thread
From: Jesse Brandeburg @ 2021-10-27 19:54 UTC (permalink / raw)
  To: intel-wired-lan

On 10/27/2021 7:48 AM, Michal Maloszewski wrote:
> 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.
> 
> Fixes: 310a2ad92e3f ("virtchnl: rename i40e to generic virtchnl")

good so far.

> Title: Fix handling of vlan strip virtual channel messages
> Change-type: DefectResolution
> HSDES-number: 1809974314
> HSDES-tenant: server_platf_lan.bug

remove the above lines, not needed or wanted upstream.

> Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
> Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
> ---
>   .../net/ethernet/intel/iavf/iavf_virtchnl.c   | 42 +++++++++++++++++++
>   1 file changed, 42 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> index bdc6040361..dbce5c17ab 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> @@ -1456,6 +1456,24 @@ 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;

you're forgetting a call to netdev_update_features(), and without that, 
layered devices won't know about the change.



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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2021-10-27 14:48 Michal Maloszewski
  2021-10-27 19:54 ` Jesse Brandeburg
  0 siblings, 1 reply; 19+ messages in thread
From: Michal Maloszewski @ 2021-10-27 14:48 UTC (permalink / raw)
  To: intel-wired-lan

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.

Fixes: 310a2ad92e3f ("virtchnl: rename i40e to generic virtchnl")
Title: Fix handling of vlan strip virtual channel messages
Change-type: DefectResolution
HSDES-number: 1809974314
HSDES-tenant: server_platf_lan.bug
Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
---
 .../net/ethernet/intel/iavf/iavf_virtchnl.c   | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index bdc6040361..dbce5c17ab 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -1456,6 +1456,24 @@ 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 +1697,18 @@ 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");
+			/* 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:
+		/* 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",
-- 
2.27.0


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

* Re: [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
  2021-10-12 13:04 Michal Maloszewski
  2021-10-12 22:02 ` Nguyen, Anthony L
@ 2021-10-12 23:57   ` kernel test robot
  1 sibling, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-10-12 23:57 UTC (permalink / raw)
  To: Michal Maloszewski, intel-wired-lan
  Cc: llvm, kbuild-all, Michal Maloszewski, Norbert Ciosek

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

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
Reported-by: kernel test robot <lkp@intel.com>

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@lists.01.org

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

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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2021-10-12 23:57   ` kernel test robot
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-10-12 23:57 UTC (permalink / raw)
  To: intel-wired-lan

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
Reported-by: kernel test robot <lkp@intel.com>

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>

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

* Re: [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2021-10-12 23:57   ` kernel test robot
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-10-12 23:57 UTC (permalink / raw)
  To: kbuild-all

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

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
Reported-by: kernel test robot <lkp@intel.com>

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(a)lists.01.org

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

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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
  2021-10-12 13:04 Michal Maloszewski
@ 2021-10-12 22:02 ` Nguyen, Anthony L
  2021-10-12 23:57   ` kernel test robot
  1 sibling, 0 replies; 19+ messages in thread
From: Nguyen, Anthony L @ 2021-10-12 22:02 UTC (permalink / raw)
  To: intel-wired-lan

On Tue, 2021-10-12 at 13:04 +0000, Michal Maloszewski wrote:
> 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.
> 
> Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the
> number 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?

> Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
> Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
> ---
> v2: commit message and comments corrected

Your title has v1, but there's a v2 here?

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

> ---
> ?.../net/ethernet/intel/iavf/iavf_virtchnl.c?? | 44
> ++++++++++++++++++-
> ?1 file changed, 43 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> index 9c128462ed..68761b92f6 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> @@ -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",


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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2021-10-12 13:04 Michal Maloszewski
  2021-10-12 22:02 ` Nguyen, Anthony L
  2021-10-12 23:57   ` kernel test robot
  0 siblings, 2 replies; 19+ messages in thread
From: Michal Maloszewski @ 2021-10-12 13:04 UTC (permalink / raw)
  To: intel-wired-lan

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.

Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number of pages it actually freed")
Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
---
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(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index 9c128462ed..68761b92f6 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -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",
-- 
2.27.0


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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
  2021-10-07 12:56 Michal Maloszewski
@ 2021-10-07 23:38 ` Nguyen, Anthony L
  0 siblings, 0 replies; 19+ messages in thread
From: Nguyen, Anthony L @ 2021-10-07 23:38 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, 2021-10-07 at 12:56 +0000, Michal Maloszewski wrote:
> 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.


This patch doesn't apply.

> Fixes: iavf: 129cf89e58567 ("rename functions and structs to new
> name")

The Fixes tag is incorrect. It should look like this:

Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the
number of pages it actually freed")

https://www.kernel.org/doc/html/latest/process/submitting-
patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-
fixes

> Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
> Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
> ---
> ?.../net/ethernet/intel/iavf/iavf_virtchnl.c?? | 48
> ++++++++++++++++++-
> ?1 file changed, 47 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> index 9c128462e..8e18ae0b5 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> @@ -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,22 @@ 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");

splitting this line isn't needed

> +???????????????????????/*
> +??????????????????????? * 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");

Why the change? Strings can be long line

> +???????????????????????/*
> +??????????????????????? * Vlan stripping could not be disabled by
> ethtool.
> +??????????????????????? * Enable it in netdev->features.
> +??????????????????????? */
> +???????????????????????iavf_netdev_features_vlan_strip_set(netdev,
> true);

This comment style is incorrect for netdev patches.

For files in net/ and drivers/net/ the preferred style for long (multi-
line) comments is a little different.

/* The preferred comment style for files in net/ and drivers/net
 * looks like this.
 *
 * It is nearly the same as the generally preferred comment style,
 * but there is no initial almost-blank line.
 */

https://www.kernel.org/doc/html/latest/process/coding-style.html

> ????????????????????????break;
> ????????????????default:
> ????????????????????????dev_err(&adapter->pdev->dev, "PF returned
> error %d (%s) to our request %d\n",
> @@ -1897,6 +1927,22 @@ 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.
> +??????????????? */

ditto for comment style

> +???????????????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.
> +??????????????? */

ditto for comment style

> +???????????????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",


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

* [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
@ 2021-10-07 12:56 Michal Maloszewski
  2021-10-07 23:38 ` Nguyen, Anthony L
  0 siblings, 1 reply; 19+ messages in thread
From: Michal Maloszewski @ 2021-10-07 12:56 UTC (permalink / raw)
  To: intel-wired-lan

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.

Fixes: iavf: 129cf89e58567 ("rename functions and structs to new name")
Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
---
 .../net/ethernet/intel/iavf/iavf_virtchnl.c   | 48 ++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index 9c128462e..8e18ae0b5 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -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,22 @@ 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 +1927,22 @@ 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",
-- 
2.27.0


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

end of thread, other threads:[~2022-01-14 23:07 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 13:48 [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages Michal Maloszewski
2022-01-14 23:07 ` Nguyen, Anthony L
  -- strict thread matches above, loose matches on Subject: below --
2022-01-13 13:51 Michal Maloszewski
2021-10-28 10:41 Michal Maloszewski
2021-10-29  0:02 ` Nguyen, Anthony L
2021-10-31 13:19 ` kernel test robot
2021-10-31 13:19   ` kernel test robot
2021-10-31 13:19   ` kernel test robot
2021-11-01  7:23 ` kernel test robot
2021-11-01  7:23   ` kernel test robot
2021-10-27 14:48 Michal Maloszewski
2021-10-27 19:54 ` Jesse Brandeburg
2021-10-12 13:04 Michal Maloszewski
2021-10-12 22:02 ` Nguyen, Anthony L
2021-10-12 23:57 ` kernel test robot
2021-10-12 23:57   ` kernel test robot
2021-10-12 23:57   ` kernel test robot
2021-10-07 12:56 Michal Maloszewski
2021-10-07 23:38 ` Nguyen, Anthony L

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.