From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f171.google.com (mail-pf0-f171.google.com [209.85.192.171]) by dpdk.org (Postfix) with ESMTP id B328DFFA for ; Mon, 29 Aug 2016 21:32:55 +0200 (CEST) Received: by mail-pf0-f171.google.com with SMTP id x72so55018849pfd.2 for ; Mon, 29 Aug 2016 12:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dVdY51Lg8Kirxpg+ipat32WGf5qYF4J5pIJllp9hvyg=; b=WuUe7mE50o+XvLsBxTDdxtgMT8JgZ0uBsRYUaT9EjTJ9ohgQdOD4g1yQl1qkycettG upP1H7q0YVkVOxibmBJ0HvFdwKhT27na682d4j61QxRvGXeTM/my3CV2e6d1j8JCzZlT 2q2bPd14nlf9C2OM0hinCNXkLNP/pu/XZ3CYkSqqUe1OtTkG3IQKrUBvHF8OpSJcTQaf P2cL4xsBtIThbyLh6QvR4K2qlP74+DnMyRUIRSewoTc/sDgtdftySr3HnnMse9bkPJhF XrJT/jx2mX6D0ZvgVJmjZbv1JW7O23XkxPP10S9qGMt0SZI33shRYRHuNP/SXWHlvwDD NPnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dVdY51Lg8Kirxpg+ipat32WGf5qYF4J5pIJllp9hvyg=; b=UayL78s8JPQ5yMBurFcVB1cggsy4yHUqvrnBLa8/XMpi+iWdQWfn71AILxlkPB6qsg kTZtcdGWXWuuyfP/37xu+ym3i1FWTl3B2GQOyEnWBrfRhDFq0fn2hdHBJf6abw7Qoz0M kCWxnAiFtwupgDKN4Lz6KQ0tlCNQFb/ZyCXPftlhsem0CGPj4+ycHuNsAR/i2HJglxNw AncivdEwBwfBYIxyFOglCOk389Jj8qSBJlUcwliEzKRqT5KQ34Q08lhInM2d2eILsEDE 4HXyjwqqiaR18tREGNZXkdcAXlU6ZjeA3L1UnWoHm05sHc7T9vRBMGbIc9Yp6GkkQEoA KN5g== X-Gm-Message-State: AE9vXwP4llrQbYe8kiqfwzltqM9USYJfpugnDypEHsmtb0KJs9IuLS0EgRxolcEMmgRWrg== X-Received: by 10.98.62.144 with SMTP id y16mr35973880pfj.9.1472499175080; Mon, 29 Aug 2016 12:32:55 -0700 (PDT) Received: from xeon-e3 (static-50-53-69-251.bvtn.or.frontiernet.net. [50.53.69.251]) by smtp.gmail.com with ESMTPSA id vt10sm51208824pab.43.2016.08.29.12.32.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Aug 2016 12:32:54 -0700 (PDT) Date: Mon, 29 Aug 2016 12:33:06 -0700 From: Stephen Hemminger To: "Dey, Souvik" Cc: "huawei.xie@intel.com" , "yuanhan.liu@linux.intel.com" , "dev@dpdk.org" Message-ID: <20160829123306.4e2bf00d@xeon-e3> In-Reply-To: References: <20160827005428.16556-1-sodey@sonusnet.com> <20160827171541.5f6b17c2@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1] add mtu set in virtio X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 19:32:56 -0000 On Sun, 28 Aug 2016 22:43:54 +0000 "Dey, Souvik" wrote: > Hi , > Currently as you have mentioned, I have changed the code to: > static int > virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) > { > struct virtio_hw *hw = dev->data->dev_private; > - if (unlikely(mtu < (uint32_t)hw->vtnet_hdr_size + ETHER_HDR_LEN)) { > - return -1; > + if (unlikely(mtu < VIRTIO_MIN_RX_BUFSIZE || mtu > VIRTIO_MAX_RX_PKTLEN)) { > + PMD_INIT_LOG(ERR,"Mtu should be between 64 and 9728." > + return -EINVAL; > } > return 0; > } > > Yes, we should support till 64K as the kernel does , but I need to go through the changes and test it properly before submitting it for review. Moreover I was thinking with the changes in the mtu, we should also support multi-segment buffers in kni. What do you suggest ? This looks good, but you really don't need likely/unlikely in this code. It is not at all performance critical.