aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Habets <mhabets@solarflare.com>2018-01-25 12:26:31 -0500
committerDavid S. Miller <davem@davemloft.net>2018-01-25 16:05:14 -0500
commit6aa47c87cb053670bb636fb2001deb4a868f9486 (patch)
treea6b7bac11b202e278b03e88084c3f3d929f115c3
parent2935e3c38228ad9bf073eeb0eedff5849eea63db (diff)
sfc: only advertise TX timestamping if we have the license for it
We check the license for TX hardware timestamping capability. The PTP probe will have enabled PTP sync events from the adapter. If later, at TX queue init, it turns out we do not have the license, we don't need the sync events either. Signed-off-by: Martin Habets <mhabets@solarflare.com> Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/sfc/ef10.c6
-rw-r--r--drivers/net/ethernet/sfc/ptp.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index b460e06880e6..75fbf58e421c 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -2433,8 +2433,12 @@ static void efx_ef10_tx_init(struct efx_tx_queue *tx_queue)
2433 * otherwise TXQ init will fail 2433 * otherwise TXQ init will fail
2434 */ 2434 */
2435 if (!(nic_data->licensed_features & 2435 if (!(nic_data->licensed_features &
2436 (1 << LICENSED_V3_FEATURES_TX_TIMESTAMPS_LBN))) 2436 (1 << LICENSED_V3_FEATURES_TX_TIMESTAMPS_LBN))) {
2437 tx_queue->timestamping = false; 2437 tx_queue->timestamping = false;
2438 /* Disable sync events on this channel. */
2439 if (efx->type->ptp_set_ts_sync_events)
2440 efx->type->ptp_set_ts_sync_events(efx, false, false);
2441 }
2438 2442
2439 /* TSOv2 is a limited resource that can only be configured on a limited 2443 /* TSOv2 is a limited resource that can only be configured on a limited
2440 * number of queues. TSO without checksum offload is not really a thing, 2444 * number of queues. TSO without checksum offload is not really a thing,
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 87a72f37141b..cbfc171d90ee 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1657,6 +1657,17 @@ void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info)
1657 ts_info->so_timestamping |= (SOF_TIMESTAMPING_TX_HARDWARE | 1657 ts_info->so_timestamping |= (SOF_TIMESTAMPING_TX_HARDWARE |
1658 SOF_TIMESTAMPING_RX_HARDWARE | 1658 SOF_TIMESTAMPING_RX_HARDWARE |
1659 SOF_TIMESTAMPING_RAW_HARDWARE); 1659 SOF_TIMESTAMPING_RAW_HARDWARE);
1660 /* Check licensed features. If we don't have the license for TX
1661 * timestamps, the NIC will not support them.
1662 */
1663 if (efx_ptp_use_mac_tx_timestamps(efx)) {
1664 struct efx_ef10_nic_data *nic_data = efx->nic_data;
1665
1666 if (!(nic_data->licensed_features &
1667 (1 << LICENSED_V3_FEATURES_TX_TIMESTAMPS_LBN)))
1668 ts_info->so_timestamping &=
1669 ~SOF_TIMESTAMPING_TX_HARDWARE;
1670 }
1660 if (primary && primary->ptp_data && primary->ptp_data->phc_clock) 1671 if (primary && primary->ptp_data && primary->ptp_data->phc_clock)
1661 ts_info->phc_index = 1672 ts_info->phc_index =
1662 ptp_clock_index(primary->ptp_data->phc_clock); 1673 ptp_clock_index(primary->ptp_data->phc_clock);