keystone-netcp.txt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Linux Driver for Keystone NetCP Ethernet Network Connection
  2. ===========================================================
  3. Keystone netcp driver files are located at drivers/net/ethernet/ti/netcp*
  4. sysfs entry to configure special packet handling
  5. ================================================
  6. mcast_filter
  7. ------------
  8. This is a hack solution to implement special packet processing
  9. for specific marked packets. The intended use is:
  10. 1. Ethernet interfaces are part of a bridge
  11. 2. The switch is enabled (by default it is not) through sysfs command
  12. 3. ALE is enabled through sysfs command
  13. 4. Bridge forwarding is disabled Bridge forwarding disabled via
  14. "ebtables -P FORWARD DROP
  15. In this rather odd situation, the bridge will transmit multicast packets
  16. (and broadcast) by sending one on each of the slaved interfaces.
  17. This results in multiple packets through QoS, which is considered "bad".
  18. To avoid this, multicast/broadcast packets can be marked via ebtables for
  19. special processing in the NetCP PA module before the packets are queued
  20. for transmission. Packets thus recognized are NOT marked for egress via a
  21. specific slave port, and thus will be transmitted through all slave ports
  22. by the ALE in NetCP switch.
  23. As part of the pa tx hook in netcp driver, it checks if the interface is
  24. bridged. If true, it checks if special processing is needed by looking
  25. at the skb->mark field, it bitwise-ANDs the skb->mark value with the
  26. "mask" value and then compares the result with the "match" value. If
  27. these do not match, the mark is ignored and the packet is processed
  28. normally.
  29. However, if the "match" value matches, then the low-order 8 bits of the
  30. skb->mark field is used as a bitmask to determine whether the packet
  31. should be dropped. If the packet would normally have been directed to
  32. slave port 1, then bit 0 of skb->mark is checked; slave port 2 checks
  33. bit 1, etc. If the bit is set, then the packet is enqueued; If the bit
  34. is NOT set, the packet is silently dropped.
  35. An example...
  36. User enter
  37. echo "12345600 ffffff00" >
  38. /sys/devices/platform/soc/2620110.netcp/mcast_filter
  39. The runtime configuration scripts execute this command:
  40. ebtables -A OUTPUT -d Multicast -j mark \
  41. --mark-set 0x12345601 --mark-target ACCEPT
  42. When the bridge attempts to send multicast packet, it will send
  43. one packet to each of the slave interfaces. The packet sent by the bridge
  44. to slave interface eth0 (ethss slave port 1) will be passed to the NetCP
  45. switch, and the ALE will send this packet on all slave ports. The packets
  46. sent by the bridge to other slave interfaces (eth1, NetCP switch slave
  47. port 2) will be silently dropped.
  48. NOTE: This works only when PA is used in the netcp data path