From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7E2FB1BBE for ; Wed, 8 Mar 2017 03:32:43 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2017 18:32:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,261,1486454400"; d="scan'208";a="941820485" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga003.jf.intel.com with ESMTP; 07 Mar 2017 18:32:40 -0800 Date: Wed, 8 Mar 2017 10:31:15 +0800 From: Yuanhan Liu To: Maxime Coquelin Cc: aconole@redhat.com, sodey@sonusnet.com, jianfeng.tan@intel.com, dev@dpdk.org Message-ID: <20170308023115.GX18844@yliu-dev.sh.intel.com> References: <20170306082740.5675-1-maxime.coquelin@redhat.com> <20170306082740.5675-3-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170306082740.5675-3-maxime.coquelin@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v2 2/7] vhost: vhost-user: Add MTU protocol feature support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Mar 2017 02:32:43 -0000 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