From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com
 [209.85.212.169]) by dpdk.org (Postfix) with ESMTP id 2C63D58E6
 for <dev@dpdk.org>; Tue, 14 Oct 2014 16:02:07 +0200 (CEST)
Received: by mail-wi0-f169.google.com with SMTP id h11so6120584wiw.4
 for <dev@dpdk.org>; Tue, 14 Oct 2014 07:09:51 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:organization
 :user-agent:in-reply-to:references:mime-version
 :content-transfer-encoding:content-type;
 bh=mvr4OUc/6dS5LPfL0bKuxeJSqvEWVJNz2kVWfhS2BZ8=;
 b=GtTq0lr1An+wH1/l1FbhTkXnH+/CurGR1oGA97cwyAnwRq7b3NOljkN6w80sbAmlGW
 +Ct7RDQPGfONjs1T2/GL04CN1ypUYuoPsQDiITpPrQ/LFlWnS/g+w4rqOl+1CqDQN+vh
 s0sDltGato6ytfWDGudQP+WV8niCy+8Ay55c6M1u2TvErNLhzq/61B4m5kwj2QFzFBqp
 daR1BjW+w4p386jVMoNIPVvJA0J8O4esUuKaD/Hu6DWM+HLFluE6FEk+CI6Fn46xAO16
 2G7MzRea8O5dIJuuxMzRqe1gwIsTrk2oy+60VwIMK9rnftriK4km44/RPSXRyevRUU0F
 aNiQ==
X-Gm-Message-State: ALoCoQldWMT42VSMC7ADtoewYPiZLRRYzIJ86DzF9fazU9AUlFw3Laba4bGfpo5OT6pFmP+N/N+A
X-Received: by 10.194.91.212 with SMTP id cg20mr5638527wjb.66.1413295791356;
 Tue, 14 Oct 2014 07:09:51 -0700 (PDT)
Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136])
 by mx.google.com with ESMTPSA id fa7sm20340165wjd.27.2014.10.14.07.09.49
 for <multiple recipients>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 14 Oct 2014 07:09:50 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: "Chen Jing D(Mark)" <jing.d.chen@intel.com>
Date: Tue, 14 Oct 2014 16:09:36 +0200
Message-ID: <20784375.UWMeVtoV91@xps13>
Organization: 6WIND
User-Agent: KMail/4.14.1 (Linux/3.16.4-1-ARCH; KDE/4.14.1; x86_64; ; )
In-Reply-To: <1411478047-1251-2-git-send-email-jing.d.chen@intel.com>
References: <1411478047-1251-1-git-send-email-jing.d.chen@intel.com>
 <1411478047-1251-2-git-send-email-jing.d.chen@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/6] ether: enhancement for VMDQ support
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <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: Tue, 14 Oct 2014 14:02:07 -0000

2014-09-23 21:14, Chen Jing D:
> The change includes several parts:
> 1. Clear pool bitmap when trying to remove specific MAC.
> 2. Define RSS, DCB and VMDQ flags to combine rx_mq_mode.
> 3. Use 'struct' to replace 'union', which to expand the rx_adv_conf
>    arguments to better support RSS, DCB and VMDQ.
> 4. Fix bug in rte_eth_dev_config_restore function, which will restore
>    all MAC address to default pool.
> 5. Define additional 3 arguments for better VMDQ support.
> 
> Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
> Acked-by: Jijiang Liu <jijiang.liu@intel.com>
> Acked-by: Huawei Xie <huawei.xie@intel.com>

Whaou, there were a lot of reviewers!
The patch should be really clean. Let's see :)

> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
>  		/* add address to the hardware */
> -		if  (*dev->dev_ops->mac_addr_add)
> +		if  (*dev->dev_ops->mac_addr_add &&
> +			dev->data->mac_pool_sel[i] & (1ULL << pool))
>  			(*dev->dev_ops->mac_addr_add)(dev, &addr, i, pool);

> +	/* Update pool bitmap in NIC data structure */
> +	dev->data->mac_pool_sel[index] = 0;

Reset is a better word than "Update" in this case.
But do we really need a comment for that?

> +#define ETH_MQ_RX_RSS_FLAG  0x1
> +#define ETH_MQ_RX_DCB_FLAG  0x2
> +#define ETH_MQ_RX_VMDQ_FLAG 0x4

Need a comment to know where these flags can be used.

>  enum rte_eth_rx_mq_mode {
> -	ETH_MQ_RX_NONE = 0,  /**< None of DCB,RSS or VMDQ mode */
> -
> -	ETH_MQ_RX_RSS,       /**< For RX side, only RSS is on */
> -	ETH_MQ_RX_DCB,       /**< For RX side,only DCB is on. */
> -	ETH_MQ_RX_DCB_RSS,   /**< Both DCB and RSS enable */
> -
> -	ETH_MQ_RX_VMDQ_ONLY, /**< Only VMDQ, no RSS nor DCB */
> -	ETH_MQ_RX_VMDQ_RSS,  /**< RSS mode with VMDQ */
> -	ETH_MQ_RX_VMDQ_DCB,  /**< Use VMDQ+DCB to route traffic to queues */
> -	ETH_MQ_RX_VMDQ_DCB_RSS, /**< Enable both VMDQ and DCB in VMDq */
> +	/**< None of DCB,RSS or VMDQ mode */
> +	ETH_MQ_RX_NONE = 0,
> +
> +	/**< For RX side, only RSS is on */
> +	ETH_MQ_RX_RSS = ETH_MQ_RX_RSS_FLAG,
> +	/**< For RX side,only DCB is on. */
> +	ETH_MQ_RX_DCB = ETH_MQ_RX_DCB_FLAG,
> +	/**< Both DCB and RSS enable */
> +	ETH_MQ_RX_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG,
> +
> +	/**< Only VMDQ, no RSS nor DCB */
> +	ETH_MQ_RX_VMDQ_ONLY = ETH_MQ_RX_VMDQ_FLAG,
> +	/**< RSS mode with VMDQ */
> +	ETH_MQ_RX_VMDQ_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_VMDQ_FLAG,
> +	/**< Use VMDQ+DCB to route traffic to queues */
> +	ETH_MQ_RX_VMDQ_DCB = ETH_MQ_RX_VMDQ_FLAG | ETH_MQ_RX_DCB_FLAG,
> +	/**< Enable both VMDQ and DCB in VMDq */
> +	ETH_MQ_RX_VMDQ_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG |
> +				 ETH_MQ_RX_VMDQ_FLAG,
>  };

Why not simply remove all these combinations and keep only flags?
Please keep it simple.

> +	/**< Specify the queue range belongs to VMDQ pools if VMDQ applicable */
> +	uint16_t vmdq_queue_base;
> +	uint16_t vmdq_queue_num;

If comment is before, it should be /** not /**<.

> +	uint16_t vmdq_pool_base; /** < Specify the start pool ID of VMDQ pools */

There is a typo with the space --^
Please, when writing comments, ask yourself if each word is required
and how it can be shorter.
Example here: /**< first ID of VMDQ pools */

Conclusion: NACK
There are only few typos and minor things but it would help to have more
careful reviews. Having a list of people at the beginning of the patch
didn't help in this case.

Thanks for your attention
-- 
Thomas