From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next v3 5/5] act_mirred: use TC_ACT_REINJECT when possible Date: Wed, 25 Jul 2018 15:30:21 +0200 Message-ID: <20180725133021.GL2164@nanopsycho> References: <612f6fb5b0cdddcbbc2d99f65b148b7f3b8b9a27.1532437050.git.pabeni@redhat.com> <3b2edafe358d1015a143b1fa0cf49b180e962c88.camel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Cong Wang , Linux Kernel Network Developers , Jamal Hadi Salim , Daniel Borkmann , Marcelo Ricardo Leitner , Eyal Birger , David Miller To: Paolo Abeni Return-path: Received: from mail-wm0-f47.google.com ([74.125.82.47]:53688 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728452AbeGYOoa (ORCPT ); Wed, 25 Jul 2018 10:44:30 -0400 Received: by mail-wm0-f47.google.com with SMTP id s9-v6so6106794wmh.3 for ; Wed, 25 Jul 2018 06:32:48 -0700 (PDT) Content-Disposition: inline In-Reply-To: <3b2edafe358d1015a143b1fa0cf49b180e962c88.camel@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: Wed, Jul 25, 2018 at 12:14:32PM CEST, pabeni@redhat.com wrote: >On Tue, 2018-07-24 at 14:15 -0700, 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. > >I can make it safer, using the no clone path only if tcf_action is >TC_ACT_STOLEN. That will still cover the relevant use-cases. That is a good idea. Thanks! > >Will do that in v4. > >Cheers, > >Paolo >