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 BDBC1F612; Wed, 11 Jan 2017 16:15:16 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP; 11 Jan 2017 07:15:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="51814012" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.38]) ([10.237.220.38]) by orsmga005.jf.intel.com with ESMTP; 11 Jan 2017 07:15:14 -0800 To: Bernard Iremonger , dev@dpdk.org, wenzhuo.lu@intel.com References: <1484144751-10412-1-git-send-email-bernard.iremonger@intel.com> Cc: stable@dpdk.org From: Ferruh Yigit Message-ID: Date: Wed, 11 Jan 2017 15:15:13 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1484144751-10412-1-git-send-email-bernard.iremonger@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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 15:15:17 -0000 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 without > @@ -4066,6 +4066,12 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, > dev = &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; > + This part seems common for all functions, what do you think exporting this into a static function? Also in the feature if you need to update the method to decide if this port_id is supported or not, only that function will be effected. <...>