Skip to content

Commit af2ccc6

Browse files
johndale88kuba-moo
authored andcommitted
enic: Move RX coalescing set function
Move the function used for setting the RX coalescing range to before the function that checks the link status. It needs to be called from there instead of from the probe function. There is no functional change. Co-developed-by: Nelson Escobar <[email protected]> Signed-off-by: Nelson Escobar <[email protected]> Co-developed-by: Satish Kharat <[email protected]> Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: John Daley <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 75f01bf commit af2ccc6

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

drivers/net/ethernet/cisco/enic/enic_main.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,36 @@ static void enic_mtu_check(struct enic *enic)
428428
}
429429
}
430430

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+
431461
static void enic_link_check(struct enic *enic)
432462
{
433463
int link_status = vnic_dev_link_status(enic->vdev);
@@ -1901,36 +1931,6 @@ static void enic_synchronize_irqs(struct enic *enic)
19011931
}
19021932
}
19031933

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-
19341934
static int enic_dev_notify_set(struct enic *enic)
19351935
{
19361936
int err;

0 commit comments

Comments
 (0)