From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Or Gerlitz <ogerlitz@mellanox.com>,
Maor Dickman <maord@mellanox.com>, Gavi Teitz <gavi@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 6/6] net/mlx5e: Unblock setting vid 0 for VFs through the uplink rep
Date: Fri, 25 Jan 2019 12:01:40 -0800 [thread overview]
Message-ID: <20190125200140.6222-7-saeedm@mellanox.com> (raw)
In-Reply-To: <20190125200140.6222-1-saeedm@mellanox.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
It turns out that libvirt uses 0-vid as a default if no vlan was
set for the guest (which is the case for switchdev mode) and errs
if we disallow that:
error: Failed to start domain vm75
error: Cannot set interface MAC/vlanid to 6a:66:2d:48:92:c2/0 \
for ifname enp59s0f0 vf 0: Operation not supported
So allow this in order not to break existing systems.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Maor Dickman <maord@mellanox.com>
Reviewed-by: Gavi Teitz <gavi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index f75227222db3..f2573c2d2b5c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -1293,6 +1293,18 @@ static int mlx5e_uplink_rep_set_mac(struct net_device *netdev, void *addr)
return 0;
}
+static int mlx5e_uplink_rep_set_vf_vlan(struct net_device *dev, int vf, u16 vlan, u8 qos,
+ __be16 vlan_proto)
+{
+ netdev_warn_once(dev, "legacy vf vlan setting isn't supported in switchdev mode\n");
+
+ if (vlan != 0)
+ return -EOPNOTSUPP;
+
+ /* allow setting 0-vid for compatibility with libvirt */
+ return 0;
+}
+
static const struct switchdev_ops mlx5e_rep_switchdev_ops = {
.switchdev_port_attr_get = mlx5e_attr_get,
};
@@ -1327,6 +1339,7 @@ static const struct net_device_ops mlx5e_netdev_ops_uplink_rep = {
.ndo_set_vf_rate = mlx5e_set_vf_rate,
.ndo_get_vf_config = mlx5e_get_vf_config,
.ndo_get_vf_stats = mlx5e_get_vf_stats,
+ .ndo_set_vf_vlan = mlx5e_uplink_rep_set_vf_vlan,
};
bool mlx5e_eswitch_rep(struct net_device *netdev)
--
2.20.1
next prev parent reply other threads:[~2019-01-25 20:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 20:01 [pull request][net 0/6] Mellanox, mlx5 fixes 2019-01-25 Saeed Mahameed
2019-01-25 20:01 ` [net 1/6] Revert "net/mlx5e: E-Switch, Initialize eswitch only if eswitch manager" Saeed Mahameed
2019-01-25 20:01 ` [net 2/6] net/mlx5e: Fix wrong private flag usage causing checksum disable Saeed Mahameed
2019-01-25 20:01 ` [net 3/6] net/mlx5: Take lock with IRQs disabled to avoid deadlock Saeed Mahameed
2019-01-25 20:01 ` [net 4/6] net/mlx5e: Allow MAC invalidation while spoofchk is ON Saeed Mahameed
2019-01-25 20:01 ` [net 5/6] net/mlx5e: Move to use common phys port names for vport representors Saeed Mahameed
2019-01-25 20:01 ` Saeed Mahameed [this message]
2019-01-27 19:39 ` [pull request][net 0/6] Mellanox, mlx5 fixes 2019-01-25 David Miller
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=20190125200140.6222-7-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=davem@davemloft.net \
--cc=gavi@mellanox.com \
--cc=maord@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox