From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 4DDE0F610; Wed, 11 Jan 2017 18:05:54 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 11 Jan 2017 09:05:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="1092801719" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga001.fm.intel.com with ESMTP; 11 Jan 2017 09:05:51 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX152.ger.corp.intel.com ([169.254.6.191]) with mapi id 14.03.0248.002; Wed, 11 Jan 2017 17:05:50 +0000 From: "Iremonger, Bernard" To: "Yigit, Ferruh" , "dev@dpdk.org" , "Lu, Wenzhuo" CC: "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH] net/ixgbe: fix API parameter checking Thread-Index: AQHSbBak4YnKddgmZU2rRUf6smNHLaEzYtWAgAAeffA= Date: Wed, 11 Jan 2017 17:05:50 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C224D1CE0F@IRSMSX108.ger.corp.intel.com> References: <1484144751-10412-1-git-send-email-bernard.iremonger@intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTllMGZhMjYtOWExZC00OGYzLWFjNmMtNjRhYjgyOTgzMDVmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjIuMTEuMCIsIlRydXN0ZWRMYWJlbEhhc2giOiJLeitBZzZRcTUzdWRnd1V0N0ZMOHNndnRSTEdrZEM3Zk51TnNlUlJSVUVRPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] net/ixgbe: fix API parameter checking 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: Wed, 11 Jan 2017 17:05:54 -0000 Hi Ferruh, > -----Original Message----- > From: Yigit, Ferruh > Sent: Wednesday, January 11, 2017 3:15 PM > To: Iremonger, Bernard ; dev@dpdk.org; > Lu, Wenzhuo > Cc: stable@dpdk.org > Subject: Re: [dpdk-stable] [PATCH] net/ixgbe: fix API parameter checking >=20 > On 1/11/2017 2:25 PM, Bernard Iremonger wrote: > > Add checks to rte_pmd_ixgbe_* API's to ensure that the port is an > > ixgbe port. > > > > Fixes: 49e248223e9f ("net/ixgbe: add API for VF management") > > > > CC: stable@dpdk.org > > Signed-off-by: Bernard Iremonger > > --- > > drivers/net/ixgbe/ixgbe_ethdev.c | 71 > > ++++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 69 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > > b/drivers/net/ixgbe/ixgbe_ethdev.c > > index b7ddd4f..ca14104 100644 > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > > @@ -1,7 +1,7 @@ > > /*- > > * BSD LICENSE > > * > > - * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. > > + * Copyright(c) 2010-2017 Intel Corporation. All rights reserved. > > * All rights reserved. > > * > > * Redistribution and use in source and binary forms, with or withou= t > > @@ -4066,6 +4066,12 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, > uint16_t vf, > > dev =3D &rte_eth_devices[port]; > > rte_eth_dev_info_get(port, &dev_info); > > > > + if (!strstr(dev_info.driver_name, "ixgbe")) > > + return -ENOTSUP; > > + > > + if (strstr(dev_info.driver_name, "ixgbe_vf")) > > + return -ENOTSUP; > > + >=20 > This part seems common for all functions, what do you think exporting thi= s > into a static function? >=20 > Also in the feature if you need to update the method to decide if this po= rt_id > is supported or not, only that function will be effected. >=20 > <...> Ok, I will put the checks into a static function and send a v2. Regards, Bernard.