From patchwork Mon Jun 21 09:24:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Sukholitko X-Patchwork-Id: 465644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_NO_TEXT, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DBD1C48BE5 for ; Mon, 21 Jun 2021 09:25:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6018C601FD for ; Mon, 21 Jun 2021 09:25:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230423AbhFUJ1Z (ORCPT ); Mon, 21 Jun 2021 05:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbhFUJ1X (ORCPT ); Mon, 21 Jun 2021 05:27:23 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 785D2C061574 for ; Mon, 21 Jun 2021 02:25:09 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id m15-20020a17090a5a4fb029016f385ffad0so7077333pji.0 for ; Mon, 21 Jun 2021 02:25:09 -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=ISsDQMkyvOLzAWTbGXT00uyXsAlFOXhQ+rnK+qGYd50=; b=fRDE2rHn6VAtQaT3pt7Ee2ebdIz0vKveSQu48TXcyITCLh2oSCE8RedCJYTftJHSq3 O2c9NZF928yv+jyLSwdNk2N451Lij6golLTve4ZZI1srzPILdqBjz7gO+kmYBSVAdRB1 1NLEE33iv5GkHmNKwwV+7Pccfro4XY1zgO5cY= 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=ISsDQMkyvOLzAWTbGXT00uyXsAlFOXhQ+rnK+qGYd50=; b=LBHw8jdqtURB9hC9dQn7JD0ASVludI/C+H+StmIu/T008xvRBnLmrbzqjo8gRpG3IN lTG0gU6hqh776tPDq8jqPx7ZHBz1JRJHnn5n07cWVY3Co5gFi9ikwQXgEIb+VFF5MT7D xdhupHbUOZwJE5ZlyikaT48e7nrJLgFc5atnqGNUWMBbzdCcBX3CB4V+HoHT+Rei9n+Z ZEbbiYaZy3fEfLPcrg/yn7641+zpiTT606Z7ubpYkdhQgb5JRYwJ2/KK6Rc+Mo+7yPWg ypUVKsNcgcFYxekT5wGhABVdKviWwl5SPKoUwBIFcJlXGDLCGJnZ+NRhLIogXDm1Cmf+ +Y6A== X-Gm-Message-State: AOAM5312z8TvBQxO4VSp/AoVpl5M1b75lESgwV4IiT6rhOupDBMwMboB vvU+wjp56brYdFDY7oJINWhS4N3RTQt/LrR8cwwXIpovTZ5+L+x2C2LodgWtjyuRyUWv5NyvpEQ JSAp6Fw6B8IKEmMY02bInGcgksJhsv6Tfx2GJXB+HqqI9QdtH6nbUoZHya3GK/3+LmAZW/NSBq3 rrJEHBtZg= X-Google-Smtp-Source: ABdhPJxS0CusWw4FFj/Xerew+/E/EE5gReY2hdjsdZTFxfCiRKdsTzVQrRnSZX7dC3p/T9bBe7r1uw== X-Received: by 2002:a17:902:7293:b029:123:4c2b:3db with SMTP id d19-20020a1709027293b02901234c2b03dbmr8748730pll.71.1624267508469; Mon, 21 Jun 2021 02:25:08 -0700 (PDT) Received: from localhost.localdomain ([192.19.250.250]) by smtp.gmail.com with ESMTPSA id y74sm4185390pfg.205.2021.06.21.02.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 02:25:07 -0700 (PDT) From: Boris Sukholitko To: netdev@vger.kernel.org, Jamal Hadi Salim , Jiri Pirko , Cong Wang Cc: "David S . Miller" , Jakub Kicinski , Vladimir Oltean , Vadym Kochan , Ilya Lifshits , Boris Sukholitko Subject: [PATCH net-next] Revert "net/sched: cls_flower: Remove match on n_proto" Date: Mon, 21 Jun 2021 12:24:29 +0300 Message-Id: <20210621092429.10043-1-boris.sukholitko@broadcom.com> X-Mailer: git-send-email 2.29.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This reverts commit 0dca2c7404a938cb10c85d0515cee40ed5348788. The commit in question breaks hardware offload of flower filters. Quoting Vladimir Oltean : fl_hw_replace_filter() and fl_reoffload() create a struct flow_cls_offload with a rule->match.mask member derived from the mask of the software classifier: &f->mask->key - that same mask that is used for initializing the flow dissector keys, and the one from which Boris removed the basic.n_proto member because it was bothering him. Reported-by: Vadym Kochan Signed-off-by: Boris Sukholitko --- net/sched/cls_flower.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 2e704c7a105a..d7869a984881 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -1531,13 +1531,14 @@ static int fl_set_key(struct net *net, struct nlattr **tb, &mask->basic.n_proto, TCA_FLOWER_UNSPEC, sizeof(key->basic.n_proto)); - mask->basic.n_proto = cpu_to_be16(0); } else { key->basic.n_proto = ethertype; + mask->basic.n_proto = cpu_to_be16(~0); } } } else { key->basic.n_proto = ethertype; + mask->basic.n_proto = cpu_to_be16(~0); } }