From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ferruh.yigit@intel.com>
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 92C2E475D
 for <dev@dpdk.org>; Wed,  7 Dec 2016 15:46:28 +0100 (CET)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by orsmga101.jf.intel.com with ESMTP; 07 Dec 2016 06:46:15 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="1069149752"
Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.29])
 ([10.237.220.29])
 by orsmga001.jf.intel.com with ESMTP; 07 Dec 2016 06:46:14 -0800
To: Wenzhuo Lu <wenzhuo.lu@intel.com>, dev@dpdk.org
References: <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com>
 <1481081535-37448-1-git-send-email-wenzhuo.lu@intel.com>
 <1481081535-37448-20-git-send-email-wenzhuo.lu@intel.com>
Cc: Bernard Iremonger <bernard.iremonger@intel.com>
From: Ferruh Yigit <ferruh.yigit@intel.com>
Message-ID: <bfd52043-69d9-2b73-00a1-6a65dad81474@intel.com>
Date: Wed, 7 Dec 2016 14:46:13 +0000
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
In-Reply-To: <1481081535-37448-20-git-send-email-wenzhuo.lu@intel.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH v2 19/32] net/i40e: set VF VLAN filter from PF
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Dec 2016 14:46:29 -0000

On 12/7/2016 3:32 AM, Wenzhuo Lu wrote:
> add rte_pmd_i40e_set_vf_vlan_filter API.
> User can call the API on PF to enable/disable
> a set of VF's VLAN filters.
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c            | 50 +++++++++++++++++++++++++++++++
>  drivers/net/i40e/rte_pmd_i40e.h           | 22 ++++++++++++++
>  drivers/net/i40e/rte_pmd_i40e_version.map |  1 +
>  3 files changed, 73 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 601e933..bc96698 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -10516,3 +10516,53 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on)
>  
>  	return ret;
>  }
> +
> +int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
> +				    uint64_t vf_mask, uint8_t on)
> +{
<...>
> +
> +	for (pool_idx = 0;
> +	     pool_idx < ETH_64_POOLS && pool_idx < pf->nb_cfg_vmdq_vsi;
> +	     pool_idx++) {
> +		if (vf_mask & ((uint64_t)(1ULL << pool_idx))) {
> +			if (on)
> +				ret = i40e_vsi_add_vlan(pf->vmdq[pool_idx].vsi,
> +							vlan_id);
> +			else
> +				ret = i40e_vsi_delete_vlan(
> +					pf->vmdq[pool_idx].vsi, vlan_id);
> +		}
> +	}
> +
> +	if (ret != I40E_SUCCESS)
> +		PMD_DRV_LOG(ERR, "Failed to set VF VLAN filter, on = %d", on);

Since loop not break on error, this will only log the last one, if the
error is in the middle, it is missed.

<...>