From: Leon Romanovsky <leon@kernel.org>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Feng Wang <wangfe@google.com>,
netdev@vger.kernel.org, antony.antony@secunet.com
Subject: Re: [PATCH] xfrm: add SA information to the offloaded packet
Date: Wed, 25 Sep 2024 11:29:35 +0300 [thread overview]
Message-ID: <20240925082935.GC967758@unreal> (raw)
In-Reply-To: <ZvKVuBTkh2dts8Qy@gauss3.secunet.de>
On Tue, Sep 24, 2024 at 12:34:32PM +0200, Steffen Klassert wrote:
> On Wed, Sep 11, 2024 at 01:40:40PM +0300, Leon Romanovsky wrote:
> > On Mon, Sep 09, 2024 at 11:09:05AM +0200, Steffen Klassert wrote:
> > > On Mon, Sep 02, 2024 at 12:44:52PM +0300, Leon Romanovsky wrote:
> > > > On Mon, Sep 02, 2024 at 09:44:24AM +0200, Steffen Klassert wrote:
> > > > > >
> > > > > > Steffen,
> > > > > >
> > > > > > What is your position on this patch?
> > > > > > It is the same patch (logically) as the one that was rejected before?
> > > > > > https://lore.kernel.org/all/ZfpnCIv+8eYd7CpO@gauss3.secunet.de/
> > > > >
> > > > > This is an infrastructure patch to support routing based IPsec
> > > > > with xfrm interfaces. I just did not notice it because it was not
> > > > > mentioned in the commit message of the first patchset. This should have
> > > > > been included into the packet offload API patchset, but I overlooked
> > > > > that xfrm interfaces can't work with packet offload mode. The stack
> > > > > infrastructure should be complete, so that drivers can implement
> > > > > that without the need to fix the stack before.
> > > >
> > > > Core implementation that is not used by any upstream code is rarely
> > > > right thing to do. It is not tested, complicates the code and mostly
> > > > overlooked when patches are reviewed. The better way will be to extend
> > > > the stack when this feature will be actually used and needed.
> > >
> > > This is our tradeoff, an API should be fully designed from the
> > > beginning, everything else is bad design and will likely result
> > > in band aids (as it happens here). The API can be connected to
> > > netdevsim to test it.
> > >
> > > Currently the combination of xfrm interfaces and packet offload
> > > is just broken.
> >
> > I don't think that it is broken.
>
> I don't see anything that prevents you from offloading a SA
> with an xfrm interface ID. The binding to the interface is
> just ignored in that case.
>
> > It is just not implemented. XFRM
> > interfaces are optional field, which is not really popular in the
> > field.
>
> It is very popular, I know of more than a billion devices that
> are using xfrm interfaces.
We see different parts of "the field". In my case it it enterprise/cloud
world, and I can say same sentence as you with "are NOT using ..."
words instead. This is why so important to see google's driver (which is Android)
to understand the real need from this feature.
>
> >
> > > Unfortunalely this patch does not fix it.
> > >
> > > I think we need to do three things:
> > >
> > > - Fix xfrm interfaces + packet offload combination
> > >
> > > - Extend netdevsim to support packet offload
> > >
> > > - Extend the API for xfrm interfaces (and everything
> > > else we forgot).
> >
> > This is the most challenging part. It is not clear what should
> > we extend if customers are not asking for it and they are extremely
> > happy with the current IPsec packet offload state.
>
> We just need to push the information down to the driver,
> and reject the offload if not supported.
Yes and in addition to that it will be beneficial do not add this information
to SKB if it won't be used.
>
> >
> > BTW, I'm aware of one gap, which is not clear how to handle, and
> > it is combination of policy sockets and offload.
>
> Socket policies are a bit special as they are configured by
> the application that uses the socket. I don't think that
> we can even configure offload for a socket policy.
One of the idea is to iterate over all devices and check if they
support offload, if yes, then offload, if not, then fallback
to software for that device. This is just rough idea with many
caveats.
Thanks
next prev parent reply other threads:[~2024-09-25 8:29 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 20:02 [PATCH] xfrm: add SA information to the offloaded packet Feng Wang
2024-08-28 5:32 ` Steffen Klassert
2024-08-28 11:26 ` Leon Romanovsky
2024-08-28 21:25 ` Feng Wang
2024-08-29 10:38 ` Leon Romanovsky
2024-08-29 21:19 ` Feng Wang
2024-08-30 14:30 ` Leon Romanovsky
2024-08-31 0:27 ` Feng Wang
2024-08-31 17:36 ` Leon Romanovsky
2024-08-31 17:39 ` Leon Romanovsky
2024-09-02 7:44 ` Steffen Klassert
2024-09-02 9:44 ` Leon Romanovsky
2024-09-03 18:19 ` Feng Wang
2024-09-03 19:04 ` Leon Romanovsky
2024-09-04 17:41 ` Feng Wang
2024-09-05 7:49 ` Leon Romanovsky
2024-09-05 18:18 ` Feng Wang
2024-09-09 9:09 ` Steffen Klassert
2024-09-09 10:02 ` Steffen Klassert
2024-09-11 10:40 ` Leon Romanovsky
2024-09-11 23:43 ` Feng Wang
2024-09-16 8:10 ` Leon Romanovsky
2024-09-24 10:07 ` Steffen Klassert
2024-09-24 10:34 ` Steffen Klassert
2024-09-24 17:57 ` Feng Wang
2024-09-24 18:10 ` Steffen Klassert
2024-09-25 8:19 ` Leon Romanovsky
2024-09-25 8:29 ` Leon Romanovsky [this message]
2024-09-02 7:47 ` Steffen Klassert
-- strict thread matches above, loose matches on Subject: below --
2024-11-12 19:22 Feng Wang
2024-11-14 10:27 ` Leon Romanovsky
2024-11-18 19:28 ` Feng Wang
2024-11-19 12:51 ` Leon Romanovsky
2024-11-19 19:15 ` Feng Wang
2024-08-12 18:23 Feng Wang
2024-08-19 6:06 ` Steffen Klassert
2024-08-22 20:11 ` Feng Wang
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=20240925082935.GC967758@unreal \
--to=leon@kernel.org \
--cc=antony.antony@secunet.com \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=wangfe@google.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).