All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tianyu Yuan <tianyu.yuan@corigine.com>
To: Eelco Chaudron <echaudro@redhat.com>
Cc: Marcelo Leitner <mleitner@redhat.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Simon Horman <simon.horman@corigine.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Davide Caratti <dcaratti@redhat.com>,
	Edward Cree <edward.cree@amd.com>,
	Ilya Maximets <i.maximets@ovn.org>, Oz Shlomo <ozsh@nvidia.com>,
	Paul Blakey <paulb@nvidia.com>, Vlad Buslov <vladbu@nvidia.com>,
	"dev@openvswitch.org" <dev@openvswitch.org>,
	oss-drivers <oss-drivers@corigine.com>,
	Ziyang Chen <ziyang.chen@corigine.com>
Subject: RE: [PATCH/RFC net-next] tc: allow drivers to accept gact with PIPE when offloading
Date: Fri, 2 Dec 2022 12:33:10 +0000	[thread overview]
Message-ID: <PH0PR13MB4793ED98F9384F2CBBA0909094179@PH0PR13MB4793.namprd13.prod.outlook.com> (raw)
In-Reply-To: <A92B3AD9-296F-4B20-88AC-D9F4124C15A9@redhat.com>


On Fri, Dec 2, 2022 at 8:18 PM , Eelco Chaudron wrote:
> 
> On 30 Nov 2022, at 4:36, Tianyu Yuan wrote:
> 
> > On Mon, Nov 29, 2022 at 8:35 PM , Eelco Chaudron wrote:
> >>
> >> On 28 Nov 2022, at 14:33, Marcelo Leitner wrote:
> >>
> >>> On Mon, Nov 28, 2022 at 02:17:40PM +0100, Eelco Chaudron wrote:
> >>>>
> >>>>
> >>>> On 28 Nov 2022, at 14:11, Marcelo Leitner wrote:
> >>>>
> >>>>> On Mon, Nov 28, 2022 at 07:11:05AM +0000, Tianyu Yuan wrote:
> >>> ...
> >>>>>>
> >>>>>> Furthermore, I think the current stats for each action mentioned
> >>>>>> in
> >>>>>> 2) cannot represent the real hw stats and this is why [ RFC
> >>>>>> net-next v2 0/2] (net: flow_offload: add support for per action
> >>>>>> hw stats)
> >> will come up.
> >>>>>
> >>>>> Exactly. Then, when this patchset (or similar) come up, it won't
> >>>>> update all actions with the same stats anymore. It will require a
> >>>>> set of stats from hw for the gact with PIPE action here. But if
> >>>>> drivers are ignoring this action, they can't have specific stats
> >>>>> for it. Or am I missing something?
> >>>>>
> >>>>> So it is better for the drivers to reject the whole flow instead
> >>>>> of simply ignoring it, and let vswitchd probe if it should or
> >>>>> should not use this action.
> >>>>
> >>>> Please note that OVS does not probe features per interface, but
> >>>> does it
> >> per datapath. So if it’s supported in pipe in tc software, we will
> >> use it. If the driver rejects it, we will probably end up with the tc software
> rule only.
> >>>
> >>> Ah right. I remember it will pick 1 interface for testing and use
> >>> those results everywhere, which then I don't know if it may or may
> >>> not be a representor port or not. Anyhow, then it should use
> >>> skip_sw, to try to probe for the offloading part. Otherwise I'm
> >>> afraid tc sw will always accept this flow and trick the probing, yes.
> >>
> >> Well, it depends on how you look at it. In theory, we should be
> >> hardware agnostic, meaning what if you have different hardware in
> >> your system? OVS only supports global offload enablement.
> >>
> >> Tianyu how are you planning to support this from the OVS side? How
> >> would you probe kernel and/or hardware support for this change?
> >
> > Currently in the test demo, I just extend gact with PIPE (previously
> > only SHOT as default and GOTO_CHAIN when chain exists), and then put
> > such a gact with PIPE at the first place of each filter which will be transacted
> with kernel tc.
> >
> > About the tc sw datapath mentioned, we don't have to make changes
> > because gact with PIPE has already been supported in current tc
> > implementation and it could act like a 'counter' And for the hardware
> > we just need to ignore this PIPE and the stats of this action will still be
> updated in kernel side and sent to userspace.
> 
> I know it’s supported now, but if we implement it, it might fail in existing
> environments. So from an OVS userspace perspective, you need to
> implement something like:

I've got your point now, sorry for my misunderstanding previously.
> 
> - Probe the kernel to see if this patch is applied, if not use the old method so
> we do not break existing deployments when upgrading OVS but not the
> kernel.
> - If we do have this newer kernel, do we assume all drivers that worked
> before, now also work?
>   - If this is not the case, how will you determine what approach to use? We
> do not have a per-interface layer, but a per-datapath one, i.e. the kernel. We
> do not know at initialization time what NICs will be added later and we can
> not decide on the strategy to use.
> 
> Thought? Maybe this should be discussed outside of the netdev mailing list,
> but what I want to highlight is that there should be a runtime way to
> determine if this patch is applied to the kernel (without using any actual hw
> driver).

I agree that whether the patch is applied in kernel should be checked at runtime rather than
compiling (for the demo I made this check inacinlude.m4). I think I need some time to investigate
how to implement it. We may discuss it later in an OVS mailing list.

Thanks,
Tianyu
> 
> //Eelco
> 
> > I agree with that the unsupported actions should be rejected by
> > drivers, so may another approach could work without ignoring PIPE in
> > all the related drivers, that we directly make put the flower stats
> > from driver into the socket which is used to transact with userspace and
> userspace(e.g. OVS) update the flow stats using this stats instead of the
> parsing the action stats. How do you think of this?


  reply	other threads:[~2022-12-02 12:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 11:20 [PATCH/RFC net-next] tc: allow drivers to accept gact with PIPE when offloading Simon Horman
2022-11-24 23:45 ` Jamal Hadi Salim
2022-11-25  3:10   ` Tianyu Yuan
2022-11-25 12:31     ` Vlad Buslov
2022-11-25 12:49       ` [PATCH] tc: allow gact pipe action offload Vlad Buslov
2022-11-25 14:19     ` [PATCH/RFC net-next] tc: allow drivers to accept gact with PIPE when offloading Marcelo Leitner
2022-11-25 14:32       ` Eelco Chaudron
2022-11-28  7:18         ` Tianyu Yuan
2022-11-28  9:11           ` Eelco Chaudron
2022-11-28  7:11       ` Tianyu Yuan
2022-11-28 13:11         ` Marcelo Leitner
2022-11-28 13:17           ` Eelco Chaudron
2022-11-28 13:33             ` Marcelo Leitner
2022-11-29 12:35               ` Eelco Chaudron
2022-11-30  3:36                 ` Tianyu Yuan
2022-11-30 18:05                   ` Marcelo Leitner
2022-12-01  3:52                     ` Tianyu Yuan
2022-12-02 12:17                   ` Eelco Chaudron
2022-12-02 12:33                     ` Tianyu Yuan [this message]
2022-12-02 12:39                       ` Eelco Chaudron
2023-01-29  8:16                         ` Tianyu Yuan
2022-11-29  8:43           ` Edward Cree
     [not found]     ` <CAM0EoMnw57gVb+niRzZ-QYefey4TuhFZwnVs3P53_jo60d8Efg@mail.gmail.com>
     [not found]       ` <PH0PR13MB47931C1CBABDD4113275A2A994139@PH0PR13MB4793.namprd13.prod.outlook.com>
2022-11-28 11:35         ` Jamal Hadi Salim
2022-11-29  7:32           ` Tianyu Yuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH0PR13MB4793ED98F9384F2CBBA0909094179@PH0PR13MB4793.namprd13.prod.outlook.com \
    --to=tianyu.yuan@corigine.com \
    --cc=dcaratti@redhat.com \
    --cc=dev@openvswitch.org \
    --cc=echaudro@redhat.com \
    --cc=edward.cree@amd.com \
    --cc=i.maximets@ovn.org \
    --cc=jhs@mojatatu.com \
    --cc=mleitner@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@corigine.com \
    --cc=ozsh@nvidia.com \
    --cc=paulb@nvidia.com \
    --cc=simon.horman@corigine.com \
    --cc=vladbu@nvidia.com \
    --cc=xiyou.wangcong@gmail.com \
    --cc=ziyang.chen@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.