Date: Thu, 18 Aug 2016 09:24:36 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304355 - in stable/11/sys/dev/ntb: . if_ntb Message-ID: <201608180924.u7I9Oafa093802@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Aug 18 09:24:36 2016 New Revision: 304355 URL: https://svnweb.freebsd.org/changeset/base/304355 Log: MFC r302494: Synchronize MTU code with Linux. It is mandatory for transport compatibility. Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:23:59 2016 (r304354) +++ stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:24:36 2016 (r304355) @@ -125,8 +125,7 @@ ntb_net_attach(device_t dev) ether_ifattach(ifp, sc->eaddr); ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; - ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN - - ETHER_CRC_LEN; + ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN; ntb_transport_link_up(sc->qp); return (0); @@ -177,7 +176,7 @@ ntb_ioctl(struct ifnet *ifp, u_long comm case SIOCSIFMTU: { if (ifr->ifr_mtu > ntb_transport_max_size(sc->qp) - - ETHER_HDR_LEN - ETHER_CRC_LEN) { + ETHER_HDR_LEN) { error = EINVAL; break; } Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:23:59 2016 (r304354) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:24:36 2016 (r304355) @@ -489,8 +489,7 @@ ntb_transport_init_queue(struct ntb_tran qp->rx_info = (void *)(qp->tx_mw + tx_size); /* Due to house-keeping, there must be at least 2 buffs */ - qp->tx_max_frame = qmin(tx_size / 2, - transport_mtu + sizeof(struct ntb_payload_header)); + qp->tx_max_frame = qmin(transport_mtu, tx_size / 2); qp->tx_max_entry = tx_size / qp->tx_max_frame; callout_init(&qp->link_work, 0); @@ -1170,8 +1169,7 @@ ntb_transport_setup_qp_mw(struct ntb_tra qp->remote_rx_info = (void*)(qp->rx_buff + rx_size); /* Due to house-keeping, there must be at least 2 buffs */ - qp->rx_max_frame = qmin(rx_size / 2, - transport_mtu + sizeof(struct ntb_payload_header)); + qp->rx_max_frame = qmin(transport_mtu, rx_size / 2); qp->rx_max_entry = rx_size / qp->rx_max_frame; qp->rx_index = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608180924.u7I9Oafa093802>