[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+FuTSdsrAAd0iti0oF3MDvXTtQWnBByuo_UMGCW2Dd+WnWeLg@mail.gmail.com>
Date: Wed, 3 Sep 2014 14:54:38 -0400
From: Willem de Bruijn <willemb@...gle.com>
To: Alexander Duyck <alexander.h.duyck@...el.com>
Cc: Network Development <netdev@...r.kernel.org>,
Richard Cochran <richardcochran@...il.com>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH 2/2] net-timestamp: Make the clone operation stand-alone
from phy timestamping
On Wed, Sep 3, 2014 at 11:53 AM, Alexander Duyck
<alexander.h.duyck@...el.com> wrote:
> The phy timestamping takes a different path than the regular timestamping
> does in that it will create a clone first so that the packets needing to be
> timestamped can be placed in a queue, or the context block could be used.
>
> In order to support these use cases I am pulling the core of the code out
> so it can be used in other drivers beyond just phy devices.
Do you already have additional such use cases?
> +struct sk_buff *__skb_clone_tx_timestamp(struct sk_buff *skb)
> +{
> + struct sock *sk = skb->sk;
> + struct sk_buff *clone;
> +
> + if (!sk || !atomic_inc_not_zero(&sk->sk_refcnt))
> + return NULL;
> +
> + clone = skb_clone(skb, GFP_ATOMIC);
> + if (!clone) {
> + sock_put(sk);
> + return NULL;
> + }
> +
> + clone->sk = sk;
> +
> + return clone;
> +}
> +EXPORT_SYMBOL(__skb_clone_tx_timestamp);
> +
Code looks great. Again, this can be verified to be a functional noop.
One minor comment is that this really is not a timestamping function,
but an skb_clone variant. skb_clone_sk?
--
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