net/ixgbevf: fix promiscuous and allmulti
The configuration of allmulti and promiscuous modes conflicts
together. For instance, if we enable promiscuous mode, then enable and
disable allmulti, then the promiscuous mode is wrongly disabled.
Fix this behavior by:
- doing nothing when we set/unset allmulti if promiscuous mode is on
- restorting the proper mode (none or allmulti) when we disable
promiscuous mode
Fixes: 1f4564ed76
("net/ixgbevf: enable promiscuous mode")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
This commit is contained in:
parent
1408993082
commit
21e471abb5
@ -7787,9 +7787,13 @@ static int
|
||||
ixgbevf_dev_promiscuous_disable(struct rte_eth_dev *dev)
|
||||
{
|
||||
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
int mode = IXGBEVF_XCAST_MODE_NONE;
|
||||
int ret;
|
||||
|
||||
switch (hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_NONE)) {
|
||||
if (dev->data->all_multicast)
|
||||
mode = IXGBEVF_XCAST_MODE_ALLMULTI;
|
||||
|
||||
switch (hw->mac.ops.update_xcast_mode(hw, mode)) {
|
||||
case IXGBE_SUCCESS:
|
||||
ret = 0;
|
||||
break;
|
||||
@ -7811,6 +7815,9 @@ ixgbevf_dev_allmulticast_enable(struct rte_eth_dev *dev)
|
||||
int ret;
|
||||
int mode = IXGBEVF_XCAST_MODE_ALLMULTI;
|
||||
|
||||
if (dev->data->promiscuous)
|
||||
return 0;
|
||||
|
||||
switch (hw->mac.ops.update_xcast_mode(hw, mode)) {
|
||||
case IXGBE_SUCCESS:
|
||||
ret = 0;
|
||||
@ -7832,6 +7839,9 @@ ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev)
|
||||
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
int ret;
|
||||
|
||||
if (dev->data->promiscuous)
|
||||
return 0;
|
||||
|
||||
switch (hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_MULTI)) {
|
||||
case IXGBE_SUCCESS:
|
||||
ret = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user