mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
dwc: add receive checksum offload for IPv6
This patch adds support for receive checksum offload for TCP/IPv6 and UDP/IPv6. Since receive checksum offload can't be configured separately for IPv4 and IPv6, IFCAP_RXCSUM and IFCAP_RXCSUM_IPV6 can't be changed independently. Reviewed by: Timo Völker MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54756
This commit is contained in:
1 parent
aca67c37a5
commit
5d8777f3a7
3 files changed
+6
-6
No files matched your search
@@ -238,7 +238,7 @@ dwc1000_enable_csum_offload(struct dwc_softc *sc)
|
||||
|
||||
DWC_ASSERT_LOCKED(sc);
|
||||
reg = READ4(sc, MAC_CONFIGURATION);
|
||||
if ((if_getcapenable(sc->ifp) & IFCAP_RXCSUM) != 0)
|
||||
if ((if_getcapenable(sc->ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) != 0)
|
||||
reg |= CONF_IPC;
|
||||
else
|
||||
reg &= ~CONF_IPC;
|
||||
|
||||
@@ -390,8 +390,8 @@ dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc,
|
||||
m->m_len = len;
|
||||
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||
|
||||
if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0 &&
|
||||
(rdesc0 & RDESC0_FT) != 0) {
|
||||
if ((if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) != 0 &&
|
||||
(rdesc0 & RDESC0_FT) != 0) {
|
||||
m->m_pkthdr.csum_flags = CSUM_IP_CHECKED;
|
||||
if ((rdesc0 & RDESC0_ICE) == 0)
|
||||
m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
|
||||
|
||||
@@ -263,8 +263,8 @@ dwc_ioctl(if_t ifp, u_long cmd, caddr_t data)
|
||||
/* No work to do except acknowledge the change took */
|
||||
if_togglecapenable(ifp, IFCAP_VLAN_MTU);
|
||||
}
|
||||
if (mask & IFCAP_RXCSUM)
|
||||
if_togglecapenable(ifp, IFCAP_RXCSUM);
|
||||
if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))
|
||||
if_togglecapenable(ifp, IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
|
||||
if (mask & IFCAP_TXCSUM)
|
||||
if_togglecapenable(ifp, IFCAP_TXCSUM);
|
||||
if ((if_getcapenable(ifp) & IFCAP_TXCSUM) != 0)
|
||||
@@ -614,7 +614,7 @@ dwc_attach(device_t dev)
|
||||
if_setsendqlen(ifp, TX_MAP_COUNT - 1);
|
||||
if_setsendqready(sc->ifp);
|
||||
if_sethwassist(sc->ifp, CSUM_IP | CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6);
|
||||
if_setcapabilities(sc->ifp, IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TXCSUM_IPV6);
|
||||
if_setcapabilities(sc->ifp, IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6);
|
||||
if_setcapenable(sc->ifp, if_getcapabilities(sc->ifp));
|
||||
|
||||
/* Attach the mii driver. */
|
||||
|
||||
Reference in new issue
Block a user