netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shradha Shah <sshah@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>
Subject: [PATCH net-next 11/16] sfc: Add ndo_get_vf_config() function for EF10
Date: Mon, 18 May 2015 16:30:38 +0100	[thread overview]
Message-ID: <555A059E.5000807@solarflare.com> (raw)
In-Reply-To: <555A044A.4060202@solarflare.com>

rtnetlink calls ndo_get_vf_config when compiling information
about a network interface, so that the VFs associated with a PF
can be listed (eg: ip link show).
Implement a response to this entry point and return PF-set MAC
address for VF in ndo_get_vf_config

Signed-off-by: Shradha Shah <sshah@solarflare.com>
---
 drivers/net/ethernet/sfc/ef10_sriov.c | 24 ++++++++++++++++++++++++
 drivers/net/ethernet/sfc/ef10_sriov.h |  7 ++-----
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
index 42a3b16..d9c2ea4 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -521,3 +521,27 @@ fail:
 	memset(vf->mac, 0, ETH_ALEN);
 	return rc;
 }
+
+int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
+				 struct ifla_vf_info *ivf)
+{
+	struct efx_ef10_nic_data *nic_data = efx->nic_data;
+	struct ef10_vf *vf;
+
+	if (vf_i >= efx->vf_count)
+		return -EINVAL;
+
+	if (!nic_data->vf)
+		return -EOPNOTSUPP;
+
+	vf = nic_data->vf + vf_i;
+
+	ivf->vf = vf_i;
+	ivf->min_tx_rate = 0;
+	ivf->max_tx_rate = 0;
+	ether_addr_copy(ivf->mac, vf->mac);
+	ivf->vlan = 0;
+	ivf->qos = 0;
+
+	return 0;
+}
diff --git a/drivers/net/ethernet/sfc/ef10_sriov.h b/drivers/net/ethernet/sfc/ef10_sriov.h
index 7f12942..8c92a8d 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.h
+++ b/drivers/net/ethernet/sfc/ef10_sriov.h
@@ -55,11 +55,8 @@ static inline int efx_ef10_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf,
 	return -EOPNOTSUPP;
 }
 
-static inline int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf,
-					       struct ifla_vf_info *ivf)
-{
-	return -EOPNOTSUPP;
-}
+int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
+				 struct ifla_vf_info *ivf);
 
 int efx_ef10_vswitching_probe_pf(struct efx_nic *efx);
 int efx_ef10_vswitching_probe_vf(struct efx_nic *efx);

  parent reply	other threads:[~2015-05-18 15:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 15:24 [PATCH net-next 00/16] sfc: Get/Set MAC address and ndo_[set/get]_vf_* entrypoint functions Shradha Shah
2015-05-18 15:27 ` [PATCH net-next 01/16] sfc: Add permissions to MCDI commands Shradha Shah
2015-05-18 16:21   ` David Miller
2015-05-18 15:27 ` [PATCH net-next 02/16] sfc: change definition of MC_CMD_VADAPTOR_ALLOC Shradha Shah
2015-05-18 15:27 ` [PATCH net-next 03/16] sfc: MC_CMD_SET_MAC can only be called by the link control Function Shradha Shah
2015-05-18 15:28 ` [PATCH net-next 04/16] sfc: Store vf_index in nic_data for Ef10 Shradha Shah
2015-05-18 15:28 ` [PATCH net-next 05/16] sfc: save old MAC address in case sriov_mac_address_changed fails Shradha Shah
2015-05-18 15:28 ` [PATCH net-next 06/16] sfc: Store the efx_nic struct of the current VF in the VF data struct Shradha Shah
2015-05-18 15:29 ` [PATCH net-next 07/16] sfc: protect filter table against use-after-free Shradha Shah
2015-05-18 15:29 ` [PATCH net-next 08/16] sfc: Enable a VF to get its own MAC address Shradha Shah
2015-05-18 15:29 ` [PATCH net-next 09/16] sfc: Initialise MCDI buffers to 0 on declaration Shradha Shah
2015-05-18 15:30 ` [PATCH net-next 10/16] sfc: add ndo_set_vf_mac() function for EF10 Shradha Shah
2015-05-18 15:30 ` Shradha Shah [this message]
2015-05-18 15:30 ` [PATCH net-next 12/16] sfc: Change entity reset on MC reboot to a new datapath-only reset Shradha Shah
2015-05-18 15:31 ` [PATCH net-next 13/16] sfc: add ndo_set_vf_vlan() function for EF10 Shradha Shah
2015-05-18 15:31 ` [PATCH net-next 14/16] sfc: add ndo_set_vf_link_state() " Shradha Shah
2015-05-18 15:31 ` [PATCH net-next 15/16] sfc: Implement dummy disable of VF spoof check " Shradha Shah
2015-05-18 15:31 ` [PATCH net-next 16/16] sfc: set the MAC address using MC_CMD_VADAPTOR_SET_MAC Shradha Shah

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=555A059E.5000807@solarflare.com \
    --to=sshah@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /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).