From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamal Hadi Salim Subject: Re: [PATCH net-next v3 5/5] act_mirred: use TC_ACT_REINJECT when possible Date: Wed, 25 Jul 2018 07:50:51 -0400 Message-ID: <39f8a66e-cf2c-13cd-9f92-cd61b60cb5e1@mojatatu.com> References: <612f6fb5b0cdddcbbc2d99f65b148b7f3b8b9a27.1532437050.git.pabeni@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Linux Kernel Network Developers , Jiri Pirko , Daniel Borkmann , Marcelo Ricardo Leitner , Eyal Birger , David Miller To: Cong Wang , Paolo Abeni Return-path: Received: from mail-it0-f68.google.com ([209.85.214.68]:54478 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728757AbeGYNCN (ORCPT ); Wed, 25 Jul 2018 09:02:13 -0400 Received: by mail-it0-f68.google.com with SMTP id s7-v6so8212938itb.4 for ; Wed, 25 Jul 2018 04:50:53 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 24/07/18 05:15 PM, Cong Wang wrote: > On Tue, Jul 24, 2018 at 1:07 PM Paolo Abeni wrote: >> + >> + /* let's the caller reinject the packet, if possible */ >> + if (skb_at_tc_ingress(skb)) { >> + res->ingress = want_ingress; >> + res->qstats = this_cpu_ptr(m->common.cpu_qstats); >> + return TC_ACT_REINJECT; >> + } > > Looks good to me, but here we no longer return user-specified > return value here, I am sure it is safe for TC_ACT_STOLEN, but > I am not sure if it is safe for other values, like TC_ACT_RECLASSIFY. > > Jamal, is there any use case of returning !TC_ACT_STOLEN for > ingress redirections? I cant think of one off top of my head. There maybe a future use case where it is not so - maybe just allow to return the user programmed action? that value will always be TC_ACT_STOLEN if the rule was specified via iproute2/tc. cheers, jamal