Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/dpaa2/dpaa2_ni.c
| Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | |||||
| /* TX/RX budget for the channel cleanup task */ | /* TX/RX budget for the channel cleanup task */ | ||||
| #define DPAA2_TX_BUDGET 128 /* sysctl(9)? */ | #define DPAA2_TX_BUDGET 128 /* sysctl(9)? */ | ||||
| #define DPAA2_RX_BUDGET 256 /* sysctl(9)? */ | #define DPAA2_RX_BUDGET 256 /* sysctl(9)? */ | ||||
| #define DPNI_IRQ_INDEX 0 /* Index of the only DPNI IRQ. */ | #define DPNI_IRQ_INDEX 0 /* Index of the only DPNI IRQ. */ | ||||
| #define DPNI_IRQ_LINK_CHANGED 1 /* Link state changed */ | #define DPNI_IRQ_LINK_CHANGED 1 /* Link state changed */ | ||||
| #define DPNI_IRQ_EP_CHANGED 2 /* DPAA2 endpoint dis/connected */ | #define DPNI_IRQ_EP_CHANGED 2 /* DPAA2 endpoint dis/connected */ | ||||
| /* Default maximum frame length. */ | /* Default maximum RX frame length w/o CRC. */ | ||||
| #define DPAA2_ETH_MFL (ETHER_MAX_LEN - ETHER_CRC_LEN) | #define DPAA2_ETH_MFL (ETHER_MAX_LEN_JUMBO + ETHER_VLAN_ENCAP_LEN - \ | ||||
| ETHER_CRC_LEN) | |||||
| /* Minimally supported version of the DPNI API. */ | /* Minimally supported version of the DPNI API. */ | ||||
| #define DPNI_VER_MAJOR 7 | #define DPNI_VER_MAJOR 7 | ||||
| #define DPNI_VER_MINOR 0 | #define DPNI_VER_MINOR 0 | ||||
| /* Rx/Tx buffers configuration. */ | /* Rx/Tx buffers configuration. */ | ||||
| #define BUF_ALIGN_V1 256 /* WRIOP v1.0.0 limitation */ | #define BUF_ALIGN_V1 256 /* WRIOP v1.0.0 limitation */ | ||||
| #define BUF_ALIGN 64 | #define BUF_ALIGN 64 | ||||
| ▲ Show 20 Lines • Show All 2,405 Lines • ▼ Show 20 Lines | if (mtu < ETHERMIN || mtu > ETHERMTU_JUMBO) { | ||||
| DPNI_UNLOCK(sc); | DPNI_UNLOCK(sc); | ||||
| error = EINVAL; | error = EINVAL; | ||||
| goto close_ni; | goto close_ni; | ||||
| } | } | ||||
| if_setmtu(ifp, mtu); | if_setmtu(ifp, mtu); | ||||
| DPNI_UNLOCK(sc); | DPNI_UNLOCK(sc); | ||||
| /* Update maximum frame length. */ | /* Update maximum frame length. */ | ||||
| error = DPAA2_CMD_NI_SET_MFL(dev, child, &cmd, | mtu += ETHER_HDR_LEN; | ||||
| mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); | if (if_getcapenable(ifp) & IFCAP_VLAN_MTU) | ||||
| mtu += ETHER_VLAN_ENCAP_LEN; | |||||
| error = DPAA2_CMD_NI_SET_MFL(dev, child, &cmd, mtu); | |||||
| if (error) { | if (error) { | ||||
| device_printf(dev, "%s: failed to update maximum frame " | device_printf(dev, "%s: failed to update maximum frame " | ||||
| "length: error=%d\n", __func__, error); | "length: error=%d\n", __func__, error); | ||||
| goto close_ni; | goto close_ni; | ||||
| } | } | ||||
| break; | break; | ||||
| case SIOCSIFCAP: | case SIOCSIFCAP: | ||||
| changed = if_getcapenable(ifp) ^ ifr->ifr_reqcap; | changed = if_getcapenable(ifp) ^ ifr->ifr_reqcap; | ||||
| ▲ Show 20 Lines • Show All 1,130 Lines • Show Last 20 Lines | |||||