From: Wei Dai Date: Tue, 5 Sep 2017 09:16:57 +0000 (+0800) Subject: net/ixgbe: fix adding a mirror rule X-Git-Tag: spdx-start~1979 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c2252db7f9a09bfca03f59fec2dab09e2a4d0d6b;p=dpdk.git net/ixgbe: fix adding a mirror rule mirror rule_type can be a bit OR result of multiple mirror type of a rule. Fixes: 7ba29a76b196 ("ethdev: rename and extend the mirror type") Cc: stable@dpdk.org Signed-off-by: Wei Dai Acked-by: Jingjing Wu --- diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 9ca5cbcd39..7e3479e346 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -5497,13 +5497,13 @@ ixgbe_mirror_rule_set(struct rte_eth_dev *dev, IXGBE_WRITE_REG(hw, IXGBE_MRCTL(rule_id), mr_ctl); /* write pool mirrror control register */ - if (mirror_conf->rule_type == ETH_MIRROR_VIRTUAL_POOL_UP) { + if (mirror_conf->rule_type & ETH_MIRROR_VIRTUAL_POOL_UP) { IXGBE_WRITE_REG(hw, IXGBE_VMRVM(rule_id), mp_lsb); IXGBE_WRITE_REG(hw, IXGBE_VMRVM(rule_id + rule_mr_offset), mp_msb); } /* write VLAN mirrror control register */ - if (mirror_conf->rule_type == ETH_MIRROR_VLAN) { + if (mirror_conf->rule_type & ETH_MIRROR_VLAN) { IXGBE_WRITE_REG(hw, IXGBE_VMRVLAN(rule_id), mv_lsb); IXGBE_WRITE_REG(hw, IXGBE_VMRVLAN(rule_id + rule_mr_offset), mv_msb);