History

ethtool: Add WAKE_FILTER and RX_CLS_FLOW_WAKE

Add the ability to specify through ethtool::rxnfc that a rule location is special and will be used to participate in Wake-on-LAN, by e.g: having a specific pattern be matched. When this is the case, fs->ring_cookie must be set to the special value RX_CLS_FLOW_WAKE. We also define an additional ethtool::wolinfo flag: WAKE_FILTER which can be used to configure an Ethernet adapter to allow Wake-on-LAN using previously programmed filters.

Florian Fainelli committed 8 years ago

Commit 6cfef791 parent 1ba98281 file · +4 −1Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/ethtool.h+4−1
@@ -870,7 +870,8 @@ struct ethtool_flow_ext { · 869 unmodified lines
870870 * includes the %FLOW_EXT or %FLOW_MAC_EXT flag
871871 * (see &struct ethtool_flow_ext description).
872872 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
873− * if packets should be discarded
873+ * if packets should be discarded, or %RX_CLS_FLOW_WAKE if the
874+ * packets should be used for Wake-on-LAN with %WAKE_FILTER
874875 * @location: Location of rule in the table. Locations must be
875876 * numbered such that a flow matching multiple rules will be
876877 * classified according to the first (lowest numbered) rule.
@@ -1634,6 +1635,7 @@ static inline int ethtool_validate_duplex(__u8 duplex) · 757 unmodified lines
16341635 #define WAKE_ARP (1 << 4)
16351636 #define WAKE_MAGIC (1 << 5)
16361637 #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
1638+#define WAKE_FILTER (1 << 7)
16371639
16381640 /* L2-L4 network traffic flow types */
16391641 #define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
@@ -1671,6 +1673,7 @@ static inline int ethtool_validate_duplex(__u8 duplex) · 31 unmodified lines
16711673 #define RXH_DISCARD (1 << 31)
16721674
16731675 #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
1676+#define RX_CLS_FLOW_WAKE 0xfffffffffffffffeULL
16741677
16751678 /* Special RX classification rule insert location values */
16761679 #define RX_CLS_LOC_SPECIAL 0x80000000 /* flag */