[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKHjkj=qr3vmLQW2jJc-7SECvV9GWM_A1Ydh2JxR8wEZm1=xeA@mail.gmail.com>
Date: Thu, 24 Dec 2015 16:02:14 +0200
From: eran ben elisha <eranlinuxmellanox@...il.com>
To: Richard Cochran <richardcochran@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Linux Netdev List <netdev@...r.kernel.org>
Cc: Or Gerlitz <ogerlitz@...lanox.com>,
Eran Ben Elisha <eranbe@...lanox.com>,
Tal Alon <talal@...lanox.com>,
Achiad Shochat <achiad@...lanox.com>,
saeedm@....mellanox.co.il, Saeed Mahameed <saeedm@...lanox.com>
Subject: Re: [PATCH net-next V2 3/4] net/mlx5e: Add HW timestamping (TS) support
> +void mlx5e_fill_hwstamp(struct mlx5e_tstamp *tstamp,
> + struct skb_shared_hwtstamps *hwts,
> + u64 timestamp)
> +{
> + unsigned long flags;
> + u64 nsec;
> +
> + memset(hwts, 0, sizeof(struct skb_shared_hwtstamps));
> + read_lock_irqsave(&tstamp->lock, flags);
Richard and others,
Any special reason to use read_lock_irqsave and not just read_lock?
On second thought could not see any good reason for that,
but saw many other examples which uses irqsave.
thanks,
Eran
> + nsec = timecounter_cyc2time(&tstamp->clock, timestamp);
> + read_unlock_irqrestore(&tstamp->lock, flags);
> +
> + hwts->hwtstamp = ns_to_ktime(nsec);
> +}
> +
> +static cycle_t mlx5e_read_clock(const struct cyclecounter *cc)
> +{
> + struct mlx5e_tstamp *tstamp = container_of(cc, struct mlx5e_tstamp,
> + cycles);
> + struct mlx5e_priv *priv = container_of(tstamp, struct mlx5e_priv,
> + tstamp);
> +
> + return mlx5_core_read_clock(priv->mdev) & cc->mask;
> +}
> +
--
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