dpaa_eth: buffer layout fixes
Subsystems (3)
v3 cover dpaa_eth: buffer layout fixes
The patches are related to the software workaround for the A050385 erratum. The first patch ensures optimal buffer usage for non-erratum scenarios. The second patch fixes a currently inconsequential discrepancy between the FMan and Ethernet drivers.
Changes in v3:
- refactor defines for clarity in 1/2
- add more details on the user impact in 1/2
- remove unnecessary inline identifier in 2/2
Changes in v2:
- make the returned value for TX ports explicit in 2/2
- simplify the buf_layout reference in 2/2
Camelia Groza (2):
dpaa_eth: update the buffer layout for non-A050385 erratum scenarios
dpaa_eth: fix the RX headroom size alignment
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 28 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-)
--
1.9.1
PATCH v3 1/2 dpaa_eth: update the buffer layout for non-A050385 erratum scenarios
Impose a larger RX private data area only when the A050385 erratum is present on the hardware. A smaller buffer size is sufficient in all other scenarios. This enables a wider range of linear Jumbo frame sizes in non-erratum scenarios, instead of turning to multi buffer Scatter/Gather frames. The maximum linear frame size is increased by 128 bytes for non-erratum arm64 platforms.
Cleanup the hardware annotations header defines in the process.
---
Changes in v3:
- refactor defines for clarity
- add more details on the user impact
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +10 -6
@@ -174,12 +174,17 @@#define DPAA_PARSE_RESULTS_SIZE sizeof(struct fman_prs_result)#define DPAA_TIME_STAMP_SIZE 8#define DPAA_HASH_RESULTS_SIZE 8 +#define DPAA_HWA_SIZE (DPAA_PARSE_RESULTS_SIZE + DPAA_TIME_STAMP_SIZE \ + + DPAA_HASH_RESULTS_SIZE) +#define DPAA_RX_PRIV_DATA_DEFAULT_SIZE (DPAA_TX_PRIV_DATA_SIZE + \ + dpaa_rx_extra_headroom)#ifdef CONFIG_DPAA_ERRATUM_A050385 -#define DPAA_RX_PRIV_DATA_SIZE (DPAA_A050385_ALIGN - (DPAA_PARSE_RESULTS_SIZE\ - + DPAA_TIME_STAMP_SIZE + DPAA_HASH_RESULTS_SIZE)) +#define DPAA_RX_PRIV_DATA_A050385_SIZE (DPAA_A050385_ALIGN - DPAA_HWA_SIZE) +#define DPAA_RX_PRIV_DATA_SIZE (fman_has_errata_a050385() ? \ + DPAA_RX_PRIV_DATA_A050385_SIZE : \ + DPAA_RX_PRIV_DATA_DEFAULT_SIZE)#else -#define DPAA_RX_PRIV_DATA_SIZE (u16)(DPAA_TX_PRIV_DATA_SIZE + \ - dpaa_rx_extra_headroom) +#define DPAA_RX_PRIV_DATA_SIZE DPAA_RX_PRIV_DATA_DEFAULT_SIZE#endif #define DPAA_ETH_PCD_RXQ_NUM 128
@@ -2854,8 +2859,7 @@ static inline u16 dpaa_get_headroom(struct dpaa_buffer_layout *bl)* * Also make sure the headroom is a multiple of data_align bytes */ - headroom = (u16)(bl->priv_data_size +DPAA_PARSE_RESULTS_SIZE + -DPAA_TIME_STAMP_SIZE +DPAA_HASH_RESULTS_SIZE ); + headroom = (u16)(bl->priv_data_size +DPAA_HWA_SIZE );return ALIGN (headroom,DPAA_FD_DATA_ALIGNMENT ); }
--
1.9.1
PATCH v3 2/2 dpaa_eth: fix the RX headroom size alignment
In reply to Camelia GrozaThe headroom reserved for received frames needs to be aligned to an RX specific value. There is currently a discrepancy between the values used in the Ethernet driver and the values passed to the FMan. Coincidentally, the resulting aligned values are identical.
---
Changes in v3:
- remove the unnecessary inline identifier
Changes in v2:
- make the returned value for TX ports explicit
- simplify the buf_layout reference
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +9 -5
@@ -2845,7 +2845,8 @@ static int dpaa_ingress_cgr_init(struct dpaa_priv *priv)return err; } -static inline u16 dpaa_get_headroom (struct dpaa_buffer_layout *bl) +static u16 dpaa_get_headroom (struct dpaa_buffer_layout *bl, +enum port_type port) {u16 headroom;
@@ -2859,9 +2860,12 @@ static inline u16 dpaa_get_headroom(struct dpaa_buffer_layout *bl)* * Also make sure the headroom is a multiple of data_align bytes */ - headroom = (u16)(bl->priv_data_size +DPAA_HWA_SIZE ); + headroom = (u16)(bl[port].priv_data_size +DPAA_HWA_SIZE ); -return ALIGN (headroom,DPAA_FD_DATA_ALIGNMENT ); +if (port ==RX ) +return ALIGN (headroom,DPAA_FD_RX_DATA_ALIGNMENT ); +else +return ALIGN (headroom,DPAA_FD_DATA_ALIGNMENT ); }static int dpaa_eth_probe (struct platform_device *pdev)
@@ -3029,8 +3033,8 @@ static int dpaa_eth_probe(struct platform_device *pdev) goto free_dpaa_fqs; } - priv->tx_headroom =dpaa_get_headroom (&priv->buf_layout[TX ]); - priv->rx_headroom =dpaa_get_headroom (&priv->buf_layout[RX ]); + priv->tx_headroom =dpaa_get_headroom (priv->buf_layout,TX ); + priv->rx_headroom =dpaa_get_headroom (priv->buf_layout,RX );/* All real interfaces need their ports initialized */ err = dpaa_eth_init_ports(mac_dev, dpaa_bp, &port_fqs,
--
1.9.1
Quoted 27 lines
-----Original Message-----
From: Camelia Groza <[email protected]>
Sent: 02 November 2020 20:35
To: [email protected]; Madalin Bucur (OSS) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Camelia Alexandra Groza <[email protected]>
Subject: [PATCH net v3 0/2]dpaa_eth: buffer layout fixesThe patches are related to the software workaround for the A050385 erratum. The first patch ensures optimal buffer usage for non-erratum scenarios. The
second patch fixes a currently inconsequential discrepancy between the FMan and Ethernet drivers.Changes in v3:
- refactor defines for clarity in 1/2
- add more details on the user impact in 1/2
- remove unnecessary inline identifier in 2/2Changes in v2:
- make the returned value for TX ports explicit in 2/2
- simplify thebuf_layoutreference in 2/2Camelia Groza (2):
dpaa_eth: update the buffer layout for non-A050385 erratum scenarios
dpaa_eth: fix the RX headroom size alignment
Quoted 6 lines
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 28 +++++++++++++++++---- ----- 1 file changed, 18 insertions(+), 10 deletions(-)--
1.9.1
For the series,
Quoted 9 lines
-----Original Message-----
From: Camelia Groza <[email protected]>
Sent: Monday, November 2, 2020 20:35
To: [email protected]; Madalin Bucur (OSS) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Camelia Alexandra Groza <[email protected]>
Subject: [PATCH net v3 0/2]dpaa_eth: buffer layout fixes
Quoted 6 lines
The patches are related to the software workaround for the A050385 erratum.
The first patch ensures optimal buffer usage for non-erratum scenarios. The second patch fixes a currently inconsequential discrepancy between the FMan and Ethernet drivers.
Jakub, when are you planning the next merger of net into net-next? I have a patch set for net-next depending on this one.
Thanks!
Camelia
Jakub Kicinski
maintainerQuoted 7 lines · On Tue, 3 Nov 2020 16:37:26 +0000 Camelia Alexandra Groza wrote:
Quoted 7 lines
Subject: [PATCH net v3 0/2]
dpaa_eth: buffer layout fixesThe patches are related to the software workaround for the A050385 erratum.
The first patch ensures optimal buffer usage for non-erratum scenarios. The second patch fixes a currently inconsequential discrepancy between the FMan and Ethernet drivers.
Hm, looks like the bot didn't reply, these are applied to net, as you probably noticed.
Quoted 2 lines
Jakub, when are you planning the next merger of net into net-next? I have a patch set for net-next depending on this one.
Thursday afternoon PST, or Friday. Depends on when Linus pulls from net.