From: Simon Horman <simon.horman@corigine.com>
To: Pranavi Somisetty <pranavi.somisetty@amd.com>
Cc: nicolas.ferre@microchip.com, claudiu.beznea@microchip.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, richardcochran@gmail.com,
linux@armlinux.org.uk, palmer@dabbelt.com, git@amd.com,
michal.simek@amd.com, harini.katakam@amd.com,
radhey.shyam.pandey@amd.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH net-next v2 2/2] net: macb: Add support for partial store and forward
Date: Thu, 11 May 2023 15:08:45 +0200 [thread overview]
Message-ID: <ZFzo3X1L3JRa98HK@corigine.com> (raw)
In-Reply-To: <20230511071214.18611-3-pranavi.somisetty@amd.com>
On Thu, May 11, 2023 at 01:12:14AM -0600, Pranavi Somisetty wrote:
> When the receive partial store and forward mode is activated, the
> receiver will only begin to forward the packet to the external AHB
> or AXI slave when enough packet data is stored in the packet buffer.
> The amount of packet data required to activate the forwarding process
> is programmable via watermark registers which are located at the same
> address as the partial store and forward enable bits. Adding support to
> read this rx-watermark value from device-tree, to program the watermark
> registers and enable partial store and forwarding.
>
> Signed-off-by: Maulik Jodhani <maulik.jodhani@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> Signed-off-by: Pranavi Somisetty <pranavi.somisetty@amd.com>
> ---
> Changes v2:
>
> 1. Removed all the changes related to validating FCS when Rx checksum offload is disabled.
> 2. Instead of using a platform dependent number (0xFFF) for the reset value of rx watermark,
> derive it from designcfg_debug2 register.
> 3. Added a check to see if partial s/f is supported, by reading the
> designcfg_debug6 register.
> ---
> drivers/net/ethernet/cadence/macb.h | 14 +++++++
> drivers/net/ethernet/cadence/macb_main.c | 49 +++++++++++++++++++++++-
> 2 files changed, 61 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
> index 14dfec4db8f9..46833662094d 100644
> --- a/drivers/net/ethernet/cadence/macb.h
> +++ b/drivers/net/ethernet/cadence/macb.h
> @@ -82,6 +82,7 @@
> #define GEM_NCFGR 0x0004 /* Network Config */
> #define GEM_USRIO 0x000c /* User IO */
> #define GEM_DMACFG 0x0010 /* DMA Configuration */
> +#define GEM_PBUFRXCUT 0x0044 /* RX Partial Store and Forward */
> #define GEM_JML 0x0048 /* Jumbo Max Length */
> #define GEM_HS_MAC_CONFIG 0x0050 /* GEM high speed config */
> #define GEM_HRB 0x0080 /* Hash Bottom */
> @@ -343,6 +344,11 @@
> #define GEM_ADDR64_SIZE 1
>
>
> +/* Bitfields in PBUFRXCUT */
> +#define GEM_WTRMRK_OFFSET 0 /* Watermark value offset */
> +#define GEM_ENCUTTHRU_OFFSET 31 /* Enable RX partial store and forward */
> +#define GEM_ENCUTTHRU_SIZE 1
> +
> /* Bitfields in NSR */
> #define MACB_NSR_LINK_OFFSET 0 /* pcs_link_state */
> #define MACB_NSR_LINK_SIZE 1
> @@ -509,6 +515,8 @@
> #define GEM_TX_PKT_BUFF_OFFSET 21
> #define GEM_TX_PKT_BUFF_SIZE 1
>
> +#define GEM_RX_PBUF_ADDR_OFFSET 22
> +#define GEM_RX_PBUF_ADDR_SIZE 4
>
> /* Bitfields in DCFG5. */
> #define GEM_TSU_OFFSET 8
> @@ -517,6 +525,8 @@
> /* Bitfields in DCFG6. */
> #define GEM_PBUF_LSO_OFFSET 27
> #define GEM_PBUF_LSO_SIZE 1
> +#define GEM_PBUF_CUTTHRU_OFFSET 26
> +#define GEM_PBUF_CUTTHRU_SIZE 1
> #define GEM_DAW64_OFFSET 23
> #define GEM_DAW64_SIZE 1
>
> @@ -718,6 +728,7 @@
> #define MACB_CAPS_NEEDS_RSTONUBR 0x00000100
> #define MACB_CAPS_MIIONRGMII 0x00000200
> #define MACB_CAPS_NEED_TSUCLK 0x00000400
> +#define MACB_CAPS_PARTIAL_STORE_FORWARD 0x00000800
> #define MACB_CAPS_PCS 0x01000000
> #define MACB_CAPS_HIGH_SPEED 0x02000000
> #define MACB_CAPS_CLK_HW_CHG 0x04000000
> @@ -1283,6 +1294,9 @@ struct macb {
>
> u32 wol;
>
> + /* holds value of rx watermark value for pbuf_rxcutthru register */
> + u16 rx_watermark;
> +
> struct macb_ptp_info *ptp_info; /* macb-ptp interface */
>
> struct phy *sgmii_phy; /* for ZynqMP SGMII mode */
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 41964fd02452..07b9964e7aa3 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -2600,6 +2600,7 @@ static void macb_init_rings(struct macb *bp)
> static void macb_reset_hw(struct macb *bp)
> {
> struct macb_queue *queue;
> + u16 watermark_reset_value;
> unsigned int q;
> u32 ctrl = macb_readl(bp, NCR);
Given the review of Conor Dooley of both patches in this series I think
there will be a v3.
Please consider adjusting the hunk above to move towards rather than
away from reverse xmas tree - longest line to shortest - for local
variable names.
That would be:
u16 watermark_reset_value;
struct macb_queue *queue;
...
pw-bot: cr
next prev parent reply other threads:[~2023-05-11 13:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 7:12 [PATCH net-next v2 0/2] Add support for partial store and forward Pranavi Somisetty
2023-05-11 7:12 ` [PATCH net-next v2 1/2] dt-bindings: net: cdns,macb: Add rx-watermark property Pranavi Somisetty
2023-05-11 7:25 ` Conor Dooley
2023-05-11 22:29 ` Conor Dooley
2023-05-11 14:03 ` Krzysztof Kozlowski
2023-05-11 15:41 ` Andrew Lunn
2023-05-11 7:12 ` [PATCH net-next v2 2/2] net: macb: Add support for partial store and forward Pranavi Somisetty
2023-05-11 7:28 ` Conor Dooley
2023-05-11 13:08 ` Simon Horman [this message]
2023-05-11 15:49 ` Andrew Lunn
2023-05-12 7:57 ` Claudiu.Beznea
2023-05-12 11:53 ` Somisetty, Pranavi
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=ZFzo3X1L3JRa98HK@corigine.com \
--to=simon.horman@corigine.com \
--cc=claudiu.beznea@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=git@amd.com \
--cc=harini.katakam@amd.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=michal.simek@amd.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
--cc=palmer@dabbelt.com \
--cc=pranavi.somisetty@amd.com \
--cc=radhey.shyam.pandey@amd.com \
--cc=richardcochran@gmail.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).