aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ntb/ntb_transport.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2016-07-09 11:58:59 +0000
committerAlexander Motin <mav@FreeBSD.org>2016-07-09 11:58:59 +0000
commita7e0f01a3d669fc708e6dca3b0134082e97105c5 (patch)
tree1d86cdb808af117280f18d8aa9ce2d8c3bbde8ac /sys/dev/ntb/ntb_transport.c
parent59850913b254aa76c2965e3fd3c31817c27fd4b1 (diff)
downloadsrc-a7e0f01a3d669fc708e6dca3b0134082e97105c5.tar.gz
src-a7e0f01a3d669fc708e6dca3b0134082e97105c5.zip
Synchronize MTU code with Linux.
It is mandatory for transport compatibility.
Notes
Notes: svn path=/head/; revision=302494
Diffstat (limited to 'sys/dev/ntb/ntb_transport.c')
-rw-r--r--sys/dev/ntb/ntb_transport.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/ntb/ntb_transport.c b/sys/dev/ntb/ntb_transport.c
index 463a2c29cacc..85647444e923 100644
--- a/sys/dev/ntb/ntb_transport.c
+++ b/sys/dev/ntb/ntb_transport.c
@@ -489,8 +489,7 @@ ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num)
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_transport_ctx *nt, unsigned int qp_num)
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;