netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Ilya Lesokhin <ilyal@mellanox.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"davejwatson@fb.com" <davejwatson@fb.com>,
	"tom@herbertland.com" <tom@herbertland.com>,
	"hannes@stressinduktion.org" <hannes@stressinduktion.org>,
	Boris Pismenny <borisp@mellanox.com>,
	Aviad Yehezkel <aviadye@mellanox.com>,
	Liran Liss <liranl@mellanox.com>,
	Steffen Klassert <steffen.klassert@secunet.com>
Subject: Re: [PATCH v3 net-next 3/6] net: Add SW fallback infrastructure for offloaded sockets
Date: Tue, 19 Dec 2017 13:05:46 -0200	[thread overview]
Message-ID: <20171219150546.GC6122@localhost.localdomain> (raw)
In-Reply-To: <AM4PR0501MB2723B5452037B69253A0459BD40F0@AM4PR0501MB2723.eurprd05.prod.outlook.com>

On Tue, Dec 19, 2017 at 07:51:02AM +0000, Ilya Lesokhin wrote:
> On Monday, December 18, 2017 9:18 PM, Marcelo Ricardo Leitner wrote:
> 
> > > +
> > > +	if (sk && sk_fullsock(sk) && sk->sk_offload_check)
> > 
> > Isn't this going to hurt the fast path, checking for sk fields here?
> > 
> 
> We do add code to the fast path but it seems unavoidable if you want to have SW fallback.
> The XFRM device offload also does that
> http://elixir.free-electrons.com/linux/v4.14.7/source/net/core/dev.c#L3058

Right, although a bit different. It's accessing skb->sp and not the
socket and depending on how compiler is doing things, the check
http://elixir.free-electrons.com/linux/v4.14.7/source/net/xfrm/xfrm_device.c#L32
will help in some cases.

But more importantly, all the above only exists if CONFIG_XFRM_OFFLOAD
is enabled.

> 
> The check can be optimized but I didn't want to do that before I saw that it's an issue.
> I'm also not sure what the correct solution is.
> I don't like that fact that each "stateful protocol" we offload requires its own check. 
> We need to think if we can find a generic way of doing it.
> 
> Perhaps we can hold the expected netdev somewhere in the SKB and only if we don't
> Go out of the expected netdev go to a slow path that does a check for each protocol.

This could be a good switch, yes.

Thanks,
Marcelo

  reply	other threads:[~2017-12-19 15:05 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 11:10 [PATCH v3 net-next 0/6] tls: Add generic NIC offload infrastructure Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 1/6] tcp: Add clean acked data hook Ilya Lesokhin
2017-12-19 19:13   ` Eric Dumazet
2017-12-19 19:21     ` Ilya Lesokhin
2017-12-19 19:28       ` Eric Dumazet
2017-12-19 19:43         ` Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 2/6] net: Rename and export copy_skb_header Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 3/6] net: Add SW fallback infrastructure for offloaded sockets Ilya Lesokhin
2017-12-18 19:18   ` Marcelo Ricardo Leitner
2017-12-19  7:51     ` Ilya Lesokhin
2017-12-19 15:05       ` Marcelo Ricardo Leitner [this message]
2017-12-19 19:12   ` Eric Dumazet
2017-12-19 19:15     ` Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 4/6] net: Add TLS offload netdev ops Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 5/6] net: Add TLS TX offload features Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 6/6] tls: Add generic NIC offload infrastructure Ilya Lesokhin
2017-12-18 19:53   ` Marcelo Ricardo Leitner
2017-12-19  7:31     ` Ilya Lesokhin
2017-12-19 15:11       ` Marcelo Ricardo Leitner
2017-12-19 15:38         ` Ilya Lesokhin
2017-12-19 16:18           ` Marcelo Ricardo Leitner
2017-12-19  7:00   ` kbuild test robot
2017-12-19  7:01   ` kbuild test robot
2017-12-19  8:17   ` [RFC PATCH] tls: tls_sw_fallback() can be static kbuild test robot
2017-12-19  8:17   ` [PATCH v3 net-next 6/6] tls: Add generic NIC offload infrastructure kbuild test robot
2017-12-18 17:10 ` [PATCH v3 net-next 0/6] " Jiri Pirko
2017-12-19 10:30   ` Jiri Pirko
2017-12-20  8:28     ` Boris Pismenny
2017-12-20 10:08       ` Jiri Pirko
2017-12-20 10:15       ` Or Gerlitz
2017-12-20 10:31         ` Or Gerlitz
2017-12-20 16:12       ` David Miller
2017-12-20 16:23         ` Ilya Lesokhin
2017-12-20 16:36           ` David Miller
2017-12-20 19:12             ` Jiri Pirko

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=20171219150546.GC6122@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=aviadye@mellanox.com \
    --cc=borisp@mellanox.com \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=ilyal@mellanox.com \
    --cc=liranl@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=tom@herbertland.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).