From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00074.outbound.protection.outlook.com [40.107.0.74]) by dpdk.org (Postfix) with ESMTP id 4A99519F5; Sun, 28 Jan 2018 08:22:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=huPB/ZteOn1G2RD0dURM9N4zRCAeHH6gLwnOhLHrjYM=; b=RsvhdvYTWm4tPAba2XYYJ3i5taSxVvxlxJujD/8tFsGMGeJ+U0jKPQke6F8e5zL0rsoHXZqXmdd/HJOMYJgNz1/3mr/UHG5Ayl6AzQ3ULINDDz416g2IG5xDABAWKAT0YzvbwWcYCd2+BA51D+U0OeeK7no2K4nlP2o6+xNWHL8= Received: from VI1PR05MB3149.eurprd05.prod.outlook.com (10.170.237.142) by VI1PR05MB3518.eurprd05.prod.outlook.com (10.175.242.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Sun, 28 Jan 2018 07:22:31 +0000 Received: from VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::cd00:54ee:63a8:937c]) by VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::cd00:54ee:63a8:937c%13]) with mapi id 15.20.0444.016; Sun, 28 Jan 2018 07:22:31 +0000 From: Shahaf Shuler To: Adrien Mazarguil , Ophir Munk CC: "dev@dpdk.org" , Thomas Monjalon , "Olga Shern" , "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH v1] net/mlx4: fix single port configuration Thread-Index: AQHTlsTo0TM1/BMEcUG6Xouh6o3CCqOI40qw Date: Sun, 28 Jan 2018 07:22:31 +0000 Message-ID: References: <1516750367-26610-1-git-send-email-ophirmu@mellanox.com> <20180126164401.GY4256@6wind.com> In-Reply-To: <20180126164401.GY4256@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.107] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB3518; 7:PvYYE+HjFILa8LBK0tBRFb7a2iB+axX80cF4QhYwfU1XlFy0aawhAYQfg/ZKl7iZe0bU2D7QaeME3zbwk38L7MNkR6egoqF8H/az0d/HLbP43tnniIk8SvDr/IpDWixGjePDPQB56gWmm2xfKbW0N40CQAF4nyDh0CuSjJ3slQJDFjxXWtMRN2RZVrEGR4s0OM1yaHHVBPyIL9rl7921HYdwX6Z3GsTK6LykgyR/JAgkPEeCo3AkFTu/wxk1RloQ x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: aecfdb9f-20a3-478a-6ad2-08d5661fe4e1 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:VI1PR05MB3518; x-ms-traffictypediagnostic: VI1PR05MB3518: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231099)(2400081)(944501161)(6055026)(6041288)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:VI1PR05MB3518; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB3518; x-forefront-prvs: 05669A7924 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(366004)(39380400002)(39860400002)(376002)(346002)(396003)(199004)(189003)(59450400001)(3846002)(2906002)(102836004)(305945005)(76176011)(7696005)(2950100002)(6116002)(6636002)(2900100001)(66066001)(33656002)(7736002)(6506007)(110136005)(229853002)(3660700001)(81156014)(6246003)(8676002)(316002)(5660300001)(99286004)(54906003)(3280700002)(5250100002)(6436002)(26005)(25786009)(81166006)(8936002)(4326008)(106356001)(105586002)(186003)(68736007)(53936002)(97736004)(86362001)(478600001)(74316002)(55016002)(14454004)(9686003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3518; H:VI1PR05MB3149.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rXoCY4vJNJzi+Hyi0Np2GXVc4sG/LSQRFAco0ZjtS+QYNgC2AwsQihoZrdyv3UxaCGt+NY/6bGKajeFJsuCGUw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: aecfdb9f-20a3-478a-6ad2-08d5661fe4e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2018 07:22:31.1696 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3518 Subject: Re: [dpdk-dev] [dpdk-stable] [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: Sun, 28 Jan 2018 07:22:34 -0000 Friday, January 26, 2018 6:44 PM, Adrien Mazarguil: > Hi Ophir, >=20 > 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 |=3D (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 =3D 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 >=20 > I was too busy to reply earlier, thanks for taking care of this issue. >=20 > Acked-by: Adrien Mazarguil Applied to next-net-mlx, thanks.=20 >=20 > -- > Adrien Mazarguil > 6WIND