4141#include "iavf_txrx.h"
4242#include "iavf_fdir.h"
4343#include "iavf_adv_rss.h"
44+ #include "iavf_types.h"
4445#include <linux/bitmap.h>
4546
4647#define DEFAULT_DEBUG_LEVEL_SHIFT 3
@@ -82,7 +83,7 @@ struct iavf_vsi {
8283
8384#define MAXIMUM_ETHERNET_VLAN_SIZE (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
8485
85- #define IAVF_RX_DESC (R , i ) (&(((union iavf_32byte_rx_desc *)((R)->desc))[i]))
86+ #define IAVF_RX_DESC (R , i ) (&(((struct iavf_rx_desc *)((R)->desc))[i]))
8687#define IAVF_TX_DESC (R , i ) (&(((struct iavf_tx_desc *)((R)->desc))[i]))
8788#define IAVF_TX_CTXTDESC (R , i ) \
8889 (&(((struct iavf_tx_context_desc *)((R)->desc))[i]))
@@ -271,6 +272,7 @@ struct iavf_adapter {
271272 /* Lock to protect accesses to MAC and VLAN lists */
272273 spinlock_t mac_vlan_list_lock ;
273274 char misc_vector_name [IFNAMSIZ + 9 ];
275+ u8 rxdid ;
274276 int num_active_queues ;
275277 int num_req_queues ;
276278
@@ -343,6 +345,17 @@ struct iavf_adapter {
343345#define IAVF_FLAG_AQ_CONFIGURE_QUEUES_BW BIT_ULL(39)
344346#define IAVF_FLAG_AQ_CFG_QUEUES_QUANTA_SIZE BIT_ULL(40)
345347#define IAVF_FLAG_AQ_GET_QOS_CAPS BIT_ULL(41)
348+ #define IAVF_FLAG_AQ_GET_SUPPORTED_RXDIDS BIT_ULL(42)
349+ #define IAVF_FLAG_AQ_GET_PTP_CAPS BIT_ULL(43)
350+ #define IAVF_FLAG_AQ_SEND_PTP_CMD BIT_ULL(44)
351+
352+ /* AQ messages that must be sent after IAVF_FLAG_AQ_GET_CONFIG, in
353+ * order to negotiated extended capabilities.
354+ */
355+ #define IAVF_FLAG_AQ_EXTENDED_CAPS \
356+ (IAVF_FLAG_AQ_GET_OFFLOAD_VLAN_V2_CAPS | \
357+ IAVF_FLAG_AQ_GET_SUPPORTED_RXDIDS | \
358+ IAVF_FLAG_AQ_GET_PTP_CAPS)
346359
347360 /* flags for processing extended capability messages during
348361 * __IAVF_INIT_EXTENDED_CAPS. Each capability exchange requires
@@ -354,10 +367,18 @@ struct iavf_adapter {
354367 u64 extended_caps ;
355368#define IAVF_EXTENDED_CAP_SEND_VLAN_V2 BIT_ULL(0)
356369#define IAVF_EXTENDED_CAP_RECV_VLAN_V2 BIT_ULL(1)
370+ #define IAVF_EXTENDED_CAP_SEND_RXDID BIT_ULL(2)
371+ #define IAVF_EXTENDED_CAP_RECV_RXDID BIT_ULL(3)
372+ #define IAVF_EXTENDED_CAP_SEND_PTP BIT_ULL(4)
373+ #define IAVF_EXTENDED_CAP_RECV_PTP BIT_ULL(5)
357374
358375#define IAVF_EXTENDED_CAPS \
359376 (IAVF_EXTENDED_CAP_SEND_VLAN_V2 | \
360- IAVF_EXTENDED_CAP_RECV_VLAN_V2)
377+ IAVF_EXTENDED_CAP_RECV_VLAN_V2 | \
378+ IAVF_EXTENDED_CAP_SEND_RXDID | \
379+ IAVF_EXTENDED_CAP_RECV_RXDID | \
380+ IAVF_EXTENDED_CAP_SEND_PTP | \
381+ IAVF_EXTENDED_CAP_RECV_PTP)
361382
362383 /* Lock to prevent possible clobbering of
363384 * current_netdev_promisc_flags
@@ -417,12 +438,18 @@ struct iavf_adapter {
417438 VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF)
418439#define QOS_ALLOWED (_a ) ((_a)->vf_res->vf_cap_flags & \
419440 VIRTCHNL_VF_OFFLOAD_QOS)
441+ #define IAVF_RXDID_ALLOWED (a ) \
442+ ((a)->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC)
443+ #define IAVF_PTP_ALLOWED (a ) \
444+ ((a)->vf_res->vf_cap_flags & VIRTCHNL_VF_CAP_PTP)
420445 struct virtchnl_vf_resource * vf_res ; /* incl. all VSIs */
421446 struct virtchnl_vsi_resource * vsi_res ; /* our LAN VSI */
422447 struct virtchnl_version_info pf_version ;
423448#define PF_IS_V11 (_a ) (((_a)->pf_version.major == 1) && \
424449 ((_a)->pf_version.minor == 1))
425450 struct virtchnl_vlan_caps vlan_v2_caps ;
451+ u64 supp_rxdids ;
452+ struct iavf_ptp ptp ;
426453 u16 msg_enable ;
427454 struct iavf_eth_stats current_stats ;
428455 struct virtchnl_qos_cap_list * qos_caps ;
@@ -555,6 +582,10 @@ int iavf_send_vf_config_msg(struct iavf_adapter *adapter);
555582int iavf_get_vf_config (struct iavf_adapter * adapter );
556583int iavf_get_vf_vlan_v2_caps (struct iavf_adapter * adapter );
557584int iavf_send_vf_offload_vlan_v2_msg (struct iavf_adapter * adapter );
585+ int iavf_send_vf_supported_rxdids_msg (struct iavf_adapter * adapter );
586+ int iavf_get_vf_supported_rxdids (struct iavf_adapter * adapter );
587+ int iavf_send_vf_ptp_caps_msg (struct iavf_adapter * adapter );
588+ int iavf_get_vf_ptp_caps (struct iavf_adapter * adapter );
558589void iavf_set_queue_vlan_tag_loc (struct iavf_adapter * adapter );
559590u16 iavf_get_num_vlans_added (struct iavf_adapter * adapter );
560591void iavf_irq_enable (struct iavf_adapter * adapter , bool flush );
0 commit comments