net/ixgbe: fix adding a mirror rule
authorWei Dai <wei.dai@intel.com>
Tue, 5 Sep 2017 09:16:57 +0000 (17:16 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:48 +0000 (02:49 +0200)
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 <wei.dai@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c

index 9ca5cbc..7e3479e 100644 (file)
@@ -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);