[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1349104125.2577.7.camel@bwh-desktop.uk.solarflarecom.com>
Date: Mon, 1 Oct 2012 16:08:45 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Yevgeny Petrilin <yevgenyp@...lanox.com>
CC: <davem@...emloft.net>, <netdev@...r.kernel.org>,
<eugenia@...lanox.co.il>
Subject: Re: [PATCH 3/3] net/mlx4_en: Add HW timestamping (TS) support
On Fri, 2012-09-28 at 12:03 +0200, Yevgeny Petrilin wrote:
> From: Eugenia Emantayev <eugenia@...lanox.co.il>
>
> The patch allows to enable/disable HW timestamping for incoming and/or
> outgoing packets. It adds and initializes all structs and callbacks
> needed by kernel TS API.
> To enable/disable HW timestamping appropriate ioctl should be used.
> Currently HWTSTAMP_FILTER_ALL/NONE and HWTSAMP_TX_ON/OFF only are
> supported.
> When enabling TS on receive flow - VLAN stripping will be disabled.
> Also were made all relevant changes in RX/TX flows to consider TS request
> and plant HW timestamps into relevant structures.
> mlx4_ib was fixed to compile with new mlx4_cq_alloc() signature.
[...]
> --- /dev/null
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_timestamp.c
[...]
> +int mlx4_en_timestamp_config(struct net_device *dev, int tx_type, int rx_filter)
> +{
> + struct mlx4_en_priv *priv = netdev_priv(dev);
> + struct mlx4_en_dev *mdev = priv->mdev;
> + int port_up = 0;
> + int err = 0;
> +
> + mutex_lock(&mdev->state_lock);
> + if (priv->port_up) {
> + port_up = 1;
> + mlx4_en_stop_port(dev);
> + }
> +
> + mlx4_en_free_resources(priv);
> +
> + en_err(priv, "Changing Time Stamp configuration\n");
> +
> + priv->hwtstamp_config.tx_type = tx_type;
> + priv->hwtstamp_config.rx_filter = rx_filter;
> +
> + if (rx_filter != HWTSTAMP_FILTER_NONE)
> + dev->features &= ~NETIF_F_HW_VLAN_RX;
> + else
> + dev->features |= NETIF_F_HW_VLAN_RX;
[...]
If you change dev->features you should also call
netdev_features_change(dev) (holding only the RTNL lock, so after you
unlock mdev->state_lock).
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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