Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145250695
D53436.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D53436.diff
View Options
diff --git a/sys/dev/dpaa2/dpaa2_ni.c b/sys/dev/dpaa2/dpaa2_ni.c
--- a/sys/dev/dpaa2/dpaa2_ni.c
+++ b/sys/dev/dpaa2/dpaa2_ni.c
@@ -559,7 +559,8 @@
if_settransmitfn(ifp, dpaa2_ni_transmit);
if_setqflushfn(ifp, dpaa2_ni_qflush);
- if_setcapabilities(ifp, IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_JUMBO_MTU);
+ if_setcapabilities(ifp, IFCAP_VLAN_MTU | IFCAP_HWCSUM |
+ IFCAP_HWCSUM_IPV6 | IFCAP_JUMBO_MTU);
if_setcapenable(ifp, if_getcapabilities(ifp));
DPAA2_CMD_INIT(&cmd);
@@ -627,6 +628,12 @@
__func__, error);
goto close_ni;
}
+ error = dpaa2_ni_setup_if_caps(sc);
+ if (error) {
+ device_printf(dev, "%s: failed to setup interface capabilities: "
+ "error=%d\n", __func__, error);
+ goto close_ni;
+ }
ether_ifattach(sc->ifp, sc->mac.addr);
callout_init(&sc->mii_callout, 0);
@@ -1569,8 +1576,7 @@
static int
dpaa2_ni_setup_if_caps(struct dpaa2_ni_softc *sc)
{
- const bool en_rxcsum = if_getcapenable(sc->ifp) & IFCAP_RXCSUM;
- const bool en_txcsum = if_getcapenable(sc->ifp) & IFCAP_TXCSUM;
+ bool en_rxcsum, en_txcsum;
device_t pdev = device_get_parent(sc->dev);
device_t dev = sc->dev;
device_t child = dev;
@@ -1582,6 +1588,17 @@
DPAA2_CMD_INIT(&cmd);
+ /*
+ * XXX-DSL: DPAA2 allows to validate L3/L4 checksums on reception and/or
+ * generate L3/L4 checksums on transmission without
+ * differentiating between IPv4/v6, i.e. enable for both
+ * protocols if requested.
+ */
+ en_rxcsum = if_getcapenable(sc->ifp) &
+ (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
+ en_txcsum = if_getcapenable(sc->ifp) &
+ (IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6);
+
error = DPAA2_CMD_RC_OPEN(dev, child, &cmd, rcinfo->id, &rc_token);
if (error) {
device_printf(dev, "%s: failed to open resource container: "
@@ -1627,6 +1644,13 @@
goto close_ni;
}
+ if (bootverbose) {
+ device_printf(dev, "%s: L3/L4 checksum validation %s\n",
+ __func__, en_rxcsum ? "enabled" : "disabled");
+ device_printf(dev, "%s: L3/L4 checksum generation %s\n",
+ __func__, en_txcsum ? "enabled" : "disabled");
+ }
+
(void)DPAA2_CMD_NI_CLOSE(dev, child, &cmd);
(void)DPAA2_CMD_RC_CLOSE(dev, child, DPAA2_CMD_TK(&cmd, rc_token));
return (0);
@@ -2574,13 +2598,27 @@
break;
case SIOCSIFCAP:
changed = if_getcapenable(ifp) ^ ifr->ifr_reqcap;
- if (changed & IFCAP_HWCSUM) {
- if ((ifr->ifr_reqcap & changed) & IFCAP_HWCSUM) {
- if_setcapenablebit(ifp, IFCAP_HWCSUM, 0);
+ if (changed & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) {
+ if ((ifr->ifr_reqcap & changed) &
+ (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) {
+ if_setcapenablebit(ifp,
+ IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6, 0);
} else {
- if_setcapenablebit(ifp, 0, IFCAP_HWCSUM);
+ if_setcapenablebit(ifp, 0,
+ IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
}
}
+ if (changed & (IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6)) {
+ if ((ifr->ifr_reqcap & changed) &
+ (IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6)) {
+ if_setcapenablebit(ifp,
+ IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6, 0);
+ } else {
+ if_setcapenablebit(ifp, 0,
+ IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6);
+ }
+ }
+
rc = dpaa2_ni_setup_if_caps(sc);
if (rc) {
printf("%s: failed to update iface capabilities: "
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 18, 3:09 PM (8 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25741921
Default Alt Text
D53436.diff (3 KB)
Attached To
Mode
D53436: dpaa2: Setup interface caps on attach
Attached
Detach File
Event Timeline
Log In to Comment