[v2,14/16] net/pfe: disable HW CRC stripping
Checks
Commit Message
From: Gagandeep Singh <g.singh@nxp.com>
LS1012A MAC PCS block has an erratum that is seen with specific
PHY AR803x. The issue is triggered by the (spec-compliant)
operation of the AR803x PHY on the LS1012A-FRWY board.
Due to this, good FCS packet is reported as error packet by MAC,
so for these error packets FCS should be validated and discard
only real error packets in PFE engine Rx packet path. Now onwards
CRC validation will be handled in pfe.ko and DPDK driver can not
use CRC Forwarding option.
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
drivers/net/pfe/pfe_ethdev.c | 7 +++++--
drivers/net/pfe/pfe_hal.c | 4 ++--
2 files changed, 7 insertions(+), 4 deletions(-)
Comments
On Mon, 27 Dec 2021 21:46:43 +0530
nipun.gupta@nxp.com wrote:
> @@ -422,8 +422,11 @@ pfe_eth_close(struct rte_eth_dev *dev)
> }
>
> static int
> -pfe_eth_configure(struct rte_eth_dev *dev __rte_unused)
> +pfe_eth_configure(struct rte_eth_dev *dev)
> {
> + if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_KEEP_CRC)
> + PFE_PMD_ERR("PMD does not support KEEP_CRC offload");
> +
> return 0;
> }
>
Why is this necessary? There is already a check for offload capabilities in
rte_eth_dev_configure(). The device should report correct supported offloads instead.
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: 27 December 2021 23:19
> To: Nipun Gupta <nipun.gupta@nxp.com>
> Cc: dev@dpdk.org; thomas@monjalon.net; ferruh.yigit@intel.com; Hemant
> Agrawal <hemant.agrawal@nxp.com>; Gagandeep Singh <G.Singh@nxp.com>
> Subject: Re: [PATCH v2 14/16] net/pfe: disable HW CRC stripping
>
> On Mon, 27 Dec 2021 21:46:43 +0530
> nipun.gupta@nxp.com wrote:
>
> > @@ -422,8 +422,11 @@ pfe_eth_close(struct rte_eth_dev *dev)
> > }
> >
> > static int
> > -pfe_eth_configure(struct rte_eth_dev *dev __rte_unused)
> > +pfe_eth_configure(struct rte_eth_dev *dev)
> > {
> > + if (dev->data->dev_conf.rxmode.offloads &
> DEV_RX_OFFLOAD_KEEP_CRC)
> > + PFE_PMD_ERR("PMD does not support KEEP_CRC offload");
> > +
> > return 0;
> > }
> >
>
> Why is this necessary? There is already a check for offload capabilities in
> rte_eth_dev_configure(). The device should report correct supported offloads
> instead.
Agree. Will remove this patch.
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2020 NXP
*/
#include <sys/ioctl.h>
@@ -422,8 +422,11 @@ pfe_eth_close(struct rte_eth_dev *dev)
}
static int
-pfe_eth_configure(struct rte_eth_dev *dev __rte_unused)
+pfe_eth_configure(struct rte_eth_dev *dev)
{
+ if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_KEEP_CRC)
+ PFE_PMD_ERR("PMD does not support KEEP_CRC offload");
+
return 0;
}
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2020 NXP
*/
#include <arpa/inet.h>
@@ -191,7 +191,7 @@ gemac_set_mode(void *base, __rte_unused int mode)
val &= ~EMAC_RCNTRL_LOOP;
/*Enable flow control and MII mode*/
- val |= (EMAC_RCNTRL_FCE | EMAC_RCNTRL_MII_MODE | EMAC_RCNTRL_CRC_FWD);
+ val |= (EMAC_RCNTRL_FCE | EMAC_RCNTRL_MII_MODE);
writel(val, base + EMAC_RCNTRL_REG);
}