“1abe9b8a138c9988ba8f7bfded6453649a31541f”上不存在“include/trace/git@gitcode.net:openeuler/kernel.git”
提交 13a8cd19 编写于 作者: A Alexander Duyck 提交者: David S. Miller

i40e: Do not enable NAPI on q_vectors that have no rings

When testing the epoll w/ busy poll code I found that I could get into a
state where the i40e driver had q_vectors w/ active NAPI that had no rings.
This was resulting in a divide by zero error.  To correct it I am updating
the driver code so that we only support NAPI on q_vectors that have 1 or
more rings allocated to them.
Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 28ee1b74
...@@ -4438,8 +4438,12 @@ static void i40e_napi_enable_all(struct i40e_vsi *vsi) ...@@ -4438,8 +4438,12 @@ static void i40e_napi_enable_all(struct i40e_vsi *vsi)
if (!vsi->netdev) if (!vsi->netdev)
return; return;
for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) {
napi_enable(&vsi->q_vectors[q_idx]->napi); struct i40e_q_vector *q_vector = vsi->q_vectors[q_idx];
if (q_vector->rx.ring || q_vector->tx.ring)
napi_enable(&q_vector->napi);
}
} }
/** /**
...@@ -4453,8 +4457,12 @@ static void i40e_napi_disable_all(struct i40e_vsi *vsi) ...@@ -4453,8 +4457,12 @@ static void i40e_napi_disable_all(struct i40e_vsi *vsi)
if (!vsi->netdev) if (!vsi->netdev)
return; return;
for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) {
napi_disable(&vsi->q_vectors[q_idx]->napi); struct i40e_q_vector *q_vector = vsi->q_vectors[q_idx];
if (q_vector->rx.ring || q_vector->tx.ring)
napi_disable(&q_vector->napi);
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部