From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2A90637A6 for ; Thu, 5 Jan 2017 07:23:36 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 04 Jan 2017 22:23:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,319,1477983600"; d="scan'208";a="26386952" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 04 Jan 2017 22:23:35 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 4 Jan 2017 22:23:35 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 4 Jan 2017 22:23:35 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Thu, 5 Jan 2017 14:23:33 +0800 From: "Lu, Wenzhuo" To: "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v7 01/27] net/i40e: support link status notification Thread-Index: AQHSZxi4VgQTQda2FEuCcgOUncYjdKEpachQ Date: Thu, 5 Jan 2017 06:23:32 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B555E92@shsmsx102.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> <9BB6961774997848B5B42BEC655768F810CC342A@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810CC342A@SHSMSX103.ccr.corp.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 06:23:37 -0000 Hi Jingjing, > -----Original Message----- > From: Wu, Jingjing > Sent: Thursday, January 5, 2017 1:58 PM > To: Lu, Wenzhuo; dev@dpdk.org > Cc: Lu, Wenzhuo > Subject: RE: [dpdk-dev] [PATCH v7 01/27] net/i40e: support link status > notification >=20 >=20 >=20 > > -----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 > > notification > > > > 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. > > > > 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 > > > > 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 > > > > +# install this header file > > +SYMLINK-$(CONFIG_RTE_LIBRTE_I40E_PMD)-include :=3D rte_pmd_i40e.h > > > > # this lib depends upon: > > DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) +=3D lib/librte_eal > > lib/librte_ether diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.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" > > > > #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, > > > > 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 for the comments.=20 As the number can be 0, how about change the code to? if (vf >=3D pf->vf_num || !pf->vfs) { >=20 > Thanks > Jingjing