From ab4e19097b754b956cf0d64880a68169423a8d76 Mon Sep 17 00:00:00 2001 From: Nicolas Chautru Date: Sun, 17 Oct 2021 12:23:24 +0530 Subject: [PATCH] bbdev: add device info for data endianness Added device information to capture explicitly the assumption of the input/output data byte endianness being processed. Signed-off-by: Nicolas Chautru Signed-off-by: Nipun Gupta Acked-by: Akhil Goyal --- doc/guides/rel_notes/release_21_11.rst | 2 ++ 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/null/bbdev_null.c | 6 ++++++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.h | 4 ++++ 7 files changed, 16 insertions(+) diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 59f1ce177d..93788530e4 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -277,6 +277,8 @@ API Changes * cryptodev: The structure ``rte_crypto_sym_vec`` was updated to add ``dest_sgl`` to support out of place processing. +* bbdev: Added device info related to data byte endianness processing. + ABI Changes ----------- diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c index 4e2feefc3c..05fe6f8b6f 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.c +++ b/drivers/baseband/acc100/rte_acc100_pmd.c @@ -1089,6 +1089,7 @@ acc100_dev_info_get(struct rte_bbdev *dev, #else dev_info->harq_buffer_size = 0; #endif + dev_info->data_endianness = RTE_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 6485cc824a..ee457f3071 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 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->default_queue_conf = default_queue_conf; dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs = NULL; + dev_info->data_endianness = RTE_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 350c4248eb..703bb611a0 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 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->default_queue_conf = default_queue_conf; dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs = NULL; + dev_info->data_endianness = RTE_LITTLE_ENDIAN; /* Calculates number of queues assigned to device */ dev_info->max_num_queues = 0; diff --git a/drivers/baseband/null/bbdev_null.c b/drivers/baseband/null/bbdev_null.c index 53c538ba44..753d920e18 100644 --- a/drivers/baseband/null/bbdev_null.c +++ b/drivers/baseband/null/bbdev_null.c @@ -77,6 +77,12 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->cpu_flag_reqs = NULL; dev_info->min_alignment = 0; + /* BBDEV null device does not process the data, so + * endianness setting is not relevant, but setting it + * here for code completeness. + */ + dev_info->data_endianness = RTE_LITTLE_ENDIAN; + rte_bbdev_log_debug("got device info from %u", dev->data->dev_id); } diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c b/drivers/baseband/turbo_sw/bbdev_turbo_software.c index e1db2bf205..b234bb751a 100644 --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c @@ -253,6 +253,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->capabilities = bbdev_capabilities; dev_info->min_alignment = 64; dev_info->harq_buffer_size = 0; + dev_info->data_endianness = RTE_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 3ebf62e697..e863bd913f 100644 --- a/lib/bbdev/rte_bbdev.h +++ b/lib/bbdev/rte_bbdev.h @@ -309,6 +309,10 @@ struct rte_bbdev_driver_info { uint16_t min_alignment; /** HARQ memory available in kB */ uint32_t harq_buffer_size; + /** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported + * for input/output data + */ + uint8_t data_endianness; /** Default queue configuration used if none is supplied */ struct rte_bbdev_queue_conf default_queue_conf; /** Device operation capabilities */ -- 2.20.1