From: Govindarajulu Varadarajan <_govind@gmx.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: ssujith@cisco.com, benve@cisco.com,
Govindarajulu Varadarajan <_govind@gmx.com>
Subject: [PATCH net-next v2 2/2] enic: add vmname port-profile handler
Date: Fri, 3 Oct 2014 04:11:23 +0530 [thread overview]
Message-ID: <1412289683-8278-3-git-send-email-_govind@gmx.com> (raw)
In-Reply-To: <1412289683-8278-1-git-send-email-_govind@gmx.com>
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
prev parent reply other threads:[~2014-10-02 22:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Govindarajulu Varadarajan [this message]
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=1412289683-8278-3-git-send-email-_govind@gmx.com \
--to=_govind@gmx.com \
--cc=benve@cisco.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ssujith@cisco.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;
as well as URLs for NNTP newsgroup(s).