From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>, Jarod Wilson <jarod@redhat.com>
Cc: Tariq Toukan <tariqt@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Saeed Mahameed <saeedm@nvidia.com>,
Moshe Shemesh <moshe@nvidia.com>,
Maor Gottlieb <maorg@nvidia.com>
Subject: Re: [PATCH net-next 0/2] TLS TX HW offload for Bond
Date: Sun, 22 Nov 2020 14:48:04 +0200 [thread overview]
Message-ID: <ee42de0e-e657-4108-3fb7-05e252979673@gmail.com> (raw)
In-Reply-To: <20201119083811.6b68bfa8@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>
On 11/19/2020 6:38 PM, Jakub Kicinski wrote:
> On Thu, 19 Nov 2020 17:59:38 +0200 Tariq Toukan wrote:
>> On 11/19/2020 2:02 AM, Jakub Kicinski wrote:
>>> On Sun, 15 Nov 2020 15:42:49 +0200 Tariq Toukan wrote:
>>>> This series opens TLS TX HW offload for bond interfaces.
>>>> This allows bond interfaces to benefit from capable slave devices.
>>>>
>>>> The first patch adds real_dev field in TLS context structure, and aligns
>>>> usages in TLS module and supporting drivers.
>>>> The second patch opens the offload for bond interfaces.
>>>>
>>>> For the configuration above, SW kTLS keeps picking the same slave
>>>> To keep simple track of the HW and SW TLS contexts, we bind each socket to
>>>> a specific slave for the socket's whole lifetime. This is logically valid
>>>> (and similar to the SW kTLS behavior) in the following bond configuration,
>>>> so we restrict the offload support to it:
>>>>
>>>> ((mode == balance-xor) or (mode == 802.3ad))
>>>> and xmit_hash_policy == layer3+4.
>>>
>>> This does not feel extremely clean, maybe you can convince me otherwise.
>>>
>>> Can we extend netdev_get_xmit_slave() and figure out the output dev
>>> (and if it's "stable") in a more generic way? And just feed that dev
>>> into TLS handling?
>>
>> I don't see we go through netdev_get_xmit_slave(), but through
>> .ndo_start_xmit (bond_start_xmit).
>
> I may be misunderstanding the purpose of netdev_get_xmit_slave(),
> please correct me if I'm wrong. AFAIU it's supposed to return a
> lower netdev that the skb should then be xmited on.
That's true. It was recently added and used by the RDMA team. Not used
or integrated in the Eth networking stack.
> So what I was thinking was either construct an skb or somehow reshuffle
> the netdev_get_xmit_slave() code to take a flow dissector output or
> ${insert other ideas}. Then add a helper in the core that would drill
> down from the socket netdev to the "egress" netdev. Have TLS call
> that helper, and talk to the "egress" netdev from the start, rather
> than the socket's netdev. Then loosen the checks on software devices.
As I understand it, best if we can even generalize this to apply to all
kinds of traffic: bond driver won't do the xmit itself anymore, it just
picks an egress dev and returns it. The core infrastructure will call
the xmit function for the egress dev.
I like the idea, it can generalize code structures for all kinds of
upper-devices and sockets, taking them into a common place in core,
which reduces code duplications.
If we go only half the way, i.e. keep xmit logic in bond for
non-TLS-offloaded traffic, then we have to let TLS module (and others in
the future) act deferentially for different kinds of devs (upper/lower)
which IMHO reduces generality.
I'm in favor of the deeper change. It will be on a larger scale, and
totally orthogonal to the current TLS offload support in bond.
If we decide to apply the idea only to TLS sockets (or any subset of
sockets) we're actually taking a generic one-flow (the xmit patch of a
bond dev) and turning it into two (or potentially more) flows, depending
on the socket type. This also reduces generality.
>
> I'm probably missing the problem you're trying to explain to me :S
>
I kept the patch minimal, and kept the TLS offload logic internal to the
bond driver, just like it is internal to the device drivers (mlx5e, and
others), with no core infrastructure modification.
> Side note - Jarod, I'd be happy to take a patch renaming
> netdev_get_xmit_slave() and the ndo, if you have the cycles to send
> a patch. It's a recent addition, and in the core we should make more
> of an effort to avoid sensitive terms.
>
>> Currently I have my check there to
>> catch all skbs belonging to offloaded TLS sockets.
>>
>> The TLS offload get_slave() logic decision is per socket, so the result
>> cannot be saved in the bond memory. Currently I save the real_dev field
>> in the TLS context structure.
>
> Right, but we could just have ctx->netdev be the "egress" netdev
> always, right? Do we expect somewhere that it's going to be matching
> the socket's dst?
>
So once the offload context is established we totally bypass the bond
dev? and lose interaction or reference to it?
What if the egress dev is detached form the bond? We must then be
notified somehow.
>> One way to make it more generic is to save it on the sock structure. I
>> agree that this replaces the TLS-specific logic, but demands increasing
>> the sock struct, and has larger impact on all other flows...
>
next prev parent reply other threads:[~2020-11-22 12:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-15 13:42 [PATCH net-next 0/2] TLS TX HW offload for Bond Tariq Toukan
2020-11-15 13:42 ` [PATCH net-next 1/2] net/tls: Add real_dev field to TLS context Tariq Toukan
2020-11-15 13:42 ` [PATCH net-next 2/2] bond: Add TLS TX offload support Tariq Toukan
2020-11-19 0:02 ` [PATCH net-next 0/2] TLS TX HW offload for Bond Jakub Kicinski
2020-11-19 15:59 ` Tariq Toukan
2020-11-19 16:38 ` Jakub Kicinski
2020-11-22 12:48 ` Tariq Toukan [this message]
2020-11-23 18:20 ` Jakub Kicinski
2020-11-24 15:08 ` Tariq Toukan
2020-11-30 7:35 ` Boris Pismenny
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=ee42de0e-e657-4108-3fb7-05e252979673@gmail.com \
--to=ttoukan.linux@gmail.com \
--cc=davem@davemloft.net \
--cc=jarod@redhat.com \
--cc=kuba@kernel.org \
--cc=maorg@nvidia.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.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.