The branch main has been updated by jhibbits:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=240d81169286cd436368644f863aa1dea996fdee

commit 240d81169286cd436368644f863aa1dea996fdee
Author:     Justin Hibbits <[email protected]>
AuthorDate: 2026-08-10 18:26:54 +0000
Commit:     Justin Hibbits <[email protected]>
CommitDate: 2026-08-21 03:17:55 +0000

    dpaa/dtsec: advertise RX/TX csum
    
    Apply 6464974 to dTSEC, since it supports the same offload capabilities
    as mEMAC.
    
    The DPAA_CSUM_TX_OFFLOAD macro moves from if_memac.c to the shared
    dpaa_eth.h since both drivers now reference it.
---
 sys/dev/dpaa/dpaa_eth.h |  4 ++++
 sys/dev/dpaa/if_dtsec.c | 20 +++++++++++++++++++-
 sys/dev/dpaa/if_memac.c |  2 --
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/sys/dev/dpaa/dpaa_eth.h b/sys/dev/dpaa/dpaa_eth.h
index cc46dc5485d6..a897b43b725e 100644
--- a/sys/dev/dpaa/dpaa_eth.h
+++ b/sys/dev/dpaa/dpaa_eth.h
@@ -27,6 +27,10 @@
 #ifndef DPAA_ETH_H_
 #define DPAA_ETH_H_
 
+/* * TX csum-offload hwassist mask for dTSEC and mEMAC. */
+#define        DPAA_CSUM_TX_OFFLOAD    \
+       (CSUM_IP | CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)
+
 struct dpaa_pcpu_cnt {
        u_int   cnt;
 } __aligned(CACHE_LINE_SIZE);
diff --git a/sys/dev/dpaa/if_dtsec.c b/sys/dev/dpaa/if_dtsec.c
index 0d886abc5345..a0ea6e69dee3 100644
--- a/sys/dev/dpaa/if_dtsec.c
+++ b/sys/dev/dpaa/if_dtsec.c
@@ -244,6 +244,7 @@ dtsec_if_ioctl(if_t ifp, u_long command, caddr_t data)
 {
        struct dtsec_softc *sc;
        struct ifreq *ifr;
+       uint32_t changed;
        int error;
 
        sc = if_getsoftc(ifp);
@@ -272,6 +273,20 @@ dtsec_if_ioctl(if_t ifp, u_long command, caddr_t data)
                DTSEC_UNLOCK(sc);
                break;
 
+       case SIOCSIFCAP:
+               changed = if_getcapenable(ifp) ^ ifr->ifr_reqcap;
+               if ((changed & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) != 0)
+                       if_togglecapenable(ifp,
+                           IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
+               if ((changed & (IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6)) != 0) {
+                       if_togglecapenable(ifp,
+                           IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6);
+                       if_togglehwassist(ifp, DPAA_CSUM_TX_OFFLOAD);
+               }
+               if ((changed & IFCAP_LRO) != 0)
+                       if_togglecapenable(ifp, IFCAP_LRO);
+               break;
+
        case SIOCGIFMEDIA:
        case SIOCSIFMEDIA:
                error = ifmedia_ioctl(ifp, ifr, &sc->sc_base.sc_mii->mii_media,
@@ -515,8 +530,11 @@ dtsec_attach(device_t dev)
        if_setsendqready(ifp);
 #endif
 
-       if_setcapabilities(ifp, IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU);
+       if_setcapabilities(ifp, IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU |
+           IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 |
+           IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6);
        if_setcapenable(ifp, if_getcapabilities(ifp));
+       if_sethwassist(ifp, DPAA_CSUM_TX_OFFLOAD);
 
        /* Attach PHY(s) */
        error = mii_attach(sc->sc_base.sc_dev, &sc->sc_base.sc_mii_dev,
diff --git a/sys/dev/dpaa/if_memac.c b/sys/dev/dpaa/if_memac.c
index 6d0fa3f5e337..047cfea323a6 100644
--- a/sys/dev/dpaa/if_memac.c
+++ b/sys/dev/dpaa/if_memac.c
@@ -89,8 +89,6 @@
 
 #define        DEFAULT_PAUSE_QUANTA    0xf000
 
-#define        DPAA_CSUM_TX_OFFLOAD    (CSUM_IP | CSUM_DELAY_DATA | 
CSUM_DELAY_DATA_IPV6)
-
 
 /**
  * @group FMan MAC routines.

Reply via email to