From: Nguyen, Anthony L <anthony.l.nguyen@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages
Date: Fri, 29 Oct 2021 00:02:32 +0000 [thread overview]
Message-ID: <b0d80a563e76a0b29bfad51ad0be9622b137cabe.camel@intel.com> (raw)
In-Reply-To: <20211028104114.71879-1-michal.maloszewski@intel.com>
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",
next prev parent reply other threads:[~2021-10-29 0:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-28 10:41 [Intel-wired-lan] [PATCH net v1] iavf: Fix handling of vlan strip virtual channel messages Michal Maloszewski
2021-10-29 0:02 ` Nguyen, Anthony L [this message]
2021-10-31 13:19 ` kernel test robot
2021-11-01 7:23 ` kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-01-13 13:51 Michal Maloszewski
2022-01-13 13:48 Michal Maloszewski
2022-01-14 23:07 ` Nguyen, Anthony L
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-07 12:56 Michal Maloszewski
2021-10-07 23:38 ` Nguyen, Anthony L
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0d80a563e76a0b29bfad51ad0be9622b137cabe.camel@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox