From patchwork Fri Jan 10 10:36:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 1220968 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=netronome.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=Vgz457l4; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47vKtS4SMqz9sP6 for ; Fri, 10 Jan 2020 22:06:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2CA1586B09; Fri, 10 Jan 2020 11:06:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IRNvvVSKJTxk; Fri, 10 Jan 2020 11:06:37 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 65C3B869ED; Fri, 10 Jan 2020 11:06:37 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 55B24C1D7D; Fri, 10 Jan 2020 11:06:37 +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 F412AC0881 for ; Fri, 10 Jan 2020 11:06:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DCD0F203EA for ; Fri, 10 Jan 2020 11:06:35 +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 0Uic11528EDQ for ; Fri, 10 Jan 2020 11:06:35 +0000 (UTC) X-Greylist: delayed 00:22:26 by SQLgrey-1.7.6 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by silver.osuosl.org (Postfix) with ESMTPS id 1CDAB203A0 for ; Fri, 10 Jan 2020 11:06:35 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id p14so980973pfn.4 for ; Fri, 10 Jan 2020 03:06:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tjQlcFmgdXVAHVlDvMpOVH4Um0yiYj9mRt5uILrFOMg=; b=Vgz457l45U8D/vJZpNvAZw5T5+XADhDvhY38R5AUORw7k7DjJ5REE5MuYIYhow/8LA LPPn5AiEgbVb4byYi+F25n3OVYSAvGFurcjvvaM+qWmNc4QNC9CRV1EZvVRkcUlZtS40 i61++HCEzoMrasAiS/DuihDBOXwxmPaHxIWy+W+y3mWrTDWq+n5xktvu79tzMi/THYYU LCRzYMJ6myBogjKIgnz9LjbYM9n7GIX2WYnZtHVTtxtezlPR348qqbjAw1BpVGbwErZY tWoph5lfx3WPskan74yh93nb2OIW7l6fxBPEBiC9QFcTEHa6Bo8hMDAC74Rj4qaj4Wpe iyXg== 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 :content-transfer-encoding; bh=tjQlcFmgdXVAHVlDvMpOVH4Um0yiYj9mRt5uILrFOMg=; b=gXRKdZESAFAQRXuih1VRYBp8oPSX6DweVJxFtkEX1kR0ZbopIAdl0ieq7VWJ0CGmpi KkS16atzK2FWJROB+46z2labgsRmRoD0bqSTulruYKCEFQRIpOpzOKDqZAQ7VXblH3o8 nZ9DrjjVkzaLHFxYTvQHJBT6SBBwRlbzTOmc8uMZ4T2+H6NElT3beivIoez7aLduJ3nJ o0IOlQLg4XJbXHJcaV5AsaqibChK/DMk5y1fWqPV/qbbH0TX7r1Q75VYsYex0xbXpP5S cXgPliPXBtMJz3TTKGtBe1L/6XOjnY/b3kz0mFCUt9WqH6lVxVkrWzqhJf06OQQxnNru 7tzA== X-Gm-Message-State: APjAAAVSWoChn+L3Zff3YNmHUnOflqm6zrIMHOEx47f0EzMBEBUuOMDQ EDDyZB5uYR50xDPR2e+n5IjT5Jkt37e8ITimAh7CXmK+n+OWF+jokAzvMMiGtak6Yab6o28gyKp dCSLQoRDNRs2gWdbkvBJ2MKeZLkiiypjhiOrsiw6vv76jiog6FSoMfdZZTp7b87rcTJyOO7k= X-Google-Smtp-Source: APXvYqwsncfhd0rBG9pZu9tomPf7EMN5pd1+gxosqoByxj7V4dyujhPbD0piAHrTi1E+NSw4HjXXjw== X-Received: by 2002:ad4:40cb:: with SMTP id x11mr1991462qvp.167.1578652583918; Fri, 10 Jan 2020 02:36:23 -0800 (PST) Received: from reginn.com ([2001:982:756:703:d63d:7eff:fe99:ac9d]) by smtp.gmail.com with ESMTPSA id l35sm800349qtl.12.2020.01.10.02.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 02:36:23 -0800 (PST) From: Simon Horman To: dev@openvswitch.org Date: Fri, 10 Jan 2020 11:36:01 +0100 Message-Id: <20200110103601.19381-1-simon.horman@netronome.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: oss-drivers@netronome.com Subject: [ovs-dev] [PATCH] tc: handle packet mark of zero 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: John Hurley Openstack may set an skb mark of 0 in tunnel rules. This is considered to be an unused/unset value. However, it prevents the rule from being offloaded. Check if the key value of the skb mark is 0 when it is in use (mask is set to all ones). If it is then ignore the field and continue with TC offload. Signed-off-by: John Hurley [simon; check for exact-match rather than any match] Signed-off-by: Simon Horman --- lib/netdev-offload-tc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c index 7453078d535f..daff8a379e97 100644 --- a/lib/netdev-offload-tc.c +++ b/lib/netdev-offload-tc.c @@ -1619,6 +1619,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match, mask->ct_label = OVS_U128_ZERO; } + /* ignore exact match on skb_mark of 0. */ + if (mask->pkt_mark == UINT32_MAX && !key->pkt_mark) { + mask->pkt_mark = 0; + } + err = test_key_and_mask(match); if (err) { return err;