Skip to content

Commit

Permalink
net/ixgbevf: fix promiscuous and allmulti
Browse files Browse the repository at this point in the history
[ upstream commit 21e471abb548f91190479c75da0c28ebc25dec36 ]

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: 1f4564e ("net/ixgbevf: enable promiscuous mode")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
  • Loading branch information
olivier-matz-6wind authored and cpaelzer committed Nov 24, 2022
1 parent 15caa4a commit acb3bb3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/net/ixgbe/ixgbe_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -8718,9 +8718,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;
Expand All @@ -8742,6 +8746,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;
Expand All @@ -8763,6 +8770,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;
Expand Down

0 comments on commit acb3bb3

Please sign in to comment.