From: Paul Greenwalt <[email protected]> Virtual Function (VF) Earliest TxTime First (ETF) hardware offload support is available on E830 hardware.
Changes made to support VF ETF: - VIRTCHNL_MAX_TXTIME_FETCH_TX_DESC accounts for the additional timestamp descriptors required when wrapping around the timestamp ring. This addresses a known hardware requirement when wrapping around the timestamp ring that can produce a malicious driver detection event. - struct virtchnl_txq_info and struct virtchnl_vsi_queue_config_info have been updated to use a deprecated union for the ETF TxTime stamp. Signed-off-by: Paul Greenwalt <[email protected]> Signed-off-by: Soumyadeep Hore <[email protected]> --- drivers/net/intel/iavf/base/virtchnl.h | 30 +++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/net/intel/iavf/base/virtchnl.h b/drivers/net/intel/iavf/base/virtchnl.h index c0d52ddd32..513e4b5d52 100644 --- a/drivers/net/intel/iavf/base/virtchnl.h +++ b/drivers/net/intel/iavf/base/virtchnl.h @@ -531,13 +531,36 @@ struct virtchnl_txq_info { u16 vsi_id; u16 queue_id; u16 ring_len; /* number of descriptors, multiple of 8 */ - u16 headwb_enabled; /* deprecated with AVF 1.0 */ + union { + u16 headwb_enabled; /* deprecated with AVF 1.0 */ + u16 flags; /* see virtchnl_txq_info_flags */ + }; u64 dma_ring_addr; - u64 dma_headwb_addr; /* deprecated with AVF 1.0 */ + union { + u64 dma_headwb_addr; /* deprecated with AVF 1.0 */ + u64 dma_txtime_addr; /* address of the txtime buffer */ + }; }; VIRTCHNL_CHECK_STRUCT_LEN(24, virtchnl_txq_info); +/* virtchnl_txq_info_flags - definition of bits in the flags field of the + * virtchnl_txq_info structure. + * + * @VIRTCHNL_TXQ_FLAG_TXTIME_ENABLED: request to enable TXTIME offload + * + * Other flag bits are currently reserved and they may be extended in the + * future. + */ +enum virtchnl_txq_info_flags { + VIRTCHNL_TXQ_FLAG_TXTIME_ENABLED = BIT(0), +}; + +/* Additional timestamp descriptors are required when wrapping around the + * timestamp ring, to avoid a malicious driver detection (MDD) event. + */ +#define VIRTCHNL_MAX_TXTIME_FETCH_TX_DESC 16 + /* RX descriptor IDs (range from 0 to 63) */ enum virtchnl_rx_desc_ids { VIRTCHNL_RXDID_0_16B_BASE = 0, @@ -658,7 +681,8 @@ VIRTCHNL_CHECK_STRUCT_LEN(64, virtchnl_queue_pair_info); struct virtchnl_vsi_queue_config_info { u16 vsi_id; u16 num_queue_pairs; - u32 pad; + u16 txtime_txqs; /* bitmap of TX queues with txtime enabled */ + u16 pad; struct virtchnl_queue_pair_info qpair[1]; }; -- 2.43.0

