All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] enic: add support to send port-profile's client name to firmware
@ 2014-10-02 22:41 Govindarajulu Varadarajan
  2014-10-02 22:41 ` [PATCH net-next v2 1/2] if_link: add client name to port profile Govindarajulu Varadarajan
  2014-10-02 22:41 ` [PATCH net-next v2 2/2] enic: add vmname port-profile handler Govindarajulu Varadarajan
  0 siblings, 2 replies; 6+ messages in thread
From: Govindarajulu Varadarajan @ 2014-10-02 22:41 UTC (permalink / raw)
  To: davem, netdev; +Cc: ssujith, benve, Govindarajulu Varadarajan

Firmware has support for sending client name of the port profile to the switch
it's connected to.

This series adds client name to port profile which is sent to hardware while
associating a port profile to VF.

Since port profile are defined in switch, this patch makes it easier to check
what VM is using a port profile.

v2:
Split single patch to multiple patches. First patch adds client name to netlink
facility. Second patch adds driver support.

Govindarajulu Varadarajan (2):
  if_link: add client name to port profile
  enic: add vmname port-profile handler

 drivers/net/ethernet/cisco/enic/enic.h      | 2 ++
 drivers/net/ethernet/cisco/enic/enic_main.c | 6 ++++++
 drivers/net/ethernet/cisco/enic/enic_pp.c   | 5 +++++
 include/uapi/linux/if_link.h                | 1 +
 net/core/rtnetlink.c                        | 2 ++
 5 files changed, 16 insertions(+)

-- 
2.1.0

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

* [PATCH net-next v2 1/2] if_link: add client name to port profile
  2014-10-02 22:41 [PATCH net-next v2 0/2] enic: add support to send port-profile's client name to firmware Govindarajulu Varadarajan
@ 2014-10-02 22:41 ` Govindarajulu Varadarajan
  2014-10-05  0:43   ` David Miller
  2014-10-05  3:05   ` Stephen Hemminger
  2014-10-02 22:41 ` [PATCH net-next v2 2/2] enic: add vmname port-profile handler Govindarajulu Varadarajan
  1 sibling, 2 replies; 6+ messages in thread
From: Govindarajulu Varadarajan @ 2014-10-02 22:41 UTC (permalink / raw)
  To: davem, netdev; +Cc: ssujith, benve, Govindarajulu Varadarajan

This patch adds client name to port profile.

This is used by netlink client to send the client name in port profile.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
---
 include/uapi/linux/if_link.h | 1 +
 net/core/rtnetlink.c         | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 0bdb77e..6ae0b0b 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -512,6 +512,7 @@ enum {
 	IFLA_PORT_HOST_UUID,		/* binary UUID */
 	IFLA_PORT_REQUEST,		/* __u8 */
 	IFLA_PORT_RESPONSE,		/* __u16, output only */
+	IFLA_PORT_VMNAME,		/* vm-name used by port profile */
 	__IFLA_PORT_MAX,
 };
 
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index a688268..116d647 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1238,6 +1238,8 @@ static const struct nla_policy ifla_port_policy[IFLA_PORT_MAX+1] = {
 				    .len = PORT_UUID_MAX },
 	[IFLA_PORT_REQUEST]	= { .type = NLA_U8, },
 	[IFLA_PORT_RESPONSE]	= { .type = NLA_U16, },
+	[IFLA_PORT_VMNAME]	= { .type = NLA_STRING,
+				    .len = PORT_PROFILE_MAX },
 };
 
 static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
-- 
2.1.0

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

* [PATCH net-next v2 2/2] enic: add vmname port-profile handler
  2014-10-02 22:41 [PATCH net-next v2 0/2] enic: add support to send port-profile's client name to firmware Govindarajulu Varadarajan
  2014-10-02 22:41 ` [PATCH net-next v2 1/2] if_link: add client name to port profile Govindarajulu Varadarajan
@ 2014-10-02 22:41 ` Govindarajulu Varadarajan
  1 sibling, 0 replies; 6+ messages in thread
From: Govindarajulu Varadarajan @ 2014-10-02 22:41 UTC (permalink / raw)
  To: davem, netdev; +Cc: ssujith, benve, Govindarajulu Varadarajan

This patch adds support to read vmname from port-profile netlink message and
send it to firmware.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
---
 drivers/net/ethernet/cisco/enic/enic.h      | 2 ++
 drivers/net/ethernet/cisco/enic/enic_main.c | 6 ++++++
 drivers/net/ethernet/cisco/enic/enic_pp.c   | 5 +++++
 3 files changed, 13 insertions(+)

diff --git a/drivers/net/ethernet/cisco/enic/enic.h b/drivers/net/ethernet/cisco/enic/enic.h
index 5ba5ad0..0b63227 100644
--- a/drivers/net/ethernet/cisco/enic/enic.h
+++ b/drivers/net/ethernet/cisco/enic/enic.h
@@ -88,6 +88,7 @@ struct enic_rx_coal {
 #define ENIC_SET_NAME			(1 << 2)
 #define ENIC_SET_INSTANCE		(1 << 3)
 #define ENIC_SET_HOST			(1 << 4)
+#define ENIC_SET_VMNAME			(1 << 5)
 
 struct enic_port_profile {
 	u32 set;
@@ -97,6 +98,7 @@ struct enic_port_profile {
 	u8 host_uuid[PORT_UUID_MAX];
 	u8 vf_mac[ETH_ALEN];
 	u8 mac_addr[ETH_ALEN];
+	char vmname[PORT_PROFILE_MAX];
 };
 
 /* enic_rfs_fltr_node - rfs filter node in hash table
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 929bfe7..6c7cd1b 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -831,6 +831,12 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
 			nla_data(port[IFLA_PORT_HOST_UUID]), PORT_UUID_MAX);
 	}
 
+	if (port[IFLA_PORT_VMNAME]) {
+		pp->set |= ENIC_SET_VMNAME;
+		memcpy(pp->vmname,
+		       nla_data(port[IFLA_PORT_VMNAME]), PORT_PROFILE_MAX);
+	}
+
 	if (vf == PORT_SELF_VF) {
 		/* Special case handling: mac came from IFLA_VF_MAC */
 		if (!is_zero_ether_addr(prev_pp.vf_mac))
diff --git a/drivers/net/ethernet/cisco/enic/enic_pp.c b/drivers/net/ethernet/cisco/enic/enic_pp.c
index e6a8319..c2b620f 100644
--- a/drivers/net/ethernet/cisco/enic/enic_pp.c
+++ b/drivers/net/ethernet/cisco/enic/enic_pp.c
@@ -128,6 +128,11 @@ static int enic_set_port_profile(struct enic *enic, int vf)
 			sizeof(uuid_str), uuid_str);
 	}
 
+	if (pp->set & ENIC_SET_VMNAME) {
+		VIC_PROVINFO_ADD_TLV(vp, VIC_GENERIC_PROV_TLV_CLIENT_NAME_STR,
+				     sizeof(pp->vmname), pp->vmname);
+	}
+
 	VIC_PROVINFO_ADD_TLV(vp,
 		VIC_GENERIC_PROV_TLV_OS_TYPE,
 		sizeof(os_type), &os_type);
-- 
2.1.0

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

* Re: [PATCH net-next v2 1/2] if_link: add client name to port profile
  2014-10-02 22:41 ` [PATCH net-next v2 1/2] if_link: add client name to port profile Govindarajulu Varadarajan
@ 2014-10-05  0:43   ` David Miller
  2014-10-05  3:05   ` Stephen Hemminger
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2014-10-05  0:43 UTC (permalink / raw)
  To: _govind; +Cc: netdev, ssujith, benve

From: Govindarajulu Varadarajan <_govind@gmx.com>
Date: Fri,  3 Oct 2014 04:11:22 +0530

> This patch adds client name to port profile.
> 
> This is used by netlink client to send the client name in port profile.
> 
> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>

I really want to see what other developers think of this thing
because it seems extremely ad-hoc to me.

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

* Re: [PATCH net-next v2 1/2] if_link: add client name to port profile
  2014-10-02 22:41 ` [PATCH net-next v2 1/2] if_link: add client name to port profile Govindarajulu Varadarajan
  2014-10-05  0:43   ` David Miller
@ 2014-10-05  3:05   ` Stephen Hemminger
  2014-10-05 18:44     ` Govindarajulu Varadarajan
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2014-10-05  3:05 UTC (permalink / raw)
  To: Govindarajulu Varadarajan; +Cc: davem, netdev, ssujith, benve

On Fri,  3 Oct 2014 04:11:22 +0530
Govindarajulu Varadarajan <_govind@gmx.com> wrote:

> This patch adds client name to port profile.
> 
> This is used by netlink client to send the client name in port profile.
> 
> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
> ---
>  include/uapi/linux/if_link.h | 1 +
>  net/core/rtnetlink.c         | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
> index 0bdb77e..6ae0b0b 100644
> --- a/include/uapi/linux/if_link.h
> +++ b/include/uapi/linux/if_link.h
> @@ -512,6 +512,7 @@ enum {
>  	IFLA_PORT_HOST_UUID,		/* binary UUID */
>  	IFLA_PORT_REQUEST,		/* __u8 */
>  	IFLA_PORT_RESPONSE,		/* __u16, output only */
> +	IFLA_PORT_VMNAME,		/* vm-name used by port profile */
>  	__IFLA_PORT_MAX,
>  };
>  
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index a688268..116d647 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -1238,6 +1238,8 @@ static const struct nla_policy ifla_port_policy[IFLA_PORT_MAX+1] = {
>  				    .len = PORT_UUID_MAX },
>  	[IFLA_PORT_REQUEST]	= { .type = NLA_U8, },
>  	[IFLA_PORT_RESPONSE]	= { .type = NLA_U16, },
> +	[IFLA_PORT_VMNAME]	= { .type = NLA_STRING,
> +				    .len = PORT_PROFILE_MAX },
>  };
>  
>  static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)

Maybe you could use the existing IFLA_IFALIAS?
It is already supported by iproute tools and sysfs, and can be used by net-snmp as well.
You would just be setting the default string, users could change it.

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

* Re: [PATCH net-next v2 1/2] if_link: add client name to port profile
  2014-10-05  3:05   ` Stephen Hemminger
@ 2014-10-05 18:44     ` Govindarajulu Varadarajan
  0 siblings, 0 replies; 6+ messages in thread
From: Govindarajulu Varadarajan @ 2014-10-05 18:44 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Govindarajulu Varadarajan, davem, netdev, ssujith, benve

On Sat, 4 Oct 2014, Stephen Hemminger wrote:
> Maybe you could use the existing IFLA_IFALIAS?
> It is already supported by iproute tools and sysfs, and can be used by net-snmp as well.
> You would just be setting the default string, users could change it.
>

I do not think we can use ifalias here. Port profile is for SRIOV-VF
pci passthrough. vfio-pci will own the pci device and there would not be
net_device registeres for that interface on host. The client (libvirt)
unregisters the vf before binding it to vfio-pci.

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

end of thread, other threads:[~2014-10-05 18:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02 22:41 [PATCH net-next v2 0/2] enic: add support to send port-profile's client name to firmware Govindarajulu Varadarajan
2014-10-02 22:41 ` [PATCH net-next v2 1/2] if_link: add client name to port profile Govindarajulu Varadarajan
2014-10-05  0:43   ` David Miller
2014-10-05  3:05   ` Stephen Hemminger
2014-10-05 18:44     ` Govindarajulu Varadarajan
2014-10-02 22:41 ` [PATCH net-next v2 2/2] enic: add vmname port-profile handler Govindarajulu Varadarajan

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.