From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] ethdev: modifiy vlan_offload_set_t to return int Date: Fri, 01 Sep 2017 10:01:33 +0200 Message-ID: <3181043.jiBUBLgLyU@xps> References: <20170825133319.15207-1-dharton@cisco.com> <2775824.X3T22OWxbu@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, ferruh.yigit@intel.com, ajit.khaparde@broadcom.com, johndale@cisco.com, konstantin.ananyev@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, jing.d.chen@intel.com, adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, alejandro.lucero@netronome.com, hemant.agrawal@nxp.com, rasesh.mody@cavium.com, harish.patil@cavium.com, skhare@vmware.com, yliu@fridaylinux.org, maxime.coquelin@redhat.com, allain.legacy@windriver.com To: "David Harton (dharton)" Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 808947CD1 for ; Fri, 1 Sep 2017 10:01:35 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 01/09/2017 02:40, David Harton (dharton): > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > --- a/doc/guides/rel_notes/release_17_11.rst > > > +++ b/doc/guides/rel_notes/release_17_11.rst > > > @@ -124,7 +124,7 @@ ABI Changes > > > Also, make sure to start the actual text at the margin. > > > ========================================================= > > > > > > - > > > +* Changed return type of ``vlan_offload_set_t`` from ``void`` to ``int``. > > > > It should be referenced as an API change (instead of ABI change). > > (and line spacing must be kept) > > Sure I'll move it to API. > > Line spacing? You mean 80 char width? I followed an example from a previous > release so I'm not sure what you mean. I mean you must take care of the number of blank lines to have before and after a title (2 blank lines before a title). > > > - (*dev->dev_ops->vlan_offload_set)(dev, mask); > > > + ret = (*dev->dev_ops->vlan_offload_set)(dev, mask); > > > + if (ret) { > > > + /* hit an error restore original values */ > > > + dev->data->dev_conf.rxmode.hw_vlan_strip = org_strip; > > > + dev->data->dev_conf.rxmode.hw_vlan_filter = org_filter; > > > + dev->data->dev_conf.rxmode.hw_vlan_extend = org_extend; > > > + } > > > > Isn't it the responsibility of the PMD to restore values in case of error? > > I understand it is there to factorize error handling code, right? > > By setting the dev_conf.rxmode.hw_vlan_* fields this function is claiming > ownership of that data and therefore it should be the one to reset it. > > > Do we want to document this behaviour with the ops prototype? > > Why? Shouldn't any function that doesn't do what it was asked to do > leave the system in its original state and in fact if it doesn't that > is when it should be documented what the behavior is? Otherwise every > caller has to implement some cleanup code and would have to be given > information to know how to perform that cleanup as well which seems > more complicated. Sorry I overlooked the function. I thought these data were set by the PMD, that's why I was telling the cleanup should be done in the PMD. You can forget this comment :)