mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
mvneta: Fix MTU update sequence
After MTU is updated we might start using allocating RX buffers from different pool. (MJUM9BYTES vs MCLBYTES) Because of that we need to update the RX buffer size in hardware. Previously it was done only when the interface was up, which is incorrect since MTU can be changed at any time. Differential revision: https://reviews.freebsd.org/D31724 Sponsored by: Stormshield Obtained from: Semihalf MFC after: 2 weeks Reviewed by: wma
This commit is contained in:
parent
bb536de6c0
commit
5438ef47e3
|
@ -2168,29 +2168,28 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||
ifp->if_hwassist = CSUM_IP | CSUM_TCP |
|
||||
CSUM_UDP;
|
||||
}
|
||||
|
||||
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
|
||||
/* Stop hardware */
|
||||
/*
|
||||
* Reinitialize RX queues.
|
||||
* We need to update RX descriptor size.
|
||||
*/
|
||||
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
|
||||
mvneta_stop_locked(sc);
|
||||
/*
|
||||
* Reinitialize RX queues.
|
||||
* We need to update RX descriptor size.
|
||||
*/
|
||||
for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) {
|
||||
mvneta_rx_lockq(sc, q);
|
||||
if (mvneta_rx_queue_init(ifp, q) != 0) {
|
||||
device_printf(sc->dev,
|
||||
"initialization failed:"
|
||||
" cannot initialize queue\n");
|
||||
mvneta_rx_unlockq(sc, q);
|
||||
error = ENOBUFS;
|
||||
break;
|
||||
}
|
||||
|
||||
for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) {
|
||||
mvneta_rx_lockq(sc, q);
|
||||
if (mvneta_rx_queue_init(ifp, q) != 0) {
|
||||
device_printf(sc->dev,
|
||||
"initialization failed:"
|
||||
" cannot initialize queue\n");
|
||||
mvneta_rx_unlockq(sc, q);
|
||||
error = ENOBUFS;
|
||||
break;
|
||||
}
|
||||
/* Trigger reinitialization */
|
||||
mvneta_init_locked(sc);
|
||||
mvneta_rx_unlockq(sc, q);
|
||||
}
|
||||
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
|
||||
mvneta_init_locked(sc);
|
||||
|
||||
mvneta_sc_unlock(sc);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue