|
@@ -331,6 +331,7 @@ static void i40evf_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector
|
|
static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
|
|
static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
|
|
{
|
|
{
|
|
enum i40e_latency_range new_latency_range = rc->latency_range;
|
|
enum i40e_latency_range new_latency_range = rc->latency_range;
|
|
|
|
+ struct i40e_q_vector *qv = rc->ring->q_vector;
|
|
u32 new_itr = rc->itr;
|
|
u32 new_itr = rc->itr;
|
|
int bytes_per_int;
|
|
int bytes_per_int;
|
|
int usecs;
|
|
int usecs;
|
|
@@ -339,9 +340,10 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
|
|
return false;
|
|
return false;
|
|
|
|
|
|
/* simple throttlerate management
|
|
/* simple throttlerate management
|
|
- * 0-10MB/s lowest (100000 ints/s)
|
|
|
|
|
|
+ * 0-10MB/s lowest (50000 ints/s)
|
|
* 10-20MB/s low (20000 ints/s)
|
|
* 10-20MB/s low (20000 ints/s)
|
|
- * 20-1249MB/s bulk (8000 ints/s)
|
|
|
|
|
|
+ * 20-1249MB/s bulk (18000 ints/s)
|
|
|
|
+ * > 40000 Rx packets per second (8000 ints/s)
|
|
*
|
|
*
|
|
* The math works out because the divisor is in 10^(-6) which
|
|
* The math works out because the divisor is in 10^(-6) which
|
|
* turns the bytes/us input value into MB/s values, but
|
|
* turns the bytes/us input value into MB/s values, but
|
|
@@ -362,24 +364,37 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
|
|
new_latency_range = I40E_LOWEST_LATENCY;
|
|
new_latency_range = I40E_LOWEST_LATENCY;
|
|
break;
|
|
break;
|
|
case I40E_BULK_LATENCY:
|
|
case I40E_BULK_LATENCY:
|
|
- if (bytes_per_int <= 20)
|
|
|
|
- new_latency_range = I40E_LOW_LATENCY;
|
|
|
|
- break;
|
|
|
|
|
|
+ case I40E_ULTRA_LATENCY:
|
|
default:
|
|
default:
|
|
if (bytes_per_int <= 20)
|
|
if (bytes_per_int <= 20)
|
|
new_latency_range = I40E_LOW_LATENCY;
|
|
new_latency_range = I40E_LOW_LATENCY;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /* this is to adjust RX more aggressively when streaming small
|
|
|
|
+ * packets. The value of 40000 was picked as it is just beyond
|
|
|
|
+ * what the hardware can receive per second if in low latency
|
|
|
|
+ * mode.
|
|
|
|
+ */
|
|
|
|
+#define RX_ULTRA_PACKET_RATE 40000
|
|
|
|
+
|
|
|
|
+ if ((((rc->total_packets * 1000000) / usecs) > RX_ULTRA_PACKET_RATE) &&
|
|
|
|
+ (&qv->rx == rc))
|
|
|
|
+ new_latency_range = I40E_ULTRA_LATENCY;
|
|
|
|
+
|
|
rc->latency_range = new_latency_range;
|
|
rc->latency_range = new_latency_range;
|
|
|
|
|
|
switch (new_latency_range) {
|
|
switch (new_latency_range) {
|
|
case I40E_LOWEST_LATENCY:
|
|
case I40E_LOWEST_LATENCY:
|
|
- new_itr = I40E_ITR_100K;
|
|
|
|
|
|
+ new_itr = I40E_ITR_50K;
|
|
break;
|
|
break;
|
|
case I40E_LOW_LATENCY:
|
|
case I40E_LOW_LATENCY:
|
|
new_itr = I40E_ITR_20K;
|
|
new_itr = I40E_ITR_20K;
|
|
break;
|
|
break;
|
|
case I40E_BULK_LATENCY:
|
|
case I40E_BULK_LATENCY:
|
|
|
|
+ new_itr = I40E_ITR_18K;
|
|
|
|
+ break;
|
|
|
|
+ case I40E_ULTRA_LATENCY:
|
|
new_itr = I40E_ITR_8K;
|
|
new_itr = I40E_ITR_8K;
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|