@@ -109,7 +109,7 @@ static struct enic_intr_mod_table mod_table[ENIC_MAX_COALESCE_TIMERS + 1] = {
109
109
static struct enic_intr_mod_range mod_range [ENIC_MAX_LINK_SPEEDS ] = {
110
110
{0 , 0 }, /* 0 - 4 Gbps */
111
111
{0 , 3 }, /* 4 - 10 Gbps */
112
- {3 , 6 }, /* 10 - 40 Gbps */
112
+ {3 , 6 }, /* 10+ Gbps */
113
113
};
114
114
115
115
static void enic_init_affinity_hint (struct enic * enic )
@@ -428,6 +428,36 @@ static void enic_mtu_check(struct enic *enic)
428
428
}
429
429
}
430
430
431
+ static void enic_set_rx_coal_setting (struct enic * enic )
432
+ {
433
+ unsigned int speed ;
434
+ int index = -1 ;
435
+ struct enic_rx_coal * rx_coal = & enic -> rx_coalesce_setting ;
436
+
437
+ /* 1. Read the link speed from fw
438
+ * 2. Pick the default range for the speed
439
+ * 3. Update it in enic->rx_coalesce_setting
440
+ */
441
+ speed = vnic_dev_port_speed (enic -> vdev );
442
+ if (speed > ENIC_LINK_SPEED_10G )
443
+ index = ENIC_LINK_40G_INDEX ;
444
+ else if (speed > ENIC_LINK_SPEED_4G )
445
+ index = ENIC_LINK_10G_INDEX ;
446
+ else
447
+ index = ENIC_LINK_4G_INDEX ;
448
+
449
+ rx_coal -> small_pkt_range_start = mod_range [index ].small_pkt_range_start ;
450
+ rx_coal -> large_pkt_range_start = mod_range [index ].large_pkt_range_start ;
451
+ rx_coal -> range_end = ENIC_RX_COALESCE_RANGE_END ;
452
+
453
+ /* Start with the value provided by UCSM */
454
+ for (index = 0 ; index < enic -> rq_count ; index ++ )
455
+ enic -> cq [index ].cur_rx_coal_timeval =
456
+ enic -> config .intr_timer_usec ;
457
+
458
+ rx_coal -> use_adaptive_rx_coalesce = 1 ;
459
+ }
460
+
431
461
static void enic_link_check (struct enic * enic )
432
462
{
433
463
int link_status = vnic_dev_link_status (enic -> vdev );
@@ -436,6 +466,7 @@ static void enic_link_check(struct enic *enic)
436
466
if (link_status && !carrier_ok ) {
437
467
netdev_info (enic -> netdev , "Link UP\n" );
438
468
netif_carrier_on (enic -> netdev );
469
+ enic_set_rx_coal_setting (enic );
439
470
} else if (!link_status && carrier_ok ) {
440
471
netdev_info (enic -> netdev , "Link DOWN\n" );
441
472
netif_carrier_off (enic -> netdev );
@@ -1901,36 +1932,6 @@ static void enic_synchronize_irqs(struct enic *enic)
1901
1932
}
1902
1933
}
1903
1934
1904
- static void enic_set_rx_coal_setting (struct enic * enic )
1905
- {
1906
- unsigned int speed ;
1907
- int index = -1 ;
1908
- struct enic_rx_coal * rx_coal = & enic -> rx_coalesce_setting ;
1909
-
1910
- /* 1. Read the link speed from fw
1911
- * 2. Pick the default range for the speed
1912
- * 3. Update it in enic->rx_coalesce_setting
1913
- */
1914
- speed = vnic_dev_port_speed (enic -> vdev );
1915
- if (ENIC_LINK_SPEED_10G < speed )
1916
- index = ENIC_LINK_40G_INDEX ;
1917
- else if (ENIC_LINK_SPEED_4G < speed )
1918
- index = ENIC_LINK_10G_INDEX ;
1919
- else
1920
- index = ENIC_LINK_4G_INDEX ;
1921
-
1922
- rx_coal -> small_pkt_range_start = mod_range [index ].small_pkt_range_start ;
1923
- rx_coal -> large_pkt_range_start = mod_range [index ].large_pkt_range_start ;
1924
- rx_coal -> range_end = ENIC_RX_COALESCE_RANGE_END ;
1925
-
1926
- /* Start with the value provided by UCSM */
1927
- for (index = 0 ; index < enic -> rq_count ; index ++ )
1928
- enic -> cq [index ].cur_rx_coal_timeval =
1929
- enic -> config .intr_timer_usec ;
1930
-
1931
- rx_coal -> use_adaptive_rx_coalesce = 1 ;
1932
- }
1933
-
1934
1935
static int enic_dev_notify_set (struct enic * enic )
1935
1936
{
1936
1937
int err ;
@@ -3063,7 +3064,6 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3063
3064
timer_setup (& enic -> notify_timer , enic_notify_timer , 0 );
3064
3065
3065
3066
enic_rfs_flw_tbl_init (enic );
3066
- enic_set_rx_coal_setting (enic );
3067
3067
INIT_WORK (& enic -> reset , enic_reset );
3068
3068
INIT_WORK (& enic -> tx_hang_reset , enic_tx_hang_reset );
3069
3069
INIT_WORK (& enic -> change_mtu_work , enic_change_mtu_work );
0 commit comments