From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IEnDVn4BJ9Ff2uYxqzPLF/Xvwo0aFhWYIlMLxMQxJhE=; b=wHIIy+1pLPx4kA6o8JhiHgHYXTfhZ97oga+7ucUJHHyrxKXwXUflM8RegVoipWmQCw h3YjPUZagD7NDk8I5d3b1qzONVI27PTwdWyCSImhgIucKaxFkKGnM99K2C8D1rhxzC1h VTpEK4+SqJuHvDbgUHLp08V8RzCYuOyNuoD5oouZ+zAGWLroYhk4xPIarAUdXn0JcfP3 QSQqT7Ci0ipCo6t7lTi41K3f4hRJSaTYJD8i5O0u6ePs/mxz2/QMLfDksm47vV/xLprv bCpntVZjXtY7W4+KaWFQbez7CHrFMa2nmq6H78v33p+aGXaY7DO81aRaGwOJFjAtgQcs 2VhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IEnDVn4BJ9Ff2uYxqzPLF/Xvwo0aFhWYIlMLxMQxJhE=; b=dprTmTsAtJl7P4VnH1F1T1xFLsN+3KmSX7bqP9SzLyOCU9QnkNyObe9KQZsOOgVAK2 sE3xMwHJQ+Cgd5CSSezc5iQwLqdZYi7yVrcUEuX3b0anGib5dXKdGMH7ILVaiBgfKkOw YCVgYCqHYUsaoUNFnK8mlTQUBSzIXWw3TopXku/JehwLu5H84+xTcNBewu0tcUjMUmfm ElHi0vm4D4RQsFvdLVpjzd/Dssit9JUTnLWM42XEL97DBF2G8k0Ae16CrElgv3gfqwTO M6Xfwkf0fF+ZwKMKiR3YNcyP4HkeCR1Ri5ikI1ctqyUH+zrYHEpjRM37KFEuzavmm01Q tyAg== X-Gm-Message-State: AKwxytcje7oY2TZ9+ELtVuxPzevM5KfeX+tN2gOvymsGhEEbokwo6ERz M0PO8Ni9hUNy0BwfNFlVYrm70A== X-Google-Smtp-Source: AH8x227f/pI0PLj7AtsaoL9peoq/5/ihJfgr5zOy0mUEryA0s/wUlbNMCM+DnJgdAUB0iSuW3qiTPg== X-Received: by 10.80.174.245 with SMTP id f50mr34719645edd.28.1516985054266; Fri, 26 Jan 2018 08:44:14 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id k11sm2714111eda.22.2018.01.26.08.44.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 08:44:13 -0800 (PST) Date: Fri, 26 Jan 2018 17:44:01 +0100 From: Adrien Mazarguil To: Ophir Munk Cc: dev@dpdk.org, Thomas Monjalon , Olga Shern , stable@dpdk.org 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 Content-Disposition: inline In-Reply-To: <1516750367-26610-1-git-send-email-ophirmu@mellanox.com> Subject: Re: [dpdk-dev] [PATCH v1] net/mlx4: fix single port configuration 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, 26 Jan 2018 16:44:14 -0000 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