* [dpdk-dev] [PATCH v1 1/1] ixgbe: fix queue stop
@ 2016-04-14 9:59 Piotr Azarewicz
2016-04-15 1:31 ` Lu, Wenzhuo
0 siblings, 1 reply; 3+ messages in thread
From: Piotr Azarewicz @ 2016-04-14 9:59 UTC (permalink / raw)
To: helin.zhang, konstantin.ananyev; +Cc: dev, Piotr Azarewicz
It should be checked if queue enable bit is clear.
CID 13215 : Wrong operator used (CONSTANT_EXPRESSION_RESULT)
operator_confusion: txdctl | 33554432 is always 1/true regardless of the
values of its operand. This occurs as the logical second operand of
'&&'.
CID 13216 : Wrong operator used (CONSTANT_EXPRESSION_RESULT)
operator_confusion: rxdctl | 33554432 is always 1/true regardless of the
values of its operand. This occurs as the logical second operand of
'&&'.
Coverity issue: 13215
Coverity issue: 13216
Fixes: 029fd06d40fa ("ixgbe: queue start and stop")
Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
---
drivers/net/ixgbe/ixgbe_rxtx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 9fb38a6..8483e51 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -4813,12 +4813,12 @@ ixgbe_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
rxdctl &= ~IXGBE_RXDCTL_ENABLE;
IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxq->reg_idx), rxdctl);
- /* Wait until RX Enable ready */
+ /* Wait until RX Enable bit clear */
poll_ms = RTE_IXGBE_REGISTER_POLL_WAIT_10_MS;
do {
rte_delay_ms(1);
rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxq->reg_idx));
- } while (--poll_ms && (rxdctl | IXGBE_RXDCTL_ENABLE));
+ } while (--poll_ms && (rxdctl & IXGBE_RXDCTL_ENABLE));
if (!poll_ms)
PMD_INIT_LOG(ERR, "Could not disable Rx Queue %d",
rx_queue_id);
@@ -4914,14 +4914,14 @@ ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
txdctl &= ~IXGBE_TXDCTL_ENABLE;
IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txq->reg_idx), txdctl);
- /* Wait until TX Enable ready */
+ /* Wait until TX Enable bit clear */
if (hw->mac.type == ixgbe_mac_82599EB) {
poll_ms = RTE_IXGBE_REGISTER_POLL_WAIT_10_MS;
do {
rte_delay_ms(1);
txdctl = IXGBE_READ_REG(hw,
IXGBE_TXDCTL(txq->reg_idx));
- } while (--poll_ms && (txdctl | IXGBE_TXDCTL_ENABLE));
+ } while (--poll_ms && (txdctl & IXGBE_TXDCTL_ENABLE));
if (!poll_ms)
PMD_INIT_LOG(ERR, "Could not disable "
"Tx Queue %d", tx_queue_id);
--
1.7.9.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/1] ixgbe: fix queue stop
2016-04-14 9:59 [dpdk-dev] [PATCH v1 1/1] ixgbe: fix queue stop Piotr Azarewicz
@ 2016-04-15 1:31 ` Lu, Wenzhuo
2016-04-21 14:05 ` Bruce Richardson
0 siblings, 1 reply; 3+ messages in thread
From: Lu, Wenzhuo @ 2016-04-15 1:31 UTC (permalink / raw)
To: Azarewicz, PiotrX T, Zhang, Helin, Ananyev, Konstantin
Cc: dev, Azarewicz, PiotrX T
Hi,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Piotr Azarewicz
> Sent: Thursday, April 14, 2016 6:00 PM
> To: Zhang, Helin; Ananyev, Konstantin
> Cc: dev@dpdk.org; Azarewicz, PiotrX T
> Subject: [dpdk-dev] [PATCH v1 1/1] ixgbe: fix queue stop
>
> It should be checked if queue enable bit is clear.
>
> CID 13215 : Wrong operator used (CONSTANT_EXPRESSION_RESULT)
> operator_confusion: txdctl | 33554432 is always 1/true regardless of the values
> of its operand. This occurs as the logical second operand of '&&'.
>
> CID 13216 : Wrong operator used (CONSTANT_EXPRESSION_RESULT)
> operator_confusion: rxdctl | 33554432 is always 1/true regardless of the values
> of its operand. This occurs as the logical second operand of '&&'.
>
> Coverity issue: 13215
> Coverity issue: 13216
> Fixes: 029fd06d40fa ("ixgbe: queue start and stop")
>
> Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Sometimes machine is smarter than human :) Thanks Piotr for handling this.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/1] ixgbe: fix queue stop
2016-04-15 1:31 ` Lu, Wenzhuo
@ 2016-04-21 14:05 ` Bruce Richardson
0 siblings, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2016-04-21 14:05 UTC (permalink / raw)
To: Lu, Wenzhuo; +Cc: Azarewicz, PiotrX T, Zhang, Helin, Ananyev, Konstantin, dev
On Fri, Apr 15, 2016 at 01:31:03AM +0000, Lu, Wenzhuo wrote:
> Hi,
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Piotr Azarewicz
> > Sent: Thursday, April 14, 2016 6:00 PM
> > To: Zhang, Helin; Ananyev, Konstantin
> > Cc: dev@dpdk.org; Azarewicz, PiotrX T
> > Subject: [dpdk-dev] [PATCH v1 1/1] ixgbe: fix queue stop
> >
> > It should be checked if queue enable bit is clear.
> >
> > CID 13215 : Wrong operator used (CONSTANT_EXPRESSION_RESULT)
> > operator_confusion: txdctl | 33554432 is always 1/true regardless of the values
> > of its operand. This occurs as the logical second operand of '&&'.
> >
> > CID 13216 : Wrong operator used (CONSTANT_EXPRESSION_RESULT)
> > operator_confusion: rxdctl | 33554432 is always 1/true regardless of the values
> > of its operand. This occurs as the logical second operand of '&&'.
> >
> > Coverity issue: 13215
> > Coverity issue: 13216
> > Fixes: 029fd06d40fa ("ixgbe: queue start and stop")
> >
> > Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Sometimes machine is smarter than human :) Thanks Piotr for handling this.
Applied to dpdk-next-net/rel_16_07
/Bruce
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-21 14:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14 9:59 [dpdk-dev] [PATCH v1 1/1] ixgbe: fix queue stop Piotr Azarewicz
2016-04-15 1:31 ` Lu, Wenzhuo
2016-04-21 14:05 ` Bruce Richardson
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).