From patchwork Tue Apr 12 10:03:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Sukholitko X-Patchwork-Id: 12810517 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 8953EC433F5 for ; Tue, 12 Apr 2022 11:17:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346927AbiDLLT3 (ORCPT ); Tue, 12 Apr 2022 07:19:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353425AbiDLLSk (ORCPT ); Tue, 12 Apr 2022 07:18:40 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EC5298F5C for ; Tue, 12 Apr 2022 03:03:59 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d15so16335114pll.10 for ; Tue, 12 Apr 2022 03:03:58 -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=hZPwZj/ZHraPQmyZLWxxTB7zz43exQePT+lwwxKq57E=; b=Z1UjyepM6Ec0pyui75AgXQIrytqeR7Oyt76AuzA7S+Yb1lX4J80eUySExzAcNfC9qi Ui3FOMQlr8OkDd5cIlr4kBcTgwuC7VATtJJdfmZC7rrI9dmTLhyZsYAaqVyVsa6MgMCe hrhUshAj7w/l7xXYK3dkDCNRmq14qZnz/ttKE= 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=hZPwZj/ZHraPQmyZLWxxTB7zz43exQePT+lwwxKq57E=; b=ZUODllGJpj2O25+kja3OJ+bSQFIfzbD/qxoHaXEsUF7SvPrL1sRS2eEJZvf/c1V1zg IMVkS0B4PLoRaaBRlbiib/IXCaIBO+5OAiWqY4VN6/XD81BCeQ+TxluLHDX3kxAIQrrq 0shWaFaOFnKtMqekMpNr8YHHzd06GfVXrJalg1scnYl+6a52vcxSfb1YRk/I6bzLt1u6 YnlA0NzlaehJVdAeSnTstziL+5imarlx1UOoo8CgrFHwsy+djy7wynFzmt6AE8SLXsnp w8qNdy9HDCjX9rDtrI5EA5K/t5kqCRquOWFuFDzTeo2MteOukGEFe5RfViWtU8edfI7E ngJg== X-Gm-Message-State: AOAM530H1zuv8KrOn+gmeB4KiIZ8npC99XGHdZ1dxWMXynGWIZiX9G+/ odFgpunH3RxTTKbW6uH9hxDZhTovsI+0whnyo0ZS94XJLWpfNrqYZtLF4K8pNyJiBxBVte+7VJM yl9riZ5quNlcAyJpWREqWNE7xBJTVyAgnd0x61eW4EkvsIQQN1OsZRpTFGfjvCBqb01ReLCq+Cr TwPrbnbnV4vw== X-Google-Smtp-Source: ABdhPJwiSnPu8W3sKGudZJMMOdB4k2L82II6WRGrAWSYGPxdiKCOtoCATdI9cWXd53PD0eNcDegQqg== X-Received: by 2002:a17:903:31d5:b0:158:27f4:fc9f with SMTP id v21-20020a17090331d500b0015827f4fc9fmr19760833ple.60.1649757838112; Tue, 12 Apr 2022 03:03:58 -0700 (PDT) Received: from localhost.localdomain ([192.19.250.250]) by smtp.gmail.com with ESMTPSA id n24-20020aa79058000000b00505686a982asm17357087pfo.125.2022.04.12.03.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 03:03:57 -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 v2 0/2] f_flower: match on the number of vlan tags Date: Tue, 12 Apr 2022 13:03:41 +0300 Message-Id: <20220412100343.27387-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. - v2: add missing f_flower subject prefix Boris Sukholitko (2): f_flower: Add num of vlans parameter f_flower: 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(-)