The rx_align was introduced by the commit 41ef84ce4c72 ("net: fec: change
FEC alignment according to i.mx6 sx requirement"). Because the i.MX6 SX
requires RX buffer must be 64 bytes alignment.
Since the commit 95698ff6177b ("net: fec: using page pool to manage RX
buffers"), the address of the RX buffer is always the page address plus
128 bytes, so RX buffer is always 64-byte aligned. Therefore, rx_align
has no effect since that commit, and we can safely remove it.
Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
drivers/net/ethernet/freescale/fec.h | 1 -
drivers/net/ethernet/freescale/fec_main.c | 6 +-----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index c5bbc2c16a4f..a25dca9c7d71 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -660,7 +660,6 @@ struct fec_enet_private {
struct pm_qos_request pm_qos_req;
unsigned int tx_align;
- unsigned int rx_align;
/* hw interrupt coalesce */
unsigned int rx_pkts_itr;
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 5de86c8bc78e..cf598d5260fb 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -4069,10 +4069,8 @@ static int fec_enet_init(struct net_device *ndev)
WARN_ON(dsize != (1 << dsize_log2));
#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
- fep->rx_align = 0xf;
fep->tx_align = 0xf;
#else
- fep->rx_align = 0x3;
fep->tx_align = 0x3;
#endif
fep->rx_pkts_itr = FEC_ITR_ICFT_DEFAULT;
@@ -4161,10 +4159,8 @@ static int fec_enet_init(struct net_device *ndev)
fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
}
- if (fep->quirks & FEC_QUIRK_HAS_MULTI_QUEUES) {
+ if (fep->quirks & FEC_QUIRK_HAS_MULTI_QUEUES)
fep->tx_align = 0;
- fep->rx_align = 0x3f;
- }
ndev->hw_features = ndev->features;
--
2.34.1
On Tue, Nov 11, 2025 at 06:00:56PM +0800, Wei Fang wrote:
> The rx_align was introduced by the commit 41ef84ce4c72 ("net: fec: change
> FEC alignment according to i.mx6 sx requirement"). Because the i.MX6 SX
> requires RX buffer must be 64 bytes alignment.
>
> Since the commit 95698ff6177b ("net: fec: using page pool to manage RX
> buffers"), the address of the RX buffer is always the page address plus
> 128 bytes, so RX buffer is always 64-byte aligned.
It is not obvious to me where this 128 bytes is added.
Andrew
On Tue, Nov 11, 2025 at 06:00:56PM +0800, Wei Fang wrote:
> The rx_align was introduced by the commit 41ef84ce4c72 ("net: fec: change
> FEC alignment according to i.mx6 sx requirement"). Because the i.MX6 SX
> requires RX buffer must be 64 bytes alignment.
>
> Since the commit 95698ff6177b ("net: fec: using page pool to manage RX
> buffers"), the address of the RX buffer is always the page address plus
> 128 bytes, so RX buffer is always 64-byte aligned. Therefore, rx_align
> has no effect since that commit, and we can safely remove it.
I suggest keep it as it because we need know this kind limitation in case
future code change broke prediction
'net: fec: using page pool to manage RX ..."
Frank
>
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> ---
> drivers/net/ethernet/freescale/fec.h | 1 -
> drivers/net/ethernet/freescale/fec_main.c | 6 +-----
> 2 files changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
> index c5bbc2c16a4f..a25dca9c7d71 100644
> --- a/drivers/net/ethernet/freescale/fec.h
> +++ b/drivers/net/ethernet/freescale/fec.h
> @@ -660,7 +660,6 @@ struct fec_enet_private {
> struct pm_qos_request pm_qos_req;
>
> unsigned int tx_align;
> - unsigned int rx_align;
>
> /* hw interrupt coalesce */
> unsigned int rx_pkts_itr;
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 5de86c8bc78e..cf598d5260fb 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -4069,10 +4069,8 @@ static int fec_enet_init(struct net_device *ndev)
>
> WARN_ON(dsize != (1 << dsize_log2));
> #if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
> - fep->rx_align = 0xf;
> fep->tx_align = 0xf;
> #else
> - fep->rx_align = 0x3;
> fep->tx_align = 0x3;
> #endif
> fep->rx_pkts_itr = FEC_ITR_ICFT_DEFAULT;
> @@ -4161,10 +4159,8 @@ static int fec_enet_init(struct net_device *ndev)
> fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
> }
>
> - if (fep->quirks & FEC_QUIRK_HAS_MULTI_QUEUES) {
> + if (fep->quirks & FEC_QUIRK_HAS_MULTI_QUEUES)
> fep->tx_align = 0;
> - fep->rx_align = 0x3f;
> - }
>
> ndev->hw_features = ndev->features;
>
> --
> 2.34.1
>
© 2016 - 2026 Red Hat, Inc.