This patch adds a function to translate the ethtool_rx_flow_spec structure to the flow_rule representation. This allows us to reuse code from the driver side given that both flower and ethtool_rx_flow interfaces use the same representation. This patch also includes support for the flow type flags FLOW_EXT, FLOW_MAC_EXT and FLOW_RSS. The ethtool_rx_flow_spec_input wrapper structure is used to convey the rss_context field, that is away from the ethtool_rx_flow_spec structure, and the ethtool_rx_flow_spec structure.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -400,4 +400,19 @@ struct ethtool_ops { · 399 unmodified lines | ||
| 400 | 400 | void (*get_ethtool_phy_stats)(struct net_device *, |
| 401 | 401 | struct ethtool_stats *, u64 *); |
| 402 | 402 | }; |
| 403 | + | |
| 404 | +struct ethtool_rx_flow_rule { | |
| 405 | + struct flow_rule *rule; | |
| 406 | + unsigned long priv[0]; | |
| 407 | +}; | |
| 408 | + | |
| 409 | +struct ethtool_rx_flow_spec_input { | |
| 410 | + const struct ethtool_rx_flow_spec *fs; | |
| 411 | + u32 rss_ctx; | |
| 412 | +}; | |
| 413 | + | |
| 414 | +struct ethtool_rx_flow_rule * | |
| 415 | +ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input); | |
| 416 | +void ethtool_rx_flow_rule_destroy(struct ethtool_rx_flow_rule *rule); | |
| 417 | + | |
| 403 | 418 | #endif /* _LINUX_ETHTOOL_H */ |