Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 May 2026 19:11:59 +0000
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 9d423705db8b - main - dpaa: Support jumbo frames as multi-buffer frames
Message-ID:  <69f79dff.3c75e.55a019b1@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d423705db8b4188ed7c02d31b93393f0f8e680e

commit 9d423705db8b4188ed7c02d31b93393f0f8e680e
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2026-04-29 20:22:56 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2026-05-03 19:09:30 +0000

    dpaa: Support jumbo frames as multi-buffer frames
---
 sys/dev/dpaa/dpaa_eth.c | 25 ++++++++++++++++++++++---
 sys/dev/dpaa/if_memac.c |  3 ++-
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/sys/dev/dpaa/dpaa_eth.c b/sys/dev/dpaa/dpaa_eth.c
index 95e2c57e014e..6424a6e0b0c3 100644
--- a/sys/dev/dpaa/dpaa_eth.c
+++ b/sys/dev/dpaa/dpaa_eth.c
@@ -360,7 +360,8 @@ dpaa_eth_fq_rx_callback(device_t portal, struct qman_fq *fq,
 
 	frame_va = DPAA_FD_GET_ADDR(frame);
 	frame_ic = frame_va;	/* internal context at head of the frame */
-	KASSERT(frame->format == 0,
+	/* Only simple (single- or multi-) frames are supported. */
+	KASSERT(frame->format == 0 || frame->format == 4,
 	    ("%s(): Got unsupported frame format 0x%02X!", __func__,
 	    frame->format));
 
@@ -374,8 +375,26 @@ dpaa_eth_fq_rx_callback(device_t portal, struct qman_fq *fq,
 	if (m == NULL)
 		goto err;
 
-	m_extadd(m, (char *)frame_va + frame->offset, frame->length,
-	    dpaa_eth_fq_mext_free, frame_va, sc, 0, EXT_NET_DRV);
+	if (frame->format == 0) {
+		/* Single-frame format */
+		m_extadd(m, (char *)frame_va + frame->offset, frame->length,
+		    dpaa_eth_fq_mext_free, frame_va, sc, 0, EXT_NET_DRV);
+	} else {
+		struct dpaa_sgte *sgt =
+		    (struct dpaa_sgte *)(char *)frame_va + frame->offset;
+		/* Simple multi-frame format */
+		for (int i = 0; i < DPAA_NUM_OF_SG_TABLE_ENTRY; i++) {
+			if (sgt[i].length > 0)
+				m_extadd(m, PHYS_TO_DMAP(sgt[i].addr),
+				    sgt[i].length, dpaa_eth_fq_mext_free,
+				    PHYS_TO_DMAP(sgt[i].addr), sc, 0,
+				    EXT_NET_DRV);
+			if (sgt[i].final)
+				break;
+		}
+		/* Free the SGT buffer, it's no longer needed. */
+		bman_put_buffer(sc->sc_rx_pool, frame->addr, sc->sc_rx_bpid);
+	}
 
 	if (if_getcapenable(sc->sc_ifnet) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))
 		dpaa_eth_update_csum_flags(frame, &frame_ic->prs, m);
diff --git a/sys/dev/dpaa/if_memac.c b/sys/dev/dpaa/if_memac.c
index ec216e8b2185..dd338b318492 100644
--- a/sys/dev/dpaa/if_memac.c
+++ b/sys/dev/dpaa/if_memac.c
@@ -617,7 +617,8 @@ memac_attach(device_t dev)
 		    device_get_unit(sc->sc_base.sc_dev));
 
 
-	if_setcapabilities(ifp, IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM |
+	if_setcapabilities(ifp, IFCAP_JUMBO_MTU |
+	    IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM |
 	    IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 |
 	    IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6);
 	if_setcapenable(ifp, if_getcapabilities(ifp));


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f79dff.3c75e.55a019b1>