[dpdk-dev] net/ixgbe: fix adding multiple mirror type in a rule

Message ID 1504603017-17657-1-git-send-email-wei.dai@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Wei Dai Sept. 5, 2017, 9:16 a.m. UTC
  mirror rule_type can be a bit OR result of multiple mirror type of
a rule. Before the commit which introduced this issue, the code
supported adding multiple mirror type in a rule.

Fixes: 7ba29a76b196 ("ethdev: rename and extend the mirror type")
Cc: stable@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Jingjing Wu Sept. 8, 2017, 12:23 a.m. UTC | #1
> -----Original Message-----
> From: Dai, Wei
> Sent: Tuesday, September 5, 2017 5:17 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/ixgbe: fix adding multiple mirror type in a rule
> 
> mirror rule_type can be a bit OR result of multiple mirror type of a rule. Before
> the commit which introduced this issue, the code supported adding multiple
> mirror type in 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>
  
Ferruh Yigit Sept. 8, 2017, 9:36 a.m. UTC | #2
On 9/8/2017 1:23 AM, Wu, Jingjing wrote:
> 
> 
>> -----Original Message-----
>> From: Dai, Wei
>> Sent: Tuesday, September 5, 2017 5:17 PM
>> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
>> <konstantin.ananyev@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>; stable@dpdk.org
>> Subject: [PATCH] net/ixgbe: fix adding multiple mirror type in a rule
>>
>> mirror rule_type can be a bit OR result of multiple mirror type of a rule. Before
>> the commit which introduced this issue, the code supported adding multiple
>> mirror type in 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>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 22171d8..858230d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -5450,13 +5450,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);