net: Introduce peer to peer one step PTP time stamping.
The 1588 standard defines one step operation for both Sync and PDelay_Resp messages. Up until now, hardware with P2P one step has been rare, and kernel support was lacking. This patch adds support of the mode in anticipation of new hardware developments. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: hongrongxuan <hongrongxuan@huawei.com>
This commit is contained in:
parent
c519d55103
commit
7b71c74c53
|
@ -15411,6 +15411,7 @@ int bnx2x_configure_ptp_filters(struct bnx2x *bp)
|
||||||
REG_WR(bp, rule, BNX2X_PTP_TX_ON_RULE_MASK);
|
REG_WR(bp, rule, BNX2X_PTP_TX_ON_RULE_MASK);
|
||||||
break;
|
break;
|
||||||
case HWTSTAMP_TX_ONESTEP_SYNC:
|
case HWTSTAMP_TX_ONESTEP_SYNC:
|
||||||
|
case HWTSTAMP_TX_ONESTEP_P2P:
|
||||||
BNX2X_ERR("One-step timestamping is not supported\n");
|
BNX2X_ERR("One-step timestamping is not supported\n");
|
||||||
return -ERANGE;
|
return -ERANGE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -920,6 +920,7 @@ static int mlxsw_sp_ptp_get_message_types(const struct hwtstamp_config *config,
|
||||||
egr_types = 0xff;
|
egr_types = 0xff;
|
||||||
break;
|
break;
|
||||||
case HWTSTAMP_TX_ONESTEP_SYNC:
|
case HWTSTAMP_TX_ONESTEP_SYNC:
|
||||||
|
case HWTSTAMP_TX_ONESTEP_P2P:
|
||||||
return -ERANGE;
|
return -ERANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1148,6 +1148,9 @@ int lan743x_ptp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
||||||
|
|
||||||
lan743x_ptp_set_sync_ts_insert(adapter, true);
|
lan743x_ptp_set_sync_ts_insert(adapter, true);
|
||||||
break;
|
break;
|
||||||
|
case HWTSTAMP_TX_ONESTEP_P2P:
|
||||||
|
ret = -ERANGE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
netif_warn(adapter, drv, adapter->netdev,
|
netif_warn(adapter, drv, adapter->netdev,
|
||||||
" tx_type = %d, UNKNOWN\n", config.tx_type);
|
" tx_type = %d, UNKNOWN\n", config.tx_type);
|
||||||
|
|
|
@ -247,6 +247,7 @@ static int qede_ptp_cfg_filters(struct qede_dev *edev)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HWTSTAMP_TX_ONESTEP_SYNC:
|
case HWTSTAMP_TX_ONESTEP_SYNC:
|
||||||
|
case HWTSTAMP_TX_ONESTEP_P2P:
|
||||||
DP_ERR(edev, "One-step timestamping is not supported\n");
|
DP_ERR(edev, "One-step timestamping is not supported\n");
|
||||||
return -ERANGE;
|
return -ERANGE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,14 @@ enum hwtstamp_tx_types {
|
||||||
* queue.
|
* queue.
|
||||||
*/
|
*/
|
||||||
HWTSTAMP_TX_ONESTEP_SYNC,
|
HWTSTAMP_TX_ONESTEP_SYNC,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Same as HWTSTAMP_TX_ONESTEP_SYNC, but also enables time
|
||||||
|
* stamp insertion directly into PDelay_Resp packets. In this
|
||||||
|
* case, neither transmitted Sync nor PDelay_Resp packets will
|
||||||
|
* receive a time stamp via the socket error queue.
|
||||||
|
*/
|
||||||
|
HWTSTAMP_TX_ONESTEP_P2P,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* possible values for hwtstamp_config->rx_filter */
|
/* possible values for hwtstamp_config->rx_filter */
|
||||||
|
|
|
@ -176,6 +176,7 @@ static int net_hwtstamp_validate(struct ifreq *ifr)
|
||||||
case HWTSTAMP_TX_OFF:
|
case HWTSTAMP_TX_OFF:
|
||||||
case HWTSTAMP_TX_ON:
|
case HWTSTAMP_TX_ON:
|
||||||
case HWTSTAMP_TX_ONESTEP_SYNC:
|
case HWTSTAMP_TX_ONESTEP_SYNC:
|
||||||
|
case HWTSTAMP_TX_ONESTEP_P2P:
|
||||||
tx_type_valid = 1;
|
tx_type_valid = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue