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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110610082056.5ab6b981@nehalam.ftrdhcpuser.net>
Date:	Fri, 10 Jun 2011 08:20:56 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Richard Cochran <richardcochran@...il.com>
Cc:	<netdev@...r.kernel.org>, David Miller <davem@...emloft.net>
Subject: Re: [PATCH 01/10] net: introduce time stamping wrapper for
 netif_rx.

On Fri, 10 Jun 2011 17:06:59 +0200
Richard Cochran <richardcochran@...il.com> wrote:

> This commit adds a variation on netif_rx() designed to allow non-NAPI
> Ethernet MAC drivers to support hardware time stamping in PHY devices.
> Adapting a given driver requires two small changes, namely replacing
> netif_rx() with netif_rx_defer() and adding a call to skb_tx_timestamp()
> in the transmission path.
> 
> Signed-off-by: Richard Cochran <richard.cochran@...cron.at>
> ---
>  include/linux/netdevice.h |   21 +++++++++++++++++++++
>  1 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index ca333e7..9a56505 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -2066,6 +2066,27 @@ extern void dev_kfree_skb_any(struct sk_buff *skb);
>  #define HAVE_NETIF_RX 1
>  extern int		netif_rx(struct sk_buff *skb);
>  extern int		netif_rx_ni(struct sk_buff *skb);
> +
> +/**
> + * netif_rx_defer() - post buffer to the network code
> + * @skb: buffer to post
> + *
> + * This function receives a packet from a device driver and queues it
> + * for the upper (protocol) levels to process.  All non-NAPI Ethernet
> + * MAC drivers should use this instead of netif_rx() since this method
> + * allows hardware timestamping to occur within the PHY.
> + *
> + * return values:
> + * NET_RX_SUCCESS  (no congestion)
> + * NET_RX_DROP     (packet was dropped)
> + */
> +static inline int netif_rx_defer(struct sk_buff *skb)
> +{
> +	if (skb_defer_rx_timestamp(skb))
> +		return NET_RX_SUCCESS;
> +	return netif_rx(skb);
> +}

Obvious question why not just put this in netif_rx.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ