Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1931074pxy; Mon, 2 Aug 2021 14:13:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt8yX7dfpiVvzYPRDeDzZzS2Jyy+vk8LicjeQAWLHJxM6SPRc6rnExU6YhChWxsdl4377e X-Received: by 2002:a05:6402:214:: with SMTP id t20mr21968065edv.247.1627938809732; Mon, 02 Aug 2021 14:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627938809; cv=none; d=google.com; s=arc-20160816; b=xW+blRjvEZtp9j8REB1FnFMH7A83OW7U6H5O6cFoS0jHSsTWb8CHaqAvcydYXK9bgM +zRzQApWlDADqFIwZWux6u97wiX+zLZIioHDhpOAQDAH71P6fqcSe6E2/MeyLSk69dZb eMtUWVv80/si4zTOHequtjouF380fF4eio82415KQU5PiBFR3aQpCRscYZGV3ySL5W2F wahCLe3wz5Df7ngKkvkkWIKD2g7yMkQNkcIsoM+E/DRvK6cs8mkOapYIXSy0LlXg90Nu TO5wPemJnUg6jD95aeG8X3I+imcCZvU8RIX/LWZPNmdQ89Wb4NQ2YlFqBGV9m6kJOBPt 87yg== 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; bh=rKtOW0LnH5Qg8S9AeCrIzwh0I4sqr7aESdJgyaUIYfQ=; b=rlczV9h28AKZIGVIIwDeru6Eq3dwrmxi+aa62YcvSWlm1gVqTRNeUh6ToQq86GuYZl mBu9NLRl6VhhqMuRHdKd+DRqpxSX7HlqCbI9VjGLZZVpIH7oNAK7wJeGk28F6tjEGk1v iLpoOaG19WrS2QPUMGVPDH5QIsEwe0k+Wbr7PRnqoreONnYBaRguaQ/bkxXyxb4U+Ztl ZbJgfYtBEjndda/IAj42REaTH/zMsnE4prbfG/9JaOR4MLKB8lg+Mdtb0hpsJXtNz/5F os7+0x/+nvoJzZ/+MzxP8jI2wRFJ0Q+nzkZLDKdgRW1XU7JdSkXXxfRFM/QDVd2JQhZC THhQ== ARC-Authentication-Results: i=1; mx.google.com; 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 dp17si12025536ejc.724.2021.08.02.14.13.06; Mon, 02 Aug 2021 14:13:29 -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; 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 S231911AbhHBVLV (ORCPT + 99 others); Mon, 2 Aug 2021 17:11:21 -0400 Received: from www62.your-server.de ([213.133.104.62]:43924 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231730AbhHBVLU (ORCPT ); Mon, 2 Aug 2021 17:11:20 -0400 Received: from sslproxy03.your-server.de ([88.198.220.132]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mAfDB-000GxW-Na; Mon, 02 Aug 2021 23:11:04 +0200 Received: from [85.5.47.65] (helo=linux.home) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAfDB-000IKM-7H; Mon, 02 Aug 2021 23:11:01 +0200 Subject: Re: [PATCH net-next 1/2] net/sched: sch_ingress: Support clsact egress mini-Qdisc option To: Peilin Ye , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Cong Wang , Peilin Ye , ast@kernel.org, john.fastabend@gmail.com References: <1931ca440b47344fe357d5438aeab4b439943d10.1627936393.git.peilin.ye@bytedance.com> From: Daniel Borkmann Message-ID: <672e6f13-bf58-d542-6712-e6f803286373@iogearbox.net> Date: Mon, 2 Aug 2021 23:10:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1931ca440b47344fe357d5438aeab4b439943d10.1627936393.git.peilin.ye@bytedance.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.2/26251/Mon Aug 2 10:18:34 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/21 10:49 PM, Peilin Ye wrote: > From: Peilin Ye > > If the ingress Qdisc is in use, currently it is not possible to add > another clsact egress mini-Qdisc to the same device without taking down > the ingress Qdisc, since both sch_ingress and sch_clsact use the same > handle (0xFFFF0000). > > Add a "change" option for sch_ingress, so that users can enable or disable > a clsact egress mini-Qdisc, without suffering from downtime: > > $ tc qdisc add dev eth0 ingress > $ tc qdisc change dev eth0 ingress clsact-on > > Then users can add filters to the egress mini-Qdisc as usual: > > $ tc filter add dev eth0 egress protocol ip prio 10 \ > matchall action skbmod swap mac > > Deleting the ingress Qdisc removes the egress mini-Qdisc as well. To > remove egress mini-Qdisc only, use: > > $ tc qdisc change dev eth0 ingress clsact-off > > Finally, if the egress mini-Qdisc is enabled, the "show" command will > print out a "clsact" flag to indicate it: > > $ tc qdisc show ingress > qdisc ingress ffff: dev eth0 parent ffff:fff1 ---------------- > $ tc qdisc change dev eth0 ingress clsact-on > $ tc qdisc show ingress > qdisc ingress ffff: dev eth0 parent ffff:fff1 ---------------- clsact > > Reviewed-by: Cong Wang > Signed-off-by: Peilin Ye NAK, just use clsact qdisc in the first place which has both ingress and egress support instead of adding such hack. You already need to change your scripts for clsact-on, so just swap 'tc qdisc add dev eth0 ingress' to 'tc qdisc add dev eth0 clsact' w/o needing to change kernel. Thanks, Daniel