From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id DEF1D58CF for ; Thu, 5 Jan 2017 06:58:25 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 04 Jan 2017 21:58:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,319,1477983600"; d="scan'208";a="1108201648" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 04 Jan 2017 21:58:24 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 4 Jan 2017 21:58:24 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Thu, 5 Jan 2017 13:58:22 +0800 From: "Wu, Jingjing" To: "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH v7 01/27] net/i40e: support link status notification Thread-Index: AQHSZY6LZx/wGuhPDkyA6Skx1n+7zKEpZXaQ Date: Thu, 5 Jan 2017 05:58:21 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810CC342A@SHSMSX103.ccr.corp.intel.com> References: <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com> <1483426488-117332-1-git-send-email-wenzhuo.lu@intel.com> <1483426488-117332-2-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1483426488-117332-2-git-send-email-wenzhuo.lu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v7 01/27] net/i40e: support link status notification 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, 05 Jan 2017 05:58:26 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > Sent: Tuesday, January 3, 2017 2:54 PM > To: dev@dpdk.org > Cc: Lu, Wenzhuo > Subject: [dpdk-dev] [PATCH v7 01/27] net/i40e: support link status notifi= cation >=20 > Add an API to expose the ability, that PF can notify VF when link status = changes, > to APP. > So if PF APP doesn't want to enable interruption but check link status by= itself, PF > APP can let VF know link status changed. >=20 > Signed-off-by: Wenzhuo Lu > --- > drivers/net/i40e/Makefile | 4 ++- > drivers/net/i40e/i40e_ethdev.c | 28 +++++++++++++++ > drivers/net/i40e/i40e_pf.c | 4 +-- > drivers/net/i40e/i40e_pf.h | 4 ++- > drivers/net/i40e/rte_pmd_i40e.h | 58 > +++++++++++++++++++++++++++++++ > drivers/net/i40e/rte_pmd_i40e_version.map | 7 ++++ > 6 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 > drivers/net/i40e/rte_pmd_i40e.h >=20 > diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile index > 66997b6..a2ef53c 100644 > --- a/drivers/net/i40e/Makefile > +++ b/drivers/net/i40e/Makefile > @@ -1,6 +1,6 @@ > # BSD LICENSE > # > -# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. > +# Copyright(c) 2010-2016 Intel Corporation. All rights reserved. > # All rights reserved. > # > # Redistribution and use in source and binary forms, with or without > @@ -111,6 +111,8 @@ ifeq ($(findstring > RTE_MACHINE_CPUFLAG_SSE4_1,$(CFLAGS)),) > CFLAGS_i40e_rxtx_vec_sse.o +=3D -msse4.1 > endif >=20 > +# install this header file > +SYMLINK-$(CONFIG_RTE_LIBRTE_I40E_PMD)-include :=3D rte_pmd_i40e.h >=20 > # this lib depends upon: > DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) +=3D lib/librte_eal lib/librte_eth= er > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index f42f4ba..fc7e987 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -62,6 +62,7 @@ > #include "i40e_rxtx.h" > #include "i40e_pf.h" > #include "i40e_regs.h" > +#include "rte_pmd_i40e.h" >=20 > #define ETH_I40E_FLOATING_VEB_ARG "enable_floating_veb" > #define ETH_I40E_FLOATING_VEB_LIST_ARG "floating_veb_list" > @@ -9695,3 +9696,30 @@ static void i40e_set_default_mac_addr(struct > rte_eth_dev *dev, >=20 > return ret; > } > + > +int > +rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) { > + struct rte_eth_dev *dev; > + struct rte_eth_dev_info dev_info; > + struct i40e_pf *pf; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); > + > + dev =3D &rte_eth_devices[port]; > + rte_eth_dev_info_get(port, &dev_info); > + > + if (vf >=3D dev_info.max_vfs) > + return -EINVAL; > + > + pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > + > + if (vf > pf->vf_num - 1 || !pf->vfs) { How about if (!pf->vfs || vf > pf->vf_num - 1) { because if vf_num is 0, the pf->vfs will be NULL. Thanks Jingjing