From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00191d01.pphosted.com (mx0a-00191d01.pphosted.com [67.231.149.140]) by dpdk.org (Postfix) with ESMTP id E0D5C2B91 for ; Thu, 30 Mar 2017 23:06:18 +0200 (CEST) Received: from pps.filterd (m0049297.ppops.net [127.0.0.1]) by m0049297.ppops.net-00191d01. (8.16.0.17/8.16.0.17) with SMTP id v2UKslYC006921; Thu, 30 Mar 2017 17:06:17 -0400 Received: from alpi154.enaf.aldc.att.com (sbcsmtp6.sbc.com [144.160.229.23]) by m0049297.ppops.net-00191d01. with ESMTP id 29h7jjc5ax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Mar 2017 17:06:16 -0400 Received: from enaf.aldc.att.com (localhost [127.0.0.1]) by alpi154.enaf.aldc.att.com (8.14.5/8.14.5) with ESMTP id v2UL6FlR001466; Thu, 30 Mar 2017 17:06:15 -0400 Received: from alpi131.aldc.att.com (alpi131.aldc.att.com [130.8.218.69]) by alpi154.enaf.aldc.att.com (8.14.5/8.14.5) with ESMTP id v2UL6B1h001435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 30 Mar 2017 17:06:11 -0400 Received: from alpi153.aldc.att.com (alpi153.aldc.att.com [130.8.42.31]) by alpi131.aldc.att.com (RSA Interceptor); Thu, 30 Mar 2017 21:06:04 GMT Received: from aldc.att.com (localhost [127.0.0.1]) by alpi153.aldc.att.com (8.14.5/8.14.5) with ESMTP id v2UL63GB011913; Thu, 30 Mar 2017 17:06:03 -0400 Received: from mtpnjrsv135.aic.cip.att.com ([135.16.18.11]) by alpi153.aldc.att.com (8.14.5/8.14.5) with ESMTP id v2UL5uMv010933; Thu, 30 Mar 2017 17:05:57 -0400 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, wei.dai@intel.com, Alex Zelezniak Date: Thu, 30 Mar 2017 16:05:54 -0500 Message-Id: <1490907954-34791-1-git-send-email-alexz@att.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490877194-33917-1-git-send-email-alexz@att.com> References: <1490877194-33917-1-git-send-email-alexz@att.com> X-RSA-Inspected: yes X-RSA-Classifications: public X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-30_16:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_policy_notspam policy=outbound_policy score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703300179 Subject: [dpdk-dev] [PATCH v4] net/ixgbe: ping VF when PF status changes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 21:06:19 -0000 From: Alex Zelezniak v4: * Removed duplicate line v3: * Added 17.05 block to rte_pmd_ixgbe_version.map file v2: * Removed trailing spaces v1: * Implements function used by application managing PF to inform VF when link status changes Signed-off-by: Alex Zelezniak --- drivers/net/ixgbe/ixgbe_ethdev.c | 31 +++++++++++++++++++++++++++++ drivers/net/ixgbe/rte_pmd_ixgbe.h | 14 +++++++++++++ drivers/net/ixgbe/rte_pmd_ixgbe_version.map | 6 ++++++ 3 files changed, 51 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 34bd681..a427a3d 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4898,6 +4898,37 @@ 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)); + + 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..cdb747e 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h @@ -42,6 +42,20 @@ #include /** + * Notify VF when PF link 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