From patchwork Wed Mar 23 10:58:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Sukholitko X-Patchwork-Id: 12789678 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 4E085C433EF for ; Wed, 23 Mar 2022 10:58:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233915AbiCWK75 (ORCPT ); Wed, 23 Mar 2022 06:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243666AbiCWK74 (ORCPT ); Wed, 23 Mar 2022 06:59:56 -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 A6DFF1168 for ; Wed, 23 Mar 2022 03:58:22 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id mm17-20020a17090b359100b001c6da62a559so6015853pjb.3 for ; Wed, 23 Mar 2022 03:58:22 -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=eG81FoLZaGdfDiXfTTAfWKycar64OD0XfnNo25MVRJA=; b=M/EPlitkUAk1rwAZRfK19PSxthUo332zTOI+/n3wXqadOey1KqhcEJmj7hgDBWclH8 lGA3+dKvTtB6YIv7YQfGh65xKttkWWW2/FQnFY/DAEerpKP4dWywFGhgojOVHOOo1t+o I+uXDrGZF8orpq0GKfMsMHS7C7GBZfdjLyGvM= 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=eG81FoLZaGdfDiXfTTAfWKycar64OD0XfnNo25MVRJA=; b=Hi5myWyV+mAHrpTxcyb/PmmbvScUs1WKVmZEJLa8x5iwQg9iThROvQ/uq4GPtBDnTf LRs1DUqcpxDOP/3OVX3UlC+u0HDSz1SDDkTdHVkOldX553nzLdIYcPol5zNKp/FUfftY h8jfyKSCSoHNiKro0kC/Vmo+w+4gSFJXilZ8iR6jCAc+HB5xitRBYx3FJN7QTTX15hUg bFTqTJAAaifNCv1TiEmyEfQvb+uK5BGi1mxVeOztZI5H2jpp7n4JMjwA02NFE+AoZkUI XgAQkOvGt6h7WV/80VGfZ6zoqWzecfGxhcpFU7ClS5hJ5qdiqNxpf5QVNwiIAUVG+jJL VxSA== X-Gm-Message-State: AOAM533gGoCsKqcTAxgSDcAbqnCXpxqheraUFo8QcMXg1jKmOPNEnP2h 5rpAnSJ31fd1wK1C/A5R8LG5YQf/N6r36HAirG59ABGQx1ha5HF5smazTCasuhDxlO1T4/5ofFQ gHEnOvqRIzToeBZTrgphSlnyZ/UMQYo3Mew260IgDsQsRRqkQFuCqUTxmi4i8o5XDOxXaTnnc4f ENsHcCXjm6xw== X-Google-Smtp-Source: ABdhPJw0rP3OWTXfgtLA1j0cKE9E7S8kLZ+EHt1/rfVpo9BavqeRImWkmkE0fY/iGLgsC+0mvcisQQ== X-Received: by 2002:a17:90a:2b86:b0:1c7:6e7a:3e00 with SMTP id u6-20020a17090a2b8600b001c76e7a3e00mr7381633pjd.115.1648033101989; Wed, 23 Mar 2022 03:58:21 -0700 (PDT) Received: from localhost.localdomain ([192.19.250.250]) by smtp.gmail.com with ESMTPSA id p125-20020a622983000000b004f6c5d58225sm26092027pfp.90.2022.03.23.03.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 03:58:21 -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: Wed, 23 Mar 2022 12:58:06 +0200 Message-Id: <20220323105808.30298-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(-)