Re: [PATCH net-next v2 4/9] net: introduce MACsec ops and add a reference in net_device

From: Antoine Tenart
Date: Mon Aug 12 2019 - 04:18:44 EST


Hi Jakub,

On Fri, Aug 09, 2019 at 01:35:09PM -0700, Jakub Kicinski wrote:
> On Thu, 8 Aug 2019 16:05:55 +0200, Antoine Tenart wrote:
> >
> > +#if defined(CONFIG_MACSEC)
> > +struct macsec_ops {
>
> I think it'd be cleaner to have macsec_ops declared in macsec.h
> and forward declare macsec_ops rather than macsec_context.

That makes sense, I'll move this declaration in macsec.h

> > + /* Device wide */
> > + int (*mdo_dev_open)(struct macsec_context *ctx);
> > + int (*mdo_dev_stop)(struct macsec_context *ctx);
> > + /* SecY */
> > + int (*mdo_add_secy)(struct macsec_context *ctx);
> > + int (*mdo_upd_secy)(struct macsec_context *ctx);
> > + int (*mdo_del_secy)(struct macsec_context *ctx);
> > + /* Security channels */
> > + int (*mdo_add_rxsc)(struct macsec_context *ctx);
> > + int (*mdo_upd_rxsc)(struct macsec_context *ctx);
> > + int (*mdo_del_rxsc)(struct macsec_context *ctx);
> > + /* Security associations */
> > + int (*mdo_add_rxsa)(struct macsec_context *ctx);
> > + int (*mdo_upd_rxsa)(struct macsec_context *ctx);
> > + int (*mdo_del_rxsa)(struct macsec_context *ctx);
> > + int (*mdo_add_txsa)(struct macsec_context *ctx);
> > + int (*mdo_upd_txsa)(struct macsec_context *ctx);
> > + int (*mdo_del_txsa)(struct macsec_context *ctx);
> > +};
> > +#endif

Thanks!
Antoine

--
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com