Subject: Re: [PATCH net-next v3 3/3] nfp: implement xfrm callbacks and expose ipsec offload feature to upper layer

From: Leon Romanovsky <[email-masked]>
Date: Wed, 9 Nov 2022 14:24:24 +0200

On Wed, Nov 09, 2022 at 12:09:17PM +0000, Yinjun Zhang wrote:
> On Wed, 9 Nov 2022 10:26:14 +0200, Leon Romanovsky wrote:
> > On Wed, Nov 09, 2022 at 06:58:44AM +0000, Yinjun Zhang wrote:
> > > On Mon, 7 Nov 2022 08:14:12 +0200, Leon Romanovsky wrote:
> > > > On Tue, Nov 01, 2022 at 12:02:48PM +0100, Simon Horman wrote:
> > > <...>
> > > > > +
> > > > > +	/* General */
> > > > > +	switch (x->props.mode) {
> > > > > +	case XFRM_MODE_TUNNEL:
> > > > > +		cfg->ctrl_word.mode = NFP_IPSEC_PROTMODE_TUNNEL;
> > > > > +		break;
> > > > > +	case XFRM_MODE_TRANSPORT:
> > > > > +		cfg->ctrl_word.mode = NFP_IPSEC_PROTMODE_TRANSPORT;
> > > > > +		break;
> > > > > +	default:
> > > > > +		nn_err(nn, "Unsupported mode for xfrm offload\n");
> > > >
> > > > There are no other modes.
> > >
> > > Sorry this comment was neglected, but I have to say this is a good practice to avoid
> > > newly introduced mode in future sneaking into HW while it's not supported.
> > 
> > There is a subtitle difference between not-existent flows and
> > not-supported ones. Good practice is to rely on upper level API to do
> > the right thing from the beginning.
> 
> I don't see any restriction in upper level API that other modes cannot be offloaded,
> would you please double check it?

Fair enough, let's keep it as is for now.

I'll fix XFRM in parallel to your submission.

Thanks

> > Thanks