From: Richard Cochran <richardcochran@gmail.com>
To: Saeed Mahameed <saeedm@mellanox.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Or Gerlitz <ogerlitz@mellanox.com>,
Eran Ben Elisha <eranbe@mellanox.com>,
Tal Alon <talal@mellanox.com>
Subject: Re: [PATCH net-next V1 3/4] net/mlx5e: Add HW timestamping (TS) support
Date: Thu, 17 Dec 2015 21:18:32 +0100 [thread overview]
Message-ID: <20151217201832.GB5975@localhost.localdomain> (raw)
In-Reply-To: <1450355735-30846-4-git-send-email-saeedm@mellanox.com>
On Thu, Dec 17, 2015 at 02:35:34PM +0200, Saeed Mahameed wrote:
> +static int mlx5e_get_ts_info(struct net_device *dev,
> + struct ethtool_ts_info *info)
> +{
> + struct mlx5e_priv *priv = netdev_priv(dev);
> + int ret;
> +
> + ret = ethtool_op_get_ts_info(dev, info);
> + if (ret)
> + return ret;
> +
> + if (MLX5_CAP_GEN(priv->mdev, device_frequency_khz)) {
> + info->so_timestamping |=
> + SOF_TIMESTAMPING_TX_HARDWARE |
> + SOF_TIMESTAMPING_RX_HARDWARE |
> + SOF_TIMESTAMPING_RAW_HARDWARE;
> +
> + info->tx_types =
> + (1 << HWTSTAMP_TX_OFF) |
> + (1 << HWTSTAMP_TX_ON);
> +
> + info->rx_filters =
> + (1 << HWTSTAMP_FILTER_NONE) |
> + (1 << HWTSTAMP_FILTER_ALL);
> + }
Here you need:
info->phc_index = -1;
and then in the next patch, use the PHC index when available.
> + return 0;
> +}
> +
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> index 7c8c408..4ae70cd 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> @@ -36,6 +36,10 @@
> #include <net/busy_poll.h>
> #include "en.h"
>
> +#define MLX5E_RX_HW_STAMP(priv) \
> + (priv->tstamp.hwtstamp_config.rx_filter == \
> + HWTSTAMP_FILTER_ALL)
Use an inline function, please. Also, that line fits in 80 columns
easily.
> + if (MLX5E_RX_HW_STAMP(priv))
> + mlx5e_fill_hwstamp(&priv->tstamp, skb_hwtstamps(skb),
> + get_cqe_ts(cqe));
> +
> +#define MLX5E_TX_HW_STAMP(priv, skb) \
> + (priv->tstamp.hwtstamp_config.tx_type == HWTSTAMP_TX_ON && \
> + skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
Use inline function.
Thanks,
Richard
next prev parent reply other threads:[~2015-12-17 20:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 12:35 [PATCH net-next V1 0/4] Introduce mlx5 ethernet timestamping Saeed Mahameed
2015-12-17 12:35 ` [PATCH net-next V1 1/4] net/mlx5e: Restore the skb data pointer after xmit is finished Saeed Mahameed
2015-12-17 20:21 ` David Miller
2015-12-20 13:02 ` Saeed Mahameed
2015-12-17 12:35 ` [PATCH net-next V1 2/4] net/mlx5_core: Add support for reading hardware timestamp Saeed Mahameed
2015-12-17 12:35 ` [PATCH net-next V1 3/4] net/mlx5e: Add HW timestamping (TS) support Saeed Mahameed
2015-12-17 20:11 ` Richard Cochran
2015-12-20 13:08 ` Saeed Mahameed
2015-12-20 19:18 ` Richard Cochran
2015-12-17 20:18 ` Richard Cochran [this message]
2015-12-17 12:35 ` [PATCH net-next V1 4/4] net/mlx5e: Add PTP Hardware Clock (PHC) support Saeed Mahameed
2015-12-17 20:20 ` Richard Cochran
2015-12-20 13:02 ` Saeed Mahameed
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=20151217201832.GB5975@localhost.localdomain \
--to=richardcochran@gmail.com \
--cc=davem@davemloft.net \
--cc=eranbe@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--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 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).