DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Ferruh Yigit'" <ferruh.yigit@xilinx.com>
Cc: <stable@dpdk.org>, <dev@dpdk.org>
Subject: RE: [PATCH 3/7] net/txgbe: fix register polling
Date: Wed, 22 Jun 2022 10:44:08 +0800	[thread overview]
Message-ID: <00c401d885e1$f2b8c200$d82a4600$@trustnetic.com> (raw)
In-Reply-To: <8d89c0b2-f9cb-e3e5-72e1-736f655ab5c3@xilinx.com>

On Tuesday, June 21, 2022 8:19 PM, Ferruh Yigit wrote:
> On 6/20/2022 8:55 AM, Jiawen Wu wrote:
> > Fix to poll some specific registers, which expect bit 0.
> >
> > Fixes: 24a4c76aff4d ("net/txgbe: add error types and registers")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> > ---
> >   drivers/net/txgbe/base/txgbe_regs.h | 11 ++++++++---
> >   1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/txgbe/base/txgbe_regs.h
> > b/drivers/net/txgbe/base/txgbe_regs.h
> > index 3139796911..911bb6e04e 100644
> > --- a/drivers/net/txgbe/base/txgbe_regs.h
> > +++ b/drivers/net/txgbe/base/txgbe_regs.h
> > @@ -1864,8 +1864,13 @@ po32m(struct txgbe_hw *hw, u32 reg, u32 mask,
> u32 expect, u32 *actual,
> >   	}
> >
> >   	do {
> > -		all |= rd32(hw, reg);
> > -		value |= mask & all;
> > +		if (expect != 0) {
> > +			all |= rd32(hw, reg);
> > +			value |= mask & all;
> > +		} else {
> > +			all = rd32(hw, reg);
> > +			value = mask & all;
> > +		}
> >   		if (value == expect)
> >   			break;
> >
> > @@ -1898,7 +1903,7 @@ po32m(struct txgbe_hw *hw, u32 reg, u32 mask,
> > u32 expect, u32 *actual,
> >
> >   #define wr32w(hw, reg, val, mask, slice) do { \
> >   	wr32((hw), reg, val); \
> > -	po32m((hw), reg, mask, mask, NULL, 5, slice); \
> > +	po32m((hw), reg, mask, 0, NULL, 5, slice); \
> 
> Just to double check, is this change intentional, to always expect reading '0'
> from registers after writing to them?
> 
> Perhaps you can explain a little more about this polling after read/write logic
> and what was wrong in the commit log.
> 

This is exactly what register expects. 'wr32w' is used for IPsec Rx Index register.
For this register, when write command bit set, the content of register affected, and immediately self cleared by hardware.
So it always expect reading '0' from register mask 'TXGBE_IPSRXIDX_WRITE'.

> >   } while (0)
> >
> >   #define TXGBE_XPCS_IDAADDR    0x13000





  reply	other threads:[~2022-06-22  2:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20  7:55 [PATCH 0/7] Fixes and supports for Wangxun NICs Jiawen Wu
2022-06-20  7:55 ` [PATCH 1/7] net/txgbe: support OEM subsystem vendor ID Jiawen Wu
2022-06-21 12:19   ` Ferruh Yigit
2022-06-20  7:55 ` [PATCH 2/7] net/ngbe: " Jiawen Wu
2022-06-21 12:19   ` Ferruh Yigit
2022-06-20  7:55 ` [PATCH 3/7] net/txgbe: fix register polling Jiawen Wu
2022-06-21 12:19   ` Ferruh Yigit
2022-06-22  2:44     ` Jiawen Wu [this message]
2022-06-20  7:55 ` [PATCH 4/7] net/ngbe: add more packet statistics Jiawen Wu
2022-06-20  7:55 ` [PATCH 5/7] net/ngbe: fix YT PHY UTP mode to link up Jiawen Wu
2022-06-20  7:55 ` [PATCH 6/7] net/ngbe: support autoneg on/off for external PHY SFI mode Jiawen Wu
2022-06-20  7:55 ` [PATCH 7/7] net/ngbe: support YT PHY SGMII to RGMII mode Jiawen Wu
2022-06-21 12:20 ` [PATCH 0/7] Fixes and supports for Wangxun NICs Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00c401d885e1$f2b8c200$d82a4600$@trustnetic.com' \
    --to=jiawenwu@trustnetic.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).