From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50051.outbound.protection.outlook.com [40.107.5.51]) by dpdk.org (Postfix) with ESMTP id 74E9E2B9A for ; Tue, 26 Mar 2019 08:33:21 +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:X-MS-Exchange-SenderADCheck; bh=Kv0EHHADU50BYiTMQimHEAmEDYw+X0F3/FKhjpHwCKk=; b=vN4GTFmRE+oIp5SaP3z205o5dvaXkRNRzDNjfrLbOy71haJ/PSRkiZQwem/LfehLD77VuBzSsQtHTbpUxCtEWrJJyHsYbHgwMIQ5e0xRJspR4rtolpbwUMM5gDeJD4Ocbj/FrQHW1DEMYrTI4PhMQCsgnK3s9KNLgiN8PrwN+QI= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3459.eurprd05.prod.outlook.com (10.171.187.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Tue, 26 Mar 2019 07:33:19 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02%3]) with mapi id 15.20.1730.019; Tue, 26 Mar 2019 07:33:19 +0000 From: Slava Ovsiienko To: Stephen Hemminger CC: "dev@dpdk.org" , Shahaf Shuler Thread-Topic: [dpdk-dev] [PATCH v2 01/13] net/mlx5: add representor recognition on kernels 5.x Thread-Index: AQHU4zWq1pGH7ndYR0agVS9FKtj9UKYdgapg Date: Tue, 26 Mar 2019 07:33:19 +0000 Message-ID: References: <1553155888-27498-1-git-send-email-viacheslavo@mellanox.com> <1553533414-9911-1-git-send-email-viacheslavo@mellanox.com> <1553533414-9911-2-git-send-email-viacheslavo@mellanox.com> <20190325110743.6e98ff03@shemminger-XPS-13-9360> In-Reply-To: <20190325110743.6e98ff03@shemminger-XPS-13-9360> 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=viacheslavo@mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fe7c1a44-973f-4066-e2bf-08d6b1bd517f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3459; x-ms-traffictypediagnostic: AM4PR05MB3459: x-microsoft-antispam-prvs: x-forefront-prvs: 09888BC01D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(366004)(376002)(136003)(39850400004)(199004)(189003)(13464003)(486006)(6436002)(33656002)(6916009)(68736007)(66066001)(5660300002)(81166006)(93886005)(106356001)(54906003)(256004)(8676002)(8936002)(97736004)(81156014)(14454004)(229853002)(76176011)(7696005)(74316002)(476003)(316002)(446003)(105586002)(2906002)(99286004)(11346002)(71200400001)(71190400001)(478600001)(107886003)(26005)(4326008)(53936002)(52536014)(53546011)(305945005)(186003)(86362001)(102836004)(25786009)(3846002)(6506007)(9686003)(6246003)(55016002)(7736002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3459; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: +svuaFuTt6PlauLmmeI9RbxyR46D/typMrGGB7OUXgH+LdTwuovI2NBwYkYSOcm+cD8txvC9KsB/hpuqMFUJ6mnKOFffd8GS5I4GpU2g3SzN+VHaViaED+lntwfH4vKA6lgGG5HynfEjiws4H+wO/7d11nc2Fwlm3UmMRzLmRK5RsDEvJuQ/dpAGU4jaYm8T7QHO7PfwdLefQhs3iY7atYOFJp37HlJ3OJqzS6eJ5RG/K7z1mIsF0jpv7kr/B9ymrD7OuAkTLQ8in1Eyb5SYkT+NX6atRhWKhkIPSP+OyRj85GWO5Bwtan5IYf/ixBAmcXnqDxMMvziEIhhdL2tka7rLDsBdbTjl9Mjph1CE1eWHxz6rB9/aNpkkU5Yu6U7R95QRaNrt6e8+E228S/ht2fbDwlIhR3NLnbpamT6WrP8= 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: fe7c1a44-973f-4066-e2bf-08d6b1bd517f X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 07:33:19.2243 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3459 Subject: Re: [dpdk-dev] [PATCH v2 01/13] net/mlx5: add representor recognition on kernels 5.x 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: Tue, 26 Mar 2019 07:33:21 -0000 > -----Original Message----- > From: Stephen Hemminger > Sent: Monday, March 25, 2019 20:08 > To: Slava Ovsiienko > Cc: dev@dpdk.org; Shahaf Shuler > Subject: Re: [dpdk-dev] [PATCH v2 01/13] net/mlx5: add representor > recognition on kernels 5.x >=20 > On Mon, 25 Mar 2019 17:03:22 +0000 > Viacheslav Ovsiienko wrote: >=20 > > + if (switch_id_set) { > > + if (info.port_name_new) { > > + /* New representors naming schema. */ > > + if (port_name_set) { > > + info.master =3D (info.port_name =3D=3D -1); > > + info.representor =3D (info.port_name !=3D -1); > > + } > > + } else { > > + /* Legacy representors naming schema. */ > > + info.master =3D (!port_name_set || num_vf_set); > > + info.representor =3D port_name_set && !num_vf_set; > > + } > > + } > > + assert(!(data.master && data.representor)); > > memcpy(arg, &info, sizeof(info)); > > return 0; >=20 > Since assert() is often removed in non-debug envirionments, Assert should be removed (compiled out) in non-debug environments. If not (= suddenly) - it must be resolved. > why not add a log message and return an error instead? Because there is no code producing assert wrong condition. No valid combina= tion of entry values to produce master&&representor. It is intended by desi= gn. We do not expect master&&representor condition at all. It should never = happen. Otherwise, we should notify the developer (because design is corrup= ted somewhere - and definitely it is not a runtime/user problem). So, asser= t seems to be the most relevant entity here. >>instead? We could add error/log in parallel, not instead of. With best regards, Slava From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id BF1C2A05D3 for ; Tue, 26 Mar 2019 08:33:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 813042BF7; Tue, 26 Mar 2019 08:33:22 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50051.outbound.protection.outlook.com [40.107.5.51]) by dpdk.org (Postfix) with ESMTP id 74E9E2B9A for ; Tue, 26 Mar 2019 08:33:21 +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:X-MS-Exchange-SenderADCheck; bh=Kv0EHHADU50BYiTMQimHEAmEDYw+X0F3/FKhjpHwCKk=; b=vN4GTFmRE+oIp5SaP3z205o5dvaXkRNRzDNjfrLbOy71haJ/PSRkiZQwem/LfehLD77VuBzSsQtHTbpUxCtEWrJJyHsYbHgwMIQ5e0xRJspR4rtolpbwUMM5gDeJD4Ocbj/FrQHW1DEMYrTI4PhMQCsgnK3s9KNLgiN8PrwN+QI= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3459.eurprd05.prod.outlook.com (10.171.187.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Tue, 26 Mar 2019 07:33:19 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02%3]) with mapi id 15.20.1730.019; Tue, 26 Mar 2019 07:33:19 +0000 From: Slava Ovsiienko To: Stephen Hemminger CC: "dev@dpdk.org" , Shahaf Shuler Thread-Topic: [dpdk-dev] [PATCH v2 01/13] net/mlx5: add representor recognition on kernels 5.x Thread-Index: AQHU4zWq1pGH7ndYR0agVS9FKtj9UKYdgapg Date: Tue, 26 Mar 2019 07:33:19 +0000 Message-ID: References: <1553155888-27498-1-git-send-email-viacheslavo@mellanox.com> <1553533414-9911-1-git-send-email-viacheslavo@mellanox.com> <1553533414-9911-2-git-send-email-viacheslavo@mellanox.com> <20190325110743.6e98ff03@shemminger-XPS-13-9360> In-Reply-To: <20190325110743.6e98ff03@shemminger-XPS-13-9360> 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=viacheslavo@mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fe7c1a44-973f-4066-e2bf-08d6b1bd517f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3459; x-ms-traffictypediagnostic: AM4PR05MB3459: x-microsoft-antispam-prvs: x-forefront-prvs: 09888BC01D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(366004)(376002)(136003)(39850400004)(199004)(189003)(13464003)(486006)(6436002)(33656002)(6916009)(68736007)(66066001)(5660300002)(81166006)(93886005)(106356001)(54906003)(256004)(8676002)(8936002)(97736004)(81156014)(14454004)(229853002)(76176011)(7696005)(74316002)(476003)(316002)(446003)(105586002)(2906002)(99286004)(11346002)(71200400001)(71190400001)(478600001)(107886003)(26005)(4326008)(53936002)(52536014)(53546011)(305945005)(186003)(86362001)(102836004)(25786009)(3846002)(6506007)(9686003)(6246003)(55016002)(7736002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3459; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: +svuaFuTt6PlauLmmeI9RbxyR46D/typMrGGB7OUXgH+LdTwuovI2NBwYkYSOcm+cD8txvC9KsB/hpuqMFUJ6mnKOFffd8GS5I4GpU2g3SzN+VHaViaED+lntwfH4vKA6lgGG5HynfEjiws4H+wO/7d11nc2Fwlm3UmMRzLmRK5RsDEvJuQ/dpAGU4jaYm8T7QHO7PfwdLefQhs3iY7atYOFJp37HlJ3OJqzS6eJ5RG/K7z1mIsF0jpv7kr/B9ymrD7OuAkTLQ8in1Eyb5SYkT+NX6atRhWKhkIPSP+OyRj85GWO5Bwtan5IYf/ixBAmcXnqDxMMvziEIhhdL2tka7rLDsBdbTjl9Mjph1CE1eWHxz6rB9/aNpkkU5Yu6U7R95QRaNrt6e8+E228S/ht2fbDwlIhR3NLnbpamT6WrP8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe7c1a44-973f-4066-e2bf-08d6b1bd517f X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 07:33:19.2243 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3459 Subject: Re: [dpdk-dev] [PATCH v2 01/13] net/mlx5: add representor recognition on kernels 5.x 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190326073319.IuMzOdGIUZw0L9atJPUWnw73MMvoLXyFBL0z6Y6k5GU@z> > -----Original Message----- > From: Stephen Hemminger > Sent: Monday, March 25, 2019 20:08 > To: Slava Ovsiienko > Cc: dev@dpdk.org; Shahaf Shuler > Subject: Re: [dpdk-dev] [PATCH v2 01/13] net/mlx5: add representor > recognition on kernels 5.x >=20 > On Mon, 25 Mar 2019 17:03:22 +0000 > Viacheslav Ovsiienko wrote: >=20 > > + if (switch_id_set) { > > + if (info.port_name_new) { > > + /* New representors naming schema. */ > > + if (port_name_set) { > > + info.master =3D (info.port_name =3D=3D -1); > > + info.representor =3D (info.port_name !=3D -1); > > + } > > + } else { > > + /* Legacy representors naming schema. */ > > + info.master =3D (!port_name_set || num_vf_set); > > + info.representor =3D port_name_set && !num_vf_set; > > + } > > + } > > + assert(!(data.master && data.representor)); > > memcpy(arg, &info, sizeof(info)); > > return 0; >=20 > Since assert() is often removed in non-debug envirionments, Assert should be removed (compiled out) in non-debug environments. If not (= suddenly) - it must be resolved. > why not add a log message and return an error instead? Because there is no code producing assert wrong condition. No valid combina= tion of entry values to produce master&&representor. It is intended by desi= gn. We do not expect master&&representor condition at all. It should never = happen. Otherwise, we should notify the developer (because design is corrup= ted somewhere - and definitely it is not a runtime/user problem). So, asser= t seems to be the most relevant entity here. >>instead? We could add error/log in parallel, not instead of. With best regards, Slava