Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp514952pxv; Thu, 24 Jun 2021 13:08:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMa2EkG40e8uM08qhCpVHKKIStHAJYjq73n5hjlxq03hJ7qxGv3pfoLbEmyvh542p32VEU X-Received: by 2002:a05:6e02:1aa7:: with SMTP id l7mr4692098ilv.187.1624565329075; Thu, 24 Jun 2021 13:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624565329; cv=none; d=google.com; s=arc-20160816; b=oWEUq8Pl5wRgh0nEeH3puMDB4i7XitEHGnA8xbqTHM3ZB4XPQt6nC5JpGWSTTDNEJS KMBk8a7bKQXLBlpcrAL1nOAcuK7BwIAyUDMnMWPfXv48lhTV1AN0XCYbP0xBx2hNdYT1 QPU67ztt+/nyVUxttM4yjpAmCXboShgGesQiFZGElyKf+vGGjBQZBfADEklHA0c0VWog 2msPWOy5S32fAZvD6l2gjmHzNv7u0tmJfl0XfZbxEWq4o8KFkAXXlEk3vMMlnAMyq7/K m5+FP+p8NHKqzrddGTbMHC3+oz+S+C53iWqbagnwpwX6JLTu2UktMh3oL9AHw0jDwDEc 6eIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=qz6S88JwspsIJOU6srz7SjZZfMOghWPodV7th4gTqJI=; b=PAM/ZaGbEOaSfzrEv/j7r4cKZfsQuc1W6quCrEJUI85jjXZYvvWA4lScw/jTkvNmGp +cx+dsuHVVnKLyKo7WObhB1gemXG6CfMk9I54eKlIzf9TJpsTgbLMXthOyiMF6Gms521 DS1DVz9Aw0cqnOycloJKi0O3uD8+LXy2CrYWwaSsBwT4KZ8JUpGL5ZRcD0qV5nWZ+eDc 663/B7sw6Araw27r+2lHnxhS4WM+7Zkff7FccdypuTYVQkS/IQ3mR2jwXdhHIsyjVuRO vOTQgFLt63SlrHEDTFd+mWPqQuexynXhNVEo1iIL3XF4be7RT6J5rkYcRlJQMTyDAkQY 5nAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20150623.gappssmtp.com header.s=20150623 header.b=DBe5RqaW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si4912223ilh.114.2021.06.24.13.08.36; Thu, 24 Jun 2021 13:08:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mojatatu-com.20150623.gappssmtp.com header.s=20150623 header.b=DBe5RqaW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232653AbhFXUKS (ORCPT + 99 others); Thu, 24 Jun 2021 16:10:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232120AbhFXUKR (ORCPT ); Thu, 24 Jun 2021 16:10:17 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ABFBC061756 for ; Thu, 24 Jun 2021 13:07:58 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id k11so9824079ioa.5 for ; Thu, 24 Jun 2021 13:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qz6S88JwspsIJOU6srz7SjZZfMOghWPodV7th4gTqJI=; b=DBe5RqaWh60s4URJNHa/A9dkeUzH+4ew9K5BnJsTe0X5FMouEsLt0FSHrWnQBWKcis J4Qh1u4Ru9w6VRWma4Kjx/5rHRh4RKQGMjx/L3VU8yKSab0GTwG9eo6H0Gd1Rcyex7YG tcnl47DhQM11j+BXAX/ehshk9JcJgytDlReUHiD6YsTWn9Vtq8aCIaXrJ7RKevC9EK73 MOFMNqaGGZT4IS6AFf4GI5JbirBtvEupPTTXayexssstN28rV3nKNdnbrHJja83y4+GT BlNkHLNh2OycJNytkhO2riQj/Zg+AzTEs4/CKeq5DmlQkysvjEaTttGfalLKfHJTdWC/ iBAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qz6S88JwspsIJOU6srz7SjZZfMOghWPodV7th4gTqJI=; b=AUZnrSOKOIQQhl11Fi11usQ0+7WUVlDNN4N3qLHSbwIksGTObVMv5RcgVvNN6dRbba 1/zhnx/ScInf4ndq8ll/se1zxNZQqEJB23yP9Fm5+trNT2yMGxT0x17ez5lTqz9YyUVO fjRBeWuPz/dqtJ5APqmWWgDJn56JB8kwfKq0o051deABcVwcjC44LcQRiby/MryhOMb1 sh4W8CFtEmAGsdUqKcJ1x8sOF4T14UouWBjZJgDHvdjimarXFHfnfdVeRnwAn6GvKfhV 3bWH13t2zCp6MCfPTPSZTPTZ38t+8mwqvAPMx4FhXc4ovuMizXOBVJPXEhqzY5jN+9Gu 9UHw== X-Gm-Message-State: AOAM531PpKmX85MK4f98lXHjxwqTNuwS76Ql/mpLlNG8w/1OJECwfMl6 WZzgs8R1rOgidiekEgd8qSbgkg== X-Received: by 2002:a05:6638:3d3:: with SMTP id r19mr6302403jaq.78.1624565278051; Thu, 24 Jun 2021 13:07:58 -0700 (PDT) Received: from [192.168.1.171] (bras-base-kntaon1617w-grc-24-174-92-115-23.dsl.bell.ca. [174.92.115.23]) by smtp.googlemail.com with ESMTPSA id c3sm2293979ils.54.2021.06.24.13.07.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jun 2021 13:07:57 -0700 (PDT) Subject: Re: [PATCH net-next] net/sched: cls_flower: fix resetting of ether proto mask To: Boris Sukholitko Cc: Vladimir Oltean , Vadym Kochan , "David S. Miller" , Jakub Kicinski , Cong Wang , Andrew Lunn , Serhiy Boiko , Volodymyr Mytnyk , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jiri@resnulli.us, idosch@idosch.org, ilya.lifshits@broadcom.com References: <20210617161435.8853-1-vadym.kochan@plvision.eu> <20210617164155.li3fct6ad45a6j7h@skbuf> <20210617195102.h3bg6khvaogc2vwh@skbuf> <20210621083037.GA9665@builder> <20210622131314.GA14973@builder> <451abd22-4c81-2821-e8d4-4f305697890c@mojatatu.com> <20210622152218.GA1608@noodle> From: Jamal Hadi Salim Message-ID: <7d0367ab-22e4-522a-11ef-8fb376672b54@mojatatu.com> Date: Thu, 24 Jun 2021 16:07:56 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210622152218.GA1608@noodle> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, Apologies for the latency. On 2021-06-22 11:22 a.m., Boris Sukholitko wrote: > On Tue, Jun 22, 2021 at 10:17:45AM -0400, Jamal Hadi Salim wrote: [..] >>> Do you by any chance have some naming suggestion? Does >>> vlan_pure_ethtype sound ok? What about vlan_{orig, pkt, raw, hdr}_ethtype? >>> >> >> The distinction is in getting the inner vs outer proto, correct? > > Yes. To be more explicit: the outer protocol (ETH_P_PPP_SES in this case) is > invisible to the user due to __skb_flow_dissect drilling down > to find the inner protocol. Ok, seems this is going to be problematic for flower for more than just ETH_P_PPP_SES, no? i.e anything that has an inner proto. IIUC, basically what you end up seeing in fl_classify() is the PPP protocol that is extracted by the dissector? > Yes. Talking specifically about flower's fl_classify and the following > rule (0x8864 is ETH_P_PPP_SES): > > tc filter add dev eth0 ingress protocol 0x8864 flower action simple sdata hi6 > > skb_flow_dissect sets skb_key.basic.n_proto to the inner protocol > contained inside the PPP tunnel. fl_mask_lookup will fail finding the > outer protocol configured by the user. > For vlans it seems that flower tries to "rectify" the situation with skb_protocol() (that why i pointed to that function) - but the situation in this case cant be rectified inside fl_classify(). Just quick glance of the dissector code though seems to indicate skb->protocol is untouched, no? i.e if you have a simple pppoe with ppp protocol == ipv4, skb->protocol should still be 0x8864 on it (even when skb_key.basic.n_proto has ipv4). > It looks to me that there is no way to match on outer protocol such as > ETH_P_PPP_SES at least in flower. Although other filters (e.g. matchall) > will work, VLAN packets containing ETH_P_PPP_SES will require flower and > still will not match. This is a consequence of flower using flow_dissector and flow dissector loosing information.. >> This is because when vlan offloading was merged it skewed >> things a little and we had to live with that. >> >> Flower is unique in its use of the dissector which other classifiers >> dont. Is this resolvable by having the fix in the dissector? > > Yes, the solution suggested by Vladimir and elaborated by myself > involves extending the dissector to keep the outer protocol and having > flower eth_type match on it. This is the "plan" being quoted above. > > > I believe this is the solution for the non-vlan tagged traffic. For the > vlans we already have [c]vlan_ethtype keys taken. Therefore we'll need > new [c]vlan_outer_ethtype keys. > I think that would work in the short term but what happens when you have vlan in vlan carrying pppoe? i.e how much max nesting can you assume and what would you call these fields? cheers, jamal