Skip to content

Commit 6050b04

Browse files
Geetha sowjanyadavem330
authored andcommitted
Documentation: octeontx2: Add Documentation for RVU representors
Adds documentation for creating and configuring rvu port representors Signed-off-by: Geetha sowjanya <gakula@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6c40ca9 commit 6050b04

File tree

1 file changed

+91
-0
lines changed
  • Documentation/networking/device_drivers/ethernet/marvell

1 file changed

+91
-0
lines changed

Documentation/networking/device_drivers/ethernet/marvell/octeontx2.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Contents
1414
- `Basic packet flow`_
1515
- `Devlink health reporters`_
1616
- `Quality of service`_
17+
- `RVU representors`_
1718

1819
Overview
1920
========
@@ -340,3 +341,93 @@ Setup HTB offload
340341
# tc class add dev <interface> parent 1: classid 1:2 htb rate 10Gbit prio 2 quantum 188416
341342

342343
# tc class add dev <interface> parent 1: classid 1:3 htb rate 10Gbit prio 2 quantum 32768
344+
345+
346+
RVU Representors
347+
================
348+
349+
RVU representor driver adds support for creation of representor devices for
350+
RVU PFs' VFs in the system. Representor devices are created when user enables
351+
the switchdev mode.
352+
Switchdev mode can be enabled either before or after setting up SRIOV numVFs.
353+
All representor devices share a single NIXLF but each has a dedicated Rx/Tx
354+
queues. RVU PF representor driver registers a separate netdev for each
355+
Rx/Tx queue pair.
356+
357+
Current HW does not support built-in switch which can do L2 learning and
358+
forwarding packets between representee and representor. Hence, packet path
359+
between representee and it's representor is achieved by setting up appropriate
360+
NPC MCAM filters.
361+
Transmit packets matching these filters will be loopbacked through hardware
362+
loopback channel/interface (i.e, instead of sending them out of MAC interface).
363+
Which will again match the installed filters and will be forwarded.
364+
This way representee => representor and representor => representee packet
365+
path is achieved. These rules get installed when representors are created
366+
and gets active/deactivate based on the representor/representee interface state.
367+
368+
Usage example:
369+
370+
- Change device to switchdev mode::
371+
372+
# devlink dev eswitch set pci/0002:1c:00.0 mode switchdev
373+
374+
- List of representor devices on the system::
375+
376+
# ip link show
377+
Rpf1vf0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether f6:43:83:ee:26:21 brd ff:ff:ff:ff:ff:ff
378+
Rpf1vf1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 12:b2:54:0e:24:54 brd ff:ff:ff:ff:ff:ff
379+
Rpf1vf2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 4a:12:c4:4c:32:62 brd ff:ff:ff:ff:ff:ff
380+
Rpf1vf3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether ca:cb:68:0e:e2:6e brd ff:ff:ff:ff:ff:ff
381+
Rpf2vf0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 06:cc:ad:b4:f0:93 brd ff:ff:ff:ff:ff:ff
382+
383+
384+
To delete the representors devices from the system. Change the device to legacy mode.
385+
386+
- Change device to legacy mode::
387+
388+
# devlink dev eswitch set pci/0002:1c:00.0 mode legacy
389+
390+
RVU representors can be managed using devlink ports
391+
(see :ref:`Documentation/networking/devlink/devlink-port.rst <devlink_port>`) interface.
392+
393+
- Show devlink ports of representors::
394+
395+
# devlink port
396+
pci/0002:1c:00.0/0: type eth netdev Rpf1vf0 flavour physical port 0 splittable false
397+
pci/0002:1c:00.0/1: type eth netdev Rpf1vf1 flavour pcivf controller 0 pfnum 1 vfnum 1 external false splittable false
398+
pci/0002:1c:00.0/2: type eth netdev Rpf1vf2 flavour pcivf controller 0 pfnum 1 vfnum 2 external false splittable false
399+
pci/0002:1c:00.0/3: type eth netdev Rpf1vf3 flavour pcivf controller 0 pfnum 1 vfnum 3 external false splittable false
400+
401+
Function attributes
402+
===================
403+
404+
The RVU representor support function attributes for representors.
405+
Port function configuration of the representors are supported through devlink eswitch port.
406+
407+
MAC address setup
408+
-----------------
409+
410+
RVU representor driver support devlink port function attr mechanism to setup MAC
411+
address. (refer to Documentation/networking/devlink/devlink-port.rst)
412+
413+
- To setup MAC address for port 2::
414+
415+
# devlink port function set pci/0002:1c:00.0/2 hw_addr 5c:a1:1b:5e:43:11
416+
# devlink port show pci/0002:1c:00.0/2
417+
pci/0002:1c:00.0/2: type eth netdev Rpf1vf2 flavour pcivf controller 0 pfnum 1 vfnum 2 external false splittable false
418+
function:
419+
hw_addr 5c:a1:1b:5e:43:11
420+
421+
422+
TC offload
423+
==========
424+
425+
The rvu representor driver implements support for offloading tc rules using port representors.
426+
427+
- Drop packets with vlan id 3::
428+
429+
# tc filter add dev Rpf1vf0 protocol 802.1Q parent ffff: flower vlan_id 3 vlan_ethtype ipv4 skip_sw action drop
430+
431+
- Redirect packets with vlan id 5 and IPv4 packets to eth1, after stripping vlan header.::
432+
433+
# tc filter add dev Rpf1vf0 ingress protocol 802.1Q flower vlan_id 5 vlan_ethtype ipv4 skip_sw action vlan pop action mirred ingress redirect dev eth1

0 commit comments

Comments
 (0)