drivers/baseband: PMD to support ACC101 device
v2 cover drivers/baseband: PMD to support ACC101 device
v2: Based on good feedback from Thomas and David,
now implementing the ACC101 PMD as a close derivative from
existing ACC100 PMD with hooks to have different behaviour based on variant. This prevents code duplication and only rely on different functions and behaviour when hardware requires or support differences.
Note that these are pending changes for ACC100 which would be specific to that device and not ACC101 but these can be managed based on the new implementation, ie. is_acc100() etc... (such incremental changes for ACC100 trending 22.11 but confirming this is future proof).
The serie also includes commits which were meant for ACC101 but are also valuable for ACC100.
v1: This serie introduces the PMD for the new bbdev device ACC101 (aka Mount Cirrus). This is a derivative from previous Mount Bryce ACC100 which includes silicon improvement, bug fixes, capacity improvement for 5GNR and feature improvement.
Nicolas Chautru (5):
baseband/acc100: introduce PMD for ACC101 baseband/acc100: modify validation code for ACC101 baseband/acc100: configuration of ACC101 from PF baseband/acc100: start explicitly PF Monitor from PMD baseband/acc100: add protection for some negative scenario
app/test-bbdev/test_bbdev_perf.c | 57 ++++ doc/guides/bbdevs/acc101.rst | 237 ++++++++++++++ doc/guides/bbdevs/features/acc101.ini | 13 + doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_cfg.h | 17 + drivers/baseband/acc100/rte_acc100_pmd.c | 546 ++++++++++++++++++++++++++++++- drivers/baseband/acc100/rte_acc100_pmd.h | 12 + drivers/baseband/acc100/rte_acc101_pmd.h | 61 ++++ drivers/baseband/acc100/version.map | 2 +- 10 files changed, 932 insertions(+), 18 deletions(-) create mode 100644 doc/guides/bbdevs/acc101.rst create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
Signature · 1 line
1.8.3.1
PATCH v2 1/5 baseband/acc100: introduce PMD for ACC101
Support for ACC101 as a derivative of ACC100.
Reusing existing code when possible.
--- doc/guides/bbdevs/acc101.rst | 237 +++++++++++++++++++++++++++++++ doc/guides/bbdevs/features/acc101.ini | 13 ++ doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_pmd.c | 194 ++++++++++++++++++++++++- drivers/baseband/acc100/rte_acc100_pmd.h | 6 + drivers/baseband/acc100/rte_acc101_pmd.h | 61 ++++++++ 7 files changed, 511 insertions(+), 5 deletions(-) create mode 100644 doc/guides/bbdevs/acc101.rst create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
doc/guides/bbdevs/acc101.rst new file +237 -0
@@ -0,0 +1,237 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2020 Intel Corporation + +Intel(R) ACC101 5G/4G FEC Poll Mode Driver +========================================== + +The BBDEV ACC101 5G/4G FEC poll mode driver (PMD) supports an +implementation of a VRAN FEC wireless acceleration function. +This device is also known as Mount Cirrus. +This is a follow-up to Mount Bryce (ACC100) and includes fixes, improved +feature set for error scenarios and performance capacity increase. + +Features +-------- + +ACC101 5G/4G FEC PMD supports the following features: + +- LDPC Encode in the DL (5GNR) +- LDPC Decode in the UL (5GNR) +- Turbo Encode in the DL (4G) +- Turbo Decode in the UL (4G) +- 16 VFs per PF (physical device) +- Maximum of 128 queues per VF +- PCIe Gen-3 x16 Interface +- MSI +- SR-IOV + +ACC101 5G/4G FEC PMD supports the following BBDEV capabilities: + +* For the LDPC encode operation: + - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_LDPC_RATE_MATCH`` : if set then do not do Rate Match bypass + - ``RTE_BBDEV_LDPC_INTERLEAVER_BYPASS`` : if set then bypass interleaver + +* For the LDPC decode operation: + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` : check CRC24B from CB(s) + - ``RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE`` : disable early termination + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` : drops CRC24B bits appended while decoding + - ``RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE`` : HARQ memory input is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE`` : HARQ memory output is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK`` : loopback data to/from HARQ memory + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS`` : HARQ memory includes the fillers bits + - ``RTE_BBDEV_LDPC_DEC_SCATTER_GATHER`` : supports scatter-gather for input/output data + - ``RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION`` : supports compression of the HARQ input/output + - ``RTE_BBDEV_LDPC_LLR_COMPRESSION`` : supports LLR input compression + +* For the turbo encode operation: + - ``RTE_BBDEV_TURBO_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_TURBO_RATE_MATCH`` : if set then do not do Rate Match bypass + - ``RTE_BBDEV_TURBO_ENC_INTERRUPTS`` : set for encoder dequeue interrupts + - ``RTE_BBDEV_TURBO_RV_INDEX_BYPASS`` : set to bypass RV index + - ``RTE_BBDEV_TURBO_ENC_SCATTER_GATHER`` : supports scatter-gather for input/output data + +* For the turbo decode operation: + - ``RTE_BBDEV_TURBO_CRC_TYPE_24B`` : check CRC24B from CB(s) + - ``RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE`` : perform subblock de-interleave + - ``RTE_BBDEV_TURBO_DEC_INTERRUPTS`` : set for decoder dequeue interrupts + - ``RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN`` : set if negative LLR encoder i/p is supported + - ``RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN`` : set if positive LLR encoder i/p is supported + - ``RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP`` : keep CRC24B bits appended while decoding + - ``RTE_BBDEV_TURBO_DEC_CRC_24B_DROP`` : option to drop the code block CRC after decoding + - ``RTE_BBDEV_TURBO_EARLY_TERMINATION`` : set early termination feature + - ``RTE_BBDEV_TURBO_DEC_SCATTER_GATHER`` : supports scatter-gather for input/output data + - ``RTE_BBDEV_TURBO_HALF_ITERATION_EVEN`` : set half iteration granularity + +Installation +------------ + +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. + +DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual. +The bbdev test application has been tested with a configuration 40 x 1GB hugepages. The +hugepage configuration of a server may be examined using: + +.. code-block:: console + + grep Huge* /proc/meminfo + + +Initialization +-------------- + +When the device first powers up, its PCI Physical Functions (PF) can be listed through this command: + +.. code-block:: console + + sudo lspci -vd8086:57c4 + +The physical and virtual functions are compatible with Linux UIO drivers: +``vfio`` and ``igb_uio``. However, in order to work the ACC101 5G/4G +FEC device first needs to be bound to one of these linux drivers through DPDK. + + +Bind PF UIO driver(s) +~~~~~~~~~~~~~~~~~~~~~ + +Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use +``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. + +The igb_uio driver may be bound to the PF PCI device using one of two methods: + + +1. PCI functions (physical or virtual, depending on the use case) can be bound to +the UIO driver by repeating this command for every function. + +.. code-block:: console + + cd <dpdk-top-level-directory> + insmod ./build/kmod/igb_uio.ko + echo "8086 57c4" > /sys/bus/pci/drivers/igb_uio/new_id + lspci -vd8086:57c4 + + +2. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool + +.. code-block:: console + + cd <dpdk-top-level-directory> + ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0 + +where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:57c4 + + +In a similar way the ACC101 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. + + +Enable Virtual Functions +~~~~~~~~~~~~~~~~~~~~~~~~ + +Now, it should be visible in the printouts that PCI PF is under igb_uio control +"``Kernel driver in use: igb_uio``" + +To show the number of available VFs on the device, read ``sriov_totalvfs`` file.. + +.. code-block:: console + + cat /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_totalvfs + + where 0000\:<b>\:<d>.<f> is the PCI device ID + + +To enable VFs via igb_uio, echo the number of virtual functions intended to +enable to ``max_vfs`` file.. + +.. code-block:: console + + echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/max_vfs + + +Afterwards, all VFs must be bound to appropriate UIO drivers as required, same +way it was done with the physical function previously. + +Enabling SR-IOV via vfio driver is pretty much the same, except that the file +name is different: + +.. code-block:: console + + echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_numvfs + + +Configure the VFs through PF +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The PCI virtual functions must be configured before working or getting assigned +to VMs/Containers. The configuration involves allocating the number of hardware +queues, priorities, load balance, bandwidth and other settings necessary for the +device to perform FEC functions. + +This configuration needs to be executed at least once after reboot or PCI FLR and can +be achieved by using the function ``acc101_configure()``, which sets up the +parameters defined in ``acc100_conf`` structure. + +Test Application +---------------- + +BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing +the functionality of ACC101 5G/4G FEC encode and decode, depending on the device's +capabilities. The test application is located under app->test-bbdev folder and has the +following options: + +.. code-block:: console + + "-p", "--testapp-path": specifies path to the bbdev test app. + "-e", "--eal-params" : EAL arguments which are passed to the test app. + "-t", "--timeout" : Timeout in seconds (default=300). + "-c", "--test-cases" : Defines test cases to run. Run all if not specified. + "-v", "--test-vector" : Test vector path (default=dpdk_path+/app/test-bbdev/test_vectors/bbdev_null.data). + "-n", "--num-ops" : Number of operations to process on device (default=32). + "-b", "--burst-size" : Operations enqueue/dequeue burst size (default=32). + "-s", "--snr" : SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-l", "--num-lcores" : Number of lcores to run (default=16). + "-i", "--init-device" : Initialise PF device with default values. + + +To execute the test application tool using simple decode or encode data, +type one of the following: + +.. code-block:: console + + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_enc_default.data + + +The test application ``test-bbdev.py``, supports the ability to configure the PF device with +a default set of values, if the "-i" or "- -init-device" option is included. The default values +are defined in test_bbdev_perf.c. + + +Test Vectors +~~~~~~~~~~~~ + +In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides +a range of additional tests under the test_vectors folder, which may be useful. The results +of these tests will depend on the ACC101 5G/4G FEC capabilities which may cause some +testcases to be skipped, but no failure should be reported. + + +Alternate Baseband Device configuration tool +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +On top of the embedded configuration feature supported in test-bbdev using "- -init-device" +option mentioned above, there is also a tool available to perform that device configuration +using a companion application. +The ``pf_bb_config`` application notably enables then to run bbdev-test from the VF +and not only limited to the PF as captured above. + +See for more details: https://github.com/intel/pf-bb-config + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_4vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -l 1 -v ./ldpc_dec_default.data
doc/guides/bbdevs/features/acc101.ini new file +13 -0
@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Y
doc/guides/bbdevs/index.rst +1 -0
@@ -14,4 +14,5 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + acc101 la12xx
doc/guides/rel_notes/release_22_07.rst +4 -0
@@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device (Mount Cirrus). + * See the :doc:`../bbdevs/acc101` for more details. Removed Items -------------
drivers/baseband/acc100/rte_acc100_pmd.c +189 -5
236 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +6 -0
@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf
@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)/* Number of Virtual Functions ACC100 supports */
@@ -590,6 +595,7 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */ };/**
drivers/baseband/acc100/rte_acc101_pmd.h new file +61 -0
61 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Re: [PATCH v2 1/5] baseband/acc100: introduce PMD for ACC101
This is a good start reusing code, but I think it needs to do more reuse.
These cards should be very close and likely represent a family of cards.
Quoted 24 lines · Nicolas Chautru
Support for ACC101 as a derivative of ACC100.
Reusing existing code when possible.Signed-off-by Nicolas Chautru <[email protected]>--- doc/guides/bbdevs/acc101.rst | 237 +++++++++++++++++++++++++++++++ doc/guides/bbdevs/features/acc101.ini | 13 ++ doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_pmd.c | 194 ++++++++++++++++++++++++- drivers/baseband/acc100/rte_acc100_pmd.h | 6 + drivers/baseband/acc100/rte_acc101_pmd.h | 61 ++++++++ 7 files changed, 511 insertions(+), 5 deletions(-)create mode 100644
doc/guides/bbdevs/acc101.rstcreate mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644drivers/baseband/acc100/rte_acc101_pmd.hdoc/guides/bbdevs/acc101.rst new file +1
-0@@ -0,0 +1,237 @@ +.. SPDX-License-Identifier: BSD-3-Clause
doc/guides/bbdevs/acc101.rst line 11
Quoted 10 lines
doc/guides/bbdevs/acc101.rst new file +10
-0+ Copyright(c) 2020 Intel Corporation + +Intel(R) ACC101 5G/4G FEC Poll Mode Driver +========================================== + +The BBDEV ACC101 5G/4G FEC poll mode driver (PMD) supports an +implementation of a VRAN FEC wireless acceleration function. +This device is also known as Mount Cirrus. +This is a follow-up to Mount Bryce (ACC100) and includes fixes, improved +feature set for error scenarios and performance capacity increase.
includes fixes, better error handling and increased performance.
A quick look at acc100.rst and the bulk of acc101.rst looks the same.
Consider a user of the acc100 is upgrading to acc101, they will
want to know what is the same and what has changed and test accordingly.
These two documents should be combined.
Quoted 236 lines
doc/guides/bbdevs/acc101.rst new file +226
-0+ +Features +-------- + +ACC101 5G/4G FEC PMD supports the following features: + +- LDPC Encode in the DL (5GNR) +- LDPC Decode in the UL (5GNR) +- Turbo Encode in the DL (4G) +- Turbo Decode in the UL (4G) +- 16 VFs per PF (physical device) +- Maximum of 128 queues per VF +- PCIe Gen-3 x16 Interface +- MSI +- SR-IOV + +ACC101 5G/4G FEC PMD supports the following BBDEV capabilities: + +* For the LDPC encode operation: + - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_LDPC_RATE_MATCH`` : if set then do not do Rate Match bypass + - ``RTE_BBDEV_LDPC_INTERLEAVER_BYPASS`` : if set then bypass interleaver + +* For the LDPC decode operation: + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` : check CRC24B from CB(s) + - ``RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE`` : disable early termination + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` : drops CRC24B bits appended while decoding + - ``RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE`` : HARQ memory input is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE`` : HARQ memory output is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK`` : loopback data to/from HARQ memory + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS`` : HARQ memory includes the fillers bits + - ``RTE_BBDEV_LDPC_DEC_SCATTER_GATHER`` : supports scatter-gather for input/output data + - ``RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION`` : supports compression of the HARQ input/output + - ``RTE_BBDEV_LDPC_LLR_COMPRESSION`` : supports LLR input compression + +* For the turbo encode operation: + - ``RTE_BBDEV_TURBO_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_TURBO_RATE_MATCH`` : if set then do not do Rate Match bypass + - ``RTE_BBDEV_TURBO_ENC_INTERRUPTS`` : set for encoder dequeue interrupts + - ``RTE_BBDEV_TURBO_RV_INDEX_BYPASS`` : set to bypass RV index + - ``RTE_BBDEV_TURBO_ENC_SCATTER_GATHER`` : supports scatter-gather for input/output data + +* For the turbo decode operation: + - ``RTE_BBDEV_TURBO_CRC_TYPE_24B`` : check CRC24B from CB(s) + - ``RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE`` : perform subblock de-interleave + - ``RTE_BBDEV_TURBO_DEC_INTERRUPTS`` : set for decoder dequeue interrupts + - ``RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN`` : set if negative LLR encoder i/p is supported + - ``RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN`` : set if positive LLR encoder i/p is supported + - ``RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP`` : keep CRC24B bits appended while decoding + - ``RTE_BBDEV_TURBO_DEC_CRC_24B_DROP`` : option to drop the code block CRC after decoding + - ``RTE_BBDEV_TURBO_EARLY_TERMINATION`` : set early termination feature + - ``RTE_BBDEV_TURBO_DEC_SCATTER_GATHER`` : supports scatter-gather for input/output data + - ``RTE_BBDEV_TURBO_HALF_ITERATION_EVEN`` : set half iteration granularity + +Installation +------------ + +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. + +DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual. +The bbdev test application has been tested with a configuration 40 x 1GB hugepages. The +hugepage configuration of a server may be examined using: + +.. code-block:: console + + grep Huge* /proc/meminfo + + +Initialization +-------------- + +When the device first powers up, its PCI Physical Functions (PF) can be listed through this command: + +.. code-block:: console + + sudo lspci -vd8086:57c4 + +The physical and virtual functions are compatible with Linux UIO drivers: +``vfio`` and ``igb_uio``. However, in order to work the ACC101 5G/4G +FEC device first needs to be bound to one of these linux drivers through DPDK. + + +Bind PF UIO driver(s) +~~~~~~~~~~~~~~~~~~~~~ + +Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use +``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. + +The igb_uio driver may be bound to the PF PCI device using one of two methods: + + +1. PCI functions (physical or virtual, depending on the use case) can be bound to +the UIO driver by repeating this command for every function. + +.. code-block:: console + + cd <dpdk-top-level-directory> + insmod ./build/kmod/igb_uio.ko + echo "8086 57c4" > /sys/bus/pci/drivers/igb_uio/new_id + lspci -vd8086:57c4 + + +2. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool + +.. code-block:: console + + cd <dpdk-top-level-directory> + ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0 + +where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:57c4 + + +In a similar way the ACC101 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. + + +Enable Virtual Functions +~~~~~~~~~~~~~~~~~~~~~~~~ + +Now, it should be visible in the printouts that PCI PF is under igb_uio control +"``Kernel driver in use: igb_uio``" + +To show the number of available VFs on the device, read ``sriov_totalvfs`` file.. + +.. code-block:: console + + cat /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_totalvfs + + where 0000\:<b>\:<d>.<f> is the PCI device ID + + +To enable VFs via igb_uio, echo the number of virtual functions intended to +enable to ``max_vfs`` file.. + +.. code-block:: console + + echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/max_vfs + + +Afterwards, all VFs must be bound to appropriate UIO drivers as required, same +way it was done with the physical function previously. + +Enabling SR-IOV via vfio driver is pretty much the same, except that the file +name is different: + +.. code-block:: console + + echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_numvfs + + +Configure the VFs through PF +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The PCI virtual functions must be configured before working or getting assigned +to VMs/Containers. The configuration involves allocating the number of hardware +queues, priorities, load balance, bandwidth and other settings necessary for the +device to perform FEC functions. + +This configuration needs to be executed at least once after reboot or PCI FLR and can +be achieved by using the function ``acc101_configure()``, which sets up the +parameters defined in ``acc100_conf`` structure. + +Test Application +---------------- + +BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing +the functionality of ACC101 5G/4G FEC encode and decode, depending on the device's +capabilities. The test application is located under app->test-bbdev folder and has the +following options: + +.. code-block:: console + + "-p", "--testapp-path": specifies path to the bbdev test app. + "-e", "--eal-params" : EAL arguments which are passed to the test app. + "-t", "--timeout" : Timeout in seconds (default=300). + "-c", "--test-cases" : Defines test cases to run. Run all if not specified. + "-v", "--test-vector" : Test vector path (default=dpdk_path+/app/test-bbdev/test_vectors/bbdev_null.data). + "-n", "--num-ops" : Number of operations to process on device (default=32). + "-b", "--burst-size" : Operations enqueue/dequeue burst size (default=32). + "-s", "--snr" : SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-l", "--num-lcores" : Number of lcores to run (default=16). + "-i", "--init-device" : Initialise PF device with default values. + + +To execute the test application tool using simple decode or encode data, +type one of the following: + +.. code-block:: console + + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_enc_default.data + + +The test application ``test-bbdev.py``, supports the ability to configure the PF device with +a default set of values, if the "-i" or "- -init-device" option is included. The default values +are defined in test_bbdev_perf.c. + + +Test Vectors +~~~~~~~~~~~~ + +In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides +a range of additional tests under the test_vectors folder, which may be useful. The results +of these tests will depend on the ACC101 5G/4G FEC capabilities which may cause some +testcases to be skipped, but no failure should be reported. + + +Alternate Baseband Device configuration tool +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +On top of the embedded configuration feature supported in test-bbdev using "- -init-device" +option mentioned above, there is also a tool available to perform that device configuration +using a companion application. +The ``pf_bb_config`` application notably enables then to run bbdev-test from the VF +and not only limited to the PF as captured above. + +See for more details: https://github.com/intel/pf-bb-config + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_4vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -l 1 -v ./ldpc_dec_default.datadoc/guides/bbdevs/features/acc101.ini new file +3
-0@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +;
doc/guides/bbdevs/features/acc101.ini line 13
Quoted 10 lines
doc/guides/bbdevs/features/acc101.ini new file +10
-0+; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Y
This is the same as acc100.ini, why do we need 2 ?
Quoted 54 lines
doc/guides/bbdevs/index.rst +1
-0@@ -14,4 +14,5 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + acc101 la12xxdoc/guides/rel_notes/release_22_07.rst +4
-0@@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device (Mount Cirrus). + * See the :doc:`../bbdevs/acc101` for more details. Removed Items -------------drivers/baseband/acc100/rte_acc100_pmd.c +7
-0@@ -22,6 +22,7 @@#include <rte_bbdev.h> #include <rte_bbdev_pmd.h> #include "rte_acc100_pmd.h" +#include "rte_acc101_pmd.h" #ifdef RTE_LIBRTE_BBDEV_DEBUG RTE_LOG_REGISTER_DEFAULT (acc100_logtype,DEBUG );@@ -1286,6 +1287,12 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); } +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); +} +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(const struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,@@ -1412,6 +1419,139 @@ } }
drivers/baseband/acc100/rte_acc100_pmd.c line 1431
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+/* Convert offset to harq index for harq_layout structure */ +static inline uint32_t hq_index (uint32_t offset) +{ +return (offset >>ACC100_HARQ_OFFSET_SHIFT ) &ACC100_HARQ_OFFSET_MASK ; +} + +/* Fill in a frame control word for LDPC decoding for ACC101 */ +static inline void +acc101_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout)
This looks extremely similar to the acc100*, why isn't this combined ?
Quoted 107 lines
drivers/baseband/acc100/rte_acc100_pmd.c +107
-0+{ +uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset; +uint32_t harq_index; +uint32_t l; + + fcw->qm = op->ldpc_dec.q_m; + fcw->nfiller = op->ldpc_dec.n_filler; + fcw->BG = (op->ldpc_dec.basegraph -1 ); + fcw->Zc = op->ldpc_dec.z_c; + fcw->ncb = op->ldpc_dec.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph, + op->ldpc_dec.rv_index); +if (op->ldpc_dec.code_block_mode ==RTE_BBDEV_CODE_BLOCK ) + fcw->rm_e = op->ldpc_dec.cb_params.e; +else + fcw->rm_e = (op->ldpc_dec.tb_params.r < + op->ldpc_dec.tb_params.cab) ? + op->ldpc_dec.tb_params.ea : + op->ldpc_dec.tb_params.eb; + +if (unlikely (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ) && + (op->ldpc_dec.harq_combined_input.length ==0 ))) { +rte_bbdev_log (WARNING ,"Null HARQ input size provided" ); +/* Disable HARQ input in that case to carry forward */ + op->ldpc_dec.op_flags ^=RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ; + } + + fcw->hcin_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ); + fcw->hcout_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE ); + fcw->crc_select =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK ); + fcw->bypass_dec =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DECODE_BYPASS ); + fcw->bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS ); +if (op->ldpc_dec.q_m ==1 ) { + fcw->bypass_intlv =1 ; + fcw->qm =2 ; + } + fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_LLR_COMPRESSION ); + harq_index =hq_index (op->ldpc_dec.harq_combined_output.offset); +if (fcw->hcin_en >0 ) { + harq_in_length = op->ldpc_dec.harq_combined_input.length; +if (fcw->hcin_decomp_mode >0 ) + harq_in_length = harq_in_length *8 /6 ; + harq_in_length =RTE_MIN (harq_in_length, op->ldpc_dec.n_cb + - op->ldpc_dec.n_filler); +/* Alignment on next 64B - Already enforced from HC output */ + harq_in_length =RTE_ALIGN_FLOOR (harq_in_length,64 ); + fcw->hcin_size0 = harq_in_length; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + }else { + fcw->hcin_size0 =0 ; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + } + + fcw->itmax = op->ldpc_dec.iter_max; + fcw->itstop =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->synd_precoder = fcw->itstop; +/* +* These are all implicitly set +* fcw->synd_post = 0; +* fcw->so_en = 0; +* fcw->so_bypass_rm = 0; +* fcw->so_bypass_intlv = 0; +* fcw->dec_convllr = 0; +* fcw->hcout_convllr = 0; +* fcw->hcout_size1 = 0; +* fcw->so_it = 0; +* fcw->hcout_offset = 0; +* fcw->negstop_th = 0; +* fcw->negstop_it = 0; +* fcw->negstop_en = 0; +* fcw->gain_i = 1; +* fcw->gain_h = 1; +*/ +if (fcw->hcout_en >0 ) { + parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) + * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + ncb_p = fcw->ncb - op->ldpc_dec.n_filler; + l =RTE_MIN (k0_p + fcw->rm_e,INT16_MAX ); + harq_out_length = (uint16_t ) fcw->hcin_size0; + harq_out_length =RTE_MAX (harq_out_length, l); +/* Cannot exceed the pruned Ncb circular buffer */ + harq_out_length =RTE_MIN (harq_out_length, ncb_p); +/* Alignment on next 64B */ + harq_out_length =RTE_ALIGN_CEIL (harq_out_length,64 ); + fcw->hcout_size0 = harq_out_length; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + harq_layout[harq_index].offset = fcw->hcout_offset; + harq_layout[harq_index].size0 = fcw->hcout_size0; + }else { + fcw->hcout_size0 =0 ;
drivers/baseband/acc100/rte_acc100_pmd.c line 1548
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + } +} + +static inline void +acc10x_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout,struct acc100_queue *q) +{ +if (is_acc100 (q))
consider having a function table in the private data so the call can be made without this if-check
Quoted 115 lines
drivers/baseband/acc100/rte_acc100_pmd.c +55
-5+return acc100_fcw_ld_fill (op, fcw, harq_layout); + else + return acc101_fcw_ld_fill(op, fcw, harq_layout); +} + +/** * Fills descriptor with data pointers of one block type. * @@ -2960,7 +3100,7 @@struct acc100_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; -acc100_fcw_ld_fill (op, fcw, harq_layout); +acc10x_fcw_ld_fill (op, fcw, harq_layout, q);/* Special handling when overusing mbuf */ if (fcw->rm_e <ACC100_MAX_E_MBUF )@@ -3027,7 +3167,7 @@ desc = q->ring_addr + desc_idx;uint64_t fcw_offset = (desc_idx <<8 ) +ACC100_DESC_FCW_OFFSET ;union acc100_harq_layout_data *harq_layout = q->d->harq_layout; -acc100_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); +acc10x_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout, q); input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data;@@ -4139,9 +4279,17 @@ dev->dequeue_ldpc_enc_ops = acc100_dequeue_ldpc_enc; dev->dequeue_ldpc_dec_ops = acc100_dequeue_ldpc_dec; - ((struct acc100_device *) dev->data->dev_private)->pf_device = - !strcmp (drv->driver.name, -RTE_STR (ACC100PF_DRIVER_NAME )); +if ((!strcmp (drv->driver.name,RTE_STR (ACC100PF_DRIVER_NAME ))) || + (!strcmp (drv->driver.name,RTE_STR (ACC100VF_DRIVER_NAME )))) { + ((struct acc100_device *) dev->data->dev_private)->pf_device = + !strcmp (drv->driver.name,RTE_STR (ACC100PF_DRIVER_NAME )); + ((struct acc100_device *) dev->data->dev_private)->device_variant =ACC100_VARIANT ; + }else { + ((struct acc100_device *) dev->data->dev_private)->pf_device = + !strcmp (drv->driver.name,RTE_STR (ACC101PF_DRIVER_NAME )); + ((struct acc100_device *) dev->data->dev_private)->device_variant =ACC101_VARIANT ; + } + ((struct acc100_device *) dev->data->dev_private)->mmio_base = pci_dev->mem_resource[0 ].addr;@@ -4251,6 +4399,42 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)RTE_PMD_REGISTER_PCI (ACC100VF_DRIVER_NAME , acc100_pci_vf_driver);RTE_PMD_REGISTER_PCI_TABLE (ACC100VF_DRIVER_NAME , pci_id_acc100_vf_map); +/* ACC101 PCI PF address map */ +static struct rte_pci_id pci_id_acc101_pf_map[] = { + { +RTE_PCI_DEVICE (RTE_ACC101_VENDOR_ID ,RTE_ACC101_PF_DEVICE_ID ) + }, + {.device_id =0 }, +}; + +/* ACC101 PCI VF address map */ +static struct rte_pci_id pci_id_acc101_vf_map[] = { + { +RTE_PCI_DEVICE (RTE_ACC101_VENDOR_ID ,RTE_ACC101_VF_DEVICE_ID ) + }, + {.device_id =0 }, +}; + + +static struct rte_pci_driver acc101_pci_pf_driver = { + .probe = acc100_pci_probe, + .remove = acc100_pci_remove, + .id_table = pci_id_acc101_pf_map, + .drv_flags =RTE_PCI_DRV_NEED_MAPPING +}; + +static struct rte_pci_driver acc101_pci_vf_driver = { + .probe = acc100_pci_probe, + .remove = acc100_pci_remove, + .id_table = pci_id_acc101_vf_map, + .drv_flags =RTE_PCI_DRV_NEED_MAPPING +}; + +RTE_PMD_REGISTER_PCI (ACC101PF_DRIVER_NAME , acc101_pci_pf_driver); +RTE_PMD_REGISTER_PCI_TABLE (ACC101PF_DRIVER_NAME , pci_id_acc101_pf_map); +RTE_PMD_REGISTER_PCI (ACC101VF_DRIVER_NAME , acc101_pci_vf_driver); +RTE_PMD_REGISTER_PCI_TABLE (ACC101VF_DRIVER_NAME , pci_id_acc101_vf_map); +/* * Workaround implementation to fix the power on status of some 5GUL engines * This requires DMA permission if ported outside DPDK drivers/baseband/acc100/rte_acc100_pmd.h +5
-0@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)/* Number of Virtual Functions ACC100 supports */
drivers/baseband/acc100/rte_acc100_pmd.h struct acc100_device { · line 598
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.h +1
-0@@ -590,6 +595,7 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */
this is not needed, check the pci id
drivers/baseband/acc100/rte_acc101_pmd.h
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.h +0
-0};/** drivers/baseband/acc100/rte_acc101_pmd.h new file +0
-0
New files need license, copyrights.
This file looks very similar to rte_acc100_pmd.h
The common parts should be in only one file, maybe a rte_acc10x_pmd.h
drivers/baseband/acc100/rte_acc101_pmd.h line 3
Quoted 4 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +3
-0@@ -0,0 +1,61 @@ +/* ACC101 PF and VF driver names */ +#define ACC101PF_DRIVER_NAME intel_acc101_pf +#define ACC101VF_DRIVER_NAME intel_acc101_vf
this maybe changes to intel_acc10x_pr/vf ?
Tom
Quoted 58 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +58
-0+ +/* ACC101 PCI vendor & device IDs */ +#define RTE_ACC101_VENDOR_ID (0x8086) +#define RTE_ACC101_PF_DEVICE_ID (0x57c4) +#define RTE_ACC101_VF_DEVICE_ID (0x57c5) + +/* Define as 1 to use only a single FEC engine */ +#ifndef RTE_ACC101_SINGLE_FEC +#define RTE_ACC101_SINGLE_FEC 0 +#endif + +/* Values used in writing to the registers */ +#define ACC101_REG_IRQ_EN_ALL 0x1FF83FF/* Enable all interrupts */ + +/* Number of Virtual Functions ACC101 supports */ +#define ACC101_NUM_VFS 16 +#define ACC101_NUM_QGRPS 8 +#define ACC101_NUM_AQS 16 +/* All ACC101 Registers alignment are 32bits = 4B */ +#define ACC101_BYTES_IN_WORD 4 + +#define ACC101_GRP_ID_SHIFT 10/* Queue Index Hierarchy */ +#define ACC101_VF_ID_SHIFT 4/* Queue Index Hierarchy */ +#define ACC101_VF_OFFSET_QOS 16/* offset in Memory specific to QoS Mon */ +#define ACC101_TMPL_PRI_0 0x03020100 +#define ACC101_TMPL_PRI_1 0x07060504 +#define ACC101_TMPL_PRI_2 0x0b0a0908 +#define ACC101_TMPL_PRI_3 0x0f0e0d0c +#define ACC101_WORDS_IN_ARAM_SIZE (128 * 1024 / 4) + +#define ACC101_NUM_TMPL 32 +/* Mapping of signals for the available engines */ +#define ACC101_SIG_UL_5G 0 +#define ACC101_SIG_UL_5G_LAST 8 +#define ACC101_SIG_DL_5G 13 +#define ACC101_SIG_DL_5G_LAST 15 +#define ACC101_SIG_UL_4G 16 +#define ACC101_SIG_UL_4G_LAST 19 +#define ACC101_SIG_DL_4G 27 +#define ACC101_SIG_DL_4G_LAST 31 +#define ACC101_NUM_ACCS 5 +#define ACC101_PF_VAL 2 + +/* ACC101 Configuration */ +#define ACC101_CFG_DMA_ERROR 0x3D7 +#define ACC101_CFG_AXI_CACHE 0x11 +#define ACC101_CFG_QMGR_HI_P 0x0F0F +#define ACC101_CFG_PCI_AXI 0xC003 +#define ACC101_CFG_PCI_BRIDGE 0x40006033 +#define ACC101_ENGINE_OFFSET 0x1000 +#define ACC101_LONG_WAIT 1000 +#define ACC101_GPEX_AXIMAP_NUM 17 +#define ACC101_CLOCK_GATING_EN 0x30000 +#define ACC101_DMA_INBOUND 0x104 +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF +*/ +#define ACC101_HARQ_DDR (512 * 1)
RE: [PATCH v2 1/5] baseband/acc100: introduce PMD for ACC101
Hi Tom,
Quoted 54 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Sunday, May 8, 2022 6:03 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 1/5] baseband/acc100: introduce PMD for ACC101This is a good start reusing code, but I think it needs to do more reuse.
These cards should be very close and likely represent a family of cards.
Quoted 6 lines · Nicolas Chautru
Support for ACC101 as a derivative of ACC100.
Reusing existing code when possible.Signed-off-by Nicolas Chautru <[email protected]>--- doc/guides/bbdevs/acc101.rst | 237+++++++++++++++++++++++++++++++
Quoted 4 lines
doc/guides/bbdevs/features/acc101.ini | 13 ++ doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_pmd.c | 194++++++++++++++++++++++++-
Quoted 14 lines
drivers/baseband/acc100/rte_acc100_pmd.h | 6 + drivers/baseband/acc100/rte_acc101_pmd.h | 61 ++++++++ 7 files changed, 511 insertions(+), 5 deletions(-)create mode 100644
doc/guides/bbdevs/acc101.rstcreate mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644drivers/baseband/acc100/rte_acc101_pmd.h(quoted diff) +0
-0
b/doc/guides/bbdevs/acc101.rstnew file mode 100644 index 0000000..46c310bdoc/guides/bbdevs/acc101.rst new file +1
-0@@ -0,0 +1,237 @@ +.. SPDX-License-Identifier: BSD-3-Clausedoc/guides/bbdevs/acc101.rst line 11
Quoted 10 lines
doc/guides/bbdevs/acc101.rst new file +10
-0+ Copyright(c) 2020 Intel Corporation + +Intel(R) ACC101 5G/4G FEC Poll Mode Driver +========================================== + +The BBDEV ACC101 5G/4G FEC poll mode driver (PMD) supports an +implementation of a VRAN FEC wireless acceleration function. +This device is also known as Mount Cirrus. +This is a follow-up to Mount Bryce (ACC100) and includes fixes, +improved feature set for error scenarios and performance capacity increase.includes fixes, better error handling and increased performance.
Quoted 8 lines
A quick look at
acc100.rstand the bulk ofacc101.rstlooks the same.Consider a user of the acc100 is upgrading to acc101, they will
want to know what is the same and what has changed and test accordingly.
These two documents should be combined.
Well in term of documentation, for the users it helps to be able to follow steps as they are for a given variant. As opposed to have to have multiple options through the document when using ACC100 vs ACC101. Except if they are other objections, I would see this more useful for the user as is and less source of errors.
Quoted 287 lines
Quoted 11 lines
doc/guides/bbdevs/acc101.rst new file +11
-0+ +Features +-------- + +ACC101 5G/4G FEC PMD supports the following features: + +- LDPC Encode in the DL (5GNR) +- LDPC Decode in the UL (5GNR) +- Turbo Encode in the DL (4G) +- Turbo Decode in the UL (4G) +- 16 VFs per PF (physical device)doc/guides/bbdevs/acc101.rst
Quoted 10 lines
doc/guides/bbdevs/acc101.rst new file +10
-0+- Maximum of 128 queues per VF +- PCIe Gen-3 x16 Interface +- MSI +- SR-IOV + +ACC101 5G/4G FEC PMD supports the following BBDEV capabilities: + +* For the LDPC encode operation: + - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_LDPC_RATE_MATCH`` : if set then do not do Rate Matchbypass
doc/guides/bbdevs/acc101.rst
Quoted 6 lines
doc/guides/bbdevs/acc101.rst new file +6
-0+ - ``RTE_BBDEV_LDPC_INTERLEAVER_BYPASS`` : if set then bypass +interleaver + +* For the LDPC decode operation: + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` : check CRC24B from CB(s) + - ``RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE`` : disable earlytermination
doc/guides/bbdevs/acc101.rst line 39
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` : drops CRC24B bitsappended while decoding
doc/guides/bbdevs/acc101.rst line 40
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE`` : provides an input forHARQ combining
doc/guides/bbdevs/acc101.rst line 41
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE`` : provides an inputfor HARQ combining
doc/guides/bbdevs/acc101.rst line 42
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE`` : HARQmemory input is internal
doc/guides/bbdevs/acc101.rst line 43
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE`` : HARQmemory output is internal
doc/guides/bbdevs/acc101.rst line 44
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK`` :loopback data to/from HARQ memory
doc/guides/bbdevs/acc101.rst line 45
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS`` : HARQmemory includes the fillers bits
doc/guides/bbdevs/acc101.rst line 46
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_LDPC_DEC_SCATTER_GATHER`` : supports scatter-gatherfor input/output data
doc/guides/bbdevs/acc101.rst line 47
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION`` : supportscompression of the HARQ input/output
doc/guides/bbdevs/acc101.rst line 52
Quoted 5 lines
doc/guides/bbdevs/acc101.rst new file +5
-0+ - ``RTE_BBDEV_LDPC_LLR_COMPRESSION`` : supports LLR input +compression + +* For the turbo encode operation: + - ``RTE_BBDEV_TURBO_CRC_24B_ATTACH`` : set to attach CRC24B toCB(s)
doc/guides/bbdevs/acc101.rst line 53
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_TURBO_RATE_MATCH`` : if set then do not do Rate Matchbypass
doc/guides/bbdevs/acc101.rst line 54
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_TURBO_ENC_INTERRUPTS`` : set for encoder dequeueinterrupts
doc/guides/bbdevs/acc101.rst
Quoted 7 lines
doc/guides/bbdevs/acc101.rst new file +7
-0+ - ``RTE_BBDEV_TURBO_RV_INDEX_BYPASS`` : set to bypass RV index + - ``RTE_BBDEV_TURBO_ENC_SCATTER_GATHER`` : supports +scatter-gather for input/output data + +* For the turbo decode operation: + - ``RTE_BBDEV_TURBO_CRC_TYPE_24B`` : check CRC24B from CB(s) + - ``RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE`` : perform subblockde-interleave
doc/guides/bbdevs/acc101.rst line 62
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_TURBO_DEC_INTERRUPTS`` : set for decoder dequeueinterrupts
doc/guides/bbdevs/acc101.rst line 63
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN`` : set if negative LLR encoderi/p is supported
doc/guides/bbdevs/acc101.rst line 64
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN`` : set if positive LLR encoderi/p is supported
doc/guides/bbdevs/acc101.rst line 65
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP`` : keep CRC24B bitsappended while decoding
doc/guides/bbdevs/acc101.rst line 66
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_TURBO_DEC_CRC_24B_DROP`` : option to drop the codeblock CRC after decoding
doc/guides/bbdevs/acc101.rst line 67
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_TURBO_EARLY_TERMINATION`` : set early terminationfeature
doc/guides/bbdevs/acc101.rst line 68
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ - ``RTE_BBDEV_TURBO_DEC_SCATTER_GATHER`` : supports scatter-gatherfor input/output data
doc/guides/bbdevs/acc101.rst
Quoted 7 lines
doc/guides/bbdevs/acc101.rst new file +7
-0+ - ``RTE_BBDEV_TURBO_HALF_ITERATION_EVEN`` : set half iteration +granularity + +Installation +------------ + +Section 3 of the DPDK manual provides instructions on installing andcompiling DPDK.
doc/guides/bbdevs/acc101.rst line 77
Quoted 2 lines
doc/guides/bbdevs/acc101.rst new file +2
-0+ +DPDK requires hugepages to be configured as detailed in section 2 of theDPDK manual.
doc/guides/bbdevs/acc101.rst line 79
Quoted 2 lines
doc/guides/bbdevs/acc101.rst new file +2
-0+The bbdev test application has been tested with a configuration 40 x +1GB hugepages. The hugepage configuration of a server may be examinedusing:
doc/guides/bbdevs/acc101.rst
Quoted 10 lines
doc/guides/bbdevs/acc101.rst new file +10
-0+ +.. code-block:: console + + grep Huge* /proc/meminfo + + +Initialization +-------------- + +When the device first powers up, its PCI Physical Functions (PF) can be listedthrough this command:
doc/guides/bbdevs/acc101.rst
Quoted 8 lines
doc/guides/bbdevs/acc101.rst new file +8
-0+ +.. code-block:: console + + sudo lspci -vd8086:57c4 + +The physical and virtual functions are compatible with Linux UIO drivers: +``vfio`` and ``igb_uio``. However, in order to work the ACC101 5G/4G +FEC device first needs to be bound to one of these linux drivers throughDPDK.
doc/guides/bbdevs/acc101.rst
Quoted 7 lines
doc/guides/bbdevs/acc101.rst new file +7
-0+ + +Bind PF UIO driver(s) +~~~~~~~~~~~~~~~~~~~~~ + +Install the DPDK igb_uio driver, bind it with the PF PCI device ID +and use ``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDKUIO driver.
doc/guides/bbdevs/acc101.rst line 106
Quoted 2 lines
doc/guides/bbdevs/acc101.rst new file +2
-0+ +The igb_uio driver may be bound to the PF PCI device using one of twomethods:
Quoted 16 lines
doc/guides/bbdevs/acc101.rst new file +16
-0+ + +1. PCI functions (physical or virtual, depending on the use case) can +be bound to the UIO driver by repeating this command for every function. + +.. code-block:: console + + cd <dpdk-top-level-directory> + insmod ./build/kmod/igb_uio.ko + echo "8086 57c4" > /sys/bus/pci/drivers/igb_uio/new_id + lspci -vd8086:57c4 + + +2. Another way to bind PF with DPDK UIO driver is by using the +``dpdk-devbind.py`` tool +doc/guides/bbdevs/acc101.rst
Quoted 10 lines
doc/guides/bbdevs/acc101.rst new file +10
-0+.. code-block:: console + + cd <dpdk-top-level-directory> + ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0 + +where the PCI device ID (example: 0000:06:00.0) is obtained using +lspci -vd8086:57c4 + + +In a similar way the ACC101 5G/4G FEC PF may be bound with vfio-pci as anyPCIe device.
doc/guides/bbdevs/acc101.rst
Quoted 9 lines
doc/guides/bbdevs/acc101.rst new file +9
-0+ + +Enable Virtual Functions +~~~~~~~~~~~~~~~~~~~~~~~~ + +Now, it should be visible in the printouts that PCI PF is under +igb_uio control "``Kernel driver in use: igb_uio``" + +To show the number of available VFs on the device, read ``sriov_totalvfs``file..
Quoted 25 lines
doc/guides/bbdevs/acc101.rst new file +25
-0+ +.. code-block:: console + + cat /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_totalvfs + + where 0000\:<b>\:<d>.<f> is the PCI device ID + + +To enable VFs via igb_uio, echo the number of virtual functions +intended to enable to ``max_vfs`` file.. + +.. code-block:: console + + echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/max_vfs + + +Afterwards, all VFs must be bound to appropriate UIO drivers as +required, same way it was done with the physical function previously. + +Enabling SR-IOV via vfio driver is pretty much the same, except that +the file name is different: + +.. code-block:: console + + echo <num-of-vfs> >doc/guides/bbdevs/acc101.rst
Quoted 10 lines
doc/guides/bbdevs/acc101.rst new file +10
-0+ /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_numvfs + + +Configure the VFs through PF +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The PCI virtual functions must be configured before working or +getting assigned to VMs/Containers. The configuration involves +allocating the number of hardware queues, priorities, load balance, +bandwidth and other settings necessary for the device to perform FECfunctions.
doc/guides/bbdevs/acc101.rst line 180
Quoted 4 lines
doc/guides/bbdevs/acc101.rst new file +4
-0+ +This configuration needs to be executed at least once after reboot or +PCI FLR and can be achieved by using the function +``acc101_configure()``, which sets up the parameters defined in``acc100_conf`` structure.
doc/guides/bbdevs/acc101.rst
Quoted 8 lines
doc/guides/bbdevs/acc101.rst new file +8
-0+ +Test Application +---------------- + +BBDEV provides a test application, ``test-bbdev.py`` and range of +test data for testing the functionality of ACC101 5G/4G FEC encode +and decode, depending on the device's capabilities. The test +application is located under app->test-bbdev folder and has the followingoptions:
doc/guides/bbdevs/acc101.rst
Quoted 8 lines
doc/guides/bbdevs/acc101.rst new file +8
-0+ +.. code-block:: console + + "-p", "--testapp-path": specifies path to the bbdev test app. + "-e", "--eal-params" : EAL arguments which are passed to the test app. + "-t", "--timeout" : Timeout in seconds (default=300). + "-c", "--test-cases" : Defines test cases to run. Run all if not specified. + "-v", "--test-vector" : Test vector path (default=dpdk_path+/app/test-bbdev/test_vectors/bbdev_null.data).
doc/guides/bbdevs/acc101.rst line 197
Quoted 1 line
doc/guides/bbdevs/acc101.rst new file +1
-0+ "-n", "--num-ops" : Number of operations to process on device(default=32).
Quoted 9 lines
doc/guides/bbdevs/acc101.rst new file +9
-0+ "-b", "--burst-size" : Operations enqueue/dequeue burst size (default=32). + "-s", "--snr" : SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-l", "--num-lcores" : Number of lcores to run (default=16). + "-i", "--init-device" : Initialise PF device with default values. + + +To execute the test application tool using simple decode or encode +data, type one of the following:doc/guides/bbdevs/acc101.rst
Quoted 10 lines
doc/guides/bbdevs/acc101.rst new file +10
-0+ +.. code-block:: console + + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_enc_default.data + + +The test application ``test-bbdev.py``, supports the ability to +configure the PF device with a default set of values, if the "-i" or +"- -init-device" option is included. The default values are defined in
test_bbdev_perf.c.doc/guides/bbdevs/acc101.rst
Quoted 9 lines
doc/guides/bbdevs/acc101.rst new file +9
-0+ + +Test Vectors +~~~~~~~~~~~~ + +In addition to the simple LDPC decoder and LDPC encoder tests, bbdev +also provides a range of additional tests under the test_vectors +folder, which may be useful. The results of these tests will depend +on the ACC101 5G/4G FEC capabilities which may cause some testcases to beskipped, but no failure should be reported.
doc/guides/bbdevs/acc101.rst
Quoted 6 lines
doc/guides/bbdevs/acc101.rst new file +6
-0+ + +Alternate Baseband Device configuration tool +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +On top of the embedded configuration feature supported in test-bbdev using"- -init-device"
Quoted 28 lines
doc/guides/bbdevs/acc101.rst new file +14
-0+option mentioned above, there is also a tool available to perform +that device configuration using a companion application. +The ``pf_bb_config`` application notably enables then to run +bbdev-test from the VF and not only limited to the PF as captured above. + +See for more details: https://github.com/intel/pf-bb-config + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_4vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -l 1 -v + ./ldpc_dec_default.datadoc/guides/bbdevs/features/acc101.ini new file +6
-0@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features]
Quoted 8 lines
doc/guides/bbdevs/features/acc101.ini line 13
Quoted 7 lines
doc/guides/bbdevs/features/acc101.ini new file +7
-0+Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = YThis is the same as acc100.ini, why do we need 2 ?
This is a different product, needs to be consistent.
Quoted 319 lines
Quoted 32 lines
doc/guides/bbdevs/index.rst +1
-0@@ -14,4 +14,5 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + acc101 la12xxdoc/guides/rel_notes/release_22_07.rst +4
-0@@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device (Mount Cirrus). + * See the :doc:`../bbdevs/acc101` for more details. Removed Items -------------drivers/baseband/acc100/rte_acc100_pmd.c +0
-0drivers/baseband/acc100/rte_acc100_pmd.c line 28
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0@@ -22,6 +22,7 @@#include <rte_bbdev.h> #include <rte_bbdev_pmd.h> #include "rte_acc100_pmd.h" +#include "rte_acc101_pmd.h" #ifdef RTE_LIBRTE_BBDEV_DEBUG RTE_LOG_REGISTER_DEFAULT(acc100_logtype, DEBUG); @@ -1286,6+1287,12
Quoted 16 lines
@@
RTE_BBDEV_TURBO_HALF_ITERATION_EVEN);
}drivers/baseband/acc100/rte_acc100_pmd.c +5
-0+static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); } +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(const struct rte_bbdev_dec_op *op, struct
acc100_fcw_ld*fcw, @@ -1412,6 +1419,139 @@
}
}drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-0+/* Convert offset to harq index for harq_layout structure */ static +inline uint32_t hq_index (uint32_t offset) { +return (offset >>ACC100_HARQ_OFFSET_SHIFT ) & +ACC100_HARQ_OFFSET_MASK ; } + +/* Fill in a frame control word for LDPC decoding for ACC101 */ +static inline void acc101_fcw_ld_fill (struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout)This looks extremely similar to the acc100*, why isn't this combined ?
Quoted 16 lines
drivers/baseband/acc100/rte_acc100_pmd.c +16
-0+{ +uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset; +uint32_t harq_index; +uint32_t l; + + fcw->qm = op->ldpc_dec.q_m; + fcw->nfiller = op->ldpc_dec.n_filler; + fcw->BG = (op->ldpc_dec.basegraph -1 ); + fcw->Zc = op->ldpc_dec.z_c; + fcw->ncb = op->ldpc_dec.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph, + op->ldpc_dec.rv_index); +if (op->ldpc_dec.code_block_mode ==RTE_BBDEV_CODE_BLOCK ) + fcw->rm_e = op->ldpc_dec.cb_params.e; +else + fcw->rm_e = (op->ldpc_dec.tb_params.r <drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ op->ldpc_dec.tb_params.cab) ? + op->ldpc_dec.tb_params.ea : + op->ldpc_dec.tb_params.eb; + +if (unlikely (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ) && + (op->ldpc_dec.harq_combined_input.length ==0 ))) { +rte_bbdev_log (WARNING ,"Null HARQ input size provided" ); +/* Disable HARQ input in that case to carry forward */ + op->ldpc_dec.op_flags ^=
RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE;Quoted 79 lines
drivers/baseband/acc100/rte_acc100_pmd.c +28
-0+ } + + fcw->hcin_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ); + fcw->hcout_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE ); + fcw->crc_select =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK ); + fcw->bypass_dec =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DECODE_BYPASS ); + fcw->bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS ); +if (op->ldpc_dec.q_m ==1 ) { + fcw->bypass_intlv =1 ; + fcw->qm =2 ; + } + fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_LLR_COMPRESSION ); + harq_index =hq_index (op->ldpc_dec.harq_combined_output.offset); +if (fcw->hcin_en >0 ) { + harq_in_length = op->ldpc_dec.harq_combined_input.length; +if (fcw->hcin_decomp_mode >0 ) + harq_in_length = harq_in_length *8 /6 ; + harq_in_length = RTE_MIN(harq_in_length, op-ldpc_dec.n_cb
drivers/baseband/acc100/rte_acc100_pmd.c +50
-0+ - op->ldpc_dec.n_filler); +/* Alignment on next 64B - Already enforced from HC output */ + harq_in_length =RTE_ALIGN_FLOOR (harq_in_length,64 ); + fcw->hcin_size0 = harq_in_length; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + }else { + fcw->hcin_size0 =0 ; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + } + + fcw->itmax = op->ldpc_dec.iter_max; + fcw->itstop =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->synd_precoder = fcw->itstop; +/* +* These are all implicitly set +* fcw->synd_post = 0; +* fcw->so_en = 0; +* fcw->so_bypass_rm = 0; +* fcw->so_bypass_intlv = 0; +* fcw->dec_convllr = 0; +* fcw->hcout_convllr = 0; +* fcw->hcout_size1 = 0; +* fcw->so_it = 0; +* fcw->hcout_offset = 0; +* fcw->negstop_th = 0; +* fcw->negstop_it = 0; +* fcw->negstop_en = 0; +* fcw->gain_i = 1; +* fcw->gain_h = 1; +*/ +if (fcw->hcout_en >0 ) { + parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) + * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + ncb_p = fcw->ncb - op->ldpc_dec.n_filler; + l =RTE_MIN (k0_p + fcw->rm_e,INT16_MAX ); + harq_out_length = (uint16_t ) fcw->hcin_size0; + harq_out_length =RTE_MAX (harq_out_length, l); +/* Cannot exceed the pruned Ncb circular buffer */ + harq_out_length =RTE_MIN (harq_out_length, ncb_p); +/* Alignment on next 64B */ + harq_out_length =RTE_ALIGN_CEIL (harq_out_length,64 ); + fcw->hcout_size0 = harq_out_length; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + harq_layout[harq_index].offset = fcw->hcout_offset;drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ harq_layout[harq_index].size0 = fcw->hcout_size0; + }else { + fcw->hcout_size0 =0 ; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + } +} + +static inline void +acc10x_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld*fcw,
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+union acc100_harq_layout_data *harq_layout, struct
acc100_queue*q)drivers/baseband/acc100/rte_acc100_pmd.c line 1548
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+{ +if (is_acc100 (q))consider having a function table in the private data so the call can be made without this if-check
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +5
-0+return acc100_fcw_ld_fill (op, fcw, harq_layout); + else + return acc101_fcw_ld_fill(op, fcw, harq_layout); } + +/** * Fills descriptor with data pointers of one block type. * drivers/baseband/acc100/rte_acc100_pmd.c line 3106
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-1@@ -2960,7 +3100,7 @@struct acc100_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; -acc100_fcw_ld_fill (op, fcw, harq_layout); +acc10x_fcw_ld_fill (op, fcw, harq_layout, q);/* Special handling when overusing mbuf */ if (fcw->rm_e < ACC100_MAX_E_MBUF) @@ -3027,7 +3167,7@@
Quoted 6 lines
desc = q->ring_addr + desc_idx; uint64_t fcw_offset = (desc_idx << 8) + ACC100_DESC_FCW_OFFSET; union acc100_harq_layout_data *harq_layout = q->d->harq_layout;drivers/baseband/acc100/rte_acc100_pmd.c +1
-1-acc100_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); +acc10x_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout, q);drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-4input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data; @@ -4139,9 +4279,17 @@ dev->dequeue_ldpc_enc_ops = acc100_dequeue_ldpc_enc; dev->dequeue_ldpc_dec_ops = acc100_dequeue_ldpc_dec; - ((struct acc100_device *) dev->data->dev_private)->pf_device = - !strcmp (drv->driver.name, -RTE_STR (ACC100PF_DRIVER_NAME )); + if ((!strcmp(drv->driver.name, RTE_STR(ACC100PF_DRIVER_NAME)))||
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ (!strcmp(drv->driver.name,
RTE_STR(ACC100VF_DRIVER_NAME)))) {drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)->pf_device=
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ !strcmp(drv->driver.name,
RTE_STR(ACC100PF_DRIVER_NAME));drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)-
device_variant=ACC100_VARIANT;drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ }else { + ((struct acc100_device *) dev->data->dev_private)->pf_device=
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ !strcmp(drv->driver.name,
RTE_STR(ACC101PF_DRIVER_NAME));drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)-
device_variant=ACC101_VARIANT;drivers/baseband/acc100/rte_acc100_pmd.c +2
-0@@ -4251,6 +4399,42 @@ static int acc100_pci_remove(structLines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
rte_pci_device*pci_dev)drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
acc100_pci_vf_driver);71 lines not shown · raw message
Quoted 7 lines
7 lines not shown · raw message
87 lines not shown · raw message
Parts of this message are not shown here. View the raw message.
Re: [PATCH v2 1/5] baseband/acc100: introduce PMD for ACC101
09/05/2022 23:23, Chautru, Nicolas:
Quoted 9 lines
From: Tom Rix <[email protected]>
Quoted 4 lines
A quick look at
acc100.rstand the bulk ofacc101.rstlooks the same. Consider a user of the acc100 is upgrading to acc101, they will want to know what is the same and what has changed and test accordingly. These two documents should be combined.Well in term of documentation, for the users it helps to be able to follow steps as they are for a given variant. As opposed to have to have multiple options through the document when using ACC100 vs ACC101. Except if they are other objections, I would see this more useful for the user as is and less source of errors.
I agree with Tom, it is more useful to highlight the differences with some notes and keep a common tutorial.
Re: [PATCH v2 1/5] baseband/acc100: introduce PMD for ACC101
In reply to Chautru, NicolasQuoted 59 lines · Nicolas
Hi Tom,
Quoted 57 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Sunday, May 8, 2022 6:03 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 1/5] baseband/acc100: introduce PMD for ACC101This is a good start reusing code, but I think it needs to do more reuse.
These cards should be very close and likely represent a family of cards.
Quoted 6 lines · Nicolas Chautru
Support for ACC101 as a derivative of ACC100.
Reusing existing code when possible.Signed-off-by Nicolas Chautru <[email protected]>--- doc/guides/bbdevs/acc101.rst | 237+++++++++++++++++++++++++++++++
Quoted 4 lines
doc/guides/bbdevs/features/acc101.ini | 13 ++ doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_pmd.c | 194++++++++++++++++++++++++-
Quoted 14 lines
drivers/baseband/acc100/rte_acc100_pmd.h | 6 + drivers/baseband/acc100/rte_acc101_pmd.h | 61 ++++++++ 7 files changed, 511 insertions(+), 5 deletions(-)create mode 100644
doc/guides/bbdevs/acc101.rstcreate mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644drivers/baseband/acc100/rte_acc101_pmd.h(quoted diff) +0
-0
b/doc/guides/bbdevs/acc101.rstnew file mode 100644 index 0000000..46c310bdoc/guides/bbdevs/acc101.rst new file +1
-0@@ -0,0 +1,237 @@ +.. SPDX-License-Identifier: BSD-3-Clausedoc/guides/bbdevs/acc101.rst line 11
Quoted 10 lines
doc/guides/bbdevs/acc101.rst new file +10
-0+ Copyright(c) 2020 Intel Corporation + +Intel(R) ACC101 5G/4G FEC Poll Mode Driver +========================================== + +The BBDEV ACC101 5G/4G FEC poll mode driver (PMD) supports an +implementation of a VRAN FEC wireless acceleration function. +This device is also known as Mount Cirrus. +This is a follow-up to Mount Bryce (ACC100) and includes fixes, +improved feature set for error scenarios and performance capacity increase.includes fixes, better error handling and increased performance.
A quick look at
acc100.rstand the bulk ofacc101.rstlooks the same.Consider a user of the acc100 is upgrading to acc101, they will
Quoted 8 lines
Quoted 4 lines
want to know what is the same and what has changed and test accordingly.
These two documents should be combined.
Well in term of documentation, for the users it helps to be able to follow steps as they are for a given variant. As opposed to have to have multiple options through the document when using ACC100 vs ACC101. Except if they are other objections, I would see this more useful for the user as is and less source of errors.
My perspective is having existing acc100 users that are upgrading and/or having to support both acc100 and acc101
for a very long time. In the first case users of existing acc100 users will want to know only the parts that have changed.
In the second, later changes that are common to both acc100 and acc101 and later accXXX will be have to fixed in
multiple places. As myself or someone at Red Hat will be on the hook for both, I would prefer if the refactoring
of the common parts acc100,acc101 were in good shape over the expediency of having acc101 sooner.
Quoted 23 lines
Quoted 15 lines
Quoted 15 lines
doc/guides/bbdevs/acc101.rst new file +4
-0+ +Features +-------- +index 0000000..0e2c21a
doc/guides/bbdevs/features/acc101.ini new file +6
-0@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features]Quoted 8 lines
doc/guides/bbdevs/features/acc101.ini line 13
Quoted 7 lines
doc/guides/bbdevs/features/acc101.ini new file +7
-0+Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = YThis is the same as acc100.ini, why do we need 2 ?
Quoted 1 line
This is a different product, needs to be consistent.
ok
Quoted 57 lines
Quoted 57 lines
Quoted 33 lines
doc/guides/bbdevs/index.rst +1
-0@@ -14,4 +14,5 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + acc101 la12xxdoc/guides/rel_notes/release_22_07.rst +4
-0@@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device (Mount Cirrus). + * See the :doc:`../bbdevs/acc101` for more details. Removed Items -------------drivers/baseband/acc100/rte_acc100_pmd.c +0
-0drivers/baseband/acc100/rte_acc100_pmd.c line 28
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0@@ -22,6 +22,7 @@#include <rte_bbdev.h> #include <rte_bbdev_pmd.h> #include "rte_acc100_pmd.h" +#include "rte_acc101_pmd.h" #ifdef RTE_LIBRTE_BBDEV_DEBUG RTE_LOG_REGISTER_DEFAULT(acc100_logtype, DEBUG); @@ -1286,6+1287,12
Quoted 16 lines
@@
RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); }drivers/baseband/acc100/rte_acc100_pmd.c +5
-0+static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); } +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(const struct rte_bbdev_dec_op *op, struct
acc100_fcw_ld*fcw, @@ -1412,6 +1419,139 @@
}
}
Quoted 10 lines
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-0+/* Convert offset to harq index for harq_layout structure */ static +inline uint32_t hq_index (uint32_t offset) { +return (offset >>ACC100_HARQ_OFFSET_SHIFT ) & +ACC100_HARQ_OFFSET_MASK ; } + +/* Fill in a frame control word for LDPC decoding for ACC101 */ +static inline void acc101_fcw_ld_fill (struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout)This looks extremely similar to the acc100*, why isn't this combined ?
Please answer.
Functions that look similar should be combined.
This gets to doing more to refactor the parts that are common between acc100 and acc101.
Quoted 117 lines
Quoted 117 lines
Quoted 16 lines
drivers/baseband/acc100/rte_acc100_pmd.c +16
-0+{ +uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset; +uint32_t harq_index; +uint32_t l; + + fcw->qm = op->ldpc_dec.q_m; + fcw->nfiller = op->ldpc_dec.n_filler; + fcw->BG = (op->ldpc_dec.basegraph -1 ); + fcw->Zc = op->ldpc_dec.z_c; + fcw->ncb = op->ldpc_dec.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph, + op->ldpc_dec.rv_index); +if (op->ldpc_dec.code_block_mode ==RTE_BBDEV_CODE_BLOCK ) + fcw->rm_e = op->ldpc_dec.cb_params.e; +else + fcw->rm_e = (op->ldpc_dec.tb_params.r <drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ op->ldpc_dec.tb_params.cab) ? + op->ldpc_dec.tb_params.ea : + op->ldpc_dec.tb_params.eb; + +if (unlikely (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ) && + (op->ldpc_dec.harq_combined_input.length ==0 ))) { +rte_bbdev_log (WARNING ,"Null HARQ input size provided" ); +/* Disable HARQ input in that case to carry forward */ + op->ldpc_dec.op_flags ^=
RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE;Quoted 79 lines
drivers/baseband/acc100/rte_acc100_pmd.c +28
-0+ } + + fcw->hcin_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ); + fcw->hcout_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE ); + fcw->crc_select =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK ); + fcw->bypass_dec =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DECODE_BYPASS ); + fcw->bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS ); +if (op->ldpc_dec.q_m ==1 ) { + fcw->bypass_intlv =1 ; + fcw->qm =2 ; + } + fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_LLR_COMPRESSION ); + harq_index =hq_index (op->ldpc_dec.harq_combined_output.offset); +if (fcw->hcin_en >0 ) { + harq_in_length = op->ldpc_dec.harq_combined_input.length; +if (fcw->hcin_decomp_mode >0 ) + harq_in_length = harq_in_length *8 /6 ; + harq_in_length = RTE_MIN(harq_in_length, op-ldpc_dec.n_cb
drivers/baseband/acc100/rte_acc100_pmd.c +50
-0+ - op->ldpc_dec.n_filler); +/* Alignment on next 64B - Already enforced from HC output */ + harq_in_length =RTE_ALIGN_FLOOR (harq_in_length,64 ); + fcw->hcin_size0 = harq_in_length; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + }else { + fcw->hcin_size0 =0 ; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + } + + fcw->itmax = op->ldpc_dec.iter_max; + fcw->itstop =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->synd_precoder = fcw->itstop; +/* +* These are all implicitly set +* fcw->synd_post = 0; +* fcw->so_en = 0; +* fcw->so_bypass_rm = 0; +* fcw->so_bypass_intlv = 0; +* fcw->dec_convllr = 0; +* fcw->hcout_convllr = 0; +* fcw->hcout_size1 = 0; +* fcw->so_it = 0; +* fcw->hcout_offset = 0; +* fcw->negstop_th = 0; +* fcw->negstop_it = 0; +* fcw->negstop_en = 0; +* fcw->gain_i = 1; +* fcw->gain_h = 1; +*/ +if (fcw->hcout_en >0 ) { + parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) + * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + ncb_p = fcw->ncb - op->ldpc_dec.n_filler; + l =RTE_MIN (k0_p + fcw->rm_e,INT16_MAX ); + harq_out_length = (uint16_t ) fcw->hcin_size0; + harq_out_length =RTE_MAX (harq_out_length, l); +/* Cannot exceed the pruned Ncb circular buffer */ + harq_out_length =RTE_MIN (harq_out_length, ncb_p); +/* Alignment on next 64B */ + harq_out_length =RTE_ALIGN_CEIL (harq_out_length,64 ); + fcw->hcout_size0 = harq_out_length; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + harq_layout[harq_index].offset = fcw->hcout_offset;drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ harq_layout[harq_index].size0 = fcw->hcout_size0; + }else { + fcw->hcout_size0 =0 ; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + } +} + +static inline void +acc10x_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld*fcw,
Quoted 6 lines
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+union acc100_harq_layout_data *harq_layout, struct
acc100_queue*q)drivers/baseband/acc100/rte_acc100_pmd.c line 1548
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+{ +if (is_acc100 (q))consider having a function table in the private data so the call can be made without this if-check
Please answer.
Quoted 130 lines
Quoted 130 lines
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +5
-0+return acc100_fcw_ld_fill (op, fcw, harq_layout); + else + return acc101_fcw_ld_fill(op, fcw, harq_layout); } + +/** * Fills descriptor with data pointers of one block type. * drivers/baseband/acc100/rte_acc100_pmd.c line 3106
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-1@@ -2960,7 +3100,7 @@struct acc100_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; -acc100_fcw_ld_fill (op, fcw, harq_layout); +acc10x_fcw_ld_fill (op, fcw, harq_layout, q);/* Special handling when overusing mbuf */ if (fcw->rm_e < ACC100_MAX_E_MBUF) @@ -3027,7 +3167,7@@
Quoted 6 lines
desc = q->ring_addr + desc_idx; uint64_t fcw_offset = (desc_idx << 8) + ACC100_DESC_FCW_OFFSET; union acc100_harq_layout_data *harq_layout = q->d->harq_layout;drivers/baseband/acc100/rte_acc100_pmd.c +1
-1-acc100_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); +acc10x_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout, q);drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-4input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data; @@ -4139,9 +4279,17 @@ dev->dequeue_ldpc_enc_ops = acc100_dequeue_ldpc_enc; dev->dequeue_ldpc_dec_ops = acc100_dequeue_ldpc_dec; - ((struct acc100_device *) dev->data->dev_private)->pf_device = - !strcmp (drv->driver.name, -RTE_STR (ACC100PF_DRIVER_NAME )); + if ((!strcmp(drv->driver.name, RTE_STR(ACC100PF_DRIVER_NAME)))||
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ (!strcmp(drv->driver.name,
RTE_STR(ACC100VF_DRIVER_NAME)))) {drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)->pf_device=
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ !strcmp(drv->driver.name,
RTE_STR(ACC100PF_DRIVER_NAME));drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)-
device_variant=ACC100_VARIANT;drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ }else { + ((struct acc100_device *) dev->data->dev_private)->pf_device=
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ !strcmp(drv->driver.name,
RTE_STR(ACC101PF_DRIVER_NAME));drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)-
device_variant=ACC101_VARIANT;drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ } + ((struct acc100_device *) dev->data->dev_private)->mmio_base = pci_dev->mem_resource[0 ].addr;@@ -4251,6 +4399,42 @@ static int acc100_pci_remove(struct
rte_pci_device*pci_dev)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4399
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0RTE_PMD_REGISTER_PCI(ACC100VF_DRIVER_NAME,
acc100_pci_vf_driver);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0RTE_PMD_REGISTER_PCI_TABLE (ACC100VF_DRIVER_NAME , pci_id_acc100_vf_map); +/* ACC101 PCI PF address map */ +static struct rte_pci_id pci_id_acc101_pf_map[] = { + { + RTE_PCI_DEVICE(RTE_ACC101_VENDOR_ID,
RTE_ACC101_PF_DEVICE_ID)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +8
-0+ }, + {.device_id = 0}, +}; + +/* ACC101 PCI VF address map */ +static struct rte_pci_id pci_id_acc101_vf_map[] = { + { + RTE_PCI_DEVICE(RTE_ACC101_VENDOR_ID,
RTE_ACC101_VF_DEVICE_ID)Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +8
-0+ }, + {.device_id = 0}, +}; + + +static struct rte_pci_driver acc101_pci_pf_driver = { + .probe = acc100_pci_probe, + .remove = acc100_pci_remove,drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ .id_table = pci_id_acc101_pf_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING }; + +static struct rte_pci_driver acc101_pci_vf_driver = { + .probe = acc100_pci_probe, + .remove = acc100_pci_remove, + .id_table = pci_id_acc101_vf_map, + .drv_flags =RTE_PCI_DRV_NEED_MAPPING }; + +RTE_PMD_REGISTER_PCI(ACC101PF_DRIVER_NAME,
acc101_pci_pf_driver);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4434
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+RTE_PMD_REGISTER_PCI_TABLE (ACC101PF_DRIVER_NAME , +pci_id_acc101_pf_map);RTE_PMD_REGISTER_PCI(ACC101VF_DRIVER_NAME,
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4440
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0+acc101_pci_vf_driver); +RTE_PMD_REGISTER_PCI_TABLE (ACC101VF_DRIVER_NAME , +pci_id_acc101_vf_map); +/* * Workaround implementation to fix the power on status of some 5GUL engines
Quoted 17 lines
* This requires DMA permission if ported outside DPDK diff --git
a/drivers/baseband/acc100/rte_acc100_pmd.hb/drivers/baseband/acc100/rte_acc100_pmd.h
index cbcece2..6438031 100644drivers/baseband/acc100/rte_acc100_pmd.h +3
-0@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vfdrivers/baseband/acc100/rte_acc100_pmd.h line 76
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.h +2
-0@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)
Quoted 8 lines
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.h struct acc100_device { · line 598
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.h +0
-0/* Number of Virtual Functions ACC100 supports */ @@ -590,6 +595,7@@ struct
acc100_device{
uint16_tq_assigned_bit_map[ACC100_NUM_QGRPS];
boolpf_device; /**< True if this is a PF ACC100 device */ bool configured; /**< True if this ACC100 device is configured */drivers/baseband/acc100/rte_acc100_pmd.h +1
-0+uint16_t device_variant;/**< Device variant */ this is not needed, check the pci id
That
device_variantis sent once during probing then we can reuse that flexibly through the code.
In the same way the pci id is set once.
Generally if there is a way to use existing data to figure something out, then use the existing data.
Special purpose data increases the size and complexity as well as destabilizing the api
Quoted 18 lines
Quoted 4 lines
Quoted 4 lines
};Quoted 8 lines
drivers/baseband/acc100/rte_acc101_pmd.h
Quoted 7 lines
/**drivers/baseband/acc100/rte_acc101_pmd.h new file +0
-0New files need license, copyrights.
Thanks!!
Quoted 1 line
This file looks very similar to
rte_acc100_pmd.hActually the configuration of the device differs and could diverge further in the future. This is limited to the part that would be specific to the device configuration. Already kept to extremely reduced set. Doing it more would be artificial and source of possible errors.
Quoted 8 lines
Quoted 7 lines
The common parts should be in only one file, maybe a
rte_acc10x_pmd.hdrivers/baseband/acc100/rte_acc101_pmd.h line 3
Quoted 4 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +3
-0@@ -0,0 +1,61 @@ +/* ACC101 PF and VF driver names */ +#define ACC101PF_DRIVER_NAME intel_acc101_pf +#define ACC101VF_DRIVER_NAME intel_acc101_vfthis maybe changes to intel_acc10x_pr/vf ?
That string would be different from the 2 products on purpose even if under the bonnet we try to reuse code as much as possible.
These two devices could be run from the same driver.
I am used to linux kernel drivers that handle multiple devices with the same driver.
The reuse in the linux kernel is about 95%.
The reuse here is about 30%, it should be at least 80%
Tom
Quoted 60 lines
Quoted 60 lines
Tom
drivers/baseband/acc100/rte_acc101_pmd.h
Quoted 11 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +11
-0+ +/* ACC101 PCI vendor & device IDs */ +#define RTE_ACC101_VENDOR_ID (0x8086) +#define RTE_ACC101_PF_DEVICE_ID (0x57c4) +#define RTE_ACC101_VF_DEVICE_ID (0x57c5) + +/* Define as 1 to use only a single FEC engine */ #ifndef +RTE_ACC101_SINGLE_FEC #define RTE_ACC101_SINGLE_FEC 0 #endif + +/* Values used in writing to the registers */ +#define ACC101_REG_IRQ_EN_ALL 0x1FF83FF/* Enable all interrupts */
drivers/baseband/acc100/rte_acc101_pmd.h
Quoted 11 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +11
-0+ +/* Number of Virtual Functions ACC101 supports */ +#define ACC101_NUM_VFS 16 +#define ACC101_NUM_QGRPS 8 +#define ACC101_NUM_AQS 16 +/* All ACC101 Registers alignment are 32bits = 4B */ +#define ACC101_BYTES_IN_WORD 4 + +#define ACC101_GRP_ID_SHIFT 10/* Queue Index Hierarchy */ +#define ACC101_VF_ID_SHIFT 4/* Queue Index Hierarchy */ +#define ACC101_VF_OFFSET_QOS 16/* offset in Memory specific to QoS Mon */
Quoted 33 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +33
-0+#define ACC101_TMPL_PRI_0 0x03020100 +#define ACC101_TMPL_PRI_1 0x07060504 +#define ACC101_TMPL_PRI_2 0x0b0a0908 +#define ACC101_TMPL_PRI_3 0x0f0e0d0c +#define ACC101_WORDS_IN_ARAM_SIZE (128 * 1024 / 4) + +#define ACC101_NUM_TMPL 32 +/* Mapping of signals for the available engines */ +#define ACC101_SIG_UL_5G 0 +#define ACC101_SIG_UL_5G_LAST 8 +#define ACC101_SIG_DL_5G 13 +#define ACC101_SIG_DL_5G_LAST 15 +#define ACC101_SIG_UL_4G 16 +#define ACC101_SIG_UL_4G_LAST 19 +#define ACC101_SIG_DL_4G 27 +#define ACC101_SIG_DL_4G_LAST 31 +#define ACC101_NUM_ACCS 5 +#define ACC101_PF_VAL 2 + +/* ACC101 Configuration */ +#define ACC101_CFG_DMA_ERROR 0x3D7 +#define ACC101_CFG_AXI_CACHE 0x11 +#define ACC101_CFG_QMGR_HI_P 0x0F0F +#define ACC101_CFG_PCI_AXI 0xC003 +#define ACC101_CFG_PCI_BRIDGE 0x40006033 +#define ACC101_ENGINE_OFFSET 0x1000 +#define ACC101_LONG_WAIT 1000 +#define ACC101_GPEX_AXIMAP_NUM 17 +#define ACC101_CLOCK_GATING_EN 0x30000 +#define ACC101_DMA_INBOUND 0x104 +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF */ +#define ACC101_HARQ_DDR (512 * 1)
RE: [PATCH v2 1/5] baseband/acc100: introduce PMD for ACC101
Hi Tom,
I realize I had not replied to that one
Quoted 93 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Tuesday, May 10, 2022 4:56 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 1/5] baseband/acc100: introduce PMD for ACC101Quoted 10 lines · Nicolas
Hi Tom,
Quoted 8 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Sunday, May 8, 2022 6:03 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, MingshanQuoted 36 lines
Quoted 36 lines
[email protected]
Subject: Re: [PATCH v2 1/5] baseband/acc100: introduce PMD for ACC101This is a good start reusing code, but I think it needs to do more reuse.
These cards should be very close and likely represent a family of cards.
Quoted 6 lines · Nicolas Chautru
Support for ACC101 as a derivative of ACC100.
Reusing existing code when possible.Signed-off-by Nicolas Chautru <[email protected]>--- doc/guides/bbdevs/acc101.rst | 237+++++++++++++++++++++++++++++++
Quoted 4 lines
doc/guides/bbdevs/features/acc101.ini | 13 ++ doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_pmd.c | 194++++++++++++++++++++++++-
Quoted 16 lines
drivers/baseband/acc100/rte_acc100_pmd.h | 6 + drivers/baseband/acc100/rte_acc101_pmd.h | 61 ++++++++ 7 files changed, 511 insertions(+), 5 deletions(-)create mode 100644
doc/guides/bbdevs/acc101.rstcreate mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644drivers/baseband/acc100/rte_acc101_pmd.h(quoted diff) +0
-0
b/doc/guides/bbdevs/acc101.rstnew file mode 100644 index 0000000..46c310bdoc/guides/bbdevs/acc101.rst new file +3
-0@@ -0,0 +1,237 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2020 Intel Corporation +Quoted 8 lines
Quoted 8 lines
doc/guides/bbdevs/acc101.rst
Quoted 8 lines
doc/guides/bbdevs/acc101.rst new file +8
-0+Intel(R) ACC101 5G/4G FEC Poll Mode Driver +========================================== + +The BBDEV ACC101 5G/4G FEC poll mode driver (PMD) supports an +implementation of a VRAN FEC wireless acceleration function. +This device is also known as Mount Cirrus. +This is a follow-up to Mount Bryce (ACC100) and includes fixes, +improved feature set for error scenarios and performance capacityincrease.
Quoted 7 lines
Quoted 7 lines
includes fixes, better error handling and increased performance.
A quick look at
acc100.rstand the bulk ofacc101.rstlooks the same.Consider a user of the acc100 is upgrading to acc101, they will
want to know what is the same and what has changed and test
accordingly.
Quoted 4 lines
Quoted 3 lines
These two documents should be combined.
Well in term of documentation, for the users it helps to be able to follow
steps as they are for a given variant.
Quoted 1 line
As opposed to have to have multiple options through the document when
using ACC100 vs ACC101.
Quoted 1 line
Except if they are other objections, I would see this more useful for the
user as is and less source of errors.
Quoted 1 line
My perspective is having existing acc100 users that are upgrading and/or having to support both acc100 and acc101
for a very long time. In the first case users of existing acc100 users will want to know only the parts that have changed.
Quoted 8 lines
In the second, later changes that are common to both acc100 and acc101 and later accXXX will be have to fixed in
multiple places. As myself or someone at Red Hat will be on the hook for both, I would prefer if the refactoring
of the common parts acc100,acc101 were in good shape over the expediency of having acc101 sooner.
Will merge documentation
Quoted 94 lines
Quoted 24 lines
Quoted 16 lines
Quoted 16 lines
doc/guides/bbdevs/acc101.rst new file +4
-0+ +Features +-------- +index 0000000..0e2c21a
doc/guides/bbdevs/features/acc101.ini new file +6
-0@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features]Quoted 8 lines
doc/guides/bbdevs/features/acc101.ini line 13
Quoted 7 lines
doc/guides/bbdevs/features/acc101.ini new file +7
-0+Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = YThis is the same as acc100.ini, why do we need 2 ?
Quoted 1 line
This is a different product, needs to be consistent.
ok
Quoted 57 lines
Quoted 57 lines
Quoted 33 lines
(quoted diff) +0
-0
b/doc/guides/bbdevs/index.rstindex cedd706..e76883c 100644doc/guides/bbdevs/index.rst +1
-0@@ -14,4 +14,5 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + acc101 la12xxdoc/guides/rel_notes/release_22_07.rst +4
-0@@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device (Mount Cirrus). + * See the :doc:`../bbdevs/acc101` for more details. Removed Items -------------drivers/baseband/acc100/rte_acc100_pmd.c +0
-0drivers/baseband/acc100/rte_acc100_pmd.c line 28
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0@@ -22,6 +22,7 @@#include <rte_bbdev.h> #include <rte_bbdev_pmd.h> #include "rte_acc100_pmd.h" +#include "rte_acc101_pmd.h" #ifdef RTE_LIBRTE_BBDEV_DEBUG RTE_LOG_REGISTER_DEFAULT(acc100_logtype, DEBUG); @@ -1286,6+1287,12
Quoted 16 lines
@@
RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); }drivers/baseband/acc100/rte_acc100_pmd.c +5
-0+static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); } +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(const struct rte_bbdev_dec_op *op, struct
acc100_fcw_ld*fcw, @@ -1412,6 +1419,139 @@
}
}Quoted 10 lines
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-0+/* Convert offset to harq index for harq_layout structure */ static +inline uint32_t hq_index (uint32_t offset) { +return (offset >>ACC100_HARQ_OFFSET_SHIFT ) & +ACC100_HARQ_OFFSET_MASK ; } + +/* Fill in a frame control word for LDPC decoding for ACC101 */ +static inline void acc101_fcw_ld_fill (struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout)This looks extremely similar to the acc100*, why isn't this combined ?
Quoted 3 lines
Please answer.
Functions that look similar should be combined.
Most of the code is common except that very function since they are HW differences which would need to be managed differently including through future patches and/or maintenance. Hopefully you would agree that this difference is kept very small (one function).
Quoted 126 lines
This gets to doing more to refactor the parts that are common between acc100 and acc101.
Quoted 2 lines
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+{ + uint16_t harq_out_length, harq_in_length, ncb_p, k0_p,
parity_offset;Quoted 52 lines
Quoted 40 lines
Quoted 14 lines
drivers/baseband/acc100/rte_acc100_pmd.c +14
-0+uint32_t harq_index; +uint32_t l; + + fcw->qm = op->ldpc_dec.q_m; + fcw->nfiller = op->ldpc_dec.n_filler; + fcw->BG = (op->ldpc_dec.basegraph -1 ); + fcw->Zc = op->ldpc_dec.z_c; + fcw->ncb = op->ldpc_dec.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph, + op->ldpc_dec.rv_index); +if (op->ldpc_dec.code_block_mode ==RTE_BBDEV_CODE_BLOCK ) + fcw->rm_e = op->ldpc_dec.cb_params.e; +else + fcw->rm_e = (op->ldpc_dec.tb_params.r <drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ op->ldpc_dec.tb_params.cab) ? + op->ldpc_dec.tb_params.ea : + op->ldpc_dec.tb_params.eb; + +if (unlikely (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ) && + (op->ldpc_dec.harq_combined_input.length ==0 ))) { +rte_bbdev_log (WARNING ,"Null HARQ input size provided" ); +/* Disable HARQ input in that case to carry forward */ + op->ldpc_dec.op_flags ^=
RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE;Quoted 15 lines
drivers/baseband/acc100/rte_acc100_pmd.c +15
-0+ } + + fcw->hcin_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ); + fcw->hcout_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE ); + fcw->crc_select =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK ); + fcw->bypass_dec =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DECODE_BYPASS ); + fcw->bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS ); +if (op->ldpc_dec.q_m ==1 ) { + fcw->bypass_intlv =1 ; + fcw->qm =2 ;Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +8
-0+ } + fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_LLR_COMPRESSION ); + harq_index = hq_index(op-ldpc_dec.harq_combined_output.offset);
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+if (fcw->hcin_en >0 ) { + harq_in_length = op-ldpc_dec.harq_combined_input.length;
Quoted 6 lines
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+if (fcw->hcin_decomp_mode >0 ) + harq_in_length = harq_in_length *8 /6 ; + harq_in_length = RTE_MIN(harq_in_length, op-ldpc_dec.n_cb
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ - op->ldpc_dec.n_filler); +/* Alignment on next 64B - Already enforced from HC output */
Quoted 60 lines
Quoted 60 lines
Quoted 49 lines
drivers/baseband/acc100/rte_acc100_pmd.c +49
-0+ harq_in_length =RTE_ALIGN_FLOOR (harq_in_length,64 ); + fcw->hcin_size0 = harq_in_length; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + }else { + fcw->hcin_size0 =0 ; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + } + + fcw->itmax = op->ldpc_dec.iter_max; + fcw->itstop =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->synd_precoder = fcw->itstop; +/* +* These are all implicitly set +* fcw->synd_post = 0; +* fcw->so_en = 0; +* fcw->so_bypass_rm = 0; +* fcw->so_bypass_intlv = 0; +* fcw->dec_convllr = 0; +* fcw->hcout_convllr = 0; +* fcw->hcout_size1 = 0; +* fcw->so_it = 0; +* fcw->hcout_offset = 0; +* fcw->negstop_th = 0; +* fcw->negstop_it = 0; +* fcw->negstop_en = 0; +* fcw->gain_i = 1; +* fcw->gain_h = 1; +*/ +if (fcw->hcout_en >0 ) { + parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) + * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + ncb_p = fcw->ncb - op->ldpc_dec.n_filler; + l =RTE_MIN (k0_p + fcw->rm_e,INT16_MAX ); + harq_out_length = (uint16_t ) fcw->hcin_size0; + harq_out_length =RTE_MAX (harq_out_length, l); +/* Cannot exceed the pruned Ncb circular buffer */ + harq_out_length =RTE_MIN (harq_out_length, ncb_p); +/* Alignment on next 64B */ + harq_out_length =RTE_ALIGN_CEIL (harq_out_length,64 ); + fcw->hcout_size0 = harq_out_length; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + harq_layout[harq_index].offset = fcw->hcout_offset; + harq_layout[harq_index].size0 = fcw->hcout_size0;drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ }else { + fcw->hcout_size0 =0 ; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + } +} + +static inline void +acc10x_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct +acc100_fcw_ld*fcw,
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+union acc100_harq_layout_data *harq_layout, struct
acc100_queue*q)drivers/baseband/acc100/rte_acc100_pmd.c line 1548
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+{ +if (is_acc100 (q))consider having a function table in the private data so the call can be made without this if-check
Please answer.
Answered offline I believe. This was left for consideration but I tend to believe that both options are similar, this was slightly less convoluted.
Quoted 143 lines
Quoted 116 lines
Quoted 116 lines
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +5
-0+return acc100_fcw_ld_fill (op, fcw, harq_layout); + else + return acc101_fcw_ld_fill(op, fcw, harq_layout); } + +/** * Fills descriptor with data pointers of one block type. * drivers/baseband/acc100/rte_acc100_pmd.c line 3106
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-1@@ -2960,7 +3100,7 @@struct acc100_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; -acc100_fcw_ld_fill (op, fcw, harq_layout); +acc10x_fcw_ld_fill (op, fcw, harq_layout, q);/* Special handling when overusing mbuf */ if (fcw->rm_e < ACC100_MAX_E_MBUF) @@ -3027,7 +3167,7@@
Quoted 6 lines
desc = q->ring_addr + desc_idx; uint64_t fcw_offset = (desc_idx << 8) + ACC100_DESC_FCW_OFFSET; union acc100_harq_layout_data *harq_layout = q->d->harq_layout;drivers/baseband/acc100/rte_acc100_pmd.c +1
-1-acc100_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); +acc10x_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout, q);drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-4input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data; @@ -4139,9 +4279,17 @@ dev->dequeue_ldpc_enc_ops = acc100_dequeue_ldpc_enc; dev->dequeue_ldpc_dec_ops = acc100_dequeue_ldpc_dec; - ((struct acc100_device *) dev->data->dev_private)->pf_device = - !strcmp (drv->driver.name, -RTE_STR (ACC100PF_DRIVER_NAME )); + if ((!strcmp(drv->driver.name, RTE_STR(ACC100PF_DRIVER_NAME)))||
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ (!strcmp(drv->driver.name,
RTE_STR(ACC100VF_DRIVER_NAME)))) {drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)->pf_device=
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ !strcmp(drv->driver.name,
RTE_STR(ACC100PF_DRIVER_NAME));drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)-
device_variant=ACC100_VARIANT;drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ }else { + ((struct acc100_device *) dev->data->dev_private)->pf_device=
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ !strcmp(drv->driver.name,
RTE_STR(ACC101PF_DRIVER_NAME));drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)-
device_variant=ACC101_VARIANT;drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ } + ((struct acc100_device *) dev->data->dev_private)->mmio_base = pci_dev->mem_resource[0 ].addr;@@ -4251,6 +4399,42 @@ static int acc100_pci_remove(struct
rte_pci_device*pci_dev)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4399
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0RTE_PMD_REGISTER_PCI(ACC100VF_DRIVER_NAME,
acc100_pci_vf_driver);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0RTE_PMD_REGISTER_PCI_TABLE (ACC100VF_DRIVER_NAME , pci_id_acc100_vf_map); +/* ACC101 PCI PF address map */ +static struct rte_pci_id pci_id_acc101_pf_map[] = { + { + RTE_PCI_DEVICE(RTE_ACC101_VENDOR_ID,
RTE_ACC101_PF_DEVICE_ID)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +8
-0+ }, + {.device_id = 0}, +}; + +/* ACC101 PCI VF address map */ +static struct rte_pci_id pci_id_acc101_vf_map[] = { + { + RTE_PCI_DEVICE(RTE_ACC101_VENDOR_ID,
RTE_ACC101_VF_DEVICE_ID)Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +8
-0+ }, + {.device_id = 0}, +}; + + +static struct rte_pci_driver acc101_pci_pf_driver = { + .probe = acc100_pci_probe, + .remove = acc100_pci_remove,drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ .id_table = pci_id_acc101_pf_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING }; + +static struct rte_pci_driver acc101_pci_vf_driver = { + .probe = acc100_pci_probe, + .remove = acc100_pci_remove, + .id_table = pci_id_acc101_vf_map, + .drv_flags =RTE_PCI_DRV_NEED_MAPPING }; + +RTE_PMD_REGISTER_PCI(ACC101PF_DRIVER_NAME,
acc101_pci_pf_driver);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4434
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+RTE_PMD_REGISTER_PCI_TABLE (ACC101PF_DRIVER_NAME , +pci_id_acc101_pf_map);RTE_PMD_REGISTER_PCI(ACC101VF_DRIVER_NAME,
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0+acc101_pci_vf_driver); +RTE_PMD_REGISTER_PCI_TABLE (ACC101VF_DRIVER_NAME , +pci_id_acc101_vf_map); +/* * Workaround implementation to fix the power on status of some 5GUL
engines
Quoted 10 lines
* This requires DMA permission if ported outside DPDK diff --git
a/drivers/baseband/acc100/rte_acc100_pmd.hb/drivers/baseband/acc100/rte_acc100_pmd.h
index cbcece2..6438031 100644drivers/baseband/acc100/rte_acc100_pmd.h +0
-0@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.h +3
-0+#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pfQuoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.h line 75
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.h +2
-0#define ACC100VF_DRIVER_NAME intel_acc100_vf@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */
Quoted 11 lines
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.h line 76
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.h +0
-0#define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)
drivers/baseband/acc100/rte_acc100_pmd.h struct acc100_device { · line 598
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.h +1
-0/* Number of Virtual Functions ACC100 supports */ @@ -590,6 +595,7 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */
drivers/baseband/acc100/rte_acc100_pmd.h +1
-0+uint16_t device_variant;/**< Device variant */ this is not needed, check the pci id
That
device_variantis sent once during probing then we can reuse thatflexibly through the code.
Quoted 7 lines
In the same way the pci id is set once.
Generally if there is a way to use existing data to figure something out, then use the existing data.
Special purpose data increases the size and complexity as well as destabilizing the api
In that very case it helps to keep in one place I believe, the device ids would be different from PF and VF. The API is not impacted here, only underlying structure within the PMD.
Quoted 32 lines
Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
};Quoted 8 lines
drivers/baseband/acc100/rte_acc101_pmd.h
Quoted 7 lines
/**drivers/baseband/acc100/rte_acc101_pmd.h new file +0
-0New files need license, copyrights.
Quoted 4 lines
Thanks!!
Quoted 1 line
This file looks very similar to
rte_acc100_pmd.hActually the configuration of the device differs and could diverge further in
the future. This is limited to the part that would be specific to the device configuration.
Quoted 1 line
Already kept to extremely reduced set. Doing it more would be artificial
and source of possible errors.
Quoted 9 lines
Quoted 8 lines
The common parts should be in only one file, maybe a
rte_acc10x_pmd.hdrivers/baseband/acc100/rte_acc101_pmd.h line 3
Quoted 4 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +3
-0@@ -0,0 +1,61 @@ +/* ACC101 PF and VF driver names */ +#define ACC101PF_DRIVER_NAME intel_acc101_pf +#define ACC101VF_DRIVER_NAME intel_acc101_vfthis maybe changes to intel_acc10x_pr/vf ?
That string would be different from the 2 products on purpose even if
under the bonnet we try to reuse code as much as possible.
Quoted 8 lines
These two devices could be run from the same driver.
I am used to linux kernel drivers that handle multiple devices with the same driver.
The reuse in the linux kernel is about 95%.
The reuse here is about 30%, it should be at least 80%
Where did you get this 30% number? I believe the reuse above is already >80% of the PMD code. (The companion configure function being outside of the PMD per se).
Thanks
Nic
Quoted 65 lines
Tom
Quoted 14 lines
Quoted 14 lines
Tom
drivers/baseband/acc100/rte_acc101_pmd.h
Quoted 11 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +11
-0+ +/* ACC101 PCI vendor & device IDs */ +#define RTE_ACC101_VENDOR_ID (0x8086) +#define RTE_ACC101_PF_DEVICE_ID (0x57c4) +#define RTE_ACC101_VF_DEVICE_ID (0x57c5) + +/* Define as 1 to use only a single FEC engine */ #ifndef +RTE_ACC101_SINGLE_FEC #define RTE_ACC101_SINGLE_FEC 0 #endif + +/* Values used in writing to the registers */ +#define ACC101_REG_IRQ_EN_ALL 0x1FF83FF/* Enable all interrupts
Quoted 12 lines
Quoted 12 lines
*/
drivers/baseband/acc100/rte_acc101_pmd.h
Quoted 11 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +11
-0+ +/* Number of Virtual Functions ACC101 supports */ +#define ACC101_NUM_VFS 16 +#define ACC101_NUM_QGRPS 8 +#define ACC101_NUM_AQS 16 +/* All ACC101 Registers alignment are 32bits = 4B */ +#define ACC101_BYTES_IN_WORD 4 + +#define ACC101_GRP_ID_SHIFT 10/* Queue Index Hierarchy */ +#define ACC101_VF_ID_SHIFT 4/* Queue Index Hierarchy */ +#define ACC101_VF_OFFSET_QOS 16/* offset in Memory specific to QoS
Quoted 34 lines
Quoted 34 lines
Mon */
Quoted 33 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +33
-0+#define ACC101_TMPL_PRI_0 0x03020100 +#define ACC101_TMPL_PRI_1 0x07060504 +#define ACC101_TMPL_PRI_2 0x0b0a0908 +#define ACC101_TMPL_PRI_3 0x0f0e0d0c +#define ACC101_WORDS_IN_ARAM_SIZE (128 * 1024 / 4) + +#define ACC101_NUM_TMPL 32 +/* Mapping of signals for the available engines */ +#define ACC101_SIG_UL_5G 0 +#define ACC101_SIG_UL_5G_LAST 8 +#define ACC101_SIG_DL_5G 13 +#define ACC101_SIG_DL_5G_LAST 15 +#define ACC101_SIG_UL_4G 16 +#define ACC101_SIG_UL_4G_LAST 19 +#define ACC101_SIG_DL_4G 27 +#define ACC101_SIG_DL_4G_LAST 31 +#define ACC101_NUM_ACCS 5 +#define ACC101_PF_VAL 2 + +/* ACC101 Configuration */ +#define ACC101_CFG_DMA_ERROR 0x3D7 +#define ACC101_CFG_AXI_CACHE 0x11 +#define ACC101_CFG_QMGR_HI_P 0x0F0F +#define ACC101_CFG_PCI_AXI 0xC003 +#define ACC101_CFG_PCI_BRIDGE 0x40006033 +#define ACC101_ENGINE_OFFSET 0x1000 +#define ACC101_LONG_WAIT 1000 +#define ACC101_GPEX_AXIMAP_NUM 17 +#define ACC101_CLOCK_GATING_EN 0x30000 +#define ACC101_DMA_INBOUND 0x104 +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF */ +#define ACC101_HARQ_DDR (512 * 1)
PATCH v2 2/5 baseband/acc100: modify validation code for ACC101
In reply to Nicolas ChautruThe validation requirement is different for the two devices.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 40 ++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +28 -12
@@ -1293,6 +1293,14 @@return (q->d->device_variant ==ACC100_VARIANT ); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG +static inline bool +validate_op_required (struct acc100_queue *q) +{ +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(const struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,
@@ -2187,8 +2195,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline int -validate_enc_op (struct rte_bbdev_enc_op *op) +validate_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_enc *turbo_enc = &op->turbo_enc;struct rte_bbdev_op_enc_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_enc_turbo_tb_params *tb =NULL ;
@@ -2325,8 +2335,10 @@ static inline uint32_t hq_index(uint32_t offset) }/* Validates LDPC encoder parameters */ static inline int -validate_ldpc_enc_op (struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc;if (op->mempool ==NULL ) {
@@ -2378,8 +2390,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec;if (op->mempool ==NULL ) {
@@ -2434,7 +2448,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2488,7 +2502,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2550,7 +2564,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2607,7 +2621,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2680,8 +2694,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_dec_turbo_tb_params *tb =NULL ;
@@ -2827,7 +2843,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
@@ -3052,7 +3068,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3156,7 +3172,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3246,7 +3262,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
Signature · 1 line
1.8.3.1
Re: [PATCH v2 2/5] baseband/acc100: modify validation code for ACC101
Quoted 13 lines · Nicolas Chautru
The validation requirement is different for the two devices.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 40 ++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0
drivers/baseband/acc100/rte_acc100_pmd.c line 1298
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0@@ -1293,6 +1293,14 @@return (q->d->device_variant ==ACC100_VARIANT ); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG +static inline bool +validate_op_required (struct acc100_queue *q)
There isn't an #else case so this will fail to build.
This i believe could be another function in private data fops i suggested in the first patch.
Tom
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.c +5
-0+{ +return is_acc100 (q); +} +#endif +
RE: [PATCH v2 2/5] baseband/acc100: modify validation code for ACC101
Hi Tom,
Quoted 30 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Sunday, May 8, 2022 6:07 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 2/5] baseband/acc100: modify validation code for ACC101Quoted 5 lines · Nicolas Chautru
The validation requirement is different for the two devices.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 40++++++++++++++++++++++----------
Quoted 11 lines
1 file changed, 28 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -1293,6 +1293,14 @@return (q->d->device_variant ==ACC100_VARIANT ); }
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.c line 1298
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+#ifdef RTE_LIBRTE_BBDEV_DEBUG +static inline bool +validate_op_required (struct acc100_queue *q)There isn't an #else case so this will fail to build.
There is no else required I believe, since that function is not used when the RTE_LIBRTE_BBDEV_DEBUG is not set. It should build on both (I believe this is tested by CICD).
Quoted 3 lines
This i believe could be another function in private data fops i suggested in the first patch.
In that case we do not expect to validate the input on ACC100, there is not such function.
Quoted 8 lines
Tom
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.c +5
-0+{ +return is_acc100 (q); +} +#endif +
PATCH v2 3/5 baseband/acc100: configuration of ACC101 from PF
In reply to Nicolas ChautruAdding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
--- app/test-bbdev/test_bbdev_perf.c | 57 ++++++ drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302 +++++++++++++++++++++++++++++++ drivers/baseband/acc100/version.map | 2 +- 4 files changed, 377 insertions(+), 1 deletion(-)
app/test-bbdev/test_bbdev_perf.c +57 -0
@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")#endif #define OPS_CACHE_SIZE 256U
@@ -765,6 +767,61 @@ typedef int (test_case_function)(struct active_device *ad,"Failed to configure ACC100 PF for bbdev %s" , info->dev_name); } +if ((get_init_device () == true) && + (!strcmp (info->drv.driver_name,ACC101PF_DRIVER_NAME ))) { +struct rte_acc100_conf conf; +unsigned int i; + +printf ("Configure ACC101 FEC Driver %s with default values\n" , + info->drv.driver_name); + +/* clear default configuration before initialization */ +memset (&conf,0 ,sizeof (struct rte_acc100_conf )); + +/* Always set in PF mode for built-in configuration */ + conf.pf_mode_en = true; +for (i =0 ; i <RTE_ACC100_NUM_VFS ; ++i) { + conf.arb_dl_4g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_dl_4g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_dl_4g[i].round_robin_weight =ACC100_QMGR_RR ; + conf.arb_ul_4g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_ul_4g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_ul_4g[i].round_robin_weight =ACC100_QMGR_RR ; + conf.arb_dl_5g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_dl_5g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_dl_5g[i].round_robin_weight =ACC100_QMGR_RR ; + conf.arb_ul_5g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_ul_5g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_ul_5g[i].round_robin_weight =ACC100_QMGR_RR ; + } + + conf.input_pos_llr_1_bit = true; + conf.output_pos_llr_1_bit = true; + conf.num_vf_bundles =1 ;/**< Number of VF bundles to setup */ + + conf.q_ul_4g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_ul_4g.first_qgroup_index =ACC100_QMGR_INVALID_IDX ; + conf.q_ul_4g.num_aqs_per_groups =ACC100_QMGR_NUM_AQS ; + conf.q_ul_4g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_dl_4g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_dl_4g.first_qgroup_index =ACC100_QMGR_INVALID_IDX ; + conf.q_dl_4g.num_aqs_per_groups =ACC100_QMGR_NUM_AQS ; + conf.q_dl_4g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_ul_5g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_ul_5g.first_qgroup_index =ACC100_QMGR_INVALID_IDX ; + conf.q_ul_5g.num_aqs_per_groups =ACC100_QMGR_NUM_AQS ; + conf.q_ul_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_dl_5g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_dl_5g.first_qgroup_index =ACC100_QMGR_INVALID_IDX ; + conf.q_dl_5g.num_aqs_per_groups =ACC100_QMGR_NUM_AQS ; + conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + +/* setup PF with configuration information */ + ret =rte_acc101_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC101 PF for bbdev %s" , + info->dev_name); + }#endif /* Let's refresh this now this is configured */ rte_bbdev_info_get (dev_id, info);
drivers/baseband/acc100/rte_acc100_cfg.h +17 -0
@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the +* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf); + #ifdef __cplusplus }#endif
drivers/baseband/acc100/rte_acc100_pmd.c +302 -0
305 lines not on this page · raw message
drivers/baseband/acc100/version.map +1 -1
@@ -6,5 +6,5 @@ EXPERIMENTAL { global: rte_acc100_configure; - + rte_acc101_configure; };
Signature · 1 line
1.8.3.1
Re: [PATCH v2 3/5] baseband/acc100: configuration of ACC101 from PF
Quoted 16 lines · Nicolas Chautru
Adding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 57 ++++++ drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302 +++++++++++++++++++++++++++++++ drivers/baseband/acc100/version.map | 2 +- 4 files changed, 377 insertions(+), 1 deletion(-)app/test-bbdev/test_bbdev_perf.c +0
-0
app/test-bbdev/test_bbdev_perf.c line 67
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +2
-0@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")
A dup from patch 1
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad, · line 772
Quoted 10 lines
app/test-bbdev/test_bbdev_perf.c +3
-0#endif #define OPS_CACHE_SIZE 256U@@ -765,6 +767,61 @@ typedef int (test_case_function)(struct active_device *ad,"Failed to configure ACC100 PF for bbdev %s" , info->dev_name); } +if ((get_init_device () == true) && + (!strcmp (info->drv.driver_name,ACC101PF_DRIVER_NAME ))) { +struct rte_acc100_conf conf;
Mixing up acc100 and acc101 ?
If this actually works, combine the two.
drivers/baseband/acc100/rte_acc100_cfg.h
Quoted 59 lines
app/test-bbdev/test_bbdev_perf.c +52
-0+unsigned int i; + +printf ("Configure ACC101 FEC Driver %s with default values\n" , + info->drv.driver_name); + +/* clear default configuration before initialization */ +memset (&conf,0 ,sizeof (struct rte_acc100_conf )); + +/* Always set in PF mode for built-in configuration */ + conf.pf_mode_en = true; +for (i =0 ; i <RTE_ACC100_NUM_VFS ; ++i) { + conf.arb_dl_4g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_dl_4g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_dl_4g[i].round_robin_weight =ACC100_QMGR_RR ; + conf.arb_ul_4g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_ul_4g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_ul_4g[i].round_robin_weight =ACC100_QMGR_RR ; + conf.arb_dl_5g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_dl_5g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_dl_5g[i].round_robin_weight =ACC100_QMGR_RR ; + conf.arb_ul_5g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_ul_5g[i].gbr_threshold1 =ACC100_QOS_GBR ; + conf.arb_ul_5g[i].round_robin_weight =ACC100_QMGR_RR ; + } + + conf.input_pos_llr_1_bit = true; + conf.output_pos_llr_1_bit = true; + conf.num_vf_bundles =1 ;/**< Number of VF bundles to setup */ + + conf.q_ul_4g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_ul_4g.first_qgroup_index =ACC100_QMGR_INVALID_IDX ; + conf.q_ul_4g.num_aqs_per_groups =ACC100_QMGR_NUM_AQS ; + conf.q_ul_4g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_dl_4g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_dl_4g.first_qgroup_index =ACC100_QMGR_INVALID_IDX ; + conf.q_dl_4g.num_aqs_per_groups =ACC100_QMGR_NUM_AQS ; + conf.q_dl_4g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_ul_5g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_ul_5g.first_qgroup_index =ACC100_QMGR_INVALID_IDX ; + conf.q_ul_5g.num_aqs_per_groups =ACC100_QMGR_NUM_AQS ; + conf.q_ul_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_dl_5g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_dl_5g.first_qgroup_index =ACC100_QMGR_INVALID_IDX ; + conf.q_dl_5g.num_aqs_per_groups =ACC100_QMGR_NUM_AQS ; + conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + +/* setup PF with configuration information */ + ret =rte_acc101_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC101 PF for bbdev %s" , + info->dev_name); + }#endif /* Let's refresh this now this is configured */ rte_bbdev_info_get (dev_id, info);drivers/baseband/acc100/rte_acc100_cfg.h +0
-0
This file marks its API as experimental though the acc100 has been used in production for some time.
It is important that the API be stable.
Is this an oversight ?
Or what is needed to stabilize the API ?
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_cfg.h +6
-0@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the
drivers/baseband/acc100/rte_acc100_cfg.h struct rte_acc100_conf { · line 124
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_cfg.h +10
-0+* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf);
I am finding seeing acc100* structs in acc101 function parameters confusing.
Maybe a general renaming of acc100 -> acc10x for the common parts.
Will we have this problem on acc120 or acc200 ?
Maybe shorten everything now to acc
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_cfg.h +1
-0+ #ifdef __cplusplus }#endif drivers/baseband/acc100/rte_acc100_pmd.c +0
-0
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev) · line 4929
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +6
-0@@ -4921,3 +4921,305 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)rte_bbdev_log_debug ("PF Tip configuration complete for %s" , dev_name);return 0 ; } + + +/* Initial configuration of a ACC101 device prior to running configure() */ +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf) +{
This is very similar to the acc100 configure function.
It would be good if these could be combined.
Tom
RE: [PATCH v2 3/5] baseband/acc100: configuration of ACC101 from PF
Quoted 50 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Sunday, May 8, 2022 6:38 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 3/5] baseband/acc100: configuration of ACC101 from PFQuoted 8 lines · Nicolas Chautru
Adding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 57 ++++++ drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302+++++++++++++++++++++++++++++++
Quoted 9 lines
drivers/baseband/acc100/version.map | 2 +- 4 files changed, 377 insertions(+), 1 deletion(-)app/test-bbdev/test_bbdev_perf.c +0
-0app/test-bbdev/test_bbdev_perf.c line 67
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +2
-0@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")A dup from patch 1
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct
Quoted 4 lines
app/test-bbdev/test_bbdev_perf.c +0
-0#endif #define OPS_CACHE_SIZE 256U@@ -765,6 +767,61 @@ typedef int (test_case_function)(struct
active_device*ad,app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +2
-0"Failed to configure ACC100 PF for bbdev %s" , info->dev_name); } +if ((get_init_device () == true) && + (!strcmp (info->drv.driver_name,ACC101PF_DRIVER_NAME ))){
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad, · line 772
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+struct rte_acc100_conf conf;Mixing up acc100 and acc101 ?
If this actually works, combine the two.
The configuration file template is the same but not the configuration file. I can combine a bit more that part.
Quoted 86 lines
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 13 lines
app/test-bbdev/test_bbdev_perf.c +12
-0+unsigned int i; + +printf ("Configure ACC101 FEC Driver %s with default values\n" , + info->drv.driver_name); + +/* clear default configuration before initialization */ +memset (&conf,0 ,sizeof (struct rte_acc100_conf )); + +/* Always set in PF mode for built-in configuration */ + conf.pf_mode_en = true; +for (i =0 ; i <RTE_ACC100_NUM_VFS ; ++i) { + conf.arb_dl_4g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 785
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_4g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 786
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_4g[i].round_robin_weight =
ACC100_QMGR_RR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 787
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_4g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 788
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_4g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 789
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_4g[i].round_robin_weight =
ACC100_QMGR_RR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 790
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_5g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 791
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_5g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 792
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_5g[i].round_robin_weight =
ACC100_QMGR_RR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 793
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_5g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 794
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_5g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 795
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_5g[i].round_robin_weight =
ACC100_QMGR_RR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +5
-0+ } + + conf.input_pos_llr_1_bit = true; + conf.output_pos_llr_1_bit = true; + conf.num_vf_bundles =1 ;/**< Number of VF bundles to setup */
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ + conf.q_ul_4g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_ul_4g.first_qgroup_index =
ACC100_QMGR_INVALID_IDX;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 804
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.q_ul_4g.num_aqs_per_groups =
ACC100_QMGR_NUM_AQS;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ conf.q_ul_4g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_dl_4g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_dl_4g.first_qgroup_index =
ACC100_QMGR_INVALID_IDX;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 808
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.q_dl_4g.num_aqs_per_groups =
ACC100_QMGR_NUM_AQS;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ conf.q_dl_4g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_ul_5g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_ul_5g.first_qgroup_index =
ACC100_QMGR_INVALID_IDX;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 812
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.q_ul_5g.num_aqs_per_groups =
ACC100_QMGR_NUM_AQS;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ conf.q_ul_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_dl_5g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_dl_5g.first_qgroup_index =
ACC100_QMGR_INVALID_IDX;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 816
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.q_dl_5g.num_aqs_per_groups =
ACC100_QMGR_NUM_AQS;drivers/baseband/acc100/rte_acc100_cfg.h
Quoted 16 lines
app/test-bbdev/test_bbdev_perf.c +8
-0+ conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + +/* setup PF with configuration information */ + ret =rte_acc101_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC101 PF for bbdev %s" , + info->dev_name); + }#endif /* Let's refresh this now this is configured */ rte_bbdev_info_get (dev_id, info);drivers/baseband/acc100/rte_acc100_cfg.h +0
-0This file marks its API as experimental though the acc100 has been used in production for some time.
Quoted 5 lines
It is important that the API be stable.
Is this an oversight ?
Or what is needed to stabilize the API ?
This is not part of the BBDEV-API, this is companion function to configure the device notably for bbdev-test. ie. would not be used in live production (ie. we would not run from the PF). It could be made non experimental through another patch if desired.
With regards to the ACC101, this is the new function hence starting as experimental.
Quoted 26 lines
Quoted 13 lines
drivers/baseband/acc100/rte_acc100_cfg.h +7
-0@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the +* rte_bbdev_info structure returned by rte_bbdev_info_get(). drivers/baseband/acc100/rte_acc100_cfg.h struct rte_acc100_conf { · line 126
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_cfg.h +10
-0+* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf +*conf);I am finding seeing acc100* structs in acc101 function parameters confusing.
Quoted 1 line
Maybe a general renaming of acc100 -> acc10x for the common parts.
Again this is just a companion function to configure the device.
Quoted 2 lines
Will we have this problem on acc120 or acc200 ?
There is a plan for ACC200 but that is a complete different product and distinct PMD.
Quoted 26 lines
Maybe shorten everything now to acc
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_cfg.h +1
-0+ #ifdef __cplusplus }#endif drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -4921,3 +4921,305 @@ static int acc100_pci_remove(struct
rte_pci_device*pci_dev)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4921
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0rte_bbdev_log_debug("PF Tip configuration complete for %s",
dev_name);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +5
-0return 0 ; } + + +/* Initial configuration of a ACC101 device prior to running +configure() */ int rte_acc101_configure (const char *dev_name,struct +rte_acc100_conf *conf) {This is very similar to the acc100 configure function.
Quoted 1 line
It would be good if these could be combined.
These should not be combined. The device configuration is distinct and would be artificial to make that function support non compatible register interface. Note that this functional is again is not part of PMD.
Quoted 3 lines
Tom
Re: [PATCH v2 3/5] baseband/acc100: configuration of ACC101 from PF
Quoted 139 lines · Nicolas
Quoted 49 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Sunday, May 8, 2022 6:38 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 3/5] baseband/acc100: configuration of ACC101 from PFQuoted 8 lines · Nicolas Chautru
Adding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 57 ++++++ drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302+++++++++++++++++++++++++++++++
Quoted 9 lines
drivers/baseband/acc100/version.map | 2 +- 4 files changed, 377 insertions(+), 1 deletion(-)app/test-bbdev/test_bbdev_perf.c +0
-0app/test-bbdev/test_bbdev_perf.c line 67
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +2
-0@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")A dup from patch 1
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct
Quoted 4 lines
app/test-bbdev/test_bbdev_perf.c +0
-0#endif #define OPS_CACHE_SIZE 256U@@ -765,6 +767,61 @@ typedef int (test_case_function)(struct
active_device*ad,app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +2
-0"Failed to configure ACC100 PF for bbdev %s" , info->dev_name); } +if ((get_init_device () == true) && + (!strcmp (info->drv.driver_name,ACC101PF_DRIVER_NAME ))){
Quoted 4 lines
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad, · line 772
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+struct rte_acc100_conf conf;Mixing up acc100 and acc101 ?
If this actually works, combine the two.
The configuration file template is the same but not the configuration file. I can combine a bit more that part.
Quoted 84 lines
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 12 lines
app/test-bbdev/test_bbdev_perf.c +12
-0+unsigned int i; + +printf ("Configure ACC101 FEC Driver %s with default values\n" , + info->drv.driver_name); + +/* clear default configuration before initialization */ +memset (&conf,0 ,sizeof (struct rte_acc100_conf )); + +/* Always set in PF mode for built-in configuration */ + conf.pf_mode_en = true; +for (i =0 ; i <RTE_ACC100_NUM_VFS ; ++i) { + conf.arb_dl_4g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 785
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_4g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 786
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_4g[i].round_robin_weight =
ACC100_QMGR_RR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 787
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_4g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 788
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_4g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 789
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_4g[i].round_robin_weight =
ACC100_QMGR_RR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 790
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_5g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 791
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_5g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 792
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_dl_5g[i].round_robin_weight =
ACC100_QMGR_RR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 793
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_5g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 794
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_5g[i].gbr_threshold1 =
ACC100_QOS_GBR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 795
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.arb_ul_5g[i].round_robin_weight =
ACC100_QMGR_RR;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +5
-0+ } + + conf.input_pos_llr_1_bit = true; + conf.output_pos_llr_1_bit = true; + conf.num_vf_bundles =1 ;/**< Number of VF bundles to setup */
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ + conf.q_ul_4g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_ul_4g.first_qgroup_index =
ACC100_QMGR_INVALID_IDX;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 804
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.q_ul_4g.num_aqs_per_groups =
ACC100_QMGR_NUM_AQS;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ conf.q_ul_4g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_dl_4g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_dl_4g.first_qgroup_index =
ACC100_QMGR_INVALID_IDX;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 808
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.q_dl_4g.num_aqs_per_groups =
ACC100_QMGR_NUM_AQS;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ conf.q_dl_4g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_ul_5g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_ul_5g.first_qgroup_index =
ACC100_QMGR_INVALID_IDX;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 812
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.q_ul_5g.num_aqs_per_groups =
ACC100_QMGR_NUM_AQS;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ conf.q_ul_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + conf.q_dl_5g.num_qgroups =ACC100_QMGR_NUM_QGS ; + conf.q_dl_5g.first_qgroup_index =
ACC100_QMGR_INVALID_IDX;app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 816
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ conf.q_dl_5g.num_aqs_per_groups =
ACC100_QMGR_NUM_AQS;drivers/baseband/acc100/rte_acc100_cfg.h
Quoted 16 lines
app/test-bbdev/test_bbdev_perf.c +8
-0+ conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ; + +/* setup PF with configuration information */ + ret =rte_acc101_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC101 PF for bbdev %s" , + info->dev_name); + }#endif /* Let's refresh this now this is configured */ rte_bbdev_info_get (dev_id, info);drivers/baseband/acc100/rte_acc100_cfg.h +0
-0This file marks its API as experimental though the acc100 has been used in production for some time.
Quoted 8 lines
Quoted 5 lines
It is important that the API be stable.
Is this an oversight ?
Or what is needed to stabilize the API ?
This is not part of the BBDEV-API, this is companion function to configure the device notably for bbdev-test. ie. would not be used in live production (ie. we would not run from the PF). It could be made non experimental through another patch if desired.
With regards to the ACC101, this is the new function hence starting as experimental.
If this is not part of the bbdev-api at all and is just test code, please remove all of the experimental tags.
Such tags are reviewed and would be misinterpreted that the source is not production ready.
Quoted 55 lines
Quoted 25 lines
Quoted 13 lines
drivers/baseband/acc100/rte_acc100_cfg.h +7
-0@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the +* rte_bbdev_info structure returned by rte_bbdev_info_get(). drivers/baseband/acc100/rte_acc100_cfg.h struct rte_acc100_conf { · line 126
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_cfg.h +10
-0+* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf +*conf);I am finding seeing acc100* structs in acc101 function parameters confusing.
Quoted 1 line
Maybe a general renaming of acc100 -> acc10x for the common parts.
Again this is just a companion function to configure the device.
Quoted 1 line
Will we have this problem on acc120 or acc200 ?
There is a plan for ACC200 but that is a complete different product and distinct PMD.
Quoted 24 lines
Maybe shorten everything now to acc
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_cfg.h +1
-0+ #ifdef __cplusplus }#endif drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -4921,3 +4921,305 @@ static int acc100_pci_remove(struct
rte_pci_device*pci_dev)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4921
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0rte_bbdev_log_debug("PF Tip configuration complete for %s",
dev_name);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +5
-0return 0 ; } + + +/* Initial configuration of a ACC101 device prior to running +configure() */ int rte_acc101_configure (const char *dev_name,struct +rte_acc100_conf *conf) {This is very similar to the acc100 configure function.
Quoted 3 lines
Quoted 1 line
It would be good if these could be combined.
These should not be combined. The device configuration is distinct and would be artificial to make that function support non compatible register interface. Note that this functional is again is not part of PMD.
ok
Tom
Quoted 3 lines
Quoted 3 lines
Tom
PATCH v2 4/5 baseband/acc100: start explicitly PF Monitor from PMD
In reply to Nicolas ChautruEnsure the performance monitor is restarted in case this is reset after VF FLR.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 4 ++++ drivers/baseband/acc100/rte_acc100_pmd.h | 6 ++++++ 2 files changed, 10 insertions(+)
drivers/baseband/acc100/rte_acc100_pmd.c +4 -0
@@ -263,6 +263,10 @@ &0xF ; } +/* Start Pmon */ +acc100_reg_write (d, reg_addr->pmon_ctrl_a,0x2 ); +acc100_reg_write (d, reg_addr->pmon_ctrl_b,0x2 ); +/* Read PF mode */ if (d->pf_device) { reg_mode =acc100_reg_read (d, HWPfHiPfMode);
drivers/baseband/acc100/rte_acc100_pmd.h +6 -0
@@ -475,6 +475,8 @@ struct acc100_registry_addr {unsigned int depth_log1_offset;unsigned int qman_group_func;unsigned int ddr_range; +unsigned int pmon_ctrl_a; +unsigned int pmon_ctrl_b; };/* Structure holding registry addresses for PF */
@@ -504,6 +506,8 @@ struct acc100_registry_addr { .depth_log1_offset = HWPfQmgrGrpDepthLog21Vf, .qman_group_func = HWPfQmgrGrpFunction0, .ddr_range = HWPfDmaVfDdrBaseRw, + .pmon_ctrl_a = HWPfPermonACntrlRegVf, + .pmon_ctrl_b = HWPfPermonBCntrlRegVf, };/* Structure holding registry addresses for VF */
@@ -533,6 +537,8 @@ struct acc100_registry_addr { .depth_log1_offset = HWVfQmgrGrpDepthLog21Vf, .qman_group_func = HWVfQmgrGrpFunction0Vf, .ddr_range = HWVfDmaDdrBaseRangeRoVf, + .pmon_ctrl_a = HWVfPmACntrlRegVf, + .pmon_ctrl_b = HWVfPmBCntrlRegVf, };/* Structure associated with each queue. */
Signature · 1 line
1.8.3.1
Re: [PATCH v2 4/5] baseband/acc100: start explicitly PF Monitor from PMD
Quoted 14 lines · Nicolas Chautru
Ensure the performance monitor is restarted in case this is reset after VF FLR.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 4 ++++ drivers/baseband/acc100/rte_acc100_pmd.h | 6 ++++++ 2 files changed, 10 insertions(+)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0
drivers/baseband/acc100/rte_acc100_pmd.c line 268
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0@@ -263,6 +263,10 @@ &0xF ; } +/* Start Pmon */ +acc100_reg_write (d, reg_addr->pmon_ctrl_a,0x2 ); +acc100_reg_write (d, reg_addr->pmon_ctrl_b,0x2 );
This looks like an acc100 bug fix, so it should be split from the acc101 pathset.
Where this code is added is fetch_acc100_config, a function that does reads.
Though convenient, this is likely not the best place to put the writes
Tom
Quoted 35 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+/* Read PF mode */ if (d->pf_device) { reg_mode =acc100_reg_read (d, HWPfHiPfMode);drivers/baseband/acc100/rte_acc100_pmd.h +6
-0@@ -475,6 +475,8 @@ struct acc100_registry_addr {unsigned int depth_log1_offset;unsigned int qman_group_func;unsigned int ddr_range; +unsigned int pmon_ctrl_a; +unsigned int pmon_ctrl_b; };/* Structure holding registry addresses for PF */ @@ -504,6 +506,8 @@ struct acc100_registry_addr { .depth_log1_offset = HWPfQmgrGrpDepthLog21Vf, .qman_group_func = HWPfQmgrGrpFunction0, .ddr_range = HWPfDmaVfDdrBaseRw, + .pmon_ctrl_a = HWPfPermonACntrlRegVf, + .pmon_ctrl_b = HWPfPermonBCntrlRegVf, };/* Structure holding registry addresses for VF */ @@ -533,6 +537,8 @@ struct acc100_registry_addr { .depth_log1_offset = HWVfQmgrGrpDepthLog21Vf, .qman_group_func = HWVfQmgrGrpFunction0Vf, .ddr_range = HWVfDmaDdrBaseRangeRoVf, + .pmon_ctrl_a = HWVfPmACntrlRegVf, + .pmon_ctrl_b = HWVfPmBCntrlRegVf, };/* Structure associated with each queue. */
RE: [PATCH v2 4/5] baseband/acc100: start explicitly PF Monitor from PMD
Hi Tom,
Quoted 37 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Sunday, May 8, 2022 6:45 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 4/5] baseband/acc100: start explicitly PF Monitor from PMDQuoted 15 lines · Nicolas Chautru
Ensure the performance monitor is restarted in case this is reset after VF FLR.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 4 ++++ drivers/baseband/acc100/rte_acc100_pmd.h | 6 ++++++ 2 files changed, 10 insertions(+)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0drivers/baseband/acc100/rte_acc100_pmd.c line 268
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0@@ -263,6 +263,10 @@ &0xF ; } +/* Start Pmon */ +acc100_reg_write (d, reg_addr->pmon_ctrl_a,0x2 ); +acc100_reg_write (d, reg_addr->pmon_ctrl_b,0x2 );This looks like an acc100 bug fix, so it should be split from the acc101 pathset.
Quoted 4 lines
Where this code is added is
fetch_acc100_config, a function that does reads.Though convenient, this is likely not the best place to put the writes
OK fair enough It could be part of setup_queues(), Thanks.
Quoted 38 lines
Tom
Quoted 36 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+/* Read PF mode */ if (d->pf_device) { reg_mode = acc100_reg_read(d, HWPfHiPfMode); diff --git
a/drivers/baseband/acc100/rte_acc100_pmd.hb/drivers/baseband/acc100/rte_acc100_pmd.h
index 6438031..f126cc0 100644drivers/baseband/acc100/rte_acc100_pmd.h +2
-0@@ -475,6 +475,8 @@ struct acc100_registry_addr {unsigned int depth_log1_offset;unsigned int qman_group_func;unsigned int ddr_range; +unsigned int pmon_ctrl_a; +unsigned int pmon_ctrl_b; }; /* Structure holding registry addresses for PF */ @@ -504,6 +506,8@@ struct
acc100_registry_addr{
.depth_log1_offset = HWPfQmgrGrpDepthLog21Vf, .qman_group_func = HWPfQmgrGrpFunction0, .ddr_range = HWPfDmaVfDdrBaseRw,drivers/baseband/acc100/rte_acc100_pmd.h +2
-0+ .pmon_ctrl_a = HWPfPermonACntrlRegVf, + .pmon_ctrl_b = HWPfPermonBCntrlRegVf, }; /* Structure holding registry addresses for VF */ @@ -533,6 +537,8@@ struct
acc100_registry_addr{
.depth_log1_offset = HWVfQmgrGrpDepthLog21Vf, .qman_group_func = HWVfQmgrGrpFunction0Vf, .ddr_range = HWVfDmaDdrBaseRangeRoVf,drivers/baseband/acc100/rte_acc100_pmd.h +2
-0+ .pmon_ctrl_a = HWVfPmACntrlRegVf, + .pmon_ctrl_b = HWVfPmBCntrlRegVf, };/* Structure associated with each queue. */
PATCH v2 5/5 baseband/acc100: add protection for some negative scenario
In reply to Nicolas ChautruCatch exception in PMD in case of invalid input parameter.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/baseband/acc100/rte_acc100_pmd.c +6 -0
@@ -1241,6 +1241,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 ) * z_c; }/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;if (rv_index ==1 )return (((bg ==1 ?ACC100_K0_1_1 :ACC100_K0_1_2 ) * n_cb) / n) * z_c;
@@ -1916,6 +1918,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Soft output */ if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_SOFT_OUTPUT )) { +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + }if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER )) *s_out_length = e;
Signature · 1 line
1.8.3.1
Re: [PATCH v2 5/5] baseband/acc100: add protection for some negative scenario
Quoted 1 line · Nicolas Chautru
Catch exception in PMD in case of invalid input parameter.
It is not clear if this is 1 fix or 2.
But it does look like an acc100 fix so it should be split from the acc101 patchset.
Quoted 11 lines
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0
drivers/baseband/acc100/rte_acc100_pmd.c line 1245
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0@@ -1241,6 +1241,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 ) * z_c; }/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;
This check should be moved to earlier, if 'n' is set to 0 in the statement above, there is div by 0 later
Tom
Quoted 14 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0if (rv_index ==1 )return (((bg ==1 ?ACC100_K0_1_1 :ACC100_K0_1_2 ) * n_cb) / n) * z_c;@@ -1916,6 +1918,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Soft output */ if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_SOFT_OUTPUT )) { +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + }if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER )) *s_out_length = e;
RE: [PATCH v2 5/5] baseband/acc100: add protection for some negative scenario
Hi Tom,
Quoted 12 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Sunday, May 8, 2022 6:56 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 5/5] baseband/acc100: add protection for some negative scenario
Quoted 8 lines
Quoted 1 line · Nicolas Chautru
Catch exception in PMD in case of invalid input parameter.
It is not clear if this is 1 fix or 2.
But it does look like an acc100 fix so it should be split from the acc101 patchset.
What is the concern? This is a different commit related to acc100.
Quoted 14 lines
drivers/baseband/acc100/rte_acc100_pmd.c line 1241
Quoted 13 lines
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -1241,6 +1241,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 )*
z_c;
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c line 1245
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0}/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;This check should be moved to earlier, if 'n' is set to 0 in the statement above, there is div by 0 later
N is purely a factor of z_c, I don’t see the concern is order.
Quoted 21 lines
Tom
drivers/baseband/acc100/rte_acc100_pmd.c line 1247
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0if (rv_index ==1 ) return (((bg == 1 ? ACC100_K0_1_1 : ACC100_K0_1_2) *
n_cb)drivers/baseband/acc100/rte_acc100_pmd.c static inline uint32_t hq_index(uint32_t · line 1921
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0/ n) * z_c;@@ -1916,6 +1918,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Soft output */ if (check_bit(op->turbo_dec.op_flags,
RTE_BBDEV_TURBO_SOFT_OUTPUT))Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0{ +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + } if (check_bit(op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER)) *s_out_length = e;
Re: [PATCH v2 5/5] baseband/acc100: add protection for some negative scenario
Quoted 14 lines · Nicolas
Hi Tom,
Quoted 12 lines
-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Sunday, May 8, 2022 6:56 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 5/5] baseband/acc100: add protection for some negative scenario
Quoted 8 lines
Quoted 7 lines · Nicolas Chautru
Quoted 1 line
Catch exception in PMD in case of invalid input parameter.
It is not clear if this is 1 fix or 2.
But it does look like an acc100 fix so it should be split from the acc101 patchset.
What is the concern? This is a different commit related to acc100.
Bisecting patchsets.
A patchset like this that enables a new device should just enable the new device.
Not enable a new device and random other stuff.
If the patchset had to be reverted, the revert would wipe out the fixes.
That work is done by someone else without deep knowledge or time to analyze every patchset for misc parts.
The fixes are more important than the new device, so they should be submitted first.
Tom
Quoted 42 lines
Quoted 14 lines
drivers/baseband/acc100/rte_acc100_pmd.c line 1241
Quoted 13 lines
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -1241,6 +1241,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 )*
z_c;Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c line 1245
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0}/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;This check should be moved to earlier, if 'n' is set to 0 in the statement above, there is div by 0 later
N is purely a factor of
z_c, I don’t see the concern is order.Quoted 20 lines
Tom
drivers/baseband/acc100/rte_acc100_pmd.c line 1247
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0if (rv_index ==1 ) return (((bg == 1 ? ACC100_K0_1_1 : ACC100_K0_1_2) *
n_cb)drivers/baseband/acc100/rte_acc100_pmd.c static inline uint32_t hq_index(uint32_t · line 1921
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0/ n) * z_c;@@ -1916,6 +1918,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Soft output */ if (check_bit(op->turbo_dec.op_flags,
RTE_BBDEV_TURBO_SOFT_OUTPUT))Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0{ +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + } if (check_bit(op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER)) *s_out_length = e;
Re: [PATCH v2 5/5] baseband/acc100: add protection for some negative scenario
10/05/2022 14:11, Tom Rix:
Quoted 18 lines · Nicolas
Quoted 9 lines
From: Tom Rix <[email protected]>
Quoted 7 lines · Nicolas Chautru
Quoted 1 line
Catch exception in PMD in case of invalid input parameter.
It is not clear if this is 1 fix or 2.
But it does look like an acc100 fix so it should be split from the acc101 patchset.
What is the concern? This is a different commit related to acc100.
Bisecting patchsets.
A patchset like this that enables a new device should just enable the new device.
Not enable a new device and random other stuff.
Quoted 7 lines
If the patchset had to be reverted, the revert would wipe out the fixes.
That work is done by someone else without deep knowledge or time to analyze every patchset for misc parts.
The fixes are more important than the new device, so they should be submitted first.
Well explained, and I agree with Tom.
v3 cover drivers/baseband: PMD to support ACC101 device
In reply to Nicolas Chautruv3: Feedback from Tom Rix: missing copyright, refactor bbdev-test section calling the configure companion function for ACC100/101, taking the Pmon commit out which is not directly required.
v2: Based on good feedback from Thomas and David,
now implementing the ACC101 PMD as a close derivative from
existing ACC100 PMD with hooks to have different behaviour based on variant. This prevents code duplication and only rely on different functions and behaviour when hardware requires or support differences.
Note that these are pending changes for ACC100 which would be specific to that device and not ACC101 but these can be managed based on the new implementation, ie. is_acc100() etc... (such incremental changes for ACC100 trending 22.11 but confirming this is future proof).
The serie also includes commits which were meant for ACC101 but are also valuable for ACC100.
v1: This serie introduces the PMD for the new bbdev device ACC101 (aka Mount Cirrus). This is a derivative from previous Mount Bryce ACC100 which includes silicon improvement, bug fixes, capacity improvement for 5GNR and feature improvement.
Nicolas Chautru (4):
baseband/acc100: introduce PMD for ACC101 baseband/acc100: modify validation code for ACC101 baseband/acc100: configuration of ACC101 from PF baseband/acc100: add protection for some negative scenario
app/test-bbdev/test_bbdev_perf.c | 22 +- doc/guides/bbdevs/acc101.rst | 237 ++++++++++++++ doc/guides/bbdevs/features/acc101.ini | 13 + doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_cfg.h | 17 + drivers/baseband/acc100/rte_acc100_pmd.c | 542 ++++++++++++++++++++++++++++++- drivers/baseband/acc100/rte_acc100_pmd.h | 6 + drivers/baseband/acc100/rte_acc101_pmd.h | 65 ++++ drivers/baseband/acc100/version.map | 2 +- 10 files changed, 885 insertions(+), 24 deletions(-) create mode 100644 doc/guides/bbdevs/acc101.rst create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
Signature · 1 line
1.8.3.1
PATCH v3 1/4 baseband/acc100: introduce PMD for ACC101
Support for ACC101 as a derivative of ACC100.
Reusing existing code when possible.
--- doc/guides/bbdevs/acc101.rst | 237 +++++++++++++++++++++++++++++++ doc/guides/bbdevs/features/acc101.ini | 13 ++ doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_pmd.c | 194 ++++++++++++++++++++++++- drivers/baseband/acc100/rte_acc100_pmd.h | 6 + drivers/baseband/acc100/rte_acc101_pmd.h | 65 +++++++++ 7 files changed, 515 insertions(+), 5 deletions(-) create mode 100644 doc/guides/bbdevs/acc101.rst create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
doc/guides/bbdevs/acc101.rst new file +237 -0
@@ -0,0 +1,237 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2020 Intel Corporation + +Intel(R) ACC101 5G/4G FEC Poll Mode Driver +========================================== + +The BBDEV ACC101 5G/4G FEC poll mode driver (PMD) supports an +implementation of a VRAN FEC wireless acceleration function. +This device is also known as Mount Cirrus. +This is a follow-up to Mount Bryce (ACC100) and includes fixes, improved +feature set for error scenarios and performance capacity increase. + +Features +-------- + +ACC101 5G/4G FEC PMD supports the following features: + +- LDPC Encode in the DL (5GNR) +- LDPC Decode in the UL (5GNR) +- Turbo Encode in the DL (4G) +- Turbo Decode in the UL (4G) +- 16 VFs per PF (physical device) +- Maximum of 128 queues per VF +- PCIe Gen-3 x16 Interface +- MSI +- SR-IOV + +ACC101 5G/4G FEC PMD supports the following BBDEV capabilities: + +* For the LDPC encode operation: + - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_LDPC_RATE_MATCH`` : if set then do not do Rate Match bypass + - ``RTE_BBDEV_LDPC_INTERLEAVER_BYPASS`` : if set then bypass interleaver + +* For the LDPC decode operation: + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` : check CRC24B from CB(s) + - ``RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE`` : disable early termination + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` : drops CRC24B bits appended while decoding + - ``RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE`` : HARQ memory input is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE`` : HARQ memory output is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK`` : loopback data to/from HARQ memory + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS`` : HARQ memory includes the fillers bits + - ``RTE_BBDEV_LDPC_DEC_SCATTER_GATHER`` : supports scatter-gather for input/output data + - ``RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION`` : supports compression of the HARQ input/output + - ``RTE_BBDEV_LDPC_LLR_COMPRESSION`` : supports LLR input compression + +* For the turbo encode operation: + - ``RTE_BBDEV_TURBO_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_TURBO_RATE_MATCH`` : if set then do not do Rate Match bypass + - ``RTE_BBDEV_TURBO_ENC_INTERRUPTS`` : set for encoder dequeue interrupts + - ``RTE_BBDEV_TURBO_RV_INDEX_BYPASS`` : set to bypass RV index + - ``RTE_BBDEV_TURBO_ENC_SCATTER_GATHER`` : supports scatter-gather for input/output data + +* For the turbo decode operation: + - ``RTE_BBDEV_TURBO_CRC_TYPE_24B`` : check CRC24B from CB(s) + - ``RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE`` : perform subblock de-interleave + - ``RTE_BBDEV_TURBO_DEC_INTERRUPTS`` : set for decoder dequeue interrupts + - ``RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN`` : set if negative LLR encoder i/p is supported + - ``RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN`` : set if positive LLR encoder i/p is supported + - ``RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP`` : keep CRC24B bits appended while decoding + - ``RTE_BBDEV_TURBO_DEC_CRC_24B_DROP`` : option to drop the code block CRC after decoding + - ``RTE_BBDEV_TURBO_EARLY_TERMINATION`` : set early termination feature + - ``RTE_BBDEV_TURBO_DEC_SCATTER_GATHER`` : supports scatter-gather for input/output data + - ``RTE_BBDEV_TURBO_HALF_ITERATION_EVEN`` : set half iteration granularity + +Installation +------------ + +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. + +DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual. +The bbdev test application has been tested with a configuration 40 x 1GB hugepages. The +hugepage configuration of a server may be examined using: + +.. code-block:: console + + grep Huge* /proc/meminfo + + +Initialization +-------------- + +When the device first powers up, its PCI Physical Functions (PF) can be listed through this command: + +.. code-block:: console + + sudo lspci -vd8086:57c4 + +The physical and virtual functions are compatible with Linux UIO drivers: +``vfio`` and ``igb_uio``. However, in order to work the ACC101 5G/4G +FEC device first needs to be bound to one of these linux drivers through DPDK. + + +Bind PF UIO driver(s) +~~~~~~~~~~~~~~~~~~~~~ + +Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use +``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. + +The igb_uio driver may be bound to the PF PCI device using one of two methods: + + +1. PCI functions (physical or virtual, depending on the use case) can be bound to +the UIO driver by repeating this command for every function. + +.. code-block:: console + + cd <dpdk-top-level-directory> + insmod ./build/kmod/igb_uio.ko + echo "8086 57c4" > /sys/bus/pci/drivers/igb_uio/new_id + lspci -vd8086:57c4 + + +2. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool + +.. code-block:: console + + cd <dpdk-top-level-directory> + ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0 + +where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:57c4 + + +In a similar way the ACC101 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. + + +Enable Virtual Functions +~~~~~~~~~~~~~~~~~~~~~~~~ + +Now, it should be visible in the printouts that PCI PF is under igb_uio control +"``Kernel driver in use: igb_uio``" + +To show the number of available VFs on the device, read ``sriov_totalvfs`` file.. + +.. code-block:: console + + cat /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_totalvfs + + where 0000\:<b>\:<d>.<f> is the PCI device ID + + +To enable VFs via igb_uio, echo the number of virtual functions intended to +enable to ``max_vfs`` file.. + +.. code-block:: console + + echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/max_vfs + + +Afterwards, all VFs must be bound to appropriate UIO drivers as required, same +way it was done with the physical function previously. + +Enabling SR-IOV via vfio driver is pretty much the same, except that the file +name is different: + +.. code-block:: console + + echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_numvfs + + +Configure the VFs through PF +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The PCI virtual functions must be configured before working or getting assigned +to VMs/Containers. The configuration involves allocating the number of hardware +queues, priorities, load balance, bandwidth and other settings necessary for the +device to perform FEC functions. + +This configuration needs to be executed at least once after reboot or PCI FLR and can +be achieved by using the function ``acc101_configure()``, which sets up the +parameters defined in ``acc100_conf`` structure. + +Test Application +---------------- + +BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing +the functionality of ACC101 5G/4G FEC encode and decode, depending on the device's +capabilities. The test application is located under app->test-bbdev folder and has the +following options: + +.. code-block:: console + + "-p", "--testapp-path": specifies path to the bbdev test app. + "-e", "--eal-params" : EAL arguments which are passed to the test app. + "-t", "--timeout" : Timeout in seconds (default=300). + "-c", "--test-cases" : Defines test cases to run. Run all if not specified. + "-v", "--test-vector" : Test vector path (default=dpdk_path+/app/test-bbdev/test_vectors/bbdev_null.data). + "-n", "--num-ops" : Number of operations to process on device (default=32). + "-b", "--burst-size" : Operations enqueue/dequeue burst size (default=32). + "-s", "--snr" : SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-l", "--num-lcores" : Number of lcores to run (default=16). + "-i", "--init-device" : Initialise PF device with default values. + + +To execute the test application tool using simple decode or encode data, +type one of the following: + +.. code-block:: console + + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_enc_default.data + + +The test application ``test-bbdev.py``, supports the ability to configure the PF device with +a default set of values, if the "-i" or "- -init-device" option is included. The default values +are defined in test_bbdev_perf.c. + + +Test Vectors +~~~~~~~~~~~~ + +In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides +a range of additional tests under the test_vectors folder, which may be useful. The results +of these tests will depend on the ACC101 5G/4G FEC capabilities which may cause some +testcases to be skipped, but no failure should be reported. + + +Alternate Baseband Device configuration tool +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +On top of the embedded configuration feature supported in test-bbdev using "- -init-device" +option mentioned above, there is also a tool available to perform that device configuration +using a companion application. +The ``pf_bb_config`` application notably enables then to run bbdev-test from the VF +and not only limited to the PF as captured above. + +See for more details: https://github.com/intel/pf-bb-config + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_4vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -l 1 -v ./ldpc_dec_default.data
doc/guides/bbdevs/features/acc101.ini new file +13 -0
@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Y
doc/guides/bbdevs/index.rst +1 -0
@@ -14,4 +14,5 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + acc101 la12xx
doc/guides/rel_notes/release_22_07.rst +4 -0
@@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device (Mount Cirrus). + * See the :doc:`../bbdevs/acc101` for more details. Removed Items -------------
drivers/baseband/acc100/rte_acc100_pmd.c +189 -5
236 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +6 -0
@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf
@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)/* Number of Virtual Functions ACC100 supports */
@@ -590,6 +595,7 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */ };/**
drivers/baseband/acc100/rte_acc101_pmd.h new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Re: [PATCH v3 1/4] baseband/acc100: introduce PMD for ACC101
Hi Nicolas,
Quoted 13 lines · Nicolas Chautru
Support for ACC101 as a derivative of ACC100.
Reusing existing code when possible.Signed-off-by Nicolas Chautru <[email protected]>--- doc/guides/bbdevs/acc101.rst | 237 +++++++++++++++++++++++++++++++ doc/guides/bbdevs/features/acc101.ini | 13 ++ doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_pmd.c | 194 ++++++++++++++++++++++++- drivers/baseband/acc100/rte_acc100_pmd.h | 6 + drivers/baseband/acc100/rte_acc101_pmd.h | 65 +++++++++ 7 files changed, 515 insertions(+), 5 deletions(-)
Quoted 4 lines
create mode 100644
doc/guides/bbdevs/acc101.rstcreate mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644drivers/baseband/acc100/rte_acc101_pmd.h
It seems most of Tom's comments on v2 have not been addressed.
Overall, ACC100 & ACC101 are very similar, I think it does not make sense in to have two drivers being declared and two documentation files.
Quoted 301 lines
doc/guides/bbdevs/acc101.rst new file +237
-0@@ -0,0 +1,237 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2020 Intel Corporation + +Intel(R) ACC101 5G/4G FEC Poll Mode Driver +========================================== + +The BBDEV ACC101 5G/4G FEC poll mode driver (PMD) supports an +implementation of a VRAN FEC wireless acceleration function. +This device is also known as Mount Cirrus. +This is a follow-up to Mount Bryce (ACC100) and includes fixes, improved +feature set for error scenarios and performance capacity increase. + +Features +-------- + +ACC101 5G/4G FEC PMD supports the following features: + +- LDPC Encode in the DL (5GNR) +- LDPC Decode in the UL (5GNR) +- Turbo Encode in the DL (4G) +- Turbo Decode in the UL (4G) +- 16 VFs per PF (physical device) +- Maximum of 128 queues per VF +- PCIe Gen-3 x16 Interface +- MSI +- SR-IOV + +ACC101 5G/4G FEC PMD supports the following BBDEV capabilities: + +* For the LDPC encode operation: + - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_LDPC_RATE_MATCH`` : if set then do not do Rate Match bypass + - ``RTE_BBDEV_LDPC_INTERLEAVER_BYPASS`` : if set then bypass interleaver + +* For the LDPC decode operation: + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` : check CRC24B from CB(s) + - ``RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE`` : disable early termination + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` : drops CRC24B bits appended while decoding + - ``RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE`` : HARQ memory input is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE`` : HARQ memory output is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK`` : loopback data to/from HARQ memory + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS`` : HARQ memory includes the fillers bits + - ``RTE_BBDEV_LDPC_DEC_SCATTER_GATHER`` : supports scatter-gather for input/output data + - ``RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION`` : supports compression of the HARQ input/output + - ``RTE_BBDEV_LDPC_LLR_COMPRESSION`` : supports LLR input compression + +* For the turbo encode operation: + - ``RTE_BBDEV_TURBO_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_TURBO_RATE_MATCH`` : if set then do not do Rate Match bypass + - ``RTE_BBDEV_TURBO_ENC_INTERRUPTS`` : set for encoder dequeue interrupts + - ``RTE_BBDEV_TURBO_RV_INDEX_BYPASS`` : set to bypass RV index + - ``RTE_BBDEV_TURBO_ENC_SCATTER_GATHER`` : supports scatter-gather for input/output data + +* For the turbo decode operation: + - ``RTE_BBDEV_TURBO_CRC_TYPE_24B`` : check CRC24B from CB(s) + - ``RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE`` : perform subblock de-interleave + - ``RTE_BBDEV_TURBO_DEC_INTERRUPTS`` : set for decoder dequeue interrupts + - ``RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN`` : set if negative LLR encoder i/p is supported + - ``RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN`` : set if positive LLR encoder i/p is supported + - ``RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP`` : keep CRC24B bits appended while decoding + - ``RTE_BBDEV_TURBO_DEC_CRC_24B_DROP`` : option to drop the code block CRC after decoding + - ``RTE_BBDEV_TURBO_EARLY_TERMINATION`` : set early termination feature + - ``RTE_BBDEV_TURBO_DEC_SCATTER_GATHER`` : supports scatter-gather for input/output data + - ``RTE_BBDEV_TURBO_HALF_ITERATION_EVEN`` : set half iteration granularity + +Installation +------------ + +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. + +DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual. +The bbdev test application has been tested with a configuration 40 x 1GB hugepages. The +hugepage configuration of a server may be examined using: + +.. code-block:: console + + grep Huge* /proc/meminfo + + +Initialization +-------------- + +When the device first powers up, its PCI Physical Functions (PF) can be listed through this command: + +.. code-block:: console + + sudo lspci -vd8086:57c4 + +The physical and virtual functions are compatible with Linux UIO drivers: +``vfio`` and ``igb_uio``. However, in order to work the ACC101 5G/4G +FEC device first needs to be bound to one of these linux drivers through DPDK. + + +Bind PF UIO driver(s) +~~~~~~~~~~~~~~~~~~~~~ + +Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use +``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. + +The igb_uio driver may be bound to the PF PCI device using one of two methods: + + +1. PCI functions (physical or virtual, depending on the use case) can be bound to +the UIO driver by repeating this command for every function. + +.. code-block:: console + + cd <dpdk-top-level-directory> + insmod ./build/kmod/igb_uio.ko + echo "8086 57c4" > /sys/bus/pci/drivers/igb_uio/new_id + lspci -vd8086:57c4 + + +2. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool + +.. code-block:: console + + cd <dpdk-top-level-directory> + ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0 + +where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:57c4 + + +In a similar way the ACC101 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. + + +Enable Virtual Functions +~~~~~~~~~~~~~~~~~~~~~~~~ + +Now, it should be visible in the printouts that PCI PF is under igb_uio control +"``Kernel driver in use: igb_uio``" + +To show the number of available VFs on the device, read ``sriov_totalvfs`` file.. + +.. code-block:: console + + cat /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_totalvfs + + where 0000\:<b>\:<d>.<f> is the PCI device ID + + +To enable VFs via igb_uio, echo the number of virtual functions intended to +enable to ``max_vfs`` file.. + +.. code-block:: console + + echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/max_vfs + + +Afterwards, all VFs must be bound to appropriate UIO drivers as required, same +way it was done with the physical function previously. + +Enabling SR-IOV via vfio driver is pretty much the same, except that the file +name is different: + +.. code-block:: console + + echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_numvfs + + +Configure the VFs through PF +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The PCI virtual functions must be configured before working or getting assigned +to VMs/Containers. The configuration involves allocating the number of hardware +queues, priorities, load balance, bandwidth and other settings necessary for the +device to perform FEC functions. + +This configuration needs to be executed at least once after reboot or PCI FLR and can +be achieved by using the function ``acc101_configure()``, which sets up the +parameters defined in ``acc100_conf`` structure. + +Test Application +---------------- + +BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing +the functionality of ACC101 5G/4G FEC encode and decode, depending on the device's +capabilities. The test application is located under app->test-bbdev folder and has the +following options: + +.. code-block:: console + + "-p", "--testapp-path": specifies path to the bbdev test app. + "-e", "--eal-params" : EAL arguments which are passed to the test app. + "-t", "--timeout" : Timeout in seconds (default=300). + "-c", "--test-cases" : Defines test cases to run. Run all if not specified. + "-v", "--test-vector" : Test vector path (default=dpdk_path+/app/test-bbdev/test_vectors/bbdev_null.data). + "-n", "--num-ops" : Number of operations to process on device (default=32). + "-b", "--burst-size" : Operations enqueue/dequeue burst size (default=32). + "-s", "--snr" : SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-l", "--num-lcores" : Number of lcores to run (default=16). + "-i", "--init-device" : Initialise PF device with default values. + + +To execute the test application tool using simple decode or encode data, +type one of the following: + +.. code-block:: console + + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_enc_default.data + + +The test application ``test-bbdev.py``, supports the ability to configure the PF device with +a default set of values, if the "-i" or "- -init-device" option is included. The default values +are defined in test_bbdev_perf.c. + + +Test Vectors +~~~~~~~~~~~~ + +In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides +a range of additional tests under the test_vectors folder, which may be useful. The results +of these tests will depend on the ACC101 5G/4G FEC capabilities which may cause some +testcases to be skipped, but no failure should be reported. + + +Alternate Baseband Device configuration tool +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +On top of the embedded configuration feature supported in test-bbdev using "- -init-device" +option mentioned above, there is also a tool available to perform that device configuration +using a companion application. +The ``pf_bb_config`` application notably enables then to run bbdev-test from the VF +and not only limited to the PF as captured above. + +See for more details: https://github.com/intel/pf-bb-config + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_4vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -l 1 -v ./ldpc_dec_default.datadoc/guides/bbdevs/features/acc101.ini new file +13
-0@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Ydoc/guides/bbdevs/index.rst +1
-0@@ -14,4 +14,5 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + acc101 la12xxdoc/guides/rel_notes/release_22_07.rst +4
-0@@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device (Mount Cirrus). + * See the :doc:`../bbdevs/acc101` for more details. Removed Items -------------drivers/baseband/acc100/rte_acc100_pmd.c +1
-0@@ -22,6 +22,7 @@#include <rte_bbdev.h> #include <rte_bbdev_pmd.h> #include "rte_acc100_pmd.h" +#include "rte_acc101_pmd.h" #ifdef RTE_LIBRTE_BBDEV_DEBUG RTE_LOG_REGISTER_DEFAULT (acc100_logtype,DEBUG );
drivers/baseband/acc100/rte_acc100_pmd.c line 1294
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +5
-0@@ -1286,6 +1287,12 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); } +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); +}
You should rely on the PCI ID to differentiate IMHO
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(const struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,@@ -1412,6 +1419,139 @@ } } +/* Convert offset to harq index for harq_layout structure */
drivers/baseband/acc100/rte_acc100_pmd.c line 1432
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+static inline uint32_t hq_index (uint32_t offset) +{ +return (offset >>ACC100_HARQ_OFFSET_SHIFT ) &ACC100_HARQ_OFFSET_MASK ; +} + +/* Fill in a frame control word for LDPC decoding for ACC101 */ +static inline void +acc101_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout) +{
This function is quite similar to the acc100 one, it should be possible to do it in a single function to avoid duplication and rely on the device ID when something specific is to be done.
Quoted 149 lines
drivers/baseband/acc100/rte_acc100_pmd.c +124
-4+uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset; +uint32_t harq_index; +uint32_t l; + + fcw->qm = op->ldpc_dec.q_m; + fcw->nfiller = op->ldpc_dec.n_filler; + fcw->BG = (op->ldpc_dec.basegraph -1 ); + fcw->Zc = op->ldpc_dec.z_c; + fcw->ncb = op->ldpc_dec.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph, + op->ldpc_dec.rv_index); +if (op->ldpc_dec.code_block_mode ==RTE_BBDEV_CODE_BLOCK ) + fcw->rm_e = op->ldpc_dec.cb_params.e; +else + fcw->rm_e = (op->ldpc_dec.tb_params.r < + op->ldpc_dec.tb_params.cab) ? + op->ldpc_dec.tb_params.ea : + op->ldpc_dec.tb_params.eb; + +if (unlikely (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ) && + (op->ldpc_dec.harq_combined_input.length ==0 ))) { +rte_bbdev_log (WARNING ,"Null HARQ input size provided" ); +/* Disable HARQ input in that case to carry forward */ + op->ldpc_dec.op_flags ^=RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ; + } + + fcw->hcin_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ); + fcw->hcout_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE ); + fcw->crc_select =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK ); + fcw->bypass_dec =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DECODE_BYPASS ); + fcw->bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS ); +if (op->ldpc_dec.q_m ==1 ) { + fcw->bypass_intlv =1 ; + fcw->qm =2 ; + } + fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_LLR_COMPRESSION ); + harq_index =hq_index (op->ldpc_dec.harq_combined_output.offset); +if (fcw->hcin_en >0 ) { + harq_in_length = op->ldpc_dec.harq_combined_input.length; +if (fcw->hcin_decomp_mode >0 ) + harq_in_length = harq_in_length *8 /6 ; + harq_in_length =RTE_MIN (harq_in_length, op->ldpc_dec.n_cb + - op->ldpc_dec.n_filler); +/* Alignment on next 64B - Already enforced from HC output */ + harq_in_length =RTE_ALIGN_FLOOR (harq_in_length,64 ); + fcw->hcin_size0 = harq_in_length; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + }else { + fcw->hcin_size0 =0 ; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + } + + fcw->itmax = op->ldpc_dec.iter_max; + fcw->itstop =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->synd_precoder = fcw->itstop; +/* +* These are all implicitly set +* fcw->synd_post = 0; +* fcw->so_en = 0; +* fcw->so_bypass_rm = 0; +* fcw->so_bypass_intlv = 0; +* fcw->dec_convllr = 0; +* fcw->hcout_convllr = 0; +* fcw->hcout_size1 = 0; +* fcw->so_it = 0; +* fcw->hcout_offset = 0; +* fcw->negstop_th = 0; +* fcw->negstop_it = 0; +* fcw->negstop_en = 0; +* fcw->gain_i = 1; +* fcw->gain_h = 1; +*/ +if (fcw->hcout_en >0 ) { + parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) + * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + ncb_p = fcw->ncb - op->ldpc_dec.n_filler; + l =RTE_MIN (k0_p + fcw->rm_e,INT16_MAX ); + harq_out_length = (uint16_t ) fcw->hcin_size0; + harq_out_length =RTE_MAX (harq_out_length, l); +/* Cannot exceed the pruned Ncb circular buffer */ + harq_out_length =RTE_MIN (harq_out_length, ncb_p); +/* Alignment on next 64B */ + harq_out_length =RTE_ALIGN_CEIL (harq_out_length,64 ); + fcw->hcout_size0 = harq_out_length; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + harq_layout[harq_index].offset = fcw->hcout_offset; + harq_layout[harq_index].size0 = fcw->hcout_size0; + }else { + fcw->hcout_size0 =0 ; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + } +} + +static inline void +acc10x_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout,struct acc100_queue *q) +{ +if (is_acc100 (q)) +return acc100_fcw_ld_fill (op, fcw, harq_layout); +else +return acc101_fcw_ld_fill (op, fcw, harq_layout); +} + +/** * Fills descriptor with data pointers of one block type. * @@ -2960,7 +3100,7 @@struct acc100_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; -acc100_fcw_ld_fill (op, fcw, harq_layout); +acc10x_fcw_ld_fill (op, fcw, harq_layout, q);/* Special handling when overusing mbuf */ if (fcw->rm_e <ACC100_MAX_E_MBUF )@@ -3027,7 +3167,7 @@ desc = q->ring_addr + desc_idx;uint64_t fcw_offset = (desc_idx <<8 ) +ACC100_DESC_FCW_OFFSET ;union acc100_harq_layout_data *harq_layout = q->d->harq_layout; -acc100_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); +acc10x_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout, q); input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data;@@ -4139,9 +4279,17 @@ dev->dequeue_ldpc_enc_ops = acc100_dequeue_ldpc_enc; dev->dequeue_ldpc_dec_ops = acc100_dequeue_ldpc_dec; - ((struct acc100_device *) dev->data->dev_private)->pf_device = - !strcmp(drv->driver.name,
drivers/baseband/acc100/rte_acc100_pmd.c line 4290
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-1- RTE_STR(ACC100PF_DRIVER_NAME)); +if ((!strcmp (drv->driver.name,RTE_STR (ACC100PF_DRIVER_NAME ))) || + (!strcmp (drv->driver.name,RTE_STR (ACC100VF_DRIVER_NAME )))) { + ((struct acc100_device *) dev->data->dev_private)->pf_device = + !strcmp (drv->driver.name,RTE_STR (ACC100PF_DRIVER_NAME )); + ((struct acc100_device *) dev->data->dev_private)->device_variant =ACC100_VARIANT ; + }else { + ((struct acc100_device *) dev->data->dev_private)->pf_device = + !strcmp (drv->driver.name,RTE_STR (ACC101PF_DRIVER_NAME )); + ((struct acc100_device *) dev->data->dev_private)->device_variant =ACC101_VARIANT ;
Better to rely on the PCI device ID than introducing a new field.
Quoted 92 lines
drivers/baseband/acc100/rte_acc100_pmd.c +38
-0+ } + ((struct acc100_device *) dev->data->dev_private)->mmio_base = pci_dev->mem_resource[0 ].addr;@@ -4251,6 +4399,42 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)RTE_PMD_REGISTER_PCI (ACC100VF_DRIVER_NAME , acc100_pci_vf_driver);RTE_PMD_REGISTER_PCI_TABLE (ACC100VF_DRIVER_NAME , pci_id_acc100_vf_map); +/* ACC101 PCI PF address map */ +static struct rte_pci_id pci_id_acc101_pf_map[] = { + { +RTE_PCI_DEVICE (RTE_ACC101_VENDOR_ID ,RTE_ACC101_PF_DEVICE_ID ) + }, + {.device_id =0 }, +}; + +/* ACC101 PCI VF address map */ +static struct rte_pci_id pci_id_acc101_vf_map[] = { + { +RTE_PCI_DEVICE (RTE_ACC101_VENDOR_ID ,RTE_ACC101_VF_DEVICE_ID ) + }, + {.device_id =0 }, +}; + + +static struct rte_pci_driver acc101_pci_pf_driver = { + .probe = acc100_pci_probe, + .remove = acc100_pci_remove, + .id_table = pci_id_acc101_pf_map, + .drv_flags =RTE_PCI_DRV_NEED_MAPPING +}; + +static struct rte_pci_driver acc101_pci_vf_driver = { + .probe = acc100_pci_probe, + .remove = acc100_pci_remove, + .id_table = pci_id_acc101_vf_map, + .drv_flags =RTE_PCI_DRV_NEED_MAPPING +}; + +RTE_PMD_REGISTER_PCI (ACC101PF_DRIVER_NAME , acc101_pci_pf_driver); +RTE_PMD_REGISTER_PCI_TABLE (ACC101PF_DRIVER_NAME , pci_id_acc101_pf_map); +RTE_PMD_REGISTER_PCI (ACC101VF_DRIVER_NAME , acc101_pci_vf_driver); +RTE_PMD_REGISTER_PCI_TABLE (ACC101VF_DRIVER_NAME , pci_id_acc101_vf_map); +/* * Workaround implementation to fix the power on status of some 5GUL engines * This requires DMA permission if ported outside DPDK drivers/baseband/acc100/rte_acc100_pmd.h +6
-0@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)/* Number of Virtual Functions ACC100 supports */ @@ -590,6 +595,7 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */ };/** drivers/baseband/acc100/rte_acc101_pmd.h new file +7
-0@@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2022 Intel Corporation +*/ + +/* ACC101 PF and VF driver names */ +#define ACC101PF_DRIVER_NAME intel_acc101_pf +#define ACC101VF_DRIVER_NAME intel_acc101_vf
drivers/baseband/acc100/rte_acc101_pmd.h line 17
Quoted 10 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +10
-0+ +/* ACC101 PCI vendor & device IDs */ +#define RTE_ACC101_VENDOR_ID (0x8086) +#define RTE_ACC101_PF_DEVICE_ID (0x57c4) +#define RTE_ACC101_VF_DEVICE_ID (0x57c5) + +/* Define as 1 to use only a single FEC engine */ +#ifndef RTE_ACC101_SINGLE_FEC +#define RTE_ACC101_SINGLE_FEC 0 +#endif
It should be configurable via a dedicated devarg or via the struct rte_acc100_conf struct, we shouldn't have to recompile to change the device configuration.
drivers/baseband/acc100/rte_acc101_pmd.h line 20
Quoted 3 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +3
-0+ +/* Values used in writing to the registers */ +#define ACC101_REG_IRQ_EN_ALL 0x1FF83FF/* Enable all interrupts */
This define is never used AFAICS, is that expected?
./drivers/baseband/acc100/rte_acc100_pmd.h:63:#define ACC100_REG_IRQ_EN_ALL 0x1FF83FF /* Enable all interrupts */ ./drivers/baseband/acc100/rte_acc101_pmd.h:20:#define ACC101_REG_IRQ_EN_ALL 0x1FF83FF /* Enable all interrupts */
./drivers/baseband/acc100/rte_acc100_pmd.c:590: acc100_reg_write(d, reg_addr->info_ring_en, ACC100_REG_IRQ_EN_ALL);
Quoted 45 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +45
-0+ +/* Number of Virtual Functions ACC101 supports */ +#define ACC101_NUM_VFS 16 +#define ACC101_NUM_QGRPS 8 +#define ACC101_NUM_AQS 16 +/* All ACC101 Registers alignment are 32bits = 4B */ +#define ACC101_BYTES_IN_WORD 4 + +#define ACC101_GRP_ID_SHIFT 10/* Queue Index Hierarchy */ +#define ACC101_VF_ID_SHIFT 4/* Queue Index Hierarchy */ +#define ACC101_VF_OFFSET_QOS 16/* offset in Memory specific to QoS Mon */ +#define ACC101_TMPL_PRI_0 0x03020100 +#define ACC101_TMPL_PRI_1 0x07060504 +#define ACC101_TMPL_PRI_2 0x0b0a0908 +#define ACC101_TMPL_PRI_3 0x0f0e0d0c +#define ACC101_WORDS_IN_ARAM_SIZE (128 * 1024 / 4) + +#define ACC101_NUM_TMPL 32 +/* Mapping of signals for the available engines */ +#define ACC101_SIG_UL_5G 0 +#define ACC101_SIG_UL_5G_LAST 8 +#define ACC101_SIG_DL_5G 13 +#define ACC101_SIG_DL_5G_LAST 15 +#define ACC101_SIG_UL_4G 16 +#define ACC101_SIG_UL_4G_LAST 19 +#define ACC101_SIG_DL_4G 27 +#define ACC101_SIG_DL_4G_LAST 31 +#define ACC101_NUM_ACCS 5 +#define ACC101_PF_VAL 2 + +/* ACC101 Configuration */ +#define ACC101_CFG_DMA_ERROR 0x3D7 +#define ACC101_CFG_AXI_CACHE 0x11 +#define ACC101_CFG_QMGR_HI_P 0x0F0F +#define ACC101_CFG_PCI_AXI 0xC003 +#define ACC101_CFG_PCI_BRIDGE 0x40006033 +#define ACC101_ENGINE_OFFSET 0x1000 +#define ACC101_LONG_WAIT 1000 +#define ACC101_GPEX_AXIMAP_NUM 17 +#define ACC101_CLOCK_GATING_EN 0x30000 +#define ACC101_DMA_INBOUND 0x104 +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF +*/ +#define ACC101_HARQ_DDR (512 * 1)
PATCH v3 2/4 baseband/acc100: modify validation code for ACC101
In reply to Nicolas ChautruThe validation requirement is different for the two devices.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 40 ++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +28 -12
@@ -1293,6 +1293,14 @@return (q->d->device_variant ==ACC100_VARIANT ); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG +static inline bool +validate_op_required (struct acc100_queue *q) +{ +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(const struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,
@@ -2187,8 +2195,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline int -validate_enc_op (struct rte_bbdev_enc_op *op) +validate_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_enc *turbo_enc = &op->turbo_enc;struct rte_bbdev_op_enc_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_enc_turbo_tb_params *tb =NULL ;
@@ -2325,8 +2335,10 @@ static inline uint32_t hq_index(uint32_t offset) }/* Validates LDPC encoder parameters */ static inline int -validate_ldpc_enc_op (struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc;if (op->mempool ==NULL ) {
@@ -2378,8 +2390,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec;if (op->mempool ==NULL ) {
@@ -2434,7 +2448,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2488,7 +2502,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2550,7 +2564,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2607,7 +2621,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2680,8 +2694,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_dec_turbo_tb_params *tb =NULL ;
@@ -2827,7 +2843,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
@@ -3052,7 +3068,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3156,7 +3172,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3246,7 +3262,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
Signature · 1 line
1.8.3.1
PATCH v3 3/4 baseband/acc100: configuration of ACC101 from PF
In reply to Nicolas ChautruAdding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
--- app/test-bbdev/test_bbdev_perf.c | 22 ++- drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302 +++++++++++++++++++++++++++++++ drivers/baseband/acc100/version.map | 2 +- 4 files changed, 336 insertions(+), 7 deletions(-)
app/test-bbdev/test_bbdev_perf.c +16 -6
@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")#endif #define OPS_CACHE_SIZE 256U
@@ -711,11 +713,12 @@ typedef int (test_case_function)(struct active_device *ad,#endif #ifdef RTE_BASEBAND_ACC100 if ((get_init_device () == true) && - (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME ))) { + ((!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) || + (!strcmp (info->drv.driver_name,ACC101PF_DRIVER_NAME )))) {struct rte_acc100_conf conf;unsigned int i; -printf ("Configure ACC100 FEC Driver %s with default values\n" , +printf ("Configure ACC10X FEC Driver %s with default values\n" , info->drv.driver_name);/* clear default configuration before initialization */
@@ -760,10 +763,17 @@ typedef int (test_case_function)(struct active_device *ad, conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ;/* setup PF with configuration information */ - ret =rte_acc100_configure (info->dev_name, &conf); -TEST_ASSERT_SUCCESS (ret, -"Failed to configure ACC100 PF for bbdev %s" , - info->dev_name); +if (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) { + ret =rte_acc100_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC100 PF for bbdev %s" , + info->dev_name); + }else { + ret =rte_acc101_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC101 PF for bbdev %s" , + info->dev_name); + } }#endif /* Let's refresh this now this is configured */
drivers/baseband/acc100/rte_acc100_cfg.h +17 -0
@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the +* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf); + #ifdef __cplusplus }#endif
drivers/baseband/acc100/rte_acc100_pmd.c +302 -0
305 lines not on this page · raw message
drivers/baseband/acc100/version.map +1 -1
@@ -6,5 +6,5 @@ EXPERIMENTAL { global: rte_acc100_configure; - + rte_acc101_configure; };
Signature · 1 line
1.8.3.1
Re: [PATCH v3 3/4] baseband/acc100: configuration of ACC101 from PF
Hi Nicolas,
Quoted 94 lines · Nicolas Chautru
Adding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 22 ++- drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302 +++++++++++++++++++++++++++++++ drivers/baseband/acc100/version.map | 2 +- 4 files changed, 336 insertions(+), 7 deletions(-)app/test-bbdev/test_bbdev_perf.c +16
-6@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")#endif #define OPS_CACHE_SIZE 256U@@ -711,11 +713,12 @@ typedef int (test_case_function)(struct active_device *ad,#endif #ifdef RTE_BASEBAND_ACC100 if ((get_init_device () == true) && - (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME ))) { + ((!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) || + (!strcmp (info->drv.driver_name,ACC101PF_DRIVER_NAME )))) {struct rte_acc100_conf conf;unsigned int i; -printf ("Configure ACC100 FEC Driver %s with default values\n" , +printf ("Configure ACC10X FEC Driver %s with default values\n" , info->drv.driver_name);/* clear default configuration before initialization */ @@ -760,10 +763,17 @@ typedef int (test_case_function)(struct active_device *ad, conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ;/* setup PF with configuration information */ - ret =rte_acc100_configure (info->dev_name, &conf); -TEST_ASSERT_SUCCESS (ret, -"Failed to configure ACC100 PF for bbdev %s" , - info->dev_name); +if (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) { + ret =rte_acc100_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC100 PF for bbdev %s" , + info->dev_name); + }else { + ret =rte_acc101_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC101 PF for bbdev %s" , + info->dev_name); + } }#endif /* Let's refresh this now this is configured */ drivers/baseband/acc100/rte_acc100_cfg.h +17
-0@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the +* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf); + #ifdef __cplusplus }#endif drivers/baseband/acc100/rte_acc100_pmd.c +0
-0
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev) · line 4929
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +6
-0@@ -4921,3 +4921,305 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)rte_bbdev_log_debug ("PF Tip configuration complete for %s" , dev_name);return 0 ; } + + +/* Initial configuration of a ACC101 device prior to running configure() */ +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf) +{
Please don't introduce new API for every new variant.
You should have a single API, and within it call specific configuration function based on the device ID.
It will be easier for the application which calls it not to have to know which variant it is for.
Quoted 24 lines
drivers/baseband/acc100/rte_acc100_pmd.c +24
-0+rte_bbdev_log (INFO ,"rte_acc101_configure" ); +uint32_t value, address, status; +int qg_idx, template_idx, vf_idx, acc, i; +struct rte_bbdev *bbdev =rte_bbdev_get_named_dev (dev_name); + +/* Compile time checks */ +RTE_BUILD_BUG_ON (sizeof (struct acc100_dma_req_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (union acc100_dma_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_td ) !=24 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_te ) !=32 ); + +if (bbdev ==NULL ) { +rte_bbdev_log (ERR , +"Invalid dev_name (%s), or device is not yet initialised" , + dev_name); +return -ENODEV ; + } +struct acc100_device *d = bbdev->data->dev_private; + +/* Store configuration */ +rte_memcpy (&d->acc100_conf, conf,sizeof (d->acc100_conf)); + +/* PCIe Bridge configuration */ +acc100_reg_write (d, HwPfPcieGpexBridgeControl,ACC101_CFG_PCI_BRIDGE );
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev) · line 4963
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+for (i =1 ; i <ACC101_GPEX_AXIMAP_NUM ; i++) +acc100_reg_write (d, HwPfPcieGpexAxiAddrMappingWindowPexBaseHigh + i *16 ,0 ); + +/* Prevent blocking AXI read on BRESP for AXI Write */ + address = HwPfPcieGpexAxiPioControl; + value =ACC101_CFG_PCI_AXI ; +acc100_reg_write (d, address, value); + +/* Explicitly releasing AXI as this may be stopped after PF FLR/BME */ +usleep (2000 );
This sleep looks weird, especially when ACC100 does not require it. Isn't there a way to know it is ready to release the AXI? Or at least document why it is necessary.
Quoted 67 lines
drivers/baseband/acc100/rte_acc100_pmd.c +67
-0+acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* Set the default 5GDL DMA configuration */ +acc100_reg_write (d, HWPfDmaInboundDrainDataSize,ACC101_DMA_INBOUND ); + +/* Enable granular dynamic clock gating */ + address = HWPfHiClkGateHystReg; + value =ACC101_CLOCK_GATING_EN ; +acc100_reg_write (d, address, value); + +/* Set default descriptor signature */ + address = HWPfDmaDescriptorSignatuture; + value =0 ; +acc100_reg_write (d, address, value); + +/* Enable the Error Detection in DMA */ + value =ACC101_CFG_DMA_ERROR ; + address = HWPfDmaErrorDetectionEn; +acc100_reg_write (d, address, value); + +/* AXI Cache configuration */ + value =ACC101_CFG_AXI_CACHE ; + address = HWPfDmaAxcacheReg; +acc100_reg_write (d, address, value); + +/* Default DMA Configuration (Qmgr Enabled) */ + address = HWPfDmaConfig0Reg; + value =0 ; +acc100_reg_write (d, address, value); + address = HWPfDmaQmanen; + value =0 ; +acc100_reg_write (d, address, value); + +/* Default RLIM/ALEN configuration */ + address = HWPfDmaConfig1Reg; +int alen_r =0xF ; +int alen_w =0x7 ; + value = (1 <<31 ) + (alen_w <<20 ) + (1 <<6 ) + alen_r; +acc100_reg_write (d, address, value); + +/* Configure DMA Qmanager addresses */ + address = HWPfDmaQmgrAddrReg; + value = HWPfQmgrEgressQueuesTemplate; +acc100_reg_write (d, address, value); + +/* ===== Qmgr Configuration ===== */ +/* Configuration of the AQueue Depth QMGR_GRP_0_DEPTH_LOG2 for UL */ +int totalQgs = conf->q_ul_4g.num_qgroups + + conf->q_ul_5g.num_qgroups + + conf->q_dl_4g.num_qgroups + + conf->q_dl_5g.num_qgroups; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrDepthLog2Grp + +ACC101_BYTES_IN_WORD * qg_idx; + value =aqDepth (qg_idx, conf); +acc100_reg_write (d, address, value); + address = HWPfQmgrTholdGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value = (1 <<16 ) + (1 << (aqDepth (qg_idx, conf) -1 )); +acc100_reg_write (d, address, value); + } + +/* Template Priority in incremental order */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg0Indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_0 ;
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev) · line 5040
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg1Indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_1 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg2indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_2 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg3Indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_3 ; +acc100_reg_write (d, address, value);
For both ACC100 and ACC101, ACC10x_NUM_TMPL is 32. Isn't there a bug here or in ACC100?
ACC100 performs a modulo 8 on template_idx, but ACC101 does not. But the registers mapping is the same, so I guess this is the same HW block.
I think ACC100 is the buggy one, because it seems weird to write the same register with the same value multiple times.
In case it is ACC100 that is buggy, it needs to be fixed in a dedicated patch, with proper fixes tag so that it is backported.
Quoted 196 lines
drivers/baseband/acc100/rte_acc100_pmd.c +185
-0+ } + + address = HWPfQmgrGrpPriority; + value =ACC101_CFG_QMGR_HI_P ; +acc100_reg_write (d, address, value); + +/* Template Configuration */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) { + value =0 ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 4GUL */ +int numQgs = conf->q_ul_4g.num_qgroups; +int numQqsAcc =0 ; + value =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_4G ; + template_idx <=ACC101_SIG_UL_4G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 5GUL */ + numQqsAcc += numQgs; + numQgs = conf->q_ul_5g.num_qgroups; + value =0 ; +int numEngines =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_5G ; + template_idx <=ACC101_SIG_UL_5G_LAST ; + template_idx++) { +/* Check engine power-on status */ + address = HwPfFecUl5gIbDebugReg + +ACC101_ENGINE_OFFSET * template_idx; + status = (acc100_reg_read (d, address) >>4 ) &0xF ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +if (status ==1 ) { +acc100_reg_write (d, address, value); + numEngines++; + }else +acc100_reg_write (d, address,0 ); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } +printf ("Number of 5GUL engines %d\n" , numEngines); +/* 4GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_4g.num_qgroups; + value =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_4G ; + template_idx <=ACC101_SIG_DL_4G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } +/* 5GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_5g.num_qgroups; + value =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_5G ; + template_idx <=ACC101_SIG_DL_5G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } + +/* Queue Group Function mapping */ +int qman_func_id[8 ] = {0 ,2 ,1 ,3 ,4 ,0 ,0 ,0 }; + address = HWPfQmgrGrpFunction0; + value =0 ; +for (qg_idx =0 ; qg_idx <8 ; qg_idx++) { + acc =accFromQgid (qg_idx, conf); + value |= qman_func_id[acc]<<(qg_idx *4 ); + } +acc100_reg_write (d, address, value); + +/* Configuration of the Arbitration QGroup depth to 1 */ +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrArbQDepthGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value =0 ; +acc100_reg_write (d, address, value); + } + +/* Enabling AQueues through the Queue hierarchy*/ +for (vf_idx =0 ; vf_idx <ACC101_NUM_VFS ; vf_idx++) { +for (qg_idx =0 ; qg_idx <ACC101_NUM_QGRPS ; qg_idx++) { + value =0 ; +if (vf_idx < conf->num_vf_bundles && + qg_idx < totalQgs) + value = (1 <<aqNum (qg_idx, conf)) -1 ; + address = HWPfQmgrAqEnableVf + + vf_idx *ACC101_BYTES_IN_WORD ; + value += (qg_idx <<16 ); +acc100_reg_write (d, address, value); + } + } + +/* This pointer to ARAM (128kB) is shifted by 2 (4B per register) */ +uint32_t aram_address =0 ; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { +for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfQmgrVfBaseAddr + vf_idx + *ACC101_BYTES_IN_WORD + qg_idx + *ACC101_BYTES_IN_WORD *64 ; + value = aram_address; +acc100_reg_write (d, address, value); +/* Offset ARAM Address for next memory bank +* - increment of 4B +*/ + aram_address +=aqNum (qg_idx, conf) * + (1 <<aqDepth (qg_idx, conf)); + } + } + +if (aram_address >ACC101_WORDS_IN_ARAM_SIZE ) { +rte_bbdev_log (ERR ,"ARAM Configuration not fitting %d %d\n" , + aram_address,ACC101_WORDS_IN_ARAM_SIZE ); +return -EINVAL ; + } + +/* ==== HI Configuration ==== */ + +/* No Info Ring/MSI by default */ +acc100_reg_write (d, HWPfHiInfoRingIntWrEnRegPf,0 ); +acc100_reg_write (d, HWPfHiInfoRingVf2pfLoWrEnReg,0 ); +acc100_reg_write (d, HWPfHiCfgMsiIntWrEnRegPf,0xFFFFFFFF ); +acc100_reg_write (d, HWPfHiCfgMsiVf2pfLoWrEnReg,0xFFFFFFFF ); +/* Prevent Block on Transmit Error */ + address = HWPfHiBlockTransmitOnErrorEn; + value =0 ; +acc100_reg_write (d, address, value); +/* Prevents to drop MSI */ + address = HWPfHiMsiDropEnableReg; + value =0 ; +acc100_reg_write (d, address, value); +/* Set the PF Mode register */ + address = HWPfHiPfMode; + value = (conf->pf_mode_en) ?ACC101_PF_VAL :0 ; +acc100_reg_write (d, address, value); +/* Explicitly releasing AXI after PF Mode and 2 ms */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* QoS overflow init */ + value =1 ; + address = HWPfQosmonAEvalOverflow0; +acc100_reg_write (d, address, value); + address = HWPfQosmonBEvalOverflow0; +acc100_reg_write (d, address, value); + +/* HARQ DDR Configuration */ +unsigned int ddrSizeInMb =ACC101_HARQ_DDR ; +for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfDmaVfDdrBaseRw + vf_idx + *0x10 ; + value = ((vf_idx * (ddrSizeInMb /64 )) <<16 ) + + (ddrSizeInMb -1 ); +acc100_reg_write (d, address, value); + } +usleep (ACC101_LONG_WAIT ); + +rte_bbdev_log_debug ("PF TIP configuration complete for %s" , dev_name); +return 0 ; +}drivers/baseband/acc100/version.map +1
-1@@ -6,5 +6,5 @@ EXPERIMENTAL { global: rte_acc100_configure; - + rte_acc101_configure; };
RE: [PATCH v3 3/4] baseband/acc100: configuration of ACC101 from PF
Hi Maxime,
Quoted 135 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Thursday, May 19, 2022 1:14 PM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]
Subject: Re: [PATCH v3 3/4] baseband/acc100: configuration of ACC101 from PFHi Nicolas,
Quoted 1 line · Nicolas Chautru
Adding companion function specific to ACC100 and it > can be called from
bbdev-test when running from PF.
Quoted 5 lines
Signed-off-by Nicolas Chautru <[email protected]> > ---app/test-bbdev/test_bbdev_perf.c | 22 ++- drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302+++++++++++++++++++++++++++++++
Review
Quoted 4 lines
drivers/baseband/acc100/version.map | 2 +- 4 files changed, 336 insertions(+), 7 deletions(-)(quoted diff) +0
-0
b/app/test-bbdev/test_bbdev_perf.capp/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct
Quoted 13 lines
index 0fa119a..b10b93d 100644
app/test-bbdev/test_bbdev_perf.c +2
-0@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")#endif #define OPS_CACHE_SIZE 256U@@ -711,11 +713,12 @@ typedef int (test_case_function)(struct
active_device*ad,app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 4 lines
app/test-bbdev/test_bbdev_perf.c +0
-1#endif #ifdef RTE_BASEBAND_ACC100 if ((get_init_device() == true) && - (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME ))){
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 716
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ ((!strcmp(info->drv.driver_name,
ACC100PF_DRIVER_NAME)) ||app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 717
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ (!strcmp(info->drv.driver_name,
ACC101PF_DRIVER_NAME)))) {app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 4 lines
app/test-bbdev/test_bbdev_perf.c +0
-1struct rte_acc100_conf conf;unsigned int i; - printf("Configure ACC100 FEC Driver %s with defaultvalues\n",
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 721
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ printf("Configure ACC10X FEC Driver %s with defaultvalues\n",
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct
Quoted 4 lines
app/test-bbdev/test_bbdev_perf.c +0
-0info->drv.driver_name);/* clear default configuration before initialization */ @@ -760,10 +763,17 @@ typedef int (test_case_function)(struct
active_device*ad,app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 6 lines
app/test-bbdev/test_bbdev_perf.c +0
-3conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ;/* setup PF with configuration information */ - ret =rte_acc100_configure (info->dev_name, &conf); - TEST_ASSERT_SUCCESS(ret, - "Failed to configure ACC100 PF for bbdev%s",
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 766
Quoted 2 lines
app/test-bbdev/test_bbdev_perf.c +1
-1- info->dev_name); + if (!strcmp(info->drv.driver_name,
ACC100PF_DRIVER_NAME)) {app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ ret =rte_acc100_configure (info->dev_name, &conf); + TEST_ASSERT_SUCCESS(ret, + "Failed to configure ACC100 PF forbbdev %s",
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +5
-0+ info->dev_name); + }else { + ret =rte_acc101_configure (info->dev_name, &conf); + TEST_ASSERT_SUCCESS(ret, + "Failed to configure ACC101 PF forbbdev %s",
Review
Quoted 6 lines
app/test-bbdev/test_bbdev_perf.c +2
-0+ info->dev_name); + } }#endif /* Let's refresh this now this is configured */ (quoted diff) +0
-0
b/drivers/baseband/acc100/rte_acc100_cfg.hdrivers/baseband/acc100/rte_acc100_cfg.h struct rte_acc100_conf { · line 107
Quoted 6 lines
index d233e42..2e3c43f 100644
drivers/baseband/acc100/rte_acc100_cfg.h +0
-0@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure(const char *dev_name, struct rte_acc100_conf*conf);
drivers/baseband/acc100/rte_acc100_cfg.h struct rte_acc100_conf {
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_cfg.h +5
-0+/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0.
drivers/baseband/acc100/rte_acc100_cfg.h struct rte_acc100_conf { · line 113
Quoted 1 line
drivers/baseband/acc100/rte_acc100_cfg.h +1
-0+* It can also be retrieved for a bbdev device from the dev_name field in the
drivers/baseband/acc100/rte_acc100_cfg.h struct rte_acc100_conf {
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_cfg.h +10
-0+* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure(const char *dev_name, struct rte_acc100_conf*conf); > +
Review
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_cfg.h +0
-0#ifdef __cplusplus }#endif (quoted diff) +0
-0
b/drivers/baseband/acc100/rte_acc100_pmd.cdrivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct
Quoted 4 lines
index daf2ce0..b03cedc 100644
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -4921,3 +4921,305 @@ static int acc100_pci_remove(struct
rte_pci_device*pci_dev)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4921
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0rte_bbdev_log_debug("PF Tip configuration complete for %s",
dev_name);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0return 0 ; } + + +/* Initial configuration of a ACC101 device prior to running
configure()*/
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4928
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+int +rte_acc101_configure(const char *dev_name, struct rte_acc100_conf*conf) > +{ Please don't introduce new API for every new variant. You should have a single API, and within it call specific configuration function based on the device ID.
It will be easier for the application which calls it not to have to know which variant it is for.
Note that this is not being used by user application, this is a companion function used as part of bbdev-test so that the device configuration can be done without relying on other ingredients outside of DPDK (pf_bb_config).
Quoted 30 lines
Quoted 15 lines
drivers/baseband/acc100/rte_acc100_pmd.c +14
-0+rte_bbdev_log (INFO ,"rte_acc101_configure" ); +uint32_t value, address, status; +int qg_idx, template_idx, vf_idx, acc, i; +struct rte_bbdev *bbdev =rte_bbdev_get_named_dev (dev_name); + +/* Compile time checks */ +RTE_BUILD_BUG_ON (sizeof (struct acc100_dma_req_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (union acc100_dma_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_td ) !=24 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_te ) !=32 ); + +if (bbdev ==NULL ) { + rte_bbdev_log(ERR, + "Invalid dev_name (%s), or device is not yet initialised",drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ dev_name); +return -ENODEV ; + } +struct acc100_device *d = bbdev->data->dev_private; + +/* Store configuration */ +rte_memcpy (&d->acc100_conf, conf,sizeof (d->acc100_conf)); + +/* PCIe Bridge configuration */ + acc100_reg_write(d, HwPfPcieGpexBridgeControl,
ACC101_CFG_PCI_BRIDGE);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4954
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+for (i =1 ; i <ACC101_GPEX_AXIMAP_NUM ; i++) + acc100_reg_write(d,HwPfPcieGpexAxiAddrMappingWindowPexBaseHigh +
i * 16, 0);
Quoted 11 lines
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev) · line 4963
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +8
-0+ +/* Prevent blocking AXI read on BRESP for AXI Write */ + address = HwPfPcieGpexAxiPioControl; + value =ACC101_CFG_PCI_AXI ; +acc100_reg_write (d, address, value); + +/* Explicitly releasing AXI as this may be stopped after PF FLR/BME */ +usleep (2000 );This sleep looks weird, especially when ACC100 does not require it. Isn't there a way to know it is ready to release the AXI? Or at least document why it is necessary.
This is intentional and HW specific for ACC101. There would be no public documentation for this, but I can add a comment.
Quoted 91 lines
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0+acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* Set the default 5GDL DMA configuration */ + acc100_reg_write(d, HWPfDmaInboundDrainDataSize,
ACC101_DMA_INBOUND);Quoted 33 lines
drivers/baseband/acc100/rte_acc100_pmd.c +33
-0+ +/* Enable granular dynamic clock gating */ + address = HWPfHiClkGateHystReg; + value =ACC101_CLOCK_GATING_EN ; +acc100_reg_write (d, address, value); + +/* Set default descriptor signature */ + address = HWPfDmaDescriptorSignatuture; + value =0 ; +acc100_reg_write (d, address, value); + +/* Enable the Error Detection in DMA */ + value =ACC101_CFG_DMA_ERROR ; + address = HWPfDmaErrorDetectionEn; +acc100_reg_write (d, address, value); + +/* AXI Cache configuration */ + value =ACC101_CFG_AXI_CACHE ; + address = HWPfDmaAxcacheReg; +acc100_reg_write (d, address, value); + +/* Default DMA Configuration (Qmgr Enabled) */ + address = HWPfDmaConfig0Reg; + value =0 ; +acc100_reg_write (d, address, value); + address = HWPfDmaQmanen; + value =0 ; +acc100_reg_write (d, address, value); + +/* Default RLIM/ALEN configuration */ + address = HWPfDmaConfig1Reg; +int alen_r =0xF ; +int alen_w =0x7 ;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ value = (1 <<31 ) + (alen_w <<20 ) + (1 <<6 ) + alen_r; +acc100_reg_write (d, address, value); + +/* Configure DMA Qmanager addresses */ + address = HWPfDmaQmgrAddrReg; + value = HWPfQmgrEgressQueuesTemplate; +acc100_reg_write (d, address, value); + +/* ===== Qmgr Configuration ===== */ +/* Configuration of the AQueue Depth QMGR_GRP_0_DEPTH_LOG2 for UL */
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-0+int totalQgs = conf->q_ul_4g.num_qgroups + + conf->q_ul_5g.num_qgroups + + conf->q_dl_4g.num_qgroups + + conf->q_dl_5g.num_qgroups; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrDepthLog2Grp + +ACC101_BYTES_IN_WORD * qg_idx; + value =aqDepth (qg_idx, conf); +acc100_reg_write (d, address, value);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ address = HWPfQmgrTholdGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value = (1 <<16 ) + (1 << (aqDepth (qg_idx, conf) -1 )); +acc100_reg_write (d, address, value); + } + +/* Template Priority in incremental order */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg0Indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ value =ACC101_TMPL_PRI_0 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg1Indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ value =ACC101_TMPL_PRI_1 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg2indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ value =ACC101_TMPL_PRI_2 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg3Indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 5039
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ value =ACC101_TMPL_PRI_3 ; +acc100_reg_write (d, address, value);For both ACC100 and ACC101,
ACC10x_NUM_TMPLis 32. Isn't there a bug here or in ACC100?
Quoted 8 lines
ACC100 performs a modulo 8 on
template_idx, but ACC101 does not. But the registers mapping is the same, so I guess this is the same HW block.I think ACC100 is the buggy one, because it seems weird to write the same register with the same value multiple times.
In case it is ACC100 that is buggy, it needs to be fixed in a dedicated patch, with proper fixes tag so that it is backported.
Yes there a number of patches pending for ACC100, this can be done through other serie.
Quoted 205 lines
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-0+ } + + address = HWPfQmgrGrpPriority; + value =ACC101_CFG_QMGR_HI_P ; +acc100_reg_write (d, address, value); + +/* Template Configuration */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) {drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ value =0 ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 4GUL */ +int numQgs = conf->q_ul_4g.num_qgroups; +int numQqsAcc =0 ; + value =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_4G ; + template_idx <=ACC101_SIG_UL_4G_LAST ; + template_idx++) {drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 5GUL */ + numQqsAcc += numQgs; + numQgs = conf->q_ul_5g.num_qgroups; + value =0 ; +int numEngines =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
Quoted 15 lines
drivers/baseband/acc100/rte_acc100_pmd.c +15
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_5G ; + template_idx <=ACC101_SIG_UL_5G_LAST ; + template_idx++) { +/* Check engine power-on status */ + address = HwPfFecUl5gIbDebugReg + +ACC101_ENGINE_OFFSET * template_idx; + status = (acc100_reg_read (d, address) >>4 ) &0xF ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +if (status ==1 ) { +acc100_reg_write (d, address, value); + numEngines++; + }else +acc100_reg_write (d, address,0 );drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } +printf ("Number of 5GUL engines %d\n" , numEngines); +/* 4GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_4g.num_qgroups; + value =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +6
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_4G ; + template_idx <=ACC101_SIG_DL_4G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+acc100_reg_write (d, address, value); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } +/* 5GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_5g.num_qgroups; + value =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
Quoted 53 lines
drivers/baseband/acc100/rte_acc100_pmd.c +53
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_5G ; + template_idx <=ACC101_SIG_DL_5G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } + +/* Queue Group Function mapping */ +int qman_func_id[8 ] = {0 ,2 ,1 ,3 ,4 ,0 ,0 ,0 }; + address = HWPfQmgrGrpFunction0; + value =0 ; +for (qg_idx =0 ; qg_idx <8 ; qg_idx++) { + acc =accFromQgid (qg_idx, conf); + value |= qman_func_id[acc]<<(qg_idx *4 ); + } +acc100_reg_write (d, address, value); + +/* Configuration of the Arbitration QGroup depth to 1 */ +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrArbQDepthGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value =0 ; +acc100_reg_write (d, address, value); + } + +/* Enabling AQueues through the Queue hierarchy*/ +for (vf_idx =0 ; vf_idx <ACC101_NUM_VFS ; vf_idx++) { +for (qg_idx =0 ; qg_idx <ACC101_NUM_QGRPS ; qg_idx++) { + value =0 ; +if (vf_idx < conf->num_vf_bundles && + qg_idx < totalQgs) + value = (1 <<aqNum (qg_idx, conf)) -1 ; + address = HWPfQmgrAqEnableVf + + vf_idx *ACC101_BYTES_IN_WORD ; + value += (qg_idx <<16 ); +acc100_reg_write (d, address, value); + } + } + +/* This pointer to ARAM (128kB) is shifted by 2 (4B per register) */ +uint32_t aram_address =0 ; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { +for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfQmgrVfBaseAddr + vf_idx + *ACC101_BYTES_IN_WORD + qg_idx + *ACC101_BYTES_IN_WORD *64 ; + value = aram_address; +acc100_reg_write (d, address, value);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+/* Offset ARAM Address for next memory bank +* - increment of 4B +*/ + aram_address +=aqNum (qg_idx, conf) * + (1 <<aqDepth (qg_idx, conf)); + } + } + +if (aram_address >ACC101_WORDS_IN_ARAM_SIZE ) { + rte_bbdev_log(ERR, "ARAM Configuration not fitting %d%d\n",
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 5177
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ aram_address,
ACC101_WORDS_IN_ARAM_SIZE);Quoted 35 lines
drivers/baseband/acc100/rte_acc100_pmd.c +35
-0+return -EINVAL ; + } + +/* ==== HI Configuration ==== */ + +/* No Info Ring/MSI by default */ +acc100_reg_write (d, HWPfHiInfoRingIntWrEnRegPf,0 ); +acc100_reg_write (d, HWPfHiInfoRingVf2pfLoWrEnReg,0 ); +acc100_reg_write (d, HWPfHiCfgMsiIntWrEnRegPf,0xFFFFFFFF ); +acc100_reg_write (d, HWPfHiCfgMsiVf2pfLoWrEnReg,0xFFFFFFFF ); +/* Prevent Block on Transmit Error */ + address = HWPfHiBlockTransmitOnErrorEn; + value =0 ; +acc100_reg_write (d, address, value); +/* Prevents to drop MSI */ + address = HWPfHiMsiDropEnableReg; + value =0 ; +acc100_reg_write (d, address, value); +/* Set the PF Mode register */ + address = HWPfHiPfMode; + value = (conf->pf_mode_en) ?ACC101_PF_VAL :0 ; +acc100_reg_write (d, address, value); +/* Explicitly releasing AXI after PF Mode and 2 ms */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* QoS overflow init */ + value =1 ; + address = HWPfQosmonAEvalOverflow0; +acc100_reg_write (d, address, value); + address = HWPfQosmonBEvalOverflow0; +acc100_reg_write (d, address, value); + +/* HARQ DDR Configuration */ +unsigned int ddrSizeInMb =ACC101_HARQ_DDR ;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfDmaVfDdrBaseRw + vf_idx + *0x10 ; + value = ((vf_idx * (ddrSizeInMb /64 )) <<16 ) + + (ddrSizeInMb -1 ); +acc100_reg_write (d, address, value); + } +usleep (ACC101_LONG_WAIT ); + + rte_bbdev_log_debug("PF TIP configuration complete for %s",
dev_name);Review
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+return 0 ; +}(quoted diff) +0
-0b/drivers/baseband/acc100/version.map
Quoted 10 lines
index 40604c7..37b850f 100644
drivers/baseband/acc100/version.map +1
-1@@ -6,5 +6,5 @@ EXPERIMENTAL { global: rte_acc100_configure; - + rte_acc101_configure; };
PATCH v3 4/4 baseband/acc100: add protection for some negative scenario
In reply to Nicolas ChautruCatch exception in PMD in case of invalid input parameter.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/baseband/acc100/rte_acc100_pmd.c +6 -0
@@ -1237,6 +1237,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 ) * z_c; }/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;if (rv_index ==1 )return (((bg ==1 ?ACC100_K0_1_1 :ACC100_K0_1_2 ) * n_cb) / n) * z_c;
@@ -1912,6 +1914,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Soft output */ if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_SOFT_OUTPUT )) { +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + }if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER )) *s_out_length = e;
Signature · 1 line
1.8.3.1
Quoted 3 lines · Nicolas Chautru
v3: Feedback from Tom Rix: missing copyright, refactor bbdev-test section calling the configure companion function for ACC100/101, taking the Pmon commit out which is not directly required.
These address some of my comments.
The others, mostly around the treating accXXX as a family of devices and refactoring the common parts out have not been.
Tom
Quoted 38 lines
v2: Based on good feedback from Thomas and David,
now implementing the ACC101 PMD as a close derivative from
existing ACC100 PMD with hooks to have different behaviour based on variant. This prevents code duplication and only rely on different functions and behaviour when hardware requires or support differences.
Note that these are pending changes for ACC100 which would be specific to that device and not ACC101 but these can be managed based on the new implementation, ie.is_acc100()etc... (such incremental changes for ACC100 trending 22.11 but confirming this is future proof).
The serie also includes commits which were meant for ACC101 but are also valuable for ACC100.v1: This serie introduces the PMD for the new bbdev device ACC101 (aka Mount Cirrus). This is a derivative from previous Mount Bryce ACC100 which includes silicon improvement, bug fixes, capacity improvement for 5GNR and feature improvement.
Nicolas Chautru (4):
baseband/acc100: introduce PMD for ACC101 baseband/acc100: modify validation code for ACC101 baseband/acc100: configuration of ACC101 from PF baseband/acc100: add protection for some negative scenarioapp/test-bbdev/test_bbdev_perf.c | 22 +- doc/guides/bbdevs/acc101.rst | 237 ++++++++++++++ doc/guides/bbdevs/features/acc101.ini | 13 + doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 4 + drivers/baseband/acc100/rte_acc100_cfg.h | 17 + drivers/baseband/acc100/rte_acc100_pmd.c | 542 ++++++++++++++++++++++++++++++- drivers/baseband/acc100/rte_acc100_pmd.h | 6 + drivers/baseband/acc100/rte_acc101_pmd.h | 65 ++++ drivers/baseband/acc100/version.map | 2 +- 10 files changed, 885 insertions(+), 24 deletions(-)create mode 100644
doc/guides/bbdevs/acc101.rstcreate mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644drivers/baseband/acc100/rte_acc101_pmd.h
v4 cover drivers/baseband: PMD to support ACC100/ACC101 devices
In reply to Nicolas Chautruv4: incremental updates based on reviews
Changed order of patchset to include two ACC100 specific commits first: updating formally the companion configure function from PF and the protection adjustment.
Then next 3 commits for the actual changes specific to ACC101: the device specific function for FCW 5GUL generation used as a local function, combined documentations into a single .rst common to both devices, updated comments, removed unused #defines.
v3: Feedback from Tom Rix: missing copyright, refactor bbdev-test section calling the configure companion function for ACC100/101, taking the Pmon commit out which is not directly required.
v2: Based on good feedback from Thomas and David,
now implementing the ACC101 PMD as a close derivative from
existing ACC100 PMD with hooks to have different behaviour based on variant. This prevents code duplication and only rely on different functions and behaviour when hardware requires or support differences.
Note that these are pending changes for ACC100 which would be specific to that device and not ACC101 but these can be managed based on the new implementation, ie. is_acc100() etc... (such incremental changes for ACC100 trending 22.11 but confirming this is future proof).
The serie also includes commits which were meant for ACC101 but are also valuable for ACC100.
v1: This serie introduces the PMD for the new bbdev device ACC101 (aka Mount Cirrus). This is a derivative from previous Mount Bryce ACC100 which includes silicon improvement, bug fixes, capacity improvement for 5GNR and feature improvement.
Nicolas Chautru (5):
baseband/acc100: update companion PF configure function baseband/acc100: add protection for some negative scenario baseband/acc100: introduce PMD for ACC101 baseband/acc100: modify validation code for ACC101 baseband/acc100: configuration of ACC101 from PF
MAINTAINERS | 1 + app/test-bbdev/test_bbdev_perf.c | 22 +- doc/guides/bbdevs/acc100.rst | 37 +- doc/guides/bbdevs/features/acc101.ini | 13 + doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/acc100_pf_enum.h | 18 + drivers/baseband/acc100/rte_acc100_cfg.h | 17 + drivers/baseband/acc100/rte_acc100_pmd.c | 685 ++++++++++++++++++++++++++++--- drivers/baseband/acc100/rte_acc100_pmd.h | 26 ++ drivers/baseband/acc100/rte_acc101_pmd.h | 59 +++ drivers/baseband/acc100/version.map | 2 +- 12 files changed, 815 insertions(+), 69 deletions(-) create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
Signature · 1 line
1.8.3.1
PATCH v4 1/5 baseband/acc100: update companion PF configure function
Update of the device configuration function from PF used for bbdev-test to latest sequence for ACC199 PRQ device and matching version in pf_bb_config 22.03.
--- drivers/baseband/acc100/acc100_pf_enum.h | 18 ++++ drivers/baseband/acc100/rte_acc100_pmd.c | 150 ++++++++++++++++++++++++------- drivers/baseband/acc100/rte_acc100_pmd.h | 15 ++++ 3 files changed, 151 insertions(+), 32 deletions(-)
drivers/baseband/acc100/acc100_pf_enum.h +18 -0
@@ -238,6 +238,24 @@ enum { HWPfPermonBTotalLatLowBusMon =0x00BAC504 , HWPfPermonBTotalLatUpperBusMon =0x00BAC508 , HWPfPermonBTotalReqCntBusMon =0x00BAC50C , + HwPfFabI2MArbCntrlReg =0x00BB0000 , + HWPfFabricMode =0x00BB1000 , + HwPfFabI2MGrp0DebugReg =0x00BBF000 , + HwPfFabI2MGrp1DebugReg =0x00BBF004 , + HwPfFabI2MGrp2DebugReg =0x00BBF008 , + HwPfFabI2MGrp3DebugReg =0x00BBF00C , + HwPfFabI2MBuf0DebugReg =0x00BBF010 , + HwPfFabI2MBuf1DebugReg =0x00BBF014 , + HwPfFabI2MBuf2DebugReg =0x00BBF018 , + HwPfFabI2MBuf3DebugReg =0x00BBF01C , + HwPfFabM2IBuf0Grp0DebugReg =0x00BBF020 , + HwPfFabM2IBuf1Grp0DebugReg =0x00BBF024 , + HwPfFabM2IBuf0Grp1DebugReg =0x00BBF028 , + HwPfFabM2IBuf1Grp1DebugReg =0x00BBF02C , + HwPfFabM2IBuf0Grp2DebugReg =0x00BBF030 , + HwPfFabM2IBuf1Grp2DebugReg =0x00BBF034 , + HwPfFabM2IBuf0Grp3DebugReg =0x00BBF038 , + HwPfFabM2IBuf1Grp3DebugReg =0x00BBF03C , HWPfFecUl5gCntrlReg =0x00BC0000 , HWPfFecUl5gI2MThreshReg =0x00BC0004 , HWPfFecUl5gVersionReg = 0x00BC0100,
drivers/baseband/acc100/rte_acc100_pmd.c +118 -32
228 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +15 -0
@@ -153,6 +153,12 @@#define ACC100_CFG_QMGR_HI_P 0x0F0F#define ACC100_CFG_PCI_AXI 0xC003#define ACC100_CFG_PCI_BRIDGE 0x40006033 +#define ACC100_QUAD_NUMS 4 +#define ACC100_LANES_PER_QUAD 4 +#define ACC100_PCIE_LANE_OFFSET 0x200 +#define ACC100_PCIE_QUAD_OFFSET 0x2000 +#define ACC100_PCS_EQ 0x6007 +#define ACC100_ADAPT 0x8400#define ACC100_ENGINE_OFFSET 0x1000#define ACC100_RESET_HI 0x20100#define ACC100_RESET_LO 0x20000
@@ -160,6 +166,15 @@#define ACC100_ENGINES_MAX 9#define ACC100_LONG_WAIT 1000#define ACC100_GPEX_AXIMAP_NUM 17 +#define ACC100_CLOCK_GATING_EN 0x30000 +#define ACC100_FABRIC_MODE 0xB +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF +*/ +#define ACC100_HARQ_DDR (512 * 1) +#define ACC100_PRQ_DDR_VER 0x10092020 +#define ACC100_MS_IN_US (1000) +#define ACC100_DDR_TRAINING_MAX (5000)/* ACC100 DMA Descriptor triplet */ struct acc100_dma_triplet {
Signature · 1 line
1.8.3.1
PATCH v4 2/5 baseband/acc100: add protection for some negative scenario
In reply to Nicolas ChautruCatch exception in PMD in case of invalid input parameter.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/baseband/acc100/rte_acc100_pmd.c +6 -0
@@ -1236,6 +1236,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 ) * z_c; }/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;if (rv_index ==1 )return (((bg ==1 ?ACC100_K0_1_1 :ACC100_K0_1_2 ) * n_cb) / n) * z_c;
@@ -1764,6 +1766,10 @@/* Soft output */ if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_SOFT_OUTPUT )) { +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + }if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER )) *s_out_length = e;
Signature · 1 line
1.8.3.1
PATCH v4 3/5 baseband/acc100: introduce PMD for ACC101
In reply to Nicolas ChautruSupport for ACC101 as a derivative of ACC100.
Reusing existing code when possible.
--- MAINTAINERS | 1 + doc/guides/bbdevs/acc100.rst | 37 ++++-- doc/guides/bbdevs/features/acc101.ini | 13 +++ doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/rte_acc100_pmd.c | 187 ++++++++++++++++++++++++++++++- drivers/baseband/acc100/rte_acc100_pmd.h | 11 ++ drivers/baseband/acc100/rte_acc101_pmd.h | 59 ++++++++++ 8 files changed, 294 insertions(+), 18 deletions(-) create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
MAINTAINERS +1 -0
@@ -1318,6 +1318,7 @@ F: doc/guides/bbdevs/features/fpga_5gnr_fec.ini F: drivers/baseband/acc100/ F: doc/guides/bbdevs/acc100.rst F: doc/guides/bbdevs/features/acc100.ini +F: doc/guides/bbdevs/features/acc101.ini Null baseband M: Nicolas Chautru <[email protected]>
doc/guides/bbdevs/acc100.rst +25 -12
@@ -1,17 +1,19 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2020 Intel Corporation -Intel(R) ACC100 5G/4G FEC Poll Mode Driver -========================================== +Intel(R) ACC100 and ACC101 5G/4G FEC Poll Mode Drivers +====================================================== The BBDEV ACC100 5G/4G FEC poll mode driver (PMD) supports an implementation of a VRAN FEC wireless acceleration function. This device is also known as Mount Bryce. +The BBDEV ACC101, also known as Mount Cirrus, is a derivative device from Mount Bryce +with functional and capacity improvements but still with the same exposed BBDEV capabilities. Features -------- -ACC100 5G/4G FEC PMD supports the following features: +ACC100 and ACC101 5G/4G FEC PMDs support the following features: - LDPC Encode in the DL (5GNR) - LDPC Decode in the UL (5GNR)
@@ -23,7 +25,7 @@ ACC100 5G/4G FEC PMD supports the following features: - MSI - SR-IOV -ACC100 5G/4G FEC PMD supports the following BBDEV capabilities: +ACC100 and ACC101 5G/4G FEC PMDs support the following BBDEV capabilities: * For the LDPC encode operation: - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s)
@@ -80,14 +82,16 @@ hugepage configuration of a server may be examined using: Initialization -------------- -When the device first powers up, its PCI Physical Functions (PF) can be listed through this command: +When the device first powers up, its PCI Physical Functions (PF) can be listed through these +commands for ACC100 and ACC101 respectively: .. code-block:: console sudo lspci -vd8086:0d5c + sudo lspci -vd8086:57c4 The physical and virtual functions are compatible with Linux UIO drivers: -``vfio`` and ``igb_uio``. However, in order to work the ACC100 5G/4G +``vfio`` and ``igb_uio``. However, in order to work the 5G/4G FEC device first needs to be bound to one of these linux drivers through DPDK.
@@ -97,7 +101,8 @@ Bind PF UIO driver(s) Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use ``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. -The igb_uio driver may be bound to the PF PCI device using one of two methods: +The igb_uio driver may be bound to the PF PCI device using one of two methods for ACC100 +(for ACC101 the device id ``57c4`` should be used in lieu of ``0d5c``): 1. PCI functions (physical or virtual, depending on the use case) can be bound to
@@ -121,7 +126,7 @@ the UIO driver by repeating this command for every function. where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:0d5c -In a similar way the ACC100 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. +In a similar way the 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. Enable Virtual Functions
@@ -167,14 +172,14 @@ queues, priorities, load balance, bandwidth and other settings necessary for the device to perform FEC functions. This configuration needs to be executed at least once after reboot or PCI FLR and can -be achieved by using the function ``acc100_configure()``, which sets up the -parameters defined in ``acc100_conf`` structure. +be achieved by using the functions ``acc100_configure()`` or ``acc101_configure()``, +which sets up the parameters defined in the compatible ``acc100_conf`` structure. Test Application ---------------- BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing -the functionality of ACC100 5G/4G FEC encode and decode, depending on the device's +the functionality of the device 5G/4G FEC encode and decode, depending on the device's capabilities. The test application is located under app->test-bbdev folder and has the following options:
@@ -212,7 +217,7 @@ Test Vectors In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides a range of additional tests under the test_vectors folder, which may be useful. The results -of these tests will depend on the ACC100 5G/4G FEC capabilities which may cause some +of these tests will depend on the device 5G/4G FEC capabilities which may cause some testcases to be skipped, but no failure should be reported.
@@ -233,3 +238,11 @@ Specifically for the BBDEV ACC100 PMD, the command below can be used: ./pf_bb_config ACC100 -c acc100/acc100_config_vf_5g.cfg ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_2vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data +
doc/guides/bbdevs/features/acc101.ini new file +13 -0
@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Y
doc/guides/bbdevs/index.rst +1 -0
@@ -14,4 +14,5 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + acc101 la12xx
doc/guides/rel_notes/release_22_07.rst +3 -0
@@ -104,6 +104,9 @@ New Features * ``RTE_EVENT_QUEUE_ATTR_WEIGHT`` * ``RTE_EVENT_QUEUE_ATTR_AFFINITY`` +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device. Removed Items -------------
drivers/baseband/acc100/rte_acc100_pmd.c +181 -6
231 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +11 -0
@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf
@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)/* Number of Virtual Functions ACC100 supports */
@@ -574,6 +579,10 @@ struct __rte_cache_aligned acc100_queue {struct acc100_device *d; }; +typedef void (*acc10x_fcw_ld_fill_fun_t )(struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout); +/* Private data structure for each ACC100 device */ struct acc100_device {void *mmio_base;/**< Base address of MMIO registers (BAR0) */
@@ -605,6 +614,8 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */ +acc10x_fcw_ld_fill_fun_t fcw_ld_fill;/**< 5GUL FCW generation function */ };/**
drivers/baseband/acc100/rte_acc101_pmd.h new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH v4 4/5 baseband/acc100: modify validation code for ACC101
In reply to Nicolas ChautruThe validation requirement is different for the two devices.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 40 ++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +28 -12
@@ -1295,6 +1295,14 @@return (q->d->device_variant ==ACC100_VARIANT ); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG +static inline bool +validate_op_required (struct acc100_queue *q) +{ +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,
@@ -2182,8 +2190,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline int -validate_enc_op (struct rte_bbdev_enc_op *op) +validate_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_enc *turbo_enc = &op->turbo_enc;struct rte_bbdev_op_enc_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_enc_turbo_tb_params *tb =NULL ;
@@ -2320,8 +2330,10 @@ static inline uint32_t hq_index(uint32_t offset) }/* Validates LDPC encoder parameters */ static inline int -validate_ldpc_enc_op (struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc;if (op->mempool ==NULL ) {
@@ -2373,8 +2385,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec;if (op->mempool ==NULL ) {
@@ -2429,7 +2443,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2483,7 +2497,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2545,7 +2559,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2602,7 +2616,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2675,8 +2689,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_dec_turbo_tb_params *tb =NULL ;
@@ -2822,7 +2838,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
@@ -3047,7 +3063,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3151,7 +3167,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3241,7 +3257,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
Signature · 1 line
1.8.3.1
PATCH v4 5/5 baseband/acc100: configuration of ACC101 from PF
In reply to Nicolas ChautruAdding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
--- app/test-bbdev/test_bbdev_perf.c | 22 ++- drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302 +++++++++++++++++++++++++++++++ drivers/baseband/acc100/version.map | 2 +- 4 files changed, 336 insertions(+), 7 deletions(-)
app/test-bbdev/test_bbdev_perf.c +16 -6
@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")#endif #define OPS_CACHE_SIZE 256U
@@ -711,11 +713,12 @@ typedef int (test_case_function)(struct active_device *ad,#endif #ifdef RTE_BASEBAND_ACC100 if ((get_init_device () == true) && - (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME ))) { + ((!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) || + (!strcmp (info->drv.driver_name,ACC101PF_DRIVER_NAME )))) {struct rte_acc100_conf conf;unsigned int i; -printf ("Configure ACC100 FEC Driver %s with default values\n" , +printf ("Configure ACC100/ACC101 FEC Driver %s with default values\n" , info->drv.driver_name);/* clear default configuration before initialization */
@@ -760,10 +763,17 @@ typedef int (test_case_function)(struct active_device *ad, conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ;/* setup PF with configuration information */ - ret =rte_acc100_configure (info->dev_name, &conf); -TEST_ASSERT_SUCCESS (ret, -"Failed to configure ACC100 PF for bbdev %s" , - info->dev_name); +if (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) { + ret =rte_acc100_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC100 PF for bbdev %s" , + info->dev_name); + }else { + ret =rte_acc101_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC101 PF for bbdev %s" , + info->dev_name); + } }#endif /* Let's refresh this now this is configured */
drivers/baseband/acc100/rte_acc100_cfg.h +17 -0
@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the +* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf); + #ifdef __cplusplus }#endif
drivers/baseband/acc100/rte_acc100_pmd.c +302 -0
305 lines not on this page · raw message
drivers/baseband/acc100/version.map +1 -1
@@ -6,5 +6,5 @@ EXPERIMENTAL { global: rte_acc100_configure; - + rte_acc101_configure; };
Signature · 1 line
1.8.3.1
v5 cover drivers/baseband: PMD to support ACC100/ACC101 devices
In reply to Nicolas Chautruv5: minor fix to doc and intermediate commit caught in CI
v4: incremental updates based on reviews Changed order of patchset to include two ACC100 specific commits first: updating formally the companion configure function from PF and the protection adjustment.
Then next 3 commits for the actual changes specific to ACC101: the device specific function for FCW 5GUL generation used as a local function, combined documentations into a single .rst common to both devices, updated comments, removed unused #defines.
v3: Feedback from Tom Rix: missing copyright, refactor bbdev-test section calling the configure companion function for ACC100/101, taking the Pmon commit out which is not directly required.
v2: Based on good feedback from Thomas and David, now implementing the ACC101 PMD as a close derivative from existing ACC100 PMD with hooks to have different behaviour based on variant.
This prevents code duplication and only rely on different functions and behaviour when hardware requires or support differences.
Note that these are pending changes for ACC100 which would be specific to that device and not ACC101 but these can be managed based on the new implementation, ie. is_acc100() etc... (such incremental changes for ACC100 trending 22.11 but confirming this is future proof). The serie also includes commits which were meant for ACC101 but are also valuable for ACC100.
v1: This serie introduces the PMD for the new bbdev device ACC101 (aka Mount Cirrus).
This is a derivative from previous Mount Bryce ACC100 which includes silicon improvement, bug fixes, capacity improvement for 5GNR and feature improvement.
Nicolas Chautru (5):
baseband/acc100: update companion PF configure function baseband/acc100: add protection for some negative scenario baseband/acc100: introduce PMD for ACC101 baseband/acc100: modify validation code for ACC101 baseband/acc100: configuration of ACC101 from PF
MAINTAINERS | 1 + app/test-bbdev/test_bbdev_perf.c | 22 +- doc/guides/bbdevs/acc100.rst | 37 +- doc/guides/bbdevs/features/acc101.ini | 13 + doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/acc100_pf_enum.h | 18 + drivers/baseband/acc100/rte_acc100_cfg.h | 17 + drivers/baseband/acc100/rte_acc100_pmd.c | 686 ++++++++++++++++++++++++++++--- drivers/baseband/acc100/rte_acc100_pmd.h | 26 ++ drivers/baseband/acc100/rte_acc101_pmd.h | 59 +++ drivers/baseband/acc100/version.map | 2 +- 11 files changed, 815 insertions(+), 69 deletions(-) create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
Signature · 1 line
1.8.3.1
PATCH v5 1/5 baseband/acc100: update companion PF configure function
Update of the device configuration function from PF used for bbdev-test to latest sequence for ACC199 PRQ device and matching version in pf_bb_config 22.03.
--- drivers/baseband/acc100/acc100_pf_enum.h | 18 ++++ drivers/baseband/acc100/rte_acc100_pmd.c | 150 ++++++++++++++++++++++++------- drivers/baseband/acc100/rte_acc100_pmd.h | 15 ++++ 3 files changed, 151 insertions(+), 32 deletions(-)
drivers/baseband/acc100/acc100_pf_enum.h +18 -0
@@ -238,6 +238,24 @@ enum { HWPfPermonBTotalLatLowBusMon =0x00BAC504 , HWPfPermonBTotalLatUpperBusMon =0x00BAC508 , HWPfPermonBTotalReqCntBusMon =0x00BAC50C , + HwPfFabI2MArbCntrlReg =0x00BB0000 , + HWPfFabricMode =0x00BB1000 , + HwPfFabI2MGrp0DebugReg =0x00BBF000 , + HwPfFabI2MGrp1DebugReg =0x00BBF004 , + HwPfFabI2MGrp2DebugReg =0x00BBF008 , + HwPfFabI2MGrp3DebugReg =0x00BBF00C , + HwPfFabI2MBuf0DebugReg =0x00BBF010 , + HwPfFabI2MBuf1DebugReg =0x00BBF014 , + HwPfFabI2MBuf2DebugReg =0x00BBF018 , + HwPfFabI2MBuf3DebugReg =0x00BBF01C , + HwPfFabM2IBuf0Grp0DebugReg =0x00BBF020 , + HwPfFabM2IBuf1Grp0DebugReg =0x00BBF024 , + HwPfFabM2IBuf0Grp1DebugReg =0x00BBF028 , + HwPfFabM2IBuf1Grp1DebugReg =0x00BBF02C , + HwPfFabM2IBuf0Grp2DebugReg =0x00BBF030 , + HwPfFabM2IBuf1Grp2DebugReg =0x00BBF034 , + HwPfFabM2IBuf0Grp3DebugReg =0x00BBF038 , + HwPfFabM2IBuf1Grp3DebugReg =0x00BBF03C , HWPfFecUl5gCntrlReg =0x00BC0000 , HWPfFecUl5gI2MThreshReg =0x00BC0004 , HWPfFecUl5gVersionReg = 0x00BC0100,
drivers/baseband/acc100/rte_acc100_pmd.c +118 -32
228 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +15 -0
@@ -153,6 +153,12 @@#define ACC100_CFG_QMGR_HI_P 0x0F0F#define ACC100_CFG_PCI_AXI 0xC003#define ACC100_CFG_PCI_BRIDGE 0x40006033 +#define ACC100_QUAD_NUMS 4 +#define ACC100_LANES_PER_QUAD 4 +#define ACC100_PCIE_LANE_OFFSET 0x200 +#define ACC100_PCIE_QUAD_OFFSET 0x2000 +#define ACC100_PCS_EQ 0x6007 +#define ACC100_ADAPT 0x8400#define ACC100_ENGINE_OFFSET 0x1000#define ACC100_RESET_HI 0x20100#define ACC100_RESET_LO 0x20000
@@ -160,6 +166,15 @@#define ACC100_ENGINES_MAX 9#define ACC100_LONG_WAIT 1000#define ACC100_GPEX_AXIMAP_NUM 17 +#define ACC100_CLOCK_GATING_EN 0x30000 +#define ACC100_FABRIC_MODE 0xB +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF +*/ +#define ACC100_HARQ_DDR (512 * 1) +#define ACC100_PRQ_DDR_VER 0x10092020 +#define ACC100_MS_IN_US (1000) +#define ACC100_DDR_TRAINING_MAX (5000)/* ACC100 DMA Descriptor triplet */ struct acc100_dma_triplet {
Signature · 1 line
1.8.3.1
PATCH v5 2/5 baseband/acc100: add protection for some negative scenario
In reply to Nicolas ChautruCatch exception in PMD in case of invalid input parameter.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/baseband/acc100/rte_acc100_pmd.c +6 -0
@@ -1236,6 +1236,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 ) * z_c; }/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;if (rv_index ==1 )return (((bg ==1 ?ACC100_K0_1_1 :ACC100_K0_1_2 ) * n_cb) / n) * z_c;
@@ -1764,6 +1766,10 @@/* Soft output */ if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_SOFT_OUTPUT )) { +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + }if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER )) *s_out_length = e;
Signature · 1 line
1.8.3.1
PATCH v5 3/5 baseband/acc100: introduce PMD for ACC101
In reply to Nicolas ChautruSupport for ACC101 as a derivative of ACC100.
Reusing existing code when possible.
--- MAINTAINERS | 1 + doc/guides/bbdevs/acc100.rst | 37 +++++-- doc/guides/bbdevs/features/acc101.ini | 13 +++ doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/rte_acc100_pmd.c | 181 ++++++++++++++++++++++++++++++- drivers/baseband/acc100/rte_acc100_pmd.h | 11 ++ drivers/baseband/acc100/rte_acc101_pmd.h | 59 ++++++++++ 7 files changed, 287 insertions(+), 18 deletions(-) create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
MAINTAINERS +1 -0
@@ -1318,6 +1318,7 @@ F: doc/guides/bbdevs/features/fpga_5gnr_fec.ini F: drivers/baseband/acc100/ F: doc/guides/bbdevs/acc100.rst F: doc/guides/bbdevs/features/acc100.ini +F: doc/guides/bbdevs/features/acc101.ini Null baseband M: Nicolas Chautru <[email protected]>
doc/guides/bbdevs/acc100.rst +25 -12
@@ -1,17 +1,19 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2020 Intel Corporation -Intel(R) ACC100 5G/4G FEC Poll Mode Driver -========================================== +Intel(R) ACC100 and ACC101 5G/4G FEC Poll Mode Drivers +====================================================== The BBDEV ACC100 5G/4G FEC poll mode driver (PMD) supports an implementation of a VRAN FEC wireless acceleration function. This device is also known as Mount Bryce. +The BBDEV ACC101, also known as Mount Cirrus, is a derivative device from Mount Bryce +with functional and capacity improvements but still with the same exposed BBDEV capabilities. Features -------- -ACC100 5G/4G FEC PMD supports the following features: +ACC100 and ACC101 5G/4G FEC PMDs support the following features: - LDPC Encode in the DL (5GNR) - LDPC Decode in the UL (5GNR)
@@ -23,7 +25,7 @@ ACC100 5G/4G FEC PMD supports the following features: - MSI - SR-IOV -ACC100 5G/4G FEC PMD supports the following BBDEV capabilities: +ACC100 and ACC101 5G/4G FEC PMDs support the following BBDEV capabilities: * For the LDPC encode operation: - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s)
@@ -80,14 +82,16 @@ hugepage configuration of a server may be examined using: Initialization -------------- -When the device first powers up, its PCI Physical Functions (PF) can be listed through this command: +When the device first powers up, its PCI Physical Functions (PF) can be listed through these +commands for ACC100 and ACC101 respectively: .. code-block:: console sudo lspci -vd8086:0d5c + sudo lspci -vd8086:57c4 The physical and virtual functions are compatible with Linux UIO drivers: -``vfio`` and ``igb_uio``. However, in order to work the ACC100 5G/4G +``vfio`` and ``igb_uio``. However, in order to work the 5G/4G FEC device first needs to be bound to one of these linux drivers through DPDK.
@@ -97,7 +101,8 @@ Bind PF UIO driver(s) Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use ``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. -The igb_uio driver may be bound to the PF PCI device using one of two methods: +The igb_uio driver may be bound to the PF PCI device using one of two methods for ACC100 +(for ACC101 the device id ``57c4`` should be used in lieu of ``0d5c``): 1. PCI functions (physical or virtual, depending on the use case) can be bound to
@@ -121,7 +126,7 @@ the UIO driver by repeating this command for every function. where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:0d5c -In a similar way the ACC100 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. +In a similar way the 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. Enable Virtual Functions
@@ -167,14 +172,14 @@ queues, priorities, load balance, bandwidth and other settings necessary for the device to perform FEC functions. This configuration needs to be executed at least once after reboot or PCI FLR and can -be achieved by using the function ``acc100_configure()``, which sets up the -parameters defined in ``acc100_conf`` structure. +be achieved by using the functions ``acc100_configure()`` or ``acc101_configure()``, +which sets up the parameters defined in the compatible ``acc100_conf`` structure. Test Application ---------------- BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing -the functionality of ACC100 5G/4G FEC encode and decode, depending on the device's +the functionality of the device 5G/4G FEC encode and decode, depending on the device's capabilities. The test application is located under app->test-bbdev folder and has the following options:
@@ -212,7 +217,7 @@ Test Vectors In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides a range of additional tests under the test_vectors folder, which may be useful. The results -of these tests will depend on the ACC100 5G/4G FEC capabilities which may cause some +of these tests will depend on the device 5G/4G FEC capabilities which may cause some testcases to be skipped, but no failure should be reported.
@@ -233,3 +238,11 @@ Specifically for the BBDEV ACC100 PMD, the command below can be used: ./pf_bb_config ACC100 -c acc100/acc100_config_vf_5g.cfg ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_2vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data +
doc/guides/bbdevs/features/acc101.ini new file +13 -0
@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Y
doc/guides/rel_notes/release_22_07.rst +3 -0
@@ -104,6 +104,9 @@ New Features * ``RTE_EVENT_QUEUE_ATTR_WEIGHT`` * ``RTE_EVENT_QUEUE_ATTR_AFFINITY`` +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device. Removed Items -------------
drivers/baseband/acc100/rte_acc100_pmd.c +175 -6
223 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +11 -0
@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf
@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)/* Number of Virtual Functions ACC100 supports */
@@ -574,6 +579,10 @@ struct __rte_cache_aligned acc100_queue {struct acc100_device *d; }; +typedef void (*acc10x_fcw_ld_fill_fun_t )(struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout); +/* Private data structure for each ACC100 device */ struct acc100_device {void *mmio_base;/**< Base address of MMIO registers (BAR0) */
@@ -605,6 +614,8 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */ +acc10x_fcw_ld_fill_fun_t fcw_ld_fill;/**< 5GUL FCW generation function */ };/**
drivers/baseband/acc100/rte_acc101_pmd.h new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH v5 4/5 baseband/acc100: modify validation code for ACC101
In reply to Nicolas ChautruThe validation requirement is different for the two devices.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 47 ++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +35 -12
@@ -1289,6 +1289,21 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG + +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); +} + +static inline bool +validate_op_required (struct acc100_queue *q) +{ +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,
@@ -2176,8 +2191,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline int -validate_enc_op (struct rte_bbdev_enc_op *op) +validate_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_enc *turbo_enc = &op->turbo_enc;struct rte_bbdev_op_enc_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_enc_turbo_tb_params *tb =NULL ;
@@ -2314,8 +2331,10 @@ static inline uint32_t hq_index(uint32_t offset) }/* Validates LDPC encoder parameters */ static inline int -validate_ldpc_enc_op (struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc;if (op->mempool ==NULL ) {
@@ -2367,8 +2386,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec;if (op->mempool ==NULL ) {
@@ -2423,7 +2444,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2477,7 +2498,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2539,7 +2560,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2596,7 +2617,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2669,8 +2690,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_dec_turbo_tb_params *tb =NULL ;
@@ -2816,7 +2839,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
@@ -3041,7 +3064,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3145,7 +3168,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3235,7 +3258,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
Signature · 1 line
1.8.3.1
Re: [PATCH v5 4/5] baseband/acc100: modify validation code for ACC101
Quoted 13 lines · Nicolas Chautru
The validation requirement is different for the two devices.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 47 ++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0
drivers/baseband/acc100/rte_acc100_pmd.c line 1297
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +6
-0@@ -1289,6 +1289,21 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG + +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT );
I keep insisting, but please rely on the PCI device ID, there is no need to introduce a new field.
Quoted 132 lines
drivers/baseband/acc100/rte_acc100_pmd.c +29
-12+} + +static inline bool +validate_op_required (struct acc100_queue *q) +{ +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,@@ -2176,8 +2191,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline int -validate_enc_op (struct rte_bbdev_enc_op *op) +validate_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_enc *turbo_enc = &op->turbo_enc;struct rte_bbdev_op_enc_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_enc_turbo_tb_params *tb =NULL ;@@ -2314,8 +2331,10 @@ static inline uint32_t hq_index(uint32_t offset) }/* Validates LDPC encoder parameters */ static inline int -validate_ldpc_enc_op (struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc;if (op->mempool ==NULL ) {@@ -2367,8 +2386,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec;if (op->mempool ==NULL ) {@@ -2423,7 +2444,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }@@ -2477,7 +2498,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }@@ -2539,7 +2560,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }@@ -2596,7 +2617,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }@@ -2669,8 +2690,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_dec_turbo_tb_params *tb =NULL ;@@ -2816,7 +2839,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }@@ -3041,7 +3064,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }@@ -3145,7 +3168,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }@@ -3235,7 +3258,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
RE: [PATCH v5 4/5] baseband/acc100: modify validation code for ACC101
Quoted 34 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Wednesday, May 25, 2022 7:33 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]
Subject: Re: [PATCH v5 4/5] baseband/acc100: modify validation code for ACC101Quoted 5 lines · Nicolas Chautru
The validation requirement is different for the two devices.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 47++++++++++++++++++++++++--------
Quoted 11 lines
1 file changed, 35 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -1289,6 +1289,21 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); }
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c line 1297
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +6
-0+#ifdef RTE_LIBRTE_BBDEV_DEBUG + +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT );I keep insisting, but please rely on the PCI device ID, there is no need to introduce a new field.
Thanks. I have a couple of concerns changing this:
1) the device id is not accessible from the structures currently passed by the functions which would rely on this. Ie. device_id is accessible from rte_bbdev/rte_device but not from acc100_device or acc100_queue. Would be convoluted to have to carry forward this structure when needed instead of using directly acc100_device structure.
2) These call would be done as part of the workload operation where performance matters, best to keep the check as trivial as possible within the PMD.
Will aim for new patch in next few days based on the other refactory suggestions and unified driver.
Thanks
Nic
Quoted 136 lines
Quoted 12 lines
drivers/baseband/acc100/rte_acc100_pmd.c +8
-0+} + +static inline bool +validate_op_required (struct acc100_queue *q) { +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ldQuoted 1 line
*fcw, @@ -2176,8 +2191,10 @@ static inline
uint32_thq_index(uint32_toffset)
Quoted 122 lines
#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline intdrivers/baseband/acc100/rte_acc100_pmd.c +24
-12-validate_enc_op(struct rte_bbdev_enc_op *op) +validate_enc_op(struct rte_bbdev_enc_op *op, struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_enc *turbo_enc = &op->turbo_enc;struct rte_bbdev_op_enc_turbo_cb_params *cb =NULL ; struct rte_bbdev_op_enc_turbo_tb_params *tb = NULL; @@ -2314,8 +2331,10 @@ static inline uint32_t hq_index(uint32_t offset) }/* Validates LDPC encoder parameters */ static inline int -validate_ldpc_enc_op (struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue +*q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc;if (op->mempool ==NULL ) {@@ -2367,8 +2386,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue +*q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec;if (op->mempool ==NULL ) {@@ -2423,7 +2444,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }@@ -2477,7 +2498,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }@@ -2539,7 +2560,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }@@ -2596,7 +2617,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }@@ -2669,8 +2690,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ; struct rte_bbdev_op_dec_turbo_tb_params *tb = NULL; @@ -2816,7 +2839,7 @@ static inline uint32_t hq_index(uint32_t offset) #ifdef RTE_LIBRTE_BBDEV_DEBUG/* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { + if (validate_dec_op(op, q) == -1) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }@@ -3041,7 +3064,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }@@ -3145,7 +3168,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }@@ -3235,7 +3258,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
Re: [PATCH v5 4/5] baseband/acc100: modify validation code for ACC101
Hi Nicolas,
Quoted 44 lines · Nicolas
Quoted 34 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Wednesday, May 25, 2022 7:33 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]
Subject: Re: [PATCH v5 4/5] baseband/acc100: modify validation code for ACC101Quoted 5 lines · Nicolas Chautru
The validation requirement is different for the two devices.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 47++++++++++++++++++++++++--------
Quoted 11 lines
1 file changed, 35 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -1289,6 +1289,21 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); }Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c line 1297
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +6
-0+#ifdef RTE_LIBRTE_BBDEV_DEBUG + +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT );I keep insisting, but please rely on the PCI device ID, there is no need to introduce a new field.
Quoted 3 lines
Thanks. I have a couple of concerns changing this:
1) the device id is not accessible from the structures currently passed by the functions which would rely on this. Ie.device_idis accessible from rte_bbdev/rte_device but not fromacc100_deviceoracc100_queue. Would be convoluted to have to carry forward this structure when needed instead of using directlyacc100_devicestructure.
2) These call would be done as part of the workload operation where performance matters, best to keep the check as trivial as possible within the PMD.
I think it is better to have a pointer to the rte_bbdev/rte_device than introducing a new ID.
Regarding performance, is_acc100 is only defined in RTE_LIBRTE_BBDEV_DEBUG, so it should not be that critical.
Regarding that, I have hard time to understand why we need to validate encoder/decoder parameters in ACC100 case, but not in ACC101 one. For example, I guess having a valid mempool pointer is required in both ACC100 and ACC101 cases.
Quoted 4 lines
Will aim for new patch in next few days based on the other refactory suggestions and unified driver.
Thanks
Nic
Thanks,
Maxime
RE: [PATCH v5 4/5] baseband/acc100: modify validation code for ACC101
Hi Maxime,
Quoted 67 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Tuesday, May 31, 2022 1:00 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]
Subject: Re: [PATCH v5 4/5] baseband/acc100: modify validation code for ACC101Hi Nicolas,
Quoted 45 lines · Nicolas
Quoted 35 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Wednesday, May 25, 2022 7:33 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]
Subject: Re: [PATCH v5 4/5] baseband/acc100: modify validation code for
ACC101Quoted 5 lines · Nicolas Chautru
The validation requirement is different for the two devices.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 47++++++++++++++++++++++++--------
Quoted 11 lines
1 file changed, 35 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -1289,6 +1289,21 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); }Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c line 1297
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +6
-0+#ifdef RTE_LIBRTE_BBDEV_DEBUG + +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT );I keep insisting, but please rely on the PCI device ID, there is no need to introduce a new field.
Quoted 2 lines
Thanks. I have a couple of concerns changing this:
1) the device id is not accessible from the structures currently passed by thefunctions which would rely on this. Ie.
device_idis accessible from rte_bbdev/rte_device but not fromacc100_deviceoracc100_queue. Would be convoluted to have to carry forward this structure when needed instead of using directlyacc100_devicestructure.Quoted 1 line
2) These call would be done as part of the workload operation where
Quoted 8 lines
performance matters, best to keep the check as trivial as possible within the PMD.
I think it is better to have a pointer to the rte_bbdev/rte_device than introducing a new ID.
Regarding performance,
is_acc100is only defined inRTE_LIBRTE_BBDEV_DEBUG, so it should not be that critical.
That function is not intended to be only used for debug purpose but more generally for other handling when the code would differ from ACC100 vs ACC101, includes future changes targeting next release.
Quoted 5 lines
Regarding that, I have hard time to understand why we need to validate encoder/decoder parameters in ACC100 case, but not in ACC101 one. For example, I guess having a valid mempool pointer is required in both ACC100 and ACC101 cases.
This is due to difference in HW implementation in ACC100 and ACC101, ACC101 HW interface would not require validation in driver of the input API.
Quoted 9 lines
Quoted 2 lines
Will aim for new patch in next few days based on the other refactory
suggestions and unified driver.
Quoted 3 lines
Thanks
NicThanks,
Maxime
PATCH v5 5/5 baseband/acc100: configuration of ACC101 from PF
In reply to Nicolas ChautruAdding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
--- app/test-bbdev/test_bbdev_perf.c | 22 ++- drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302 +++++++++++++++++++++++++++++++ drivers/baseband/acc100/version.map | 2 +- 4 files changed, 336 insertions(+), 7 deletions(-)
app/test-bbdev/test_bbdev_perf.c +16 -6
@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")#endif #define OPS_CACHE_SIZE 256U
@@ -711,11 +713,12 @@ typedef int (test_case_function)(struct active_device *ad,#endif #ifdef RTE_BASEBAND_ACC100 if ((get_init_device () == true) && - (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME ))) { + ((!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) || + (!strcmp (info->drv.driver_name,ACC101PF_DRIVER_NAME )))) {struct rte_acc100_conf conf;unsigned int i; -printf ("Configure ACC100 FEC Driver %s with default values\n" , +printf ("Configure ACC100/ACC101 FEC Driver %s with default values\n" , info->drv.driver_name);/* clear default configuration before initialization */
@@ -760,10 +763,17 @@ typedef int (test_case_function)(struct active_device *ad, conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ;/* setup PF with configuration information */ - ret =rte_acc100_configure (info->dev_name, &conf); -TEST_ASSERT_SUCCESS (ret, -"Failed to configure ACC100 PF for bbdev %s" , - info->dev_name); +if (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) { + ret =rte_acc100_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC100 PF for bbdev %s" , + info->dev_name); + }else { + ret =rte_acc101_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC101 PF for bbdev %s" , + info->dev_name); + } }#endif /* Let's refresh this now this is configured */
drivers/baseband/acc100/rte_acc100_cfg.h +17 -0
@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the +* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf); + #ifdef __cplusplus }#endif
drivers/baseband/acc100/rte_acc100_pmd.c +302 -0
305 lines not on this page · raw message
drivers/baseband/acc100/version.map +1 -1
@@ -6,5 +6,5 @@ EXPERIMENTAL { global: rte_acc100_configure; - + rte_acc101_configure; };
Signature · 1 line
1.8.3.1
Re: [PATCH v5 5/5] baseband/acc100: configuration of ACC101 from PF
Hi Nicolas,
Quoted 48 lines · Nicolas Chautru
Adding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 22 ++- drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302 +++++++++++++++++++++++++++++++ drivers/baseband/acc100/version.map | 2 +- 4 files changed, 336 insertions(+), 7 deletions(-)app/test-bbdev/test_bbdev_perf.c +6
-6@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")#endif #define OPS_CACHE_SIZE 256U@@ -711,11 +713,12 @@ typedef int (test_case_function)(struct active_device *ad,#endif #ifdef RTE_BASEBAND_ACC100 if ((get_init_device () == true) && - (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME ))) { + ((!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) || + (!strcmp (info->drv.driver_name,ACC101PF_DRIVER_NAME )))) {struct rte_acc100_conf conf;unsigned int i; -printf ("Configure ACC100 FEC Driver %s with default values\n" , +printf ("Configure ACC100/ACC101 FEC Driver %s with default values\n" , info->drv.driver_name);/* clear default configuration before initialization */ @@ -760,10 +763,17 @@ typedef int (test_case_function)(struct active_device *ad, conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ;/* setup PF with configuration information */ - ret =rte_acc100_configure (info->dev_name, &conf); -TEST_ASSERT_SUCCESS (ret, -"Failed to configure ACC100 PF for bbdev %s" , - info->dev_name); +if (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME )) {
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad, · line 776
Quoted 10 lines
app/test-bbdev/test_bbdev_perf.c +10
-0+ ret =rte_acc100_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC100 PF for bbdev %s" , + info->dev_name); + }else { + ret =rte_acc101_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure ACC101 PF for bbdev %s" , + info->dev_name); + }
Having a single function for configuration, and a single driver would avoid this.
You can keep the rte_acc100_configure and rte_acc100_configure functions almost unmodified, just remove rte_ prefix and remove them from exported API. Then introduce a rte_acc10x_configure which call proper configuration function based on device ID.
Quoted 352 lines
app/test-bbdev/test_bbdev_perf.c +0
-0}#endif /* Let's refresh this now this is configured */ drivers/baseband/acc100/rte_acc100_cfg.h +17
-0@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the +* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf); + #ifdef __cplusplus }#endif drivers/baseband/acc100/rte_acc100_pmd.c +302
-0@@ -5005,3 +5005,305 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)rte_bbdev_log_debug ("PF Tip configuration complete for %s" , dev_name);return 0 ; } + + +/* Initial configuration of a ACC101 device prior to running configure() */ +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf *conf) +{ +rte_bbdev_log (INFO ,"rte_acc101_configure" ); +uint32_t value, address, status; +int qg_idx, template_idx, vf_idx, acc, i; +struct rte_bbdev *bbdev =rte_bbdev_get_named_dev (dev_name); + +/* Compile time checks */ +RTE_BUILD_BUG_ON (sizeof (struct acc100_dma_req_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (union acc100_dma_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_td ) !=24 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_te ) !=32 ); + +if (bbdev ==NULL ) { +rte_bbdev_log (ERR , +"Invalid dev_name (%s), or device is not yet initialised" , + dev_name); +return -ENODEV ; + } +struct acc100_device *d = bbdev->data->dev_private; + +/* Store configuration */ +rte_memcpy (&d->acc100_conf, conf,sizeof (d->acc100_conf)); + +/* PCIe Bridge configuration */ +acc100_reg_write (d, HwPfPcieGpexBridgeControl,ACC101_CFG_PCI_BRIDGE ); +for (i =1 ; i <ACC101_GPEX_AXIMAP_NUM ; i++) +acc100_reg_write (d, HwPfPcieGpexAxiAddrMappingWindowPexBaseHigh + i *16 ,0 ); + +/* Prevent blocking AXI read on BRESP for AXI Write */ + address = HwPfPcieGpexAxiPioControl; + value =ACC101_CFG_PCI_AXI ; +acc100_reg_write (d, address, value); + +/* Explicitly releasing AXI including a 2ms delay on ACC101 */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* Set the default 5GDL DMA configuration */ +acc100_reg_write (d, HWPfDmaInboundDrainDataSize,ACC101_DMA_INBOUND ); + +/* Enable granular dynamic clock gating */ + address = HWPfHiClkGateHystReg; + value =ACC101_CLOCK_GATING_EN ; +acc100_reg_write (d, address, value); + +/* Set default descriptor signature */ + address = HWPfDmaDescriptorSignatuture; + value =0 ; +acc100_reg_write (d, address, value); + +/* Enable the Error Detection in DMA */ + value =ACC101_CFG_DMA_ERROR ; + address = HWPfDmaErrorDetectionEn; +acc100_reg_write (d, address, value); + +/* AXI Cache configuration */ + value =ACC101_CFG_AXI_CACHE ; + address = HWPfDmaAxcacheReg; +acc100_reg_write (d, address, value); + +/* Default DMA Configuration (Qmgr Enabled) */ + address = HWPfDmaConfig0Reg; + value =0 ; +acc100_reg_write (d, address, value); + address = HWPfDmaQmanen; + value =0 ; +acc100_reg_write (d, address, value); + +/* Default RLIM/ALEN configuration */ + address = HWPfDmaConfig1Reg; +int alen_r =0xF ; +int alen_w =0x7 ; + value = (1 <<31 ) + (alen_w <<20 ) + (1 <<6 ) + alen_r; +acc100_reg_write (d, address, value); + +/* Configure DMA Qmanager addresses */ + address = HWPfDmaQmgrAddrReg; + value = HWPfQmgrEgressQueuesTemplate; +acc100_reg_write (d, address, value); + +/* ===== Qmgr Configuration ===== */ +/* Configuration of the AQueue Depth QMGR_GRP_0_DEPTH_LOG2 for UL */ +int totalQgs = conf->q_ul_4g.num_qgroups + + conf->q_ul_5g.num_qgroups + + conf->q_dl_4g.num_qgroups + + conf->q_dl_5g.num_qgroups; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrDepthLog2Grp + +ACC101_BYTES_IN_WORD * qg_idx; + value =aqDepth (qg_idx, conf); +acc100_reg_write (d, address, value); + address = HWPfQmgrTholdGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value = (1 <<16 ) + (1 << (aqDepth (qg_idx, conf) -1 )); +acc100_reg_write (d, address, value); + } + +/* Template Priority in incremental order */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg0Indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_0 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg1Indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_1 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg2indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_2 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg3Indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_3 ; +acc100_reg_write (d, address, value); + } + + address = HWPfQmgrGrpPriority; + value =ACC101_CFG_QMGR_HI_P ; +acc100_reg_write (d, address, value); + +/* Template Configuration */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) { + value =0 ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 4GUL */ +int numQgs = conf->q_ul_4g.num_qgroups; +int numQqsAcc =0 ; + value =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_4G ; + template_idx <=ACC101_SIG_UL_4G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 5GUL */ + numQqsAcc += numQgs; + numQgs = conf->q_ul_5g.num_qgroups; + value =0 ; +int numEngines =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_5G ; + template_idx <=ACC101_SIG_UL_5G_LAST ; + template_idx++) { +/* Check engine power-on status */ + address = HwPfFecUl5gIbDebugReg + +ACC101_ENGINE_OFFSET * template_idx; + status = (acc100_reg_read (d, address) >>4 ) &0xF ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +if (status ==1 ) { +acc100_reg_write (d, address, value); + numEngines++; + }else +acc100_reg_write (d, address,0 ); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } +printf ("Number of 5GUL engines %d\n" , numEngines); +/* 4GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_4g.num_qgroups; + value =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_4G ; + template_idx <=ACC101_SIG_DL_4G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } +/* 5GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_5g.num_qgroups; + value =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_5G ; + template_idx <=ACC101_SIG_DL_5G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } + +/* Queue Group Function mapping */ +int qman_func_id[8 ] = {0 ,2 ,1 ,3 ,4 ,0 ,0 ,0 }; + address = HWPfQmgrGrpFunction0; + value =0 ; +for (qg_idx =0 ; qg_idx <8 ; qg_idx++) { + acc =accFromQgid (qg_idx, conf); + value |= qman_func_id[acc]<<(qg_idx *4 ); + } +acc100_reg_write (d, address, value); + +/* Configuration of the Arbitration QGroup depth to 1 */ +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrArbQDepthGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value =0 ; +acc100_reg_write (d, address, value); + } + +/* Enabling AQueues through the Queue hierarchy*/ +for (vf_idx =0 ; vf_idx <ACC101_NUM_VFS ; vf_idx++) { +for (qg_idx =0 ; qg_idx <ACC101_NUM_QGRPS ; qg_idx++) { + value =0 ; +if (vf_idx < conf->num_vf_bundles && + qg_idx < totalQgs) + value = (1 <<aqNum (qg_idx, conf)) -1 ; + address = HWPfQmgrAqEnableVf + + vf_idx *ACC101_BYTES_IN_WORD ; + value += (qg_idx <<16 ); +acc100_reg_write (d, address, value); + } + } + +/* This pointer to ARAM (128kB) is shifted by 2 (4B per register) */ +uint32_t aram_address =0 ; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { +for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfQmgrVfBaseAddr + vf_idx + *ACC101_BYTES_IN_WORD + qg_idx + *ACC101_BYTES_IN_WORD *64 ; + value = aram_address; +acc100_reg_write (d, address, value); +/* Offset ARAM Address for next memory bank +* - increment of 4B +*/ + aram_address +=aqNum (qg_idx, conf) * + (1 <<aqDepth (qg_idx, conf)); + } + } + +if (aram_address >ACC101_WORDS_IN_ARAM_SIZE ) { +rte_bbdev_log (ERR ,"ARAM Configuration not fitting %d %d\n" , + aram_address,ACC101_WORDS_IN_ARAM_SIZE ); +return -EINVAL ; + } + +/* ==== HI Configuration ==== */ + +/* No Info Ring/MSI by default */ +acc100_reg_write (d, HWPfHiInfoRingIntWrEnRegPf,0 ); +acc100_reg_write (d, HWPfHiInfoRingVf2pfLoWrEnReg,0 ); +acc100_reg_write (d, HWPfHiCfgMsiIntWrEnRegPf,0xFFFFFFFF ); +acc100_reg_write (d, HWPfHiCfgMsiVf2pfLoWrEnReg,0xFFFFFFFF ); +/* Prevent Block on Transmit Error */ + address = HWPfHiBlockTransmitOnErrorEn; + value =0 ; +acc100_reg_write (d, address, value); +/* Prevents to drop MSI */ + address = HWPfHiMsiDropEnableReg; + value =0 ; +acc100_reg_write (d, address, value); +/* Set the PF Mode register */ + address = HWPfHiPfMode; + value = (conf->pf_mode_en) ?ACC101_PF_VAL :0 ; +acc100_reg_write (d, address, value); +/* Explicitly releasing AXI after PF Mode and 2 ms */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* QoS overflow init */ + value =1 ; + address = HWPfQosmonAEvalOverflow0; +acc100_reg_write (d, address, value); + address = HWPfQosmonBEvalOverflow0; +acc100_reg_write (d, address, value); + +/* HARQ DDR Configuration */ +unsigned int ddrSizeInMb =ACC101_HARQ_DDR ; +for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfDmaVfDdrBaseRw + vf_idx + *0x10 ; + value = ((vf_idx * (ddrSizeInMb /64 )) <<16 ) + + (ddrSizeInMb -1 ); +acc100_reg_write (d, address, value); + } +usleep (ACC101_LONG_WAIT ); + +rte_bbdev_log_debug ("PF TIP configuration complete for %s" , dev_name); +return 0 ; +}drivers/baseband/acc100/version.map +1
-1@@ -6,5 +6,5 @@ EXPERIMENTAL { global: rte_acc100_configure; - + rte_acc101_configure; };
RE: [PATCH v5 5/5] baseband/acc100: configuration of ACC101 from PF
Hi Maxime,
Quoted 90 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Wednesday, May 25, 2022 6:25 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]
Subject: Re: [PATCH v5 5/5] baseband/acc100: configuration of ACC101 from PFHi Nicolas,
Quoted 8 lines · Nicolas Chautru
Adding companion function specific to ACC100 and it can be called from bbdev-test when running from PF.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 22 ++- drivers/baseband/acc100/rte_acc100_cfg.h | 17 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 302+++++++++++++++++++++++++++++++
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct
Quoted 18 lines
drivers/baseband/acc100/version.map | 2 +- 4 files changed, 336 insertions(+), 7 deletions(-)app/test-bbdev/test_bbdev_perf.c +2
-0@@ -63,6 +63,8 @@#define ACC100_QMGR_INVALID_IDX -1#define ACC100_QMGR_RR 1#define ACC100_QOS_GBR 0 +#define ACC101PF_DRIVER_NAME ("intel_acc101_pf") +#define ACC101VF_DRIVER_NAME ("intel_acc101_vf")#endif #define OPS_CACHE_SIZE 256U@@ -711,11 +713,12 @@ typedef int (test_case_function)(struct
active_device*ad,app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 4 lines
app/test-bbdev/test_bbdev_perf.c +0
-1#endif #ifdef RTE_BASEBAND_ACC100 if ((get_init_device() == true) && - (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME ))){
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 716
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ ((!strcmp(info->drv.driver_name,
ACC100PF_DRIVER_NAME)) ||app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct · line 717
Quoted 1 line
app/test-bbdev/test_bbdev_perf.c +1
-0+ (!strcmp(info->drv.driver_name,
ACC101PF_DRIVER_NAME)))) {app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 4 lines
app/test-bbdev/test_bbdev_perf.c +0
-1struct rte_acc100_conf conf;unsigned int i; - printf("Configure ACC100 FEC Driver %s with defaultvalues\n",
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +2
-0+printf ("Configure ACC100/ACC101 FEC Driver %s with default +values\n", info->drv.driver_name); /* clear default configuration before initialization */ @@ -760,10
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 7 lines
+763,17 @@ typedef int (test_case_function)(struct
active_device*ad,
conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH;/* setup PF with configuration information */
app/test-bbdev/test_bbdev_perf.c +0
-3- ret =rte_acc100_configure (info->dev_name, &conf); - TEST_ASSERT_SUCCESS(ret, - "Failed to configure ACC100 PF for bbdev%s",
app/test-bbdev/test_bbdev_perf.c
Quoted 2 lines
app/test-bbdev/test_bbdev_perf.c +1
-1- info->dev_name); + if (!strcmp(info->drv.driver_name,
ACC100PF_DRIVER_NAME)) {app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 3 lines
app/test-bbdev/test_bbdev_perf.c +3
-0+ ret =rte_acc100_configure (info->dev_name, &conf); + TEST_ASSERT_SUCCESS(ret, + "Failed to configure ACC100 PF forbbdev %s",
app/test-bbdev/test_bbdev_perf.c typedef int (test_case_function)(struct active_device *ad,
Quoted 5 lines
app/test-bbdev/test_bbdev_perf.c +5
-0+ info->dev_name); + }else { + ret =rte_acc101_configure (info->dev_name, &conf); + TEST_ASSERT_SUCCESS(ret, + "Failed to configure ACC101 PF forbbdev %s",
app/test-bbdev/test_bbdev_perf.c
Quoted 2 lines
app/test-bbdev/test_bbdev_perf.c +2
-0+ info->dev_name); + }Having a single function for configuration, and a single driver would avoid this.
Quoted 5 lines
You can keep the
rte_acc100_configureandrte_acc100_configurefunctions almost unmodified, just removerte_prefix and remove them from exported API. Then introduce arte_acc10x_configurewhich call proper configuration function based on device ID.
Ok fair enough. Thanks!
Quoted 375 lines
Quoted 9 lines
}
#endif
/* Let's refresh this now this is configured */ diff --gita/drivers/baseband/acc100/rte_acc100_cfg.hb/drivers/baseband/acc100/rte_acc100_cfg.h
index d233e42..2e3c43f 100644drivers/baseband/acc100/rte_acc100_cfg.h struct rte_acc100_conf { · line 115
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_cfg.h +6
-0@@ -106,6 +106,23 @@ struct rte_acc100_conf {int rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +/** +* Configure a ACC101 device +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct
Quoted 21 lines
drivers/baseband/acc100/rte_acc100_cfg.h +12
-0+* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to ACC101 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +__rte_experimental +int +rte_acc101_configure (const char *dev_name,struct rte_acc100_conf +*conf); + #ifdef __cplusplus }#endif drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -5005,3 +5005,305 @@ static int acc100_pci_remove(struct
rte_pci_device*pci_dev)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 5005
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0rte_bbdev_log_debug("PF Tip configuration complete for %s",
dev_name);Quoted 21 lines
drivers/baseband/acc100/rte_acc100_pmd.c +19
-0return 0 ; } + + +/* Initial configuration of a ACC101 device prior to running +configure() */ int rte_acc101_configure (const char *dev_name,struct +rte_acc100_conf *conf) { +rte_bbdev_log (INFO ,"rte_acc101_configure" ); +uint32_t value, address, status; +int qg_idx, template_idx, vf_idx, acc, i; +struct rte_bbdev *bbdev =rte_bbdev_get_named_dev (dev_name); + +/* Compile time checks */ +RTE_BUILD_BUG_ON (sizeof (struct acc100_dma_req_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (union acc100_dma_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_td ) !=24 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_te ) !=32 ); + +if (bbdev ==NULL ) { + rte_bbdev_log(ERR, + "Invalid dev_name (%s), or device is not yet initialised",drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ dev_name); +return -ENODEV ; + } +struct acc100_device *d = bbdev->data->dev_private; + +/* Store configuration */ +rte_memcpy (&d->acc100_conf, conf,sizeof (d->acc100_conf)); + +/* PCIe Bridge configuration */ + acc100_reg_write(d, HwPfPcieGpexBridgeControl,
ACC101_CFG_PCI_BRIDGE);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 5038
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+for (i =1 ; i <ACC101_GPEX_AXIMAP_NUM ; i++) + acc100_reg_write(d,HwPfPcieGpexAxiAddrMappingWindowPexBaseHigh + i
Quoted 47 lines
drivers/baseband/acc100/rte_acc100_pmd.c +47
-0+* 16, 0); + +/* Prevent blocking AXI read on BRESP for AXI Write */ + address = HwPfPcieGpexAxiPioControl; + value =ACC101_CFG_PCI_AXI ; +acc100_reg_write (d, address, value); + +/* Explicitly releasing AXI including a 2ms delay on ACC101 */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* Set the default 5GDL DMA configuration */ +acc100_reg_write (d, HWPfDmaInboundDrainDataSize, +ACC101_DMA_INBOUND ); + +/* Enable granular dynamic clock gating */ + address = HWPfHiClkGateHystReg; + value =ACC101_CLOCK_GATING_EN ; +acc100_reg_write (d, address, value); + +/* Set default descriptor signature */ + address = HWPfDmaDescriptorSignatuture; + value =0 ; +acc100_reg_write (d, address, value); + +/* Enable the Error Detection in DMA */ + value =ACC101_CFG_DMA_ERROR ; + address = HWPfDmaErrorDetectionEn; +acc100_reg_write (d, address, value); + +/* AXI Cache configuration */ + value =ACC101_CFG_AXI_CACHE ; + address = HWPfDmaAxcacheReg; +acc100_reg_write (d, address, value); + +/* Default DMA Configuration (Qmgr Enabled) */ + address = HWPfDmaConfig0Reg; + value =0 ; +acc100_reg_write (d, address, value); + address = HWPfDmaQmanen; + value =0 ; +acc100_reg_write (d, address, value); + +/* Default RLIM/ALEN configuration */ + address = HWPfDmaConfig1Reg; +int alen_r =0xF ; +int alen_w =0x7 ;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ value = (1 <<31 ) + (alen_w <<20 ) + (1 <<6 ) + alen_r; +acc100_reg_write (d, address, value); + +/* Configure DMA Qmanager addresses */ + address = HWPfDmaQmgrAddrReg; + value = HWPfQmgrEgressQueuesTemplate; +acc100_reg_write (d, address, value); + +/* ===== Qmgr Configuration ===== */ +/* Configuration of the AQueue Depth QMGR_GRP_0_DEPTH_LOG2 for UL */
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-0+int totalQgs = conf->q_ul_4g.num_qgroups + + conf->q_ul_5g.num_qgroups + + conf->q_dl_4g.num_qgroups + + conf->q_dl_5g.num_qgroups; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrDepthLog2Grp + +ACC101_BYTES_IN_WORD * qg_idx; + value =aqDepth (qg_idx, conf); +acc100_reg_write (d, address, value);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ address = HWPfQmgrTholdGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value = (1 <<16 ) + (1 << (aqDepth (qg_idx, conf) -1 )); +acc100_reg_write (d, address, value); + } + +/* Template Priority in incremental order */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg0Indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ value =ACC101_TMPL_PRI_0 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg1Indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ value =ACC101_TMPL_PRI_1 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg2indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ value =ACC101_TMPL_PRI_2 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg3Indx +
ACC101_BYTES_IN_WORD*template_idx;Quoted 11 lines
drivers/baseband/acc100/rte_acc100_pmd.c +11
-0+ value =ACC101_TMPL_PRI_3 ; +acc100_reg_write (d, address, value); + } + + address = HWPfQmgrGrpPriority; + value =ACC101_CFG_QMGR_HI_P ; +acc100_reg_write (d, address, value); + +/* Template Configuration */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) {drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ value =0 ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 4GUL */ +int numQgs = conf->q_ul_4g.num_qgroups; +int numQqsAcc =0 ; + value =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_4G ; + template_idx <=ACC101_SIG_UL_4G_LAST ; + template_idx++) {drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 5GUL */ + numQqsAcc += numQgs; + numQgs = conf->q_ul_5g.num_qgroups; + value =0 ; +int numEngines =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
Quoted 15 lines
drivers/baseband/acc100/rte_acc100_pmd.c +15
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_5G ; + template_idx <=ACC101_SIG_UL_5G_LAST ; + template_idx++) { +/* Check engine power-on status */ + address = HwPfFecUl5gIbDebugReg + +ACC101_ENGINE_OFFSET * template_idx; + status = (acc100_reg_read (d, address) >>4 ) &0xF ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +if (status ==1 ) { +acc100_reg_write (d, address, value); + numEngines++; + }else +acc100_reg_write (d, address,0 );drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } +printf ("Number of 5GUL engines %d\n" , numEngines); +/* 4GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_4g.num_qgroups; + value =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +7
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_4G ; + template_idx <=ACC101_SIG_DL_4G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; + acc100_reg_write(d, address, value); #if
RTE_ACC101_SINGLE_FEC== 1drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +8
-0+ value =0 ; +#endif + } +/* 5GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_5g.num_qgroups; + value =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +7
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_5G ; + template_idx <=ACC101_SIG_DL_5G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; + acc100_reg_write(d, address, value); #if
RTE_ACC101_SINGLE_FEC== 1Quoted 45 lines
drivers/baseband/acc100/rte_acc100_pmd.c +45
-0+ value =0 ; +#endif + } + +/* Queue Group Function mapping */ +int qman_func_id[8 ] = {0 ,2 ,1 ,3 ,4 ,0 ,0 ,0 }; + address = HWPfQmgrGrpFunction0; + value =0 ; +for (qg_idx =0 ; qg_idx <8 ; qg_idx++) { + acc =accFromQgid (qg_idx, conf); + value |= qman_func_id[acc]<<(qg_idx *4 ); + } +acc100_reg_write (d, address, value); + +/* Configuration of the Arbitration QGroup depth to 1 */ +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrArbQDepthGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value =0 ; +acc100_reg_write (d, address, value); + } + +/* Enabling AQueues through the Queue hierarchy*/ +for (vf_idx =0 ; vf_idx <ACC101_NUM_VFS ; vf_idx++) { +for (qg_idx =0 ; qg_idx <ACC101_NUM_QGRPS ; qg_idx++) { + value =0 ; +if (vf_idx < conf->num_vf_bundles && + qg_idx < totalQgs) + value = (1 <<aqNum (qg_idx, conf)) -1 ; + address = HWPfQmgrAqEnableVf + + vf_idx *ACC101_BYTES_IN_WORD ; + value += (qg_idx <<16 ); +acc100_reg_write (d, address, value); + } + } + +/* This pointer to ARAM (128kB) is shifted by 2 (4B per register) */ +uint32_t aram_address =0 ; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { +for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfQmgrVfBaseAddr + vf_idx + *ACC101_BYTES_IN_WORD + qg_idx + *ACC101_BYTES_IN_WORD *64 ; + value = aram_address; +acc100_reg_write (d, address, value);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+/* Offset ARAM Address for next memory bank +* - increment of 4B +*/ + aram_address +=aqNum (qg_idx, conf) * + (1 <<aqDepth (qg_idx, conf)); + } + } + +if (aram_address >ACC101_WORDS_IN_ARAM_SIZE ) { + rte_bbdev_log(ERR, "ARAM Configuration not fitting %d%d\n",
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 5261
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ aram_address,
ACC101_WORDS_IN_ARAM_SIZE);Quoted 35 lines
drivers/baseband/acc100/rte_acc100_pmd.c +35
-0+return -EINVAL ; + } + +/* ==== HI Configuration ==== */ + +/* No Info Ring/MSI by default */ +acc100_reg_write (d, HWPfHiInfoRingIntWrEnRegPf,0 ); +acc100_reg_write (d, HWPfHiInfoRingVf2pfLoWrEnReg,0 ); +acc100_reg_write (d, HWPfHiCfgMsiIntWrEnRegPf,0xFFFFFFFF ); +acc100_reg_write (d, HWPfHiCfgMsiVf2pfLoWrEnReg,0xFFFFFFFF ); +/* Prevent Block on Transmit Error */ + address = HWPfHiBlockTransmitOnErrorEn; + value =0 ; +acc100_reg_write (d, address, value); +/* Prevents to drop MSI */ + address = HWPfHiMsiDropEnableReg; + value =0 ; +acc100_reg_write (d, address, value); +/* Set the PF Mode register */ + address = HWPfHiPfMode; + value = (conf->pf_mode_en) ?ACC101_PF_VAL :0 ; +acc100_reg_write (d, address, value); +/* Explicitly releasing AXI after PF Mode and 2 ms */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* QoS overflow init */ + value =1 ; + address = HWPfQosmonAEvalOverflow0; +acc100_reg_write (d, address, value); + address = HWPfQosmonBEvalOverflow0; +acc100_reg_write (d, address, value); + +/* HARQ DDR Configuration */ +unsigned int ddrSizeInMb =ACC101_HARQ_DDR ;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfDmaVfDdrBaseRw + vf_idx + *0x10 ; + value = ((vf_idx * (ddrSizeInMb /64 )) <<16 ) + + (ddrSizeInMb -1 ); +acc100_reg_write (d, address, value); + } +usleep (ACC101_LONG_WAIT ); + + rte_bbdev_log_debug("PF TIP configuration complete for %s",
dev_name);Quoted 14 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+return 0 ; +}drivers/baseband/acc100/version.map +1
-1@@ -6,5 +6,5 @@ EXPERIMENTAL { global: rte_acc100_configure; - + rte_acc101_configure; };
v6 cover drivers/baseband: PMD to support ACC100/ACC101 devices
In reply to Nicolas Chautruv6: use formally an unified driver for AC100 and AC101. Exposing single unified function for the PF device configuration used by bbdev-test.
v5: minor fix to doc and intermediate commit caught in CI
v4: incremental updates based on reviews Changed order of patchset to include two ACC100 specific commits first: updating formally the companion configure function from PF and the protection adjustment.
Then next 3 commits for the actual changes specific to ACC101: the device specific function for FCW 5GUL generation used as a local function, combined documentations into a single .rst common to both devices, updated comments, removed unused #defines.
v3: Feedback from Tom Rix: missing copyright, refactor bbdev-test section calling the configure companion function for ACC100/101, taking the Pmon commit out which is not directly required.
v2: Based on good feedback from Thomas and David, now implementing the ACC101 PMD as a close derivative from existing ACC100 PMD with hooks to have different behaviour based on variant.
This prevents code duplication and only rely on different functions and behaviour when hardware requires or support differences.
Note that these are pending changes for ACC100 which would be specific to that device and not ACC101 but these can be managed based on the new implementation, ie. is_acc100() etc... (such incremental changes for ACC100 trending 22.11 but confirming this is future proof). The serie also includes commits which were meant for ACC101 but are also valuable for ACC100.
v1: This serie introduces the PMD for the new bbdev device ACC101 (aka Mount Cirrus).
This is a derivative from previous Mount Bryce ACC100 which includes silicon improvement, bug fixes, capacity improvement for 5GNR and feature improvement.
Nicolas Chautru (5):
baseband/acc100: update companion PF configure function baseband/acc100: add protection for some negative scenario baseband/acc100: introduce PMD for ACC101 baseband/acc100: modify validation code for ACC101 baseband/acc100: configuration of ACC101 from PF
MAINTAINERS | 1 + app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/bbdevs/acc100.rst | 37 +- doc/guides/bbdevs/features/acc101.ini | 13 + doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/acc100_pf_enum.h | 18 + drivers/baseband/acc100/rte_acc100_cfg.h | 4 +- drivers/baseband/acc100/rte_acc100_pmd.c | 679 ++++++++++++++++++++++++++++--- drivers/baseband/acc100/rte_acc100_pmd.h | 26 ++ drivers/baseband/acc100/rte_acc101_pmd.h | 55 +++ drivers/baseband/acc100/version.map | 3 +- 11 files changed, 773 insertions(+), 72 deletions(-) create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
Signature · 1 line
1.8.3.1
v6 cover drivers/baseband: PMD to support ACC100/ACC101 devices
In reply to Nicolas Chautruv6: use formally an unified driver for AC100 and AC101. Exposing single unified function for the PF device configuration used by bbdev-test.
v5: minor fix to doc and intermediate commit caught in CI
v4: incremental updates based on reviews Changed order of patchset to include two ACC100 specific commits first: updating formally the companion configure function from PF and the protection adjustment.
Then next 3 commits for the actual changes specific to ACC101: the device specific function for FCW 5GUL generation used as a local function, combined documentations into a single .rst common to both devices, updated comments, removed unused #defines.
v3: Feedback from Tom Rix: missing copyright, refactor bbdev-test section calling the configure companion function for ACC100/101, taking the Pmon commit out which is not directly required.
v2: Based on good feedback from Thomas and David, now implementing the ACC101 PMD as a close derivative from existing ACC100 PMD with hooks to have different behaviour based on variant.
This prevents code duplication and only rely on different functions and behaviour when hardware requires or support differences.
Note that these are pending changes for ACC100 which would be specific to that device and not ACC101 but these can be managed based on the new implementation, ie. is_acc100() etc... (such incremental changes for ACC100 trending 22.11 but confirming this is future proof). The serie also includes commits which were meant for ACC101 but are also valuable for ACC100.
v1: This serie introduces the PMD for the new bbdev device ACC101 (aka Mount Cirrus).
This is a derivative from previous Mount Bryce ACC100 which includes silicon improvement, bug fixes, capacity improvement for 5GNR and feature improvement.
Nicolas Chautru (5):
baseband/acc100: update companion PF configure function baseband/acc100: add protection for some negative scenario baseband/acc100: introduce PMD for ACC101 baseband/acc100: modify validation code for ACC101 baseband/acc100: configuration of ACC101 from PF
MAINTAINERS | 1 + app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/bbdevs/acc100.rst | 37 +- doc/guides/bbdevs/features/acc101.ini | 13 + doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/acc100_pf_enum.h | 18 + drivers/baseband/acc100/rte_acc100_cfg.h | 4 +- drivers/baseband/acc100/rte_acc100_pmd.c | 679 ++++++++++++++++++++++++++++--- drivers/baseband/acc100/rte_acc100_pmd.h | 26 ++ drivers/baseband/acc100/rte_acc101_pmd.h | 55 +++ drivers/baseband/acc100/version.map | 3 +- 11 files changed, 773 insertions(+), 72 deletions(-) create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
Signature · 1 line
1.8.3.1
PATCH v6 1/5 baseband/acc100: update companion PF configure function
Update of the device configuration function from PF used for bbdev-test to latest sequence for ACC199 PRQ device and matching version in pf_bb_config 22.03.
--- drivers/baseband/acc100/acc100_pf_enum.h | 18 ++++ drivers/baseband/acc100/rte_acc100_pmd.c | 150 ++++++++++++++++++++++++------- drivers/baseband/acc100/rte_acc100_pmd.h | 15 ++++ 3 files changed, 151 insertions(+), 32 deletions(-)
drivers/baseband/acc100/acc100_pf_enum.h +18 -0
@@ -238,6 +238,24 @@ enum { HWPfPermonBTotalLatLowBusMon =0x00BAC504 , HWPfPermonBTotalLatUpperBusMon =0x00BAC508 , HWPfPermonBTotalReqCntBusMon =0x00BAC50C , + HwPfFabI2MArbCntrlReg =0x00BB0000 , + HWPfFabricMode =0x00BB1000 , + HwPfFabI2MGrp0DebugReg =0x00BBF000 , + HwPfFabI2MGrp1DebugReg =0x00BBF004 , + HwPfFabI2MGrp2DebugReg =0x00BBF008 , + HwPfFabI2MGrp3DebugReg =0x00BBF00C , + HwPfFabI2MBuf0DebugReg =0x00BBF010 , + HwPfFabI2MBuf1DebugReg =0x00BBF014 , + HwPfFabI2MBuf2DebugReg =0x00BBF018 , + HwPfFabI2MBuf3DebugReg =0x00BBF01C , + HwPfFabM2IBuf0Grp0DebugReg =0x00BBF020 , + HwPfFabM2IBuf1Grp0DebugReg =0x00BBF024 , + HwPfFabM2IBuf0Grp1DebugReg =0x00BBF028 , + HwPfFabM2IBuf1Grp1DebugReg =0x00BBF02C , + HwPfFabM2IBuf0Grp2DebugReg =0x00BBF030 , + HwPfFabM2IBuf1Grp2DebugReg =0x00BBF034 , + HwPfFabM2IBuf0Grp3DebugReg =0x00BBF038 , + HwPfFabM2IBuf1Grp3DebugReg =0x00BBF03C , HWPfFecUl5gCntrlReg =0x00BC0000 , HWPfFecUl5gI2MThreshReg =0x00BC0004 , HWPfFecUl5gVersionReg = 0x00BC0100,
drivers/baseband/acc100/rte_acc100_pmd.c +118 -32
228 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +15 -0
@@ -153,6 +153,12 @@#define ACC100_CFG_QMGR_HI_P 0x0F0F#define ACC100_CFG_PCI_AXI 0xC003#define ACC100_CFG_PCI_BRIDGE 0x40006033 +#define ACC100_QUAD_NUMS 4 +#define ACC100_LANES_PER_QUAD 4 +#define ACC100_PCIE_LANE_OFFSET 0x200 +#define ACC100_PCIE_QUAD_OFFSET 0x2000 +#define ACC100_PCS_EQ 0x6007 +#define ACC100_ADAPT 0x8400#define ACC100_ENGINE_OFFSET 0x1000#define ACC100_RESET_HI 0x20100#define ACC100_RESET_LO 0x20000
@@ -160,6 +166,15 @@#define ACC100_ENGINES_MAX 9#define ACC100_LONG_WAIT 1000#define ACC100_GPEX_AXIMAP_NUM 17 +#define ACC100_CLOCK_GATING_EN 0x30000 +#define ACC100_FABRIC_MODE 0xB +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF +*/ +#define ACC100_HARQ_DDR (512 * 1) +#define ACC100_PRQ_DDR_VER 0x10092020 +#define ACC100_MS_IN_US (1000) +#define ACC100_DDR_TRAINING_MAX (5000)/* ACC100 DMA Descriptor triplet */ struct acc100_dma_triplet {
Signature · 1 line
1.8.3.1
PATCH v6 2/5 baseband/acc100: add protection for some negative scenario
In reply to Nicolas ChautruCatch exception in PMD in case of invalid input parameter.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/baseband/acc100/rte_acc100_pmd.c +6 -0
@@ -1236,6 +1236,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 ) * z_c; }/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;if (rv_index ==1 )return (((bg ==1 ?ACC100_K0_1_1 :ACC100_K0_1_2 ) * n_cb) / n) * z_c;
@@ -1764,6 +1766,10 @@/* Soft output */ if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_SOFT_OUTPUT )) { +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + }if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER )) *s_out_length = e;
Signature · 1 line
1.8.3.1
PATCH v6 3/5 baseband/acc100: introduce PMD for ACC101
In reply to Nicolas ChautruSupport for ACC101 as a derivative of ACC100.
Integrated in unified driver and reusing existing code when possible.
--- MAINTAINERS | 1 + doc/guides/bbdevs/acc100.rst | 37 +++++--- doc/guides/bbdevs/features/acc101.ini | 13 +++ doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/rte_acc100_pmd.c | 153 +++++++++++++++++++++++++++++-- drivers/baseband/acc100/rte_acc100_pmd.h | 11 +++ drivers/baseband/acc100/rte_acc101_pmd.h | 55 +++++++++++ 7 files changed, 254 insertions(+), 19 deletions(-) create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/rte_acc101_pmd.h
MAINTAINERS +1 -0
@@ -1318,6 +1318,7 @@ F: doc/guides/bbdevs/features/fpga_5gnr_fec.ini F: drivers/baseband/acc100/ F: doc/guides/bbdevs/acc100.rst F: doc/guides/bbdevs/features/acc100.ini +F: doc/guides/bbdevs/features/acc101.ini Null baseband M: Nicolas Chautru <[email protected]>
doc/guides/bbdevs/acc100.rst +25 -12
@@ -1,17 +1,19 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2020 Intel Corporation -Intel(R) ACC100 5G/4G FEC Poll Mode Driver -========================================== +Intel(R) ACC100 and ACC101 5G/4G FEC Poll Mode Drivers +====================================================== The BBDEV ACC100 5G/4G FEC poll mode driver (PMD) supports an implementation of a VRAN FEC wireless acceleration function. This device is also known as Mount Bryce. +The BBDEV ACC101, also known as Mount Cirrus, is a derivative device from Mount Bryce +with functional and capacity improvements but still with the same exposed BBDEV capabilities. Features -------- -ACC100 5G/4G FEC PMD supports the following features: +ACC100 and ACC101 5G/4G FEC PMDs support the following features: - LDPC Encode in the DL (5GNR) - LDPC Decode in the UL (5GNR)
@@ -23,7 +25,7 @@ ACC100 5G/4G FEC PMD supports the following features: - MSI - SR-IOV -ACC100 5G/4G FEC PMD supports the following BBDEV capabilities: +ACC100 and ACC101 5G/4G FEC PMDs support the following BBDEV capabilities: * For the LDPC encode operation: - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s)
@@ -80,14 +82,16 @@ hugepage configuration of a server may be examined using: Initialization -------------- -When the device first powers up, its PCI Physical Functions (PF) can be listed through this command: +When the device first powers up, its PCI Physical Functions (PF) can be listed through these +commands for ACC100 and ACC101 respectively: .. code-block:: console sudo lspci -vd8086:0d5c + sudo lspci -vd8086:57c4 The physical and virtual functions are compatible with Linux UIO drivers: -``vfio`` and ``igb_uio``. However, in order to work the ACC100 5G/4G +``vfio`` and ``igb_uio``. However, in order to work the 5G/4G FEC device first needs to be bound to one of these linux drivers through DPDK.
@@ -97,7 +101,8 @@ Bind PF UIO driver(s) Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use ``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. -The igb_uio driver may be bound to the PF PCI device using one of two methods: +The igb_uio driver may be bound to the PF PCI device using one of two methods for ACC100 +(for ACC101 the device id ``57c4`` should be used in lieu of ``0d5c``): 1. PCI functions (physical or virtual, depending on the use case) can be bound to
@@ -121,7 +126,7 @@ the UIO driver by repeating this command for every function. where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:0d5c -In a similar way the ACC100 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. +In a similar way the 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. Enable Virtual Functions
@@ -167,14 +172,14 @@ queues, priorities, load balance, bandwidth and other settings necessary for the device to perform FEC functions. This configuration needs to be executed at least once after reboot or PCI FLR and can -be achieved by using the function ``acc100_configure()``, which sets up the -parameters defined in ``acc100_conf`` structure. +be achieved by using the functions ``acc100_configure()`` or ``acc101_configure()``, +which sets up the parameters defined in the compatible ``acc100_conf`` structure. Test Application ---------------- BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing -the functionality of ACC100 5G/4G FEC encode and decode, depending on the device's +the functionality of the device 5G/4G FEC encode and decode, depending on the device's capabilities. The test application is located under app->test-bbdev folder and has the following options:
@@ -212,7 +217,7 @@ Test Vectors In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides a range of additional tests under the test_vectors folder, which may be useful. The results -of these tests will depend on the ACC100 5G/4G FEC capabilities which may cause some +of these tests will depend on the device 5G/4G FEC capabilities which may cause some testcases to be skipped, but no failure should be reported.
@@ -233,3 +238,11 @@ Specifically for the BBDEV ACC100 PMD, the command below can be used: ./pf_bb_config ACC100 -c acc100/acc100_config_vf_5g.cfg ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_2vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data +
doc/guides/bbdevs/features/acc101.ini new file +13 -0
@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Y
doc/guides/rel_notes/release_22_07.rst +3 -0
@@ -104,6 +104,9 @@ New Features * ``RTE_EVENT_QUEUE_ATTR_WEIGHT`` * ``RTE_EVENT_QUEUE_ATTR_AFFINITY`` +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device. Removed Items -------------
drivers/baseband/acc100/rte_acc100_pmd.c +146 -7
202 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +11 -0
@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf
@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)/* Number of Virtual Functions ACC100 supports */
@@ -574,6 +579,10 @@ struct __rte_cache_aligned acc100_queue {struct acc100_device *d; }; +typedef void (*acc10x_fcw_ld_fill_fun_t )(struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout); +/* Private data structure for each ACC100 device */ struct acc100_device {void *mmio_base;/**< Base address of MMIO registers (BAR0) */
@@ -605,6 +614,8 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */ +acc10x_fcw_ld_fill_fun_t fcw_ld_fill;/**< 5GUL FCW generation function */ };/**
drivers/baseband/acc100/rte_acc101_pmd.h new file +55 -0
55 lines not on this page · raw message
Signature · 1 line
1.8.3.1
RE: [EXT] [PATCH v6 3/5] baseband/acc100: introduce PMD for ACC101
Quoted 12 lines
Enable Virtual Functions
(quoted diff) +0
-0@@ -167,14 +172,14 @@ queues, priorities, load balance, bandwidth and othersettings necessary for the
device to perform FEC functions.This configuration needs to be executed at least once after reboot or PCI FLR
and candoc/guides/bbdevs/acc100.rst +1
-2-be achieved by using the function ``acc100_configure()``, which sets up the -parameters defined in ``acc100_conf`` structure. +be achieved by using the functions ``acc100_configure()`` or
Quoted 1 line
``acc101_configure()``,
I believe the API for user is common now. Right? So why to have two references?
Quoted 315 lines
+which sets up the parameters defined in the compatible ``acc100_conf`` structure.
Test Application
----------------BBDEV provides a test application, ``test-bbdev.py`` and range of test data for
testing
-the functionality of ACC100 5G/4G FEC encode and decode, depending on the device's
+the functionality of the device 5G/4G FEC encode and decode, depending on the device's
capabilities. The test application is located under app->test-bbdev folder and
has the
following options:(quoted diff) +0
-0@@ -212,7 +217,7 @@ Test Vectors In addition to the simple LDPC decoder and LDPC encoder tests, bbdev alsoprovides
a range of additional tests under thetest_vectorsfolder, which may be useful.
The results
-of these tests will depend on the ACC100 5G/4G FEC capabilities which may cause some
+of these tests will depend on the device 5G/4G FEC capabilities which may cause some
testcases to be skipped, but no failure should be reported.(quoted diff) +0
-0@@ -233,3 +238,11 @@ Specifically for the BBDEV ACC100 PMD, the commandbelow can be used:
./pf_bb_config ACC100 -c acc100/acc100_config_vf_5g.cfg ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v./ldpc_dec_default.data
doc/guides/bbdevs/acc100.rst +7
-0+ +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_2vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data
(quoted diff) +1
-0+doc/guides/bbdevs/features/acc101.ini new file +13
-0@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Ydoc/guides/rel_notes/release_22_07.rst +3
-0@@ -104,6 +104,9 @@ New Features * ``RTE_EVENT_QUEUE_ATTR_WEIGHT`` * ``RTE_EVENT_QUEUE_ATTR_AFFINITY`` +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device. Removed Items -------------drivers/baseband/acc100/rte_acc100_pmd.c +5
-1@@ -22,6 +22,7 @@#include <rte_bbdev.h> #include <rte_bbdev_pmd.h> #include "rte_acc100_pmd.h" +#include "rte_acc101_pmd.h" #ifdef RTE_LIBRTE_BBDEV_DEBUG RTE_LOG_REGISTER_DEFAULT (acc100_logtype,DEBUG );@@ -1133,7 +1134,10 @@/* ACC100 PCI PF address map */ static struct rte_pci_id pci_id_acc100_pf_map[] = { { -RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID , RTE_ACC100_PF_DEVICE_ID) +RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID ,RTE_ACC100_PF_DEVICE_ID ), + }, + { +RTE_PCI_DEVICE (RTE_ACC101_VENDOR_ID ,RTE_ACC101_PF_DEVICE_ID ),drivers/baseband/acc100/rte_acc100_pmd.c +4
-1}, {.device_id = 0}, };@@ -1141,7 +1145,10 @@/* ACC100 PCI VF address map */ static struct rte_pci_id pci_id_acc100_vf_map[] = { { -RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID , RTE_ACC100_VF_DEVICE_ID) +RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID ,RTE_ACC100_VF_DEVICE_ID ), + }, + { +RTE_PCI_DEVICE (RTE_ACC101_VENDOR_ID ,RTE_ACC101_VF_DEVICE_ID ),drivers/baseband/acc100/rte_acc100_pmd.c +1
-1}, {.device_id = 0}, };@@ -1290,7 +1297,7 @@/* Fill in a frame control word for LDPC decoding. */ static inline void -acc100_fcw_ld_fill (const struct rte_bbdev_dec_op *op,struct acc100_fcw_ld *fcw, +acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw, union acc100_harq_layout_data *harq_layout) {drivers/baseband/acc100/rte_acc100_pmd.c +122
-0uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset;@@ -1414,6 +1421,128 @@ } } +/* Convert offset to harq index for harq_layout structure */ +static inline uint32_t hq_index (uint32_t offset) +{ +return (offset >>ACC100_HARQ_OFFSET_SHIFT ) &ACC100_HARQ_OFFSET_MASK ; +} + +/* Fill in a frame control word for LDPC decoding for ACC101 */ +static inline void +acc101_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout) +{ +uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset; +uint32_t harq_index; +uint32_t l; + + fcw->qm = op->ldpc_dec.q_m; + fcw->nfiller = op->ldpc_dec.n_filler; + fcw->BG = (op->ldpc_dec.basegraph -1 ); + fcw->Zc = op->ldpc_dec.z_c; + fcw->ncb = op->ldpc_dec.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph, + op->ldpc_dec.rv_index); +if (op->ldpc_dec.code_block_mode ==RTE_BBDEV_CODE_BLOCK ) + fcw->rm_e = op->ldpc_dec.cb_params.e; +else + fcw->rm_e = (op->ldpc_dec.tb_params.r < + op->ldpc_dec.tb_params.cab) ? + op->ldpc_dec.tb_params.ea : + op->ldpc_dec.tb_params.eb; + +if (unlikely (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ) && + (op->ldpc_dec.harq_combined_input.length ==0 ))) { +rte_bbdev_log (WARNING ,"Null HARQ input size provided" ); +/* Disable HARQ input in that case to carry forward */ + op->ldpc_dec.op_flags ^=RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ; + } + + fcw->hcin_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ); + fcw->hcout_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE ); + fcw->crc_select =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK ); + fcw->bypass_dec =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DECODE_BYPASS ); + fcw->bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS ); +if (op->ldpc_dec.q_m ==1 ) { + fcw->bypass_intlv =1 ; + fcw->qm =2 ; + } + fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_LLR_COMPRESSION ); + harq_index =hq_index (op->ldpc_dec.harq_combined_output.offset); +if (fcw->hcin_en >0 ) { + harq_in_length = op->ldpc_dec.harq_combined_input.length; +if (fcw->hcin_decomp_mode >0 ) + harq_in_length = harq_in_length *8 /6 ; + harq_in_length =RTE_MIN (harq_in_length, op->ldpc_dec.n_cb + - op->ldpc_dec.n_filler); +/* Alignment on next 64B - Already enforced from HC output */ + harq_in_length =RTE_ALIGN_FLOOR (harq_in_length,64 ); + fcw->hcin_size0 = harq_in_length; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + }else { + fcw->hcin_size0 =0 ; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + } + + fcw->itmax = op->ldpc_dec.iter_max; + fcw->itstop =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->synd_precoder = fcw->itstop; +/* +* These are all implicitly set +* fcw->synd_post = 0; +* fcw->so_en = 0; +* fcw->so_bypass_rm = 0; +* fcw->so_bypass_intlv = 0; +* fcw->dec_convllr = 0; +* fcw->hcout_convllr = 0; +* fcw->hcout_size1 = 0; +* fcw->so_it = 0; +* fcw->hcout_offset = 0; +* fcw->negstop_th = 0; +* fcw->negstop_it = 0; +* fcw->negstop_en = 0; +* fcw->gain_i = 1; +* fcw->gain_h = 1; +*/ +if (fcw->hcout_en >0 ) { + parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) + * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + ncb_p = fcw->ncb - op->ldpc_dec.n_filler; + l =RTE_MIN (k0_p + fcw->rm_e,INT16_MAX ); + harq_out_length = (uint16_t ) fcw->hcin_size0; + harq_out_length =RTE_MAX (harq_out_length, l); +/* Cannot exceed the pruned Ncb circular buffer */ + harq_out_length =RTE_MIN (harq_out_length, ncb_p); +/* Alignment on next 64B */ + harq_out_length =RTE_ALIGN_CEIL (harq_out_length,64 ); + fcw->hcout_size0 = harq_out_length; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + harq_layout[harq_index].offset = fcw->hcout_offset; + harq_layout[harq_index].size0 = fcw->hcout_size0; + }else { + fcw->hcout_size0 =0 ; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + } +} +/** * Fills descriptor with data pointers of one block type. *
drivers/baseband/acc100/rte_acc100_pmd.c +13
-4@@ -2966,7 +3095,7 @@struct acc100_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; -acc100_fcw_ld_fill (op, fcw, harq_layout); + q->d->fcw_ld_fill (op, fcw, harq_layout);/* Special handling when overusing mbuf */ if (fcw->rm_e <ACC100_MAX_E_MBUF )@@ -3033,7 +3162,7 @@ desc = q->ring_addr + desc_idx;uint64_t fcw_offset = (desc_idx <<8 ) +ACC100_DESC_FCW_OFFSET ;union acc100_harq_layout_data *harq_layout = q->d->harq_layout; -acc100_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); + q->d->fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data;@@ -4145,9 +4274,19 @@ dev->dequeue_ldpc_enc_ops = acc100_dequeue_ldpc_enc; dev->dequeue_ldpc_dec_ops = acc100_dequeue_ldpc_dec; +/* Device variant specific handling */ +if ((pci_dev->id.device_id ==RTE_ACC100_PF_DEVICE_ID ) || + (pci_dev->id.device_id ==RTE_ACC100_VF_DEVICE_ID )) { + ((struct acc100_device *) dev->data->dev_private)- >device_variant = ACC100_VARIANT; + ((struct acc100_device *) dev->data->dev_private)->fcw_ld_fill = acc100_fcw_ld_fill; + }else { + ((struct acc100_device *) dev->data->dev_private)- >device_variant = ACC101_VARIANT; + ((struct acc100_device *) dev->data->dev_private)->fcw_ld_fill = acc101_fcw_ld_fill; + } + ((struct acc100_device *) dev->data->dev_private)->pf_device = - !strcmp (drv->driver.name, -RTE_STR (ACC100PF_DRIVER_NAME )); + !strcmp(drv->driver.name,
RTE_STR(ACC100PF_DRIVER_NAME));drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)->mmio_base = pci_dev->mem_resource[0 ].addr;drivers/baseband/acc100/rte_acc100_pmd.h +0
-0
drivers/baseband/acc100/rte_acc100_pmd.h line 26
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.h +2
-0@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1
Since you are using PCI dev id for identifying the device. Do we still need above defines?
drivers/baseband/acc100/rte_acc101_pmd.h
Quoted 41 lines
drivers/baseband/acc100/rte_acc100_pmd.h +3
-0+/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES- 1)/* Number of Virtual Functions ACC100 supports */
drivers/baseband/acc100/rte_acc100_pmd.h +6
-0@@ -574,6 +579,10 @@ struct __rte_cache_aligned acc100_queue {struct acc100_device *d; }; +typedef void (*acc10x_fcw_ld_fill_fun_t )(struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout); +/* Private data structure for each ACC100 device */ struct acc100_device {void *mmio_base;/**< Base address of MMIO registers (BAR0) */ @@ -605,6 +614,8 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */ +acc10x_fcw_ld_fill_fun_t fcw_ld_fill;/**< 5GUL FCW generation function */
};/**
drivers/baseband/acc100/rte_acc101_pmd.h new file +0
-0
This file is internal, shouldn't we drop the rte?
Quoted 4 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +3
-0@@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2022 Intel Corporation +*/
drivers/baseband/acc100/rte_acc101_pmd.h line 13
Quoted 10 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +10
-0+ +/* ACC101 PCI vendor & device IDs */ +#define RTE_ACC101_VENDOR_ID (0x8086) +#define RTE_ACC101_PF_DEVICE_ID (0x57c4) +#define RTE_ACC101_VF_DEVICE_ID (0x57c5) + +/* Define as 1 to use only a single FEC engine */ +#ifndef RTE_ACC101_SINGLE_FEC +#define RTE_ACC101_SINGLE_FEC 0 +#endif
Also the above defines should drop RTE if they are internal symbols.
Quoted 44 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +42
-1+ +/* Number of Virtual Functions ACC101 supports */ +#define ACC101_NUM_VFS 16 +#define ACC101_NUM_QGRPS 8 +#define ACC101_NUM_AQS 16 +/* All ACC101 Registers alignment are 32bits = 4B */ +#define ACC101_BYTES_IN_WORD 4 + +#define ACC101_TMPL_PRI_0 0x03020100 +#define ACC101_TMPL_PRI_1 0x07060504 +#define ACC101_TMPL_PRI_2 0x0b0a0908 +#define ACC101_TMPL_PRI_3 0x0f0e0d0c +#define ACC101_WORDS_IN_ARAM_SIZE (128 * 1024 / 4) + +#define ACC101_NUM_TMPL 32 +/* Mapping of signals for the available engines */ +#define ACC101_SIG_UL_5G 0 +#define ACC101_SIG_UL_5G_LAST 8 +#define ACC101_SIG_DL_5G 13 +#define ACC101_SIG_DL_5G_LAST 15 +#define ACC101_SIG_UL_4G 16 +#define ACC101_SIG_UL_4G_LAST 19 +#define ACC101_SIG_DL_4G 27 +#define ACC101_SIG_DL_4G_LAST 31 +#define ACC101_NUM_ACCS 5 +#define ACC101_PF_VAL 2 + +/* ACC101 Configuration */ +#define ACC101_CFG_DMA_ERROR 0x3D7 +#define ACC101_CFG_AXI_CACHE 0x11 +#define ACC101_CFG_QMGR_HI_P 0x0F0F +#define ACC101_CFG_PCI_AXI 0xC003 +#define ACC101_CFG_PCI_BRIDGE 0x40006033 +#define ACC101_ENGINE_OFFSET 0x1000 +#define ACC101_LONG_WAIT 1000 +#define ACC101_GPEX_AXIMAP_NUM 17 +#define ACC101_CLOCK_GATING_EN 0x30000 +#define ACC101_DMA_INBOUND 0x104 +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF +*/ +#define ACC101_HARQ_DDR (512 * 1) --1.8.3.1
RE: [EXT] [PATCH v6 3/5] baseband/acc100: introduce PMD for ACC101
Hi Akhil,
Quoted 18 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Monday, May 30, 2022 12:40 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v6 3/5] baseband/acc100: introduce PMD for ACC101Quoted 6 lines
Enable Virtual Functions
(quoted diff) +0
-0@@ -167,14 +172,14 @@ queues, priorities, load balance, bandwidth andother settings necessary for the device to perform FEC functions.
Quoted 9 lines
Quoted 6 lines
This configuration needs to be executed at least once after reboot or
PCI FLR and can -be achieved by using the function ``acc100_configure()``, which sets up the -parameters defined in ``acc100_conf`` structure.
+be achieved by using the functions ``acc100_configure()`` or ``acc101_configure()``,I believe the API for user is common now. Right? So why to have two references?
Thanks, I will amend the documentation now.
Quoted 327 lines
Quoted 88 lines
+which sets up the parameters defined in the compatible +``acc100_conf``
structure.Test Application
----------------BBDEV provides a test application, ``test-bbdev.py`` and range of
test data for testing -the functionality of ACC100 5G/4G FEC encode and decode, depending on the device's(quoted diff) +2
-0+the functionality of the device 5G/4G FEC encode and decode, +depending onthe device's
capabilities. The test application is located under app->test-bbdev
folder and has the following options:(quoted diff) +0
-0@@ -212,7 +217,7 @@ Test Vectors In addition to the simple LDPC decoder and LDPC encoder tests, bbdevalso provides a range of additional tests under the
test_vectorsfolder, which may be useful.
The results
-of these tests will depend on the ACC100 5G/4G FEC capabilities which may cause some(quoted diff) +2
-0+of these tests will depend on the device 5G/4G FEC capabilities which +maycause some
testcases to be skipped, but no failure should be reported.(quoted diff) +0
-0@@ -233,3 +238,11 @@ Specifically for the BBDEV ACC100 PMD, thecommand below can be used:
./pf_bb_config ACC100 -c acc100/acc100_config_vf_5g.cfg ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64doc/guides/bbdevs/acc100.rst +8
-1-b 32 -l 1 -v ./ldpc_dec_default.data + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_2vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 + -b 32 -l 1 -v ./ldpc_dec_default.data
(quoted diff) +1
-0+doc/guides/bbdevs/features/acc101.ini new file +13
-0@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Ydoc/guides/rel_notes/release_22_07.rst +3
-0@@ -104,6 +104,9 @@ New Features * ``RTE_EVENT_QUEUE_ATTR_WEIGHT`` * ``RTE_EVENT_QUEUE_ATTR_AFFINITY`` +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device. Removed Items -------------drivers/baseband/acc100/rte_acc100_pmd.c +0
-0drivers/baseband/acc100/rte_acc100_pmd.c line 28
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0@@ -22,6 +22,7 @@#include <rte_bbdev.h> #include <rte_bbdev_pmd.h> #include "rte_acc100_pmd.h" +#include "rte_acc101_pmd.h" #ifdef RTE_LIBRTE_BBDEV_DEBUG RTE_LOG_REGISTER_DEFAULT(acc100_logtype, DEBUG); @@ -1133,7+1134,10
Quoted 47 lines
@@
/* ACC100 PCI PF address map */
static structrte_pci_idpci_id_acc100_pf_map[] = {drivers/baseband/acc100/rte_acc100_pmd.c +0
-1{ - RTE_PCI_DEVICE(RTE_ACC100_VENDOR_ID,
RTE_ACC100_PF_DEVICE_ID)drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ RTE_PCI_DEVICE(RTE_ACC100_VENDOR_ID,
RTE_ACC100_PF_DEVICE_ID),drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ }, + { + RTE_PCI_DEVICE(RTE_ACC101_VENDOR_ID,
RTE_ACC101_PF_DEVICE_ID),drivers/baseband/acc100/rte_acc100_pmd.c +4
-1}, {.device_id = 0}, };@@ -1141,7 +1145,10 @@/* ACC100 PCI VF address map */ static struct rte_pci_id pci_id_acc100_vf_map[] = { { -RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID , RTE_ACC100_VF_DEVICE_ID) +RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID ,RTE_ACC100_VF_DEVICE_ID ), + }, + { +RTE_PCI_DEVICE (RTE_ACC101_VENDOR_ID ,RTE_ACC101_VF_DEVICE_ID ),drivers/baseband/acc100/rte_acc100_pmd.c +0
-0}, {.device_id = 0}, };@@ -1290,7 +1297,7 @@ /* Fill in a frame control word for LDPC decoding. */ static inlinevoid -acc100_fcw_ld_fill(const struct
rte_bbdev_dec_op*op, structacc100_fcw_ld*fcw,drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld +*fcw, union acc100_harq_layout_data *harq_layout) { uint16_t harq_out_length, harq_in_length, ncb_p, k0_p,
parity_offset; @@ -1414,6 +1421,128 @@drivers/baseband/acc100/rte_acc100_pmd.c +3
-0} } +/* Convert offset to harq index for harq_layout structure */ static +inline uint32_t hq_index (uint32_t offset) { + return (offset >> ACC100_HARQ_OFFSET_SHIFT) &
ACC100_HARQ_OFFSET_MASK;drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +7
-0+} + +/* Fill in a frame control word for LDPC decoding for ACC101 */ +static inline void acc101_fcw_ld_fill (struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout) { + uint16_t harq_out_length, harq_in_length, ncb_p, k0_p,
parity_offset;Quoted 56 lines
drivers/baseband/acc100/rte_acc100_pmd.c +24
-0+uint32_t harq_index; +uint32_t l; + + fcw->qm = op->ldpc_dec.q_m; + fcw->nfiller = op->ldpc_dec.n_filler; + fcw->BG = (op->ldpc_dec.basegraph -1 ); + fcw->Zc = op->ldpc_dec.z_c; + fcw->ncb = op->ldpc_dec.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph, + op->ldpc_dec.rv_index); +if (op->ldpc_dec.code_block_mode ==RTE_BBDEV_CODE_BLOCK ) + fcw->rm_e = op->ldpc_dec.cb_params.e; +else + fcw->rm_e = (op->ldpc_dec.tb_params.r < + op->ldpc_dec.tb_params.cab) ? + op->ldpc_dec.tb_params.ea : + op->ldpc_dec.tb_params.eb; + +if (unlikely (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ) && + (op->ldpc_dec.harq_combined_input.length ==0 ))) { +rte_bbdev_log (WARNING ,"Null HARQ input size provided" ); +/* Disable HARQ input in that case to carry forward */ + op->ldpc_dec.op_flags ^=
RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE;drivers/baseband/acc100/rte_acc100_pmd.c +23
-0+ } + + fcw->hcin_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE ); + fcw->hcout_en =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE ); + fcw->crc_select =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK ); + fcw->bypass_dec =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DECODE_BYPASS ); + fcw->bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS ); +if (op->ldpc_dec.q_m ==1 ) { + fcw->bypass_intlv =1 ; + fcw->qm =2 ; + } + fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_LLR_COMPRESSION ); + harq_index = hq_index(op-ldpc_dec.harq_combined_output.offset);
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+if (fcw->hcin_en >0 ) { + harq_in_length = op-ldpc_dec.harq_combined_input.length;
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+if (fcw->hcin_decomp_mode >0 ) + harq_in_length = harq_in_length *8 /6 ; + harq_in_length = RTE_MIN(harq_in_length, op-ldpc_dec.n_cb
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ - op->ldpc_dec.n_filler); +/* Alignment on next 64B - Already enforced from HC output */
Quoted 69 lines
drivers/baseband/acc100/rte_acc100_pmd.c +57
-1+ harq_in_length =RTE_ALIGN_FLOOR (harq_in_length,64 ); + fcw->hcin_size0 = harq_in_length; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + }else { + fcw->hcin_size0 =0 ; + fcw->hcin_offset =0 ; + fcw->hcin_size1 =0 ; + } + + fcw->itmax = op->ldpc_dec.iter_max; + fcw->itstop =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->synd_precoder = fcw->itstop; +/* +* These are all implicitly set +* fcw->synd_post = 0; +* fcw->so_en = 0; +* fcw->so_bypass_rm = 0; +* fcw->so_bypass_intlv = 0; +* fcw->dec_convllr = 0; +* fcw->hcout_convllr = 0; +* fcw->hcout_size1 = 0; +* fcw->so_it = 0; +* fcw->hcout_offset = 0; +* fcw->negstop_th = 0; +* fcw->negstop_it = 0; +* fcw->negstop_en = 0; +* fcw->gain_i = 1; +* fcw->gain_h = 1; +*/ +if (fcw->hcout_en >0 ) { + parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) + * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + ncb_p = fcw->ncb - op->ldpc_dec.n_filler; + l =RTE_MIN (k0_p + fcw->rm_e,INT16_MAX ); + harq_out_length = (uint16_t ) fcw->hcin_size0; + harq_out_length =RTE_MAX (harq_out_length, l); +/* Cannot exceed the pruned Ncb circular buffer */ + harq_out_length =RTE_MIN (harq_out_length, ncb_p); +/* Alignment on next 64B */ + harq_out_length =RTE_ALIGN_CEIL (harq_out_length,64 ); + fcw->hcout_size0 = harq_out_length; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + harq_layout[harq_index].offset = fcw->hcout_offset; + harq_layout[harq_index].size0 = fcw->hcout_size0; + }else { + fcw->hcout_size0 =0 ; + fcw->hcout_size1 =0 ; + fcw->hcout_offset =0 ; + } +} +/** * Fills descriptor with data pointers of one block type. * @@ -2966,7 +3095,7 @@struct acc100_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; -acc100_fcw_ld_fill (op, fcw, harq_layout); + q->d->fcw_ld_fill (op, fcw, harq_layout);/* Special handling when overusing mbuf */ if (fcw->rm_e <ACC100_MAX_E_MBUF )drivers/baseband/acc100/rte_acc100_pmd.c line 3168
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +1
-1@@ -3033,7 +3162,7 @@ desc = q->ring_addr + desc_idx;uint64_t fcw_offset = (desc_idx <<8 ) +ACC100_DESC_FCW_OFFSET ;union acc100_harq_layout_data *harq_layout = q->d->harq_layout; -acc100_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); + q->d->fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data; @@ -4145,9
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 7 lines
+4274,19 @@
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0dev->dequeue_ldpc_enc_ops = acc100_dequeue_ldpc_enc; dev->dequeue_ldpc_dec_ops = acc100_dequeue_ldpc_dec; +/* Device variant specific handling */ + if ((pci_dev->id.device_id == RTE_ACC100_PF_DEVICE_ID) || + (pci_dev->id.device_id ==
RTE_ACC100_VF_DEVICE_ID))Quoted 31 lines
{
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)-Quoted 1 line
device_variant=ACC100_VARIANT;drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)-
fcw_ld_fill
=acc100_fcw_ld_fill;drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ }else { + ((struct acc100_device *) dev->data->dev_private)-Quoted 1 line
device_variant=ACC101_VARIANT;drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)-
fcw_ld_fill
=acc101_fcw_ld_fill;drivers/baseband/acc100/rte_acc100_pmd.c +3
-2+ } + ((struct acc100_device *) dev->data->dev_private)->pf_device = - !strcmp (drv->driver.name, -RTE_STR (ACC100PF_DRIVER_NAME )); + !strcmp(drv->driver.name,
RTE_STR(ACC100PF_DRIVER_NAME));drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ ((struct acc100_device *) dev->data->dev_private)->mmio_base = pci_dev->mem_resource[0 ].addr;drivers/baseband/acc100/rte_acc100_pmd.h +0
-0@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...) #endif
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.h line 26
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.h +2
-0+#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1Since you are using PCI dev id for identifying the device. Do we still need above defines?
The implementation is_acc100() is based on checking that enum
(q->d->device_variant == ACC100_VARIANT);
Quoted 37 lines
drivers/baseband/acc100/rte_acc100_pmd.h line 75
Quoted 11 lines
drivers/baseband/acc100/rte_acc100_pmd.h +3
-0+/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf@@ -67,6 +70,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */
drivers/baseband/acc100/rte_acc100_pmd.h line 76
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.h +0
-0#define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-
Quoted 11 lines
drivers/baseband/acc100/rte_acc100_pmd.h +0
-01)/* Number of Virtual Functions ACC100 supports */ @@ -574,6 +579,10
@@ struct__rte_cache_alignedacc100_queue{drivers/baseband/acc100/rte_acc100_pmd.h +4
-0struct acc100_device *d; }; +typedef void (*acc10x_fcw_ld_fill_fun_t )(struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout); + /* Private data structure for each ACC100 device */ structQuoted 2 lines
acc100_device{
void*mmio_base; /**< Base address of MMIO registers (BAR0) */@@
Quoted 9 lines
-605,6 +614,8 @@ struct
acc100_device{drivers/baseband/acc100/rte_acc100_pmd.h +2
-0uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */ +acc10x_fcw_ld_fill_fun_t fcw_ld_fill;/**< 5GUL FCW generation function */
};
Quoted 9 lines
drivers/baseband/acc100/rte_acc101_pmd.h
Quoted 7 lines
/**
drivers/baseband/acc100/rte_acc101_pmd.h new file +0
-0This file is internal, shouldn't we drop the rte?
There is lack of consistency on the filenaming really historically, still will update the new file. Thanks
Quoted 15 lines
drivers/baseband/acc100/rte_acc101_pmd.h line 10
Quoted 13 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +10
-0@@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2022 Intel Corporation */ + +/* ACC101 PCI vendor & device IDs */ +#define RTE_ACC101_VENDOR_ID (0x8086) +#define RTE_ACC101_PF_DEVICE_ID (0x57c4) +#define RTE_ACC101_VF_DEVICE_ID (0x57c5) + +/* Define as 1 to use only a single FEC engine */ #ifndef +RTE_ACC101_SINGLE_FEC #define RTE_ACC101_SINGLE_FEC 0 #endifAlso the above defines should drop RTE if they are internal symbols.
This is historical as well but will update on current code first with additional commit. Thanks
Quoted 44 lines
Quoted 44 lines
drivers/baseband/acc100/rte_acc101_pmd.h new file +41
-1+ +/* Number of Virtual Functions ACC101 supports */ +#define ACC101_NUM_VFS 16 +#define ACC101_NUM_QGRPS 8 +#define ACC101_NUM_AQS 16 +/* All ACC101 Registers alignment are 32bits = 4B */ +#define ACC101_BYTES_IN_WORD 4 + +#define ACC101_TMPL_PRI_0 0x03020100 +#define ACC101_TMPL_PRI_1 0x07060504 +#define ACC101_TMPL_PRI_2 0x0b0a0908 +#define ACC101_TMPL_PRI_3 0x0f0e0d0c +#define ACC101_WORDS_IN_ARAM_SIZE (128 * 1024 / 4) + +#define ACC101_NUM_TMPL 32 +/* Mapping of signals for the available engines */ +#define ACC101_SIG_UL_5G 0 +#define ACC101_SIG_UL_5G_LAST 8 +#define ACC101_SIG_DL_5G 13 +#define ACC101_SIG_DL_5G_LAST 15 +#define ACC101_SIG_UL_4G 16 +#define ACC101_SIG_UL_4G_LAST 19 +#define ACC101_SIG_DL_4G 27 +#define ACC101_SIG_DL_4G_LAST 31 +#define ACC101_NUM_ACCS 5 +#define ACC101_PF_VAL 2 + +/* ACC101 Configuration */ +#define ACC101_CFG_DMA_ERROR 0x3D7 +#define ACC101_CFG_AXI_CACHE 0x11 +#define ACC101_CFG_QMGR_HI_P 0x0F0F +#define ACC101_CFG_PCI_AXI 0xC003 +#define ACC101_CFG_PCI_BRIDGE 0x40006033 +#define ACC101_ENGINE_OFFSET 0x1000 +#define ACC101_LONG_WAIT 1000 +#define ACC101_GPEX_AXIMAP_NUM 17 +#define ACC101_CLOCK_GATING_EN 0x30000 +#define ACC101_DMA_INBOUND 0x104 +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF */ +#define ACC101_HARQ_DDR (512 * 1) --1.8.3.1
PATCH v6 4/5 baseband/acc100: modify validation code for ACC101
In reply to Nicolas ChautruThe validation requirement is different for the two devices.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 47 ++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +35 -12
@@ -1295,6 +1295,21 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG + +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); +} + +static inline bool +validate_op_required (struct acc100_queue *q) +{ +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,
@@ -2182,8 +2197,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline int -validate_enc_op (struct rte_bbdev_enc_op *op) +validate_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_enc *turbo_enc = &op->turbo_enc;struct rte_bbdev_op_enc_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_enc_turbo_tb_params *tb =NULL ;
@@ -2320,8 +2337,10 @@ static inline uint32_t hq_index(uint32_t offset) }/* Validates LDPC encoder parameters */ static inline int -validate_ldpc_enc_op (struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc;if (op->mempool ==NULL ) {
@@ -2373,8 +2392,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec;if (op->mempool ==NULL ) {
@@ -2429,7 +2450,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2483,7 +2504,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2545,7 +2566,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2602,7 +2623,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2675,8 +2696,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_dec_turbo_tb_params *tb =NULL ;
@@ -2822,7 +2845,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
@@ -3047,7 +3070,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3151,7 +3174,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3241,7 +3264,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
Signature · 1 line
1.8.3.1
Re: [PATCH v6 4/5] baseband/acc100: modify validation code for ACC101
Quoted 35 lines · Nicolas Chautru
The validation requirement is different for the two devices.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 47 ++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +15
-0@@ -1295,6 +1295,21 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG + +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); +} + +static inline bool +validate_op_required (struct acc100_queue *q) +{ +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,
drivers/baseband/acc100/rte_acc100_pmd.c static inline uint32_t hq_index(uint32_t offset) · line 2203
Quoted 8 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-1@@ -2182,8 +2197,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline int -validate_enc_op (struct rte_bbdev_enc_op *op) +validate_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;
This check should be done after the variables declarations as per the project coding style:
"
Local Variables
~~~~~~~~~~~~~~~
* Variables should be declared at the start of a block of code rather than in the middle. "
Quoted 111 lines
drivers/baseband/acc100/rte_acc100_pmd.c +17
-11struct rte_bbdev_op_turbo_enc *turbo_enc = &op->turbo_enc;struct rte_bbdev_op_enc_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_enc_turbo_tb_params *tb =NULL ;@@ -2320,8 +2337,10 @@ static inline uint32_t hq_index(uint32_t offset) }/* Validates LDPC encoder parameters */ static inline int -validate_ldpc_enc_op (struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc;if (op->mempool ==NULL ) {@@ -2373,8 +2392,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec;if (op->mempool ==NULL ) {@@ -2429,7 +2450,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }@@ -2483,7 +2504,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }@@ -2545,7 +2566,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }@@ -2602,7 +2623,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }@@ -2675,8 +2696,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_dec_turbo_tb_params *tb =NULL ;@@ -2822,7 +2845,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }@@ -3047,7 +3070,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }@@ -3151,7 +3174,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }@@ -3241,7 +3264,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
RE: [PATCH v6 4/5] baseband/acc100: modify validation code for ACC101
Hi Maxime,
Quoted 50 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Tuesday, May 31, 2022 1:03 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]
Subject: Re: [PATCH v6 4/5] baseband/acc100: modify validation code for ACC101Quoted 5 lines · Nicolas Chautru
The validation requirement is different for the two devices.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 47++++++++++++++++++++++++--------
Quoted 27 lines
1 file changed, 35 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +13
-0@@ -1295,6 +1295,21 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG + +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); } + +static inline bool +validate_op_required (struct acc100_queue *q) { +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ldQuoted 1 line
*fcw, @@ -2182,8 +2197,10 @@ static inline
uint32_thq_index(uint32_toffset)
Quoted 12 lines
drivers/baseband/acc100/rte_acc100_pmd.c static inline uint32_t hq_index(uint32_t offset) · line 2203
Quoted 8 lines
#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline intdrivers/baseband/acc100/rte_acc100_pmd.c +3
-1-validate_enc_op(struct rte_bbdev_enc_op *op) +validate_enc_op(struct rte_bbdev_enc_op *op, struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;This check should be done after the variables declarations as per the project coding style:'
Thanks, I will update now.
Quoted 123 lines
"
Local Variables
~~~~~~~~~~~~~~~* Variables should be declared at the start of a block of code rather than in the middle.
"Quoted 114 lines
struct
rte_bbdev_op_turbo_enc*turbo_enc=&op->turbo_enc; structrte_bbdev_op_enc_turbo_cb_params*cb = NULL; structrte_bbdev_op_enc_turbo_tb_params*tb = NULL; @@ -2320,8
+2337,10 @@ static inlineuint32_thq_index(uint32_t offset)
}
/* Validates LDPC encoder parameters */
static inline intdrivers/baseband/acc100/rte_acc100_pmd.c +20
-11-validate_ldpc_enc_op(struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op(struct rte_bbdev_enc_op *op, struct acc100_queue +*q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc;if (op->mempool ==NULL ) {@@ -2373,8 +2392,10 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue +*q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec;if (op->mempool ==NULL ) {@@ -2429,7 +2450,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }@@ -2483,7 +2504,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }@@ -2545,7 +2566,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }@@ -2602,7 +2623,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }@@ -2675,8 +2696,10 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) { +if (!validate_op_required (q)) +return 0 ;struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ; struct rte_bbdev_op_dec_turbo_tb_params *tb = NULL; @@ -2822,7 +2845,7 @@ static inline uint32_t hq_index(uint32_t offset) #ifdef RTE_LIBRTE_BBDEV_DEBUG/* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { + if (validate_dec_op(op, q) == -1) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }@@ -3047,7 +3070,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }@@ -3151,7 +3174,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }@@ -3241,7 +3264,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
PATCH v6 5/5 baseband/acc100: configuration of ACC101 from PF
In reply to Nicolas ChautruAdding companion function common to ACC100/ACC101 which can be called from bbdev-test when running from PF.
--- app/test-bbdev/test_bbdev_perf.c | 6 +- drivers/baseband/acc100/rte_acc100_cfg.h | 4 +- drivers/baseband/acc100/rte_acc100_pmd.c | 323 ++++++++++++++++++++++++++++++- drivers/baseband/acc100/version.map | 3 +- 4 files changed, 327 insertions(+), 9 deletions(-)
app/test-bbdev/test_bbdev_perf.c +3 -3
@@ -711,11 +711,11 @@ typedef int (test_case_function)(struct active_device *ad,#endif #ifdef RTE_BASEBAND_ACC100 if ((get_init_device () == true) && - (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME ))) { + (!strcmp (info->drv.driver_name,ACC100PF_DRIVER_NAME ))) {struct rte_acc100_conf conf;unsigned int i; -printf ("Configure ACC100 FEC Driver %s with default values\n" , +printf ("Configure ACC100/ACC101 FEC Driver %s with default values\n" , info->drv.driver_name);/* clear default configuration before initialization */
@@ -760,7 +760,7 @@ typedef int (test_case_function)(struct active_device *ad, conf.q_dl_5g.aq_depth_log2 =ACC100_QMGR_AQ_DEPTH ;/* setup PF with configuration information */ - ret =rte_acc100_configure (info->dev_name, &conf); + ret =rte_acc10x_configure (info->dev_name, &conf);TEST_ASSERT_SUCCESS (ret,"Failed to configure ACC100 PF for bbdev %s" , info->dev_name);
drivers/baseband/acc100/rte_acc100_cfg.h +2 -2
@@ -90,7 +90,7 @@ struct rte_acc100_conf { };/** -* Configure a ACC100 device +* Configure a ACC100/ACC101 device in PF mode notably for bbdev-test * * @param dev_name * The name of the device. This is the short form of PCI BDF, e.g. 00:01.0.
@@ -104,7 +104,7 @@ struct rte_acc100_conf {*/ __rte_experimental int -rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf); +rte_acc10x_configure (const char *dev_name,struct rte_acc100_conf *conf); #ifdef __cplusplus }
drivers/baseband/acc100/rte_acc100_pmd.c +321 -2
332 lines not on this page · raw message
drivers/baseband/acc100/version.map +1 -2
@@ -5,6 +5,5 @@ DPDK_22 { EXPERIMENTAL { global: - rte_acc100_configure; - + rte_acc10x_configure; };
Signature · 1 line
1.8.3.1
Re: [PATCH v6 5/5] baseband/acc100: configuration of ACC101 from PF
Hi Nicolas,
Thanks for doing the API change, this part looks good to me now. I just have one comment below that was not addressed:
Quoted 11 lines · Nicolas Chautru
Adding companion function common to ACC100/ACC101 which can be called from bbdev-test when running from PF.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 6 +- drivers/baseband/acc100/rte_acc100_cfg.h | 4 +- drivers/baseband/acc100/rte_acc100_pmd.c | 323 ++++++++++++++++++++++++++++++- drivers/baseband/acc100/version.map | 3 +- 4 files changed, 327 insertions(+), 9 deletions(-)
...
Quoted 194 lines
drivers/baseband/acc100/rte_acc100_pmd.c +177
-2@@ -4574,8 +4574,8 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev) }/* Initial configuration of a ACC100 device prior to running configure() */ -int -rte_acc100_configure (const char *dev_name,struct rte_acc100_conf *conf) +static int +acc100_configure (const char *dev_name,struct rte_acc100_conf *conf) {rte_bbdev_log (INFO ,"rte_acc100_configure" );uint32_t value, address, status;@@ -4975,3 +4975,322 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)rte_bbdev_log_debug ("PF Tip configuration complete for %s" , dev_name);return 0 ; } + + +/* Initial configuration of a ACC101 device prior to running configure() */ +static int +acc101_configure (const char *dev_name,struct rte_acc100_conf *conf) +{ +rte_bbdev_log (INFO ,"rte_acc101_configure" ); +uint32_t value, address, status; +int qg_idx, template_idx, vf_idx, acc, i; +struct rte_bbdev *bbdev =rte_bbdev_get_named_dev (dev_name); + +/* Compile time checks */ +RTE_BUILD_BUG_ON (sizeof (struct acc100_dma_req_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (union acc100_dma_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_td ) !=24 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_te ) !=32 ); + +if (bbdev ==NULL ) { +rte_bbdev_log (ERR , +"Invalid dev_name (%s), or device is not yet initialised" , + dev_name); +return -ENODEV ; + } +struct acc100_device *d = bbdev->data->dev_private; + +/* Store configuration */ +rte_memcpy (&d->acc100_conf, conf,sizeof (d->acc100_conf)); + +/* PCIe Bridge configuration */ +acc100_reg_write (d, HwPfPcieGpexBridgeControl,ACC101_CFG_PCI_BRIDGE ); +for (i =1 ; i <ACC101_GPEX_AXIMAP_NUM ; i++) +acc100_reg_write (d, HwPfPcieGpexAxiAddrMappingWindowPexBaseHigh + i *16 ,0 ); + +/* Prevent blocking AXI read on BRESP for AXI Write */ + address = HwPfPcieGpexAxiPioControl; + value =ACC101_CFG_PCI_AXI ; +acc100_reg_write (d, address, value); + +/* Explicitly releasing AXI including a 2ms delay on ACC101 */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* Set the default 5GDL DMA configuration */ +acc100_reg_write (d, HWPfDmaInboundDrainDataSize,ACC101_DMA_INBOUND ); + +/* Enable granular dynamic clock gating */ + address = HWPfHiClkGateHystReg; + value =ACC101_CLOCK_GATING_EN ; +acc100_reg_write (d, address, value); + +/* Set default descriptor signature */ + address = HWPfDmaDescriptorSignatuture; + value =0 ; +acc100_reg_write (d, address, value); + +/* Enable the Error Detection in DMA */ + value =ACC101_CFG_DMA_ERROR ; + address = HWPfDmaErrorDetectionEn; +acc100_reg_write (d, address, value); + +/* AXI Cache configuration */ + value =ACC101_CFG_AXI_CACHE ; + address = HWPfDmaAxcacheReg; +acc100_reg_write (d, address, value); + +/* Default DMA Configuration (Qmgr Enabled) */ + address = HWPfDmaConfig0Reg; + value =0 ; +acc100_reg_write (d, address, value); + address = HWPfDmaQmanen; + value =0 ; +acc100_reg_write (d, address, value); + +/* Default RLIM/ALEN configuration */ + address = HWPfDmaConfig1Reg; +int alen_r =0xF ; +int alen_w =0x7 ; + value = (1 <<31 ) + (alen_w <<20 ) + (1 <<6 ) + alen_r; +acc100_reg_write (d, address, value); + +/* Configure DMA Qmanager addresses */ + address = HWPfDmaQmgrAddrReg; + value = HWPfQmgrEgressQueuesTemplate; +acc100_reg_write (d, address, value); + +/* ===== Qmgr Configuration ===== */ +/* Configuration of the AQueue Depth QMGR_GRP_0_DEPTH_LOG2 for UL */ +int totalQgs = conf->q_ul_4g.num_qgroups + + conf->q_ul_5g.num_qgroups + + conf->q_dl_4g.num_qgroups + + conf->q_dl_5g.num_qgroups; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrDepthLog2Grp + +ACC101_BYTES_IN_WORD * qg_idx; + value =aqDepth (qg_idx, conf); +acc100_reg_write (d, address, value); + address = HWPfQmgrTholdGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value = (1 <<16 ) + (1 << (aqDepth (qg_idx, conf) -1 )); +acc100_reg_write (d, address, value); + } + +/* Template Priority in incremental order */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg0Indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_0 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg1Indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_1 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg2indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_2 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg3Indx +ACC101_BYTES_IN_WORD * template_idx; + value =ACC101_TMPL_PRI_3 ; +acc100_reg_write (d, address, value); + } + + address = HWPfQmgrGrpPriority; + value =ACC101_CFG_QMGR_HI_P ; +acc100_reg_write (d, address, value); + +/* Template Configuration */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) { + value =0 ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 4GUL */ +int numQgs = conf->q_ul_4g.num_qgroups; +int numQqsAcc =0 ; + value =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_4G ; + template_idx <=ACC101_SIG_UL_4G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 5GUL */ + numQqsAcc += numQgs; + numQgs = conf->q_ul_5g.num_qgroups; + value =0 ; +int numEngines =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_5G ; + template_idx <=ACC101_SIG_UL_5G_LAST ; + template_idx++) { +/* Check engine power-on status */ + address = HwPfFecUl5gIbDebugReg + +ACC101_ENGINE_OFFSET * template_idx; + status = (acc100_reg_read (d, address) >>4 ) &0xF ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +if (status ==1 ) { +acc100_reg_write (d, address, value); + numEngines++; + }else +acc100_reg_write (d, address,0 ); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } +printf ("Number of 5GUL engines %d\n" , numEngines); +/* 4GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_4g.num_qgroups; + value =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++)
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev) · line 5162
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_4G ; + template_idx <=ACC101_SIG_DL_4G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif
As I mentionned on previous revision, single FEC case should be handled via a devarg, so that testing both cases do not require a rebuild.
Quoted 134 lines
drivers/baseband/acc100/rte_acc100_pmd.c +134
-0+ } +/* 5GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_5g.num_qgroups; + value =0 ; +for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc); qg_idx++) + value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_5G ; + template_idx <=ACC101_SIG_DL_5G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); +#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } + +/* Queue Group Function mapping */ +int qman_func_id[8 ] = {0 ,2 ,1 ,3 ,4 ,0 ,0 ,0 }; + address = HWPfQmgrGrpFunction0; + value =0 ; +for (qg_idx =0 ; qg_idx <8 ; qg_idx++) { + acc =accFromQgid (qg_idx, conf); + value |= qman_func_id[acc]<<(qg_idx *4 ); + } +acc100_reg_write (d, address, value); + +/* Configuration of the Arbitration QGroup depth to 1 */ +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrArbQDepthGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value =0 ; +acc100_reg_write (d, address, value); + } + +/* Enabling AQueues through the Queue hierarchy*/ +for (vf_idx =0 ; vf_idx <ACC101_NUM_VFS ; vf_idx++) { +for (qg_idx =0 ; qg_idx <ACC101_NUM_QGRPS ; qg_idx++) { + value =0 ; +if (vf_idx < conf->num_vf_bundles && + qg_idx < totalQgs) + value = (1 <<aqNum (qg_idx, conf)) -1 ; + address = HWPfQmgrAqEnableVf + + vf_idx *ACC101_BYTES_IN_WORD ; + value += (qg_idx <<16 ); +acc100_reg_write (d, address, value); + } + } + +/* This pointer to ARAM (128kB) is shifted by 2 (4B per register) */ +uint32_t aram_address =0 ; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { +for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfQmgrVfBaseAddr + vf_idx + *ACC101_BYTES_IN_WORD + qg_idx + *ACC101_BYTES_IN_WORD *64 ; + value = aram_address; +acc100_reg_write (d, address, value); +/* Offset ARAM Address for next memory bank +* - increment of 4B +*/ + aram_address +=aqNum (qg_idx, conf) * + (1 <<aqDepth (qg_idx, conf)); + } + } + +if (aram_address >ACC101_WORDS_IN_ARAM_SIZE ) { +rte_bbdev_log (ERR ,"ARAM Configuration not fitting %d %d\n" , + aram_address,ACC101_WORDS_IN_ARAM_SIZE ); +return -EINVAL ; + } + +/* ==== HI Configuration ==== */ + +/* No Info Ring/MSI by default */ +acc100_reg_write (d, HWPfHiInfoRingIntWrEnRegPf,0 ); +acc100_reg_write (d, HWPfHiInfoRingVf2pfLoWrEnReg,0 ); +acc100_reg_write (d, HWPfHiCfgMsiIntWrEnRegPf,0xFFFFFFFF ); +acc100_reg_write (d, HWPfHiCfgMsiVf2pfLoWrEnReg,0xFFFFFFFF ); +/* Prevent Block on Transmit Error */ + address = HWPfHiBlockTransmitOnErrorEn; + value =0 ; +acc100_reg_write (d, address, value); +/* Prevents to drop MSI */ + address = HWPfHiMsiDropEnableReg; + value =0 ; +acc100_reg_write (d, address, value); +/* Set the PF Mode register */ + address = HWPfHiPfMode; + value = (conf->pf_mode_en) ?ACC101_PF_VAL :0 ; +acc100_reg_write (d, address, value); +/* Explicitly releasing AXI after PF Mode and 2 ms */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* QoS overflow init */ + value =1 ; + address = HWPfQosmonAEvalOverflow0; +acc100_reg_write (d, address, value); + address = HWPfQosmonBEvalOverflow0; +acc100_reg_write (d, address, value); + +/* HARQ DDR Configuration */ +unsigned int ddrSizeInMb =ACC101_HARQ_DDR ; +for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfDmaVfDdrBaseRw + vf_idx + *0x10 ; + value = ((vf_idx * (ddrSizeInMb /64 )) <<16 ) + + (ddrSizeInMb -1 ); +acc100_reg_write (d, address, value); + } +usleep (ACC101_LONG_WAIT ); + +rte_bbdev_log_debug ("PF TIP configuration complete for %s" , dev_name); +return 0 ; +} + +int +rte_acc10x_configure (const char *dev_name,struct rte_acc100_conf *conf) +{ +struct rte_bbdev *bbdev =rte_bbdev_get_named_dev (dev_name); +if (bbdev ==NULL ) { +rte_bbdev_log (ERR ,"Invalid dev_name (%s), or device is not yet initialised" , + dev_name); +return -ENODEV ; + } +struct rte_pci_device *pci_dev =RTE_DEV_TO_PCI (bbdev->device); +printf ("Configure dev id %x\n" , pci_dev->id.device_id); +if (pci_dev->id.device_id ==RTE_ACC100_PF_DEVICE_ID ) +return acc100_configure (dev_name, conf); +else +return acc101_configure (dev_name, conf); +}
RE: [PATCH v6 5/5] baseband/acc100: configuration of ACC101 from PF
Hi Maxime,
Quoted 251 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Tuesday, May 31, 2022 12:36 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]
Subject: Re: [PATCH v6 5/5] baseband/acc100: configuration of ACC101 from PFHi Nicolas,
Thanks for doing the API change, this part looks good to me now. I just have one comment below that was not addressed:
Quoted 1 line · Nicolas Chautru
Adding companion function common to ACC100/ACC101 which can be
called
Quoted 7 lines
from bbdev-test when running from PF.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 6 +- drivers/baseband/acc100/rte_acc100_cfg.h | 4 +- drivers/baseband/acc100/rte_acc100_pmd.c | 323++++++++++++++++++++++++++++++-
Quoted 3 lines
drivers/baseband/acc100/version.map | 3 +- 4 files changed, 327 insertions(+), 9 deletions(-)...
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct
Quoted 6 lines
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0@@ -4574,8 +4574,8 @@ static int acc100_pci_remove(struct
rte_pci_device*pci_dev)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct
Quoted 11 lines
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0}/* Initial configuration of a ACC100 device prior to running
configure()*/ -int -rte_acc100_configure(const char*dev_name, structrte_acc100_conf*conf)drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+static int +acc100_configure (const char *dev_name,struct rte_acc100_conf *conf) {rte_bbdev_log (INFO ,"rte_acc100_configure" );uint32_t value, address, status;@@ -4975,3 +4975,322 @@ static int acc100_pci_remove(struct
rte_pci_device*pci_dev)drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 4975
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +0
-0rte_bbdev_log_debug("PF Tip configuration complete for %s",
dev_name);Quoted 21 lines
drivers/baseband/acc100/rte_acc100_pmd.c +19
-0return 0 ; } + + +/* Initial configuration of a ACC101 device prior to running +configure() */ static int acc101_configure (const char *dev_name, +struct rte_acc100_conf *conf) { +rte_bbdev_log (INFO ,"rte_acc101_configure" ); +uint32_t value, address, status; +int qg_idx, template_idx, vf_idx, acc, i; +struct rte_bbdev *bbdev =rte_bbdev_get_named_dev (dev_name); + +/* Compile time checks */ +RTE_BUILD_BUG_ON (sizeof (struct acc100_dma_req_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (union acc100_dma_desc ) !=256 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_td ) !=24 ); +RTE_BUILD_BUG_ON (sizeof (struct acc100_fcw_te ) !=32 ); + +if (bbdev ==NULL ) { + rte_bbdev_log(ERR, + "Invalid dev_name (%s), or device is not yet initialised",drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ dev_name); +return -ENODEV ; + } +struct acc100_device *d = bbdev->data->dev_private; + +/* Store configuration */ +rte_memcpy (&d->acc100_conf, conf,sizeof (d->acc100_conf)); + +/* PCIe Bridge configuration */ + acc100_reg_write(d, HwPfPcieGpexBridgeControl,
ACC101_CFG_PCI_BRIDGE);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 5008
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+for (i =1 ; i <ACC101_GPEX_AXIMAP_NUM ; i++) + acc100_reg_write(d,HwPfPcieGpexAxiAddrMappingWindowPexBaseHigh + i
Quoted 47 lines
drivers/baseband/acc100/rte_acc100_pmd.c +47
-0+* 16, 0); + +/* Prevent blocking AXI read on BRESP for AXI Write */ + address = HwPfPcieGpexAxiPioControl; + value =ACC101_CFG_PCI_AXI ; +acc100_reg_write (d, address, value); + +/* Explicitly releasing AXI including a 2ms delay on ACC101 */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* Set the default 5GDL DMA configuration */ +acc100_reg_write (d, HWPfDmaInboundDrainDataSize, +ACC101_DMA_INBOUND ); + +/* Enable granular dynamic clock gating */ + address = HWPfHiClkGateHystReg; + value =ACC101_CLOCK_GATING_EN ; +acc100_reg_write (d, address, value); + +/* Set default descriptor signature */ + address = HWPfDmaDescriptorSignatuture; + value =0 ; +acc100_reg_write (d, address, value); + +/* Enable the Error Detection in DMA */ + value =ACC101_CFG_DMA_ERROR ; + address = HWPfDmaErrorDetectionEn; +acc100_reg_write (d, address, value); + +/* AXI Cache configuration */ + value =ACC101_CFG_AXI_CACHE ; + address = HWPfDmaAxcacheReg; +acc100_reg_write (d, address, value); + +/* Default DMA Configuration (Qmgr Enabled) */ + address = HWPfDmaConfig0Reg; + value =0 ; +acc100_reg_write (d, address, value); + address = HWPfDmaQmanen; + value =0 ; +acc100_reg_write (d, address, value); + +/* Default RLIM/ALEN configuration */ + address = HWPfDmaConfig1Reg; +int alen_r =0xF ; +int alen_w =0x7 ;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ value = (1 <<31 ) + (alen_w <<20 ) + (1 <<6 ) + alen_r; +acc100_reg_write (d, address, value); + +/* Configure DMA Qmanager addresses */ + address = HWPfDmaQmgrAddrReg; + value = HWPfQmgrEgressQueuesTemplate; +acc100_reg_write (d, address, value); + +/* ===== Qmgr Configuration ===== */ +/* Configuration of the AQueue Depth QMGR_GRP_0_DEPTH_LOG2 for UL */
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-0+int totalQgs = conf->q_ul_4g.num_qgroups + + conf->q_ul_5g.num_qgroups + + conf->q_dl_4g.num_qgroups + + conf->q_dl_5g.num_qgroups; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrDepthLog2Grp + +ACC101_BYTES_IN_WORD * qg_idx; + value =aqDepth (qg_idx, conf); +acc100_reg_write (d, address, value);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ address = HWPfQmgrTholdGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value = (1 <<16 ) + (1 << (aqDepth (qg_idx, conf) -1 )); +acc100_reg_write (d, address, value); + } + +/* Template Priority in incremental order */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg0Indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ value =ACC101_TMPL_PRI_0 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg1Indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ value =ACC101_TMPL_PRI_1 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg2indx +
ACC101_BYTES_IN_WORD*template_idx;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 3 lines
drivers/baseband/acc100/rte_acc100_pmd.c +3
-0+ value =ACC101_TMPL_PRI_2 ; +acc100_reg_write (d, address, value); + address = HWPfQmgrGrpTmplateReg3Indx +
ACC101_BYTES_IN_WORD*template_idx;Quoted 11 lines
drivers/baseband/acc100/rte_acc100_pmd.c +11
-0+ value =ACC101_TMPL_PRI_3 ; +acc100_reg_write (d, address, value); + } + + address = HWPfQmgrGrpPriority; + value =ACC101_CFG_QMGR_HI_P ; +acc100_reg_write (d, address, value); + +/* Template Configuration */ +for (template_idx =0 ; template_idx <ACC101_NUM_TMPL ; + template_idx++) {drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ value =0 ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 4GUL */ +int numQgs = conf->q_ul_4g.num_qgroups; +int numQqsAcc =0 ; + value =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_4G ; + template_idx <=ACC101_SIG_UL_4G_LAST ; + template_idx++) {drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+ address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +acc100_reg_write (d, address, value); + } +/* 5GUL */ + numQqsAcc += numQgs; + numQgs = conf->q_ul_5g.num_qgroups; + value =0 ; +int numEngines =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
Quoted 15 lines
drivers/baseband/acc100/rte_acc100_pmd.c +15
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_UL_5G ; + template_idx <=ACC101_SIG_UL_5G_LAST ; + template_idx++) { +/* Check engine power-on status */ + address = HwPfFecUl5gIbDebugReg + +ACC101_ENGINE_OFFSET * template_idx; + status = (acc100_reg_read (d, address) >>4 ) &0xF ; + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; +if (status ==1 ) { +acc100_reg_write (d, address, value); + numEngines++; + }else +acc100_reg_write (d, address,0 );drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+#if RTE_ACC101_SINGLE_FEC ==1 + value =0 ; +#endif + } +printf ("Number of 5GUL engines %d\n" , numEngines); +/* 4GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_4g.num_qgroups; + value =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +7
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_4G ; + template_idx <=ACC101_SIG_DL_4G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; + acc100_reg_write(d, address, value); #if
RTE_ACC101_SINGLE_FEC== 1
Quoted 5 lines
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 5162
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ value =0 ; +#endif As I mentionned on previous revision, single FEC case should be handled via a devarg, so that testing both cases do not require a rebuild.
This is already done like this in ACC100 and is meant to be a build time parameter. Still I will take it out of the commit to avoid any confusion.
Thanks
Quoted 139 lines
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +6
-0+ } +/* 5GDL */ + numQqsAcc += numQgs; + numQgs = conf->q_dl_5g.num_qgroups; + value =0 ; + for (qg_idx = numQqsAcc; qg_idx < (numQgs + numQqsAcc);qg_idx++)
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 7 lines
drivers/baseband/acc100/rte_acc100_pmd.c +7
-0+ value |= (1 << qg_idx); +for (template_idx =ACC101_SIG_DL_5G ; + template_idx <=ACC101_SIG_DL_5G_LAST ; + template_idx++) { + address = HWPfQmgrGrpTmplateReg4Indx + +ACC101_BYTES_IN_WORD * template_idx; + acc100_reg_write(d, address, value); #if
RTE_ACC101_SINGLE_FEC== 1Quoted 45 lines
drivers/baseband/acc100/rte_acc100_pmd.c +45
-0+ value =0 ; +#endif + } + +/* Queue Group Function mapping */ +int qman_func_id[8 ] = {0 ,2 ,1 ,3 ,4 ,0 ,0 ,0 }; + address = HWPfQmgrGrpFunction0; + value =0 ; +for (qg_idx =0 ; qg_idx <8 ; qg_idx++) { + acc =accFromQgid (qg_idx, conf); + value |= qman_func_id[acc]<<(qg_idx *4 ); + } +acc100_reg_write (d, address, value); + +/* Configuration of the Arbitration QGroup depth to 1 */ +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { + address = HWPfQmgrArbQDepthGrp + +ACC101_BYTES_IN_WORD * qg_idx; + value =0 ; +acc100_reg_write (d, address, value); + } + +/* Enabling AQueues through the Queue hierarchy*/ +for (vf_idx =0 ; vf_idx <ACC101_NUM_VFS ; vf_idx++) { +for (qg_idx =0 ; qg_idx <ACC101_NUM_QGRPS ; qg_idx++) { + value =0 ; +if (vf_idx < conf->num_vf_bundles && + qg_idx < totalQgs) + value = (1 <<aqNum (qg_idx, conf)) -1 ; + address = HWPfQmgrAqEnableVf + + vf_idx *ACC101_BYTES_IN_WORD ; + value += (qg_idx <<16 ); +acc100_reg_write (d, address, value); + } + } + +/* This pointer to ARAM (128kB) is shifted by 2 (4B per register) */ +uint32_t aram_address =0 ; +for (qg_idx =0 ; qg_idx < totalQgs; qg_idx++) { +for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfQmgrVfBaseAddr + vf_idx + *ACC101_BYTES_IN_WORD + qg_idx + *ACC101_BYTES_IN_WORD *64 ; + value = aram_address; +acc100_reg_write (d, address, value);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+/* Offset ARAM Address for next memory bank +* - increment of 4B +*/ + aram_address +=aqNum (qg_idx, conf) * + (1 <<aqDepth (qg_idx, conf)); + } + } + +if (aram_address >ACC101_WORDS_IN_ARAM_SIZE ) { + rte_bbdev_log(ERR, "ARAM Configuration not fitting %d%d\n",
drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct · line 5231
Quoted 1 line
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ aram_address,
ACC101_WORDS_IN_ARAM_SIZE);Quoted 35 lines
drivers/baseband/acc100/rte_acc100_pmd.c +35
-0+return -EINVAL ; + } + +/* ==== HI Configuration ==== */ + +/* No Info Ring/MSI by default */ +acc100_reg_write (d, HWPfHiInfoRingIntWrEnRegPf,0 ); +acc100_reg_write (d, HWPfHiInfoRingVf2pfLoWrEnReg,0 ); +acc100_reg_write (d, HWPfHiCfgMsiIntWrEnRegPf,0xFFFFFFFF ); +acc100_reg_write (d, HWPfHiCfgMsiVf2pfLoWrEnReg,0xFFFFFFFF ); +/* Prevent Block on Transmit Error */ + address = HWPfHiBlockTransmitOnErrorEn; + value =0 ; +acc100_reg_write (d, address, value); +/* Prevents to drop MSI */ + address = HWPfHiMsiDropEnableReg; + value =0 ; +acc100_reg_write (d, address, value); +/* Set the PF Mode register */ + address = HWPfHiPfMode; + value = (conf->pf_mode_en) ?ACC101_PF_VAL :0 ; +acc100_reg_write (d, address, value); +/* Explicitly releasing AXI after PF Mode and 2 ms */ +usleep (2000 ); +acc100_reg_write (d, HWPfDmaAxiControl,1 ); + +/* QoS overflow init */ + value =1 ; + address = HWPfQosmonAEvalOverflow0; +acc100_reg_write (d, address, value); + address = HWPfQosmonBEvalOverflow0; +acc100_reg_write (d, address, value); + +/* HARQ DDR Configuration */ +unsigned int ddrSizeInMb =ACC101_HARQ_DDR ;drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +10
-0+for (vf_idx =0 ; vf_idx < conf->num_vf_bundles; vf_idx++) { + address = HWPfDmaVfDdrBaseRw + vf_idx + *0x10 ; + value = ((vf_idx * (ddrSizeInMb /64 )) <<16 ) + + (ddrSizeInMb -1 ); +acc100_reg_write (d, address, value); + } +usleep (ACC101_LONG_WAIT ); + + rte_bbdev_log_debug("PF TIP configuration complete for %s",
dev_name);drivers/baseband/acc100/rte_acc100_pmd.c static int acc100_pci_remove(struct rte_pci_device *pci_dev)
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-0+return 0 ; +} + +int +rte_acc10x_configure (const char *dev_name,struct rte_acc100_conf +*conf) { +struct rte_bbdev *bbdev =rte_bbdev_get_named_dev (dev_name); +if (bbdev ==NULL ) { + rte_bbdev_log(ERR, "Invalid dev_name (%s), or device is notyet initialised",
Quoted 9 lines
drivers/baseband/acc100/rte_acc100_pmd.c +9
-0+ dev_name); +return -ENODEV ; + } +struct rte_pci_device *pci_dev =RTE_DEV_TO_PCI (bbdev->device); +printf ("Configure dev id %x\n" , pci_dev->id.device_id); +if (pci_dev->id.device_id ==RTE_ACC100_PF_DEVICE_ID ) +return acc100_configure (dev_name, conf); +else +return acc101_configure (dev_name, conf); }
v7 cover drivers/baseband: PMD to support ACC100/ACC101 devices
In reply to Nicolas Chautruv7: updates suggested by Akhil and Maxime. Removed RTE prefix for internal #define, removed
build-time single FEC engine configuration mode, documentation fix, coding guideline fix, renamed new file without rte prefix.
v6: use formally an unified driver for AC100 and AC101. Exposing single unified function for the PF device configuration used by bbdev-test.
v5: minor fix to doc and intermediate commit caught in CI
v4: incremental updates based on reviews Changed order of patchset to include two ACC100 specific commits first: updating formally the companion configure function from PF and the protection adjustment.
Then next 3 commits for the actual changes specific to ACC101: the device specific function for FCW 5GUL generation used as a local function, combined documentations into a single .rst common to both devices, updated comments, removed unused #defines.
v3: Feedback from Tom Rix: missing copyright, refactor bbdev-test section calling the configure companion function for ACC100/101, taking the Pmon commit out which is not directly required.
v2: Based on good feedback from Thomas and David, now implementing the ACC101 PMD as a close derivative from existing ACC100 PMD with hooks to have different behaviour based on variant.
This prevents code duplication and only rely on different functions and behaviour when hardware requires or support differences.
Note that these are pending changes for ACC100 which would be specific to that device and not ACC101 but these can be managed based on the new implementation, ie. is_acc100() etc... (such incremental changes for ACC100 trending 22.11 but confirming this is future proof). The serie also includes commits which were meant for ACC101 but are also valuable for ACC100.
v1: This serie introduces the PMD for the new bbdev device ACC101 (aka Mount Cirrus).
This is a derivative from previous Mount Bryce ACC100 which includes silicon improvement, bug fixes, capacity improvement for 5GNR and feature improvement.
Nicolas Chautru (6):
baseband/acc100: update companion PF configure function baseband/acc100: add protection for some negative scenario baseband/acc100: remove RTE prefix for internal macro baseband/acc100: introduce PMD for ACC101 baseband/acc100: modify validation code for ACC101 baseband/acc100: configuration of ACC101 from PF
MAINTAINERS | 1 + app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/bbdevs/acc100.rst | 37 +- doc/guides/bbdevs/features/acc101.ini | 13 + doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/acc100_pf_enum.h | 18 + drivers/baseband/acc100/acc101_pmd.h | 50 +++ drivers/baseband/acc100/rte_acc100_cfg.h | 4 +- drivers/baseband/acc100/rte_acc100_pmd.c | 687 ++++++++++++++++++++++++++++--- drivers/baseband/acc100/rte_acc100_pmd.h | 37 +- drivers/baseband/acc100/version.map | 3 +- 11 files changed, 768 insertions(+), 91 deletions(-) create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/acc101_pmd.h
Signature · 1 line
1.8.3.1
PATCH v7 1/6 baseband/acc100: update companion PF configure function
Update of the device configuration function from PF used for bbdev-test to latest sequence for ACC199 PRQ device and matching version in pf_bb_config 22.03.
--- drivers/baseband/acc100/acc100_pf_enum.h | 18 ++++ drivers/baseband/acc100/rte_acc100_pmd.c | 163 +++++++++++++++++++++++-------- drivers/baseband/acc100/rte_acc100_pmd.h | 20 +++- 3 files changed, 153 insertions(+), 48 deletions(-)
drivers/baseband/acc100/acc100_pf_enum.h +18 -0
@@ -238,6 +238,24 @@ enum { HWPfPermonBTotalLatLowBusMon =0x00BAC504 , HWPfPermonBTotalLatUpperBusMon =0x00BAC508 , HWPfPermonBTotalReqCntBusMon =0x00BAC50C , + HwPfFabI2MArbCntrlReg =0x00BB0000 , + HWPfFabricMode =0x00BB1000 , + HwPfFabI2MGrp0DebugReg =0x00BBF000 , + HwPfFabI2MGrp1DebugReg =0x00BBF004 , + HwPfFabI2MGrp2DebugReg =0x00BBF008 , + HwPfFabI2MGrp3DebugReg =0x00BBF00C , + HwPfFabI2MBuf0DebugReg =0x00BBF010 , + HwPfFabI2MBuf1DebugReg =0x00BBF014 , + HwPfFabI2MBuf2DebugReg =0x00BBF018 , + HwPfFabI2MBuf3DebugReg =0x00BBF01C , + HwPfFabM2IBuf0Grp0DebugReg =0x00BBF020 , + HwPfFabM2IBuf1Grp0DebugReg =0x00BBF024 , + HwPfFabM2IBuf0Grp1DebugReg =0x00BBF028 , + HwPfFabM2IBuf1Grp1DebugReg =0x00BBF02C , + HwPfFabM2IBuf0Grp2DebugReg =0x00BBF030 , + HwPfFabM2IBuf1Grp2DebugReg =0x00BBF034 , + HwPfFabM2IBuf0Grp3DebugReg =0x00BBF038 , + HwPfFabM2IBuf1Grp3DebugReg =0x00BBF03C , HWPfFecUl5gCntrlReg =0x00BC0000 , HWPfFecUl5gI2MThreshReg =0x00BC0004 , HWPfFecUl5gVersionReg = 0x00BC0100,
drivers/baseband/acc100/rte_acc100_pmd.c +120 -43
262 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +15 -5
@@ -31,11 +31,6 @@#define RTE_ACC100_PF_DEVICE_ID (0x0d5c)#define RTE_ACC100_VF_DEVICE_ID (0x0d5d) -/* Define as 1 to use only a single FEC engine */ -#ifndef RTE_ACC100_SINGLE_FEC -#define RTE_ACC100_SINGLE_FEC 0 -#endif -/* Values used in filling in descriptors */ #define ACC100_DMA_DESC_TYPE 2#define ACC100_DMA_CODE_BLK_MODE 0
@@ -153,6 +148,12 @@#define ACC100_CFG_QMGR_HI_P 0x0F0F#define ACC100_CFG_PCI_AXI 0xC003#define ACC100_CFG_PCI_BRIDGE 0x40006033 +#define ACC100_QUAD_NUMS 4 +#define ACC100_LANES_PER_QUAD 4 +#define ACC100_PCIE_LANE_OFFSET 0x200 +#define ACC100_PCIE_QUAD_OFFSET 0x2000 +#define ACC100_PCS_EQ 0x6007 +#define ACC100_ADAPT 0x8400#define ACC100_ENGINE_OFFSET 0x1000#define ACC100_RESET_HI 0x20100#define ACC100_RESET_LO 0x20000
@@ -160,6 +161,15 @@#define ACC100_ENGINES_MAX 9#define ACC100_LONG_WAIT 1000#define ACC100_GPEX_AXIMAP_NUM 17 +#define ACC100_CLOCK_GATING_EN 0x30000 +#define ACC100_FABRIC_MODE 0xB +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF +*/ +#define ACC100_HARQ_DDR (512 * 1) +#define ACC100_PRQ_DDR_VER 0x10092020 +#define ACC100_MS_IN_US (1000) +#define ACC100_DDR_TRAINING_MAX (5000)/* ACC100 DMA Descriptor triplet */ struct acc100_dma_triplet {
Signature · 1 line
1.8.3.1
Re: [PATCH v7 1/6] baseband/acc100: update companion PF configure function
Hi Nicolas,
Quoted 7 lines · Nicolas Chautru
Update of the device configuration function from PF used for bbdev-test to latest sequence for ACC199 PRQ device and matching version in
pf_bb_config22.03.Fixes b17d70922d5d ("baseband/acc100: add configure function")
Can you describe what this patch is fixing?
Is it backwards compatible to keep things working if someone only upgrades DPDK (e.g. 21.11 to 21.11.2)? The commit log mentioning 22.03 makes think it may not be the case.
thanks,
Kevin.
Quoted 6 lines
Signed-off-by Nicolas Chautru<[email protected]>--- drivers/baseband/acc100/acc100_pf_enum.h | 18 ++++ drivers/baseband/acc100/rte_acc100_pmd.c | 163 +++++++++++++++++++++++-------- drivers/baseband/acc100/rte_acc100_pmd.h | 20 +++- 3 files changed, 153 insertions(+), 48 deletions(-)
RE: [PATCH v7 1/6] baseband/acc100: update companion PF configure function
Hi Kevin,
Quoted 23 lines
-----Original Message-----
From: Kevin Traynor <[email protected]>
Sent: Thursday, June 2, 2022 2:50 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH v7 1/6] baseband/acc100: update companion PF configure functionHi Nicolas,
Quoted 7 lines · Nicolas Chautru
Update of the device configuration function from PF used for bbdev-test to latest sequence for ACC199 PRQ device and matching version in
pf_bb_config22.03.Fixes b17d70922d5d ("baseband/acc100: add configure function")
Quoted 5 lines
Can you describe what this patch is fixing?
Is it backwards compatible to keep things working if someone only upgrades DPDK (e.g. 21.11 to 21.11.2)? The commit log mentioning 22.03 makes think it may not be the case.
The companion function used by bbdev-test to configure the device from PF is updated to latest including possible HW exception and tuning => there is no backward compatibility aspect between the PMD and that configuration sequence, but latest is greatest hence updating now.
22.03 version is referring to another ingredient outside of DPDK (pf_bb_config) for reference only. I hope this clarifies. There is no direct dependency or compatibility concern.
Thanks
Nic
Quoted 11 lines
thanks,
Kevin.Quoted 4 lines
Signed-off-by Nicolas Chautru<[email protected]>--- drivers/baseband/acc100/acc100_pf_enum.h | 18 ++++ drivers/baseband/acc100/rte_acc100_pmd.c | 163+++++++++++++++++++++++--------
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.h | 20 +++- 3 files changed, 153 insertions(+), 48 deletions(-)
RE: [PATCH v7 1/6] baseband/acc100: update companion PF configure function
In reply to Nicolas Chautru-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Tuesday, May 31, 2022 5:32 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; Kinsella, Ray <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Vargas, Hernan <[email protected]>; [email protected]; Chautru, Nicolas <[email protected]>; [email protected]
Subject: [PATCH v7 1/6] baseband/acc100: update companion PF configure function
Update of the device configuration function from PF used for bbdev-test to latest sequence for ACC199 PRQ device and matching version in pf_bb_config 22.03.
--- drivers/baseband/acc100/acc100_pf_enum.h | 18 ++++ drivers/baseband/acc100/rte_acc100_pmd.c | 163 +++++++++++++++++++++++-------- drivers/baseband/acc100/rte_acc100_pmd.h | 20 +++- 3 files changed, 153 insertions(+), 48 deletions(-)
Thanks,
Hernan
drivers/baseband/acc100/acc100_pf_enum.h +18 -0
@@ -238,6 +238,24 @@ enum { HWPfPermonBTotalLatLowBusMon =0x00BAC504 , HWPfPermonBTotalLatUpperBusMon =0x00BAC508 , HWPfPermonBTotalReqCntBusMon =0x00BAC50C , + HwPfFabI2MArbCntrlReg =0x00BB0000 , + HWPfFabricMode =0x00BB1000 , + HwPfFabI2MGrp0DebugReg =0x00BBF000 , + HwPfFabI2MGrp1DebugReg =0x00BBF004 , + HwPfFabI2MGrp2DebugReg =0x00BBF008 , + HwPfFabI2MGrp3DebugReg =0x00BBF00C , + HwPfFabI2MBuf0DebugReg =0x00BBF010 , + HwPfFabI2MBuf1DebugReg =0x00BBF014 , + HwPfFabI2MBuf2DebugReg =0x00BBF018 , + HwPfFabI2MBuf3DebugReg =0x00BBF01C , + HwPfFabM2IBuf0Grp0DebugReg =0x00BBF020 , + HwPfFabM2IBuf1Grp0DebugReg =0x00BBF024 , + HwPfFabM2IBuf0Grp1DebugReg =0x00BBF028 , + HwPfFabM2IBuf1Grp1DebugReg =0x00BBF02C , + HwPfFabM2IBuf0Grp2DebugReg =0x00BBF030 , + HwPfFabM2IBuf1Grp2DebugReg =0x00BBF034 , + HwPfFabM2IBuf0Grp3DebugReg =0x00BBF038 , + HwPfFabM2IBuf1Grp3DebugReg =0x00BBF03C , HWPfFecUl5gCntrlReg =0x00BC0000 , HWPfFecUl5gI2MThreshReg =0x00BC0004 , HWPfFecUl5gVersionReg = 0x00BC0100,
drivers/baseband/acc100/rte_acc100_pmd.c +2 -2
@@ -141,8 +141,8 @@int acc_enum =accFromQgid (qg_idx, acc100_conf);qtopFromAcc (&q_top, acc_enum, acc100_conf);if (unlikely (q_top ==NULL )) -return 0 ; -return q_top->aq_depth_log2; +return 1 ; +return RTE_MAX (1 , q_top->aq_depth_log2); } /* Return the AQ depth for a Queue Group Index */ @@ -4411,7 +4411,7 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev) {
rte_bbdev_log(INFO, "rte_acc100_configure"); uint32_t value, address, status;
- int qg_idx, template_idx, vf_idx, acc, i;
+ int qg_idx, template_idx, vf_idx, acc, i, j;
struct rte_bbdev *bbdev = rte_bbdev_get_named_dev(dev_name);
/* Compile time checks */
@@ -4431,6 +4431,9 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
/* Store configuration */
rte_memcpy(&d->acc100_conf, conf, sizeof(d->acc100_conf));
+ value = acc100_reg_read(d, HwPfPcieGpexBridgeControl);
+ bool firstCfg = (value != ACC100_CFG_PCI_BRIDGE);
+
/* PCIe Bridge configuration */
acc100_reg_write(d, HwPfPcieGpexBridgeControl, ACC100_CFG_PCI_BRIDGE);
for (i = 1; i < ACC100_GPEX_AXIMAP_NUM; i++) @@ -4451,20 +4454,9 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev) value = 1;
acc100_reg_write(d, address, value);
- /* DDR Configuration */
- address = HWPfDdrBcTim6;
- value = acc100_reg_read(d, address);
- value &= 0xFFFFFFFB; /* Bit 2 */
-#ifdef ACC100_DDR_ECC_ENABLE
- value |= 0x4;
-#endif
- acc100_reg_write(d, address, value);
- address = HWPfDdrPhyDqsCountNum;
-#ifdef ACC100_DDR_ECC_ENABLE
- value = 9;
-#else
- value = 8;
-#endif
+ /* Enable granular dynamic clock gating */
+ address = HWPfHiClkGateHystReg;
+ value = ACC100_CLOCK_GATING_EN;
acc100_reg_write(d, address, value);
/* Set default descriptor signature */ @@ -4482,6 +4474,17 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev) address = HWPfDmaAxcacheReg;
acc100_reg_write(d, address, value);
+ /* Adjust PCIe Lane adaptation */
+ for (i = 0; i < ACC100_QUAD_NUMS; i++)
+ for (j = 0; j < ACC100_LANES_PER_QUAD; j++)
+ acc100_reg_write(d, HwPfPcieLnAdaptctrl + i * ACC100_PCIE_QUAD_OFFSET
+ + j * ACC100_PCIE_LANE_OFFSET, ACC100_ADAPT);
+
+ /* Enable PCIe live adaptation */
+ for (i = 0; i < ACC100_QUAD_NUMS; i++)
+ acc100_reg_write(d, HwPfPciePcsEqControl +
+ i * ACC100_PCIE_QUAD_OFFSET, ACC100_PCS_EQ);
+
/* Default DMA Configuration (Qmgr Enabled) */
address = HWPfDmaConfig0Reg;
value = 0;
@@ -4500,6 +4503,11 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
value = HWPfQmgrEgressQueuesTemplate;
acc100_reg_write(d, address, value);
+ /* Default Fabric Mode */
+ address = HWPfFabricMode;
+ value = ACC100_FABRIC_MODE;
+ acc100_reg_write(d, address, value);
+
/* ===== Qmgr Configuration ===== */
/* Configuration of the AQueue Depth QMGR_GRP_0_DEPTH_LOG2 for UL */
int totalQgs = conf->q_ul_4g.num_qgroups + @@ -4518,22 +4526,17 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev) }
/* Template Priority in incremental order */
- for (template_idx = 0; template_idx < ACC100_NUM_TMPL;
- template_idx++) {
- address = HWPfQmgrGrpTmplateReg0Indx +
- ACC100_BYTES_IN_WORD * (template_idx % 8);
+ for (template_idx = 0; template_idx < ACC100_NUM_TMPL; template_idx++) {
+ address = HWPfQmgrGrpTmplateReg0Indx + ACC100_BYTES_IN_WORD *
+template_idx;
value = ACC100_TMPL_PRI_0;
acc100_reg_write(d, address, value);
- address = HWPfQmgrGrpTmplateReg1Indx +
- ACC100_BYTES_IN_WORD * (template_idx % 8);
+ address = HWPfQmgrGrpTmplateReg1Indx + ACC100_BYTES_IN_WORD *
+template_idx;
value = ACC100_TMPL_PRI_1;
acc100_reg_write(d, address, value);
- address = HWPfQmgrGrpTmplateReg2indx +
- ACC100_BYTES_IN_WORD * (template_idx % 8);
+ address = HWPfQmgrGrpTmplateReg2indx + ACC100_BYTES_IN_WORD *
+template_idx;
value = ACC100_TMPL_PRI_2;
acc100_reg_write(d, address, value);
- address = HWPfQmgrGrpTmplateReg3Indx +
- ACC100_BYTES_IN_WORD * (template_idx % 8);
+ address = HWPfQmgrGrpTmplateReg3Indx + ACC100_BYTES_IN_WORD *
+template_idx;
value = ACC100_TMPL_PRI_3;
acc100_reg_write(d, address, value);
}
@@ -4584,9 +4587,6 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
numEngines++;
} else
acc100_reg_write(d, address, 0);
-#if RTE_ACC100_SINGLE_FEC == 1
- value = 0;
-#endif
}
printf("Number of 5GUL engines %d\n", numEngines);
/* 4GDL */
@@ -4601,9 +4601,6 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
address = HWPfQmgrGrpTmplateReg4Indx
+ ACC100_BYTES_IN_WORD * template_idx;
acc100_reg_write(d, address, value);
-#if RTE_ACC100_SINGLE_FEC == 1
- value = 0;
-#endif
}
/* 5GDL */
numQqsAcc += numQgs;
@@ -4617,13 +4614,10 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
address = HWPfQmgrGrpTmplateReg4Indx
+ ACC100_BYTES_IN_WORD * template_idx;
acc100_reg_write(d, address, value);
-#if RTE_ACC100_SINGLE_FEC == 1
- value = 0;
-#endif
}
/* Queue Group Function mapping */
- int qman_func_id[5] = {0, 2, 1, 3, 4};
+ int qman_func_id[8] = {0, 2, 1, 3, 4, 0, 0, 0};
address = HWPfQmgrGrpFunction0;
value = 0;
for (qg_idx = 0; qg_idx < 8; qg_idx++) { @@ -4654,7 +4648,7 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
}
}
- /* This pointer to ARAM (256kB) is shifted by 2 (4B per register) */
+ /* This pointer to ARAM (128kB) is shifted by 2 (4B per register) */
uint32_t aram_address = 0;
for (qg_idx = 0; qg_idx < totalQgs; qg_idx++) {
for (vf_idx = 0; vf_idx < conf->num_vf_bundles; vf_idx++) { @@ -4679,6 +4673,11 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
/* ==== HI Configuration ==== */
+ /* No Info Ring/MSI by default */
+ acc100_reg_write(d, HWPfHiInfoRingIntWrEnRegPf, 0);
+ acc100_reg_write(d, HWPfHiInfoRingVf2pfLoWrEnReg, 0);
+ acc100_reg_write(d, HWPfHiCfgMsiIntWrEnRegPf, 0xFFFFFFFF);
+ acc100_reg_write(d, HWPfHiCfgMsiVf2pfLoWrEnReg, 0xFFFFFFFF);
/* Prevent Block on Transmit Error */
address = HWPfHiBlockTransmitOnErrorEn;
value = 0;
@@ -4691,10 +4690,6 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
address = HWPfHiPfMode;
value = (conf->pf_mode_en) ? ACC100_PF_VAL : 0; acc100_reg_write(d, address, value);
- /* Enable Error Detection in HW */
- address = HWPfDmaErrorDetectionEn;
- value = 0x3D7;
- acc100_reg_write(d, address, value);
/* QoS overflow init */
value = 1;
@@ -4704,7 +4699,7 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
acc100_reg_write(d, address, value);
/* HARQ DDR Configuration */
- unsigned int ddrSizeInMb = 512; /* Fixed to 512 MB per VF for now */
+ unsigned int ddrSizeInMb = ACC100_HARQ_DDR;
for (vf_idx = 0; vf_idx < conf->num_vf_bundles; vf_idx++) {
address = HWPfDmaVfDdrBaseRw + vf_idx
* 0x10;
@@ -4718,6 +4713,88 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev)
if (numEngines < (ACC100_SIG_UL_5G_LAST + 1))
poweron_cleanup(bbdev, d, conf);
+ uint32_t version = 0;
+ for (i = 0; i < 4; i++)
+ version += acc100_reg_read(d,
+ HWPfDdrPhyIdtmFwVersion + 4 * i) << (8 * i);
+ if (version != ACC100_PRQ_DDR_VER) {
+ printf("* Note: Not on DDR PRQ version %8x != %08x\n",
+ version, ACC100_PRQ_DDR_VER);
+ } else if (firstCfg) {
+ /* ---- DDR configuration at boot up --- */
+ /* Read Clear Ddr training status */
+ acc100_reg_read(d, HWPfChaDdrStDoneStatus);
+ /* Reset PHY/IDTM/UMMC */
+ acc100_reg_write(d, HWPfChaDdrWbRstCfg, 3);
+ acc100_reg_write(d, HWPfChaDdrApbRstCfg, 2);
+ acc100_reg_write(d, HWPfChaDdrPhyRstCfg, 2);
+ acc100_reg_write(d, HWPfChaDdrCpuRstCfg, 3);
+ acc100_reg_write(d, HWPfChaDdrSifRstCfg, 2);
+ usleep(ACC100_MS_IN_US);
+ /* Reset WB and APB resets */
+ acc100_reg_write(d, HWPfChaDdrWbRstCfg, 2);
+ acc100_reg_write(d, HWPfChaDdrApbRstCfg, 3);
+ /* Configure PHY-IDTM */
+ acc100_reg_write(d, HWPfDdrPhyIdletimeout, 0x3e8);
+ /* IDTM timing registers */
+ acc100_reg_write(d, HWPfDdrPhyRdLatency, 0x13);
+ acc100_reg_write(d, HWPfDdrPhyRdLatencyDbi, 0x15);
+ acc100_reg_write(d, HWPfDdrPhyWrLatency, 0x10011);
+ /* Configure SDRAM MRS registers */
+ acc100_reg_write(d, HWPfDdrPhyMr01Dimm, 0x3030b70);
+ acc100_reg_write(d, HWPfDdrPhyMr01DimmDbi, 0x3030b50);
+ acc100_reg_write(d, HWPfDdrPhyMr23Dimm, 0x30);
+ acc100_reg_write(d, HWPfDdrPhyMr67Dimm, 0xc00);
+ acc100_reg_write(d, HWPfDdrPhyMr45Dimm, 0x4000000);
+ /* Configure active lanes */
+ acc100_reg_write(d, HWPfDdrPhyDqsCountMax, 0x9);
+ acc100_reg_write(d, HWPfDdrPhyDqsCountNum, 0x9);
+ /* Configure WR/RD leveling timing registers */
+ acc100_reg_write(d, HWPfDdrPhyWrlvlWwRdlvlRr, 0x101212);
+ /* Configure what trainings to execute */
+ acc100_reg_write(d, HWPfDdrPhyTrngType, 0x2d3c);
+ /* Releasing PHY reset */
+ acc100_reg_write(d, HWPfChaDdrPhyRstCfg, 3);
+ /* Configure Memory Controller registers */
+ acc100_reg_write(d, HWPfDdrMemInitPhyTrng0, 0x3);
+ acc100_reg_write(d, HWPfDdrBcDram, 0x3c232003);
+ acc100_reg_write(d, HWPfDdrBcAddrMap, 0x31);
+ /* Configure UMMC BC timing registers */
+ acc100_reg_write(d, HWPfDdrBcRef, 0xa22);
+ acc100_reg_write(d, HWPfDdrBcTim0, 0x4050501);
+ acc100_reg_write(d, HWPfDdrBcTim1, 0xf0b0476);
+ acc100_reg_write(d, HWPfDdrBcTim2, 0x103);
+ acc100_reg_write(d, HWPfDdrBcTim3, 0x144050a1);
+ acc100_reg_write(d, HWPfDdrBcTim4, 0x23300);
+ acc100_reg_write(d, HWPfDdrBcTim5, 0x4230276);
+ acc100_reg_write(d, HWPfDdrBcTim6, 0x857914);
+ acc100_reg_write(d, HWPfDdrBcTim7, 0x79100232);
+ acc100_reg_write(d, HWPfDdrBcTim8, 0x100007ce);
+ acc100_reg_write(d, HWPfDdrBcTim9, 0x50020);
+ acc100_reg_write(d, HWPfDdrBcTim10, 0x40ee);
+ /* Configure UMMC DFI timing registers */
+ acc100_reg_write(d, HWPfDdrDfiInit, 0x5000);
+ acc100_reg_write(d, HWPfDdrDfiTim0, 0x15030006);
+ acc100_reg_write(d, HWPfDdrDfiTim1, 0x11305);
+ acc100_reg_write(d, HWPfDdrDfiPhyUpdEn, 0x1);
+ acc100_reg_write(d, HWPfDdrUmmcIntEn, 0x1f);
+ /* Release IDTM CPU out of reset */
+ acc100_reg_write(d, HWPfChaDdrCpuRstCfg, 0x2);
+ /* Wait PHY-IDTM to finish static training */
+ for (i = 0; i < ACC100_DDR_TRAINING_MAX; i++) {
+ usleep(ACC100_MS_IN_US);
+ value = acc100_reg_read(d,
+ HWPfChaDdrStDoneStatus);
+ if (value & 1)
+ break;
+ }
+ printf("DDR Training completed in %d ms", i);
+ /* Enable Memory Controller */
+ acc100_reg_write(d, HWPfDdrUmmcCtrl, 0x401);
+ /* Release AXI interface reset */
+ acc100_reg_write(d, HWPfChaDdrSifRstCfg, 3);
+ }
+
rte_bbdev_log_debug("PF Tip configuration complete for %s", dev_name); return 0;
}
drivers/baseband/acc100/rte_acc100_pmd.h +14 -2
@@ -31,11 +31,6 @@#define RTE_ACC100_PF_DEVICE_ID (0x0d5c)#define RTE_ACC100_VF_DEVICE_ID (0x0d5d) -/* Define as 1 to use only a single FEC engine */ -#ifndef RTE_ACC100_SINGLE_FEC -#define RTE_ACC100_SINGLE_FEC 0 -#endif -/* Values used in filling in descriptors */ #define ACC100_DMA_DESC_TYPE 2#define ACC100_DMA_CODE_BLK_MODE 0
@@ -153,6 +148,12 @@#define ACC100_CFG_QMGR_HI_P 0x0F0F#define ACC100_CFG_PCI_AXI 0xC003#define ACC100_CFG_PCI_BRIDGE 0x40006033 +#define ACC100_QUAD_NUMS 4 +#define ACC100_LANES_PER_QUAD 4 +#define ACC100_PCIE_LANE_OFFSET 0x200 +#define ACC100_PCIE_QUAD_OFFSET 0x2000 +#define ACC100_PCS_EQ 0x6007 +#define ACC100_ADAPT 0x8400#define ACC100_ENGINE_OFFSET 0x1000#define ACC100_RESET_HI 0x20100#define ACC100_RESET_LO 0x20000
@@ -160,6 +161,15 @@#define ACC100_ENGINES_MAX 9#define ACC100_LONG_WAIT 1000#define ACC100_GPEX_AXIMAP_NUM 17 +#define ACC100_CLOCK_GATING_EN 0x30000 +#define ACC100_FABRIC_MODE 0xB +/* DDR Size per VF - 512MB by default +* Can be increased up to 4 GB with single PF/VF */ +#define ACC100_HARQ_DDR (512 * 1) +#define ACC100_PRQ_DDR_VER 0x10092020 +#define ACC100_MS_IN_US (1000) +#define ACC100_DDR_TRAINING_MAX (5000)/* ACC100 DMA Descriptor triplet */ struct acc100_dma_triplet {
--
1.8.3.1
PATCH v7 2/6 baseband/acc100: add protection for some negative scenario
In reply to Nicolas ChautruCatch exception in PMD in case of invalid input parameter.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/baseband/acc100/rte_acc100_pmd.c +6 -0
@@ -1236,6 +1236,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 ) * z_c; }/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;if (rv_index ==1 )return (((bg ==1 ?ACC100_K0_1_1 :ACC100_K0_1_2 ) * n_cb) / n) * z_c;
@@ -1764,6 +1766,10 @@/* Soft output */ if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_SOFT_OUTPUT )) { +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + }if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER )) *s_out_length = e;
Signature · 1 line
1.8.3.1
Re: [PATCH v7 2/6] baseband/acc100: add protection for some negative scenario
Quoted 24 lines · Nicolas Chautru
Catch exception in PMD in case of invalid input parameter.
Fixes 5ad5060f8f7a ("baseband/acc100: add LDPC processing functions")Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/baseband/acc100/rte_acc100_pmd.c +2
-0@@ -1236,6 +1236,8 @@return (bg ==1 ?ACC100_K0_3_1 :ACC100_K0_3_2 ) * z_c; }/* LBRM case - includes a division by N */ +if (unlikely (z_c ==0 )) +return 0 ;if (rv_index ==1 )return (((bg ==1 ?ACC100_K0_1_1 :ACC100_K0_1_2 ) * n_cb) / n) * z_c;
drivers/baseband/acc100/rte_acc100_pmd.c line 1775
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.c +4
-0@@ -1764,6 +1766,10 @@/* Soft output */ if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_SOFT_OUTPUT )) { +if (op->turbo_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + }if (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_EQUALIZER )) *s_out_length = e;
Thanks,
Maxime
PATCH v7 3/6 baseband/acc100: remove RTE prefix for internal macro
In reply to Nicolas ChautruCosmetic update to remove RTE_ prefix for a define kept internal.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 4 ++-- drivers/baseband/acc100/rte_acc100_pmd.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +2 -2
@@ -1133,7 +1133,7 @@/* ACC100 PCI PF address map */ static struct rte_pci_id pci_id_acc100_pf_map[] = { { -RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID ,RTE_ACC100_PF_DEVICE_ID ) +RTE_PCI_DEVICE (ACC100_VENDOR_ID ,ACC100_PF_DEVICE_ID ) }, {.device_id =0 }, };
@@ -1141,7 +1141,7 @@/* ACC100 PCI VF address map */ static struct rte_pci_id pci_id_acc100_vf_map[] = { { -RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID ,RTE_ACC100_VF_DEVICE_ID ) +RTE_PCI_DEVICE (ACC100_VENDOR_ID ,ACC100_VF_DEVICE_ID ) }, {.device_id =0 }, };
drivers/baseband/acc100/rte_acc100_pmd.h +3 -3
@@ -27,9 +27,9 @@#define ACC100VF_DRIVER_NAME intel_acc100_vf/* ACC100 PCI vendor & device IDs */ -#define RTE_ACC100_VENDOR_ID (0x8086) -#define RTE_ACC100_PF_DEVICE_ID (0x0d5c) -#define RTE_ACC100_VF_DEVICE_ID (0x0d5d) +#define ACC100_VENDOR_ID (0x8086) +#define ACC100_PF_DEVICE_ID (0x0d5c) +#define ACC100_VF_DEVICE_ID (0x0d5d)/* Values used in filling in descriptors */ #define ACC100_DMA_DESC_TYPE 2
Signature · 1 line
1.8.3.1
Re: [PATCH v7 3/6] baseband/acc100: remove RTE prefix for internal macro
Quoted 38 lines · Nicolas Chautru
Cosmetic update to remove
RTE_prefix for a define kept internal.Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 4 ++-- drivers/baseband/acc100/rte_acc100_pmd.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +2
-2@@ -1133,7 +1133,7 @@/* ACC100 PCI PF address map */ static struct rte_pci_id pci_id_acc100_pf_map[] = { { -RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID ,RTE_ACC100_PF_DEVICE_ID ) +RTE_PCI_DEVICE (ACC100_VENDOR_ID ,ACC100_PF_DEVICE_ID ) }, {.device_id =0 }, };@@ -1141,7 +1141,7 @@/* ACC100 PCI VF address map */ static struct rte_pci_id pci_id_acc100_vf_map[] = { { -RTE_PCI_DEVICE (RTE_ACC100_VENDOR_ID ,RTE_ACC100_VF_DEVICE_ID ) +RTE_PCI_DEVICE (ACC100_VENDOR_ID ,ACC100_VF_DEVICE_ID ) }, {.device_id =0 }, };drivers/baseband/acc100/rte_acc100_pmd.h +0
-0@@ -27,9 +27,9 @@#define ACC100VF_DRIVER_NAME intel_acc100_vf
drivers/baseband/acc100/rte_acc100_pmd.h line 35
Quoted 10 lines
drivers/baseband/acc100/rte_acc100_pmd.h +3
-3/* ACC100 PCI vendor & device IDs */ -#define RTE_ACC100_VENDOR_ID (0x8086) -#define RTE_ACC100_PF_DEVICE_ID (0x0d5c) -#define RTE_ACC100_VF_DEVICE_ID (0x0d5d) +#define ACC100_VENDOR_ID (0x8086) +#define ACC100_PF_DEVICE_ID (0x0d5c) +#define ACC100_VF_DEVICE_ID (0x0d5d)/* Values used in filling in descriptors */ #define ACC100_DMA_DESC_TYPE 2
Thanks,
Maxime
RE: [EXT] Re: [PATCH v7 3/6] baseband/acc100: remove RTE prefix for internal macro
Hi Maxime,
Quoted 3 lines
Reviewed-by Maxime Coquelin <[email protected]>
Do you have any more comments on other patches of this series? If not, please ack other patches as well.
Re: [EXT] Re: [PATCH v7 3/6] baseband/acc100: remove RTE prefix for internal macro
Hi Akhil,
Quoted 7 lines · Akhil Goyal
Hi Maxime,
Quoted 3 lines
Reviewed-by Maxime Coquelin <[email protected]>Do you have any more comments on other patches of this series? If not, please ack other patches as well.
I'm done with my review of the series.
Regards
Maxime
PATCH v7 4/6 baseband/acc100: introduce PMD for ACC101
In reply to Nicolas ChautruSupport for ACC101 as a derivative of ACC100.
Integrated in unified driver and reusing existing code when possible.
--- MAINTAINERS | 1 + doc/guides/bbdevs/acc100.rst | 37 +++++--- doc/guides/bbdevs/features/acc101.ini | 13 +++ doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/acc101_pmd.h | 50 ++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 153 +++++++++++++++++++++++++++++-- drivers/baseband/acc100/rte_acc100_pmd.h | 11 +++ 7 files changed, 249 insertions(+), 19 deletions(-) create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644 drivers/baseband/acc100/acc101_pmd.h
MAINTAINERS +1 -0
@@ -1318,6 +1318,7 @@ F: doc/guides/bbdevs/features/fpga_5gnr_fec.ini F: drivers/baseband/acc100/ F: doc/guides/bbdevs/acc100.rst F: doc/guides/bbdevs/features/acc100.ini +F: doc/guides/bbdevs/features/acc101.ini Null baseband M: Nicolas Chautru <[email protected]>
doc/guides/bbdevs/acc100.rst +25 -12
@@ -1,17 +1,19 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2020 Intel Corporation -Intel(R) ACC100 5G/4G FEC Poll Mode Driver -========================================== +Intel(R) ACC100 and ACC101 5G/4G FEC Poll Mode Drivers +====================================================== The BBDEV ACC100 5G/4G FEC poll mode driver (PMD) supports an implementation of a VRAN FEC wireless acceleration function. This device is also known as Mount Bryce. +The BBDEV ACC101, also known as Mount Cirrus, is a derivative device from Mount Bryce +with functional and capacity improvements but still with the same exposed BBDEV capabilities. Features -------- -ACC100 5G/4G FEC PMD supports the following features: +ACC100 and ACC101 5G/4G FEC PMDs support the following features: - LDPC Encode in the DL (5GNR) - LDPC Decode in the UL (5GNR)
@@ -23,7 +25,7 @@ ACC100 5G/4G FEC PMD supports the following features: - MSI - SR-IOV -ACC100 5G/4G FEC PMD supports the following BBDEV capabilities: +ACC100 and ACC101 5G/4G FEC PMDs support the following BBDEV capabilities: * For the LDPC encode operation: - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s)
@@ -80,14 +82,16 @@ hugepage configuration of a server may be examined using: Initialization -------------- -When the device first powers up, its PCI Physical Functions (PF) can be listed through this command: +When the device first powers up, its PCI Physical Functions (PF) can be listed through these +commands for ACC100 and ACC101 respectively: .. code-block:: console sudo lspci -vd8086:0d5c + sudo lspci -vd8086:57c4 The physical and virtual functions are compatible with Linux UIO drivers: -``vfio`` and ``igb_uio``. However, in order to work the ACC100 5G/4G +``vfio`` and ``igb_uio``. However, in order to work the 5G/4G FEC device first needs to be bound to one of these linux drivers through DPDK.
@@ -97,7 +101,8 @@ Bind PF UIO driver(s) Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use ``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. -The igb_uio driver may be bound to the PF PCI device using one of two methods: +The igb_uio driver may be bound to the PF PCI device using one of two methods for ACC100 +(for ACC101 the device id ``57c4`` should be used in lieu of ``0d5c``): 1. PCI functions (physical or virtual, depending on the use case) can be bound to
@@ -121,7 +126,7 @@ the UIO driver by repeating this command for every function. where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:0d5c -In a similar way the ACC100 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. +In a similar way the 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. Enable Virtual Functions
@@ -167,14 +172,14 @@ queues, priorities, load balance, bandwidth and other settings necessary for the device to perform FEC functions. This configuration needs to be executed at least once after reboot or PCI FLR and can -be achieved by using the function ``acc100_configure()``, which sets up the -parameters defined in ``acc100_conf`` structure. +be achieved by using the functions ``rte_acc10x_configure()``, +which sets up the parameters defined in the compatible ``acc100_conf`` structure. Test Application ---------------- BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing -the functionality of ACC100 5G/4G FEC encode and decode, depending on the device's +the functionality of the device 5G/4G FEC encode and decode, depending on the device's capabilities. The test application is located under app->test-bbdev folder and has the following options:
@@ -212,7 +217,7 @@ Test Vectors In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides a range of additional tests under the test_vectors folder, which may be useful. The results -of these tests will depend on the ACC100 5G/4G FEC capabilities which may cause some +of these tests will depend on the device 5G/4G FEC capabilities which may cause some testcases to be skipped, but no failure should be reported.
@@ -233,3 +238,11 @@ Specifically for the BBDEV ACC100 PMD, the command below can be used: ./pf_bb_config ACC100 -c acc100/acc100_config_vf_5g.cfg ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data + +Specifically for the BBDEV ACC101 PMD, the command below can be used: + +.. code-block:: console + + ./pf_bb_config ACC101 -c acc101/acc101_config_2vf_4g5g.cfg + ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data +
doc/guides/bbdevs/features/acc101.ini new file +13 -0
@@ -0,0 +1,13 @@ +; +; Supported features of the 'acc101' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Y
doc/guides/rel_notes/release_22_07.rst +3 -0
@@ -104,6 +104,9 @@ New Features * ``RTE_EVENT_QUEUE_ATTR_WEIGHT`` * ``RTE_EVENT_QUEUE_ATTR_AFFINITY`` +* **Added Intel ACC101 baseband PMD.** + + * Added a new baseband PMD for Intel ACC101 device. Removed Items -------------
drivers/baseband/acc100/acc101_pmd.h new file +50 -0
50 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.c +146 -7
202 lines not on this page · raw message
drivers/baseband/acc100/rte_acc100_pmd.h +11 -0
@@ -22,6 +22,9 @@#define rte_bbdev_log_debug (fmt, ...)#endif +#define ACC100_VARIANT 0 +#define ACC101_VARIANT 1 +/* ACC100 PF and VF driver names */ #define ACC100PF_DRIVER_NAME intel_acc100_pf#define ACC100VF_DRIVER_NAME intel_acc100_vf
@@ -62,6 +65,8 @@#define ACC100_HARQ_LAYOUT (64*1024*1024)/* Assume offset for HARQ in memory */ #define ACC100_HARQ_OFFSET (32*1024) +#define ACC100_HARQ_OFFSET_SHIFT 15 +#define ACC100_HARQ_OFFSET_MASK 0x7ffffff/* Mask used to calculate an index in an Info Ring array (not a byte offset) */ #define ACC100_INFO_RING_MASK (ACC100_INFO_RING_NUM_ENTRIES-1)/* Number of Virtual Functions ACC100 supports */
@@ -569,6 +574,10 @@ struct __rte_cache_aligned acc100_queue {struct acc100_device *d; }; +typedef void (*acc10x_fcw_ld_fill_fun_t )(struct rte_bbdev_dec_op *op, +struct acc100_fcw_ld *fcw, +union acc100_harq_layout_data *harq_layout); +/* Private data structure for each ACC100 device */ struct acc100_device {void *mmio_base;/**< Base address of MMIO registers (BAR0) */
@@ -600,6 +609,8 @@ struct acc100_device {uint16_t q_assigned_bit_map[ACC100_NUM_QGRPS ];bool pf_device;/**< True if this is a PF ACC100 device */ bool configured;/**< True if this ACC100 device is configured */ +uint16_t device_variant;/**< Device variant */ +acc10x_fcw_ld_fill_fun_t fcw_ld_fill;/**< 5GUL FCW generation function */ };/**
Signature · 1 line
1.8.3.1
Re: [PATCH v7 4/6] baseband/acc100: introduce PMD for ACC101
Quoted 13 lines · Nicolas Chautru
Support for ACC101 as a derivative of ACC100.
Integrated in unified driver and reusing existing code when possible.Signed-off-by Nicolas Chautru <[email protected]>--- MAINTAINERS | 1 + doc/guides/bbdevs/acc100.rst | 37 +++++--- doc/guides/bbdevs/features/acc101.ini | 13 +++ doc/guides/rel_notes/release_22_07.rst | 3 + drivers/baseband/acc100/acc101_pmd.h | 50 ++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 153 +++++++++++++++++++++++++++++-- drivers/baseband/acc100/rte_acc100_pmd.h | 11 +++ 7 files changed, 249 insertions(+), 19 deletions(-)
Quoted 2 lines
create mode 100644 doc/guides/bbdevs/features/acc101.ini create mode 100644
drivers/baseband/acc100/acc101_pmd.h
Thanks,
Maxime
PATCH v7 5/6 baseband/acc100: modify validation code for ACC101
In reply to Nicolas ChautruThe validation requirement is different for the two devices.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 51 ++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +39 -12
@@ -1295,6 +1295,21 @@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG + +static inline bool +is_acc100 (struct acc100_queue *q) +{ +return (q->d->device_variant ==ACC100_VARIANT ); +} + +static inline bool +validate_op_required (struct acc100_queue *q) +{ +return is_acc100 (q); +} +#endif +/* Fill in a frame control word for LDPC decoding. */ static inline void acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc100_fcw_ld *fcw,
@@ -2182,13 +2197,16 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo encoder parameters */ static inline int -validate_enc_op (struct rte_bbdev_enc_op *op) +validate_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) {struct rte_bbdev_op_turbo_enc *turbo_enc = &op->turbo_enc;struct rte_bbdev_op_enc_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_enc_turbo_tb_params *tb =NULL ;uint16_t kw, kw_neg, kw_pos; +if (!validate_op_required (q)) +return 0 ; +if (op->mempool ==NULL ) {rte_bbdev_log (ERR ,"Invalid mempool pointer" );return -1 ;
@@ -2320,10 +2338,13 @@ static inline uint32_t hq_index(uint32_t offset) }/* Validates LDPC encoder parameters */ static inline int -validate_ldpc_enc_op (struct rte_bbdev_enc_op *op) +validate_ldpc_enc_op (struct rte_bbdev_enc_op *op,struct acc100_queue *q) {struct rte_bbdev_op_ldpc_enc *ldpc_enc = &op->ldpc_enc; +if (!validate_op_required (q)) +return 0 ; +if (op->mempool ==NULL ) {rte_bbdev_log (ERR ,"Invalid mempool pointer" );return -1 ;
@@ -2373,10 +2394,13 @@ static inline uint32_t hq_index(uint32_t offset)/* Validates LDPC decoder parameters */ static inline int -validate_ldpc_dec_op (struct rte_bbdev_dec_op *op) +validate_ldpc_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) {struct rte_bbdev_op_ldpc_dec *ldpc_dec = &op->ldpc_dec; +if (!validate_op_required (q)) +return 0 ; +if (op->mempool ==NULL ) {rte_bbdev_log (ERR ,"Invalid mempool pointer" );return -1 ;
@@ -2429,7 +2453,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2483,7 +2507,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (ops[0 ]) ==-1 ) { +if (validate_ldpc_enc_op (ops[0 ], q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2545,7 +2569,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_enc_op (op) ==-1 ) { +if (validate_ldpc_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC encoder validation failed" );return -EINVAL ; }
@@ -2602,7 +2626,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_enc_op (op) ==-1 ) { +if (validate_enc_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo encoder validation failed" );return -EINVAL ; }
@@ -2675,12 +2699,15 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validates turbo decoder parameters */ static inline int -validate_dec_op (struct rte_bbdev_dec_op *op) +validate_dec_op (struct rte_bbdev_dec_op *op,struct acc100_queue *q) {struct rte_bbdev_op_turbo_dec *turbo_dec = &op->turbo_dec;struct rte_bbdev_op_dec_turbo_cb_params *cb =NULL ;struct rte_bbdev_op_dec_turbo_tb_params *tb =NULL ; +if (!validate_op_required (q)) +return 0 ; +if (op->mempool ==NULL ) {rte_bbdev_log (ERR ,"Invalid mempool pointer" );return -1 ;
@@ -2822,7 +2849,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
@@ -3047,7 +3074,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3151,7 +3178,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_ldpc_dec_op (op) ==-1 ) { +if (validate_ldpc_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"LDPC decoder validation failed" );return -EINVAL ; }
@@ -3241,7 +3268,7 @@ static inline uint32_t hq_index(uint32_t offset)#ifdef RTE_LIBRTE_BBDEV_DEBUG /* Validate op structure */ -if (validate_dec_op (op) ==-1 ) { +if (validate_dec_op (op, q) ==-1 ) {rte_bbdev_log (ERR ,"Turbo decoder validation failed" );return -EINVAL ; }
Signature · 1 line
1.8.3.1