netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Or Gerlitz <gerlitz.or@gmail.com>
Cc: John Hurley <john.hurley@netronome.com>,
	Linux Netdev List <netdev@vger.kernel.org>,
	oss-drivers@netronome.com, Jiri Pirko <jiri@resnulli.us>,
	Oz Shlomo <ozsh@mellanox.com>,
	Simon Horman <simon.horman@netronome.com>,
	Aviv Heller <avivh@mellanox.com>
Subject: Re: [RFC net-next v2 1/8] net: sched: register callbacks for indirect tc block binds
Date: Mon, 29 Oct 2018 11:36:53 -0700	[thread overview]
Message-ID: <20181029113653.04fc3d2b@cakuba.netronome.com> (raw)
In-Reply-To: <CAJ3xEMh-7FUnXRJks11cmvwjfrSsYG_O0pGEew-VmefWFJ5R_g@mail.gmail.com>

On Mon, 29 Oct 2018 17:12:27 +0200, Or Gerlitz wrote:
> >> Maybe it would be better to follow the trusted environment model of the kernel
> >> and not protect the core from driver bugs? If the driver does things right they
> >> will unregister before bailing out and if not, they will have to fix..  
> 
> > The owner stuff just makes it easier for a driver to track the blocks
> > it has registered for and, in turn, release these when exiting.
> > We could just leave this up to the driver to ensure it properly cleans
> > up after itself.  
> 
> If it makes the life of the driver easier and doesn't add notable complexity,
> then I think I am good to leave it
> 
> > I don't feel that strongly either way.  
> 
> m2
> 
> So lets see if other comment here, if not, we can just leave it, I guess

To be honest big part of why we retained this mechanism was to keep the
per-driver core structure in existence (struct tcf_indr_block_owner).
In my experience it is way easier to move common functionality into the
core if there is a place where core can track offload-related state.

Growing core structures just for offloads is not super advisable, so
unless there is a separate structure core allocates - all state lands in
the drivers.  This lesson comes from BPF offload, which started off as
mostly stateless from core's perspective where all operations were muxed
via a single NDO, but that became increasingly awkward to use.  We are
gradually moving to a "offload device + ops" form.

I'm not 100% sure the indirect callbacks are a good place for a core
structure, given we didn't seem to need such a thing for normal TC
blocks.  So yes, perhaps we should drop that code.

Hope that explanation makes sense.

  reply	other threads:[~2018-10-30  3:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 12:26 [RFC net-next v2 0/8] indirect tc block cb registration John Hurley
2018-10-25 12:26 ` [RFC net-next v2 1/8] net: sched: register callbacks for indirect tc block binds John Hurley
2018-10-28 11:10   ` Or Gerlitz
2018-10-29 12:54     ` John Hurley
2018-10-29 15:12       ` Or Gerlitz
2018-10-29 18:36         ` Jakub Kicinski [this message]
2018-10-25 12:26 ` [RFC net-next v2 2/8] net: add netif_is_geneve() John Hurley
2018-10-25 12:54   ` Jiri Pirko
2018-10-25 14:59     ` John Hurley
2018-10-26  8:51   ` Sergei Shtylyov
2018-10-29 12:06     ` John Hurley
2018-10-29 15:00       ` Sergei Shtylyov
2018-10-25 12:26 ` [RFC net-next v2 3/8] nfp: flower: include geneve as supported offload tunnel type John Hurley
2018-10-25 12:26 ` [RFC net-next v2 4/8] nfp: flower: allow non repr netdev offload John Hurley
2018-10-25 12:26 ` [RFC net-next v2 5/8] nfp: flower: add infastructure for indirect TC block register John Hurley
2018-10-25 12:26 ` [RFC net-next v2 6/8] nfp: flower: offload tunnel decap rules via indirect TC blocks John Hurley
2018-10-25 12:26 ` [RFC net-next v2 7/8] nfp: flower: remove TC egdev offloads John Hurley
2018-10-25 12:26 ` [RFC net-next v2 8/8] nfp: flower: remove unnecessary code in flow lookup John Hurley
2018-10-25 12:52 ` [RFC net-next v2 0/8] indirect tc block cb registration Jiri Pirko
2018-10-25 14:56   ` John Hurley

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=20181029113653.04fc3d2b@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=avivh@mellanox.com \
    --cc=gerlitz.or@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=john.hurley@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=ozsh@mellanox.com \
    --cc=simon.horman@netronome.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).