All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx
@ 2016-04-15 13:39 Tomasz Kulasek
  2016-04-18  1:57 ` Lu, Wenzhuo
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Tomasz Kulasek @ 2016-04-15 13:39 UTC (permalink / raw)
  To: dev; +Cc: helin.zhang, konstantin.ananyev

CID 13193 (#1 of 1): Bad bit shift operation (BAD_SHIFT)
large_shift: In expression 1 << pool, left shifting by more than 31 bits
has undefined behavior. The shift amount, pool, is at least 32.

This patch limits mask shift to be in range of 32 bit PFVFRE[1] register,
for pool > 31.

Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3f1ebc1..f676a64 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4401,7 +4401,7 @@ ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
 
 	addr = IXGBE_VFRE(pool >= ETH_64_POOLS/2);
 	reg = IXGBE_READ_REG(hw, addr);
-	val = bit1 << pool;
+	val = bit1 << (pool & 0x01F);
 
 	if (on)
 		reg |= val;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx
  2016-04-15 13:39 [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx Tomasz Kulasek
@ 2016-04-18  1:57 ` Lu, Wenzhuo
  2016-04-21 13:51 ` Bruce Richardson
  2016-04-22 15:35 ` [PATCH v2] ixgbe: fix bad shift operation in ixgbe_set_pool_rx/tx Tomasz Kulasek
  2 siblings, 0 replies; 9+ messages in thread
From: Lu, Wenzhuo @ 2016-04-18  1:57 UTC (permalink / raw)
  To: Kulasek, TomaszX, dev; +Cc: Zhang, Helin, Ananyev, Konstantin

Hi Tomasz,


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tomasz Kulasek
> Sent: Friday, April 15, 2016 9:39 PM
> To: dev@dpdk.org
> Cc: Zhang, Helin; Ananyev, Konstantin
> Subject: [dpdk-dev] [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx
> 
> CID 13193 (#1 of 1): Bad bit shift operation (BAD_SHIFT)
> large_shift: In expression 1 << pool, left shifting by more than 31 bits has
> undefined behavior. The shift amount, pool, is at least 32.
> 
> This patch limits mask shift to be in range of 32 bit PFVFRE[1] register, for pool >
> 31.
> 
> Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")
> 
> Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx
  2016-04-15 13:39 [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx Tomasz Kulasek
  2016-04-18  1:57 ` Lu, Wenzhuo
@ 2016-04-21 13:51 ` Bruce Richardson
  2016-04-21 14:44   ` Kulasek, TomaszX
  2016-04-22 15:35 ` [PATCH v2] ixgbe: fix bad shift operation in ixgbe_set_pool_rx/tx Tomasz Kulasek
  2 siblings, 1 reply; 9+ messages in thread
From: Bruce Richardson @ 2016-04-21 13:51 UTC (permalink / raw)
  To: Tomasz Kulasek; +Cc: dev, helin.zhang, konstantin.ananyev

On Fri, Apr 15, 2016 at 03:39:09PM +0200, Tomasz Kulasek wrote:
> CID 13193 (#1 of 1): Bad bit shift operation (BAD_SHIFT)
> large_shift: In expression 1 << pool, left shifting by more than 31 bits
> has undefined behavior. The shift amount, pool, is at least 32.
> 
> This patch limits mask shift to be in range of 32 bit PFVFRE[1] register,
> for pool > 31.
> 
> Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")
> 
> Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 3f1ebc1..f676a64 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -4401,7 +4401,7 @@ ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
>  
>  	addr = IXGBE_VFRE(pool >= ETH_64_POOLS/2);
>  	reg = IXGBE_READ_REG(hw, addr);
> -	val = bit1 << pool;
> +	val = bit1 << (pool & 0x01F);
>  
Are we sure this is the correct way to fix this. Rather than silently truncating
the pool value, are we not better to check our input parameters and return
EINVAL to the caller if pool overflows?

/Bruce

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx
  2016-04-21 13:51 ` Bruce Richardson
@ 2016-04-21 14:44   ` Kulasek, TomaszX
  2016-04-21 15:28     ` Bruce Richardson
  0 siblings, 1 reply; 9+ messages in thread
From: Kulasek, TomaszX @ 2016-04-21 14:44 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev, Zhang, Helin, Ananyev, Konstantin



> -----Original Message-----
> From: Richardson, Bruce
> Sent: Thursday, April 21, 2016 15:52
> To: Kulasek, TomaszX <tomaszx.kulasek@intel.com>
> Cc: dev@dpdk.org; Zhang, Helin <helin.zhang@intel.com>; Ananyev,
> Konstantin <konstantin.ananyev@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix bad shift operation in
> ixgbe_set_pool_rx
> 
> On Fri, Apr 15, 2016 at 03:39:09PM +0200, Tomasz Kulasek wrote:
> > CID 13193 (#1 of 1): Bad bit shift operation (BAD_SHIFT)
> > large_shift: In expression 1 << pool, left shifting by more than 31
> > bits has undefined behavior. The shift amount, pool, is at least 32.
> >
> > This patch limits mask shift to be in range of 32 bit PFVFRE[1]
> > register, for pool > 31.
> >
> > Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")
> >
> > Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index 3f1ebc1..f676a64 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -4401,7 +4401,7 @@ ixgbe_set_pool_rx(struct rte_eth_dev *dev,
> > uint16_t pool, uint8_t on)
> >
> >  	addr = IXGBE_VFRE(pool >= ETH_64_POOLS/2);

For pool in 0..31 PFVFRE[0] is used, for pool in 32..63, PFVFRE[1], but for second case, we set/unset (pool-32) bit in the register. Invalid value if pool > 63, but catching it doesn't solve a problem of possible overflow for pool > 31.

> >  	reg = IXGBE_READ_REG(hw, addr);
> > -	val = bit1 << pool;

Previous implementation expects that for shift operation will be used rol on 32 bit value, and the bits that slide off the end of the register are fed back into the spaces, eg. (bit1 << 33) == (bit1 << 1).
Pool value can be bigger than 31, and this is not an error while pool is smaller than 64.

Truncating pool value is clearer for me, than relay on obscure shift operation.

> > +	val = bit1 << (pool & 0x01F);
> >
> Are we sure this is the correct way to fix this. Rather than silently
> truncating the pool value, are we not better to check our input parameters
> and return EINVAL to the caller if pool overflows?
> 
> /Bruce

Tomasz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx
  2016-04-21 14:44   ` Kulasek, TomaszX
@ 2016-04-21 15:28     ` Bruce Richardson
  2016-04-22 13:27       ` Kulasek, TomaszX
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Richardson @ 2016-04-21 15:28 UTC (permalink / raw)
  To: Kulasek, TomaszX; +Cc: dev, Zhang, Helin, Ananyev, Konstantin

On Thu, Apr 21, 2016 at 03:44:03PM +0100, Kulasek, TomaszX wrote:
> 
> 
> > -----Original Message-----
> > From: Richardson, Bruce
> > Sent: Thursday, April 21, 2016 15:52
> > To: Kulasek, TomaszX <tomaszx.kulasek@intel.com>
> > Cc: dev@dpdk.org; Zhang, Helin <helin.zhang@intel.com>; Ananyev,
> > Konstantin <konstantin.ananyev@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix bad shift operation in
> > ixgbe_set_pool_rx
> > 
> > On Fri, Apr 15, 2016 at 03:39:09PM +0200, Tomasz Kulasek wrote:
> > > CID 13193 (#1 of 1): Bad bit shift operation (BAD_SHIFT)
> > > large_shift: In expression 1 << pool, left shifting by more than 31
> > > bits has undefined behavior. The shift amount, pool, is at least 32.
> > >
> > > This patch limits mask shift to be in range of 32 bit PFVFRE[1]
> > > register, for pool > 31.
> > >
> > > Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")
> > >
> > > Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
> > > ---
> > >  drivers/net/ixgbe/ixgbe_ethdev.c |    2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > index 3f1ebc1..f676a64 100644
> > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > @@ -4401,7 +4401,7 @@ ixgbe_set_pool_rx(struct rte_eth_dev *dev,
> > > uint16_t pool, uint8_t on)
> > >
> > >  	addr = IXGBE_VFRE(pool >= ETH_64_POOLS/2);
> 
> For pool in 0..31 PFVFRE[0] is used, for pool in 32..63, PFVFRE[1], but for second case, we set/unset (pool-32) bit in the register. Invalid value if pool > 63, but catching it doesn't solve a problem of possible overflow for pool > 31.
> 
> > >  	reg = IXGBE_READ_REG(hw, addr);
> > > -	val = bit1 << pool;
> 
> Previous implementation expects that for shift operation will be used rol on 32 bit value, and the bits that slide off the end of the register are fed back into the spaces, eg. (bit1 << 33) == (bit1 << 1).
> Pool value can be bigger than 31, and this is not an error while pool is smaller than 64.
> 
> Truncating pool value is clearer for me, than relay on obscure shift operation.
>
Thanks for the explanation, that indeed does make it clearer.

However, all that detail is completely unclear to the reader of the function, so
perhaps we can clean up the code to make it more explicit what is happening.
For example:

        /* for pool >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
        if (pool >= ETH_64_POOLS)
                 return -EINVAL;
        else if (pool >= ETH_64_POOLS/2) {
                 addr = IXGBE_VFRE(1);
                 val = bit1 << (pool - 32);
        } else {
                addr = IXGBE_VFRE(0);
                val = bit1 << pool;
        }

        reg = IXGBE_READ_REG(hw, addr);

This should fix the issue and make the resulting code clearer, I think.

/Bruce

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx
  2016-04-21 15:28     ` Bruce Richardson
@ 2016-04-22 13:27       ` Kulasek, TomaszX
  0 siblings, 0 replies; 9+ messages in thread
From: Kulasek, TomaszX @ 2016-04-22 13:27 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev, Zhang, Helin, Ananyev, Konstantin



> -----Original Message-----
> From: Richardson, Bruce
> Sent: Thursday, April 21, 2016 17:28
> To: Kulasek, TomaszX <tomaszx.kulasek@intel.com>
> Cc: dev@dpdk.org; Zhang, Helin <helin.zhang@intel.com>; Ananyev,
> Konstantin <konstantin.ananyev@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix bad shift operation in
> ixgbe_set_pool_rx
> 
> On Thu, Apr 21, 2016 at 03:44:03PM +0100, Kulasek, TomaszX wrote:
> >
> >
> > > -----Original Message-----
> > > From: Richardson, Bruce
> > > Sent: Thursday, April 21, 2016 15:52
> > > To: Kulasek, TomaszX <tomaszx.kulasek@intel.com>
> > > Cc: dev@dpdk.org; Zhang, Helin <helin.zhang@intel.com>; Ananyev,
> > > Konstantin <konstantin.ananyev@intel.com>
> > > Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix bad shift operation in
> > > ixgbe_set_pool_rx
> > >
> > > On Fri, Apr 15, 2016 at 03:39:09PM +0200, Tomasz Kulasek wrote:
> > > > CID 13193 (#1 of 1): Bad bit shift operation (BAD_SHIFT)
> > > > large_shift: In expression 1 << pool, left shifting by more than
> > > > 31 bits has undefined behavior. The shift amount, pool, is at least
> 32.
> > > >
> > > > This patch limits mask shift to be in range of 32 bit PFVFRE[1]
> > > > register, for pool > 31.
> > > >
> > > > Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")
> > > >
> > > > Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
> > > > ---
> > > >  drivers/net/ixgbe/ixgbe_ethdev.c |    2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > > index 3f1ebc1..f676a64 100644
> > > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > > @@ -4401,7 +4401,7 @@ ixgbe_set_pool_rx(struct rte_eth_dev *dev,
> > > > uint16_t pool, uint8_t on)
> > > >
> > > >  	addr = IXGBE_VFRE(pool >= ETH_64_POOLS/2);
> >
> > For pool in 0..31 PFVFRE[0] is used, for pool in 32..63, PFVFRE[1], but
> for second case, we set/unset (pool-32) bit in the register. Invalid value
> if pool > 63, but catching it doesn't solve a problem of possible overflow
> for pool > 31.
> >
> > > >  	reg = IXGBE_READ_REG(hw, addr);
> > > > -	val = bit1 << pool;
> >
> > Previous implementation expects that for shift operation will be used
> rol on 32 bit value, and the bits that slide off the end of the register
> are fed back into the spaces, eg. (bit1 << 33) == (bit1 << 1).
> > Pool value can be bigger than 31, and this is not an error while pool is
> smaller than 64.
> >
> > Truncating pool value is clearer for me, than relay on obscure shift
> operation.
> >
> Thanks for the explanation, that indeed does make it clearer.
> 
> However, all that detail is completely unclear to the reader of the
> function, so perhaps we can clean up the code to make it more explicit
> what is happening.
> For example:
> 
>         /* for pool >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
>         if (pool >= ETH_64_POOLS)
>                  return -EINVAL;
>         else if (pool >= ETH_64_POOLS/2) {
>                  addr = IXGBE_VFRE(1);
>                  val = bit1 << (pool - 32);
>         } else {
>                 addr = IXGBE_VFRE(0);
>                 val = bit1 << pool;
>         }
> 
>         reg = IXGBE_READ_REG(hw, addr);
> 
> This should fix the issue and make the resulting code clearer, I think.
> 
> /Bruce

Yes, I got it. I will send v2.

Tomasz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] ixgbe: fix bad shift operation in ixgbe_set_pool_rx/tx
  2016-04-15 13:39 [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx Tomasz Kulasek
  2016-04-18  1:57 ` Lu, Wenzhuo
  2016-04-21 13:51 ` Bruce Richardson
@ 2016-04-22 15:35 ` Tomasz Kulasek
  2016-04-25 10:35   ` Bruce Richardson
  2 siblings, 1 reply; 9+ messages in thread
From: Tomasz Kulasek @ 2016-04-22 15:35 UTC (permalink / raw)
  To: wenzhuo.lu, helin.zhang, konstantin.ananyev, bruce.richardson; +Cc: dev

Fix issue reported by Coverity.

Coverity ID 13193: Bad bit shift operation (BAD_SHIFT)
large_shift: In expression 1 << pool, left shifting by more than 31 bits
has undefined behavior. The shift amount, pool, is at least 32.

This patch is a rework of register addr selection logic and mask
computation to made it more readable and avoid bit overflow when 32 bit
value is shifted over its size for pool > 31.

Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
---
v2:
 - joined two patches for same issue in tx/rx
 - added pool parameter checking for invalid value
 - reworked register selection logic and mask shift in more explicit way

 drivers/net/ixgbe/ixgbe_ethdev.c |   28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3f1ebc1..eed2662 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4399,9 +4399,19 @@ ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
 	if (ixgbe_vmdq_mode_check(hw) < 0)
 		return -ENOTSUP;
 
-	addr = IXGBE_VFRE(pool >= ETH_64_POOLS/2);
+	if (pool >= ETH_64_POOLS)
+		return -EINVAL;
+
+	/* for pool >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
+	if (pool >= 32) {
+		addr = IXGBE_VFRE(1);
+		val = bit1 << (pool - 32);
+	} else {
+		addr = IXGBE_VFRE(0);
+		val = bit1 << pool;
+	}
+
 	reg = IXGBE_READ_REG(hw, addr);
-	val = bit1 << pool;
 
 	if (on)
 		reg |= val;
@@ -4426,9 +4436,19 @@ ixgbe_set_pool_tx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
 	if (ixgbe_vmdq_mode_check(hw) < 0)
 		return -ENOTSUP;
 
-	addr = IXGBE_VFTE(pool >= ETH_64_POOLS/2);
+	if (pool >= ETH_64_POOLS)
+		return -EINVAL;
+
+	/* for pool >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
+	if (pool >= 32) {
+		addr = IXGBE_VFTE(1);
+		val = bit1 << (pool - 32);
+	} else {
+		addr = IXGBE_VFTE(0);
+		val = bit1 << pool;
+	}
+
 	reg = IXGBE_READ_REG(hw, addr);
-	val = bit1 << pool;
 
 	if (on)
 		reg |= val;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] ixgbe: fix bad shift operation in ixgbe_set_pool_rx/tx
  2016-04-22 15:35 ` [PATCH v2] ixgbe: fix bad shift operation in ixgbe_set_pool_rx/tx Tomasz Kulasek
@ 2016-04-25 10:35   ` Bruce Richardson
  2016-04-25 10:38     ` Bruce Richardson
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Richardson @ 2016-04-25 10:35 UTC (permalink / raw)
  To: Tomasz Kulasek; +Cc: wenzhuo.lu, helin.zhang, konstantin.ananyev, dev

On Fri, Apr 22, 2016 at 05:35:57PM +0200, Tomasz Kulasek wrote:
> Fix issue reported by Coverity.
> 
> Coverity ID 13193: Bad bit shift operation (BAD_SHIFT)
> large_shift: In expression 1 << pool, left shifting by more than 31 bits
> has undefined behavior. The shift amount, pool, is at least 32.
> 
> This patch is a rework of register addr selection logic and mask
> computation to made it more readable and avoid bit overflow when 32 bit
> value is shifted over its size for pool > 31.
> 
> Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")
> 
> Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] ixgbe: fix bad shift operation in ixgbe_set_pool_rx/tx
  2016-04-25 10:35   ` Bruce Richardson
@ 2016-04-25 10:38     ` Bruce Richardson
  0 siblings, 0 replies; 9+ messages in thread
From: Bruce Richardson @ 2016-04-25 10:38 UTC (permalink / raw)
  To: Tomasz Kulasek; +Cc: wenzhuo.lu, helin.zhang, konstantin.ananyev, dev

On Mon, Apr 25, 2016 at 11:35:44AM +0100, Bruce Richardson wrote:
> On Fri, Apr 22, 2016 at 05:35:57PM +0200, Tomasz Kulasek wrote:
> > Fix issue reported by Coverity.
> > 
> > Coverity ID 13193: Bad bit shift operation (BAD_SHIFT)
> > large_shift: In expression 1 << pool, left shifting by more than 31 bits
> > has undefined behavior. The shift amount, pool, is at least 32.
> > 
> > This patch is a rework of register addr selection logic and mask
> > computation to made it more readable and avoid bit overflow when 32 bit
> > value is shifted over its size for pool > 31.
> > 
> > Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")
> > 
> > Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
Applied to dpdk-next-net/rel_16_07

/Bruce

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-25 10:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-15 13:39 [PATCH] ixgbe: fix bad shift operation in ixgbe_set_pool_rx Tomasz Kulasek
2016-04-18  1:57 ` Lu, Wenzhuo
2016-04-21 13:51 ` Bruce Richardson
2016-04-21 14:44   ` Kulasek, TomaszX
2016-04-21 15:28     ` Bruce Richardson
2016-04-22 13:27       ` Kulasek, TomaszX
2016-04-22 15:35 ` [PATCH v2] ixgbe: fix bad shift operation in ixgbe_set_pool_rx/tx Tomasz Kulasek
2016-04-25 10:35   ` Bruce Richardson
2016-04-25 10:38     ` Bruce Richardson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.