diff options
author | Maxime Chevallier <maxime.chevallier@bootlin.com> | 2019-04-30 09:14:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-01 17:13:14 -0400 |
commit | 84e90b0b51aabb5cb73a366368b956df37d7cedc (patch) | |
tree | ac54f44039a24b8e6c03c53e3115efcae4fd7277 /drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h | |
parent | 6f16a4652262c2a27a241b30039c11ae01586641 (diff) |
net: mvpp2: cls: Use a bitfield to represent the flow_type
As of today, the classification code is used only for RSS. We split the
incoming traffic into multiple flows, that correspond to the ethtool
flow_type parameter.
We don't want to use the ethtool flow definitions such as TCP_V4_FLOW,
for several reason :
- We want to decorrelate the driver code from ethtool as much as
possible, so that we can easily use other interfaces such as tc flower,
- We want the flow_type to be a bitfield, so that we can match flows
embedded into each other, such as TCP4 which is a subset of IP4.
This commit does the conversion to the newer type.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h')
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h index 96304ffc5d49..284a16225370 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h | |||
@@ -107,6 +107,20 @@ struct mvpp2_cls_c2_entry { | |||
107 | u8 valid; | 107 | u8 valid; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | #define MVPP22_FLOW_ETHER_BIT BIT(0) | ||
111 | #define MVPP22_FLOW_IP4_BIT BIT(1) | ||
112 | #define MVPP22_FLOW_IP6_BIT BIT(2) | ||
113 | #define MVPP22_FLOW_TCP_BIT BIT(3) | ||
114 | #define MVPP22_FLOW_UDP_BIT BIT(4) | ||
115 | |||
116 | #define MVPP22_FLOW_TCP4 (MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP4_BIT | MVPP22_FLOW_TCP_BIT) | ||
117 | #define MVPP22_FLOW_TCP6 (MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP6_BIT | MVPP22_FLOW_TCP_BIT) | ||
118 | #define MVPP22_FLOW_UDP4 (MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP4_BIT | MVPP22_FLOW_UDP_BIT) | ||
119 | #define MVPP22_FLOW_UDP6 (MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP6_BIT | MVPP22_FLOW_UDP_BIT) | ||
120 | #define MVPP22_FLOW_IP4 (MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP4_BIT) | ||
121 | #define MVPP22_FLOW_IP6 (MVPP22_FLOW_ETHER_BIT | MVPP22_FLOW_IP6_BIT) | ||
122 | #define MVPP22_FLOW_ETHERNET (MVPP22_FLOW_ETHER_BIT) | ||
123 | |||
110 | /* Classifier C2 engine entries */ | 124 | /* Classifier C2 engine entries */ |
111 | #define MVPP22_CLS_C2_N_ENTRIES 256 | 125 | #define MVPP22_CLS_C2_N_ENTRIES 256 |
112 | 126 | ||