From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4ECA5425FC for ; Wed, 20 Sep 2023 19:29:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4727740ED9; Wed, 20 Sep 2023 19:29:01 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2104.outbound.protection.outlook.com [40.107.237.104]) by mails.dpdk.org (Postfix) with ESMTP id 24F68402C3; Wed, 20 Sep 2023 19:28:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NlBpRSFb8jjglwwivfFIjYb1Q6BzsZPI5nkMVR5Wpz5F5Ci6sO2is7F6fipbjjK2xhZ96WoCIcd1JnXYrDTU7Cfe/R+kMJWXxJjqcROh+LojbCeGqpcMaEWBMoXZM8ohisdodxkxm2slO9J+16solLn+kwjpHv+eLAxVXTru2DcTBXAjUa7G0AaI4eVLgWBjN5cEHIoWohjvBU5lLfVKHOAZ0TzzZQctPBs5c5f8Hc+2P704zQRRiJzuGMT8M8+VetAkoPio7cXKTILg3QBdG2u9KE8Ve8JdcbJPfQoP9VC8mSvTsEJNqDWJu0/4XHkp1rqs+BO2MyebLBENyoXSXw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ir51Rq0pEhp3kJS0TNoyGk0W8211QVMb/xbbX1s7Pi4=; b=gjMrJFQaMvsR/hRA85KovCQEuRd3KHsZvvZj6+R0HsJmPh6qXq1gC/sLjStwhhh9zUjDRyVpmvmpZTU7z5y2XULpfw0ustptt+k+exdIGTxIgj+P2Fv+eZ5HBNqLbIsGupzUwSKLeE4171H0WsLIay6RoUKTtqcYrejAxIMxvAr8d29qIVff0YGhiX0i+iIpxryaiMEjWvduSLMXNOrLc3Ooz3zVE6JNQ4IccEOTWep7q/gV42ke2xPOyh+M0h08/rYRw0s8p+RRIu3RuyJm0ADR1mEallyLINLPg8t8VRj7yEmeapvIjSijuyHQvP3CjbN/jwu3CRPRy6l0axTXmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ir51Rq0pEhp3kJS0TNoyGk0W8211QVMb/xbbX1s7Pi4=; b=aNpP+3/aYjqlFacpEJh+8X/63ijniNj5KRRXCN0NgFTz7G6TLGHbzRPpv8qZpQLk55xp8vXCQK2f0tTm7vVUMv4pVUUwakiQLqf+nxohdSda911/o2EdNW40OIQQhMwSQYLqJZZ9A4TMTgJh8mKheFSpHxiePshrN0yp+H+bOg8= Received: from PH7PR21MB3263.namprd21.prod.outlook.com (2603:10b6:510:1db::16) by MN0PR21MB3462.namprd21.prod.outlook.com (2603:10b6:208:3d1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.6; Wed, 20 Sep 2023 17:28:56 +0000 Received: from PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::69a5:e3db:6bba:9f1]) by PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::69a5:e3db:6bba:9f1%7]) with mapi id 15.20.6838.005; Wed, 20 Sep 2023 17:28:56 +0000 From: Long Li To: Wei Hu , "dev@dpdk.org" CC: "stable@dpdk.org" , Ferruh Yigit , Luca Boccassi , Kevin Traynor Subject: RE: [PATCH 1/1] net/mana: add 32 bit short doorbell Thread-Topic: [PATCH 1/1] net/mana: add 32 bit short doorbell Thread-Index: AQHZ4xiOA4amZHCZtkOdzUllHV8Mf7AhDPeQgABqugCAARXUsIAA4DQAgACbgXA= Date: Wed, 20 Sep 2023 17:28:56 +0000 Message-ID: References: <20230909122347.2043969-1-weh@microsoft.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=592ba939-5e1d-43f1-96fe-5f2adeba49dc; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-09-18T19:51:56Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR21MB3263:EE_|MN0PR21MB3462:EE_ x-ms-office365-filtering-correlation-id: 8097384f-906a-4ce1-761c-08dbb9ff1152 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LrGxlM8zj7cLhCtYQZNOyVM33J7USlSwUNeZ1iUKp3AL9SttyqQM64ZKA5z9436PSZ640WJ/BT4v5nvxigk7we+HLDGrTb1bRYu+NEADdC63xYOHE9o+C/tCCTl+tv2BB9YF2y9mpDdB7o1zQE4dyqe+6pKnrmWeR8TEU4r/Fsj0y9a2CqL3SroTSjgOc43zVw9qy1SXPv5hh3xTTtpagpfKZ/hHszMjGQrrV09p3F0a0RI5N3FIVucbrijy1c0XDrRzUj1r1H2wFlWpdAl61aFXL+TB+4S/mG9mKPT0YQBJi0u15k6PB6Y65dOXjR9faE7wVd/IancR73okzCMF/0aWNQiIdAWFBGVvpePgHRV4CGKCGNmC5cwBbjP8CswyKNNU5Dl8UL109zpXGPSPRMgHZVuRXkfhYlZCWV52ntSJYtxBauqks4PhM7jBzZPhXQfCyw3i1E7Mb2VZZf3pKB0PjMBUwK38JdDrSgSPXjdGOJ+lRCLgxprAMU7bxQP3ZvibULZwL1p2Mv/nzP8JLyACw7EQCgQO2IR0yiM6yD8PSl81B4B05T3iFxSfvH8kyas21xcp8BALWppaJCRYhPepk+/gJhRrtKtxovTe+n4xVt+3HWozqXBa2mssbu6AC/BQpwLfdLHKsadCinmdB0zrcSNzSQB+WTNhlxZK6WM= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR21MB3263.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(396003)(366004)(136003)(39860400002)(346002)(186009)(451199024)(1800799009)(478600001)(7696005)(6506007)(71200400001)(9686003)(52536014)(10290500003)(26005)(2906002)(5660300002)(66476007)(66946007)(316002)(64756008)(8990500004)(76116006)(54906003)(66556008)(110136005)(8676002)(66446008)(41300700001)(4326008)(8936002)(86362001)(82960400001)(33656002)(82950400001)(122000001)(55016003)(38070700005)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ub3mIvz+xWcxTWcsKl53ajQ3Q5/lbozcTMszV51Mx2bsFRIWlON2BwQ5eTUf?= =?us-ascii?Q?IUh5QcCbRLpGZKPtOacNIIBBJ4TDTfMDUcpqHr6PVNQEEngMmZq7k/xLKAFp?= =?us-ascii?Q?Ev+1XBXduwzRpDxu+7s80iI50p22mYa8wyoB1bNbPq6gfhonkSXsoFPeo/0N?= =?us-ascii?Q?CkWE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C?= =?us-ascii?Q?Y25tJnBNPo+4CLHWW+dbHASBOcfHa0oxbQOc31u7LsIQLF8XRprBQwwD4H0C?= =?us-ascii?Q?KMav6VD/zFynAHXRtAwM9dYLRfNOObCKdsWvLsZ9CLkEBJe3HdBzaitPfl+t?= =?us-ascii?Q?IVGPgsPYFH31I3vcVrdGhxK5CLad9SFx/Em8DJNVTniQyDn5dq5zV4VaLgh6?= =?us-ascii?Q?4wKFvEKtc8q8qn1ErwW+RhTHZBBPkiZ03xDiQAib4uYAXv75cTRHuTAT0xnV?= =?us-ascii?Q?vuIZ13N740tF6CA61wv14rUZaLqrdU61bG6pANJhKJ2eri0CYMvf58NMIeOQ?= =?us-ascii?Q?QzQzRowIWTkASD/F/lKmx64dubfm9VdjMgWjA/QGMfTXiMn9hd7UaT62TZi9?= =?us-ascii?Q?PSoyIcxzoJX+c6NsSnQ++tBjVkQf46IezKYSF0e8qqk7bRg16zknMP/ZLz0E?= =?us-ascii?Q?F4UJ7VRAxy7t78keMqWm6k+S9en62bJzfE6Fo8EM5SwvRt1+lUxMskx60GL/?= =?us-ascii?Q?WjS1P5mcq/5Hrnw+uU7pAAq5kP1f9e4zK+Al1y5g?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR21MB3263.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8097384f-906a-4ce1-761c-08dbb9ff1152 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2023 17:28:56.0913 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xpOS52mc7lOYEoizXJ1Mz+d4gxxaHeuuSeuY5JThD7jDvt3Y2EUcWuiEIfQBGiCQ+67ry0pfSAVfLwvSqO6Z+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR21MB3462 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > > Subject: RE: [PATCH 1/1] net/mana: add 32 bit short doorbell > > > > > > > +#ifdef RTE_ARCH_32 > > > > > + uint16_t cqe_incr =3D > > > > > +(uint16_t)rxq->gdma_cq.head_incr_to_short_db; > > > > > > > > How do you make sure head_incr_to_short_db doesn't overflow? > > > > > > > > > > I have checked this with hardware team. In my opinion it would be > > > easily overflown. > > > The hw team seems suggesting the hw will take care of this. > > > > > > Thanks, > > > Wei > > > > I'm not sure how HW can take care of this when it overflows. When it > > happens, the HW will miss a doorbell and CQ queue will get full. And > > eventually you'll lose completions for TX/RX. > > > > In mana_alloc_and_post_rx_wqes() and mana_rx_burst(), the code has > > check for RX/TX_WQE_SHORT_DB_THRESHOLD to make sure tail_incr doesn't > > overflow when ringing the doorbell. > > > > In gdma_poll_completion_queue(), you need to have a similar mechanism > > to not overflow tail_incr when ringing the doorbell. > > > I am not sure what can be done here. Applications could run in poll mode = without > need to ring cq doorbell, or it could take very long time before it chang= e the > interrupt state. What we can do when cq->head_incr_to_short_db reaches 0x= ffff > in gdma_poll_completion_queue()? >=20 > If it breaks out the loop and return, the next time it enters it may stil= l at0xffff > because it has not rung doorbell the have it reset yet. >=20 > If just resetting the value to 0 and let it keep going in the loop, it i= s no difference > than casting it to 16 bit unsigned int, which would be done in > mana_arm_cq() if it is eventually called. >=20 > Anyway, ringing cq doorbell has not been tested as the driver doesn't sup= port > interrupts. If 32bit doorbell doesn't support interrupts, you can remove this feature f= rom 32 bits. Long