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

Maxime Coquelin maxime.coquelin at redhat.com
Sun Mar 12 11:24:32 CET 2017



On 03/08/2017 03:31 AM, Yuanhan Liu wrote:
> 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.

Right. Changed to %"PRIu64".
>
>> +
>> +		return -1;
>> +	}
>> +
>> +	dev->mtu = (uint16_t)msg->payload.u64;
>
> Besides, the cast seems unnecessary.
Indeed.

Thanks;
Maxime


More information about the dev mailing list