Skip to contentSkip to conversation

enic: updates to version 1.4.1.9

PATCH In review Roopa Prabhu 2 participants 4 messages Dec 8, 2010 – Dec 10, 2010

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/2 enic: Add ndo_set_vf_mac support for enic dynamic devices

From: Roopa Prabhu <[email protected]>

This patch implements the ndo_set_vf_mac netdev operation for enic dynamic devices. It treats the mac address set by IFLA_VF_MAC as a special case to use it in the port profile provisioning data.

---
 drivers/net/enic/enic.h      |    3 ++-
 drivers/net/enic/enic_main.c |   20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)
drivers/net/enic/enic.h +2 -1
index 8f374c1..bd473a9 100644
@@ -32,7 +32,7 @@
 
 #define DRV_NAME		"enic"
 #define DRV_DESCRIPTION		"Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION		"1.4.1.8"
+#define DRV_VERSION		"1.4.1.9"
 #define DRV_COPYRIGHT		"Copyright 2008-2010 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX		6
@@ -61,6 +61,7 @@ struct enic_port_profile {
 	char name[PORT_PROFILE_MAX];
 	u8 instance_uuid[PORT_UUID_MAX];
 	u8 host_uuid[PORT_UUID_MAX];
+	u8 vf_mac[ETH_ALEN];
 };
 
 /* Per-instance private data structure */
drivers/net/enic/enic_main.c +20 -0
index 1931f15..ddeffb5 100644
@@ -1231,6 +1231,23 @@ static int enic_dev_init_done(struct enic *enic, int *done, int *error)
 	return err;
 }
 
+static int enic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
+{
+	struct enic *enic = netdev_priv(netdev);
+
+	if (vf != PORT_SELF_VF)
+		return -EOPNOTSUPP;
+
+	/* Ignore the vf argument for now. We can assume the request
+	 * is coming on a vf.
+	 */
+	if (is_valid_ether_addr(mac)) {
+		memcpy(enic->pp.vf_mac, mac, ETH_ALEN);
+		return 0;
+	} else
+		return -EINVAL;
+}
+
 static int enic_set_port_profile(struct enic *enic, u8 *mac)
 {
 	struct vic_provinfo *vp;
@@ -2411,6 +2428,9 @@ static const struct net_device_ops enic_netdev_dynamic_ops = {
 	.ndo_tx_timeout		= enic_tx_timeout,
 	.ndo_set_vf_port	= enic_set_vf_port,
 	.ndo_get_vf_port	= enic_get_vf_port,
+#ifdef IFLA_VF_MAX
+	.ndo_set_vf_mac		= enic_set_vf_mac,
+#endif
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	= enic_poll_controller,
 #endif
#2 lore raw

PATCH 2/2 enic: Use VF mac set by IFLA_VF_MAC in port profile provisioning data

In reply to Roopa Prabhu

From: Roopa Prabhu <[email protected]>

This patch adds support in enic 802.1Qbh port profile provisioning code to use the mac address set by IFLA_VF_MAC. For now we handle this mac as a special case for a VM mac address sent to us by libvirt. The VM mac address is sent to the switch along with the rest of the port profile provisioning data. This patch also adds calls to register and deregister the mac address during port profile association/deassociation.

---
 drivers/net/enic/enic.h      |    1 +
 drivers/net/enic/enic_main.c |   79 ++++++++++++++++++++++++++++++------------
 2 files changed, 57 insertions(+), 23 deletions(-)
drivers/net/enic/enic.h +1 -0
index bd473a9..577067e 100644
@@ -62,6 +62,7 @@ struct enic_port_profile {
 	u8 instance_uuid[PORT_UUID_MAX];
 	u8 host_uuid[PORT_UUID_MAX];
 	u8 vf_mac[ETH_ALEN];
+	u8 mac_addr[ETH_ALEN];
 };
 
 /* Per-instance private data structure */
drivers/net/enic/enic_main.c +56 -23

145 lines not on this page · raw message

maintainer
#3 lore raw
In reply to Roopa Prabhu

From: Roopa Prabhu <[email protected]>
Date: Wed, 08 Dec 2010 15:53:52 -0800

Quoted 4 lines

This patch series implements the following enic driver updates:

01/2 - Add ndo_set_vf_mac support for enic dynamic devices 02/2 - Use VF mac set by IFLA_VF_MAC in port profile provisioning data

Both applied, thanks.