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 592A0425E2 for ; Mon, 18 Sep 2023 22:01:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D55A402DD; Mon, 18 Sep 2023 22:01:49 +0200 (CEST) Received: from BN3PR00CU001.outbound.protection.outlook.com (mail-eastus2azon11020014.outbound.protection.outlook.com [52.101.56.14]) by mails.dpdk.org (Postfix) with ESMTP id 153604025D; Mon, 18 Sep 2023 22:01:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kNeSz84xbzcwqREEOAA3WLYCGAEDz2nxuoHUwxEb/8qP4GT20Gh2YJnEtloLJ06VIvyPPwdYuL4rx3pKH7k4fF+bNEjydQyDK4/WRscr/jt4cVYkBYHB+20RthDu5UHShS/sTHTRzeWir75T36pAVl9EmVkTwjLMrUiWn17HJ+eD131IK+aB1qXoGnCPIJyX43jmEJSw6P3tbjau1w0QO80XdkdRs+D9796KpZXMHNrbRtV4T2geRrHlQhczWzL7JFAxhW9mLe2gbipbSIf+FTWdNZJsRNToq/fLM8r30Mm0LcIHomYxfJDjywIRQ1id4qHw8PY+qh6C1V3XJjUPdA== 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=sfEWAi5ABzR5fsyju5EXsrX+/ISfQk9V8ci1eaoVENk=; b=cWVZDNuDY6EACEixlimB0IKBS3EeyN8EdxhMwBSign8QrKKaJdOjxcCDkWrxLCsfG0VSuk2whwQqOM3T9N3/HMN35rwPTjshn9PyP1aE+UR3gl85KOcj/ANJJ+GB0Rdcxqwg7woGXjAejUAgOhwBQhDOUzxYvTt4oNl2Z4wyVCeelQKyytpGysLy+Lk24mkPtjgPSxGB1t+B5V9fflACnjxWqQta6kAWl5z+vXXyvd+DRH91SgLWdBcVZQczTTBwDrEc8dQ407Gu9zqTKYqXszfKLYvHvl8TIEWEHE+Px/uefqPaEHTvF/Dah7HLFaJUQUFma7In7ddqZ/jRYQor8A== 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=sfEWAi5ABzR5fsyju5EXsrX+/ISfQk9V8ci1eaoVENk=; b=XC5k+HWX6VDTG+jwGvCJcswECXin3SiMz6DUkogaNWeDzk7GXMUaw/Hszd3bLF6DZByYIwW0zMO4auRHp40kgm1d6lFJZFL9Ky5NgE1CLwQsQPhrLEuCrW57/PZUx1K1p9dKGQUua1r0+gle6eyXTk45WmH49jP1qY05fBHovWc= Received: from PH7PR21MB3263.namprd21.prod.outlook.com (2603:10b6:510:1db::16) by DM4PR21MB3441.namprd21.prod.outlook.com (2603:10b6:8:ac::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.4; Mon, 18 Sep 2023 20:01:42 +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.003; Mon, 18 Sep 2023 20:01:42 +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: AQHZ4xiOA4amZHCZtkOdzUllHV8Mf7AhDPeQ Date: Mon, 18 Sep 2023 20:01:42 +0000 Message-ID: References: <20230909122347.2043969-1-weh@microsoft.com> In-Reply-To: <20230909122347.2043969-1-weh@microsoft.com> 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_|DM4PR21MB3441:EE_ x-ms-office365-filtering-correlation-id: 4a5041ea-0009-4f93-3a5c-08dbb8821404 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vHp/SGv7l39ze8hYmDtSI4kLtsAFISFerUHSaKeOT5eyD5GEeQ6mhKvoW0LzQynhxGaAZTRAoh1WTK/xn2tKpAfzlt5jyvGdc30VEo8RnDsAKRuOrIm9tdy4+FuMvdNonljZ3K+/ydrbRZFYpMTPHlR4t/Lw2Jhk11nksfjElZcBZTgmmsBnv1BeL6ciPw7Az55DoiO7XY4XuFytwF8JSyX7dOGD0Esxaddnbmk7oMF8L0q5TMJR7yLETGZvy51AybGapu8gSTb143Vk6edQIT7RwX+blNeammRdPpKcQ8soGKeRpI6vY4i6aBvAoLI0d8cFW7kTfY5sbGchcUPSPESSf6LnEJoFZBW1vu7l5PsXwQJq9Eun9nwTVLbSrnvjgvioLKlKndbxICKhjvpD/2WxnPpdrriAF0bfX8G/pJbVpTxuzpnDkhH5RyiQbLd7JxH8gPvpAFYFCjpk90VpC1sQ138qc93ZGb7Zs7a2MfB61NYRsLERvRjQFfcFvOL1E7OxRrLk9G3pikICCzosYz8VhjB5qT6A7uFeMUo6f4q9rgD3e9kgijwph7Zmi4IWmQy156s77PNUFHzXflzjEG1nlvqHJnnPpm/hX7QOt0F0hg5Qh8c+cRFuPAluQmJdjIsCQQynq4r/apxdnqmmPcRIiI13ruHG6VwG7BwTYF8= 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)(39860400002)(136003)(366004)(346002)(451199024)(186009)(1800799009)(55016003)(2906002)(83380400001)(38100700002)(38070700005)(9686003)(10290500003)(7696005)(6506007)(71200400001)(86362001)(8990500004)(33656002)(478600001)(26005)(8676002)(8936002)(4326008)(41300700001)(5660300002)(52536014)(316002)(122000001)(82950400001)(82960400001)(54906003)(64756008)(66946007)(66556008)(110136005)(66476007)(66446008)(76116006); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OGu4dQfcYs9dG/fF7o9WKN8ksZS9jT2JIAQdSQEz2kK3TvqyzJXk8zVVYSWT?= =?us-ascii?Q?YJJ3iqcNIaSXmrS4JthueoUIi4Bij/WC2fMQC6a8EbwskyGZ3opfxwjYYQa5?= =?us-ascii?Q?DJGQXb3c6iiSWi91Wg5lSDAI+IB2tBFzX2nHegSRKaOLsIzILj528c7OtBwN?= =?us-ascii?Q?2Om0w2Rr3KyYxViyouaY29xKDTPcyRRai5zPqQquMyPIJoIKIxReF8+8OkMp?= =?us-ascii?Q?PzxSmB1ymzJU03LlV6/6WOo2osv78gTE2I5uH0T/xXOXqA6K8KjM1NT9EJvI?= =?us-ascii?Q?3QQR7pH+LaxgW+4Kc0WmWw/vz3lrU7+JNg2guKEH0TwHsfGroeC6bTMm9sUY?= =?us-ascii?Q?R+YfqwN1t49cA+RYEOCe/JySf3wqWXxiCISMa7gY+S3nkymYP46xcI6Zuv65?= =?us-ascii?Q?sAHM28X9LuxYwxePHnQJAZy/06c85wNjq/iO2rMrB4jfhkGsK/RpG7pCvTkc?= =?us-ascii?Q?oL3W62Ua1ZXhCGASA4c/3OBqeciEecYmX5vaXrGLCz1Xx5hYbDIVyYdamRBh?= =?us-ascii?Q?hu+m1LYF2uwCZmtrLtjmsu588gKC1OaIT1hHqfXOTSTynlG3p0TImoPI/wGe?= =?us-ascii?Q?M1Tbm88WcQkajNCMTiioC5Wqn3VDFOpMRjGTEttItWDj/P/h0t5RuuLtS1MO?= =?us-ascii?Q?XTKnrcs9+vJjtPCxaYADoeCNZQklO1/DcC9p2hH+njX8Om0Q2fpGnvRfCO2R?= =?us-ascii?Q?ddXPO4+ZhKNvKY1WKFcPxJfjUVZTHo1PQpoU5QOqqYCzirVSjdGER1GIgdYe?= =?us-ascii?Q?/oliMIKn53uxKKRSNeKzN+tNOo4zapdIDSAWrICFfajY/JN9P0IbOglauPpX?= =?us-ascii?Q?Kc7bpW4m5T8FH6wl9IuW/e+A6WARoSPI7nig8SXPM/3xx0JjW8asRN+ZUg1i?= =?us-ascii?Q?QoWpRtcDYnHanUPcGvF0dz4u250gwG394lfMeeZK1LHjFj6Z1r+TTtpqTIt9?= =?us-ascii?Q?GhD7RrHaCiJkItT6MFxdDuzLFNf3ScTTYu9ab3VguUtyNNQ+LatHp+r+akOi?= =?us-ascii?Q?PsSpTGfUvMvTNpLB0twJwJyJs1PB/rAeJm3TVeATUOHGCifdmFG6TvND9n/x?= =?us-ascii?Q?ruwbIg8BUW9sPbzwXqym76X2oRTlrfpFGISeRBbiwuTVuYsoJU0c3fNZiAwV?= =?us-ascii?Q?FtntNpVKlHnPMhUQR6JgvnUegOQgQNw2Z/WzcVesEQZbQSV4XKwsff9h2u3C?= =?us-ascii?Q?UPAC16dZcy15CbSVFuqFasCVJqwENgWTwcesFeTX3ZAACdFkiE8guqt+wwl2?= =?us-ascii?Q?V0qCOD5fFL07dufHStbJ+bBuC9kd++USeZM+RYsdo1K05SCE8ZUYn1a3gG9w?= =?us-ascii?Q?jD4P6iov4TjqqcGFPXNACF/YDUrqPZI7pwF1UGtTYXdueVR8PjANGjBYf9aa?= =?us-ascii?Q?bfEigvTuzqHLqelCJ8eF6jSLOzGL29dgUgCb6xVFDH+FxlqVNR3pZqtpXh+W?= =?us-ascii?Q?3adbukAFVaPcu0bFKsSuUfCyTl1s8ZelG7MaRESZcWMeCuah2CgKgng86RmU?= =?us-ascii?Q?xxKcThQyAp7/+uFcy8wVkjYkMshWbttnwbSmEZmUpJ8gogg6N4b8VIpwPdML?= =?us-ascii?Q?z6UAzc0ls/bP6Sz4OvZevpF2RPskfGYqjHNZj55G?= 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: 4a5041ea-0009-4f93-3a5c-08dbb8821404 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2023 20:01:42.3802 (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: vh2XI1Xg7GRjsbNBOk/w6RbxyvfZsrd7wofxpPxguyhWCMflfFKnzCVxxg6RhSLfm9ZKcvwac/p+vwJhbjT6rQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR21MB3441 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: [PATCH 1/1] net/mana: add 32 bit short doorbell >=20 > Add 32 bit short doorbell support. Ring short doorbell when running in 32= bit > applicactions. >=20 > Cc: stable@dpdk.org >=20 > 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(+) >=20 > 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; > } >=20 > +#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; >=20 > @@ -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 >=20 > /* > * Poll completion queue for completions. > @@ -287,6 +379,9 @@ gdma_poll_completion_queue(struct > mana_gdma_queue *cq, > num_comp++; >=20 > cq->head++; > +#ifdef RTE_ARCH_32 > + cq->head_incr_to_short_db++; > +#endif >=20 > 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 >=20 > +/* 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 \ GDMA_SHORT_DB_MAX_WQE is in BU, MAX_TX_WQE_SIZE is in bytes. Doing math on two different units... And why using "2*", using "1*" is good enough? > + (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 > }; >=20 > #define MANA_MR_BTREE_PER_QUEUE_N 64 > @@ -425,6 +441,9 @@ struct mana_rxq { > */ > uint32_t desc_ring_head, desc_ring_tail; >=20 > + /* 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; >=20 > #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") >=20 > +#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); >=20 > 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 { Is it possible that rxq->wqe_cnt_to_short_db might be 0 from the caller? Th= e caller shouldn't ring the doorbell if there is nothing to ring. > + /* 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 >=20 > 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; >=20 > +#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 > } >=20 > mana_rq_ring_doorbell(rxq); > @@ -349,6 +373,9 @@ mana_start_rx_queues(struct rte_eth_dev *dev) >=20 > /* 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 >=20 > 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; >=20 > +#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 > } >=20 > 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; How do you make sure head_incr_to_short_db doesn't overflow? Thanks, Long