From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH v1] net/mlx4: fix single port configuration Date: Fri, 26 Jan 2018 17:44:01 +0100 Message-ID: <20180126164401.GY4256@6wind.com> References: <1516750367-26610-1-git-send-email-ophirmu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Thomas Monjalon , Olga Shern , stable@dpdk.org To: Ophir Munk Return-path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 857E51B2DE for ; Fri, 26 Jan 2018 17:44:14 +0100 (CET) Received: by mail-wm0-f42.google.com with SMTP id t74so2488719wme.3 for ; Fri, 26 Jan 2018 08:44:14 -0800 (PST) Content-Disposition: inline In-Reply-To: <1516750367-26610-1-git-send-email-ophirmu@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Ophir, On Tue, Jan 23, 2018 at 11:32:47PM +0000, Ophir Munk wrote: > The number of mlx4 present ports is calculated as follows: > conf.ports.present |= (UINT64_C(1) << device_attr.phys_port_cnt) - 1; > > That is - all ones sequence (due to -1 subtraction) > When retrieving the number of ports, 1 must be added in order to obtain > the correct number of ports to the power of 2, as follows: > uint32_t ports = rte_log2_u32(conf->ports.present + 1); > If 1 was not added, in the case of one port, the number of ports would > be falsely calculated as 0. > > Fixes: 82642799 ("net/mlx4: check max number of ports dynamically") > Cc: stable@dpdk.org > > Signed-off-by: Ophir Munk I was too busy to reply earlier, thanks for taking care of this issue. Acked-by: Adrien Mazarguil -- Adrien Mazarguil 6WIND