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 C8C09A0C47; Thu, 7 Oct 2021 14:01:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ACD6A407FF; Thu, 7 Oct 2021 14:01:13 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 0E07440040 for ; Thu, 7 Oct 2021 14:01:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633608071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0CEx3gXe80x21cWCoh4OsHaJcNbqQLAl3pxq6QbjC+8=; b=LK3LLSzI08FIUxWx/zRk76IT9GRlgGoG6GZ+fwfB1UVL2spB+AOP2vmycuB3RbVlpkU9ee Y9BU9qz2wqmuZwSsxf6mn/my2q/oKPHnnHZxR3lDi8J9nMAGB1oKW2g3Xd5QOC2IRcXUkq xPO6wJBbpmcXXQ9TdJu8jEuLDP2ws4U= Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-eTnML6QaOL6ooGTouzy7Kg-1; Thu, 07 Oct 2021 08:01:08 -0400 X-MC-Unique: eTnML6QaOL6ooGTouzy7Kg-1 Received: by mail-oi1-f198.google.com with SMTP id o62-20020acaf041000000b00276562d5a75so3343900oih.13 for ; Thu, 07 Oct 2021 05:01:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=0CEx3gXe80x21cWCoh4OsHaJcNbqQLAl3pxq6QbjC+8=; b=iY4AbafEOY5im0/TXg1aGo6TXaGvklvtzhi2Hgh83tUkODm/nCqTzrCddKyLHjn63X VJ8Xv2agJzhPfGa4JiQRAEY5ffROG6Qk8A+n9f7hgY5sQPEYjiADl55EOjAiMd7atFyn jOR1buvsRn7vZ57LBJ2WpUTh2ELUdSVWwcT47JvxRekYkml2xu4ldVS3V7TBGQoDNjl6 T5XMia9jtnncityM6eUjz6D4PBdjbknWtkc4yrBNAvz1QSEmGMczzhZK8W8F1LmJmjhA l9yAMfBphzFV930IJ+pYGjOpCicwnJUWohl6kC4QqVqIipQ2GmDJWGegL4x871+GGqSL h3gQ== X-Gm-Message-State: AOAM531DY6GtZUtbYaZRWEh9O3EpNmRNwehfN6NSGFX46ZDdyz8fvka2 AtqO5y863WAcwedvLaJO51kBoaCTYE1G6hK4XBjEf703uLbXpzHqQfXh+Y5VmGOWfMAedbFJ9Q7 WU2A= X-Received: by 2002:a9d:6f93:: with SMTP id h19mr3246582otq.14.1633608067463; Thu, 07 Oct 2021 05:01:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu0KjRaxR7XNrcWbWTYnAs0ye+8Ua9NfL6obxe17qLSXwUEPeILVm77a7/y++S1hy69oW+XA== X-Received: by 2002:a9d:6f93:: with SMTP id h19mr3246498otq.14.1633608066664; Thu, 07 Oct 2021 05:01:06 -0700 (PDT) Received: from localhost.localdomain (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id j6sm324409oot.18.2021.10.07.05.01.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Oct 2021 05:01:06 -0700 (PDT) To: Nicolas Chautru , dev@dpdk.org, gakhil@marvell.com, nipun.gupta@nxp.com Cc: thomas@monjalon.net, mingshan.zhang@intel.com, arun.joshi@intel.com, hemant.agrawal@nxp.com, david.marchand@redhat.com References: <1633553929-58670-1-git-send-email-nicolas.chautru@intel.com> <1633553929-58670-2-git-send-email-nicolas.chautru@intel.com> From: Tom Rix Message-ID: Date: Thu, 7 Oct 2021 05:01:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <1633553929-58670-2-git-send-email-nicolas.chautru@intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=trix@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [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" On 10/6/21 1:58 PM, Nicolas Chautru wrote: > Adding device information to capture explicitly the assumption > of the input/output data byte endianness being processed. > > 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 + Missed bbdev_null.c If this was intentional data_endianness is uninitialized or implicitly big endian. It would be better to say it is unknown. which may mean another enum is needed. > drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + > lib/bbdev/rte_bbdev.h | 8 ++++++++ > 6 files changed, 13 insertions(+) > > 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 > > * bbdev: Added capability related to more comprehensive CRC options. > > +* bbdev: Added device info related to data byte endianness processing assumption. > > 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 = 0; > #endif > + dev_info->data_endianness = RTE_BBDEV_LITTLE_ENDIAN; > acc100_check_ir(d); > } > > 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 = default_queue_conf; > dev_info->capabilities = bbdev_capabilities; > dev_info->cpu_flag_reqs = NULL; > + dev_info->data_endianness = RTE_BBDEV_LITTLE_ENDIAN; > > /* Calculates number of queues assigned to device */ > dev_info->max_num_queues = 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 = default_queue_conf; > dev_info->capabilities = bbdev_capabilities; > dev_info->cpu_flag_reqs = NULL; > + dev_info->data_endianness = RTE_BBDEV_LITTLE_ENDIAN; > > /* Calculates number of queues assigned to device */ > dev_info->max_num_queues = 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 = bbdev_capabilities; > dev_info->min_alignment = 64; > dev_info->harq_buffer_size = 0; > + dev_info->data_endianness = RTE_BBDEV_LITTLE_ENDIAN; > > 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 > }; > > +/** 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 */ > +}; Could RTE_BIG|LITTLE_ENDIAN be reused ? Tom > + > /** > * Get the total number of devices that have been successfully initialised. > * > @@ -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; > /** Default queue configuration used if none is supplied */ > struct rte_bbdev_queue_conf default_queue_conf; > /** Device operation capabilities */