From patchwork Mon May 22 11:19:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal Mazon X-Patchwork-Id: 24449 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id CD4112C18; Mon, 22 May 2017 13:20:01 +0200 (CEST) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 5FFF728EE for ; Mon, 22 May 2017 13:20:00 +0200 (CEST) Received: from 6wind.com (unknown [10.16.0.184]) by proxy.6wind.com (Postfix) with SMTP id F2E93255C3; Mon, 22 May 2017 13:19:52 +0200 (CEST) Received: by 6wind.com (sSMTP sendmail emulation); Mon, 22 May 2017 13:19:54 +0200 From: Pascal Mazon To: dev@dpdk.org Cc: pascal.mazon@6wind.com Date: Mon, 22 May 2017 13:19:53 +0200 Message-Id: <398d6c2d628f8239bdf5726236f72990dbbcde3b.1495444748.git.pascal.mazon@6wind.com> X-Mailer: git-send-email 2.12.0.306.g4a9b9b3 Subject: [dpdk-dev] [PATCH] net/tap: fix some flow collision X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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)) {