* [dpdk-dev] [PATCH] net/ixgbe: fix mask bits register set error for FDIR @ 2018-06-13 8:12 Wei Zhao 2018-06-14 0:52 ` Lu, Wenzhuo 2018-06-14 7:21 ` [dpdk-dev] [PATCH v2] " Wei Zhao 0 siblings, 2 replies; 9+ messages in thread From: Wei Zhao @ 2018-06-13 8:12 UTC (permalink / raw) To: dev; +Cc: wenzhuo.lu, stable, Wei Zhao MAC address bits in mask registers should be set to zero when the is mac mask is 0xFF, otherwise if it is 0x0 these bits should be to 0x3F. Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550") Signed-off-by: Wei Zhao <wei.zhao1@intel.com> --- drivers/net/ixgbe/ixgbe_fdir.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index 3feb815..6d97aa3 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -394,9 +394,15 @@ fdir_set_input_mask_x550(struct rte_eth_dev *dev) IXGBE_FDIRIP6M_TNI_VNI; if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) { - mac_mask = info->mask.mac_addr_byte_mask; - fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT) - & IXGBE_FDIRIP6M_INNER_MAC; + mac_mask = info->mask.mac_addr_byte_mask & 0x3F; + if (mac_mask == 0x3F) + fdiripv6m &= ~IXGBE_FDIRIP6M_INNER_MAC; + else if (mac_mask == 0) + fdiripv6m |= IXGBE_FDIRIP6M_INNER_MAC; + else{ + PMD_INIT_LOG(ERR, "invalid mac_addr_byte_mask"); + return -EINVAL; + } switch (info->mask.tunnel_type_mask) { case 0: -- 2.7.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbe: fix mask bits register set error for FDIR 2018-06-13 8:12 [dpdk-dev] [PATCH] net/ixgbe: fix mask bits register set error for FDIR Wei Zhao @ 2018-06-14 0:52 ` Lu, Wenzhuo 2018-06-14 1:52 ` Zhao1, Wei 2018-06-14 7:21 ` [dpdk-dev] [PATCH v2] " Wei Zhao 1 sibling, 1 reply; 9+ messages in thread From: Lu, Wenzhuo @ 2018-06-14 0:52 UTC (permalink / raw) To: Zhao1, Wei, dev; +Cc: stable Hi Wei, > -----Original Message----- > From: Zhao1, Wei > Sent: Wednesday, June 13, 2018 4:12 PM > To: dev@dpdk.org > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org; Zhao1, Wei > <wei.zhao1@intel.com> > Subject: [PATCH] net/ixgbe: fix mask bits register set error for FDIR > > MAC address bits in mask registers should be set to zero when the is mac > mask is 0xFF, otherwise if it is 0x0 these bits should be to 0x3F. > > Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550") > > Signed-off-by: Wei Zhao <wei.zhao1@intel.com> > --- > drivers/net/ixgbe/ixgbe_fdir.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c > index 3feb815..6d97aa3 100644 > --- a/drivers/net/ixgbe/ixgbe_fdir.c > +++ b/drivers/net/ixgbe/ixgbe_fdir.c > @@ -394,9 +394,15 @@ fdir_set_input_mask_x550(struct rte_eth_dev *dev) > IXGBE_FDIRIP6M_TNI_VNI; > > if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) { > - mac_mask = info->mask.mac_addr_byte_mask; > - fdiripv6m |= (mac_mask << > IXGBE_FDIRIP6M_INNER_MAC_SHIFT) > - & IXGBE_FDIRIP6M_INNER_MAC; > + mac_mask = info->mask.mac_addr_byte_mask & 0x3F; Better not use 0x3f, you can change it to "IXGBE_FDIRIP6M_INNER_MAC >> IXGBE_FDIRIP6M_INNER_MAC_SHIFT" > + if (mac_mask == 0x3F) > + fdiripv6m &= ~IXGBE_FDIRIP6M_INNER_MAC; > + else if (mac_mask == 0) > + fdiripv6m |= IXGBE_FDIRIP6M_INNER_MAC; > + else{ > + PMD_INIT_LOG(ERR, "invalid mac_addr_byte_mask"); > + return -EINVAL; I think every byte of the MAC address can be masked. So this is not the invalid case. We should support 0x1f, 0xf, 0x7... as before. > + } > > switch (info->mask.tunnel_type_mask) { > case 0: > -- > 2.7.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ixgbe: fix mask bits register set error for FDIR 2018-06-14 0:52 ` Lu, Wenzhuo @ 2018-06-14 1:52 ` Zhao1, Wei 0 siblings, 0 replies; 9+ messages in thread From: Zhao1, Wei @ 2018-06-14 1:52 UTC (permalink / raw) To: Lu, Wenzhuo, dev; +Cc: stable Hi, wenzhuo > -----Original Message----- > From: Lu, Wenzhuo > Sent: Thursday, June 14, 2018 8:53 AM > To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org > Cc: stable@dpdk.org > Subject: RE: [PATCH] net/ixgbe: fix mask bits register set error for FDIR > > Hi Wei, > > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Wednesday, June 13, 2018 4:12 PM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org; Zhao1, Wei > > <wei.zhao1@intel.com> > > Subject: [PATCH] net/ixgbe: fix mask bits register set error for FDIR > > > > MAC address bits in mask registers should be set to zero when the is > > mac mask is 0xFF, otherwise if it is 0x0 these bits should be to 0x3F. > > > > Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for > > X550") > > > > Signed-off-by: Wei Zhao <wei.zhao1@intel.com> > > --- > > drivers/net/ixgbe/ixgbe_fdir.c | 12 +++++++++--- > > 1 file changed, 9 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/ixgbe/ixgbe_fdir.c > > b/drivers/net/ixgbe/ixgbe_fdir.c index 3feb815..6d97aa3 100644 > > --- a/drivers/net/ixgbe/ixgbe_fdir.c > > +++ b/drivers/net/ixgbe/ixgbe_fdir.c > > @@ -394,9 +394,15 @@ fdir_set_input_mask_x550(struct rte_eth_dev > *dev) > > IXGBE_FDIRIP6M_TNI_VNI; > > > > if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) { > > - mac_mask = info->mask.mac_addr_byte_mask; > > - fdiripv6m |= (mac_mask << > > IXGBE_FDIRIP6M_INNER_MAC_SHIFT) > > - & IXGBE_FDIRIP6M_INNER_MAC; > > + mac_mask = info->mask.mac_addr_byte_mask & 0x3F; > Better not use 0x3f, you can change it to "IXGBE_FDIRIP6M_INNER_MAC >> > IXGBE_FDIRIP6M_INNER_MAC_SHIFT" > > > + if (mac_mask == 0x3F) > > + fdiripv6m &= ~IXGBE_FDIRIP6M_INNER_MAC; > > + else if (mac_mask == 0) > > + fdiripv6m |= IXGBE_FDIRIP6M_INNER_MAC; > > + else{ > > + PMD_INIT_LOG(ERR, "invalid > mac_addr_byte_mask"); > > + return -EINVAL; > I think every byte of the MAC address can be masked. So this is not the > invalid case. We should support 0x1f, 0xf, 0x7... as before. Ok, I will commit v3 > > > + } > > > > switch (info->mask.tunnel_type_mask) { > > case 0: > > -- > > 2.7.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH v2] net/ixgbe: fix mask bits register set error for FDIR 2018-06-13 8:12 [dpdk-dev] [PATCH] net/ixgbe: fix mask bits register set error for FDIR Wei Zhao 2018-06-14 0:52 ` Lu, Wenzhuo @ 2018-06-14 7:21 ` Wei Zhao 2018-06-15 2:30 ` [dpdk-dev] [PATCH v3] " Wei Zhao 1 sibling, 1 reply; 9+ messages in thread From: Wei Zhao @ 2018-06-14 7:21 UTC (permalink / raw) To: dev; +Cc: wenzhuo.lu, stable, Wei Zhao MAC address bits in mask registers should be set to zero when the is mac mask is 0xFF, otherwise if it is 0x0 these bits should be to 0x3F, it also support other mask like 0xF and so on. Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550") Signed-off-by: Wei Zhao <wei.zhao1@intel.com> --- v2: -change mask bits set method to support more mac mask. --- drivers/net/ixgbe/ixgbe_fdir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index 3feb815..dea8862 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -394,9 +394,9 @@ fdir_set_input_mask_x550(struct rte_eth_dev *dev) IXGBE_FDIRIP6M_TNI_VNI; if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) { - mac_mask = info->mask.mac_addr_byte_mask; - fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT) - & IXGBE_FDIRIP6M_INNER_MAC; + mac_mask = info->mask.mac_addr_byte_mask & 0x3F; + fdiripv6m &= ~((mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT) & + IXGBE_FDIRIP6M_INNER_MAC); switch (info->mask.tunnel_type_mask) { case 0: -- 2.7.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH v3] net/ixgbe: fix mask bits register set error for FDIR 2018-06-14 7:21 ` [dpdk-dev] [PATCH v2] " Wei Zhao @ 2018-06-15 2:30 ` Wei Zhao 2018-06-15 3:10 ` [dpdk-dev] [PATCH v4] " Wei Zhao 0 siblings, 1 reply; 9+ messages in thread From: Wei Zhao @ 2018-06-15 2:30 UTC (permalink / raw) To: dev; +Cc: wenzhuo.lu, stable, Wei Zhao MAC address bits in mask registers should be set to zero when the is mac mask is 0xFF, otherwise if it is 0x0 these bits should be to 0x3F. Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550") Signed-off-by: Wei Zhao <wei.zhao1@intel.com> --- v2: -change mask bits set method to support more mac mask. v3: -change mask and with 0x3F to macro definition. --- drivers/net/ixgbe/ixgbe_fdir.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index 6baf825..aebe4c6 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -394,9 +394,11 @@ fdir_set_input_mask_x550(struct rte_eth_dev *dev) IXGBE_FDIRIP6M_TNI_VNI; if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) { - mac_mask = info->mask.mac_addr_byte_mask; - fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT) - & IXGBE_FDIRIP6M_INNER_MAC; + mac_mask = info->mask.mac_addr_byte_mask & + (IXGBE_FDIRIP6M_INNER_MAC >> + IXGBE_FDIRIP6M_INNER_MAC_SHIFT); + fdiripv6m &= ~((mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT) & + IXGBE_FDIRIP6M_INNER_MAC); switch (info->mask.tunnel_type_mask) { case 0: -- 2.7.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH v4] net/ixgbe: fix mask bits register set error for FDIR 2018-06-15 2:30 ` [dpdk-dev] [PATCH v3] " Wei Zhao @ 2018-06-15 3:10 ` Wei Zhao 2018-06-15 6:08 ` [dpdk-dev] [PATCH v5] " Wei Zhao 0 siblings, 1 reply; 9+ messages in thread From: Wei Zhao @ 2018-06-15 3:10 UTC (permalink / raw) To: dev; +Cc: wenzhuo.lu, stable, Wei Zhao MAC address bits in mask registers should be set to zero when the is mac mask is 0xFF, otherwise if it is 0x0 these bits should be to 0x3F. Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550") Signed-off-by: Wei Zhao <wei.zhao1@intel.com> --- v2: -change mask bits set method to support more mac mask. v3: -change mask and with 0x3F to macro definition. v4: -fix mask bits bug in v3. --- drivers/net/ixgbe/ixgbe_fdir.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index 6baf825..6ac806c 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -388,15 +388,17 @@ fdir_set_input_mask_x550(struct rte_eth_dev *dev) IXGBE_WRITE_REG(hw, IXGBE_FDIRM, fdirm); fdiripv6m = ((u32)0xFFFFU << IXGBE_FDIRIP6M_DIPM_SHIFT); - fdiripv6m |= IXGBE_FDIRIP6M_ALWAYS_MASK; + fdiripv6m |= IXGBE_FDIRIP6M_ALWAYS_MASK | IXGBE_FDIRIP6M_INNER_MAC; if (mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) fdiripv6m |= IXGBE_FDIRIP6M_TUNNEL_TYPE | IXGBE_FDIRIP6M_TNI_VNI; if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) { - mac_mask = info->mask.mac_addr_byte_mask; - fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT) - & IXGBE_FDIRIP6M_INNER_MAC; + mac_mask = info->mask.mac_addr_byte_mask & + (IXGBE_FDIRIP6M_INNER_MAC >> + IXGBE_FDIRIP6M_INNER_MAC_SHIFT); + fdiripv6m &= ~((mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT) & + IXGBE_FDIRIP6M_INNER_MAC); switch (info->mask.tunnel_type_mask) { case 0: -- 2.7.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH v5] net/ixgbe: fix mask bits register set error for FDIR 2018-06-15 3:10 ` [dpdk-dev] [PATCH v4] " Wei Zhao @ 2018-06-15 6:08 ` Wei Zhao 2018-06-19 0:57 ` Lu, Wenzhuo 0 siblings, 1 reply; 9+ messages in thread From: Wei Zhao @ 2018-06-15 6:08 UTC (permalink / raw) To: dev; +Cc: wenzhuo.lu, stable, Wei Zhao MAC address bits in mask registers should be set to zero when the is mac mask is 0xFF, otherwise if it is 0x0 these bits should be to 0x3F. Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550") Signed-off-by: Wei Zhao <wei.zhao1@intel.com> --- v2: -change mask bits set method to support more mac mask. v3: -change mask and with 0x3F to macro definition. v4: -fix mask bits bug in v3. v5: -mask bits should be set only in tunnel mode. --- drivers/net/ixgbe/ixgbe_fdir.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index 6baf825..e559f0f 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -394,9 +394,12 @@ fdir_set_input_mask_x550(struct rte_eth_dev *dev) IXGBE_FDIRIP6M_TNI_VNI; if (mode == RTE_FDIR_MODE_PERFECT_TUNNEL) { - mac_mask = info->mask.mac_addr_byte_mask; - fdiripv6m |= (mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT) - & IXGBE_FDIRIP6M_INNER_MAC; + fdiripv6m |= IXGBE_FDIRIP6M_INNER_MAC; + mac_mask = info->mask.mac_addr_byte_mask & + (IXGBE_FDIRIP6M_INNER_MAC >> + IXGBE_FDIRIP6M_INNER_MAC_SHIFT); + fdiripv6m &= ~((mac_mask << IXGBE_FDIRIP6M_INNER_MAC_SHIFT) & + IXGBE_FDIRIP6M_INNER_MAC); switch (info->mask.tunnel_type_mask) { case 0: -- 2.7.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH v5] net/ixgbe: fix mask bits register set error for FDIR 2018-06-15 6:08 ` [dpdk-dev] [PATCH v5] " Wei Zhao @ 2018-06-19 0:57 ` Lu, Wenzhuo 2018-06-21 14:12 ` Zhang, Qi Z 0 siblings, 1 reply; 9+ messages in thread From: Lu, Wenzhuo @ 2018-06-19 0:57 UTC (permalink / raw) To: Zhao1, Wei, dev; +Cc: stable Hi, > -----Original Message----- > From: Zhao1, Wei > Sent: Friday, June 15, 2018 2:08 PM > To: dev@dpdk.org > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org; Zhao1, Wei > <wei.zhao1@intel.com> > Subject: [PATCH v5] net/ixgbe: fix mask bits register set error for FDIR > > MAC address bits in mask registers should be set to zero when the is mac > mask is 0xFF, otherwise if it is 0x0 these bits should be to 0x3F. > > Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550") > > Signed-off-by: Wei Zhao <wei.zhao1@intel.com> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH v5] net/ixgbe: fix mask bits register set error for FDIR 2018-06-19 0:57 ` Lu, Wenzhuo @ 2018-06-21 14:12 ` Zhang, Qi Z 0 siblings, 0 replies; 9+ messages in thread From: Zhang, Qi Z @ 2018-06-21 14:12 UTC (permalink / raw) To: Lu, Wenzhuo, Zhao1, Wei, dev; +Cc: stable > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Lu, Wenzhuo > Sent: Tuesday, June 19, 2018 8:57 AM > To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org > Cc: stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v5] net/ixgbe: fix mask bits register set error > for FDIR > > Hi, > > > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Friday, June 15, 2018 2:08 PM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org; Zhao1, Wei > > <wei.zhao1@intel.com> > > Subject: [PATCH v5] net/ixgbe: fix mask bits register set error for > > FDIR > > > > MAC address bits in mask registers should be set to zero when the is > > mac mask is 0xFF, otherwise if it is 0x0 these bits should be to 0x3F. > > > > Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for > > X550") > > > > Signed-off-by: Wei Zhao <wei.zhao1@intel.com> > Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com> Applied to dpdk-next-net-intel Thanks! Qi ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-06-21 14:12 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-06-13 8:12 [dpdk-dev] [PATCH] net/ixgbe: fix mask bits register set error for FDIR Wei Zhao 2018-06-14 0:52 ` Lu, Wenzhuo 2018-06-14 1:52 ` Zhao1, Wei 2018-06-14 7:21 ` [dpdk-dev] [PATCH v2] " Wei Zhao 2018-06-15 2:30 ` [dpdk-dev] [PATCH v3] " Wei Zhao 2018-06-15 3:10 ` [dpdk-dev] [PATCH v4] " Wei Zhao 2018-06-15 6:08 ` [dpdk-dev] [PATCH v5] " Wei Zhao 2018-06-19 0:57 ` Lu, Wenzhuo 2018-06-21 14:12 ` Zhang, Qi Z
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).