11/10/2021 18:58, Akhil Goyal:
> > 08/10/2021 22:45, Akhil Goyal:
> > > In struct rte_security_ipsec_sa_options, for every new option
> > > added, there is an ABI breakage, to avoid, a reserved_opts
> > > bitfield is added to for the remaining bits available in the
> > > structure.
> > > Now for every new sa option, these reserved_opts can be reduced
> > > and new option can be added.
> > 
> > How do you make sure this field is initialized to 0?
> > 
> Struct rte_security_ipsec_xform Is part of rte_security_capability as well
> As a configuration structure in session create.
> User, should ensure that if a device support that option(in capability), then
> only these options will take into effect or else it will be don't care for 
> the PMD.
> The initial values of capabilities are set by PMD statically based on the 
> features
> that it support.
> So if someone sets a bit in reserved_opts, it will work only if PMD support it
> And sets the corresponding field in capabilities.
> But yes, if a new field is added in future, and user sets the reserved_opts 
> by mistake
> And the PMD supports that feature as well, then that feature will be enabled.
> This may or may not create issue depending on the feature which is enabled.
> 
> Should I add a note in the comments to clarify that reserved_opts should be 
> set as 0
> And future releases may change this without notice(But reserved in itself 
> suggest that)?
> Adding an explicit check in session_create does not make sense to me.
> What do you suggest?

Yes at the minimum you should add a comment.
You could also initialize it in the lib, but it is not always possible.


Reply via email to