WSL2-Linux-Kernel/drivers
Po Liu 888ae5a395 net: enetc: add tc flower psfp offload driver
This patch is to add tc flower offload for the enetc IEEE 802.1Qci(PSFP)
function. There are four main feature parts to implement the flow
policing and filtering for ingress flow with IEEE 802.1Qci features.
They are stream identify(this is defined in the P802.1cb exactly but
needed for 802.1Qci), stream filtering, stream gate and flow metering.
Each function block includes many entries by index to assign parameters.
So for one frame would be filtered by stream identify first, then
flow into stream filter block by the same handle between stream identify
and stream filtering. Then flow into stream gate control which assigned
by the stream filtering entry. And then policing by the gate and limited
by the max sdu in the filter block(optional). At last, policing by the
flow metering block, index choosing at the fitering block.
So you can see that each entry of block may link to many upper entries
since they can be assigned same index means more streams want to share
the same feature in the stream filtering or stream gate or flow
metering.
To implement such features, each stream filtered by source/destination
mac address, some stream maybe also plus the vlan id value would be
treated as one flow chain. This would be identified by the chain_index
which already in the tc filter concept. Driver would maintain this chain
and also with gate modules. The stream filter entry create by the gate
index and flow meter(optional) entry id and also one priority value.
Offloading only transfer the gate action and flow filtering parameters.
Driver would create (or search same gate id and flow meter id and
 priority) one stream filter entry to set to the hardware. So stream
filtering do not need transfer by the action offloading.
This architecture is same with tc filter and actions relationship. tc
filter maintain the list for each flow feature by keys. And actions
maintain by the action list.

Below showing a example commands by tc:
> tc qdisc add dev eth0 ingress
> ip link set eth0 address 10:00:80:00:00:00
> tc filter add dev eth0 parent ffff: protocol ip chain 11 \
	flower skip_sw dst_mac 10:00:80:00:00:00 \
	action gate index 10 \
	sched-entry open 200000000 1 8000000 \
	sched-entry close 100000000 -1 -1

Command means to set the dst_mac 10:00:80:00:00:00 to index 11 of stream
identify module. Then setting the gate index 10 of stream gate module.
Keep the gate open for 200ms and limit the traffic volume to 8MB in this
sched-entry. Then direct the frames to the ingress queue 1.

Signed-off-by: Po Liu <Po.Liu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-05-01 16:08:20 -07:00
..
accessibility
acpi Merge branch 'acpi-pci' 2020-04-24 21:03:57 +02:00
amba
android
ata ata: sata_inic162x fix a spelling issue 2020-04-23 09:59:30 -06:00
atm docs: networking: convert iphase.txt to ReST 2020-04-28 14:39:47 -07:00
auxdisplay
base PM: sleep: core: Switch back to async_schedule_dev() 2020-04-22 16:36:18 +02:00
bcma
block block-5.7-2020-04-24 2020-04-24 12:44:19 -07:00
bluetooth
bus
cdrom
char virtio: fixes, cleanups 2020-04-21 12:27:18 -07:00
clk
clocksource
connector
counter
cpufreq
cpuidle
crypto chcr: Fix CPU hard lockup 2020-04-23 15:51:37 -07:00
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware ARM: SoC fixes 2020-04-23 09:36:40 -07:00
fpga
fsi
gnss
gpio
gpu drm fixes for 5.7-rc3 2020-04-24 10:20:08 -07:00
greybus
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
ide
idle
iio
infiniband net/mlx5: Refactor imm_inval_pkey field in cqe struct 2020-04-28 12:45:15 -07:00
input
interconnect
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net net: enetc: add tc flower psfp offload driver 2020-05-01 16:08:20 -07:00
nfc
ntb
nubus
nvdimm
nvme
nvmem
of Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-04-25 20:18:53 -07:00
opp
oprofile
parisc
parport
pci
pcmcia
perf
phy
pinctrl
platform
pnp
power drivers: Remove inclusion of vermagic header 2020-04-21 13:27:37 -07:00
powercap
pps
ps3
ptp ptp: ptp_ines: convert to devm_platform_ioremap_resource 2020-04-29 11:44:08 -07:00
pwm
rapidio
ras
regulator
remoteproc remoteproc fixes for v5.7 2020-04-23 09:28:15 -07:00
reset
rpmsg
rtc
s390
sbus
scsi
sfi
sh
siox
slimbus
soc arm64: soc: ZynqMP SoC fixes for v5.7 2020-04-21 14:21:20 +02:00
soundwire
spi
spmi
ssb
staging docs: networking: convert switchdev.txt to ReST 2020-04-30 12:56:38 -07:00
target
tc
tee
thermal
thunderbolt
tty
uio
usb
vdpa
vfio
vhost
video
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile