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 B9F5FA0C47; Thu, 7 Oct 2021 15:13:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 944C7411D6; Thu, 7 Oct 2021 15:13:38 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 6532C40685 for ; Thu, 7 Oct 2021 15:13:37 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1972pxMt012178; Thu, 7 Oct 2021 06:13:36 -0700 Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam08lp2042.outbound.protection.outlook.com [104.47.73.42]) by mx0b-0016f401.pphosted.com with ESMTP id 3bhrg2a9c7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Oct 2021 06:13:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QlE8om33arQ7XVnRSgc0iSdw/4PFbRYiPiSSgVgkapQ6802VA2hKxozrSWZ4E2a6DshJzEZFesZQeJvE7ZQJZsWpX1zeuYl8PIHcgO3DsCRQRGHwdS+RKEdjHPoRrB//gp+Qp/at8Y+y5mbi9+2QO1RI0CxmVddNUuYrbdoeiOTGaGp+1YZncRfCLmM8p0zMyjLxMyzY5hqind3Z5Z6tCMHrmVVliGZ6ClXNzuqjg+dPT8W+m6fbfDp1cVNv7loqOuhS04SDcs4jYhK8KKhKGEtIXQB05nZBOxoL6KeBUgh1rqyoK5cQ3G5HopGlBtrIOkRi64W3n5CNJMCsOPbQhA== 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=Xp6huTZ0IFFKRHF1Rgx5HhHs8eYpSok3YlVbZ+WnMfg=; b=BY91SlYgVFYs3fG9E37ovZ+W+22Pzvn0KBlrXrn2TcfzLK8J97HSUrbQUsxXkIEhPoDx+5G0ky72B4LSlJF2uJJwkRikdzV+8ODYULROcHD5ECcMygNLqFHXYsLZnDWrTCvBHx4nFxhgpJUnVl4dXenL7rmmWMUnbR3AeQ/r0hJEwSBTH1TT9ZMWhEfKedvJf9d2BB8UnMHYJeLlGCF5cO1+FpjoQLxZdz8s1i+UkQPODMSgtfXGvh6BZQ/Uu3dM6eIt9KSxenhKRhMpJ75XU1rLEukOLAWGMQKiKX2jSGOUNls3a0FVtqoOGs2xkcj4UcdvC6Df63kI4MzMwew4hQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xp6huTZ0IFFKRHF1Rgx5HhHs8eYpSok3YlVbZ+WnMfg=; b=f1U5x73Czz2hi0nU+tnGbSxiTJ03L8/7aOcZCIZ3j3PwuQbQwnJ6ztjT+knT4faks1HGWwUjlC1hYeEBrWwuYOzepvwWyEW2i4WvZZ2YhHRGhaviJ3zG6KkYBT6l+/738aFJLhxQNTH985XRtWmBPdfoSn0R6glXrVXUq75LTWI= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4825.namprd18.prod.outlook.com (2603:10b6:303:ec::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Thu, 7 Oct 2021 13:13:32 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8%6]) with mapi id 15.20.4566.023; Thu, 7 Oct 2021 13:13:32 +0000 From: Akhil Goyal To: Nicolas Chautru , "dev@dpdk.org" , "nipun.gupta@nxp.com" , "trix@redhat.com" CC: "thomas@monjalon.net" , "mingshan.zhang@intel.com" , "arun.joshi@intel.com" , "hemant.agrawal@nxp.com" , "david.marchand@redhat.com" Thread-Topic: [EXT] [PATCH v9] bbdev: add device info related to data endianness assumption Thread-Index: AQHXuvT6wRKvJ1WW4Uy1hHmgxcc/4avHfb9g Date: Thu, 7 Oct 2021 13:13:32 +0000 Message-ID: References: <1633553929-58670-1-git-send-email-nicolas.chautru@intel.com> <1633553929-58670-2-git-send-email-nicolas.chautru@intel.com> In-Reply-To: <1633553929-58670-2-git-send-email-nicolas.chautru@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d1474f96-506f-4e3b-54c0-08d989944355 x-ms-traffictypediagnostic: CO1PR18MB4825: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2201; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lOtWfZPZtpzWmcqcWXAtI1GVcBsjrWI2JmcERtXtF7fMG2IIFdAZPWsY2hGTLSOl8zRSfC0DneKVPRy2iaXRxfyaklSKebW+PlBKxE9bw/NmefQDB+Ikb5o5ynBg5r+tThgjlsch/mKpqVfk3Wp/erK7lKJnYiB8ITGy+/2akmRbTQb3Lv7Gu3YYwkIuEW9w8f86g5RYOF9irJp6SjcsktUHvBdcs8+X2GpKWliZprgoqWNDZk07iSiBTkNlwdBvaf1MBEsrDbD74XEg5ORrix7E6XuyJL44gN5kokOqwC4VSwDr+0fDJKFsgUSAE9XB6cfDmaehc36LLS10oRxGQ9UeDDwMRDdROv+CXaHsJHos43TZG2kOUGyw6S5PrWgajNYSM8/rjhY22U05Ut4Z8hpRXXT6k+mOeIrFSUmET3is/BqcY5gEZ/kgiXRdjkalIcNQU/tls7f8J6u5v08nY6sv+m55pdcXZYKjDGwWeTrEx1dGKlb4fcNccdt68luGDkS02ATX/QEvqSviob3JTLuXmIG/8nb2atXgYUvhSSRrJ+3G4OLwB1nu/ykENspbNgg422f+JwT+O2n84uBCnXGD1YDL1zupclSHUKgsJDIKQKm4yfdCFlKQ+TDmibY+614ymOCXduuNACU3FWDouSTI9LV9j6kT0DkLd9Dz+OuFzZaqxMVUpmtClp1QgqzcRA09lrPvxhp851ymJFwygw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(54906003)(8936002)(122000001)(316002)(110136005)(4326008)(508600001)(71200400001)(55236004)(38100700002)(6506007)(7696005)(8676002)(26005)(33656002)(55016002)(2906002)(9686003)(52536014)(5660300002)(186003)(64756008)(66446008)(66556008)(66476007)(66946007)(86362001)(38070700005)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?k0ATrTEM0ZM2iiTZQ/JuI6Nd3iIafn3vGuNVhGL++eZ5LBO3Uq62onyrv7/H?= =?us-ascii?Q?UJT3U6jkhl5dVi36tJRjVmgt+VRQuS3ql7Av0PfMQFpR3ojsVu/a+Vo+LPmt?= =?us-ascii?Q?PcIV072uAbR0Pn+lRq7J2O17nvsveoAp3ubRNbCxWJ8LyN74uFwDKF29jIm/?= =?us-ascii?Q?uEerLF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m0HKM2NoAP?= =?us-ascii?Q?+VDxIU2zum2PajW6h6kk5LMyK4XDdeGM6IigRTX9SptKOValQzKkn2msw4m1?= =?us-ascii?Q?L39WPNpvaoHHoF9fBfwN15AQ7XapGOS7aITUkXgXas99mu+b7CQhtm4Jtkxr?= =?us-ascii?Q?4qFw4Ng7+jk3yugrwC/G2UMH1rUPSkoTCZVU4S1zGUHQoeKXYdwoJQbrOpW/?= =?us-ascii?Q?rdAfJFWnxmF99hnnGyNET15AQJrW1p7HtlCwcnBhXPrev028zSUli1L+XkXv?= =?us-ascii?Q?1fzTpIF0G+Jh9LMm8zDNFxa4?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1474f96-506f-4e3b-54c0-08d989944355 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2021 13:13:32.6421 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lU6eQliUghL7N3xU0CMfCX+MiqlzFsE7iNSDQsRYBp70pk24S+ZEwO0ugdrVnvGexJs6q86rcqArUm9dNLabLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4825 X-Proofpoint-GUID: wpOoU-Xtp0bEt40cKNi3ihUmN_KP7Vjd X-Proofpoint-ORIG-GUID: wpOoU-Xtp0bEt40cKNi3ihUmN_KP7Vjd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-07_01,2021-10-07_02,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [PATCH v9] bbdev: add device info related to data endianness assumption X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > Subject: [EXT] [PATCH v9] bbdev: add device info related to data endianne= ss > assumption >=20 Title is too long. bbdev: add dev info for data endianness > Adding device information to capture explicitly the assumption > of the input/output data byte endianness being processed. >=20 > Signed-off-by: Nicolas Chautru > --- > doc/guides/rel_notes/release_21_11.rst | 1 + > drivers/baseband/acc100/rte_acc100_pmd.c | 1 + > drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + > drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + > drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + > lib/bbdev/rte_bbdev.h | 8 ++++++++ > 6 files changed, 13 insertions(+) >=20 > diff --git a/doc/guides/rel_notes/release_21_11.rst > b/doc/guides/rel_notes/release_21_11.rst > index a8900a3..f0b3006 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -191,6 +191,7 @@ API Changes >=20 > * bbdev: Added capability related to more comprehensive CRC options. >=20 > +* bbdev: Added device info related to data byte endianness processing > assumption. It is not clear from the description or the release notes, what the applica= tion is supposed to do based on the new dev_info field set and how the driver de= termine what value to set? Isn't there a standard from the application stand point that the input/outp= ut data Should be in BE or in LE like in case of IP packets which are always in BE? I mean why is it dependent on the PMD which is processing it? Whatever application understands, PMD should comply with that and do intern= al Swapping if it does not support it. Am I missing something? >=20 > ABI Changes > ----------- > diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c > b/drivers/baseband/acc100/rte_acc100_pmd.c > index 4e2feef..eb2c6c1 100644 > --- a/drivers/baseband/acc100/rte_acc100_pmd.c > +++ b/drivers/baseband/acc100/rte_acc100_pmd.c > @@ -1089,6 +1089,7 @@ > #else > dev_info->harq_buffer_size =3D 0; > #endif > + dev_info->data_endianness =3D RTE_BBDEV_LITTLE_ENDIAN; > acc100_check_ir(d); > } >=20 > diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > index 6485cc8..c7f15c0 100644 > --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > @@ -372,6 +372,7 @@ > dev_info->default_queue_conf =3D default_queue_conf; > dev_info->capabilities =3D bbdev_capabilities; > dev_info->cpu_flag_reqs =3D NULL; > + dev_info->data_endianness =3D RTE_BBDEV_LITTLE_ENDIAN; >=20 > /* Calculates number of queues assigned to device */ > dev_info->max_num_queues =3D 0; > diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c > b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c > index 350c424..72e213e 100644 > --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c > +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c > @@ -644,6 +644,7 @@ struct __rte_cache_aligned fpga_queue { > dev_info->default_queue_conf =3D default_queue_conf; > dev_info->capabilities =3D bbdev_capabilities; > dev_info->cpu_flag_reqs =3D NULL; > + dev_info->data_endianness =3D RTE_BBDEV_LITTLE_ENDIAN; >=20 > /* Calculates number of queues assigned to device */ > dev_info->max_num_queues =3D 0; > diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c > b/drivers/baseband/turbo_sw/bbdev_turbo_software.c > index e1db2bf..0cab91a 100644 > --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c > +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c > @@ -253,6 +253,7 @@ struct turbo_sw_queue { > dev_info->capabilities =3D bbdev_capabilities; > dev_info->min_alignment =3D 64; > dev_info->harq_buffer_size =3D 0; > + dev_info->data_endianness =3D RTE_BBDEV_LITTLE_ENDIAN; >=20 > rte_bbdev_log_debug("got device info from %u\n", dev->data- > >dev_id); > } > diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h > index 3ebf62e..b3f3000 100644 > --- a/lib/bbdev/rte_bbdev.h > +++ b/lib/bbdev/rte_bbdev.h > @@ -49,6 +49,12 @@ enum rte_bbdev_state { > RTE_BBDEV_INITIALIZED > }; >=20 > +/** Definitions of device data byte endianness types */ > +enum rte_bbdev_endianness { > + RTE_BBDEV_BIG_ENDIAN, /**< Data with byte-endianness BE */ > + RTE_BBDEV_LITTLE_ENDIAN, /**< Data with byte-endianness LE */ > +}; If at all be need this dev_info field, as Tom suggested we should use RTE_BIG/LITTLE_ENDIAN. > + > /** > * Get the total number of devices that have been successfully initialis= ed. > * > @@ -309,6 +315,8 @@ struct rte_bbdev_driver_info { > uint16_t min_alignment; > /** HARQ memory available in kB */ > uint32_t harq_buffer_size; > + /** Byte endianness assumption for input/output data */ > + enum rte_bbdev_endianness data_endianness; We should define how the input and output data are expected from the app. If need be, we can define a simple ``bool swap`` instead of an enum. > /** Default queue configuration used if none is supplied */ > struct rte_bbdev_queue_conf default_queue_conf; > /** Device operation capabilities */ > -- > 1.8.3.1