@@ -227,6 +227,7 @@ enum mlx5e_priv_flag {
227
227
MLX5E_PFLAG_RX_NO_CSUM_COMPLETE ,
228
228
MLX5E_PFLAG_XDP_TX_MPWQE ,
229
229
MLX5E_PFLAG_SKB_TX_MPWQE ,
230
+ MLX5E_PFLAG_TX_PORT_TS ,
230
231
MLX5E_NUM_PFLAGS , /* Keep last */
231
232
};
232
233
@@ -282,10 +283,12 @@ struct mlx5e_cq {
282
283
u16 event_ctr ;
283
284
struct napi_struct * napi ;
284
285
struct mlx5_core_cq mcq ;
285
- struct mlx5e_channel * channel ;
286
+ struct mlx5e_ch_stats * ch_stats ;
286
287
287
288
/* control */
289
+ struct net_device * netdev ;
288
290
struct mlx5_core_dev * mdev ;
291
+ struct mlx5e_priv * priv ;
289
292
struct mlx5_wq_ctrl wq_ctrl ;
290
293
} ____cacheline_aligned_in_smp ;
291
294
@@ -329,6 +332,15 @@ struct mlx5e_tx_mpwqe {
329
332
u8 inline_on ;
330
333
};
331
334
335
+ struct mlx5e_skb_fifo {
336
+ struct sk_buff * * fifo ;
337
+ u16 * pc ;
338
+ u16 * cc ;
339
+ u16 mask ;
340
+ };
341
+
342
+ struct mlx5e_ptpsq ;
343
+
332
344
struct mlx5e_txqsq {
333
345
/* data path */
334
346
@@ -349,11 +361,10 @@ struct mlx5e_txqsq {
349
361
/* read only */
350
362
struct mlx5_wq_cyc wq ;
351
363
u32 dma_fifo_mask ;
352
- u16 skb_fifo_mask ;
353
364
struct mlx5e_sq_stats * stats ;
354
365
struct {
355
366
struct mlx5e_sq_dma * dma_fifo ;
356
- struct sk_buff * * skb_fifo ;
367
+ struct mlx5e_skb_fifo skb_fifo ;
357
368
struct mlx5e_tx_wqe_info * wqe_info ;
358
369
} db ;
359
370
void __iomem * uar_map ;
@@ -367,14 +378,17 @@ struct mlx5e_txqsq {
367
378
unsigned int hw_mtu ;
368
379
struct hwtstamp_config * tstamp ;
369
380
struct mlx5_clock * clock ;
381
+ struct net_device * netdev ;
382
+ struct mlx5_core_dev * mdev ;
383
+ struct mlx5e_priv * priv ;
370
384
371
385
/* control path */
372
386
struct mlx5_wq_ctrl wq_ctrl ;
373
- struct mlx5e_channel * channel ;
374
387
int ch_ix ;
375
388
int txq_ix ;
376
389
u32 rate_limit ;
377
390
struct work_struct recover_work ;
391
+ struct mlx5e_ptpsq * ptpsq ;
378
392
} ____cacheline_aligned_in_smp ;
379
393
380
394
struct mlx5e_dma_info {
@@ -593,7 +607,6 @@ struct mlx5e_rq {
593
607
u8 map_dir ; /* dma map direction */
594
608
} buff ;
595
609
596
- struct mlx5e_channel * channel ;
597
610
struct device * pdev ;
598
611
struct net_device * netdev ;
599
612
struct mlx5e_rq_stats * stats ;
@@ -602,6 +615,8 @@ struct mlx5e_rq {
602
615
struct mlx5e_page_cache page_cache ;
603
616
struct hwtstamp_config * tstamp ;
604
617
struct mlx5_clock * clock ;
618
+ struct mlx5e_icosq * icosq ;
619
+ struct mlx5e_priv * priv ;
605
620
606
621
mlx5e_fp_handle_rx_cqe handle_rx_cqe ;
607
622
mlx5e_fp_post_rx_wqes post_wqes ;
@@ -681,8 +696,11 @@ struct mlx5e_channel {
681
696
int cpu ;
682
697
};
683
698
699
+ struct mlx5e_port_ptp ;
700
+
684
701
struct mlx5e_channels {
685
702
struct mlx5e_channel * * c ;
703
+ struct mlx5e_port_ptp * port_ptp ;
686
704
unsigned int num ;
687
705
struct mlx5e_params params ;
688
706
};
@@ -697,6 +715,12 @@ struct mlx5e_channel_stats {
697
715
struct mlx5e_xdpsq_stats xsksq ;
698
716
} ____cacheline_aligned_in_smp ;
699
717
718
+ struct mlx5e_port_ptp_stats {
719
+ struct mlx5e_ch_stats ch ;
720
+ struct mlx5e_sq_stats sq [MLX5E_MAX_NUM_TC ];
721
+ struct mlx5e_ptp_cq_stats cq [MLX5E_MAX_NUM_TC ];
722
+ } ____cacheline_aligned_in_smp ;
723
+
700
724
enum {
701
725
MLX5E_STATE_OPENED ,
702
726
MLX5E_STATE_DESTROYING ,
@@ -766,8 +790,10 @@ struct mlx5e_scratchpad {
766
790
767
791
struct mlx5e_priv {
768
792
/* priv data path fields - start */
769
- struct mlx5e_txqsq * txq2sq [MLX5E_MAX_NUM_CHANNELS * MLX5E_MAX_NUM_TC ];
793
+ /* +1 for port ptp ts */
794
+ struct mlx5e_txqsq * txq2sq [(MLX5E_MAX_NUM_CHANNELS + 1 ) * MLX5E_MAX_NUM_TC ];
770
795
int channel_tc2realtxq [MLX5E_MAX_NUM_CHANNELS ][MLX5E_MAX_NUM_TC ];
796
+ int port_ptp_tc2realtxq [MLX5E_MAX_NUM_TC ];
771
797
#ifdef CONFIG_MLX5_CORE_EN_DCB
772
798
struct mlx5e_dcbx_dp dcbx_dp ;
773
799
#endif
@@ -802,12 +828,15 @@ struct mlx5e_priv {
802
828
struct net_device * netdev ;
803
829
struct mlx5e_stats stats ;
804
830
struct mlx5e_channel_stats channel_stats [MLX5E_MAX_NUM_CHANNELS ];
831
+ struct mlx5e_port_ptp_stats port_ptp_stats ;
805
832
u16 max_nch ;
806
833
u8 max_opened_tc ;
834
+ bool port_ptp_opened ;
807
835
struct hwtstamp_config tstamp ;
808
836
u16 q_counter ;
809
837
u16 drop_rq_q_counter ;
810
838
struct notifier_block events_nb ;
839
+ int num_tc_x_num_ch ;
811
840
812
841
struct udp_tunnel_nic_info nic_info ;
813
842
#ifdef CONFIG_MLX5_CORE_EN_DCB
@@ -923,9 +952,17 @@ int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params,
923
952
struct mlx5e_xdpsq * sq , bool is_redirect );
924
953
void mlx5e_close_xdpsq (struct mlx5e_xdpsq * sq );
925
954
955
+ struct mlx5e_create_cq_param {
956
+ struct napi_struct * napi ;
957
+ struct mlx5e_ch_stats * ch_stats ;
958
+ int node ;
959
+ int ix ;
960
+ };
961
+
926
962
struct mlx5e_cq_param ;
927
- int mlx5e_open_cq (struct mlx5e_channel * c , struct dim_cq_moder moder ,
928
- struct mlx5e_cq_param * param , struct mlx5e_cq * cq );
963
+ int mlx5e_open_cq (struct mlx5e_priv * priv , struct dim_cq_moder moder ,
964
+ struct mlx5e_cq_param * param , struct mlx5e_create_cq_param * ccp ,
965
+ struct mlx5e_cq * cq );
929
966
void mlx5e_close_cq (struct mlx5e_cq * cq );
930
967
931
968
int mlx5e_open_locked (struct net_device * netdev );
@@ -974,7 +1011,17 @@ void mlx5e_deactivate_icosq(struct mlx5e_icosq *icosq);
974
1011
int mlx5e_modify_sq (struct mlx5_core_dev * mdev , u32 sqn ,
975
1012
struct mlx5e_modify_sq_param * p );
976
1013
void mlx5e_activate_txqsq (struct mlx5e_txqsq * sq );
1014
+ void mlx5e_deactivate_txqsq (struct mlx5e_txqsq * sq );
1015
+ void mlx5e_free_txqsq (struct mlx5e_txqsq * sq );
977
1016
void mlx5e_tx_disable_queue (struct netdev_queue * txq );
1017
+ int mlx5e_alloc_txqsq_db (struct mlx5e_txqsq * sq , int numa );
1018
+ void mlx5e_free_txqsq_db (struct mlx5e_txqsq * sq );
1019
+ struct mlx5e_create_sq_param ;
1020
+ int mlx5e_create_sq_rdy (struct mlx5_core_dev * mdev ,
1021
+ struct mlx5e_sq_param * param ,
1022
+ struct mlx5e_create_sq_param * csp ,
1023
+ u32 * sqn );
1024
+ void mlx5e_tx_err_cqe_work (struct work_struct * recover_work );
978
1025
979
1026
static inline bool mlx5_tx_swp_supported (struct mlx5_core_dev * mdev )
980
1027
{
0 commit comments