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 935DDA0526; Thu, 9 Jul 2020 11:04:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CA4631DFE6; Thu, 9 Jul 2020 11:04:11 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 17BBE1DED4 for ; Thu, 9 Jul 2020 11:04:10 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6CCAC5C0113; Thu, 9 Jul 2020 05:04:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 09 Jul 2020 05:04:08 -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= IMr7XioaSFO7NnoX8dQk6w5PzGTHgF5ft5mAhDtrpoY=; b=h5xGXCO4A6yyvj+U mow91pLLhZK0oAkHdCMTpx4CZiv78RvHgWN0HdGenovpKFR1tyRdGRFg+ds78RfE m6OsGb0KR3Gnm8OgkLSGiilEorD8biR7CdQiYWfR4NVYehorR7IV+Ya2W/nknDIQ eDAlTPDPOH3EwI7c/MpnL6ahm/YCAb6//JbmoeyDJif3N8D2LUv3KBE+rOSUVaVV ira0Woxdi8dBMt8exsklXQtc0nrRKeG/m8pcMRvSicK2Pb1LXyNMKwXXr4nJ1QPU f2Pd/XNiMJsgNDT08dg+pjoY80BfmGutAqwIR2AhwpSwtyk7VVl22gSjdCEgr8f/ uMgjHw== 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=IMr7XioaSFO7NnoX8dQk6w5PzGTHgF5ft5mAhDtrp oY=; b=VgjP5eysRCzD95OXiwKf0rsHiZONEHs/CBy65Yo5f/lSWI6JVcCAeMdbJ WvtuilciPPo6sb9gbVJ5Cm3Ny8RfdDOvhBCAqGFIQ4eNWJnIDPEdA4r/mEe/H8Yl DVI3tRw3uK7NHzGsSYFOBzl4CqPQ7OHmbwKLltJfzlZshxVLpuNuKlRgjBNGhMeg LE1Z0K2u+zP6rWq+QjYghPcuGKncwsiGKypMmL89uZ9tThjKxjXvv5bhQ3b38xLQ TAA1npKx+ocHfCx2QOXD/wOdY87rPnv787pX7LsZO//ow7gK/4ePKc5wFb5qWFPS z6WOQF8s7kS5UhXXX/BGnIywZkx5w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudelgddutdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeekteehtdeivefhieegjeelgedufeejheekkeetueevieeuvdevuedt jeevheevteenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth 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 EDBD830600B2; Thu, 9 Jul 2020 05:04:05 -0400 (EDT) From: Thomas Monjalon To: "Wei Hu (Xavier)" 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: Thu, 09 Jul 2020 11:04:04 +0200 Message-ID: <2417893.HJc4kpR3nN@thomas> In-Reply-To: <54cebe1e-b6a0-30c5-824d-6ed56248e5ca@huawei.com> References: <1594019191-54524-1-git-send-email-xavier.huwei@huawei.com> <4862684.ztQDoVm40t@thomas> <54cebe1e-b6a0-30c5-824d-6ed56248e5ca@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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" 09/07/2020 09:39, Wei Hu (Xavier): > On 2020/7/8 18:14, Thomas Monjalon wrote: > > 08/07/2020 05:37, Wei Hu (Xavier): > >> On 2020/7/7 22:11, Thomas Monjalon wrote: > >>> 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 t= he > >>>> driver does not support. If the PMD driver does not support certain = VLAN > >>>> hardware offloads and does not check for it, the hardware setting wi= ll > >>>> not change, but the VLAN offloads in dev->data->dev_conf.rxmode.offl= oads > >>>> 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 A= PI > >>>> function named rte_eth_dev_configure. And it is also needed to clean= up > >>>> duplicated checks which are done in some PMDs. Also, note that it is > >>>> behaviour change for some PMDs which simply ignore (with error/warni= ng log > >>>> message) unsupported VLAN offloads, but now it will fail. > > [...] > >>>> @@ -3317,6 +3319,25 @@ rte_eth_dev_set_vlan_offload(uint16_t port_id= , int offload_mask) > >>>> if (mask =3D=3D 0) > >>>> return ret; > >>>> =20 > >>>> + ret =3D rte_eth_dev_info_get(port_id, &dev_info); > >>>> + if (ret !=3D 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"? > >> The parameter offload_mask of rte_eth_dev_set_vlan_offload() function > >> includes some Rx VLAN offload, and some of them maybe are not enabled > >> in rte_eth_dev_configure(). > > OK > > > > I don't understand why checking only new features. > > All enabled features must be within capabilities, right? > Yes=EF=BC=8Cyou are right. all enabled features must be within capabiliti= es=EF=BC=8C > Some features enabled in rte_eth_dev_configure() had been already checked, > So the comment here emphasizes 'new added Rx VLAN offloading'. I feel this precision more confusing than helpful.