summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@nxp.com>2018-10-01 13:44:58 +0300
committerDavid S. Miller <davem@davemloft.net>2018-10-02 22:24:08 -0700
commitafb90dbb5f7813ead3324ddf056b8937f78c8bd2 (patch)
treec623a6f765d3d0b1474ee7b1e32b4455b2e0ae02 /drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
parent4aaaf9b95abad9cfcd2ac9b07797bccdd4ec01c1 (diff)
dpaa2-eth: Add ethtool support for flow classification
Add support for inserting and deleting Rx flow classification rules through ethtool. We support classification based on some header fields for flow-types ether, ip4, tcp4, udp4 and sctp4. Rx queues are core affine, so the action argument effectively selects on which cpu the matching frame will be processed. Discarding the frame is also supported. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h')
-rw-r--r--drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
index b67be5c708b8..7a7a3e7bcde2 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
@@ -297,6 +297,11 @@ struct dpaa2_eth_dist_fields {
int size;
};
+struct dpaa2_eth_cls_rule {
+ struct ethtool_rx_flow_spec fs;
+ u8 in_use;
+};
+
/* Driver private data */
struct dpaa2_eth_priv {
struct net_device *net_dev;
@@ -340,6 +345,7 @@ struct dpaa2_eth_priv {
/* enabled ethtool hashing bits */
u64 rx_hash_fields;
+ struct dpaa2_eth_cls_rule *cls_rules;
u8 rx_cls_enabled;
};
@@ -378,6 +384,9 @@ static inline int dpaa2_eth_cmp_dpni_ver(struct dpaa2_eth_priv *priv,
(dpaa2_eth_cmp_dpni_ver((priv), DPNI_RX_DIST_KEY_VER_MAJOR, \
DPNI_RX_DIST_KEY_VER_MINOR) < 0)
+#define dpaa2_eth_fs_count(priv) \
+ ((priv)->dpni_attrs.fs_entries)
+
enum dpaa2_eth_rx_dist {
DPAA2_ETH_RX_DIST_HASH,
DPAA2_ETH_RX_DIST_CLS
@@ -426,5 +435,7 @@ static int dpaa2_eth_queue_count(struct dpaa2_eth_priv *priv)
}
int dpaa2_eth_set_hash(struct net_device *net_dev, u64 flags);
+int dpaa2_eth_cls_key_size(void);
+int dpaa2_eth_cls_fld_off(int prot, int field);
#endif /* __DPAA2_H */