raw/cnxk_bphy: support CGX enqueue operation
[dpdk.git] / doc / guides / rawdevs / cnxk_bphy.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2021 Marvell.
3
4 Marvell CNXK BPHY Driver
5 ========================
6
7 CN10K/CN9K Fusion product families offer an internal BPHY unit which provides
8 set of hardware accelerators for performing baseband related operations.
9 Connectivity to the outside world happens through a block called RFOE which is
10 backed by ethernet I/O block called CGX or RPM (depending on the chip version).
11 RFOE stands for Radio Frequency Over Ethernet and provides support for
12 IEEE 1904.3 (RoE) standard.
13
14 Features
15 --------
16
17 The BPHY CGX/RPM implements following features in the rawdev API:
18
19 - Access to BPHY CGX/RPM via a set of predefined messages
20
21 Device Setup
22 ------------
23
24 The BPHY CGX/RPM devices will need to be bound to a user-space IO driver for
25 use. The script ``dpdk-devbind.py`` script included with DPDK can be used to
26 view the state of the devices and to bind them to a suitable DPDK-supported
27 kernel driver. When querying the status of the devices, they will appear under
28 the category of "Misc (rawdev) devices", i.e. the command
29 ``dpdk-devbind.py --status-dev misc`` can be used to see the state of those
30 devices alone.
31
32 Before performing actual data transfer one needs to first retrieve number of
33 available queues with ``rte_rawdev_queue_count()`` and capacity of each
34 using ``rte_rawdev_queue_conf_get()``.
35
36 To perform data transfer use standard ``rte_rawdev_enqueue_buffers()`` and
37 ``rte_rawdev_dequeue_buffers()`` APIs. Not all messages produce sensible
38 responses hence dequeueing is not always necessary.
39
40 BPHY CGX/RPM PMD accepts ``struct cnxk_bphy_cgx_msg`` messages which differ by type and payload.
41 Message types along with description are listed below.
42
43 Get link information
44 ~~~~~~~~~~~~~~~~~~~~
45
46 Message is used to get information about link state.
47
48 Message must have type set to ``CNXK_BPHY_CGX_MSG_TYPE_GET_LINKINFO``. In response one will
49 get message containing payload i.e ``struct cnxk_bphy_cgx_msg_link_info`` filled with information
50 about current link state.
51
52 Change internal loopback state
53 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54
55 Message is used to enable or disable internal loopback.
56
57 Message must have type set to ``CNXK_BPHY_CGX_MSG_TYPE_INTLBK_ENABLE`` or
58 ``CNXK_BPHY_CGX_MSG_TYPE_INTLBK_DISABLE``. Former will activate internal loopback while the latter
59 will do the opposite.
60
61 Change PTP RX state
62 ~~~~~~~~~~~~~~~~~~~
63
64 Message is used to enable or disable PTP mode.
65
66 Message must have type set to ``CNXK_BPHY_CGX_MSG_TYPE_PTP_RX_ENABLE`` or
67 ``CNXK_BPHY_CGX_MSG_TYPE_PTP_RX_DISABLE``. Former will enable PTP while the latter will do the
68 opposite.
69
70 Set link mode
71 ~~~~~~~~~~~~~
72
73 Message is used to change link mode.
74
75 Message must have type set to ``CNXK_BPHY_CGX_MSG_TYPE_SET_LINK_MODE``. Prior to sending actual
76 message payload i.e ``struct cnxk_bphy_cgx_msg_link_mode`` needs to be filled with relevant
77 information.
78
79 Change link state
80 ~~~~~~~~~~~~~~~~~
81
82 Message is used to set link up or down.
83
84 Message must have type set to ``CNXK_BPHY_CGX_MSG_TYPE_SET_LINK_STATE``. Prior to sending actual
85 message payload i.e ``struct cnxk_bphy_cgx_msg_set_link_state`` needs to be filled with relevant
86 information.
87
88 Start or stop RX/TX
89 ~~~~~~~~~~~~~~~~~~~
90
91 Message is used to start or stop accepting traffic.
92
93 Message must have type set to ``CNXK_BPHY_CGX_MSG_TYPE_START_RXTX`` or
94 ``CNXK_BPHY_CGX_MSG_TYPE_STOP_RXTX``. Former will enable traffic while the latter will
95 do the opposite.