Commit 4c0d6df
virtio_net: Fix error unwinding of XDP initialization
BugLink: https://bugs.launchpad.net/bugs/2028408
[ Upstream commit 5306623 ]
When initializing XDP in virtnet_open(), some rq xdp initialization
may hit an error causing net device open failed. However, previous
rqs have already initialized XDP and enabled NAPI, which is not the
expected behavior. Need to roll back the previous rq initialization
to avoid leaks in error unwinding of init code.
Also extract helper functions of disable and enable queue pairs.
Use newly introduced disable helper function in error unwinding and
virtnet_close. Use enable helper function in virtnet_open.
Fixes: 754b8a2 ("virtio_net: setup xdp_rxq_info")
Signed-off-by: Feng Liu <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
Reviewed-by: William Tu <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
Reviewed-by: Xuan Zhuo <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Kamal Mostafa <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>1 parent 0fe2477 commit 4c0d6df
1 file changed
+44
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1604 | 1604 | | |
1605 | 1605 | | |
1606 | 1606 | | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
1607 | 1639 | | |
1608 | 1640 | | |
1609 | 1641 | | |
| |||
1617 | 1649 | | |
1618 | 1650 | | |
1619 | 1651 | | |
1620 | | - | |
| 1652 | + | |
1621 | 1653 | | |
1622 | | - | |
1623 | | - | |
1624 | | - | |
1625 | | - | |
1626 | | - | |
1627 | | - | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
| 1654 | + | |
1633 | 1655 | | |
1634 | 1656 | | |
1635 | 1657 | | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1636 | 1666 | | |
1637 | 1667 | | |
1638 | 1668 | | |
| |||
1998 | 2028 | | |
1999 | 2029 | | |
2000 | 2030 | | |
2001 | | - | |
2002 | | - | |
2003 | | - | |
2004 | | - | |
2005 | | - | |
| 2031 | + | |
| 2032 | + | |
2006 | 2033 | | |
2007 | 2034 | | |
2008 | 2035 | | |
| |||
0 commit comments