[dpdk-dev,v2] net/i40e: fix vsi removing from tailq when release
Commit Message
VSI structure need to be removed from TAILQ list when releasing.
But for the child VSI it will be removed again after the structure
is freed. It will cause core dump when the DPDK i40e using as PF
host driver.
This patch fixes it to only remove child VSI from TAILQ before
send adminq command to remove it from hardware.
Fixes: 4861cde46116 ("i40e: new poll mode driver")
Fixes: 440499cf5376 ("net/i40e: support floating VEB")
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
v2 change:
- add fix for floating veb case
drivers/net/i40e/i40e_ethdev.c | 2 --
1 file changed, 2 deletions(-)
Comments
> -----Original Message-----
> From: Wu, Jingjing
> Sent: Monday, July 25, 2016 1:36 PM
> To: Zhang, Helin <helin.zhang@intel.com>
> Cc: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Peng, Yuan <yuan.peng@intel.com>
> Subject: [PATCH v2] net/i40e: fix vsi removing from tailq when release
>
> VSI structure need to be removed from TAILQ list when releasing.
> But for the child VSI it will be removed again after the structure is freed. It will
> cause core dump when the DPDK i40e using as PF host driver.
>
> This patch fixes it to only remove child VSI from TAILQ before send adminq
> command to remove it from hardware.
>
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> Fixes: 440499cf5376 ("net/i40e: support floating VEB")
> Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
> > VSI structure need to be removed from TAILQ list when releasing.
> > But for the child VSI it will be removed again after the structure is freed. It will
> > cause core dump when the DPDK i40e using as PF host driver.
> >
> > This patch fixes it to only remove child VSI from TAILQ before send adminq
> > command to remove it from hardware.
> >
> > Fixes: 4861cde46116 ("i40e: new poll mode driver")
> > Fixes: 440499cf5376 ("net/i40e: support floating VEB")
> > Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
> Acked-by: Helin Zhang <helin.zhang@intel.com>
Applied, thanks
@@ -4110,7 +4110,6 @@ i40e_vsi_release(struct i40e_vsi *vsi)
TAILQ_FOREACH_SAFE(vsi_list, &vsi->veb->head, list, temp) {
if (i40e_vsi_release(vsi_list->vsi) != I40E_SUCCESS)
return -1;
- TAILQ_REMOVE(&vsi->veb->head, vsi_list, list);
}
i40e_veb_release(vsi->veb);
}
@@ -4119,7 +4118,6 @@ i40e_vsi_release(struct i40e_vsi *vsi)
TAILQ_FOREACH_SAFE(vsi_list, &vsi->floating_veb->head, list, temp) {
if (i40e_vsi_release(vsi_list->vsi) != I40E_SUCCESS)
return -1;
- TAILQ_REMOVE(&vsi->floating_veb->head, vsi_list, list);
}
}