Thread (52 messages) flat view 52 messages, 6 authors, 2017-04-10

Re: [PATCH v2 2/7] vhost: vhost-user: Add MTU protocol feature support

From: Yuanhan Liu <hidden>
Date: 2017-03-08 02:32:43

On Mon, Mar 06, 2017 at 09:27:35AM +0100, Maxime Coquelin wrote:
+static int
+vhost_user_net_set_mtu(struct virtio_net *dev, struct VhostUserMsg *msg)
+{
+	if (msg->payload.u64 < VIRTIO_MIN_MTU ||
+			msg->payload.u64 > VIRTIO_MAX_MTU) {
+		RTE_LOG(ERR, VHOST_CONFIG, "Invalid MTU size (%lu)\n",
+				msg->payload.u64);
This (%lu) would break the 32-bit OS build.
+
+		return -1;
+	}
+
+	dev->mtu = (uint16_t)msg->payload.u64;
Besides, the cast seems unnecessary.

	--yliu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help