All of lore.kernel.org
 help / color / mirror / Atom feed
From: eran ben elisha <eranlinuxmellanox@gmail.com>
To: Richard Cochran <richardcochran@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>
Cc: Or Gerlitz <ogerlitz@mellanox.com>,
	Eran Ben Elisha <eranbe@mellanox.com>,
	Tal Alon <talal@mellanox.com>,
	Achiad Shochat <achiad@mellanox.com>,
	saeedm@dev.mellanox.co.il, Saeed Mahameed <saeedm@mellanox.com>
Subject: Re: [PATCH net-next V2 3/4] net/mlx5e: Add HW timestamping (TS) support
Date: Thu, 24 Dec 2015 16:02:14 +0200	[thread overview]
Message-ID: <CAKHjkj=qr3vmLQW2jJc-7SECvV9GWM_A1Ydh2JxR8wEZm1=xeA@mail.gmail.com> (raw)
In-Reply-To: <1450647991-13736-4-git-send-email-saeedm@mellanox.com>

> +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;
> +}
> +

  parent reply	other threads:[~2015-12-24 14:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-20 21:46 [PATCH net-next V2 0/4] Introduce mlx5 ethernet timestamping Saeed Mahameed
2015-12-20 21:46 ` [PATCH net-next V2 1/4] net/mlx5e: Do not modify the TX SKB Saeed Mahameed
2015-12-21  5:05   ` Or Gerlitz
2015-12-20 21:46 ` [PATCH net-next V2 2/4] net/mlx5_core: Add support for reading hardware timestamp Saeed Mahameed
2015-12-20 21:46 ` [PATCH net-next V2 3/4] net/mlx5e: Add HW timestamping (TS) support Saeed Mahameed
2015-12-21  9:15   ` Richard Cochran
2015-12-21 14:35     ` Saeed Mahameed
2015-12-21 18:35       ` Richard Cochran
2015-12-22  9:56         ` Saeed Mahameed
2015-12-22 10:00     ` Saeed Mahameed
2015-12-22 17:01       ` Richard Cochran
2015-12-24 14:02   ` eran ben elisha [this message]
2015-12-20 21:46 ` [PATCH net-next V2 4/4] net/mlx5e: Add PTP Hardware Clock (PHC) support Saeed Mahameed
2015-12-21  9:16   ` Richard Cochran

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='CAKHjkj=qr3vmLQW2jJc-7SECvV9GWM_A1Ydh2JxR8wEZm1=xeA@mail.gmail.com' \
    --to=eranlinuxmellanox@gmail.com \
    --cc=achiad@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=eranbe@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=richardcochran@gmail.com \
    --cc=saeedm@dev.mellanox.co.il \
    --cc=saeedm@mellanox.com \
    --cc=talal@mellanox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.