From patchwork Tue Oct 20 18:03:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriharsha Basavapatna X-Patchwork-Id: 1385151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openvswitch.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=NFvwtnbM; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CG1jB4QMSz9sSG for ; Wed, 21 Oct 2020 05:04:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EA15F2E1DA; Tue, 20 Oct 2020 18:04:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JZaUNOKZhwR0; Tue, 20 Oct 2020 18:04:04 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id A1BBF2E1E5; Tue, 20 Oct 2020 18:04:04 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 82B0EC088B; Tue, 20 Oct 2020 18:04:04 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 705AAC0051 for ; Tue, 20 Oct 2020 18:04:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 455732E1E5 for ; Tue, 20 Oct 2020 18:04:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3vYHvhgCxFe6 for ; Tue, 20 Oct 2020 18:04:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by silver.osuosl.org (Postfix) with ESMTPS id 3B5152E1DA for ; Tue, 20 Oct 2020 18:04:01 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id 144so1625791pfb.4 for ; Tue, 20 Oct 2020 11:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=KGAtSQEzalHtegu6xgZXYg7/t+lbXF1lEllxyBFuBdM=; b=NFvwtnbMaw7aUxa3U0zEkQbvAqejzTSCn1C9p5+/9P9IkI2OWl6oSy8s/qYkvRX/cw LG1kkRBN5HCwgBdrHkUa2DesGfv9cTBezM979mC/ukjuzX46Vm8AU+K7ljGFfoja8Yxt Ef/GmWtUWTasGyaXF+mnOYcBvuNYiV7yUlReo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=KGAtSQEzalHtegu6xgZXYg7/t+lbXF1lEllxyBFuBdM=; b=MHe8QbU8qN7S9f8C9Ix7uT/ogoP8JVGctBqR0Somkq3rHx8xB1BNHkq+3cVmdh6rb7 PuqScYbRJmVZ0ZX5pFEoVoPi83trpORCy1NSc7B00HAtGMONPU1nHQJEzvzCiUgopDVf 1BGoMzXdu4qSj1Je6srx3akYMiPSsrYddrZm/Je5U4YLGVZq0fbJi9GwErR5ezz69coS 5U7NWDVZVOXu0cow/JGkyEwvoF4kavw2l92rIB2+Cjhp4ysXOZP3TQfxVmfJeYgB5tAv wogQnhnHXrBxODkIrTyuZUp4/UyoQSwy8tzq7RbtvTzGCTTj9ijY0VadasS50dAI4+o7 WFcg== X-Gm-Message-State: AOAM531ZaBjwuUROZEIvCg/xbVXcAwHbJVmymePzMFMQIdkBYiPgbcrG Aq8D14aVNL88J+iaIjrmfdz6ItaBkM697WfRAEeQYvfgJ4+m28iYC/9pR3kgq24w3QZoG7infFR l8Rayfl2RgRjc4iRKuUvAmupdc97ieAyGXcxVA63btgQUoJx2yVF6TbwEy/x7Ikz6iBNNMNE+tO mWVXV+FuQ= X-Google-Smtp-Source: ABdhPJw/clJa2JedckyYl3eeMYt0QhHnbQ5rMsMAatvBsbXVgDYy4msx7nHAKfBzn3ygaws2xLm8Sw== X-Received: by 2002:a63:1849:: with SMTP id 9mr3628796pgy.443.1603217039665; Tue, 20 Oct 2020 11:03:59 -0700 (PDT) Received: from dhcp-10-123-153-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id v17sm2596912pjy.40.2020.10.20.11.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 11:03:58 -0700 (PDT) To: dev@openvswitch.org Date: Tue, 20 Oct 2020 14:03:52 -0400 Message-Id: <20201020180352.24323-1-sriharsha.basavapatna@broadcom.com> X-Mailer: git-send-email 2.25.0.rc2 MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: Eli Britstein Subject: [ovs-dev] [PATCH] netdev-offload-dpdk: Pass L4 proto-id to match in the L3 rte_flow_item X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sriharsha Basavapatna via dev From: Sriharsha Basavapatna Reply-To: Sriharsha Basavapatna Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The offload layer clears the L4 protocol mask in the L3 item, when the L4 item is passed for matching, as an optimization. This can be confusing while parsing the headers in the PMD. Also, the datapath flow specifies this field to be matched. This optimization is best left to the PMD. This patch restores the code to pass the L4 protocol type in L3 match. Fixes: e8a2b5bf92bb ("netdev-dpdk: implement flow offload with rte flow") Signed-off-by: Sriharsha Basavapatna Acked-by: Eli Britstein Tested-by: Emma Finn --- v3: Updated "Acked-by:" and rebased. v2: Updated "fixes:" tag with the right commit id. --- lib/netdev-offload-dpdk.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index 4d19f93cd..786193e16 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -676,7 +676,6 @@ static int parse_flow_match(struct flow_patterns *patterns, struct match *match) { - uint8_t *next_proto_mask = NULL; struct flow *consumed_masks; uint8_t proto = 0; @@ -782,7 +781,6 @@ parse_flow_match(struct flow_patterns *patterns, /* Save proto for L4 protocol setup. */ proto = spec->hdr.next_proto_id & mask->hdr.next_proto_id; - next_proto_mask = &mask->hdr.next_proto_id; } /* If fragmented, then don't HW accelerate - for now. */ if (match->wc.masks.nw_frag & match->flow.nw_frag) { @@ -825,7 +823,6 @@ parse_flow_match(struct flow_patterns *patterns, /* Save proto for L4 protocol setup. */ proto = spec->hdr.proto & mask->hdr.proto; - next_proto_mask = &mask->hdr.proto; } if (proto != IPPROTO_ICMP && proto != IPPROTO_UDP && @@ -858,11 +855,6 @@ parse_flow_match(struct flow_patterns *patterns, consumed_masks->tcp_flags = 0; add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_TCP, spec, mask); - - /* proto == TCP and ITEM_TYPE_TCP, thus no need for proto match. */ - if (next_proto_mask) { - *next_proto_mask = 0; - } } else if (proto == IPPROTO_UDP) { struct rte_flow_item_udp *spec, *mask; @@ -879,11 +871,6 @@ parse_flow_match(struct flow_patterns *patterns, consumed_masks->tp_dst = 0; add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_UDP, spec, mask); - - /* proto == UDP and ITEM_TYPE_UDP, thus no need for proto match. */ - if (next_proto_mask) { - *next_proto_mask = 0; - } } else if (proto == IPPROTO_SCTP) { struct rte_flow_item_sctp *spec, *mask; @@ -900,11 +887,6 @@ parse_flow_match(struct flow_patterns *patterns, consumed_masks->tp_dst = 0; add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_SCTP, spec, mask); - - /* proto == SCTP and ITEM_TYPE_SCTP, thus no need for proto match. */ - if (next_proto_mask) { - *next_proto_mask = 0; - } } else if (proto == IPPROTO_ICMP) { struct rte_flow_item_icmp *spec, *mask; @@ -921,11 +903,6 @@ parse_flow_match(struct flow_patterns *patterns, consumed_masks->tp_dst = 0; add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ICMP, spec, mask); - - /* proto == ICMP and ITEM_TYPE_ICMP, thus no need for proto match. */ - if (next_proto_mask) { - *next_proto_mask = 0; - } } add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_END, NULL, NULL);