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 DFDAC4258E for ; Wed, 13 Sep 2023 23:11:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D69E7402E2; Wed, 13 Sep 2023 23:11:12 +0200 (CEST) Received: from DM6FTOPR00CU001.outbound.protection.outlook.com (mail-centralusazon11020016.outbound.protection.outlook.com [52.101.61.16]) by mails.dpdk.org (Postfix) with ESMTP id 36543402AE; Wed, 13 Sep 2023 23:11:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bgLTAbg+JYGs6oGBOgNN4cVYaTtj2lRtz6AvQDxgwemeeQYgSmSkVfQ5uXskqLA1BmPVkz3KTCiLaSl25FIbbJwfvL6Iji4d0EH+18JQi0RAG8UnalStwGzzp0JFR2w4GwLjiHbOx2GRgn4x2pfbArLo3wq7scOZsvnFMd8lL/3x62vHbpGDMJgrSX7VWa5AVRs4XTTHQBEoCsPHO0OVbVSQT4w0+xQuW+Wm01Mq47u2G7/ss0o8ZK77Bk321ZYdl0TqF50bVKSajW0XqI+LBfomRkqNxmci+qlxNEtK0Rlr8dDZG0Kbg/fHcl17JRNuU1UiD1wxQ/1YlPfMKc+VfA== 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=yKpG00n8FlxMPhi4Ps8eG5alwIWGVKBs4c/hWJJAx/E=; b=B49sno0PPhP/euL+8+yd+jXue2AN/cad7MVG7M9nw54crgity2EpkRwBZs2YSgZvgnhahXYtrLH2fYETJyH+gnc0CSsPvTDZD9/hdD2L5EOqDlZqgnDDbiObpEzlawPrjP/RRvO5L/vdWx+m74JKgZ+mWdJ6yYwYmHZtUOUDf8vHUTuqfrANDHYKYpXV1j0NR3UmP7iooOlCV+Ufu9We77qHqUVWTHAT4onuhzQoBURoz4zBP3hT1Vi5vyb+z5UHm906jaDgT6jc8qQs6zPfnXUPPviQym4ReNJv/m4oEJS0RRmEn3Cl/hG4cE9WetLfvbRbLaGNoL488QouDauR5w== 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=yKpG00n8FlxMPhi4Ps8eG5alwIWGVKBs4c/hWJJAx/E=; b=fBYZeg+RgWCfnF2z8WvAekqbXSuE9NKoHbr3Oh0ZukzDRE9aOVaUzUmPVmU06hzlSTOpG+VMamc5eaqBK87uxqAMsmqyX+ODmCIcVrAroPBCKlk7MunpdeY0zuVjrmBYyUTMPER+DRXqYESrX4vwqK7gbjYT6t9LwEQkHiI83PE= Received: from PH7PR21MB3263.namprd21.prod.outlook.com (2603:10b6:510:1db::16) by PH8PR21MB3854.namprd21.prod.outlook.com (2603:10b6:510:25f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.7; Wed, 13 Sep 2023 21:11:07 +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.6813.006; Wed, 13 Sep 2023 21:11:07 +0000 From: Long Li To: Wei Hu , "dev@dpdk.org" , Ferruh Yigit , Andrew Rybchenko CC: "stable@dpdk.org" 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: AQHZ4xiOA4amZHCZtkOdzUllHV8Mf7AZQhew Date: Wed, 13 Sep 2023 21:11:07 +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=bec1f215-7edf-49c3-93c3-470f9993eedc; 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-13T20:52:00Z; 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_|PH8PR21MB3854:EE_ x-ms-office365-filtering-correlation-id: 199a1e05-41b2-4b02-9e18-08dbb49df29c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JdcE9FTkam9w/FGJN5Z6Qsg1KQa+hqcwAU17ywufjotS7sMSnjPN5KJ+teHWUP1lMoGZ6uvRkKzcKNheSwwbdDgGTVbwwZie4RNlpC4NfgsfoO+Oo9qLwdoYs87945orV057KQCF42Mn4j5BiJopVip3Az/GYZksEJP0GGMJffQsx2ZKLGc0ji0RdHHB7g2JMEaZflmjb1fjnoUkx1m2edXc3+Zv6d05S7cL4nZn9yeS9Wa6jCTvgB3pZNfPwm0TekfgJOUyKcD4CtiTMQkEQ3wfgkPoQtuHPs8BADi/WmiLoOCZHXo9I9/TYs9ExlEHlwgHstQ/YrTS46XAyzjIE0iv//CdteePWygyrAyjOsOElGulHEkoOB1Y26JnAcItfhaXsQEVB2vwb2vqlBL7LiUsoRa4tOArfrUSC6UwtEPupdIaKJPgHeyKg6zwrsqv58WORU9lTC50ey02qqKgWSGc7sZoIiNC80zQJQnFY6BSglU/o7ETsPGwDrIxSjExcz7qObxqLDUU0QYnN4k5sdR0fKSptUhiNOCiWF2D1TyUjShW49T0O8dKDpNX+ePcSDdo6Ilov3AIhMilqs+n7OMbU68lfVToPFeUHlbtKGg6K/sZF+nfmQg8uB52TM/Ko5q9De5J8VL9VWjfOezokkwbMJqW3YtTDSMKFmKMDec= 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)(39860400002)(366004)(346002)(396003)(376002)(136003)(1800799009)(186009)(451199024)(122000001)(71200400001)(7696005)(6506007)(83380400001)(9686003)(478600001)(10290500003)(26005)(2906002)(8990500004)(64756008)(66446008)(66476007)(66556008)(66946007)(316002)(76116006)(110136005)(52536014)(4326008)(8676002)(8936002)(41300700001)(5660300002)(86362001)(33656002)(55016003)(82950400001)(82960400001)(38070700005)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?J64vHnsaO08aEqcSHbRt/IST+98kjk3PtmI9xcBTptD8BrXe2ITQNNzwLDE+?= =?us-ascii?Q?RmSogvNTgUmsPj1dkCopRIM+g/TtuLXgc2IhCHU3BIjqdBjRIKaB+ePsY5MY?= =?us-ascii?Q?dMQsTrhcX6jBq599l5g7IZ9mNnO4z2ac4RztM1kVN2MSCB/jnL+xEuDLV8jF?= =?us-ascii?Q?tiAf55nFQsiO84LhWnS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?us-ascii?Q?F57uT8M0wG9kJIsbgXROrxfyqjt2MNZwhwaxHx5edf6idm2lhwBslhciP083?= =?us-ascii?Q?D9bZWpC/zUsm+0b9LfrhuVIi4UITdzGQJEmmFvJB0UkcCQ7HU07vht8BBnPX?= =?us-ascii?Q?Yce3DsHqN4hC+G1QBb15ELDscTijfCKJEt0Gn9nk2XXvFrYZkfm7xT+M+N7G?= =?us-ascii?Q?lDDeX2M3ZJH6haIleq/0MMO9kebh8HdgW8VwzdppHiYXLTsVkOiOa8LhlWqD?= =?us-ascii?Q?9A3urnbfr6WED19MenymFbG2QYQZ4UXWLHjTJ1vscMsrfCgqstTJEffazRLB?= =?us-ascii?Q?o16nOy3FiPLnK0qrf2qjQS9+2m12+5YmWnfAwCCTyRIaBHSxM86Esy5k0v43?= =?us-ascii?Q?+iDeFYEYO/zii2RLRzVdwSKoc91ZM96D+0QPx29opSZXxMem6AxPuxG/cZvQ?= =?us-ascii?Q?+3Ep7FqdVUiDvFGgARQvjrMrRE5937QoHjPIEG73gpdmgUXOSh45Md3CZkw9?= =?us-ascii?Q?BBYjjsyLAiL58m/eC0x6yFPdYUhqXVJLXUFVEWhA?= 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: 199a1e05-41b2-4b02-9e18-08dbb49df29c X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2023 21:11:07.6249 (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: t53nRBGuwO55jc2uVmTlIiT0gVBaF4jQsj2ahVX8K5NJzKNWVa7muVo9a0jmW5Vh607nWGArkPMbtUL0n7J77w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR21MB3854 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 Please send this patch to Ferruh Yigit Andrew Rybchenko > --- > 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); This should never happen. What does "overflowed" mean? Is it a hardware error or software error? If t= his is a software error, the calling code needs to make sure it never overf= lows when using short doorbells. Thanks, Long