Subject: Re: [PATCH 1/2] xfrm: add SA information to the offloaded packet

From: Antony Antony <[email-masked]>
Date: Wed, 6 Nov 2024 14:41:11 +0100

> On Tue, Nov 05, 2024 at 03:41:15PM -0800, Feng Wang wrote:
> > Hi Leon,
> > I checked the current tree and there are no drivers who support packet
> > offload. Even for the mlx5 driver, it only supports crypto offload
> > mode. 
> 
> I don't know what to add here. We already had this discussion for more
> than once.
> https://lore.kernel.org/all/[email-masked]/
> Let's me cite Steffen:
> 
> "There are 'packet offload drivers' in the kernel, that's why we
> support this kind of offload."
> 
> > If I miss anything, please let me know.
> > Since the driver only requires the Security Association (SA) to
> > perform the necessary transformations,  policy information is not
> > needed. Storing policy information, matching the policy and checking
> > the if_id within the driver wouldn't provide much benefit. 
> 
> You need to make sure that policy and SA has match in their selectors,
> and IMHO you can't add support to SA without adding same support to
> policy.

when a packet enters an XFRMi,  xfrm_lookup_with_ifid() is called? 
What does that call return, incase of packet offload? 

My guess is that call is returning NULL and that is why Feng is trying hard code
state here? 

I imagine the policy may not match because that policy has
offload packet?  May be this look up need to handle packet offload?

> 
> > It would increase CPU and memory usage without a clear advantage.
> > For all other suggestions, I totally agree with you.
> > 
> > Thanks,
> > Feng