[dpdk-dev] [PATCH v2] ping VF when PF status changes
Iremonger, Bernard
bernard.iremonger at intel.com
Wed Mar 29 23:59:19 CEST 2017
Hi Alex
> -----Original Message-----
> From: alexz at att.com [mailto:alexz at att.com]
> Sent: Wednesday, March 29, 2017 9:52 PM
> To: dev at dpdk.org
> Cc: Ananyev, Konstantin <konstantin.ananyev at intel.com>; Zhang, Helin
> <helin.zhang at intel.com>; Lu, Wenzhuo <wenzhuo.lu at intel.com>;
> Iremonger, Bernard <bernard.iremonger at intel.com>; Alex Zelezniak
> <alexz at att.com>
> Subject: [PATCH v2] ping VF when PF status changes
>
> From: Alex Zelezniak <alexz at att.com>
>
> * updated rte_pmd_ixgbe_version.map file
>
> Signed-off-by: Alex Zelezniak <alexz at att.com>
> ---
> drivers/net/ixgbe/ixgbe_ethdev.c | 33
> +++++++++++++++++++++++++++++
> drivers/net/ixgbe/rte_pmd_ixgbe.h | 14 ++++++++++++
> drivers/net/ixgbe/rte_pmd_ixgbe_version.map | 1 +
> 3 files changed, 48 insertions(+)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 7169007..94c85da 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -4894,6 +4894,39 @@ static void ixgbevf_set_vfta_all(struct
> rte_eth_dev *dev, bool on)
> return new_val;
> }
>
> +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_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t
> on) diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h
> b/drivers/net/ixgbe/rte_pmd_ixgbe.h
> index 4d7b507..bbb957f 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 about 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..882dd80 100644
> --- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
> +++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
> @@ -25,6 +25,7 @@ DPDK_17.02 {
> rte_pmd_ixgbe_macsec_enable;
> rte_pmd_ixgbe_macsec_select_rxsa;
> rte_pmd_ixgbe_macsec_select_txsa;
> + rte_pmd_ixgbe_ping_vf;
> rte_pmd_ixgbe_set_vf_rate_limit;
> rte_pmd_ixgbe_set_vf_rx;
> rte_pmd_ixgbe_set_vf_rxmode;
> --
> 1.9.1
The 17.02 block should not be changed.
A new block needs to be added for 17.05
Regards,
Bernard.
More information about the dev
mailing list