lkml.org 
[lkml]   [2020]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v5 05/15] net: macsec: hardware offloading infrastructure
On Mon, Jan 13, 2020 at 03:57:58PM +0100, Antoine Tenart wrote:
> On Mon, Jan 13, 2020 at 03:34:52PM +0100, Jiri Pirko wrote:
> > Fri, Jan 10, 2020 at 05:20:00PM CET, antoine.tenart@bootlin.com wrote:
>
> > >+/* Checks if underlying layers implement MACsec offloading functions. */
> > >+static bool macsec_check_offload(enum macsec_offload offload,
> > >+ struct macsec_dev *macsec)
> > >+{
> > >+ if (!macsec || !macsec->real_dev)
> > >+ return false;
> > >+
> > >+ if (offload == MACSEC_OFFLOAD_PHY)
> >
> > You have a helper for this already - macsec_is_offloaded(). No need for
> > "offload" arg then.
>
> Same here, except the _PHY case is different from the _MAC one. So the
> check needs to be specific to _PHY.

Also 'offload' here can be different from the one stored in the macsec
structure.

>
> > >+ return macsec->real_dev->phydev &&
> > >+ macsec->real_dev->phydev->macsec_ops;
> > >+
> > >+ return false;
> > >+}

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

\
 
 \ /
  Last update: 2020-01-13 16:00    [W:0.063 / U:7.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site