* [dpdk-dev] [PATCH] net/tap: fix some flow collision
@ 2017-05-22 11:19 Pascal Mazon
2017-05-26 9:13 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Pascal Mazon @ 2017-05-22 11:19 UTC (permalink / raw)
To: dev; +Cc: pascal.mazon
The following two flow rules (testpmd syntax) should not collide:
flow create 0 priority 1 ingress pattern eth / ipv4 / end actions drop / end
flow create 0 priority 1 ingress pattern eth / ipv6 / end actions drop / end
But the eth_type in the associated TC rule was set to either "ip" or "ipv6".
For TC, they could thus not have the same priority.
Use ETH_P_ALL only in the TC message to make sure those rules can coexist.
Fixes: de96fe68ae95 ("net/tap: add basic flow API patterns and actions")
Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
---
drivers/net/tap/tap_flow.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
index cf1c8a26c8ff..a0dd5048a486 100644
--- a/drivers/net/tap/tap_flow.c
+++ b/drivers/net/tap/tap_flow.c
@@ -401,9 +401,6 @@ tap_flow_create_eth(const struct rte_flow_item *item, void *data)
if (!flow)
return 0;
msg = &flow->msg;
- if (spec->type & mask->type)
- msg->t.tcm_info = TC_H_MAKE(msg->t.tcm_info,
- (spec->type & mask->type));
if (!is_zero_ether_addr(&spec->dst)) {
nlattr_add(&msg->nh, TCA_FLOWER_KEY_ETH_DST, ETHER_ADDR_LEN,
&spec->dst.addr_bytes);
@@ -508,8 +505,6 @@ tap_flow_create_ipv4(const struct rte_flow_item *item, void *data)
msg = &flow->msg;
if (!info->eth_type)
info->eth_type = htons(ETH_P_IP);
- if (!info->vlan)
- msg->t.tcm_info = TC_H_MAKE(msg->t.tcm_info, htons(ETH_P_IP));
if (!spec)
return 0;
if (spec->hdr.dst_addr) {
@@ -566,8 +561,6 @@ tap_flow_create_ipv6(const struct rte_flow_item *item, void *data)
msg = &flow->msg;
if (!info->eth_type)
info->eth_type = htons(ETH_P_IPV6);
- if (!info->vlan)
- msg->t.tcm_info = TC_H_MAKE(msg->t.tcm_info, htons(ETH_P_IPV6));
if (!spec)
return 0;
if (memcmp(spec->hdr.dst_addr, empty_addr, 16)) {
--
2.12.0.306.g4a9b9b3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] net/tap: fix some flow collision
2017-05-22 11:19 [dpdk-dev] [PATCH] net/tap: fix some flow collision Pascal Mazon
@ 2017-05-26 9:13 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2017-05-26 9:13 UTC (permalink / raw)
To: Pascal Mazon, dev
On 5/22/2017 12:19 PM, Pascal Mazon wrote:
> The following two flow rules (testpmd syntax) should not collide:
> flow create 0 priority 1 ingress pattern eth / ipv4 / end actions drop / end
> flow create 0 priority 1 ingress pattern eth / ipv6 / end actions drop / end
>
> But the eth_type in the associated TC rule was set to either "ip" or "ipv6".
> For TC, they could thus not have the same priority.
>
> Use ETH_P_ALL only in the TC message to make sure those rules can coexist.
>
> Fixes: de96fe68ae95 ("net/tap: add basic flow API patterns and actions")
Cc: stable@dpdk.org
>
> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-26 9:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 11:19 [dpdk-dev] [PATCH] net/tap: fix some flow collision Pascal Mazon
2017-05-26 9:13 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).