From: Simon Horman <simon.horman@corigine.com>
To: Maxim Georgiev <glipus@gmail.com>
Cc: kory.maincent@bootlin.com, kuba@kernel.org,
netdev@vger.kernel.org, maxime.chevallier@bootlin.com,
vladimir.oltean@nxp.com, vadim.fedorenko@linux.dev,
richardcochran@gmail.com, gerhard@engleder-embedded.com
Subject: Re: [RFC PATCH v4 2/5] Add ifreq pointer field to kernel_hwtstamp_config structure
Date: Wed, 26 Apr 2023 21:59:22 +0200 [thread overview]
Message-ID: <ZEmCmirgOnAIByYH@corigine.com> (raw)
In-Reply-To: <20230423032817.285371-1-glipus@gmail.com>
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@kernel.org>
> Signed-off-by: Maxim Georgiev <glipus@gmail.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,
...
next prev parent reply other threads:[~2023-04-26 19:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-23 3:28 [RFC PATCH v4 2/5] Add ifreq pointer field to kernel_hwtstamp_config structure Maxim Georgiev
2023-04-26 19:59 ` Simon Horman [this message]
2023-04-27 4:02 ` Max Georgiev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZEmCmirgOnAIByYH@corigine.com \
--to=simon.horman@corigine.com \
--cc=gerhard@engleder-embedded.com \
--cc=glipus@gmail.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=vadim.fedorenko@linux.dev \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).