lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 26 Apr 2023 22:02:08 -0600
From:   Max Georgiev <glipus@...il.com>
To:     Simon Horman <simon.horman@...igine.com>
Cc:     kory.maincent@...tlin.com, kuba@...nel.org, netdev@...r.kernel.org,
        maxime.chevallier@...tlin.com, vladimir.oltean@....com,
        vadim.fedorenko@...ux.dev, richardcochran@...il.com,
        gerhard@...leder-embedded.com
Subject: Re: [RFC PATCH v4 2/5] Add ifreq pointer field to kernel_hwtstamp_config
 structure

On Wed, Apr 26, 2023 at 1:59 PM Simon Horman <simon.horman@...igine.com> wrote:
>
> On Sat, Apr 22, 2023 at 09:28:17PM -0600, Maxim Georgiev wrote:
> > Considering the stackable nature of drivers there will be situations
> > where a driver implementing ndo_hwtstamp_get/set functions will have
> > to translate requests back to SIOCGHWTSTAMP/SIOCSHWTSTAMP IOCTLs
> > to pass them to lower level drivers that do not provide
> > ndo_hwtstamp_get/set callbacks. To simplify request translation in
> > such scenarios let's include a pointer to the original struct ifreq
> > to kernel_hwtstamp_config structure.
> >
> > Suggested-by: Jakub Kicinski <kuba@...nel.org>
> > Signed-off-by: Maxim Georgiev <glipus@...il.com>
> >
> > Notes:
> >
> >   Changes in V4:
> >   - Introducing KERNEL_HWTSTAMP_FLAG_IFR_RESULT flag indicating that
> >     the operation results are returned in the ifr referred by
> >     struct kernel_hwtstamp_config instead of kernel_hwtstamp_config
> >     glags/tx_type/rx_filter fields.
> >   - Implementing generic_hwtstamp_set/set_lower() functions
> >     which will be used by vlan, maxvlan, bond and potentially
> >     other drivers translating ndo_hwtstamp_set/set calls to
> >     lower level drivers.
> > ---
> >  include/linux/net_tstamp.h |  7 ++++
> >  include/linux/netdevice.h  |  6 +++
> >  net/core/dev_ioctl.c       | 80 +++++++++++++++++++++++++++++++++++---
> >  3 files changed, 87 insertions(+), 6 deletions(-)
> >
> > diff --git a/include/linux/net_tstamp.h b/include/linux/net_tstamp.h
> > index 7c59824f43f5..5164dce3f9a0 100644
> > --- a/include/linux/net_tstamp.h
> > +++ b/include/linux/net_tstamp.h
> > @@ -20,6 +20,13 @@ struct kernel_hwtstamp_config {
> >       int flags;
> >       int tx_type;
> >       int rx_filter;
> > +     struct ifreq *ifr;
> > +     int kernel_flags;
>
> nit: ifr and kernel_flags should be added to the kdoc for this struct
>      that appears immediately above it.
>
> > +};
> > +
> > +/* possible values for kernel_hwtstamp_config->kernel_flags */
> > +enum kernel_hwtstamp_flags {
> > +     KERNEL_HWTSTAMP_FLAG_IFR_RESULT = (1 << 0),
>
> nit: maybe BIT(0)
>
> >  };
> >
> >  static inline void hwtstamp_config_to_kernel(struct kernel_hwtstamp_config *kernel_cfg,
>
> ...

Thank you for the feedback!
I'll update and resend the patch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ