From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id DCC04100F for ; Fri, 31 Mar 2017 02:48:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490921287; x=1522457287; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KMWLRR7KzJAA2wFAOVOZPT5RohkFvIoOv7as6LZ3wzw=; b=wWg+nMhswRR22IKtCX1H2JAZOBEvCir1jnIdTwPQdbzcoJH3aV5qN/jw yobx6UYVJA3fHZce13iZelU33kImJQ==; Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Mar 2017 17:48:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,249,1486454400"; d="scan'208";a="67166110" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by orsmga002.jf.intel.com with ESMTP; 30 Mar 2017 17:48:03 -0700 Received: from pgsmsx101.gar.corp.intel.com ([169.254.1.119]) by PGSMSX108.gar.corp.intel.com ([169.254.8.13]) with mapi id 14.03.0248.002; Fri, 31 Mar 2017 08:47:41 +0800 From: "Dai, Wei" To: "alexz@att.com" , "dev@dpdk.org" CC: "Ananyev, Konstantin" , "Zhang, Helin" , "Lu, Wenzhuo" , "Iremonger, Bernard" Thread-Topic: [PATCH v4] net/ixgbe: ping VF when PF status changes Thread-Index: AQHSqZl9TgzLgy5zD0O5VI/OqiQ7Z6GuG82w Date: Fri, 31 Mar 2017 00:47:40 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D650A23F62@PGSMSX101.gar.corp.intel.com> References: <1490877194-33917-1-git-send-email-alexz@att.com> <1490907954-34791-1-git-send-email-alexz@att.com> In-Reply-To: <1490907954-34791-1-git-send-email-alexz@att.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTc5OTJhOTItNDkzNy00MDRhLThiMmQtMDk5YjQyZGUyZTM0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InFncWtVODNYcXo1STRmVlExREdOYTB1d1c2QTVkN1dZcUs1SUg0aXNtcDQ9In0= x-ctpclassification: CTP_IC x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: Fri, 31 Mar 2017 00:48:07 -0000 Hi, Alexz Thanks for your quick reponse. Hi, Wenzhuo Would you please review it again and add your acknowledgement if it is OK f= or you. > Subject: [PATCH v4] net/ixgbe: ping VF when PF status changes >=20 > From: Alex Zelezniak >=20 > v4: > * Removed duplicate line >=20 > v3: > * Added 17.05 block to rte_pmd_ixgbe_version.map file >=20 > v2: > * Removed trailing spaces >=20 > v1: > * Implements function used by application managing PF to inform VF when l= ink > status changes >=20 > Signed-off-by: Alex Zelezniak Acked-by: Wei Dai > --- > 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(+) >=20 > 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_de= v > *dev, bool on) > return new_val; > } >=20 > +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 =3D &rte_eth_devices[port]; > + pci_dev =3D IXGBE_DEV_TO_PCI(dev); > + > + if (!is_device_supported(dev, &rte_ixgbe_pmd)) > + return -ENOTSUP; > + > + if (vf >=3D pci_dev->max_vfs) > + return -EINVAL; > + > + hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + vfinfo =3D *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); > + > + ctrl =3D IXGBE_PF_CONTROL_MSG; > + if (vfinfo[vf].clear_to_send) > + ctrl |=3D IXGBE_VT_MSGTYPE_CTS; > + > + ixgbe_write_mbx(hw, &ctrl, 1, vf); > + > + return 0; > +} >=20 > 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 >=20 > /** > + * 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