From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0579BC5DF62 for ; Wed, 6 Nov 2019 12:26:39 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 8F166217D7 for ; Wed, 6 Nov 2019 12:26:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=monjalon.net header.i=@monjalon.net header.b="rgdNiOyS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="TgR3yspY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F166217D7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=monjalon.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 903451C120; Wed, 6 Nov 2019 13:26:37 +0100 (CET) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by dpdk.org (Postfix) with ESMTP id B4C721C117 for ; Wed, 6 Nov 2019 13:26:35 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 406E4D4A; Wed, 6 Nov 2019 07:26:35 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 06 Nov 2019 07:26:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=tYJeN9AN+HE8FlMGa69RpxrEwMuXRyDdJiCmye0gpFg=; b=rgdNiOySsXOa Syi8z/JxYTfRXkkorec1eiIFxYFF+qDsQBQnhTV4njCE2aGJQ4CKRqQzpJMqFzl7 IDynlEDFdwjnOhgXhWZO9n0bz72aUVslYv+3eUPnRUOj5UNhgVBSCIOCJoUQkx9z 9qWLnLGSlM+1vsg9RFeitbX2dTpuokg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=tYJeN9AN+HE8FlMGa69RpxrEwMuXRyDdJiCmye0gp Fg=; b=TgR3yspYCgqJXgX+xQWXJz/FW97vCScewnM/E2aJYXP82aKSl2EW9rsWo IwhbCejqpsj503TeVdPoy6P2olLuCwZOJkL1m3KQGU/c9+EPB7Hc4QB3uGDOnJnX fMTi+MFHIen9CWStOv0+t53CvuJDiPSIkB+LDxiVT5XVDVsbLTe0pYqDB1jYggcK r2NFuDh8QMQ0Uak3kwv6mtFiAE8XnkJnsDlCREnzudNP6XJfsXQ4dsUkbEaMf2ZZ eip7opc1yk+XzCa1eeeCji4/97qghgrBfVmQ0zxiTcUM8o0Nu4Ql4zU3kgo62PAv J1/sa1tEbCMPT18JQ2TawyXSZAnQA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddujedggeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuff homhgrihhnpeguphgukhdrohhrghenucfkphepjeejrddufeegrddvtdefrddukeegnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtne cuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B732780063; Wed, 6 Nov 2019 07:26:30 -0500 (EST) From: Thomas Monjalon To: Dekel Peled Cc: john.mcnamara@intel.com, marko.kovacevic@intel.com, nhorman@tuxdriver.com, ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com, anatoly.burakov@intel.com, xuanziyang2@huawei.com, cloud.wangxiaoyun@huawei.com, zhouguoyang@huawei.com, wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, matan@mellanox.com, shahafs@mellanox.com, viacheslavo@mellanox.com, rmody@marvell.com, shshaikh@marvell.com, maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com, yongwang@vmware.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, jingjing.wu@intel.com, bernard.iremonger@intel.com, dev@dpdk.org Date: Wed, 06 Nov 2019 13:26:29 +0100 Message-ID: <2242698.MuZukdLNMd@xps> In-Reply-To: <5761720ab8a57fd331ed03916ff27fd153e8fb85.1573039465.git.dekelp@mellanox.com> References: <5761720ab8a57fd331ed03916ff27fd153e8fb85.1573039465.git.dekelp@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 1/3] ethdev: support API to set max LRO packet size 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 06/11/2019 12:34, Dekel Peled: > This patch implements [1], to support API for configuration and > validation of max size for LRO aggregated packet. > API change notice [2] is removed, and release notes for 19.11 > are updated accordingly. > > Various PMDs using LRO offload are updated, the new data members are > initialized to ensure they don't fail validation. > > [1] http://patches.dpdk.org/patch/58217/ > [2] http://patches.dpdk.org/patch/57492/ > > Signed-off-by: Dekel Peled > Reviewed-by: Andrew Rybchenko > --- [...] > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -1156,6 +1156,26 @@ struct rte_eth_dev * > return name; > } > > +static inline int > +check_lro_pkt_size(uint16_t port_id, uint32_t config_size, > + uint32_t dev_info_size) > +{ > + int ret = 0; > + > + if (config_size > dev_info_size) { > + RTE_ETHDEV_LOG(ERR, "Ethdev port_id=%d max_lro_pkt_size %u > " > + "max allowed value %u\n", Minor comment (can be fixed while merging): it is better to keep fixed strings together so it can be grepped. Here I would move " > " on the second line, so we can grep " > max allowed value ". > + port_id, config_size, dev_info_size); > + ret = -EINVAL; > + } else if (config_size < RTE_ETHER_MIN_LEN) { > + RTE_ETHDEV_LOG(ERR, "Ethdev port_id=%d max_lro_pkt_size %u < " > + "min allowed value %u\n", port_id, config_size, Same minor comment here. > + (unsigned int)RTE_ETHER_MIN_LEN); > + ret = -EINVAL; > + } > + return ret; > +} [...] > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -395,6 +395,8 @@ struct rte_eth_rxmode { > + /** Maximal allowed size of LRO aggregated packet. */ Not sure, isn't it more correct to say "Maximum" in English? > + uint32_t max_lro_pkt_size; > @@ -1223,6 +1225,8 @@ struct rte_eth_dev_info { > + /** Maximum configurable size of LRO aggregated packet. */ > + uint32_t max_lro_pkt_size; Except minor comments above, Acked-by: Thomas Monjalon