[dpdk-dev,v3] net/ixgbe: ping VF when PF status changes
Checks
Commit Message
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(+)
Comments
Hi,
> -----Original Message-----
> Subject: [PATCH v3] net/ixgbe: ping VF when PF status changes
>
> 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>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Except the commit log should describe what's implemented and for what.
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Lu, Wenzhuo
> Sent: Thursday, March 30, 2017 9:10 PM
> To: alexz@att.com; dev@dpdk.org
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Zhang, Helin
> <helin.zhang@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v3] net/ixgbe: ping VF when PF status changes
>
> Hi,
>
> > -----Original Message-----
> > Subject: [PATCH v3] net/ixgbe: ping VF when PF status changes
> >
> > 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>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com> Except the commit log should
> describe what's implemented and for what.
Acked-by: Wei Dai <wei.dai@intel.com>
The second "hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);" can be removed. :-)
And is there any other patch to use this new function ?
@@ -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;
@@ -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
@@ -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;