From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by dpdk.org (Postfix) with ESMTP id 80271133F for ; Mon, 20 Mar 2017 08:56:44 +0100 (CET) Received: by mail-wr0-f175.google.com with SMTP id g10so86394207wrg.2 for ; Mon, 20 Mar 2017 00:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=r/lWMCpcxbcdXEf7RwzfRvO7PQ4QxuUH92lVx7tXDLo=; b=WqIpBUBgoKGG7Fg5eVYXMHuxLE6EmrNlaEI/vPYQOJoWXxLNEfgRsy17hjgQdDs1S0 dTbU927CWjskKlyhuoeOrgzCjNEfwlfPwTHMd2sjGsECJIDBKNRhe1P9lB/3biqwT8R+ RYKGp5ydnoOG4/5nFH88AkC/RV/xqejbqRLxE7X2VV/pWBnfKybtMg/EH76gWsIqQpPZ s5RvW7oKiFAxPj/lZp87Ep4h5eYGkKCztk/Q1t4lOJ/8LqcI0KyzTex6tAoTp/UAWMJl KXgs/tN9BXRhSPOmsuYrP00MjsWtKUjlBRu2lraOGhnetqDsdfsouoK669HBUt7+7r8+ FeEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=r/lWMCpcxbcdXEf7RwzfRvO7PQ4QxuUH92lVx7tXDLo=; b=UmWxZL08MxbqIbtWsK8v7rckg8hVRpJOk27kX9drwHzrkswpVFPGIrhaOoHt+ZaYTk OkOL6wH3xiLoZpZ4Ci7pZspAdfIFpp18c31QTQbVl9u0Peg+cOBb7wtNqFoqI2Vhx1oz FzvbVEewICpCvUuckAV5/EhuApOWlEbiSix4nky7ARQm2FZaYsskcltuOgnHOoQoh0LE 88bpLuHwKhvReeQ4dwJfD37dWriruki3TrLFBF3NosDH61C0FmcLURr1vsrmxSPI5eS8 A1SoxtOFcUNE1encLcbmKeB0orr8nsNimWtvU+2XtaFZtL1excuO/XJNr3eIqJmVN9HV 1bxQ== X-Gm-Message-State: AFeK/H2LP/OyOMcP7rKjWOeHG1Z6sUiiZT1aVspzYLkVQFZsW6rN8MxyLLCbCxiIeW52XTD0 X-Received: by 10.223.134.69 with SMTP id 5mr25776463wrw.22.1489996604101; Mon, 20 Mar 2017 00:56:44 -0700 (PDT) Received: from autoinstall.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id w207sm12440294wmw.1.2017.03.20.00.56.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Mar 2017 00:56:43 -0700 (PDT) Date: Mon, 20 Mar 2017 08:56:35 +0100 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Yongseok Koh Cc: "ferruh.yigit@intel.com" , "dev@dpdk.org" , Adrien Mazarguil Message-ID: <20170320075635.GB12013@autoinstall.dev.6wind.com> References: <20170316224056.19685-1-yskoh@mellanox.com> <20170316224056.19685-4-yskoh@mellanox.com> <20170317091143.GP22756@autoinstall.dev.6wind.com> <20170317171456.GF530@mtidpdk.mti.labs.mlnx> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170317171456.GF530@mtidpdk.mti.labs.mlnx> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 3/3] net/mlx5: rebuild flows on updating RETA 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: , X-List-Received-Date: Mon, 20 Mar 2017 07:56:44 -0000 On Fri, Mar 17, 2017 at 10:14:56AM -0700, Yongseok Koh wrote: > Hi Nelio, > > On Fri, Mar 17, 2017 at 02:11:43AM -0700, Nélio Laranjeiro wrote: > > On Thu, Mar 16, 2017 at 03:40:56PM -0700, Yongseok Koh wrote: > > > Currently mlx5_dev_rss_reta_update() just updates tables in the host, > > > therefore it isn't immediately effective until restarting the device by > > > calling mlx5_dev_stop()/mlx5_dev_start() to update the changes in the > > > device side. This patch adds rebuilding the device-specific datastructure > > > and applying it to the device right away. > > > > > > Signed-off-by: Yongseok Koh > > > --- > > > drivers/net/mlx5/mlx5_rss.c | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c > > > index 0702f1a63..30e59faa5 100644 > > > --- a/drivers/net/mlx5/mlx5_rss.c > > > +++ b/drivers/net/mlx5/mlx5_rss.c > > > @@ -357,8 +357,11 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev *dev, > > > int ret; > > > struct priv *priv = dev->data->dev_private; > > > > > > + mlx5_dev_stop(dev); > > > priv_lock(priv); > > > ret = priv_dev_rss_reta_update(priv, reta_conf, reta_size); > > > priv_unlock(priv); > > > + if (!ret) > > > + ret = (unsigned int)mlx5_dev_start(dev); > > > return -ret; > > > } > > > -- > > > 2.11.0 > > > > > > > Hi Yongseok, > > > > I don't understand why you need the cast for the returned value of > > mlx5_dev_start() as it already returns an int and your final variable is > > also an int. > > For some reason, in mlx5 PMD code, priv_* calls return positive error numbers > and corresponding mlx5_* APIs return negative values by adding (-) sign the the > return value from priv_* calls. This is due to the IOCTL calls which returns only positives errno, we decided to keep only positives errors internally and negate them in when they are returned to DPDK. > To follow this tacit rule in the existing code, I casted the return value to > unsigned. I see more this cast as something confusing than helping, knowing that it could be avoided with something like: if (ret) return -ret; return mlx5_dev_start(dev); Regards, -- Nélio Laranjeiro 6WIND