From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E71BAA00BE; Tue, 7 Jul 2020 16:12:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 188D31DE3C; Tue, 7 Jul 2020 16:11:52 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 75F261DE2B for ; Tue, 7 Jul 2020 16:11:50 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B35C85C0076; Tue, 7 Jul 2020 10:11:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 07 Jul 2020 10:11:49 -0400 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=fm1; bh= yQAoUz1rjnF49z5a5lmtQYX+i4SCDl18SGgH7OazXLs=; b=cnJ/C8Kp6+w+HG2P tNR0Cv2Bfl8kiBet6EkV+CvtMhSZOP5uiCwqRNXDhax6pexhNfH5kgM4d2R9Wulu Ipggx5bmiV0SyywoDI2wXwrxsugENI6cVxTyTW8upQSO7v9YTI70ZRkYtrvr5W+O Je/p/AaSt8lutG5rVUFAm3Q0b7d9LQLcXotJk+sSc2is6BSqU4dERwFoxhTw4h3H 9F45xa8lH7BFBMM0RWBVXBFqW2PdHadk15bAlx7z+Vmkl6Z4EFtrxHERSzp5ODvt rMGJkRc5ojRJi1hmDm+jPVnLjalRv24Oybsj58+6c2w8FsgBI2MM3G4rJY/p4KWk ke/ooQ== 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=fm3; bh=yQAoUz1rjnF49z5a5lmtQYX+i4SCDl18SGgH7OazX Ls=; b=XkexSmWaJe838pmh7hM3knNPJ9LKv9j3xJo8uwhHXvltqg/+9rNJP+hbl O3cnOJvUkui1ODklOhpUa1WVBDIWs10z2FZNZ0dz3pozqkkXnLW0Wq/UBxLTZoX+ ZtvecqXr5LjITQ9Va1z51RrChcOre/JWsA3FJaw1mX7hrVZQ3GADbGl2bWEq3vEY r9dTKuqd2KzvjVpXIYn6gztFKyaS1CUV8TxPpjnqT4gtdiEvz0C38eCv/jqcEf6u HlrWFkkOjsndw85beeZzwkcyzwN3Ytgh10gwXpcfUbIUM6JHZsrLeNcDQ49fzJiQ DlDqvFsxwIrFtk4pGyW8o2Rl1RtSw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudehgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfgjfhgggfgtsehtufertd dttddvnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehm ohhnjhgrlhhonhdrnhgvtheqnecuggftrfgrthhtvghrnhepudeggfdvfeduffdtfeegle fghfeukefgfffhueejtdetuedtjeeuieeivdffgeehnecukfhppeejjedrudefgedrvddt fedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght 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 A795E306005F; Tue, 7 Jul 2020 10:11:47 -0400 (EDT) From: Thomas Monjalon To: xavier.huwei@huawei.com Cc: dev@dpdk.org, ferruh.yigit@intel.com, arybchenko@solarflare.com, tangchengchang@huawei.com, hyonkim@cisco.com, sachin.saxena@oss.nxp.com, cloud.wangxiaoyun@huawei.com, hkalra@marvell.com, viacheslavo@mellanox.com Date: Tue, 07 Jul 2020 16:11:46 +0200 Message-ID: <3633587.h79vMgjPB0@thomas> In-Reply-To: <1594019191-54524-3-git-send-email-xavier.huwei@huawei.com> References: <1594019191-54524-1-git-send-email-xavier.huwei@huawei.com> <1594019191-54524-3-git-send-email-xavier.huwei@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v6 2/2] ethdev: fix VLAN offloads set if no relative capabilities 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/07/2020 09:06, Wei Hu (Xavier): > Currently, there is a potential problem that calling the API function > rte_eth_dev_set_vlan_offload to start VLAN hardware offloads which the > driver does not support. If the PMD driver does not support certain VLAN > hardware offloads and does not check for it, the hardware setting will > not change, but the VLAN offloads in dev->data->dev_conf.rxmode.offloads > will be turned on. > > It is supposed to check the hardware capabilities to decide whether the > relative callback needs to be called just like the behavior in the API > function named rte_eth_dev_configure. And it is also needed to cleanup > duplicated checks which are done in some PMDs. Also, note that it is > behaviour change for some PMDs which simply ignore (with error/warning log > message) unsupported VLAN offloads, but now it will fail. > > Fixes: a4996bd89c42 ("ethdev: new Rx/Tx offloads API") > Fixes: 0ebce6129bc6 ("net/dpaa2: support new ethdev offload APIs") > Fixes: f9416bbafd98 ("net/enic: remove VLAN filter handler") > Fixes: 4f7d9e383e5c ("fm10k: update vlan offload features") > Fixes: fdba3bf15c7b ("net/hinic: add VLAN filter and offload") > Fixes: b96fb2f0d22b ("net/i40e: handle QinQ strip") > Fixes: d4a27a3b092a ("nfp: add basic features") > Fixes: 56139e85abec ("net/octeontx: support VLAN filter offload") > Fixes: ba1b3b081edf ("net/octeontx2: support VLAN offloads") > Fixes: d87246a43759 ("net/qede: enable and disable VLAN filtering") > Cc: stable@dpdk.org > > Signed-off-by: Chengchang Tang > Signed-off-by: Wei Hu (Xavier) > Acked-by: Andrew Rybchenko > Acked-by: Hyong Youb Kim > Acked-by: Sachin Saxena > Acked-by: Xiaoyun wang > Acked-by: Harman Kalra Looks like a lot of reviews were already done. I missed this patch. Please could you make sure API maintainers are Cc'ed? You can use --cc-cmd devtools/get-maintainer.sh > @@ -3317,6 +3319,25 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) > if (mask == 0) > return ret; > > + ret = rte_eth_dev_info_get(port_id, &dev_info); > + if (ret != 0) > + return ret; > + > + /* > + * New added Rx VLAN offloading which are not enabled in > + * rte_eth_dev_configure() must be within its device capabilities > + */ What means "New added Rx VLAN offloading"? > + if ((dev_offloads & dev_info.rx_offload_capa) != dev_offloads) { > + new_offloads = dev_offloads & ~orig_offloads; > + RTE_ETHDEV_LOG(ERR, > + "Ethdev port_id=%u requested new added VLAN offloads " > + "0x%" PRIx64 " must be within Rx offloads capabilities " > + "0x%" PRIx64 " in %s()\n", > + port_id, new_offloads, dev_info.rx_offload_capa, > + __func__); > + return -EINVAL; > + }