* [PATCH 1/7] net/nfb: use MAC address assigned to card
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
@ 2026-02-06 17:04 ` spinler
2026-02-06 17:04 ` [PATCH 2/7] net/nfb: get correct link speed spinler
` (8 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-06 17:04 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Check for a specific MAC address assigned to a card.
If there is no assigned MAC address, then use a random MAC as fallback.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
drivers/net/nfb/nfb_ethdev.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index 157f04a891..ca3dbad879 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -11,6 +11,7 @@
#include <nfb/nfb.h>
#include <nfb/ndp.h>
+#include <netcope/eth.h>
#include <netcope/rxmac.h>
#include <netcope/txmac.h>
@@ -639,10 +640,14 @@ nfb_eth_dev_init(struct rte_eth_dev *dev, void *init_data)
goto err_malloc_mac_addrs;
}
- rte_eth_random_addr(eth_addr_init.addr_bytes);
- eth_addr_init.addr_bytes[0] = eth_addr.addr_bytes[0];
- eth_addr_init.addr_bytes[1] = eth_addr.addr_bytes[1];
- eth_addr_init.addr_bytes[2] = eth_addr.addr_bytes[2];
+ ret = nc_ifc_get_default_mac(internals->nfb, ifc->id, eth_addr_init.addr_bytes,
+ sizeof(eth_addr_init.addr_bytes));
+ if (ret != 0) {
+ rte_eth_random_addr(eth_addr_init.addr_bytes);
+ eth_addr_init.addr_bytes[0] = eth_addr.addr_bytes[0];
+ eth_addr_init.addr_bytes[1] = eth_addr.addr_bytes[1];
+ eth_addr_init.addr_bytes[2] = eth_addr.addr_bytes[2];
+ }
nfb_eth_mac_addr_set(dev, ð_addr_init);
rte_ether_addr_copy(ð_addr_init, &data->mac_addrs[0]);
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 2/7] net/nfb: get correct link speed
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
2026-02-06 17:04 ` [PATCH 1/7] net/nfb: use MAC address assigned to card spinler
@ 2026-02-06 17:04 ` spinler
2026-02-06 17:04 ` [PATCH 3/7] net/nfb: support real link-up/down config spinler
` (7 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-06 17:04 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Read link speed capabilities and actual link speed
from the MDIO registers.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
drivers/net/nfb/meson.build | 1 +
drivers/net/nfb/nfb.h | 7 ++++
drivers/net/nfb/nfb_ethdev.c | 78 +++++++++++++++++++++++++++---------
drivers/net/nfb/nfb_mdio.c | 42 +++++++++++++++++++
drivers/net/nfb/nfb_mdio.h | 34 ++++++++++++++++
5 files changed, 142 insertions(+), 20 deletions(-)
create mode 100644 drivers/net/nfb/nfb_mdio.c
create mode 100644 drivers/net/nfb/nfb_mdio.h
diff --git a/drivers/net/nfb/meson.build b/drivers/net/nfb/meson.build
index 9e458dfb4a..b57d1d48fa 100644
--- a/drivers/net/nfb/meson.build
+++ b/drivers/net/nfb/meson.build
@@ -21,6 +21,7 @@ sources = files(
'nfb_rxmode.c',
'nfb_stats.c',
'nfb_tx.c',
+ 'nfb_mdio.c',
)
cflags += no_wvla_cflag
diff --git a/drivers/net/nfb/nfb.h b/drivers/net/nfb/nfb.h
index 2bce71ac89..6ffb940c6d 100644
--- a/drivers/net/nfb/nfb.h
+++ b/drivers/net/nfb/nfb.h
@@ -11,6 +11,7 @@
#include <nfb/ndp.h>
#include <netcope/rxmac.h>
#include <netcope/txmac.h>
+#include <netcope/mdio_if_info.h>
#include <netcope/info.h>
extern int nfb_logtype;
@@ -50,6 +51,10 @@ extern int nfb_logtype;
NFB_ARG_PORT "=<number>" \
""
+struct eth_node {
+ struct mdio_if_info if_info; /**< MDIO interface handles */
+};
+
/*
* Handles obtained from the libnfb: each process must use own instance.
* Stored inside dev->process_private.
@@ -57,8 +62,10 @@ extern int nfb_logtype;
struct pmd_internals {
uint16_t max_rxmac; /**< Count of valid rxmac items */
uint16_t max_txmac; /**< Count of valid txmac items */
+ uint16_t max_eth; /**< Count of valid eth nodes */
struct nc_rxmac **rxmac; /**< Array of Rx MAC handles */
struct nc_txmac **txmac; /**< Array of Tx MAC handles */
+ struct eth_node *eth_node; /**< Array of Eth nodes */
struct nfb_device *nfb;
TAILQ_ENTRY(pmd_internals) eth_dev_list; /**< Item in list of all devices */
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index ca3dbad879..437aed9ae7 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -14,6 +14,8 @@
#include <netcope/eth.h>
#include <netcope/rxmac.h>
#include <netcope/txmac.h>
+#include <netcope/mdio.h>
+#include <netcope/ieee802_3.h>
#include <ethdev_pci.h>
#include <rte_kvargs.h>
@@ -24,6 +26,8 @@
#include "nfb_rxmode.h"
#include "nfb.h"
+#include "nfb_mdio.h"
+
static const char * const VALID_KEYS[] = {
NFB_ARG_PORT,
NULL
@@ -46,6 +50,18 @@ static struct nfb_pmd_internals_head nfb_eth_dev_list =
static int nfb_eth_dev_uninit(struct rte_eth_dev *dev);
+static int
+nfb_mdio_read(void *priv, int prtad, int devad, uint16_t addr)
+{
+ return nc_mdio_read((struct nc_mdio *)priv, prtad, devad, addr);
+}
+
+static int
+nfb_mdio_write(void *priv, int prtad, int devad, uint16_t addr, uint16_t val)
+{
+ return nc_mdio_write((struct nc_mdio *)priv, prtad, devad, addr, val);
+}
+
/**
* Default MAC addr
*/
@@ -65,10 +81,17 @@ static int
nfb_nc_eth_init(struct pmd_internals *intl, struct nfb_ifc_create_params *params)
{
int ret;
- int i, rxm, txm;
+ int i, rxm, txm, eth;
struct nc_ifc_info *ifc = params->ifc_info;
struct nc_ifc_map_info *mi = ¶ms->map_info;
+ int node, node_cp;
+ const int32_t *prop32;
+ int proplen;
+ const void *fdt;
+
+ fdt = nfb_get_fdt(intl->nfb);
+
ret = -ENOMEM;
if (ifc->eth_cnt == 0)
return 0;
@@ -81,9 +104,14 @@ nfb_nc_eth_init(struct pmd_internals *intl, struct nfb_ifc_create_params *params
if (intl->txmac == NULL)
goto err_alloc_txmac;
+ intl->eth_node = calloc(ifc->eth_cnt, sizeof(*intl->eth_node));
+ if (intl->eth_node == NULL)
+ goto err_alloc_ethnode;
+
/* Some eths may not have assigned MAC nodes, hence use separate var for indexing */
rxm = 0;
txm = 0;
+ eth = 0;
for (i = 0; i < mi->eth_cnt; i++) {
if (mi->eth[i].ifc != ifc->id)
continue;
@@ -95,12 +123,30 @@ nfb_nc_eth_init(struct pmd_internals *intl, struct nfb_ifc_create_params *params
intl->txmac[txm] = nc_txmac_open(intl->nfb, mi->eth[i].node_txmac);
if (intl->txmac[txm])
txm++;
+
+ node = nc_eth_get_pcspma_control_node(fdt, mi->eth[i].node_eth, &node_cp);
+
+ intl->eth_node[eth].if_info.dev = nc_mdio_open(intl->nfb, node, node_cp);
+ if (intl->eth_node[eth].if_info.dev) {
+ intl->eth_node[eth].if_info.prtad = 0;
+ intl->eth_node[eth].if_info.mdio_read = nfb_mdio_read;
+ intl->eth_node[eth].if_info.mdio_write = nfb_mdio_write;
+
+ prop32 = fdt_getprop(fdt, node_cp, "dev", &proplen);
+ if (proplen == sizeof(*prop32))
+ intl->eth_node[eth].if_info.prtad = fdt32_to_cpu(*prop32);
+
+ eth++;
+ }
}
intl->max_rxmac = rxm;
intl->max_txmac = txm;
+ intl->max_eth = eth;
return 0;
+err_alloc_ethnode:
+ free(intl->txmac);
err_alloc_txmac:
free(intl->rxmac);
err_alloc_rxmac:
@@ -116,6 +162,8 @@ static void
nfb_nc_eth_deinit(struct pmd_internals *intl)
{
uint16_t i;
+ for (i = 0; i < intl->max_eth; i++)
+ nc_mdio_close(intl->eth_node[i].if_info.dev);
for (i = 0; i < intl->max_txmac; i++)
nc_txmac_close(intl->txmac[i]);
for (i = 0; i < intl->max_rxmac; i++)
@@ -262,16 +310,22 @@ nfb_eth_dev_info(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info)
{
struct pmd_priv *priv = dev->data->dev_private;
+ struct pmd_internals *intl = dev->process_private;
dev_info->max_mac_addrs = nfb_eth_get_max_mac_address_count(dev);
dev_info->max_rx_pktlen = (uint32_t)-1;
dev_info->max_rx_queues = priv->max_rx_queues;
dev_info->max_tx_queues = priv->max_tx_queues;
- dev_info->speed_capa = RTE_ETH_LINK_SPEED_100G;
+ dev_info->speed_capa = RTE_ETH_LINK_SPEED_FIXED;
dev_info->rx_offload_capa =
RTE_ETH_RX_OFFLOAD_TIMESTAMP;
+ if (intl->max_eth) {
+ nfb_mdio_cl45_pma_get_speed_capa(&intl->eth_node[0].if_info,
+ &dev_info->speed_capa);
+ }
+
return 0;
}
@@ -339,24 +393,8 @@ nfb_eth_link_update(struct rte_eth_dev *dev,
link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
link.link_autoneg = RTE_ETH_LINK_SPEED_FIXED;
- if (internals->max_rxmac) {
- nc_rxmac_read_status(internals->rxmac[0], &status);
-
- switch (status.speed) {
- case MAC_SPEED_10G:
- link.link_speed = RTE_ETH_SPEED_NUM_10G;
- break;
- case MAC_SPEED_40G:
- link.link_speed = RTE_ETH_SPEED_NUM_40G;
- break;
- case MAC_SPEED_100G:
- link.link_speed = RTE_ETH_SPEED_NUM_100G;
- break;
- default:
- link.link_speed = RTE_ETH_SPEED_NUM_NONE;
- break;
- }
- }
+ if (internals->max_eth)
+ link.link_speed = ieee802_3_get_pma_speed_value(&internals->eth_node->if_info);
for (i = 0; i < internals->max_rxmac; ++i) {
nc_rxmac_read_status(internals->rxmac[i], &status);
diff --git a/drivers/net/nfb/nfb_mdio.c b/drivers/net/nfb/nfb_mdio.c
new file mode 100644
index 0000000000..19a433635b
--- /dev/null
+++ b/drivers/net/nfb/nfb_mdio.c
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2026 CESNET, z.s.p.o.
+ */
+
+#include <eal_export.h>
+#include <rte_ethdev.h>
+
+#include "nfb_mdio.h"
+
+RTE_EXPORT_INTERNAL_SYMBOL(nfb_mdio_cl45_pma_get_speed_capa)
+void
+nfb_mdio_cl45_pma_get_speed_capa(struct mdio_if_info *info, uint32_t *capa)
+{
+ int i;
+ int reg;
+
+ const int speed_ability[NFB_MDIO_WIDTH] = {
+ RTE_ETH_LINK_SPEED_10G,
+ 0,
+ 0,
+ RTE_ETH_LINK_SPEED_50G,
+ RTE_ETH_LINK_SPEED_1G,
+ RTE_ETH_LINK_SPEED_100M,
+ RTE_ETH_LINK_SPEED_10M,
+ 0,
+ RTE_ETH_LINK_SPEED_40G,
+ RTE_ETH_LINK_SPEED_100G,
+ 0,
+ RTE_ETH_LINK_SPEED_25G,
+ RTE_ETH_LINK_SPEED_200G,
+ RTE_ETH_LINK_SPEED_2_5G,
+ RTE_ETH_LINK_SPEED_5G,
+ RTE_ETH_LINK_SPEED_400G,
+ };
+
+ reg = nfb_mdio_if_read_pma(info, NFB_MDIO_PMA_SPEED_ABILITY);
+
+ for (i = 0; i < NFB_MDIO_WIDTH; i++) {
+ if (reg & NFB_MDIO_BIT(i))
+ *capa |= speed_ability[i];
+ }
+}
diff --git a/drivers/net/nfb/nfb_mdio.h b/drivers/net/nfb/nfb_mdio.h
new file mode 100644
index 0000000000..f783e71c4b
--- /dev/null
+++ b/drivers/net/nfb/nfb_mdio.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2026 CESNET, z.s.p.o.
+ */
+
+#include <stdint.h>
+#include <rte_bitops.h>
+#include <netcope/mdio_if_info.h>
+
+
+#define NFB_MDIO_WIDTH (UINT16_WIDTH)
+#define NFB_MDIO_BIT(nr) (UINT16_C(1) << (nr))
+
+#define NFB_MDIO_DEV_PMA 1
+
+#define NFB_MDIO_PMA_CTRL 0
+#define NFB_MDIO_PMA_CTRL_RESET NFB_MDIO_BIT(15)
+
+#define NFB_MDIO_PMA_SPEED_ABILITY 4
+
+#define NFB_MDIO_PMA_RSFEC_CR 200
+#define NFB_MDIO_PMA_RSFEC_CR_ENABLE NFB_MDIO_BIT(2)
+
+static inline int nfb_mdio_if_read_pma(struct mdio_if_info *if_info, uint16_t addr)
+{
+ return if_info->mdio_read(if_info->dev, if_info->prtad, NFB_MDIO_DEV_PMA, addr);
+}
+
+static inline int nfb_mdio_if_write_pma(struct mdio_if_info *if_info, uint16_t addr, uint16_t val)
+{
+ return if_info->mdio_write(if_info->dev, if_info->prtad, NFB_MDIO_DEV_PMA, addr, val);
+}
+
+__rte_internal
+void nfb_mdio_cl45_pma_get_speed_capa(struct mdio_if_info *if_info, uint32_t *capa);
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 3/7] net/nfb: support real link-up/down config
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
2026-02-06 17:04 ` [PATCH 1/7] net/nfb: use MAC address assigned to card spinler
2026-02-06 17:04 ` [PATCH 2/7] net/nfb: get correct link speed spinler
@ 2026-02-06 17:04 ` spinler
2026-02-06 17:04 ` [PATCH 4/7] net/nfb: support setting RS-FEC mode spinler
` (6 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-06 17:04 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Use the standard PMA reset bit in the MDIO registers
to configure of the link-up/link-down state.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
drivers/net/nfb/nfb_ethdev.c | 36 +++++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index 437aed9ae7..950754f4cf 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -410,6 +410,29 @@ nfb_eth_link_update(struct rte_eth_dev *dev,
return 0;
}
+static int
+nfb_eth_dev_set_link(struct pmd_internals *intl, bool val)
+{
+ int reg;
+ struct mdio_if_info *if_info;
+
+ if (!intl->max_eth)
+ return 0;
+
+ if_info = &intl->eth_node[0].if_info;
+
+ reg = nfb_mdio_if_read_pma(if_info, NFB_MDIO_PMA_CTRL);
+ if (reg < 0)
+ return reg;
+
+ /* Update PMA Reset flag if necessary (Reset flag set means link down) */
+ if ((reg & NFB_MDIO_PMA_CTRL_RESET) != (val ? 0 : NFB_MDIO_PMA_CTRL_RESET)) {
+ reg ^= NFB_MDIO_PMA_CTRL_RESET;
+ return nfb_mdio_if_write_pma(if_info, NFB_MDIO_PMA_CTRL, reg);
+ }
+ return 0;
+}
+
/**
* DPDK callback to bring the link UP.
*
@@ -422,17 +445,16 @@ nfb_eth_link_update(struct rte_eth_dev *dev,
static int
nfb_eth_dev_set_link_up(struct rte_eth_dev *dev)
{
- struct pmd_internals *internals = (struct pmd_internals *)
- dev->process_private;
-
+ struct pmd_internals *internals = dev->process_private;
uint16_t i;
+
for (i = 0; i < internals->max_rxmac; ++i)
nc_rxmac_enable(internals->rxmac[i]);
for (i = 0; i < internals->max_txmac; ++i)
nc_txmac_enable(internals->txmac[i]);
- return 0;
+ return nfb_eth_dev_set_link(internals, true);
}
/**
@@ -447,17 +469,17 @@ nfb_eth_dev_set_link_up(struct rte_eth_dev *dev)
static int
nfb_eth_dev_set_link_down(struct rte_eth_dev *dev)
{
- struct pmd_internals *internals = (struct pmd_internals *)
- dev->process_private;
+ struct pmd_internals *internals = dev->process_private;
uint16_t i;
+
for (i = 0; i < internals->max_rxmac; ++i)
nc_rxmac_disable(internals->rxmac[i]);
for (i = 0; i < internals->max_txmac; ++i)
nc_txmac_disable(internals->txmac[i]);
- return 0;
+ return nfb_eth_dev_set_link(internals, false);
}
static uint64_t
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 4/7] net/nfb: support setting RS-FEC mode
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
` (2 preceding siblings ...)
2026-02-06 17:04 ` [PATCH 3/7] net/nfb: support real link-up/down config spinler
@ 2026-02-06 17:04 ` spinler
2026-02-06 17:04 ` [PATCH 5/7] net/nfb: support setting Rx MTU spinler
` (5 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-06 17:04 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Enable basic configuration of the RS-FEC link mode over MDIO.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
drivers/net/nfb/nfb_ethdev.c | 62 ++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index 950754f4cf..b927d006e7 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -575,6 +575,66 @@ nfb_eth_fw_version_get(struct rte_eth_dev *dev, char *fw_version,
return 0;
}
+static int
+nfb_eth_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
+{
+ int reg;
+ struct pmd_internals *intl = dev->process_private;
+ struct mdio_if_info *if_info;
+
+ *fec_capa = 0;
+ if (!intl->max_eth)
+ return 0;
+
+ if_info = &intl->eth_node[0].if_info;
+
+ reg = nfb_mdio_if_read_pma(if_info, NFB_MDIO_PMA_RSFEC_CR);
+ if (reg < 0)
+ return -EIO;
+
+ *fec_capa = (reg & NFB_MDIO_PMA_RSFEC_CR_ENABLE) ?
+ RTE_ETH_FEC_MODE_CAPA_MASK(RS) :
+ RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
+
+ return 0;
+}
+
+static int
+nfb_eth_fec_set(struct rte_eth_dev *dev, uint32_t fec_capa)
+{
+ int ret;
+ uint32_t fec_capa2 = 0;
+ int reg;
+
+ struct pmd_internals *intl = dev->process_private;
+ struct mdio_if_info *if_info;
+
+ if (!intl->max_eth)
+ return 0;
+
+ if_info = &intl->eth_node[0].if_info;
+
+ if (fec_capa & RTE_ETH_FEC_MODE_CAPA_MASK(AUTO))
+ return -EINVAL;
+
+ reg = nfb_mdio_if_read_pma(if_info, NFB_MDIO_PMA_RSFEC_CR);
+ if (reg < 0)
+ return -EIO;
+
+ reg = (fec_capa & RTE_ETH_FEC_MODE_CAPA_MASK(RS)) ?
+ (reg | NFB_MDIO_PMA_RSFEC_CR_ENABLE) :
+ (reg & ~NFB_MDIO_PMA_RSFEC_CR_ENABLE);
+ nfb_mdio_if_write_pma(if_info, NFB_MDIO_PMA_RSFEC_CR, reg);
+ ret = nfb_eth_fec_get(dev, &fec_capa2);
+ if (ret)
+ return ret;
+
+ if (fec_capa != fec_capa2)
+ return -EINVAL;
+
+ return 0;
+}
+
static const struct eth_dev_ops ops = {
.dev_start = nfb_eth_dev_start,
.dev_stop = nfb_eth_dev_stop,
@@ -602,6 +662,8 @@ static const struct eth_dev_ops ops = {
.mac_addr_add = nfb_eth_mac_addr_add,
.mac_addr_remove = nfb_eth_mac_addr_remove,
.fw_version_get = nfb_eth_fw_version_get,
+ .fec_get = nfb_eth_fec_get,
+ .fec_set = nfb_eth_fec_set,
};
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 5/7] net/nfb: support setting Rx MTU
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
` (3 preceding siblings ...)
2026-02-06 17:04 ` [PATCH 4/7] net/nfb: support setting RS-FEC mode spinler
@ 2026-02-06 17:04 ` spinler
2026-02-18 18:20 ` Stephen Hemminger
2026-02-06 17:04 ` [PATCH 6/7] net/nfb: read total stats from macs spinler
` (4 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: spinler @ 2026-02-06 17:04 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Enable configuration of the MTU on the Rx MAC assigned to the port.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
drivers/net/nfb/nfb_ethdev.c | 39 ++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index b927d006e7..b4bd98e08c 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -49,6 +49,7 @@ static struct nfb_pmd_internals_head nfb_eth_dev_list =
TAILQ_HEAD_INITIALIZER(nfb_eth_dev_list);
static int nfb_eth_dev_uninit(struct rte_eth_dev *dev);
+static int nfb_eth_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
static int
nfb_mdio_read(void *priv, int prtad, int devad, uint16_t addr)
@@ -255,6 +256,10 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
int ret;
struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
+ ret = nfb_eth_mtu_set(dev, dev_conf->rxmode.mtu);
+ if (ret)
+ goto err_mtu_set;
+
if (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
ret = rte_mbuf_dyn_rx_timestamp_register
(&nfb_timestamp_dynfield_offset,
@@ -269,6 +274,7 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
return 0;
err_ts_register:
+err_mtu_set:
nfb_eth_dev_uninit(dev);
return ret;
}
@@ -549,6 +555,38 @@ nfb_eth_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
nc_rxmac_set_mac(internals->rxmac[i], index, 0, 0);
}
+static int
+nfb_eth_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+{
+ unsigned int i;
+ struct nc_rxmac_status status;
+ struct pmd_internals *intl = dev->process_private;
+ uint16_t frame_length_max_capable;
+
+ mtu += RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
+
+ if (!intl->max_rxmac)
+ return 0;
+
+ status.frame_length_max_capable = 0;
+ nc_rxmac_read_status(intl->rxmac[0], &status);
+ frame_length_max_capable = status.frame_length_max_capable;
+
+ for (i = 1; i < intl->max_rxmac; ++i) {
+ nc_rxmac_read_status(intl->rxmac[i], &status);
+ if (frame_length_max_capable > status.frame_length_max_capable)
+ frame_length_max_capable = status.frame_length_max_capable;
+ }
+
+ if (frame_length_max_capable < mtu && frame_length_max_capable != 0)
+ return -EINVAL;
+
+ for (i = 0; i < intl->max_rxmac; ++i)
+ nc_rxmac_set_frame_length(intl->rxmac[i], mtu, RXMAC_FRAME_LENGTH_MAX);
+
+ return 0;
+}
+
static int
nfb_eth_fw_version_get(struct rte_eth_dev *dev, char *fw_version,
size_t fw_size)
@@ -661,6 +699,7 @@ static const struct eth_dev_ops ops = {
.mac_addr_set = nfb_eth_mac_addr_set,
.mac_addr_add = nfb_eth_mac_addr_add,
.mac_addr_remove = nfb_eth_mac_addr_remove,
+ .mtu_set = nfb_eth_mtu_set,
.fw_version_get = nfb_eth_fw_version_get,
.fec_get = nfb_eth_fec_get,
.fec_set = nfb_eth_fec_set,
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 5/7] net/nfb: support setting Rx MTU
2026-02-06 17:04 ` [PATCH 5/7] net/nfb: support setting Rx MTU spinler
@ 2026-02-18 18:20 ` Stephen Hemminger
2026-02-19 6:20 ` Martin Spinler
0 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2026-02-18 18:20 UTC (permalink / raw)
To: spinler; +Cc: dev
On Fri, 6 Feb 2026 18:04:33 +0100
spinler@cesnet.cz wrote:
> +static int
> +nfb_eth_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
> +{
> + unsigned int i;
> + struct nc_rxmac_status status;
> + struct pmd_internals *intl = dev->process_private;
> + uint16_t frame_length_max_capable;
> +
> + mtu += RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
> +
Since mtu is 16 bit value, you need to use uint32_t to avoid
overflow.
Something like:
+ uint32_t frame_len = (uint32_t)mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
+ if (frame_len > priv->frame_len_max_cap)
+ return -EINVAL;
+ for (i = 0; i < intl->max_rxmac; ++i)
+ nc_rxmac_set_frame_length(intl->rxmac[i], frame_len, RXMAC_FRAME_LENGTH_MAX);
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH 5/7] net/nfb: support setting Rx MTU
2026-02-18 18:20 ` Stephen Hemminger
@ 2026-02-19 6:20 ` Martin Spinler
0 siblings, 0 replies; 21+ messages in thread
From: Martin Spinler @ 2026-02-19 6:20 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
> Since mtu is 16 bit value, you need to use uint32_t to avoid
> overflow.
>
> Something like:
> + uint32_t frame_len = (uint32_t)mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
> + if (frame_len > priv->frame_len_max_cap)
> + return -EINVAL;
>
> + for (i = 0; i < intl->max_rxmac; ++i)
> + nc_rxmac_set_frame_length(intl->rxmac[i], frame_len, RXMAC_FRAME_LENGTH_MAX);
Thank you, this check is cleaner.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 6/7] net/nfb: read total stats from macs
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
` (4 preceding siblings ...)
2026-02-06 17:04 ` [PATCH 5/7] net/nfb: support setting Rx MTU spinler
@ 2026-02-06 17:04 ` spinler
2026-02-06 17:04 ` [PATCH 7/7] doc/nfb: update release notes for nfb driver spinler
` (3 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-06 17:04 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Both the Rx and Tx MAC components in firmware provide basic statistics.
Use these statistics instead of the sum of the per-queue counters.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
drivers/net/nfb/nfb_stats.c | 40 +++++++++++++++++++++++--------------
1 file changed, 25 insertions(+), 15 deletions(-)
diff --git a/drivers/net/nfb/nfb_stats.c b/drivers/net/nfb/nfb_stats.c
index 27a01c3160..4bdec17219 100644
--- a/drivers/net/nfb/nfb_stats.c
+++ b/drivers/net/nfb/nfb_stats.c
@@ -14,11 +14,11 @@ nfb_eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
uint16_t i;
uint16_t nb_rx = dev->data->nb_rx_queues;
uint16_t nb_tx = dev->data->nb_tx_queues;
- uint64_t rx_total = 0;
- uint64_t tx_total = 0;
- uint64_t tx_err_total = 0;
- uint64_t rx_total_bytes = 0;
- uint64_t tx_total_bytes = 0;
+
+ int ret;
+ struct pmd_internals *internals = dev->process_private;
+ struct nc_rxmac_counters rx_cntrs;
+ struct nc_txmac_counters tx_cntrs;
struct ndp_rx_queue *rx_queue;
struct ndp_tx_queue *tx_queue;
@@ -29,8 +29,6 @@ nfb_eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
qstats->q_ipackets[i] = rx_queue->rx_pkts;
qstats->q_ibytes[i] = rx_queue->rx_bytes;
}
- rx_total += rx_queue->rx_pkts;
- rx_total_bytes += rx_queue->rx_bytes;
}
for (i = 0; i < nb_tx; i++) {
@@ -39,16 +37,28 @@ nfb_eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
qstats->q_opackets[i] = tx_queue->tx_pkts;
qstats->q_obytes[i] = tx_queue->tx_bytes;
}
- tx_total += tx_queue->tx_pkts;
- tx_total_bytes += tx_queue->tx_bytes;
- tx_err_total += tx_queue->err_pkts;
}
- stats->ipackets = rx_total;
- stats->opackets = tx_total;
- stats->ibytes = rx_total_bytes;
- stats->obytes = tx_total_bytes;
- stats->oerrors = tx_err_total;
+ for (i = 0; i < internals->max_rxmac; i++) {
+ ret = nc_rxmac_read_counters(internals->rxmac[i], &rx_cntrs, NULL);
+ if (ret)
+ return -EIO;
+
+ stats->ipackets += rx_cntrs.cnt_received;
+ stats->ibytes += rx_cntrs.cnt_octets;
+ stats->ierrors += rx_cntrs.cnt_drop - rx_cntrs.cnt_overflowed;
+ stats->imissed += rx_cntrs.cnt_overflowed;
+ }
+
+ for (i = 0; i < internals->max_txmac; i++) {
+ ret = nc_txmac_read_counters(internals->txmac[i], &tx_cntrs);
+ if (ret)
+ return -EIO;
+
+ stats->opackets += tx_cntrs.cnt_sent;
+ stats->obytes += tx_cntrs.cnt_octets;
+ stats->oerrors += tx_cntrs.cnt_drop;
+ }
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 7/7] doc/nfb: update release notes for nfb driver
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
` (5 preceding siblings ...)
2026-02-06 17:04 ` [PATCH 6/7] net/nfb: read total stats from macs spinler
@ 2026-02-06 17:04 ` spinler
2026-02-17 4:37 ` Stephen Hemminger
2026-02-10 0:33 ` [PATCH 0/7] net/nfb: ethernet enhancements Stephen Hemminger
` (2 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: spinler @ 2026-02-06 17:04 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Update the release notes for the NFB driver with Link Up / Link Down,
RS-FEC, Rx MTU configuration and link speed status features.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
doc/guides/rel_notes/release_26_03.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_26_03.rst b/doc/guides/rel_notes/release_26_03.rst
index 7678cf1a49..de14238b1e 100644
--- a/doc/guides/rel_notes/release_26_03.rst
+++ b/doc/guides/rel_notes/release_26_03.rst
@@ -64,9 +64,10 @@ New Features
* The timestamp value has been updated to make it usable.
* The DPDK port now represents just one Ethernet port instead of all Ethernet ports on the NIC.
* All ports are used by default, but a subset can be selected using the ``port`` argument.
- * Report firmware version.
+ * Report firmware version and correct Ethernet link speed.
* Common CESNET-NDK-based adapters have been added,
including the FB2CGHH (Silicom Denmark) and XpressSX AGI-FH400G (Reflex CES).
+ * Added support for configuration of the RS-FEC mode, Link Up / Link Down state, and the Rx MTU.
Removed Items
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 7/7] doc/nfb: update release notes for nfb driver
2026-02-06 17:04 ` [PATCH 7/7] doc/nfb: update release notes for nfb driver spinler
@ 2026-02-17 4:37 ` Stephen Hemminger
0 siblings, 0 replies; 21+ messages in thread
From: Stephen Hemminger @ 2026-02-17 4:37 UTC (permalink / raw)
To: spinler; +Cc: dev
On Fri, 6 Feb 2026 18:04:35 +0100
spinler@cesnet.cz wrote:
> From: Martin Spinler <spinler@cesnet.cz>
>
> Update the release notes for the NFB driver with Link Up / Link Down,
> RS-FEC, Rx MTU configuration and link speed status features.
>
> Signed-off-by: Martin Spinler <spinler@cesnet.cz>
> ---
> doc/guides/rel_notes/release_26_03.rst | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guides/rel_notes/release_26_03.rst b/doc/guides/rel_notes/release_26_03.rst
> index 7678cf1a49..de14238b1e 100644
> --- a/doc/guides/rel_notes/release_26_03.rst
> +++ b/doc/guides/rel_notes/release_26_03.rst
> @@ -64,9 +64,10 @@ New Features
> * The timestamp value has been updated to make it usable.
> * The DPDK port now represents just one Ethernet port instead of all Ethernet ports on the NIC.
> * All ports are used by default, but a subset can be selected using the ``port`` argument.
> - * Report firmware version.
> + * Report firmware version and correct Ethernet link speed.
> * Common CESNET-NDK-based adapters have been added,
> including the FB2CGHH (Silicom Denmark) and XpressSX AGI-FH400G (Reflex CES).
> + * Added support for configuration of the RS-FEC mode, Link Up / Link Down state, and the Rx MTU.
>
Please just update each item as part of the matching patch.
The Depends-on mechanism doesn't work well with current CI.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 0/7] net/nfb: ethernet enhancements
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
` (6 preceding siblings ...)
2026-02-06 17:04 ` [PATCH 7/7] doc/nfb: update release notes for nfb driver spinler
@ 2026-02-10 0:33 ` Stephen Hemminger
2026-02-12 18:52 ` Stephen Hemminger
2026-02-17 11:03 ` [PATCH v2 0/6] " spinler
9 siblings, 0 replies; 21+ messages in thread
From: Stephen Hemminger @ 2026-02-10 0:33 UTC (permalink / raw)
To: spinler; +Cc: dev
On Fri, 6 Feb 2026 18:04:28 +0100
spinler@cesnet.cz wrote:
> From: Martin Spinler <spinler@cesnet.cz>
>
> This set includes minor enhancements to the Ethernet
> configuration and overall usage.
>
> ---
> Depends-on: series-37261 ("net/nfb: rework to real multiport")
>
> Martin Spinler (7):
> net/nfb: use MAC address assigned to card
> net/nfb: get correct link speed
> net/nfb: support real link-up/down config
> net/nfb: support setting RS-FEC mode
> net/nfb: support setting Rx MTU
> net/nfb: read total stats from macs
> doc/nfb: update release notes for nfb driver
>
> doc/guides/rel_notes/release_26_03.rst | 3 +-
> drivers/net/nfb/meson.build | 1 +
> drivers/net/nfb/nfb.h | 7 +
> drivers/net/nfb/nfb_ethdev.c | 228 +++++++++++++++++++++----
> drivers/net/nfb/nfb_mdio.c | 42 +++++
> drivers/net/nfb/nfb_mdio.h | 34 ++++
> drivers/net/nfb/nfb_stats.c | 40 +++--
> 7 files changed, 308 insertions(+), 47 deletions(-)
> create mode 100644 drivers/net/nfb/nfb_mdio.c
> create mode 100644 drivers/net/nfb/nfb_mdio.h
>
The CI and I don't have hardware to do deep check so have to rely
on my and AI review.
Bundle 1747 (Feature Additions - 7 patches)
3 Critical Issues:
Patch 2: MDIO resource leak on error path - opened handles not closed
Patch 3: Missing NULL check before accessing eth_node[0]
Patch 4: Same NULL check issue in FEC get/set functions
Quick Summary: The feature additions are mostly solid. The main issue is a consistent pattern of accessing eth_node[0] without verifying the pointer is non-NULL. One resource leak needs cleanup code added.
Detailed output:
# NFB Driver Review - Bundle 1747 (Feature Additions)
## Series: 7 patches adding MAC, link speed, FEC, MTU, and stats features
---
## PATCH 1/7: net/nfb: use MAC address assigned to card
**Subject**: net/nfb: use MAC address assigned to card (47 chars) ✓
### Summary
Retrieves MAC address from card firmware via `nc_ifc_get_default_mac()` instead of always generating random MAC with OUI prefix.
### Status: ✓ No errors found
This patch is clean. Falls back gracefully to random MAC generation if firmware MAC retrieval fails.
---
## PATCH 2/7: net/nfb: get correct link speed
**Subject**: net/nfb: get correct link speed (38 chars) ✓
### Summary
Adds MDIO infrastructure to read accurate link speed from PHY PMA registers instead of MAC status register. Introduces `struct eth_node` with MDIO interface info.
### Errors
**Error 1: Resource leak on error path**
```c
intl->eth_node[eth].if_info.dev = nc_mdio_open(intl->nfb, node, node_cp);
if (intl->eth_node[eth].if_info.dev) {
// ... set up interface info
eth++;
}
```
Location: `nfb_nc_eth_init()`, loop at line ~126
If `nc_mdio_open()` succeeds for some iterations but then a later error occurs (e.g., memory allocation for subsequent MACs fails), the function jumps to error labels `err_alloc_ethnode`, `err_alloc_txmac`, or `err_alloc_rxmac`. None of these labels close the already-opened MDIO handles.
**Suggested fix**: Add cleanup loop before freeing eth_node:
```c
err_alloc_ethnode:
for (i = 0; i < eth; i++)
if (intl->eth_node[i].if_info.dev)
nc_mdio_close(intl->eth_node[i].if_info.dev);
free(intl->eth_node);
err_alloc_txmac:
free(intl->txmac);
err_alloc_rxmac:
free(intl->rxmac);
return ret;
```
---
## PATCH 3/7: net/nfb: support real link-up/down config
**Subject**: net/nfb: support real link-up/down config (47 chars) ✓
### Summary
Implements actual PHY link control via MDIO PMA reset register (`NFB_MDIO_PMA_CTRL`) instead of just enabling/disabling MAC layer.
### Errors
**Error 1: Missing NULL check before array access**
```c
static int
nfb_eth_dev_set_link(struct pmd_internals *intl, bool val)
{
// ...
if (!intl->max_eth)
return 0;
if_info = &intl->eth_node[0].if_info; // <-- dereference without NULL check
```
Location: `nfb_eth_dev_set_link()`
If `intl->eth_node` is NULL (allocation failed but not caught), this crashes. While initialization should guarantee that `max_eth > 0` implies `eth_node != NULL`, defensive coding requires verification.
**Suggested fix**: Add NULL check:
```c
if (!intl->max_eth || !intl->eth_node)
return 0;
if_info = &intl->eth_node[0].if_info;
```
---
## PATCH 4/7: net/nfb: support setting RS-FEC mode
**Subject**: net/nfb: support setting RS-FEC mode (44 chars) ✓
### Summary
Implements FEC (Forward Error Correction) get/set operations via MDIO PMA RS-FEC control register. Supports RS-FEC enable/disable; rejects AUTO mode.
### Errors
**Error 1: Same NULL check issue as Patch 3**
```c
static int
nfb_eth_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
{
// ...
if (!intl->max_eth)
return 0;
if_info = &intl->eth_node[0].if_info; // <-- dereference without NULL check
```
Location: `nfb_eth_fec_get()` and `nfb_eth_fec_set()`
**Suggested fix**: Add NULL check in both functions:
```c
if (!intl->max_eth || !intl->eth_node)
return 0;
```
---
## PATCH 5/7: net/nfb: support setting Rx MTU
**Subject**: net/nfb: support setting Rx MTU (38 chars) ✓
### Summary
Implements MTU setting by querying maximum frame length capability from all RX MACs, taking minimum, and configuring all MACs with requested MTU.
### Status: ✓ No errors found
The logic correctly handles the case of no RX MACs (`if (!intl->max_rxmac) return 0`), queries capability limits, validates against minimum capability, and applies MTU to all MACs.
One minor observation: `status.frame_length_max_capable` is initialized to 0, and the function checks `frame_length_max_capable != 0` before rejecting MTU. This allows unlimited MTU if all MACs report 0 capability (meaning unlimited). This seems intentional.
---
## PATCH 6/7: net/nfb: read total stats from macs
**Subject**: net/nfb: read total stats from macs (41 chars) ✓
### Summary
Aggregates statistics from all MAC instances instead of reading from queues. Changes `nfb_eth_stats_get()` to sum across all RX/TX MACs.
### Status: ✓ No errors found
The aggregation logic is straightforward and correct. Iterates over all MACs and accumulates statistics into the stats structure.
---
## PATCH 7/7: doc/nfb: update release notes for nfb driver
**Subject**: doc/nfb: update release notes for nfb driver (52 chars) ✓
### Status: ✓ Not reviewed (documentation)
Documentation patch - should verify that release notes accurately describe all changes in the series.
---
## Summary - Bundle 1747
### Critical Issues: 3
1. **Patch 2/7**: Resource leak - MDIO handles not closed on error path in `nfb_nc_eth_init()`
2. **Patch 3/7**: Missing NULL check before accessing `eth_node[0]` in `nfb_eth_dev_set_link()`
3. **Patch 4/7**: Missing NULL check before accessing `eth_node[0]` in `nfb_eth_fec_get()` and `nfb_eth_fec_set()`
### All Patches: Format ✓
- Proper Signed-off-by tags ✓
- Subject lines within 60 chars ✓
- Commit message format correct ✓
---
## Recommended Actions
### Must Fix:
1. **Patch 2**: Add MDIO handle cleanup loop on error paths
2. **Patches 3-4**: Add NULL check for `eth_node` before accessing array element
### Pattern to Apply:
For all functions accessing `intl->eth_node[0]`, use:
```c
if (!intl->max_eth || !intl->eth_node)
return 0; // or appropriate error code
```
This defensive pattern prevents crashes if initialization invariants are violated.
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH 0/7] net/nfb: ethernet enhancements
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
` (7 preceding siblings ...)
2026-02-10 0:33 ` [PATCH 0/7] net/nfb: ethernet enhancements Stephen Hemminger
@ 2026-02-12 18:52 ` Stephen Hemminger
2026-02-17 11:03 ` [PATCH v2 0/6] " spinler
9 siblings, 0 replies; 21+ messages in thread
From: Stephen Hemminger @ 2026-02-12 18:52 UTC (permalink / raw)
To: spinler; +Cc: dev
On Fri, 6 Feb 2026 18:04:28 +0100
spinler@cesnet.cz wrote:
> From: Martin Spinler <spinler@cesnet.cz>
>
> This set includes minor enhancements to the Ethernet
> configuration and overall usage.
>
> ---
> Depends-on: series-37261 ("net/nfb: rework to real multiport")
>
> Martin Spinler (7):
> net/nfb: use MAC address assigned to card
> net/nfb: get correct link speed
> net/nfb: support real link-up/down config
> net/nfb: support setting RS-FEC mode
> net/nfb: support setting Rx MTU
> net/nfb: read total stats from macs
> doc/nfb: update release notes for nfb driver
>
> doc/guides/rel_notes/release_26_03.rst | 3 +-
> drivers/net/nfb/meson.build | 1 +
> drivers/net/nfb/nfb.h | 7 +
> drivers/net/nfb/nfb_ethdev.c | 228 +++++++++++++++++++++----
> drivers/net/nfb/nfb_mdio.c | 42 +++++
> drivers/net/nfb/nfb_mdio.h | 34 ++++
> drivers/net/nfb/nfb_stats.c | 40 +++--
> 7 files changed, 308 insertions(+), 47 deletions(-)
> create mode 100644 drivers/net/nfb/nfb_mdio.c
> create mode 100644 drivers/net/nfb/nfb_mdio.h
>
Less issues in this but AI did find some errors around checking values.
AI is pickier than is fully required, just figured you might want
to look at these. Since this patch depends on multiport
will defer this until that is updated.
The highest priority item is the unchecked MDIO read in
nfb_mdio_cl45_pma_get_speed_capa() — a failed read gets silently
interpreted as a capability bitmask, which could advertise nonsensical
speeds to applications.
# Review: NFB PMD Enhancement Series (7 Patches)
**Series**: `[PATCH 1/7]` through `[PATCH 7/7]`
**Author**: Martin Spinler `<spinler@cesnet.cz>`
**Delegate**: Stephen Hemminger
This series adds hardware feature support to the NFB PMD, building on the multi-port architecture from the preceding series. It covers: card-assigned MAC addresses, MDIO-based link speed, PMA link up/down control, RS-FEC configuration, RX MTU setting, and MAC-counter-based statistics.
---
### Patch 2/7: `net/nfb: get correct link speed`
Introduces MDIO infrastructure (`nfb_mdio.c` / `nfb_mdio.h`), `eth_node` array in `pmd_internals`, and PMA register-based speed capability and link speed reporting.
**Error: `nfb_mdio_cl45_pma_get_speed_capa()` does not check for MDIO read failure**
```c
reg = nfb_mdio_if_read_pma(info, NFB_MDIO_PMA_SPEED_ABILITY);
for (i = 0; i < NFB_MDIO_WIDTH; i++) {
if (reg & NFB_MDIO_BIT(i))
*capa |= speed_ability[i];
}
```
`mdio_read` can return negative values on error. A negative `reg` gets interpreted as a bitmask, producing garbage speed capability flags advertised to the application.
**Fix**: Check `if (reg < 0) return;` before the loop.
**Confidence**: ~85%.
**Warning: `nfb_mdio.h` missing include guard**
The header has no `#ifndef _NFB_MDIO_H_` / `#define _NFB_MDIO_H_` guard. Multiple or transitive inclusion could cause redefinition errors for the `static inline` functions and macros.
**Confidence**: ~80%.
**Warning: `eth_node` population loop lacks bounds check**
```c
intl->eth_node = calloc(ifc->eth_cnt, sizeof(*intl->eth_node));
// ...
eth = 0;
for (i = 0; i < mi->eth_cnt; i++) {
if (mi->eth[i].ifc != ifc->id)
continue;
// ... populate intl->eth_node[eth] ...
eth++;
}
```
Allocated with `ifc->eth_cnt` elements. If the firmware map has more matching entries, `eth` overflows the allocation. Same pattern exists for `rxm`/`txm` in the base series, but this patch extends it to a third array.
**Confidence**: ~55%.
---
### Patch 3/7: `net/nfb: support real link-up/down config`
Adds PMA reset bit manipulation for link up/down.
**Warning: MACs left in inconsistent state on MDIO failure**
```c
for (i = 0; i < internals->max_rxmac; ++i)
nc_rxmac_enable(internals->rxmac[i]);
for (i = 0; i < internals->max_txmac; ++i)
nc_txmac_enable(internals->txmac[i]);
return nfb_eth_dev_set_link(internals, true);
```
If the MDIO PMA write fails, the function returns an error but the MACs have already been enabled. The caller sees failure while the hardware is in a half-configured state (MACs enabled, PMA still in reset). The symmetric problem exists in `set_link_down`.
**Confidence**: ~65%.
---
### Patch 4/7: `net/nfb: support setting RS-FEC mode`
**Error: `nfb_eth_fec_set()` ignores MDIO write return value**
```c
nfb_mdio_if_write_pma(if_info, NFB_MDIO_PMA_RSFEC_CR, reg);
ret = nfb_eth_fec_get(dev, &fec_capa2);
```
The write return value is discarded. If the write fails, the code proceeds to read back and compare — which may coincidentally detect the failure, but the actual error code is lost and the user gets `-EINVAL` instead of `-EIO`.
**Fix**:
```c
ret = nfb_mdio_if_write_pma(if_info, NFB_MDIO_PMA_RSFEC_CR, reg);
if (ret < 0)
return -EIO;
```
**Confidence**: ~75%.
---
### Patch 5/7: `net/nfb: support setting Rx MTU`
**Warning: `uint16_t` MTU addition can overflow**
```c
mtu += RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
```
`mtu` is `uint16_t`. Adding 18 bytes wraps around near `UINT16_MAX`. The driver sets `max_rx_pktlen = (uint32_t)-1` in `dev_info`, so ethdev's validation won't reject unreasonably large MTU values.
**Fix**: Promote to `uint32_t` before the addition, or set a realistic `max_rx_pktlen` in `dev_info_get`.
**Confidence**: ~70%.
---
### Patch 6/7: `net/nfb: read total stats from macs`
**Warning: `ierrors` subtraction may underflow**
```c
stats->ierrors += rx_cntrs.cnt_drop - rx_cntrs.cnt_overflowed;
```
If firmware counters are inconsistent and `cnt_overflowed > cnt_drop`, this produces a large wrapped unsigned value. A guard would be safer:
```c
if (rx_cntrs.cnt_drop >= rx_cntrs.cnt_overflowed)
stats->ierrors += rx_cntrs.cnt_drop - rx_cntrs.cnt_overflowed;
```
**Confidence**: ~55%.
---
## Summary
| Severity | Patch | Finding |
|----------|-------|---------|
| **Error** | 2/7 | `nfb_mdio_cl45_pma_get_speed_capa()` doesn't check for negative MDIO read return — garbage speed capabilities on error |
| **Error** | 4/7 | `nfb_eth_fec_set()` ignores MDIO write return value |
| **Warning** | 2/7 | `nfb_mdio.h` missing include guard |
| **Warning** | 2/7 | `eth_node` population loop lacks bounds check against allocated size |
| **Warning** | 3/7 | `set_link_up`/`set_link_down` leaves MACs inconsistent if MDIO fails |
| **Warning** | 5/7 | `uint16_t` MTU overflow; `max_rx_pktlen = (uint32_t)-1` lets it through |
| **Warning** | 6/7 | `ierrors` subtraction can underflow |
Patches 1/7 and 7/7 have no issues.
^ permalink raw reply [flat|nested] 21+ messages in thread* [PATCH v2 0/6] net/nfb: ethernet enhancements
2026-02-06 17:04 [PATCH 0/7] net/nfb: ethernet enhancements spinler
` (8 preceding siblings ...)
2026-02-12 18:52 ` Stephen Hemminger
@ 2026-02-17 11:03 ` spinler
2026-02-17 11:03 ` [PATCH v2 1/6] net/nfb: use MAC address assigned to card spinler
` (6 more replies)
9 siblings, 7 replies; 21+ messages in thread
From: spinler @ 2026-02-17 11:03 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
This set includes minor enhancements to the Ethernet
configuration and overall usage.
---
Depends-on: series-37385 ("net/nfb: rework to real multiport")
v2:
* P2/7: close MDIO handles in error path of nfb_nc_eth_init
* P2/7: add bounds check for eth_node population
* P2/7: add check for nfb_mdio_if_read_pma() return value
in nfb_mdio_cl45_pma_get_speed_capa()
* P2/7: add include guard to nfb_mdio.h
* P3/7: move nfb_eth_dev_set_link() (PMA configuration)
before MAC enable/disable call to avoid inconsistency on failure
* P4/7: add check for nfb_mdio_if_write_pma() return value
* P5/7: set dev_info->max_mtu
* P5/7: add frame_len_max_cap to struct pmd_priv; used in MTU configuration
* P5/7: extract nfb_mac_read_frame_len_max_cap() from nfb_eth_mtu_set()
* P5/7: check for MTU overflow
* P6/7: use direct value for stats->ierrors from rx_cntrs
* P7/7: remove this patch completely and distribute release notes update
to matching patches
Martin Spinler (6):
net/nfb: use MAC address assigned to card
net/nfb: get correct link speed
net/nfb: support real link-up/down config
net/nfb: support setting RS-FEC mode
net/nfb: support setting Rx MTU
net/nfb: read total stats from macs
doc/guides/rel_notes/release_26_03.rst | 3 +-
drivers/net/nfb/meson.build | 1 +
drivers/net/nfb/nfb.h | 8 +
drivers/net/nfb/nfb_ethdev.c | 247 +++++++++++++++++++++----
drivers/net/nfb/nfb_mdio.c | 44 +++++
drivers/net/nfb/nfb_mdio.h | 39 ++++
drivers/net/nfb/nfb_stats.c | 40 ++--
7 files changed, 335 insertions(+), 47 deletions(-)
create mode 100644 drivers/net/nfb/nfb_mdio.c
create mode 100644 drivers/net/nfb/nfb_mdio.h
--
2.53.0
^ permalink raw reply [flat|nested] 21+ messages in thread* [PATCH v2 1/6] net/nfb: use MAC address assigned to card
2026-02-17 11:03 ` [PATCH v2 0/6] " spinler
@ 2026-02-17 11:03 ` spinler
2026-02-17 11:03 ` [PATCH v2 2/6] net/nfb: get correct link speed spinler
` (5 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-17 11:03 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Check for a specific MAC address assigned to a card.
If there is no assigned MAC address, then use a random MAC as fallback.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
drivers/net/nfb/nfb_ethdev.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index 9737ccc65b..b99785cc22 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -11,6 +11,7 @@
#include <nfb/nfb.h>
#include <nfb/ndp.h>
+#include <netcope/eth.h>
#include <netcope/rxmac.h>
#include <netcope/txmac.h>
@@ -665,10 +666,14 @@ nfb_eth_dev_init(struct rte_eth_dev *dev, void *init_data)
goto err_malloc_mac_addrs;
}
- rte_eth_random_addr(eth_addr_init.addr_bytes);
- eth_addr_init.addr_bytes[0] = eth_addr.addr_bytes[0];
- eth_addr_init.addr_bytes[1] = eth_addr.addr_bytes[1];
- eth_addr_init.addr_bytes[2] = eth_addr.addr_bytes[2];
+ ret = nc_ifc_get_default_mac(internals->nfb, ifc->id, eth_addr_init.addr_bytes,
+ sizeof(eth_addr_init.addr_bytes));
+ if (ret != 0) {
+ rte_eth_random_addr(eth_addr_init.addr_bytes);
+ eth_addr_init.addr_bytes[0] = eth_addr.addr_bytes[0];
+ eth_addr_init.addr_bytes[1] = eth_addr.addr_bytes[1];
+ eth_addr_init.addr_bytes[2] = eth_addr.addr_bytes[2];
+ }
nfb_eth_mac_addr_set(dev, ð_addr_init);
rte_ether_addr_copy(ð_addr_init, &data->mac_addrs[0]);
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v2 2/6] net/nfb: get correct link speed
2026-02-17 11:03 ` [PATCH v2 0/6] " spinler
2026-02-17 11:03 ` [PATCH v2 1/6] net/nfb: use MAC address assigned to card spinler
@ 2026-02-17 11:03 ` spinler
2026-02-17 11:03 ` [PATCH v2 3/6] net/nfb: support real link-up/down config spinler
` (4 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-17 11:03 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Read link speed capabilities and actual link speed
from the MDIO registers.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
doc/guides/rel_notes/release_26_03.rst | 2 +-
drivers/net/nfb/meson.build | 1 +
drivers/net/nfb/nfb.h | 7 +++
drivers/net/nfb/nfb_ethdev.c | 82 +++++++++++++++++++-------
drivers/net/nfb/nfb_mdio.c | 44 ++++++++++++++
drivers/net/nfb/nfb_mdio.h | 39 ++++++++++++
6 files changed, 153 insertions(+), 22 deletions(-)
create mode 100644 drivers/net/nfb/nfb_mdio.c
create mode 100644 drivers/net/nfb/nfb_mdio.h
diff --git a/doc/guides/rel_notes/release_26_03.rst b/doc/guides/rel_notes/release_26_03.rst
index 7678cf1a49..d408551955 100644
--- a/doc/guides/rel_notes/release_26_03.rst
+++ b/doc/guides/rel_notes/release_26_03.rst
@@ -64,7 +64,7 @@ New Features
* The timestamp value has been updated to make it usable.
* The DPDK port now represents just one Ethernet port instead of all Ethernet ports on the NIC.
* All ports are used by default, but a subset can be selected using the ``port`` argument.
- * Report firmware version.
+ * Report firmware version and correct Ethernet link speed.
* Common CESNET-NDK-based adapters have been added,
including the FB2CGHH (Silicom Denmark) and XpressSX AGI-FH400G (Reflex CES).
diff --git a/drivers/net/nfb/meson.build b/drivers/net/nfb/meson.build
index 9e458dfb4a..b57d1d48fa 100644
--- a/drivers/net/nfb/meson.build
+++ b/drivers/net/nfb/meson.build
@@ -21,6 +21,7 @@ sources = files(
'nfb_rxmode.c',
'nfb_stats.c',
'nfb_tx.c',
+ 'nfb_mdio.c',
)
cflags += no_wvla_cflag
diff --git a/drivers/net/nfb/nfb.h b/drivers/net/nfb/nfb.h
index 1d863d5ad7..3b905bbb3b 100644
--- a/drivers/net/nfb/nfb.h
+++ b/drivers/net/nfb/nfb.h
@@ -11,6 +11,7 @@
#include <nfb/ndp.h>
#include <netcope/rxmac.h>
#include <netcope/txmac.h>
+#include <netcope/mdio_if_info.h>
#include <netcope/info.h>
extern int nfb_logtype;
@@ -50,6 +51,10 @@ extern int nfb_logtype;
NFB_ARG_PORT "=<number>" \
""
+struct eth_node {
+ struct mdio_if_info if_info; /**< MDIO interface handles */
+};
+
/*
* Handles obtained from the libnfb: each process must use own instance.
* Stored inside dev->process_private.
@@ -57,8 +62,10 @@ extern int nfb_logtype;
struct pmd_internals {
uint16_t max_rxmac; /**< Count of valid rxmac items */
uint16_t max_txmac; /**< Count of valid txmac items */
+ uint16_t max_eth; /**< Count of valid eth nodes */
struct nc_rxmac **rxmac; /**< Array of Rx MAC handles */
struct nc_txmac **txmac; /**< Array of Tx MAC handles */
+ struct eth_node *eth_node; /**< Array of Eth nodes */
struct nfb_device *nfb;
TAILQ_ENTRY(pmd_internals) eth_dev_list; /**< Item in list of all devices */
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index b99785cc22..9b173c0f89 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -14,6 +14,8 @@
#include <netcope/eth.h>
#include <netcope/rxmac.h>
#include <netcope/txmac.h>
+#include <netcope/mdio.h>
+#include <netcope/ieee802_3.h>
#include <ethdev_pci.h>
#include <rte_kvargs.h>
@@ -24,6 +26,8 @@
#include "nfb_rxmode.h"
#include "nfb.h"
+#include "nfb_mdio.h"
+
static const char * const VALID_KEYS[] = {
NFB_ARG_PORT,
NULL
@@ -48,6 +52,18 @@ static struct nfb_pmd_internals_head nfb_eth_dev_list =
static int nfb_eth_dev_uninit(struct rte_eth_dev *dev);
+static int
+nfb_mdio_read(void *priv, int prtad, int devad, uint16_t addr)
+{
+ return nc_mdio_read((struct nc_mdio *)priv, prtad, devad, addr);
+}
+
+static int
+nfb_mdio_write(void *priv, int prtad, int devad, uint16_t addr, uint16_t val)
+{
+ return nc_mdio_write((struct nc_mdio *)priv, prtad, devad, addr, val);
+}
+
/**
* Default MAC addr
*/
@@ -67,10 +83,17 @@ static int
nfb_nc_eth_init(struct pmd_internals *intl, struct nfb_ifc_create_params *params)
{
int ret;
- int i, rxm, txm;
+ int i, rxm, txm, eth;
struct nc_ifc_info *ifc = params->ifc_info;
struct nc_ifc_map_info *mi = ¶ms->map_info;
+ int node, node_cp;
+ const int32_t *prop32;
+ int proplen;
+ const void *fdt;
+
+ fdt = nfb_get_fdt(intl->nfb);
+
ret = -ENOMEM;
if (ifc->eth_cnt == 0)
return 0;
@@ -83,14 +106,19 @@ nfb_nc_eth_init(struct pmd_internals *intl, struct nfb_ifc_create_params *params
if (intl->txmac == NULL)
goto err_alloc_txmac;
+ intl->eth_node = calloc(ifc->eth_cnt, sizeof(*intl->eth_node));
+ if (intl->eth_node == NULL)
+ goto err_alloc_ethnode;
+
/* Some eths may not have assigned MAC nodes, hence use separate var for indexing */
rxm = 0;
txm = 0;
+ eth = 0;
for (i = 0; i < mi->eth_cnt; i++) {
if (mi->eth[i].ifc != ifc->id)
continue;
- if (rxm >= ifc->eth_cnt || txm >= ifc->eth_cnt) {
+ if (rxm >= ifc->eth_cnt || txm >= ifc->eth_cnt || eth >= ifc->eth_cnt) {
NFB_LOG(ERR, "MAC mapping inconsistent");
ret = -EINVAL;
goto err_map_inconsistent;
@@ -103,17 +131,37 @@ nfb_nc_eth_init(struct pmd_internals *intl, struct nfb_ifc_create_params *params
intl->txmac[txm] = nc_txmac_open(intl->nfb, mi->eth[i].node_txmac);
if (intl->txmac[txm])
txm++;
+
+ node = nc_eth_get_pcspma_control_node(fdt, mi->eth[i].node_eth, &node_cp);
+
+ intl->eth_node[eth].if_info.dev = nc_mdio_open(intl->nfb, node, node_cp);
+ if (intl->eth_node[eth].if_info.dev) {
+ intl->eth_node[eth].if_info.prtad = 0;
+ intl->eth_node[eth].if_info.mdio_read = nfb_mdio_read;
+ intl->eth_node[eth].if_info.mdio_write = nfb_mdio_write;
+
+ prop32 = fdt_getprop(fdt, node_cp, "dev", &proplen);
+ if (proplen == sizeof(*prop32))
+ intl->eth_node[eth].if_info.prtad = fdt32_to_cpu(*prop32);
+
+ eth++;
+ }
}
intl->max_rxmac = rxm;
intl->max_txmac = txm;
+ intl->max_eth = eth;
return 0;
err_map_inconsistent:
+ for (i = 0; i < eth; i++)
+ nc_mdio_close(intl->eth_node[i].if_info.dev);
for (i = 0; i < txm; i++)
nc_txmac_close(intl->txmac[i]);
for (i = 0; i < rxm; i++)
nc_rxmac_close(intl->rxmac[i]);
+ free(intl->eth_node);
+err_alloc_ethnode:
free(intl->txmac);
err_alloc_txmac:
free(intl->rxmac);
@@ -130,6 +178,8 @@ static void
nfb_nc_eth_deinit(struct pmd_internals *intl)
{
uint16_t i;
+ for (i = 0; i < intl->max_eth; i++)
+ nc_mdio_close(intl->eth_node[i].if_info.dev);
for (i = 0; i < intl->max_txmac; i++)
nc_txmac_close(intl->txmac[i]);
for (i = 0; i < intl->max_rxmac; i++)
@@ -276,16 +326,22 @@ nfb_eth_dev_info(struct rte_eth_dev *dev,
struct rte_eth_dev_info *dev_info)
{
struct pmd_priv *priv = dev->data->dev_private;
+ struct pmd_internals *intl = dev->process_private;
dev_info->max_mac_addrs = nfb_eth_get_max_mac_address_count(dev);
dev_info->max_rx_pktlen = (uint32_t)-1;
dev_info->max_rx_queues = priv->max_rx_queues;
dev_info->max_tx_queues = priv->max_tx_queues;
- dev_info->speed_capa = RTE_ETH_LINK_SPEED_100G;
+ dev_info->speed_capa = RTE_ETH_LINK_SPEED_FIXED;
dev_info->rx_offload_capa =
RTE_ETH_RX_OFFLOAD_TIMESTAMP;
+ if (intl->max_eth) {
+ nfb_mdio_cl45_pma_get_speed_capa(&intl->eth_node[0].if_info,
+ &dev_info->speed_capa);
+ }
+
return 0;
}
@@ -353,24 +409,8 @@ nfb_eth_link_update(struct rte_eth_dev *dev,
link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
link.link_autoneg = RTE_ETH_LINK_SPEED_FIXED;
- if (internals->max_rxmac) {
- nc_rxmac_read_status(internals->rxmac[0], &status);
-
- switch (status.speed) {
- case MAC_SPEED_10G:
- link.link_speed = RTE_ETH_SPEED_NUM_10G;
- break;
- case MAC_SPEED_40G:
- link.link_speed = RTE_ETH_SPEED_NUM_40G;
- break;
- case MAC_SPEED_100G:
- link.link_speed = RTE_ETH_SPEED_NUM_100G;
- break;
- default:
- link.link_speed = RTE_ETH_SPEED_NUM_NONE;
- break;
- }
- }
+ if (internals->max_eth)
+ link.link_speed = ieee802_3_get_pma_speed_value(&internals->eth_node->if_info);
for (i = 0; i < internals->max_rxmac; ++i) {
nc_rxmac_read_status(internals->rxmac[i], &status);
diff --git a/drivers/net/nfb/nfb_mdio.c b/drivers/net/nfb/nfb_mdio.c
new file mode 100644
index 0000000000..a4a827e734
--- /dev/null
+++ b/drivers/net/nfb/nfb_mdio.c
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2026 CESNET, z.s.p.o.
+ */
+
+#include <eal_export.h>
+#include <rte_ethdev.h>
+
+#include "nfb_mdio.h"
+
+RTE_EXPORT_INTERNAL_SYMBOL(nfb_mdio_cl45_pma_get_speed_capa)
+void
+nfb_mdio_cl45_pma_get_speed_capa(struct mdio_if_info *info, uint32_t *capa)
+{
+ int i;
+ int reg;
+
+ const int speed_ability[NFB_MDIO_WIDTH] = {
+ RTE_ETH_LINK_SPEED_10G,
+ 0,
+ 0,
+ RTE_ETH_LINK_SPEED_50G,
+ RTE_ETH_LINK_SPEED_1G,
+ RTE_ETH_LINK_SPEED_100M,
+ RTE_ETH_LINK_SPEED_10M,
+ 0,
+ RTE_ETH_LINK_SPEED_40G,
+ RTE_ETH_LINK_SPEED_100G,
+ 0,
+ RTE_ETH_LINK_SPEED_25G,
+ RTE_ETH_LINK_SPEED_200G,
+ RTE_ETH_LINK_SPEED_2_5G,
+ RTE_ETH_LINK_SPEED_5G,
+ RTE_ETH_LINK_SPEED_400G,
+ };
+
+ reg = nfb_mdio_if_read_pma(info, NFB_MDIO_PMA_SPEED_ABILITY);
+ if (reg < 0)
+ return;
+
+ for (i = 0; i < NFB_MDIO_WIDTH; i++) {
+ if (reg & NFB_MDIO_BIT(i))
+ *capa |= speed_ability[i];
+ }
+}
diff --git a/drivers/net/nfb/nfb_mdio.h b/drivers/net/nfb/nfb_mdio.h
new file mode 100644
index 0000000000..7cafe17dc5
--- /dev/null
+++ b/drivers/net/nfb/nfb_mdio.h
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2026 CESNET, z.s.p.o.
+ */
+
+#ifndef _NFB_MDIO_H_
+#define _NFB_MDIO_H_
+
+#include <stdint.h>
+#include <rte_bitops.h>
+#include <netcope/mdio_if_info.h>
+
+
+#define NFB_MDIO_WIDTH (UINT16_WIDTH)
+#define NFB_MDIO_BIT(nr) (UINT16_C(1) << (nr))
+
+#define NFB_MDIO_DEV_PMA 1
+
+#define NFB_MDIO_PMA_CTRL 0
+#define NFB_MDIO_PMA_CTRL_RESET NFB_MDIO_BIT(15)
+
+#define NFB_MDIO_PMA_SPEED_ABILITY 4
+
+#define NFB_MDIO_PMA_RSFEC_CR 200
+#define NFB_MDIO_PMA_RSFEC_CR_ENABLE NFB_MDIO_BIT(2)
+
+static inline int nfb_mdio_if_read_pma(struct mdio_if_info *if_info, uint16_t addr)
+{
+ return if_info->mdio_read(if_info->dev, if_info->prtad, NFB_MDIO_DEV_PMA, addr);
+}
+
+static inline int nfb_mdio_if_write_pma(struct mdio_if_info *if_info, uint16_t addr, uint16_t val)
+{
+ return if_info->mdio_write(if_info->dev, if_info->prtad, NFB_MDIO_DEV_PMA, addr, val);
+}
+
+__rte_internal
+void nfb_mdio_cl45_pma_get_speed_capa(struct mdio_if_info *if_info, uint32_t *capa);
+
+#endif /* _NFB_MDIO_H_ */
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v2 3/6] net/nfb: support real link-up/down config
2026-02-17 11:03 ` [PATCH v2 0/6] " spinler
2026-02-17 11:03 ` [PATCH v2 1/6] net/nfb: use MAC address assigned to card spinler
2026-02-17 11:03 ` [PATCH v2 2/6] net/nfb: get correct link speed spinler
@ 2026-02-17 11:03 ` spinler
2026-02-17 11:03 ` [PATCH v2 4/6] net/nfb: support setting RS-FEC mode spinler
` (3 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-17 11:03 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Use the standard PMA reset bit in the MDIO registers
to configure of the link-up/link-down state.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
doc/guides/rel_notes/release_26_03.rst | 1 +
drivers/net/nfb/nfb_ethdev.c | 42 +++++++++++++++++++++++---
2 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/doc/guides/rel_notes/release_26_03.rst b/doc/guides/rel_notes/release_26_03.rst
index d408551955..8a7e1010fb 100644
--- a/doc/guides/rel_notes/release_26_03.rst
+++ b/doc/guides/rel_notes/release_26_03.rst
@@ -67,6 +67,7 @@ New Features
* Report firmware version and correct Ethernet link speed.
* Common CESNET-NDK-based adapters have been added,
including the FB2CGHH (Silicom Denmark) and XpressSX AGI-FH400G (Reflex CES).
+ * Added support for configuration of the Link Up / Link Down state.
Removed Items
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index 9b173c0f89..abb108a280 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -426,6 +426,29 @@ nfb_eth_link_update(struct rte_eth_dev *dev,
return 0;
}
+static int
+nfb_eth_dev_set_link(struct pmd_internals *intl, bool val)
+{
+ int reg;
+ struct mdio_if_info *if_info;
+
+ if (!intl->max_eth)
+ return 0;
+
+ if_info = &intl->eth_node[0].if_info;
+
+ reg = nfb_mdio_if_read_pma(if_info, NFB_MDIO_PMA_CTRL);
+ if (reg < 0)
+ return reg;
+
+ /* Update PMA Reset flag if necessary (Reset flag set means link down) */
+ if ((reg & NFB_MDIO_PMA_CTRL_RESET) != (val ? 0 : NFB_MDIO_PMA_CTRL_RESET)) {
+ reg ^= NFB_MDIO_PMA_CTRL_RESET;
+ return nfb_mdio_if_write_pma(if_info, NFB_MDIO_PMA_CTRL, reg);
+ }
+ return 0;
+}
+
/**
* DPDK callback to bring the link UP.
*
@@ -438,10 +461,14 @@ nfb_eth_link_update(struct rte_eth_dev *dev,
static int
nfb_eth_dev_set_link_up(struct rte_eth_dev *dev)
{
- struct pmd_internals *internals = (struct pmd_internals *)
- dev->process_private;
-
+ int ret;
+ struct pmd_internals *internals = dev->process_private;
uint16_t i;
+
+ ret = nfb_eth_dev_set_link(internals, true);
+ if (ret)
+ return ret;
+
for (i = 0; i < internals->max_rxmac; ++i)
nc_rxmac_enable(internals->rxmac[i]);
@@ -463,10 +490,15 @@ nfb_eth_dev_set_link_up(struct rte_eth_dev *dev)
static int
nfb_eth_dev_set_link_down(struct rte_eth_dev *dev)
{
- struct pmd_internals *internals = (struct pmd_internals *)
- dev->process_private;
+ int ret;
+ struct pmd_internals *internals = dev->process_private;
uint16_t i;
+
+ ret = nfb_eth_dev_set_link(internals, false);
+ if (ret)
+ return ret;
+
for (i = 0; i < internals->max_rxmac; ++i)
nc_rxmac_disable(internals->rxmac[i]);
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v2 4/6] net/nfb: support setting RS-FEC mode
2026-02-17 11:03 ` [PATCH v2 0/6] " spinler
` (2 preceding siblings ...)
2026-02-17 11:03 ` [PATCH v2 3/6] net/nfb: support real link-up/down config spinler
@ 2026-02-17 11:03 ` spinler
2026-02-17 11:03 ` [PATCH v2 5/6] net/nfb: support setting Rx MTU spinler
` (2 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-17 11:03 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Enable basic configuration of the RS-FEC link mode over MDIO.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
doc/guides/rel_notes/release_26_03.rst | 2 +-
drivers/net/nfb/nfb_ethdev.c | 65 ++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_26_03.rst b/doc/guides/rel_notes/release_26_03.rst
index 8a7e1010fb..ac76ac5b67 100644
--- a/doc/guides/rel_notes/release_26_03.rst
+++ b/doc/guides/rel_notes/release_26_03.rst
@@ -67,7 +67,7 @@ New Features
* Report firmware version and correct Ethernet link speed.
* Common CESNET-NDK-based adapters have been added,
including the FB2CGHH (Silicom Denmark) and XpressSX AGI-FH400G (Reflex CES).
- * Added support for configuration of the Link Up / Link Down state.
+ * Added support for configuration of the RS-FEC mode, Link Up / Link Down state.
Removed Items
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index abb108a280..a556ceca67 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -601,6 +601,69 @@ nfb_eth_fw_version_get(struct rte_eth_dev *dev, char *fw_version,
return 0;
}
+static int
+nfb_eth_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
+{
+ int reg;
+ struct pmd_internals *intl = dev->process_private;
+ struct mdio_if_info *if_info;
+
+ *fec_capa = 0;
+ if (!intl->max_eth)
+ return 0;
+
+ if_info = &intl->eth_node[0].if_info;
+
+ reg = nfb_mdio_if_read_pma(if_info, NFB_MDIO_PMA_RSFEC_CR);
+ if (reg < 0)
+ return -EIO;
+
+ *fec_capa = (reg & NFB_MDIO_PMA_RSFEC_CR_ENABLE) ?
+ RTE_ETH_FEC_MODE_CAPA_MASK(RS) :
+ RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
+
+ return 0;
+}
+
+static int
+nfb_eth_fec_set(struct rte_eth_dev *dev, uint32_t fec_capa)
+{
+ int ret;
+ uint32_t fec_capa2 = 0;
+ int reg;
+
+ struct pmd_internals *intl = dev->process_private;
+ struct mdio_if_info *if_info;
+
+ if (!intl->max_eth)
+ return 0;
+
+ if_info = &intl->eth_node[0].if_info;
+
+ if (fec_capa & RTE_ETH_FEC_MODE_CAPA_MASK(AUTO))
+ return -EINVAL;
+
+ reg = nfb_mdio_if_read_pma(if_info, NFB_MDIO_PMA_RSFEC_CR);
+ if (reg < 0)
+ return -EIO;
+
+ reg = (fec_capa & RTE_ETH_FEC_MODE_CAPA_MASK(RS)) ?
+ (reg | NFB_MDIO_PMA_RSFEC_CR_ENABLE) :
+ (reg & ~NFB_MDIO_PMA_RSFEC_CR_ENABLE);
+ ret = nfb_mdio_if_write_pma(if_info, NFB_MDIO_PMA_RSFEC_CR, reg);
+ if (ret < 0)
+ return -EIO;
+
+ ret = nfb_eth_fec_get(dev, &fec_capa2);
+ if (ret)
+ return ret;
+
+ if (fec_capa != fec_capa2)
+ return -EINVAL;
+
+ return 0;
+}
+
static const struct eth_dev_ops ops = {
.dev_start = nfb_eth_dev_start,
.dev_stop = nfb_eth_dev_stop,
@@ -628,6 +691,8 @@ static const struct eth_dev_ops ops = {
.mac_addr_add = nfb_eth_mac_addr_add,
.mac_addr_remove = nfb_eth_mac_addr_remove,
.fw_version_get = nfb_eth_fw_version_get,
+ .fec_get = nfb_eth_fec_get,
+ .fec_set = nfb_eth_fec_set,
};
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v2 5/6] net/nfb: support setting Rx MTU
2026-02-17 11:03 ` [PATCH v2 0/6] " spinler
` (3 preceding siblings ...)
2026-02-17 11:03 ` [PATCH v2 4/6] net/nfb: support setting RS-FEC mode spinler
@ 2026-02-17 11:03 ` spinler
2026-02-17 11:03 ` [PATCH v2 6/6] net/nfb: read total stats from macs spinler
2026-02-18 18:21 ` [PATCH v2 0/6] net/nfb: ethernet enhancements Stephen Hemminger
6 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-17 11:03 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Enable configuration of the MTU on the Rx MAC assigned to the port.
The max MTU value is also reported in dev_info.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
doc/guides/rel_notes/release_26_03.rst | 4 +--
drivers/net/nfb/nfb.h | 1 +
drivers/net/nfb/nfb_ethdev.c | 45 +++++++++++++++++++++++++-
3 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/doc/guides/rel_notes/release_26_03.rst b/doc/guides/rel_notes/release_26_03.rst
index ac76ac5b67..7ce852e349 100644
--- a/doc/guides/rel_notes/release_26_03.rst
+++ b/doc/guides/rel_notes/release_26_03.rst
@@ -64,10 +64,10 @@ New Features
* The timestamp value has been updated to make it usable.
* The DPDK port now represents just one Ethernet port instead of all Ethernet ports on the NIC.
* All ports are used by default, but a subset can be selected using the ``port`` argument.
- * Report firmware version and correct Ethernet link speed.
+ * Report firmware version, correct Ethernet link speed and maximum capable MTU value.
* Common CESNET-NDK-based adapters have been added,
including the FB2CGHH (Silicom Denmark) and XpressSX AGI-FH400G (Reflex CES).
- * Added support for configuration of the RS-FEC mode, Link Up / Link Down state.
+ * Added support for configuration of the RS-FEC mode, Link Up / Link Down state, and the Rx MTU.
Removed Items
diff --git a/drivers/net/nfb/nfb.h b/drivers/net/nfb/nfb.h
index 3b905bbb3b..7d192946bc 100644
--- a/drivers/net/nfb/nfb.h
+++ b/drivers/net/nfb/nfb.h
@@ -84,6 +84,7 @@ struct pmd_priv {
int *queue_map_rx;
/** Mapping from DPDK TX queue index to firmware queue ID */
int *queue_map_tx;
+ uint16_t frame_len_max_cap; /**< Maximum length obtained from Rx MAC */
bool ready; /**< This structure is initialized for usage in secondary process */
};
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index a556ceca67..1093c6edf4 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -51,6 +51,7 @@ static struct nfb_pmd_internals_head nfb_eth_dev_list =
TAILQ_HEAD_INITIALIZER(nfb_eth_dev_list);
static int nfb_eth_dev_uninit(struct rte_eth_dev *dev);
+static int nfb_eth_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
static int
nfb_mdio_read(void *priv, int prtad, int devad, uint16_t addr)
@@ -271,6 +272,10 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
int ret;
struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
+ ret = nfb_eth_mtu_set(dev, dev_conf->rxmode.mtu);
+ if (ret)
+ goto err_mtu_set;
+
if (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
ret = rte_mbuf_dyn_rx_timestamp_register
(&nfb_timestamp_dynfield_offset,
@@ -285,6 +290,7 @@ nfb_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
return 0;
err_ts_register:
+err_mtu_set:
nfb_eth_dev_uninit(dev);
return ret;
}
@@ -330,7 +336,8 @@ nfb_eth_dev_info(struct rte_eth_dev *dev,
dev_info->max_mac_addrs = nfb_eth_get_max_mac_address_count(dev);
- dev_info->max_rx_pktlen = (uint32_t)-1;
+ dev_info->max_rx_pktlen = priv->frame_len_max_cap;
+ dev_info->max_mtu = dev_info->max_rx_pktlen - (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN);
dev_info->max_rx_queues = priv->max_rx_queues;
dev_info->max_tx_queues = priv->max_tx_queues;
dev_info->speed_capa = RTE_ETH_LINK_SPEED_FIXED;
@@ -575,6 +582,39 @@ nfb_eth_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
nc_rxmac_set_mac(internals->rxmac[i], index, 0, 0);
}
+static uint16_t
+nfb_mac_read_frame_len_max_cap(struct pmd_internals *intl)
+{
+ unsigned int i;
+ uint16_t ret = UINT16_MAX;
+ struct nc_rxmac_status status;
+
+ for (i = 0; i < intl->max_rxmac; ++i) {
+ status.frame_length_max_capable = 0;
+ nc_rxmac_read_status(intl->rxmac[i], &status);
+ if (status.frame_length_max_capable && ret > status.frame_length_max_capable)
+ ret = status.frame_length_max_capable;
+ }
+ return ret;
+}
+
+static int
+nfb_eth_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+{
+ unsigned int i;
+ struct pmd_internals *intl = dev->process_private;
+ struct pmd_priv *priv = dev->data->dev_private;
+
+ mtu += RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
+ if (mtu > priv->frame_len_max_cap || mtu < RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN)
+ return -EINVAL;
+
+ for (i = 0; i < intl->max_rxmac; ++i)
+ nc_rxmac_set_frame_length(intl->rxmac[i], mtu, RXMAC_FRAME_LENGTH_MAX);
+
+ return 0;
+}
+
static int
nfb_eth_fw_version_get(struct rte_eth_dev *dev, char *fw_version,
size_t fw_size)
@@ -690,6 +730,7 @@ static const struct eth_dev_ops ops = {
.mac_addr_set = nfb_eth_mac_addr_set,
.mac_addr_add = nfb_eth_mac_addr_add,
.mac_addr_remove = nfb_eth_mac_addr_remove,
+ .mtu_set = nfb_eth_mtu_set,
.fw_version_get = nfb_eth_fw_version_get,
.fec_get = nfb_eth_fec_get,
.fec_set = nfb_eth_fec_set,
@@ -793,6 +834,8 @@ nfb_eth_dev_init(struct rte_eth_dev *dev, void *init_data)
}
}
+ priv->frame_len_max_cap = nfb_mac_read_frame_len_max_cap(internals);
+
/* Allocate space for MAC addresses */
mac_count = nfb_eth_get_max_mac_address_count(dev);
data->mac_addrs = rte_zmalloc(data->name,
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v2 6/6] net/nfb: read total stats from macs
2026-02-17 11:03 ` [PATCH v2 0/6] " spinler
` (4 preceding siblings ...)
2026-02-17 11:03 ` [PATCH v2 5/6] net/nfb: support setting Rx MTU spinler
@ 2026-02-17 11:03 ` spinler
2026-02-18 18:21 ` [PATCH v2 0/6] net/nfb: ethernet enhancements Stephen Hemminger
6 siblings, 0 replies; 21+ messages in thread
From: spinler @ 2026-02-17 11:03 UTC (permalink / raw)
To: dev; +Cc: Martin Spinler
From: Martin Spinler <spinler@cesnet.cz>
Both the Rx and Tx MAC components in firmware provide basic statistics.
Use these statistics instead of the sum of the per-queue counters.
Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
drivers/net/nfb/nfb_stats.c | 40 +++++++++++++++++++++++--------------
1 file changed, 25 insertions(+), 15 deletions(-)
diff --git a/drivers/net/nfb/nfb_stats.c b/drivers/net/nfb/nfb_stats.c
index 27a01c3160..f0a1c8a7e0 100644
--- a/drivers/net/nfb/nfb_stats.c
+++ b/drivers/net/nfb/nfb_stats.c
@@ -14,11 +14,11 @@ nfb_eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
uint16_t i;
uint16_t nb_rx = dev->data->nb_rx_queues;
uint16_t nb_tx = dev->data->nb_tx_queues;
- uint64_t rx_total = 0;
- uint64_t tx_total = 0;
- uint64_t tx_err_total = 0;
- uint64_t rx_total_bytes = 0;
- uint64_t tx_total_bytes = 0;
+
+ int ret;
+ struct pmd_internals *internals = dev->process_private;
+ struct nc_rxmac_counters rx_cntrs;
+ struct nc_txmac_counters tx_cntrs;
struct ndp_rx_queue *rx_queue;
struct ndp_tx_queue *tx_queue;
@@ -29,8 +29,6 @@ nfb_eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
qstats->q_ipackets[i] = rx_queue->rx_pkts;
qstats->q_ibytes[i] = rx_queue->rx_bytes;
}
- rx_total += rx_queue->rx_pkts;
- rx_total_bytes += rx_queue->rx_bytes;
}
for (i = 0; i < nb_tx; i++) {
@@ -39,16 +37,28 @@ nfb_eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
qstats->q_opackets[i] = tx_queue->tx_pkts;
qstats->q_obytes[i] = tx_queue->tx_bytes;
}
- tx_total += tx_queue->tx_pkts;
- tx_total_bytes += tx_queue->tx_bytes;
- tx_err_total += tx_queue->err_pkts;
}
- stats->ipackets = rx_total;
- stats->opackets = tx_total;
- stats->ibytes = rx_total_bytes;
- stats->obytes = tx_total_bytes;
- stats->oerrors = tx_err_total;
+ for (i = 0; i < internals->max_rxmac; i++) {
+ ret = nc_rxmac_read_counters(internals->rxmac[i], &rx_cntrs, NULL);
+ if (ret)
+ return -EIO;
+
+ stats->ipackets += rx_cntrs.cnt_received;
+ stats->ibytes += rx_cntrs.cnt_octets;
+ stats->ierrors += rx_cntrs.cnt_erroneous;
+ stats->imissed += rx_cntrs.cnt_overflowed;
+ }
+
+ for (i = 0; i < internals->max_txmac; i++) {
+ ret = nc_txmac_read_counters(internals->txmac[i], &tx_cntrs);
+ if (ret)
+ return -EIO;
+
+ stats->opackets += tx_cntrs.cnt_sent;
+ stats->obytes += tx_cntrs.cnt_octets;
+ stats->oerrors += tx_cntrs.cnt_drop;
+ }
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v2 0/6] net/nfb: ethernet enhancements
2026-02-17 11:03 ` [PATCH v2 0/6] " spinler
` (5 preceding siblings ...)
2026-02-17 11:03 ` [PATCH v2 6/6] net/nfb: read total stats from macs spinler
@ 2026-02-18 18:21 ` Stephen Hemminger
6 siblings, 0 replies; 21+ messages in thread
From: Stephen Hemminger @ 2026-02-18 18:21 UTC (permalink / raw)
To: spinler; +Cc: dev
On Tue, 17 Feb 2026 12:03:18 +0100
spinler@cesnet.cz wrote:
> From: Martin Spinler <spinler@cesnet.cz>
>
> This set includes minor enhancements to the Ethernet
> configuration and overall usage.
>
> ---
> Depends-on: series-37385 ("net/nfb: rework to real multiport")
>
> v2:
> * P2/7: close MDIO handles in error path of nfb_nc_eth_init
> * P2/7: add bounds check for eth_node population
> * P2/7: add check for nfb_mdio_if_read_pma() return value
> in nfb_mdio_cl45_pma_get_speed_capa()
> * P2/7: add include guard to nfb_mdio.h
> * P3/7: move nfb_eth_dev_set_link() (PMA configuration)
> before MAC enable/disable call to avoid inconsistency on failure
> * P4/7: add check for nfb_mdio_if_write_pma() return value
> * P5/7: set dev_info->max_mtu
> * P5/7: add frame_len_max_cap to struct pmd_priv; used in MTU configuration
> * P5/7: extract nfb_mac_read_frame_len_max_cap() from nfb_eth_mtu_set()
> * P5/7: check for MTU overflow
> * P6/7: use direct value for stats->ierrors from rx_cntrs
> * P7/7: remove this patch completely and distribute release notes update
> to matching patches
>
> Martin Spinler (6):
> net/nfb: use MAC address assigned to card
> net/nfb: get correct link speed
> net/nfb: support real link-up/down config
> net/nfb: support setting RS-FEC mode
> net/nfb: support setting Rx MTU
> net/nfb: read total stats from macs
>
> doc/guides/rel_notes/release_26_03.rst | 3 +-
> drivers/net/nfb/meson.build | 1 +
> drivers/net/nfb/nfb.h | 8 +
> drivers/net/nfb/nfb_ethdev.c | 247 +++++++++++++++++++++----
> drivers/net/nfb/nfb_mdio.c | 44 +++++
> drivers/net/nfb/nfb_mdio.h | 39 ++++
> drivers/net/nfb/nfb_stats.c | 40 ++--
> 7 files changed, 335 insertions(+), 47 deletions(-)
> create mode 100644 drivers/net/nfb/nfb_mdio.c
> create mode 100644 drivers/net/nfb/nfb_mdio.h
>
Queued all these to next-net with small change to avoid overflow when
computing mtu.
^ permalink raw reply [flat|nested] 21+ messages in thread