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 B8186425F1 for ; Tue, 19 Sep 2023 04:14:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA2C0402C9; Tue, 19 Sep 2023 04:14:07 +0200 (CEST) Received: from HK2P15301CU002.outbound.protection.outlook.com (mail-eastasiaazon11020020.outbound.protection.outlook.com [52.101.128.20]) by mails.dpdk.org (Postfix) with ESMTP id 635D74003C; Tue, 19 Sep 2023 04:14:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FgJDEm52sGI6jDB9Q4MJVGkOJzTsSPLVdQPTktb39YmfEZtyPJ56diy6MhadN4D4LBciC8uHb2a6LgBkGVOVygmEKxHSELdC1Aj0mCb/1i4x1V6Sma6fnPY3cW8onqVav3glGgYM6WAB8+UvSSXlKV7F3WgHpuoFJyr6P5kD7AZ7JkSHDqps5NInPZQfJc9MsTmMn1qsgIRX0TK6QqjoDuxKS4+Ut1K63lXIXM4yc6MgMUelHdb2crsFK4tfihFVIQDll1BQvlFLvKYOChd7Ldacjk71SMpBXHqRie7J1DJ84b95G5u4ENs3o4UpkpefaJrZHwXOonJXyFYGhU38/w== 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=TbyH8vqT3GCPFmZ2takT/Y1VPxltYfQDYsQtYI/c8Gw=; b=AVskDa2R/QPBRiN0ssyLSVpl076hJQa3sTT1fK9QzhOAvzwDaWAV+Ks61hoTNGeJ+4unf1/rG7isP6MrSdI1nmP0vsa5iTDN5cR4NqtUvuP6UiyCmFu5GYJ5ZC+VCrghN3zLPlgUx/47spe778Z4B3ZE58IDCbERTFbocDUkE+g01BUD1FA1fCuxlVi0gmKTShDpPBCnHElfKNi0M/DAR5PpEEQ/roewLcEwfZhPlYT0v5iUYhe9ane64AuVY4yg8BAEhVMkb4FEuS5jenu/5fjFC9kpzM6U9wddmdTa86Gs7quyFhHS03QRoz4jyxvN6LrXGDNqzretrtuzjoyzuw== 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=TbyH8vqT3GCPFmZ2takT/Y1VPxltYfQDYsQtYI/c8Gw=; b=DdvIJ8ZEEKeu/rrGKYGycOCR7sL9ycw42VE0xdHpNTbbJ7P1r6DewBSRKkIMQJfedztrRtb2o5GfpQM8egzgS2hJnw6oOPwT11+7LRKPc19fRJ/TCZzKOCsyqLCVI7ammVyCAaPxO32wdN0i2IRFOr1Jqh2o07z2d2dyv/PhosY= Received: from SI2P153MB0441.APCP153.PROD.OUTLOOK.COM (2603:1096:4:fc::7) by PUZP153MB0665.APCP153.PROD.OUTLOOK.COM (2603:1096:301:e6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.4; Tue, 19 Sep 2023 02:13:57 +0000 Received: from SI2P153MB0441.APCP153.PROD.OUTLOOK.COM ([fe80::3daf:70ad:afb:a26c]) by SI2P153MB0441.APCP153.PROD.OUTLOOK.COM ([fe80::3daf:70ad:afb:a26c%3]) with mapi id 15.20.6838.003; Tue, 19 Sep 2023 02:13:57 +0000 From: Wei Hu To: Long Li , "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: AQHZ4xiQ9bKvJDFRDkup2UAbNtMUZbAhD7EAgABmi0A= Date: Tue, 19 Sep 2023 02:13: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: SI2P153MB0441:EE_|PUZP153MB0665:EE_ x-ms-office365-filtering-correlation-id: bd8ed263-9561-4bd2-1dab-08dbb8b6147e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w9lXon/y5SrKMl6G1/ZW+tFLBzzyF2uo8xnL+Tt9TRm1JwPKZBsPCj5Uqwiq3smSaSATndSGHYYRJhFoXHDrgUypdBUrwGk3jYX3MwGEh7cEXvlGbkOXqbWYxwcp4CCtcBaaMOvy3z+V5cwGDu88tBCUvR65sKILrE3vvZt/hz3mur4YVkwN5NnJBT3JHCDYEkyBTBMQMS8iC8rHCBKz/SJOEE9waz7thPZ09Mkx67eQOCRZwlmqmAoG0xA70Di2ufTiXw2BJJYznASrFxdPcuLFFVvIH/NPcT4xZm9HqBiizoBN7Tk2wkPRzfTEoPwm5s26BOQPr4/KZ2gcIwA3C2wgM8MVpfeqVorjA+f0EOkXgi/vQRalbS7Enp66/Cl6KacmHMGAsfksxxUBKSV5v1DOKQSovzcPft4KYxiXYZ2rmyEtRtZ9TAMbJNCe14WO/XVRKXwxH6kl/PXM2ZPjwERn84T+sJwFhpBJa0hWrmcjYk2V4j9vgWxm2OMX9rMqBRZG7/XfqoQKE8jaaUQLMcxIaGTwrdmyral7zoL3jMSFlSK7pdAGVaXzVEIZDWKiYOhJ3WCxG4vTY3kVmJSUg53O8DLkpI9G0b6ESwd/h3LgWUVPi7GyE8K5nRrHzGNalBkXTbrnKDzfIa8APqWex72c/xFJ3MaNFXXg9Vja4AY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SI2P153MB0441.APCP153.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(396003)(346002)(376002)(366004)(136003)(186009)(1800799009)(451199024)(6506007)(8990500004)(7696005)(53546011)(478600001)(71200400001)(82960400001)(82950400001)(38070700005)(86362001)(33656002)(122000001)(38100700002)(9686003)(83380400001)(55016003)(64756008)(66446008)(54906003)(76116006)(2906002)(66476007)(66556008)(110136005)(41300700001)(66946007)(8936002)(30864003)(8676002)(316002)(52536014)(5660300002)(4326008)(10290500003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?y42DqyQF7qM9oR0xgxnRiX7t5TkLXuts/Lq587xTkCaUXFb5gLJ0rdKYI1zg?= =?us-ascii?Q?LWeJ2EJHxPXFlHVmfF8TYX7K/5EGa2ZTZ1LbfMwpEDBgziq3EQj5dpi0u/Zz?= =?us-ascii?Q?e3IJcYaPxrM09sQE3zZx5vE16piXM+MfHtIGfUSZ+buKh+kQ5AuYvN0h+ETW?= =?us-ascii?Q?GKJUpS+tAmyODybSripXK3AGZQk++qrKXlb+KOOWdeHOhjKexehnxFH8civE?= =?us-ascii?Q?Ec8mvytHrBl2U4R3CMAGzaiAnLTbShMyQjF7of3ceyNPN39y552FSWTTx2Jz?= =?us-ascii?Q?iVbK/hlku8YhqQ6BbFbWuQbYpmQLmd9NuO9VGpEzmdZq7Di1PEOFpVNWqwh1?= =?us-ascii?Q?rq+b+wyaJM+4CXrEg767aF69XHJLfklWGcC2rn1NqjgNXmaozRXwmPz3slIX?= =?us-ascii?Q?9NLjP4lE3P17ZsAMA5kxF1yLh+8qPX3qWq6zsvr0yyJyRw/IX5HzNyw2SPqu?= =?us-ascii?Q?L/crxhHrQV9dmdkqe4P56m3oKvfc8Nxp7yKLAIiGI8/mB800TnYTj51l+9ru?= =?us-ascii?Q?ISJ0tKBtJ0oUyVJuBCFBlQzTZ+VWAm3nU87ilgCehPgeD2mR1xIXoM5lzfte?= =?us-ascii?Q?9adRvRJNfmShcwD7/Nl8tLtzqQWDdXrZOUBlIG63NvLyaNYWpisUPoKTGp3w?= =?us-ascii?Q?/MT4r9Bn6e0a1B5x4jprN82Q80AOxZXT80T7vdlhLEKHRSviZyq9vOxGnfFk?= =?us-ascii?Q?CsOuYOkuUUIjRWm2BV583Jo1vZ8+0UeLRrZK9YpfJAdLis1hY/0ar8AAUZsa?= =?us-ascii?Q?+BhKQhDf5zcieB4N92fiDwoFXHBFLex0rxlw+LyY6jPR/s/1Mp0qfMwhIflw?= =?us-ascii?Q?EXDFOpnN23ZysOe5avksy+nGjKfo8RXST09Wjpg9UAIszcMgRVybLILlJpb2?= =?us-ascii?Q?3Y7+QSthixZd4MWTbDOMAeJCoeVX2QbyXK2tSolzEJ6WaRqRBFx2qC/Yl0VE?= =?us-ascii?Q?oZu0FiesW7oc1F9u3J6Rb65NA6pgoqdoeygMIMtEwHBk14bvG2fQXYh2aBUk?= =?us-ascii?Q?JkCgfK0S4PKmh/4+BeAh5b6eWt3LTpFlHi3MIFUooivnfBGB9j35/W9375ym?= =?us-ascii?Q?WlKpuBF8S+1KZe3nagnleGHKTi8cF4gpkJGDbwLcUN6wcSMpqkxkW8phRHU4?= =?us-ascii?Q?XplLeCx36zMGhUxrIWylLWEyStDqcQw9lIC1L2hG4H0Pc/HubwybqUJiafDo?= =?us-ascii?Q?CQAQ2IS6DVn7l0dh4LsH7oY+eOEZmQvvLMUyJ/1mATh9TGFIK8nBmcS2hY+F?= =?us-ascii?Q?1isBj8F6Cxf9YHf9bDTKX0z7oaWjkY0lUAohg4wq3Q7Lc0AdcTw76CAHVAKY?= =?us-ascii?Q?kZHLUsbOFpspUzAmCWabTRzyvTErX89NK/nixKJQwoxwVS5qhL1jSQc0QXtv?= =?us-ascii?Q?bOjZ9Lq14sO8mEdqC6yOeDjLNpJ5rtoH1cvNd1prvV6LmSRP36iWX30xkUVK?= =?us-ascii?Q?8wOCxIDKz7AT8pgnqy3NDlkay499f/r9M8GmSccDf0Fb5WkBG/X0CIvnzYlR?= =?us-ascii?Q?H4hwFwRt0Ux8Z7mGBM7n4/iucoLEjmNOxCfg4B8TIpetTfapF9zRsfhLcpkU?= =?us-ascii?Q?kchB+5objzCy9VyDPVwG3OQRosBEAxy8LTUCDIvIF+Zc7QPwAx2ykZvynfp+?= =?us-ascii?Q?MQ=3D=3D?= 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: SI2P153MB0441.APCP153.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: bd8ed263-9561-4bd2-1dab-08dbb8b6147e X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2023 02:13:56.9845 (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: WbVRA03KDrF1bL6lk+A7+hqzVc4jSpYUQe3O+qD5LpQNG4E4IRum5rH9AP/z56Q6dBcNaBbXwAA9l9WqrcAT5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZP153MB0665 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 > -----Original Message----- > From: Long Li > Sent: Tuesday, September 19, 2023 4:02 AM > 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 >=20 > > Subject: [PATCH 1/1] net/mana: add 32 bit short doorbell > > > > Add 32 bit short doorbell support. Ring short doorbell when running in > > 32 bit applicactions. > > > > Cc: stable@dpdk.org > > > > Signed-off-by: Wei Hu > > --- > > drivers/net/mana/gdma.c | 95 > > +++++++++++++++++++++++++++++++++++++++++ > > drivers/net/mana/mana.h | 25 +++++++++++ > > drivers/net/mana/rx.c | 52 ++++++++++++++++++++++ > > drivers/net/mana/tx.c | 28 ++++++++++++ > > 4 files changed, 200 insertions(+) > > > > diff --git a/drivers/net/mana/gdma.c b/drivers/net/mana/gdma.c index > > 65685fe236..d1da025d1b 100644 > > --- a/drivers/net/mana/gdma.c > > +++ b/drivers/net/mana/gdma.c > > @@ -166,6 +166,97 @@ gdma_post_work_request(struct > mana_gdma_queue > > *queue, > > return 0; > > } > > > > +#ifdef RTE_ARCH_32 > > +union gdma_short_doorbell_entry { > > + uint32_t as_uint32; > > + > > + struct { > > + uint32_t tail_ptr_incr : 16; /* Number of CQEs */ > > + uint32_t id : 12; > > + uint32_t reserved : 3; > > + uint32_t arm : 1; > > + } cq; > > + > > + struct { > > + uint32_t tail_ptr_incr : 16; /* In number of bytes */ > > + uint32_t id : 12; > > + uint32_t reserved : 4; > > + } rq; > > + > > + struct { > > + uint32_t tail_ptr_incr : 16; /* In number of bytes */ > > + uint32_t id : 12; > > + uint32_t reserved : 4; > > + } sq; > > + > > + struct { > > + uint32_t tail_ptr_incr : 16; /* Number of EQEs */ > > + uint32_t id : 12; > > + uint32_t reserved : 3; > > + uint32_t arm : 1; > > + } eq; > > +}; /* HW DATA */ > > + > > +enum { > > + DOORBELL_SHORT_OFFSET_SQ =3D 0x10, > > + DOORBELL_SHORT_OFFSET_RQ =3D 0x410, > > + DOORBELL_SHORT_OFFSET_CQ =3D 0x810, > > + DOORBELL_SHORT_OFFSET_EQ =3D 0xFF0, > > +}; > > + > > +/* > > + * Write to hardware doorbell to notify new activity. > > + */ > > +int > > +mana_ring_short_doorbell(void *db_page, enum gdma_queue_types > > queue_type, > > + uint32_t queue_id, uint32_t tail_incr, uint8_t arm) { > > + uint8_t *addr =3D db_page; > > + union gdma_short_doorbell_entry e =3D {}; > > + > > + if ((queue_id & ~GDMA_SHORT_DB_QID_MASK) || > > + (tail_incr & ~GDMA_SHORT_DB_INC_MASK)) { > > + DP_LOG(ERR, "%s: queue_id %u or " > > + "tail_incr %u overflowed, queue type %d", > > + __func__, queue_id, tail_incr, queue_type); > > + return -EINVAL; > > + } > > + > > + switch (queue_type) { > > + case GDMA_QUEUE_SEND: > > + e.sq.id =3D queue_id; > > + e.sq.tail_ptr_incr =3D tail_incr; > > + addr +=3D DOORBELL_SHORT_OFFSET_SQ; > > + break; > > + > > + case GDMA_QUEUE_RECEIVE: > > + e.rq.id =3D queue_id; > > + e.rq.tail_ptr_incr =3D tail_incr; > > + addr +=3D DOORBELL_SHORT_OFFSET_RQ; > > + break; > > + > > + case GDMA_QUEUE_COMPLETION: > > + e.cq.id =3D queue_id; > > + e.cq.tail_ptr_incr =3D tail_incr; > > + e.cq.arm =3D arm; > > + addr +=3D DOORBELL_SHORT_OFFSET_CQ; > > + break; > > + > > + default: > > + DP_LOG(ERR, "Unsupported queue type %d", queue_type); > > + return -1; > > + } > > + > > + /* Ensure all writes are done before ringing doorbell */ > > + rte_wmb(); > > + > > + DP_LOG(DEBUG, "db_page %p addr %p queue_id %u type %u tail %u > > arm %u", > > + db_page, addr, queue_id, queue_type, tail_incr, arm); > > + > > + rte_write32(e.as_uint32, addr); > > + return 0; > > +} > > +#else > > union gdma_doorbell_entry { > > uint64_t as_uint64; > > > > @@ -248,6 +339,7 @@ mana_ring_doorbell(void *db_page, enum > > gdma_queue_types queue_type, > > rte_write64(e.as_uint64, addr); > > return 0; > > } > > +#endif > > > > /* > > * Poll completion queue for completions. > > @@ -287,6 +379,9 @@ gdma_poll_completion_queue(struct > mana_gdma_queue > > *cq, > > num_comp++; > > > > cq->head++; > > +#ifdef RTE_ARCH_32 > > + cq->head_incr_to_short_db++; > > +#endif > > > > DP_LOG(DEBUG, "comp new 0x%x old 0x%x cqe 0x%x wq %u > sq %u head > > %u", > > new_owner_bits, old_owner_bits, cqe_owner_bits, diff -- > git > > a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h index > > 5801491d75..848d87c096 100644 > > --- a/drivers/net/mana/mana.h > > +++ b/drivers/net/mana/mana.h > > @@ -50,6 +50,19 @@ struct mana_shared_data { #define > MAX_TX_WQE_SIZE > > 512 #define MAX_RX_WQE_SIZE 256 > > > > +/* For 32 bit only */ > > +#ifdef RTE_ARCH_32 > > +#define GDMA_SHORT_DB_INC_MASK 0xffff > > +#define GDMA_SHORT_DB_QID_MASK 0xfff > > + > > +#define GDMA_SHORT_DB_MAX_WQE (0x10000 / > > GDMA_WQE_ALIGNMENT_UNIT_SIZE) > > + > > +#define TX_WQE_SHORT_DB_THRESHOLD \ > > + (GDMA_SHORT_DB_MAX_WQE - (2 * MAX_TX_WQE_SIZE)) #define > > +RX_WQE_SHORT_DB_THRESHOLD \ >=20 > GDMA_SHORT_DB_MAX_WQE is in BU, MAX_TX_WQE_SIZE is in bytes. >=20 > Doing math on two different units... >=20 That is good point. I will correct this. > And why using "2*", using "1*" is good enough? >=20 >=20 Sure. I will use 1 in next revision. >=20 >=20 > > + (GDMA_SHORT_DB_MAX_WQE - (2 * MAX_RX_WQE_SIZE)) #endif > > + > > /* Values from the GDMA specification document, WQE format > > description */ #define INLINE_OOB_SMALL_SIZE_IN_BYTES 8 #define > > INLINE_OOB_LARGE_SIZE_IN_BYTES 24 @@ -375,6 +388,9 @@ struct > > mana_gdma_queue { > > uint32_t id; > > uint32_t head; > > uint32_t tail; > > +#ifdef RTE_ARCH_32 > > + uint32_t head_incr_to_short_db; > > +#endif > > }; > > > > #define MANA_MR_BTREE_PER_QUEUE_N 64 > > @@ -425,6 +441,9 @@ struct mana_rxq { > > */ > > uint32_t desc_ring_head, desc_ring_tail; > > > > + /* For storing wqe increment count btw each short doorbell ring */ > > + uint32_t wqe_cnt_to_short_db; > > + > > struct mana_gdma_queue gdma_rq; > > struct mana_gdma_queue gdma_cq; > > struct gdma_comp *gdma_comp_buf; > > @@ -455,8 +474,14 @@ extern int mana_logtype_init; > > > > #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") > > > > +#ifdef RTE_ARCH_32 > > +int mana_ring_short_doorbell(void *db_page, enum gdma_queue_types > > queue_type, > > + uint32_t queue_id, uint32_t tail_incr, > > + uint8_t arm); > > +#else > > int mana_ring_doorbell(void *db_page, enum gdma_queue_types > > queue_type, > > uint32_t queue_id, uint32_t tail, uint8_t arm); > > +#endif > > int mana_rq_ring_doorbell(struct mana_rxq *rxq); > > > > int gdma_post_work_request(struct mana_gdma_queue *queue, diff --git > > a/drivers/net/mana/rx.c b/drivers/net/mana/rx.c index > > 14d9085801..303d129e5b 100644 > > --- a/drivers/net/mana/rx.c > > +++ b/drivers/net/mana/rx.c > > @@ -39,10 +39,23 @@ mana_rq_ring_doorbell(struct mana_rxq *rxq) > > /* Hardware Spec specifies that software client should set 0 for > > * wqe_cnt for Receive Queues. > > */ > > +#ifdef RTE_ARCH_32 > > + if (rxq->wqe_cnt_to_short_db) { > > + ret =3D mana_ring_short_doorbell(db_page, > > GDMA_QUEUE_RECEIVE, > > + rxq->gdma_rq.id, > > + rxq->wqe_cnt_to_short_db * > > + > > GDMA_WQE_ALIGNMENT_UNIT_SIZE, > > + 0); > > + } else { >=20 > Is it possible that rxq->wqe_cnt_to_short_db might be 0 from the caller? = The > caller shouldn't ring the doorbell if there is nothing to ring. >=20 This is just a safeguard. I can remove the check. >=20 >=20 >=20 >=20 > > + /* No need to ring, just return */ > > + ret =3D 0; > > + } > > +#else > > ret =3D mana_ring_doorbell(db_page, GDMA_QUEUE_RECEIVE, > > rxq->gdma_rq.id, > > rxq->gdma_rq.head * > > GDMA_WQE_ALIGNMENT_UNIT_SIZE, > > 0); > > +#endif > > > > if (ret) > > DP_LOG(ERR, "failed to ring RX doorbell ret %d", ret); @@ - > > 97,6 +110,7 @@ mana_alloc_and_post_rx_wqe(struct mana_rxq *rxq) > > /* update queue for tracking pending packets */ > > desc->pkt =3D mbuf; > > desc->wqe_size_in_bu =3D wqe_size_in_bu; > > + rxq->wqe_cnt_to_short_db +=3D wqe_size_in_bu; > > rxq->desc_ring_head =3D (rxq->desc_ring_head + 1) % rxq- > > >num_desc; > > } else { > > DP_LOG(DEBUG, "failed to post recv ret %d", ret); @@ - > > 115,12 +129,22 @@ mana_alloc_and_post_rx_wqes(struct mana_rxq *rxq) > > int ret; > > uint32_t i; > > > > +#ifdef RTE_ARCH_32 > > + rxq->wqe_cnt_to_short_db =3D 0; > > +#endif > > for (i =3D 0; i < rxq->num_desc; i++) { > > ret =3D mana_alloc_and_post_rx_wqe(rxq); > > if (ret) { > > DP_LOG(ERR, "failed to post RX ret =3D %d", ret); > > return ret; > > } > > + > > +#ifdef RTE_ARCH_32 > > + if (rxq->wqe_cnt_to_short_db > > > RX_WQE_SHORT_DB_THRESHOLD) { > > + mana_rq_ring_doorbell(rxq); > > + rxq->wqe_cnt_to_short_db =3D 0; > > + } > > +#endif > > } > > > > mana_rq_ring_doorbell(rxq); > > @@ -349,6 +373,9 @@ mana_start_rx_queues(struct rte_eth_dev *dev) > > > > /* CQ head starts with count */ > > rxq->gdma_cq.head =3D rxq->gdma_cq.count; > > +#ifdef RTE_ARCH_32 > > + rxq->gdma_cq.head_incr_to_short_db =3D 0; #endif > > > > DRV_LOG(INFO, "rxq cq id %u buf %p count %u size %u", > > rxq->gdma_cq.id, rxq->gdma_cq.buffer, @@ -397,6 > > +424,10 @@ mana_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, > > uint16_t pkts_n) > > uint32_t i; > > int polled =3D 0; > > > > +#ifdef RTE_ARCH_32 > > + rxq->wqe_cnt_to_short_db =3D 0; > > +#endif > > + > > repoll: > > /* Polling on new completions if we have no backlog */ > > if (rxq->comp_buf_idx =3D=3D rxq->comp_buf_len) { @@ -505,6 +536,16 > @@ > > mana_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t > > pkts_n) > > wqe_posted++; > > if (pkt_received =3D=3D pkts_n) > > break; > > + > > +#ifdef RTE_ARCH_32 > > + /* Ring short doorbell if approaching the wqe increment > > + * limit. > > + */ > > + if (rxq->wqe_cnt_to_short_db > > > RX_WQE_SHORT_DB_THRESHOLD) { > > + mana_rq_ring_doorbell(rxq); > > + rxq->wqe_cnt_to_short_db =3D 0; > > + } > > +#endif > > } > > > > rxq->backlog_idx =3D pkt_idx; > > @@ -529,6 +570,16 @@ static int > > mana_arm_cq(struct mana_rxq *rxq, uint8_t arm) { > > struct mana_priv *priv =3D rxq->priv; > > +#ifdef RTE_ARCH_32 > > + uint16_t cqe_incr =3D (uint16_t)rxq->gdma_cq.head_incr_to_short_db; >=20 > How do you make sure head_incr_to_short_db doesn't overflow? >=20 I have checked this with hardware team. In my opinion it would be easily ov= erflown.=20 The hw team seems suggesting the hw will take care of this. Thanks, Wei >=20 > Thanks, >=20 > Long