[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <VI1PR04MB5807A1501D629B4AD0F7B3B7F2170@VI1PR04MB5807.eurprd04.prod.outlook.com>
Date: Wed, 28 Oct 2020 15:57:55 +0000
From: Camelia Alexandra Groza <camelia.groza@....com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
CC: "Madalin Bucur (OSS)" <madalin.bucur@....nxp.com>,
David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Network Development <netdev@...r.kernel.org>
Subject: RE: [PATCH net 2/2] dpaa_eth: fix the RX headroom size alignment
> -----Original Message-----
> From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
> Sent: Tuesday, October 27, 2020 23:31
> To: Camelia Alexandra Groza <camelia.groza@....com>
> Cc: Madalin Bucur (OSS) <madalin.bucur@....nxp.com>; David Miller
> <davem@...emloft.net>; Jakub Kicinski <kuba@...nel.org>; Network
> Development <netdev@...r.kernel.org>
> Subject: Re: [PATCH net 2/2] dpaa_eth: fix the RX headroom size alignment
>
> On Tue, Oct 27, 2020 at 11:04 AM Camelia Groza <camelia.groza@....com>
> wrote:
> >
> > The 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.
> >
> > Fixes: 3c68b8fffb48 ("dpaa_eth: FMan erratum A050385 workaround")
> > Signed-off-by: Camelia Groza <camelia.groza@....com>
> > ---
> > drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 12 ++++++++----
> > 1 file changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > index 1aac0b6..67ae561 100644
> > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > @@ -2842,7 +2842,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 inline u16 dpaa_get_headroom(struct dpaa_buffer_layout *bl,
> > + enum port_type port)
> > {
> > u16 headroom;
> >
> > @@ -2856,9 +2857,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_PARSE_RESULTS_SIZE +
> > + headroom = (u16)(bl[port].priv_data_size +
> DPAA_PARSE_RESULTS_SIZE +
> > DPAA_TIME_STAMP_SIZE + DPAA_HASH_RESULTS_SIZE);
> >
> > + if (port == RX)
> > + return ALIGN(headroom, DPAA_FD_RX_DATA_ALIGNMENT);
> > +
> else?
It falls through. I'll make it explicit.
> > return ALIGN(headroom, DPAA_FD_DATA_ALIGNMENT);
> > }
> >
> > @@ -3027,8 +3031,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[0], TX);
> > + priv->rx_headroom = dpaa_get_headroom(&priv->buf_layout[0],
> RX);
>
> This can be just priv->buf_layout
I'll change it. Thanks.
> > /* All real interfaces need their ports initialized */
> > err = dpaa_eth_init_ports(mac_dev, dpaa_bp, &port_fqs,
> > --
> > 1.9.1
> >
Powered by blists - more mailing lists