@@ -15,7 +15,7 @@ struct idpf_vport_max_q;
1515#include <linux/pci.h>
1616#include <linux/bitfield.h>
1717#include <linux/sctp.h>
18- #include <linux/ethtool .h>
18+ #include <linux/ethtool_netlink .h>
1919#include <net/gro.h>
2020#include <linux/dim.h>
2121
@@ -37,8 +37,6 @@ struct idpf_vport_max_q;
3737#define IDPF_MB_MAX_ERR 20
3838#define IDPF_NUM_CHUNKS_PER_MSG (struct_sz , chunk_sz ) \
3939 ((IDPF_CTLQ_MAX_BUF_LEN - (struct_sz)) / (chunk_sz))
40- #define IDPF_WAIT_FOR_EVENT_TIMEO_MIN 2000
41- #define IDPF_WAIT_FOR_EVENT_TIMEO 60000
4240
4341#define IDPF_MAX_WAIT 500
4442
@@ -66,14 +64,12 @@ struct idpf_mac_filter {
6664
6765/**
6866 * enum idpf_state - State machine to handle bring up
69- * @__IDPF_STARTUP: Start the state machine
7067 * @__IDPF_VER_CHECK: Negotiate virtchnl version
7168 * @__IDPF_GET_CAPS: Negotiate capabilities
7269 * @__IDPF_INIT_SW: Init based on given capabilities
7370 * @__IDPF_STATE_LAST: Must be last, used to determine size
7471 */
7572enum idpf_state {
76- __IDPF_STARTUP ,
7773 __IDPF_VER_CHECK ,
7874 __IDPF_GET_CAPS ,
7975 __IDPF_INIT_SW ,
@@ -87,6 +83,7 @@ enum idpf_state {
8783 * @IDPF_HR_RESET_IN_PROG: Reset in progress
8884 * @IDPF_REMOVE_IN_PROG: Driver remove in progress
8985 * @IDPF_MB_INTR_MODE: Mailbox in interrupt mode
86+ * @IDPF_VC_CORE_INIT: virtchnl core has been init
9087 * @IDPF_FLAGS_NBITS: Must be last
9188 */
9289enum idpf_flags {
@@ -95,6 +92,7 @@ enum idpf_flags {
9592 IDPF_HR_RESET_IN_PROG ,
9693 IDPF_REMOVE_IN_PROG ,
9794 IDPF_MB_INTR_MODE ,
95+ IDPF_VC_CORE_INIT ,
9896 IDPF_FLAGS_NBITS ,
9997};
10098
@@ -209,71 +207,6 @@ struct idpf_dev_ops {
209207 struct idpf_reg_ops reg_ops ;
210208};
211209
212- /* These macros allow us to generate an enum and a matching char * array of
213- * stringified enums that are always in sync. Checkpatch issues a bogus warning
214- * about this being a complex macro; but it's wrong, these are never used as a
215- * statement and instead only used to define the enum and array.
216- */
217- #define IDPF_FOREACH_VPORT_VC_STATE (STATE ) \
218- STATE(IDPF_VC_CREATE_VPORT) \
219- STATE(IDPF_VC_CREATE_VPORT_ERR) \
220- STATE(IDPF_VC_ENA_VPORT) \
221- STATE(IDPF_VC_ENA_VPORT_ERR) \
222- STATE(IDPF_VC_DIS_VPORT) \
223- STATE(IDPF_VC_DIS_VPORT_ERR) \
224- STATE(IDPF_VC_DESTROY_VPORT) \
225- STATE(IDPF_VC_DESTROY_VPORT_ERR) \
226- STATE(IDPF_VC_CONFIG_TXQ) \
227- STATE(IDPF_VC_CONFIG_TXQ_ERR) \
228- STATE(IDPF_VC_CONFIG_RXQ) \
229- STATE(IDPF_VC_CONFIG_RXQ_ERR) \
230- STATE(IDPF_VC_ENA_QUEUES) \
231- STATE(IDPF_VC_ENA_QUEUES_ERR) \
232- STATE(IDPF_VC_DIS_QUEUES) \
233- STATE(IDPF_VC_DIS_QUEUES_ERR) \
234- STATE(IDPF_VC_MAP_IRQ) \
235- STATE(IDPF_VC_MAP_IRQ_ERR) \
236- STATE(IDPF_VC_UNMAP_IRQ) \
237- STATE(IDPF_VC_UNMAP_IRQ_ERR) \
238- STATE(IDPF_VC_ADD_QUEUES) \
239- STATE(IDPF_VC_ADD_QUEUES_ERR) \
240- STATE(IDPF_VC_DEL_QUEUES) \
241- STATE(IDPF_VC_DEL_QUEUES_ERR) \
242- STATE(IDPF_VC_ALLOC_VECTORS) \
243- STATE(IDPF_VC_ALLOC_VECTORS_ERR) \
244- STATE(IDPF_VC_DEALLOC_VECTORS) \
245- STATE(IDPF_VC_DEALLOC_VECTORS_ERR) \
246- STATE(IDPF_VC_SET_SRIOV_VFS) \
247- STATE(IDPF_VC_SET_SRIOV_VFS_ERR) \
248- STATE(IDPF_VC_GET_RSS_LUT) \
249- STATE(IDPF_VC_GET_RSS_LUT_ERR) \
250- STATE(IDPF_VC_SET_RSS_LUT) \
251- STATE(IDPF_VC_SET_RSS_LUT_ERR) \
252- STATE(IDPF_VC_GET_RSS_KEY) \
253- STATE(IDPF_VC_GET_RSS_KEY_ERR) \
254- STATE(IDPF_VC_SET_RSS_KEY) \
255- STATE(IDPF_VC_SET_RSS_KEY_ERR) \
256- STATE(IDPF_VC_GET_STATS) \
257- STATE(IDPF_VC_GET_STATS_ERR) \
258- STATE(IDPF_VC_ADD_MAC_ADDR) \
259- STATE(IDPF_VC_ADD_MAC_ADDR_ERR) \
260- STATE(IDPF_VC_DEL_MAC_ADDR) \
261- STATE(IDPF_VC_DEL_MAC_ADDR_ERR) \
262- STATE(IDPF_VC_GET_PTYPE_INFO) \
263- STATE(IDPF_VC_GET_PTYPE_INFO_ERR) \
264- STATE(IDPF_VC_LOOPBACK_STATE) \
265- STATE(IDPF_VC_LOOPBACK_STATE_ERR) \
266- STATE(IDPF_VC_NBITS)
267-
268- #define IDPF_GEN_ENUM (ENUM ) ENUM,
269- #define IDPF_GEN_STRING (STRING ) #STRING,
270-
271- enum idpf_vport_vc_state {
272- IDPF_FOREACH_VPORT_VC_STATE (IDPF_GEN_ENUM )
273- };
274-
275- extern const char * const idpf_vport_vc_state_str [];
276-
277210/**
278211 * enum idpf_vport_reset_cause - Vport soft reset causes
279212 * @IDPF_SR_Q_CHANGE: Soft reset queue change
@@ -358,11 +291,7 @@ struct idpf_port_stats {
358291 * @port_stats: per port csum, header split, and other offload stats
359292 * @link_up: True if link is up
360293 * @link_speed_mbps: Link speed in mbps
361- * @vc_msg: Virtchnl message buffer
362- * @vc_state: Virtchnl message state
363- * @vchnl_wq: Wait queue for virtchnl messages
364294 * @sw_marker_wq: workqueue for marker packets
365- * @vc_buf_lock: Lock to protect virtchnl buffer
366295 */
367296struct idpf_vport {
368297 u16 num_txq ;
@@ -408,21 +337,18 @@ struct idpf_vport {
408337 bool link_up ;
409338 u32 link_speed_mbps ;
410339
411- char vc_msg [IDPF_CTLQ_MAX_BUF_LEN ];
412- DECLARE_BITMAP (vc_state , IDPF_VC_NBITS );
413-
414- wait_queue_head_t vchnl_wq ;
415340 wait_queue_head_t sw_marker_wq ;
416- struct mutex vc_buf_lock ;
417341};
418342
419343/**
420344 * enum idpf_user_flags
345+ * @__IDPF_USER_FLAG_HSPLIT: header split state
421346 * @__IDPF_PROMISC_UC: Unicast promiscuous mode
422347 * @__IDPF_PROMISC_MC: Multicast promiscuous mode
423348 * @__IDPF_USER_FLAGS_NBITS: Must be last
424349 */
425350enum idpf_user_flags {
351+ __IDPF_USER_FLAG_HSPLIT = 0U ,
426352 __IDPF_PROMISC_UC = 32 ,
427353 __IDPF_PROMISC_MC ,
428354
@@ -474,15 +400,11 @@ struct idpf_vport_user_config_data {
474400 * enum idpf_vport_config_flags - Vport config flags
475401 * @IDPF_VPORT_REG_NETDEV: Register netdev
476402 * @IDPF_VPORT_UP_REQUESTED: Set if interface up is requested on core reset
477- * @IDPF_VPORT_ADD_MAC_REQ: Asynchronous add ether address in flight
478- * @IDPF_VPORT_DEL_MAC_REQ: Asynchronous delete ether address in flight
479403 * @IDPF_VPORT_CONFIG_FLAGS_NBITS: Must be last
480404 */
481405enum idpf_vport_config_flags {
482406 IDPF_VPORT_REG_NETDEV ,
483407 IDPF_VPORT_UP_REQUESTED ,
484- IDPF_VPORT_ADD_MAC_REQ ,
485- IDPF_VPORT_DEL_MAC_REQ ,
486408 IDPF_VPORT_CONFIG_FLAGS_NBITS ,
487409};
488410
@@ -553,11 +475,13 @@ struct idpf_vector_lifo {
553475struct idpf_vport_config {
554476 struct idpf_vport_user_config_data user_config ;
555477 struct idpf_vport_max_q max_q ;
556- void * req_qs_chunks ;
478+ struct virtchnl2_add_queues * req_qs_chunks ;
557479 spinlock_t mac_filter_list_lock ;
558480 DECLARE_BITMAP (flags , IDPF_VPORT_CONFIG_FLAGS_NBITS );
559481};
560482
483+ struct idpf_vc_xn_manager ;
484+
561485/**
562486 * struct idpf_adapter - Device data struct generated on probe
563487 * @pdev: PCI device struct given on probe
@@ -599,9 +523,7 @@ struct idpf_vport_config {
599523 * @stats_task: Periodic statistics retrieval task
600524 * @stats_wq: Workqueue for statistics task
601525 * @caps: Negotiated capabilities with device
602- * @vchnl_wq: Wait queue for virtchnl messages
603- * @vc_state: Virtchnl message state
604- * @vc_msg: Virtchnl message buffer
526+ * @vcxn_mngr: Virtchnl transaction manager
605527 * @dev_ops: See idpf_dev_ops
606528 * @num_vfs: Number of allocated VFs through sysfs. PF does not directly talk
607529 * to VFs but is used to initialize them
@@ -657,10 +579,8 @@ struct idpf_adapter {
657579 struct delayed_work stats_task ;
658580 struct workqueue_struct * stats_wq ;
659581 struct virtchnl2_get_capabilities caps ;
582+ struct idpf_vc_xn_manager * vcxn_mngr ;
660583
661- wait_queue_head_t vchnl_wq ;
662- DECLARE_BITMAP (vc_state , IDPF_VC_NBITS );
663- char vc_msg [IDPF_CTLQ_MAX_BUF_LEN ];
664584 struct idpf_dev_ops dev_ops ;
665585 int num_vfs ;
666586 bool crc_enable ;
@@ -901,68 +821,21 @@ void idpf_mbx_task(struct work_struct *work);
901821void idpf_vc_event_task (struct work_struct * work );
902822void idpf_dev_ops_init (struct idpf_adapter * adapter );
903823void idpf_vf_dev_ops_init (struct idpf_adapter * adapter );
904- int idpf_vport_adjust_qs (struct idpf_vport * vport );
905- int idpf_init_dflt_mbx (struct idpf_adapter * adapter );
906- void idpf_deinit_dflt_mbx (struct idpf_adapter * adapter );
907- int idpf_vc_core_init (struct idpf_adapter * adapter );
908- void idpf_vc_core_deinit (struct idpf_adapter * adapter );
909824int idpf_intr_req (struct idpf_adapter * adapter );
910825void idpf_intr_rel (struct idpf_adapter * adapter );
911- int idpf_get_reg_intr_vecs (struct idpf_vport * vport ,
912- struct idpf_vec_regs * reg_vals );
913826u16 idpf_get_max_tx_hdr_size (struct idpf_adapter * adapter );
914- int idpf_send_delete_queues_msg (struct idpf_vport * vport );
915- int idpf_send_add_queues_msg (const struct idpf_vport * vport , u16 num_tx_q ,
916- u16 num_complq , u16 num_rx_q , u16 num_rx_bufq );
917827int idpf_initiate_soft_reset (struct idpf_vport * vport ,
918828 enum idpf_vport_reset_cause reset_cause );
919- int idpf_send_enable_vport_msg (struct idpf_vport * vport );
920- int idpf_send_disable_vport_msg (struct idpf_vport * vport );
921- int idpf_send_destroy_vport_msg (struct idpf_vport * vport );
922- int idpf_send_get_rx_ptype_msg (struct idpf_vport * vport );
923- int idpf_send_ena_dis_loopback_msg (struct idpf_vport * vport );
924- int idpf_send_get_set_rss_key_msg (struct idpf_vport * vport , bool get );
925- int idpf_send_get_set_rss_lut_msg (struct idpf_vport * vport , bool get );
926- int idpf_send_dealloc_vectors_msg (struct idpf_adapter * adapter );
927- int idpf_send_alloc_vectors_msg (struct idpf_adapter * adapter , u16 num_vectors );
928829void idpf_deinit_task (struct idpf_adapter * adapter );
929830int idpf_req_rel_vector_indexes (struct idpf_adapter * adapter ,
930831 u16 * q_vector_idxs ,
931832 struct idpf_vector_info * vec_info );
932- int idpf_vport_alloc_vec_indexes (struct idpf_vport * vport );
933- int idpf_send_get_stats_msg (struct idpf_vport * vport );
934- int idpf_get_vec_ids (struct idpf_adapter * adapter ,
935- u16 * vecids , int num_vecids ,
936- struct virtchnl2_vector_chunks * chunks );
937- int idpf_recv_mb_msg (struct idpf_adapter * adapter , u32 op ,
938- void * msg , int msg_size );
939- int idpf_send_mb_msg (struct idpf_adapter * adapter , u32 op ,
940- u16 msg_size , u8 * msg );
941833void idpf_set_ethtool_ops (struct net_device * netdev );
942- int idpf_vport_alloc_max_qs (struct idpf_adapter * adapter ,
943- struct idpf_vport_max_q * max_q );
944- void idpf_vport_dealloc_max_qs (struct idpf_adapter * adapter ,
945- struct idpf_vport_max_q * max_q );
946- int idpf_add_del_mac_filters (struct idpf_vport * vport ,
947- struct idpf_netdev_priv * np ,
948- bool add , bool async );
949- int idpf_set_promiscuous (struct idpf_adapter * adapter ,
950- struct idpf_vport_user_config_data * config_data ,
951- u32 vport_id );
952- int idpf_send_disable_queues_msg (struct idpf_vport * vport );
953- void idpf_vport_init (struct idpf_vport * vport , struct idpf_vport_max_q * max_q );
954- u32 idpf_get_vport_id (struct idpf_vport * vport );
955- int idpf_vport_queue_ids_init (struct idpf_vport * vport );
956- int idpf_queue_reg_init (struct idpf_vport * vport );
957- int idpf_send_config_queues_msg (struct idpf_vport * vport );
958- int idpf_send_enable_queues_msg (struct idpf_vport * vport );
959- int idpf_send_create_vport_msg (struct idpf_adapter * adapter ,
960- struct idpf_vport_max_q * max_q );
961- int idpf_check_supported_desc_ids (struct idpf_vport * vport );
962834void idpf_vport_intr_write_itr (struct idpf_q_vector * q_vector ,
963835 u16 itr , bool tx );
964- int idpf_send_map_unmap_queue_vector_msg (struct idpf_vport * vport , bool map );
965- int idpf_send_set_sriov_vfs_msg (struct idpf_adapter * adapter , u16 num_vfs );
966836int idpf_sriov_configure (struct pci_dev * pdev , int num_vfs );
967837
838+ u8 idpf_vport_get_hsplit (const struct idpf_vport * vport );
839+ bool idpf_vport_set_hsplit (const struct idpf_vport * vport , u8 val );
840+
968841#endif /* !_IDPF_H_ */
0 commit comments