From: Nicolas Chautru <nicolas.chau...@intel.com> Adding device information to capture explicitly the assumption of the input/output data byte endianness being processed.
Signed-off-by: Nicolas Chautru <nicolas.chau...@intel.com> Signed-off-by: Nipun Gupta <nipun.gu...@nxp.com> --- 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/null/bbdev_null.c | 6 ++++++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.h | 4 ++++ 7 files changed, 15 insertions(+) diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index c0a7f75518..135aa467f2 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -194,6 +194,7 @@ API Changes the crypto/security operation. This field will be used to communicate events such as soft expiry with IPsec in lookaside mode. +* 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 68ba523ea9..361e06cf94 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.c +++ b/drivers/baseband/acc100/rte_acc100_pmd.c @@ -1088,6 +1088,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 77e9a2ecbc..7dfeec665a 100644 --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c @@ -251,6 +251,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.17.1