From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4ED95A04F9; Fri, 10 Jan 2020 10:56:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1E6F71DBEB; Fri, 10 Jan 2020 10:56:03 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150083.outbound.protection.outlook.com [40.107.15.83]) by dpdk.org (Postfix) with ESMTP id DAED01DB76 for ; Fri, 10 Jan 2020 10:56:01 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dAUuH28lyZ6lXWe3sNzlMLtac3XXtIrOsMTheCvI/OPRR2ut6etwaI2sZzlFCL1oL8Sy4+I9P6XTxD4WI4MImEpPpFi7rOytgyPUlG1zm0NoC5+guV+ZTsHsIB4RoMsIw9wE0i3YDiluZcH1k/xGhXwS85tI3dsyxxBkQZpCX7JJw8zE06Mq15njlmjnH1MLDVboQZrNTvFiNqXfjTi5KgTIBIy4Sa83x6h2dUiCVOa0zjoVFScJ9Jfsuf1KIEmTa4rS087UTIMCikXYmiK9paZpH/U0VnCoYPPXBsuRigy5VZ95V6bHo/F6EbjKioH1fhv0KQdK6q6/ZD++Yg823A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iFpR7S3xoaoMmMmnLmi/XpuOmy8S1HM9IVJNr4C9Zeg=; b=CgYm3BzI1UEU6ao5hykDjycrxZleo13uMLSxhnUU8LIYPdYzmIxHp3JAyXzus5ma2MwF+qqTh/TB233u0x8/PK0O7F1oh8+K5QQaC8TdunIEmEzqOiLWeHPwTb0uxCd3k8uTnf5Vats76Re1zct3myn858qvtwzGny8/cL+lR78vdpdmOolbUX0bB3ssPzzB78iPtoxvy3edI6oCNnmaPj8YQnJ5vTwLr/WTUByZTF7ck4CCl2s1RT1kuSY8o3mrbCfEz/pDvkxv9T+pbWN+sS1KnNwNvYlWpZPFzZgVWr+eBe/7dVDmejj2ufj3vNmtAaBq2XNoJTrzv4ysqQroaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=iFpR7S3xoaoMmMmnLmi/XpuOmy8S1HM9IVJNr4C9Zeg=; b=IiPi4QK5rKQWRFKUFRpC6QJhnbLe4Haq62PRhDfg7N5lfTOSQg38AYsWj43o1srmzYT5RLuN5x3lS8FI7QkcRyTEInrFsVD6MYTcdwIGto0oPb9RPmHZ3dEqFhbxdO9MMhWoKc28nFtOXa0kk1tLZlgHZwmDqV7fHL2TCC0HRQU= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3489.eurprd05.prod.outlook.com (10.170.126.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.9; Fri, 10 Jan 2020 09:56:00 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::68eb:ad79:71f4:110f]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::68eb:ad79:71f4:110f%3]) with mapi id 15.20.2623.013; Fri, 10 Jan 2020 09:56:00 +0000 From: Slava Ovsiienko To: Thomas Monjalon CC: Ferruh Yigit , "dev@dpdk.org" , Matan Azrad , Raslan Darawsheh , Ori Kam Thread-Topic: [dpdk-dev] [PATCH v2 4/4] net/mlx5: engage free on completion queue Thread-Index: AQHVxtuEBKQevEEzgk6qMuFtgoO8n6ficmyAgAABqCCAAAVjgIAAAF4AgAEjC4CAAADJIIAABtCAgAAEVxA= Date: Fri, 10 Jan 2020 09:55:59 +0000 Message-ID: References: <1578500161-20156-1-git-send-email-viacheslavo@mellanox.com> <35082105.XM6RcZxFsP@xps> <3418044.RUnXabflUD@xps> In-Reply-To: <3418044.RUnXabflUD@xps> 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: [77.75.144.194] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d6f3ed8c-af80-4fbc-d9ad-08d795b34bd9 x-ms-traffictypediagnostic: AM4PR05MB3489:|AM4PR05MB3489: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 02788FF38E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(376002)(396003)(39860400002)(136003)(13464003)(199004)(189003)(2906002)(107886003)(316002)(66446008)(55016002)(66476007)(66556008)(64756008)(7696005)(54906003)(33656002)(8936002)(8676002)(71200400001)(81156014)(81166006)(9686003)(6916009)(478600001)(76116006)(26005)(6506007)(86362001)(53546011)(186003)(66946007)(52536014)(4326008)(5660300002)(21314003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3489; 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: BCL:0; x-microsoft-antispam-message-info: c6ik5cpyvW1ZC5tGLHh3CLU+G/x1hwFxma5ZCNQX0DGuGfjo1k0F2J5gL6VJ9iFGUtFtM36LBKS7K/uUYJ3BcRV+wlmPeT6xwLLEL0nS0oiFo/mp0IijyGkzsHzF62JpRG9RqfpxTxV7itWUuEOXkKspDeO9B9yRoSiaqr0ZOp8mLvEWGTFexxZolSO3+tE5G1cjnpRA3tdLkewPwBln06xndcIk1DsszFCFY3VFaKYL7a+GMwpSiopt7lC37Ldrfj06uqanGFhfKF8gR0ctd4Ofg2W4GNFh9FpcdoFzjnhwWZVRqfhXgj5vJI1DvRbpVLQXmLdHP9gFWbJlehHfQmGbgvHoeG+PslSENkp0BdjP5ovJJ7m1vSnCdJ76jAyOkUViP0jfBAeFJbIYBng5jyYW+5PfzEdFGLPH801f44gxa3g3RxxBUjZ2S7hHw9l1/HlvT65+FuZr+O/m22F6YJWHh0LNDj+WPcIA+RgcdEOAj4lroXTi/SxiW4SczN18dUc+11QFM8u5z2p1ywiTqw== 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: d6f3ed8c-af80-4fbc-d9ad-08d795b34bd9 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2020 09:55:59.8788 (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-CrossTenant-userprincipalname: mK4gKLn0QhWGjR/zHpJA4sDrDdHCJR5drB7DeafkzZ2JYrxIO0E0qXOX/e2A0e/SRkG2fOlHVIMMJOo2Pxb3/9gdytl8zSXWNgLZb0DRvFQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3489 Subject: Re: [dpdk-dev] [PATCH v2 4/4] net/mlx5: engage free on completion queue 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" > -----Original Message----- > From: Thomas Monjalon > Sent: Friday, January 10, 2020 11:34 > To: Slava Ovsiienko > Cc: Ferruh Yigit ; dev@dpdk.org; Matan Azrad > ; Raslan Darawsheh ; Ori > Kam > Subject: Re: [dpdk-dev] [PATCH v2 4/4] net/mlx5: engage free on completio= n > queue >=20 > 10/01/2020 10:28, Slava Ovsiienko: > > From: Thomas Monjalon > > > 09/01/2020 17:22, Slava Ovsiienko: > > > > From: Ferruh Yigit > > > > > On 1/9/2020 3:27 PM, Slava Ovsiienko wrote: > > > > > > From: Ferruh Yigit > > > > > >> On 1/9/2020 10:56 AM, Viacheslav Ovsiienko wrote: > > > > > >>> + assert(ci !=3D txq->cq_pi); > > > > > >>> + assert((txq->fcqs[ci & txq->cqe_m] >> 16) =3D=3D cqe- > > > > > >>> wqe_counter); > > > > > >> > > > > > >> And same comments on these as previous patches, we spend some > > > > > >> effort to remove the 'rte_panic' from drivers, this is almost = same > thing. > > > > > >> > > > > > >> I think a driver shouldn't decide to exit whole application, > > > > > >> it's effect should be limited to the driver. > > > > > >> > > > > > >> Assert is useful for debug and during development, but not > > > > > >> sure having them in the production code. > > > > > > > > > > > > IIRC, "assert" is standard C function. Compiled only if there > > > > > > is no NDEBUG > > > > > defined. > > > > > > So, assert does exactly what you are saying - provide the > > > > > > debug break not allowing the bug to evolve. And no this break > > > > > > in production > > > code. > > > > > > > > > > > > > > > > Since mlx driver is using NDEBUG defined, what you said is right > > > > > indeed. But why not using RTE_ASSERT to be consistent with rest. > > > > > There is a specific config option to control assert > > > > > (RTE_ENABLE_ASSERT) and anyone using it will get different > > > > > behavior with > > > mlx5. > > > > > > > > We have the dedicated option to control mlx5 debug: > > > > CONFIG_RTE_ENABLE_ASSERT controls the whole DPDK. > > > > > > No, it controls the whole DPDK except mlx PMDs. > > > > > > > CONFIG_RTE_LIBRTE_MLX5_DEBUG controls NDEBUG for mlx5 > > > > > > > > From my practice - I switch the mlx5 debug option (in the process > > > > of the debugging/testing datapath and checking the resulting > > > > performance, by directly defining NDEBUG in mlx5.h and not > > > > reconfiguring/rebuilding the > > > entire DPDK), this fine grained option seems to be useful. > > > > > > I don't like having mlx PMDs behave differently. > > > It make things difficult for newcomers. > > > And with meson, such options are cleaned up. > > > > Do you mean we should eliminate NDEBUG usage and convert it to some > explicit "MLX5_NDEBUG" > > (and convert "assert" to "MLX5_ASSERT") ? >=20 > I mean we should use RTE_ASSERT in mlx5, as it is already done in some fi= les. >=20 This would make not possible to engage asserts in mlx5 module only. It is a question of structuring/layering, not "different behavior". As for me - it is very nice to have fine grained debug control option, and I use this feature actively, it just saves my time. Also, it seems=20 these options are implemented in many other PMDs (with its own xxx_ASSERTs). With best regards, Slava