Skip to content

Commit 5a38b4f

Browse files
committed
Merge branch 'dpaa2-eth-add-devlink-parser-error-drop-trap-support'
Ioana Ciornei says: ==================== dpaa2-eth: add devlink parser error drop trap support This patch set adds support in the dpaa2-eth driver for a new group of devlink drop traps - PARSER_ERROR_DROPS. The first patch adds a new generic trap group and associated traps, their definitions in devlink and their corresponding entries in the Documentation. Because there might be more devices (besides DPAA2) which do not support changing the action independently on each trap, a nre devlink callback is introduced - .trap_group_action_set(). If this callback is populated, it will take precedence over .trap_action_set() when the user requests changing the action on all the traps in a group. The next patches add basic linkage with devlink for the dpaa2-eth driver and support for the newly added PARSER_ERROR_DROPS. Nothing special here, just setting up the Rx error queue, interpreting the parse result, and then reporting any frame received on that queue to devlink. Changes in v2: - fix build error in 3/4 Changes in v3: - removed a commented line in 4/4 - added an extack in 4/4 - fixed up a warning on 32bit in 4/4 - reworded the trap_group_action_set() description in 2/4 ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 34ad937 + 061d631 commit 5a38b4f

File tree

7 files changed

+671
-2
lines changed

7 files changed

+671
-2
lines changed

Documentation/networking/devlink/devlink-trap.rst

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,73 @@ be added to the following table:
409409
- ``drop``
410410
- Traps packets dropped due to the RED (Random Early Detection) algorithm
411411
(i.e., early drops)
412+
* - ``vxlan_parsing``
413+
- ``drop``
414+
- Traps packets dropped due to an error in the VXLAN header parsing which
415+
might be because of packet truncation or the I flag is not set.
416+
* - ``llc_snap_parsing``
417+
- ``drop``
418+
- Traps packets dropped due to an error in the LLC+SNAP header parsing
419+
* - ``vlan_parsing``
420+
- ``drop``
421+
- Traps packets dropped due to an error in the VLAN header parsing. Could
422+
include unexpected packet truncation.
423+
* - ``pppoe_ppp_parsing``
424+
- ``drop``
425+
- Traps packets dropped due to an error in the PPPoE+PPP header parsing.
426+
This could include finding a session ID of 0xFFFF (which is reserved and
427+
not for use), a PPPoE length which is larger than the frame received or
428+
any common error on this type of header
429+
* - ``mpls_parsing``
430+
- ``drop``
431+
- Traps packets dropped due to an error in the MPLS header parsing which
432+
could include unexpected header truncation
433+
* - ``arp_parsing``
434+
- ``drop``
435+
- Traps packets dropped due to an error in the ARP header parsing
436+
* - ``ip_1_parsing``
437+
- ``drop``
438+
- Traps packets dropped due to an error in the first IP header parsing.
439+
This packet trap could include packets which do not pass an IP checksum
440+
check, a header length check (a minimum of 20 bytes), which might suffer
441+
from packet truncation thus the total length field exceeds the received
442+
packet length etc
443+
* - ``ip_n_parsing``
444+
- ``drop``
445+
- Traps packets dropped due to an error in the parsing of the last IP
446+
header (the inner one in case of an IP over IP tunnel). The same common
447+
error checking is performed here as for the ip_1_parsing trap
448+
* - ``gre_parsing``
449+
- ``drop``
450+
- Traps packets dropped due to an error in the GRE header parsing
451+
* - ``udp_parsing``
452+
- ``drop``
453+
- Traps packets dropped due to an error in the UDP header parsing.
454+
This packet trap could include checksum errorrs, an improper UDP
455+
length detected (smaller than 8 bytes) or detection of header
456+
truncation.
457+
* - ``tcp_parsing``
458+
- ``drop``
459+
- Traps packets dropped due to an error in the TCP header parsing.
460+
This could include TCP checksum errors, improper combination of SYN, FIN
461+
and/or RESET etc.
462+
* - ``ipsec_parsing``
463+
- ``drop``
464+
- Traps packets dropped due to an error in the IPSEC header parsing
465+
* - ``sctp_parsing``
466+
- ``drop``
467+
- Traps packets dropped due to an error in the SCTP header parsing.
468+
This would mean that port number 0 was used or that the header is
469+
truncated.
470+
* - ``dccp_parsing``
471+
- ``drop``
472+
- Traps packets dropped due to an error in the DCCP header parsing
473+
* - ``gtp_parsing``
474+
- ``drop``
475+
- Traps packets dropped due to an error in the GTP header parsing
476+
* - ``esp_parsing``
477+
- ``drop``
478+
- Traps packets dropped due to an error in the ESP header parsing
412479

413480
Driver-specific Packet Traps
414481
============================
@@ -509,6 +576,9 @@ narrow. The description of these groups must be added to the following table:
509576
* - ``acl_trap``
510577
- Contains packet traps for packets that were trapped (logged) by the
511578
device during ACL processing
579+
* - ``parser_error_drops``
580+
- Contains packet traps for packets that were marked by the device during
581+
parsing as erroneous
512582

513583
Packet Trap Policers
514584
====================

drivers/net/ethernet/freescale/dpaa2/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o
77
obj-$(CONFIG_FSL_DPAA2_PTP_CLOCK) += fsl-dpaa2-ptp.o
88

9-
fsl-dpaa2-eth-objs := dpaa2-eth.o dpaa2-ethtool.o dpni.o dpaa2-mac.o dpmac.o
9+
fsl-dpaa2-eth-objs := dpaa2-eth.o dpaa2-ethtool.o dpni.o dpaa2-mac.o dpmac.o dpaa2-eth-devlink.o
1010
fsl-dpaa2-eth-${CONFIG_FSL_DPAA2_ETH_DCB} += dpaa2-eth-dcb.o
1111
fsl-dpaa2-eth-${CONFIG_DEBUG_FS} += dpaa2-eth-debugfs.o
1212
fsl-dpaa2-ptp-objs := dpaa2-ptp.o dprtc.o

0 commit comments

Comments
 (0)