All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: Wojciech Drewek <wojciech.drewek@intel.com>,
	netdev@vger.kernel.org, anthony.l.nguyen@intel.com
Subject: [PATCH net-next 05/10] ice: Forbid trusted VFs in switchdev mode
Date: Tue, 19 Oct 2021 11:30:22 -0700	[thread overview]
Message-ID: <20211019183027.2820413-6-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20211019183027.2820413-1-anthony.l.nguyen@intel.com>

From: Wojciech Drewek <wojciech.drewek@intel.com>

Merge issues caused the check for switchdev mode has been inserted
in wrong place. It should be in ice_set_vf_trust not in ice_set_vf_mac.

Trusted VFs are forbidden in switchdev mode because they should
be configured only from the host side.

Fixes: 1c54c839935b ("ice: enable/disable switchdev when managing VFs")
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index 86f265268ac8..862d191284ba 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -4839,11 +4839,6 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
 	struct ice_vf *vf;
 	int ret;
 
-	if (ice_is_eswitch_mode_switchdev(pf)) {
-		dev_info(ice_pf_to_dev(pf), "Trusted VF is forbidden in switchdev mode\n");
-		return -EOPNOTSUPP;
-	}
-
 	if (ice_validate_vf_id(pf, vf_id))
 		return -EINVAL;
 
@@ -4903,6 +4898,11 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)
 	struct ice_vf *vf;
 	int ret;
 
+	if (ice_is_eswitch_mode_switchdev(pf)) {
+		dev_info(ice_pf_to_dev(pf), "Trusted VF is forbidden in switchdev mode\n");
+		return -EOPNOTSUPP;
+	}
+
 	if (ice_validate_vf_id(pf, vf_id))
 		return -EINVAL;
 
-- 
2.31.1


  parent reply	other threads:[~2021-10-19 18:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 18:30 [PATCH net-next 00/10][pull request] 100GbE Intel Wired LAN Driver Updates 2021-10-19 Tony Nguyen
2021-10-19 18:30 ` [PATCH net-next 01/10] ice: Add support for VF rate limiting Tony Nguyen
2021-10-19 18:30 ` [PATCH net-next 02/10] ice: update dim usage and moderation Tony Nguyen
2021-10-19 18:30 ` [PATCH net-next 03/10] ice: fix rate limit update after coalesce change Tony Nguyen
2021-10-19 18:30 ` [PATCH net-next 04/10] ice: fix software generating extra interrupts Tony Nguyen
2021-10-19 18:30 ` Tony Nguyen [this message]
2021-10-19 18:30 ` [PATCH net-next 06/10] ice: Manage act flags for switchdev offloads Tony Nguyen
2021-10-19 18:30 ` [PATCH net-next 07/10] ice: Refactor PR ethtool ops Tony Nguyen
2021-10-19 18:30 ` [PATCH net-next 08/10] ice: Make use of the helper function devm_add_action_or_reset() Tony Nguyen
2021-10-19 18:30 ` [PATCH net-next 09/10] ice: use devm_kcalloc() instead of devm_kzalloc() Tony Nguyen
2021-10-19 18:30 ` [PATCH net-next 10/10] ice: fix an error code in ice_ena_vfs() Tony Nguyen
2021-10-20 11:10 ` [PATCH net-next 00/10][pull request] 100GbE Intel Wired LAN Driver Updates 2021-10-19 patchwork-bot+netdevbpf

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=20211019183027.2820413-6-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wojciech.drewek@intel.com \
    /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 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.