linux/drivers
Vladimir Oltean 5124197ce5 net: dsa: tag_ocelot: use a short prefix on both ingress and egress
There are 2 goals that we follow:

- Reduce the header size
- Make the header size equal between RX and TX

The issue that required long prefix on RX was the fact that the ocelot
DSA tag, being put before Ethernet as it is, would overlap with the area
that a DSA master uses for RX filtering (destination MAC address
mainly).

Now that we can ask DSA to put the master in promiscuous mode, in theory
we could remove the prefix altogether and call it a day, but it looks
like we can't. Using no prefix on ingress, some packets (such as ICMP)
would be received, while others (such as PTP) would not be received.
This is because the DSA master we use (enetc) triggers parse errors
("MAC rx frame errors") presumably because it sees Ethernet frames with
a bad length. And indeed, when using no prefix, the EtherType (bytes
12-13 of the frame, bits 96-111) falls over the REW_VAL field from the
extraction header, aka the PTP timestamp.

When turning the short (32-bit) prefix on, the EtherType overlaps with
bits 64-79 of the extraction header, which are a reserved area
transmitted as zero by the switch. The packets are not dropped by the
DSA master with a short prefix. Actually, the frames look like this in
tcpdump (below is a PTP frame, with an extra dsa_8021q tag - dadb 0482 -
added by a downstream sja1105).

89:0c:a9:f2:01:00 > 88:80:00:0a:00:1d, 802.3, length 0: LLC, \
	dsap Unknown (0x10) Individual, ssap ProWay NM (0x0e) Response, \
	ctrl 0x0004: Information, send seq 2, rcv seq 0, \
	Flags [Response], length 78

0x0000:  8880 000a 001d 890c a9f2 0100 0000 100f  ................
0x0010:  0400 0000 0180 c200 000e 001f 7b63 0248  ............{c.H
0x0020:  dadb 0482 88f7 1202 0036 0000 0000 0000  .........6......
0x0030:  0000 0000 0000 0000 0000 001f 7bff fe63  ............{..c
0x0040:  0248 0001 1f81 0500 0000 0000 0000 0000  .H..............
0x0050:  0000 0000 0000 0000 0000 0000            ............

So the short prefix is our new default: we've shortened our RX frames by
12 octets, increased TX by 4, and headers are now equal between RX and
TX. Note that we still need promiscuous mode for the DSA master to not
drop it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-09-26 14:17:58 -07:00
..
accessibility
acpi ACPI: processor: Take over RCU-idle for C3-BM idle 2020-09-16 19:36:26 +02:00
amba
android
ata
atm
auxdisplay
base Driver core fixes for 5.9-rc5 2020-09-13 09:02:59 -07:00
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource RISC-V Fixes for 5.9-rc6 (or shortly after) 2020-09-20 10:51:11 -07:00
connector connector: simplify the return expression of cn_add_callback() 2020-09-21 13:48:29 -07:00
counter
cpufreq
cpuidle powerpc fixes for 5.9 #5 2020-09-18 11:48:25 -07:00
crypto
dax dax: Fix stack overflow when mounting fsdax pmem device 2020-09-20 08:57:36 -07:00
dca
devfreq
dio
dma
dma-buf
edac EDAC/ghes: Check whether the driver is on the safe list correctly 2020-09-15 09:42:15 +02:00
eisa
extcon
firewire
firmware Single EFI fix for v5.9-rc: 2020-09-20 15:18:11 -07:00
fpga
fsi
gnss
gpio
gpu Mediatek DRM Fixes for Linux 5.9 2020-09-18 08:52:06 +10:00
greybus
hid
hsi
hv hyperv-fixes for 5.9-rc6 2020-09-15 16:20:43 -07:00
hwmon
hwspinlock
hwtracing
i2c i2c: mxs: use MXS_DMA_CTRL_WAIT4END instead of DMA_CTRL_ACK 2020-09-18 23:11:44 +02:00
i3c
ide
idle
iio Staging / IIO driver fixes for 5.9-rc5 2020-09-13 09:15:20 -07:00
infiniband
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2020-09-20 10:40:43 -07:00
interconnect
iommu iommu/amd: Restore IRTE.RemapEn bit for amd_iommu_activate_guest_mode 2020-09-18 11:17:19 +02:00
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md dm: Call proper helper to determine dax support 2020-09-20 08:55:09 -07:00
media
memory
memstick
message
mfd
misc Char / Misc driver fixes for 5.9-rc5 2020-09-13 08:52:21 -07:00
mmc
most
mtd Revert "mtd: spi-nor: Add capability to disable flash quad mode" 2020-09-14 20:58:27 +05:30
mux
net net: dsa: tag_ocelot: use a short prefix on both ingress and egress 2020-09-26 14:17:58 -07:00
nfc
ntb
nubus
nvdimm
nvme block-5.9-2020-09-22 2020-09-22 14:31:38 -07:00
nvmem
of of: add of_mdio_find_device() api 2020-09-24 19:49:36 -07:00
opp
oprofile
parisc
parport
pci
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap powercap: RAPL: Add support for Lakefield 2020-09-16 14:16:04 +02:00
pps
ps3
ptp ptp_qoriq: support FIPER3 2020-09-18 17:49:20 -07:00
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 s390/qeth: remove forward declarations in L2 code 2020-09-23 12:07:54 -07:00
sbus
scsi SCSI fixes on 20200915 2020-09-15 16:30:20 -07:00
sfi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb ssb: Remove meaningless jump label to simplify the code 2020-09-21 16:01:35 +03:00
staging Staging / IIO driver fixes for 5.9-rc5 2020-09-13 09:15:20 -07:00
target
tc
tee
thermal
thunderbolt thunderbolt: Fix for v5.9-rc6 2020-09-15 13:52:14 +02:00
tty serial: 8250_pci: Add Realtek 816a and 816b 2020-09-16 13:23:33 +02:00
uio
usb usblp: fix race between disconnect() and read() 2020-09-17 18:45:30 +02:00
vdpa
vfio
vhost
video TTY/Serial/fbcon fixes for 5.9-rc6 2020-09-20 10:46:26 -07:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile