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

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Mar 8 03:31:15 CET 2017


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


More information about the dev mailing list