DPDK patches and discussions
 help / color / mirror / Atom feed
From: alexz@att.com
To: dev@dpdk.org
Cc: konstantin.ananyev@intel.com, helin.zhang@intel.com,
	wenzhuo.lu@intel.com,  bernard.iremonger@intel.com,
	Alex Zelezniak <alexz@att.com>
Subject: [dpdk-dev] [PATCH v3] net/ixgbe: ping VF when PF status changes
Date: Thu, 30 Mar 2017 07:33:14 -0500	[thread overview]
Message-ID: <1490877194-33917-1-git-send-email-alexz@att.com> (raw)
In-Reply-To: <1490820742-32330-1-git-send-email-alexz@att.com>

From: Alex Zelezniak <alexz@att.com>

* added 17.05 block to rte_pmd_ixgbe_version.map file

Signed-off-by: Alex Zelezniak <alexz@att.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c            | 34 +++++++++++++++++++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 14 ++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  6 +++++
 3 files changed, 54 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7169007..5f0feab 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4926,6 +4926,40 @@ static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on)
 }
 
 int
+rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf)
+{
+	struct ixgbe_hw *hw;
+	struct ixgbe_vf_info *vfinfo;
+	struct rte_eth_dev *dev;
+	struct rte_pci_device *pci_dev;
+	uint32_t ctrl;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	pci_dev = IXGBE_DEV_TO_PCI(dev);
+
+	if (!is_device_supported(dev, &rte_ixgbe_pmd))
+		return -ENOTSUP;
+
+	if (vf >= pci_dev->max_vfs)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	ctrl = IXGBE_PF_CONTROL_MSG;
+	if (vfinfo[vf].clear_to_send)
+		ctrl |= IXGBE_VT_MSGTYPE_CTS;
+
+	ixgbe_write_mbx(hw, &ctrl, 1, vf);
+
+	return 0;
+}
+
+int
 rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
 {
 	struct ixgbe_hw *hw;
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 4d7b507..63b1229 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -42,6 +42,20 @@
 #include <rte_ethdev.h>
 
 /**
+ * Notify VF when PF status changes.
+ *
+ * @param port
+ *   The port identifier of the Ethernet device.
+ * @param vf
+ *   VF id.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-EINVAL) if *vf* invalid.
+ */
+int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf);
+
+/**
  * Set the VF MAC address.
  *
  * @param port
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
index a992dfd..2c7512d 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
@@ -31,3 +31,9 @@ DPDK_17.02 {
 	rte_pmd_ixgbe_set_vf_tx;
 	rte_pmd_ixgbe_set_vf_vlan_filter;
 } DPDK_16.11;
+
+DPDK_17.05 {
+	global:
+
+	rte_pmd_ixgbe_ping_vf;
+} DPDK_17.02;
-- 
1.9.1

  parent reply	other threads:[~2017-03-30 12:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22 17:32 [dpdk-dev] [PATCH] net/ixgbe: notify VF when PF link " alexz
2017-03-29 11:10 ` Iremonger, Bernard
2017-03-29 20:52 ` [dpdk-dev] [PATCH v2] ping VF when PF " alexz
2017-03-29 21:59   ` Iremonger, Bernard
2017-03-30 12:33   ` alexz [this message]
2017-03-30 13:09     ` [dpdk-dev] [PATCH v3] net/ixgbe: " Lu, Wenzhuo
2017-03-30 16:50       ` Dai, Wei
2017-03-30 21:05     ` [dpdk-dev] [PATCH v4] " alexz
2017-03-31  0:47       ` Dai, Wei
2017-03-31  1:00         ` Lu, Wenzhuo
2017-03-31 10:26           ` Ferruh Yigit

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=1490877194-33917-1-git-send-email-alexz@att.com \
    --to=alexz@att.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=wenzhuo.lu@intel.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).