From patchwork Mon Apr 11 13:32:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Sukholitko X-Patchwork-Id: 12809109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BB43C433F5 for ; Mon, 11 Apr 2022 13:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346506AbiDKNeb (ORCPT ); Mon, 11 Apr 2022 09:34:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346520AbiDKNe3 (ORCPT ); Mon, 11 Apr 2022 09:34:29 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E2AB3BA78 for ; Mon, 11 Apr 2022 06:32:16 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id a16-20020a17090a6d9000b001c7d6c1bb13so16827393pjk.4 for ; Mon, 11 Apr 2022 06:32:16 -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=0rx7rzIDyUIz4rGCu4mWG3gGHKeVDBo/u8sAugoXsk4=; b=DVHaz0y8ufEdqaqD3Fej3zm2YSWbpbNL/+vXz3hVZ6FKv7whHg5P665ia17ZVFSerV DBJDhn2bQj3ZJn1X4v4dz87Gh/ml+VuChfzd6JkMV0p14CVsNG9fpTEkfC5eRqnoUV/n 5QKAk7xzGPRuESJQTDldqkGIVV/UzZPk2ba18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=0rx7rzIDyUIz4rGCu4mWG3gGHKeVDBo/u8sAugoXsk4=; b=MNCie3rVu/YaeMAy7cLm1DKD0plADaUnaPXcAhnpyvZcwiksL0jCANOQuNcUX8g2qv xYF6iWJsaEkKV/D0Di3gj0L6iFTZCYvoaZSBNqBHNO+1VCC0a/Va8eak4RYE9hbVoylx dlr3We/LIkydEc7IDUvG6qBHKSLt2HAsLN6JcvlmsvHmUa7c9HYFcGFgo1esetKN8FTc /rBLZHRcpJ+jVQFQ54ABuv0KCIp6qiFExwSvPpUXYL/JjANLEff3tRf3lEZMoKQ3cBri kkPHCtAWkEjXDcuPp+G0jKk/7AwJdK6RpIl0RcyX/hJIC9zY4dRmQmVgj4hKTLqWvuSB 2l9A== X-Gm-Message-State: AOAM532L+/OHhdzarXh+L7ahwcSj5v6dpMZfR/oQLOCpRvtCt27UAaQM Qh4ItROKMNS02htUG9DsTPS80nT3DC2OEqzTiAHesuDSFF0M4DiCnN3WViKxhMMzoldqBhE/G3A cYzQXfA24Az9ftsHuo7ybD8H6JIUA4bxB9ShZUp+I71p8jn7dXF5vXDN3o8ojhkFo8ZViseedq8 4lVAS/0oNGMA== X-Google-Smtp-Source: ABdhPJz2QEvhREtsQvZHO02FhM5hpMn48jngdBvOK3ZNwzwKDBwG4D9yxqGquizv9rX3ERi3iGOSaQ== X-Received: by 2002:a17:90b:17c4:b0:1c6:e74b:31d9 with SMTP id me4-20020a17090b17c400b001c6e74b31d9mr36377319pjb.242.1649683935184; Mon, 11 Apr 2022 06:32:15 -0700 (PDT) Received: from localhost.localdomain ([192.19.250.250]) by smtp.gmail.com with ESMTPSA id v4-20020a17090a00c400b001cb4f242c92sm10232730pjd.26.2022.04.11.06.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 06:32:14 -0700 (PDT) From: Boris Sukholitko To: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "Gustavo A . R . Silva" , Vladimir Oltean , Eric Dumazet , zhang kai , Yoshiki Komachi Cc: Ilya Lifshits , Boris Sukholitko Subject: [PATCH iproute2-next 0/2] flower: match on the number of vlan tags Date: Mon, 11 Apr 2022 16:32:00 +0300 Message-Id: <20220411133202.18278-1-boris.sukholitko@broadcom.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com Hi, Our customers in the fiber telecom world have network configurations where they would like to control their traffic according to the number of tags appearing in the packet. For example, TR247 GPON conformance test suite specification mostly talks about untagged, single, double tagged packets and gives lax guidelines on the vlan protocol vs. number of vlan tags. This is different from the common IT networks where 802.1Q and 802.1ad protocols are usually describe single and double tagged packet. GPON configurations that we work with have arbitrary mix the above protocols and number of vlan tags in the packet. The following patch series implement number of vlans flower filter. They add num_of_vlans flower filter as an alternative to vlan ethtype protocol matching. The end result is that the following command becomes possible: tc filter add dev eth1 ingress flower \ num_of_vlans 1 vlan_prio 5 action drop The corresponding kernel patches are being sent separately. Thanks, Boris. Boris Sukholitko (2): Add num of vlans parameter Check args with num_of_vlans include/uapi/linux/pkt_cls.h | 2 ++ tc/f_flower.c | 57 ++++++++++++++++++++++++++---------- 2 files changed, 43 insertions(+), 16 deletions(-)