File tree Expand file tree Collapse file tree 4 files changed +34
-6
lines changed
drivers/net/ethernet/mellanox/mlx5/core Expand file tree Collapse file tree 4 files changed +34
-6
lines changed Original file line number Diff line number Diff line change @@ -504,6 +504,19 @@ int mlx5_core_disable_hca(struct mlx5_core_dev *dev, u16 func_id)
504
504
return mlx5_cmd_status_to_err_v2 (out );
505
505
}
506
506
507
+ cycle_t mlx5_read_internal_timer (struct mlx5_core_dev * dev )
508
+ {
509
+ u32 timer_h , timer_h1 , timer_l ;
510
+
511
+ timer_h = ioread32be (& dev -> iseg -> internal_timer_h );
512
+ timer_l = ioread32be (& dev -> iseg -> internal_timer_l );
513
+ timer_h1 = ioread32be (& dev -> iseg -> internal_timer_h );
514
+ if (timer_h != timer_h1 ) /* wrap around */
515
+ timer_l = ioread32be (& dev -> iseg -> internal_timer_l );
516
+
517
+ return (cycle_t )timer_l | (cycle_t )timer_h1 << 32 ;
518
+ }
519
+
507
520
static int mlx5_irq_set_affinity_hint (struct mlx5_core_dev * mdev , int i )
508
521
{
509
522
struct mlx5_priv * priv = & mdev -> priv ;
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ int mlx5_core_sriov_configure(struct pci_dev *dev, int num_vfs);
98
98
int mlx5_core_enable_hca (struct mlx5_core_dev * dev , u16 func_id );
99
99
int mlx5_core_disable_hca (struct mlx5_core_dev * dev , u16 func_id );
100
100
int mlx5_wait_for_vf_pages (struct mlx5_core_dev * dev );
101
+ cycle_t mlx5_read_internal_timer (struct mlx5_core_dev * dev );
101
102
102
103
void mlx5e_init (void );
103
104
void mlx5e_cleanup (void );
Original file line number Diff line number Diff line change @@ -443,9 +443,12 @@ struct mlx5_init_seg {
443
443
__be32 rsvd1 [120 ];
444
444
__be32 initializing ;
445
445
struct health_buffer health ;
446
- __be32 rsvd2 [884 ];
446
+ __be32 rsvd2 [880 ];
447
+ __be32 internal_timer_h ;
448
+ __be32 internal_timer_l ;
449
+ __be32 rsrv3 [2 ];
447
450
__be32 health_counter ;
448
- __be32 rsvd3 [1019 ];
451
+ __be32 rsvd4 [1019 ];
449
452
__be64 ieee1588_clk ;
450
453
__be32 ieee1588_clk_type ;
451
454
__be32 clr_intx ;
@@ -601,7 +604,8 @@ struct mlx5_cqe64 {
601
604
__be32 imm_inval_pkey ;
602
605
u8 rsvd40 [4 ];
603
606
__be32 byte_cnt ;
604
- __be64 timestamp ;
607
+ __be32 timestamp_h ;
608
+ __be32 timestamp_l ;
605
609
__be32 sop_drop_qpn ;
606
610
__be16 wqe_counter ;
607
611
u8 signature ;
@@ -623,6 +627,16 @@ static inline int cqe_has_vlan(struct mlx5_cqe64 *cqe)
623
627
return !!(cqe -> l4_hdr_type_etc & 0x1 );
624
628
}
625
629
630
+ static inline u64 get_cqe_ts (struct mlx5_cqe64 * cqe )
631
+ {
632
+ u32 hi , lo ;
633
+
634
+ hi = be32_to_cpu (cqe -> timestamp_h );
635
+ lo = be32_to_cpu (cqe -> timestamp_l );
636
+
637
+ return (u64 )lo | ((u64 )hi << 32 );
638
+ }
639
+
626
640
enum {
627
641
CQE_L4_HDR_TYPE_NONE = 0x0 ,
628
642
CQE_L4_HDR_TYPE_TCP_NO_ACK = 0x1 ,
Original file line number Diff line number Diff line change @@ -829,9 +829,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
829
829
u8 reserved_66 [0x8 ];
830
830
u8 log_uar_page_sz [0x10 ];
831
831
832
- u8 reserved_67 [0xe0 ];
833
-
834
- u8 reserved_68 [0x1f ];
832
+ u8 reserved_67 [0x40 ];
833
+ u8 device_frequency_khz [ 0x20 ];
834
+ u8 reserved_68 [0x5f ];
835
835
u8 cqe_zip [0x1 ];
836
836
837
837
u8 cqe_zip_timeout [0x10 ];
You can’t perform that action at this time.
0 commit comments