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 A24197D4E; Fri, 22 Sep 2017 18:48:32 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2017 09:48:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="902961302" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by FMSMGA003.fm.intel.com with ESMTP; 22 Sep 2017 09:48:30 -0700 To: Michal Jastrzebski , jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, deepak.k.jain@intel.com, Tomasz Kulasek , stable@dpdk.org References: <20170922123625.4896-1-michalx.k.jastrzebski@intel.com> From: Ferruh Yigit Message-ID: Date: Fri, 22 Sep 2017 17:48:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170922123625.4896-1-michalx.k.jastrzebski@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] net/i40e: fix assignment of enum values 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, 22 Sep 2017 16:48:34 -0000 On 9/22/2017 1:36 PM, Michal Jastrzebski wrote: > From: Tomasz Kulasek > > mixed_enums: Mixing enum types enum i40e_vsi_type and enum > virtchnl_vsi_type for type > > Coverity issue 158651 > Fixes: a58860f68929 ("net/i40e/base: use new virtchnl header file") > Cc: jingjing.wu@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Tomasz Kulasek > --- > drivers/net/i40e/i40e_ethdev_vf.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c > index 73c315a..a8d2740 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1295,7 +1295,15 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev, > if (hw->mac.type == I40E_MAC_X722_VF) > vf->flags = I40E_FLAG_RSS_AQ_CAPABLE; > vf->vsi.vsi_id = vf->vsi_res->vsi_id; > - vf->vsi.type = (enum i40e_vsi_type)vf->vsi_res->vsi_type; > + > + switch (vf->vsi_res->vsi_type) { > + case VIRTCHNL_VSI_SRIOV: > + vf->vsi.type = I40E_VSI_SRIOV; > + break; > + default: > + vf->vsi.type = I40E_VSI_TYPE_UNKNOWN; This changes the behavior. Previously: vsi_type == VIRTCHNL_VSI_TYPE_INVALID ? type = I40E_VSI_MAIN Now: vsi_type == VIRTCHNL_VSI_TYPE_INVALID ? type = I40E_VSI_TYPE_UNKNOWN > + break; > + } > vf->vsi.nb_qps = vf->vsi_res->num_queue_pairs; > vf->vsi.adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > >