netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, edumazet@google.com,
	linux-kernel@vger.kernel.org, bryan.whitehead@microchip.com,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net] net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips
Date: Fri, 8 Mar 2024 19:27:35 +0000	[thread overview]
Message-ID: <20240308192735.GA603911@kernel.org> (raw)
In-Reply-To: <20240307085823.403831-1-Raju.Lakkaraju@microchip.com>

On Thu, Mar 07, 2024 at 02:28:23PM +0530, Raju Lakkaraju wrote:
> The RFE (Receive Filtering Engine) read fifo threshold hardware default should
> be overwritten to 3 for PCI1x1x Rev B0 devices to prevent lockup during some
> stress tests using frames that include VLAN tags.
> Rev C0 and later hardware already defaults to 3.
> 
> Fixes: bb4f6bffe33c ("net: lan743x: Add PCI11010 / PCI11414 device IDs")
> Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
> ---
>  drivers/net/ethernet/microchip/lan743x_main.c | 17 +++++++++++++++++
>  drivers/net/ethernet/microchip/lan743x_main.h |  5 +++++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index 45e209a7d083..aec2d100ab87 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -3272,6 +3272,22 @@ static void lan743x_full_cleanup(struct lan743x_adapter *adapter)
>  	lan743x_pci_cleanup(adapter);
>  }
>  
> +static int pci11x1x_set_rfe_rd_fifo_threshold(struct lan743x_adapter *adapter)
> +{
> +	u16 rev = adapter->csr.id_rev & ID_REV_CHIP_REV_MASK_;
> +
> +	if (rev == ID_REV_CHIP_REV_PCI11X1X_B0_) {
> +		int misc_ctl;
> +
> +		misc_ctl = lan743x_csr_read(adapter, MISC_CTL_0);
> +		misc_ctl &= ~MISC_CTL_0_RFE_READ_FIFO_MASK_;
> +		misc_ctl |= (0x3 << MISC_CTL_0_RFE_READ_FIFO_SHIFT_);
> +		lan743x_csr_write(adapter, MISC_CTL_0, misc_ctl);

Hi Raju,

Some minor nits from my side:

- misc_ctl could be an unsigned integer
- The above could probably use FIELD_PREP, which in turn
  probably means that MISC_CTL_0_RFE_READ_FIFO_SHIFT_ isn't needed
- 0x3 could be a #define - what does it mean?

> +	}
> +
> +	return 0;
> +}
> +
>  static int lan743x_hardware_init(struct lan743x_adapter *adapter,
>  				 struct pci_dev *pdev)
>  {

...

  reply	other threads:[~2024-03-08 19:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  8:58 [PATCH net] net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips Raju Lakkaraju
2024-03-08 19:27 ` Simon Horman [this message]
2024-03-18  6:50   ` Raju.Lakkaraju

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=20240308192735.GA603911@kernel.org \
    --to=horms@kernel.org \
    --cc=Raju.Lakkaraju@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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).