From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by dpdk.org (Postfix) with ESMTP id EDD291B2D8 for ; Mon, 12 Feb 2018 09:47:28 +0100 (CET) Received: by mail-wr0-f172.google.com with SMTP id h9so14307864wre.12 for ; Mon, 12 Feb 2018 00:47:28 -0800 (PST) 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:in-reply-to; bh=xJPiFOPXuSsUJQ1XsUlmuT9NeWHgDp7o+/+fPiiWVzs=; b=i4j3oQ7wwVx4u/T3C88ExN+yxj8Z94Od/JB6dH1EAujO/oVht82j6mp6PwX5LlL729 msR89Ln1F0fnGISxdGaaDFx0d4sWfdBVaxPXtONXDedmnET3t9JFcj1y81ph7p6krrpH n+8Q2f6YrFlKvrAv4nJrXRvgf+vvJWngifTQMCHLG4VGcA4H+9hH7CWOe3i1VGJ3vH9q l8AMbxtEtyOZ0eNBGyMoMqCuFDUbuSlFI8yJB7WwM90qhhD02gt8wsHlAO6bBbXyTduP fbPpOexxpLwgjDTbpxB0rZiqZ+LmSyTUoj03MK6yBIHIm8xxYgarNUVTDN7Ritu/CDiq x1PQ== 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:in-reply-to; bh=xJPiFOPXuSsUJQ1XsUlmuT9NeWHgDp7o+/+fPiiWVzs=; b=c/a5yANekti7AP8bcGxIkXDS0mKBFXIvrd8rAwqzKkts+q/bDcaonLc10UBnT2khtH jy4EEtAwrHB3S5i1Mx0kmUE4AKBA3o1L0MAxuKVkWSx7R+pudRyHE8EJ3UKoLJr8X46K BYHieYDKtmPdoy9hEXFl/EvjmuSnkzzQ9FT2p6LnK45+taB4uPTV0816PVEZUdRERuKv DzwY0pmxiIVD2L/MzfBhcYqkix3NE4Zeg898nMVMFoYhYg5ckrs50Ct0MEC9RreZG02T JJHLTkfJeZm7KmQrOu539mUKF1yxBWtC0Ifp9y38EQOJRz7e+jDeMkdJKJ3CQs4qw2T6 EI/w== X-Gm-Message-State: APf1xPAfKVCzPpLsJ69MzcmrK8Uk1aDAPFAJ9ckoSPT0Z4ZagWxJG8/n Tp+DbSNehrOM+yrka9F6ZooCRw== X-Google-Smtp-Source: AH8x224Zw36uTpuEFFf6CqkOxFCXAFXHC8CLh+xt6Eoqakt7ffcYr/BMP4keft72oLD77zyLXsDzPg== X-Received: by 10.223.163.207 with SMTP id m15mr9513119wrb.174.1518425248686; Mon, 12 Feb 2018 00:47:28 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 91sm4919250wro.69.2018.02.12.00.47.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 00:47:27 -0800 (PST) Date: Mon, 12 Feb 2018 09:47:15 +0100 From: Adrien Mazarguil To: Shahaf Shuler Cc: =?utf-8?B?TsOpbGlv?= Laranjeiro , Yongseok Koh , "dev@dpdk.org" Message-ID: <20180212084715.GF4256@6wind.com> References: <20180208163538.22407-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v1] net/mlx: control netdevices through ioctl only 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, 12 Feb 2018 08:47:29 -0000 Hi Shahaf, On Sun, Feb 11, 2018 at 11:55:44AM +0000, Shahaf Shuler wrote: > Hi Adrien, > > Small doc issues. > > -/** > > * Perform ifreq ioctl() on associated Ethernet device. > > * > > * @param[in] priv > > @@ -361,12 +200,12 @@ mlx4_get_mac(struct priv *priv, uint8_t > > (*mac)[ETHER_ADDR_LEN]) int mlx4_mtu_get(struct priv *priv, uint16_t > > *mtu) { > > - unsigned long ulong_mtu = 0; > > - int ret = mlx4_get_sysfs_ulong(priv, "mtu", &ulong_mtu); > > + struct ifreq request; > > + int ret = mlx4_ifreq(priv, SIOCGIFMTU, &request); > > > > if (ret) > > return ret; > > Function documentation is : "0 on success, negative errno value otherwise and rte_errno is set." > Per my understating ioctl returns -1 on error with errno set. Since the positive/negative errno mess was addressed in mlx4 (commit 9d14b27308a0 "net/mlx4: standardize on negative errno value"), unlike mlx5's priv_ifreq(), mlx4_ifreq() returns a negative errno value with rte_errno set in case of error. Simply returning ret is enough as rte_errno is left unmodified; all functions are already documented accordingly. > > @@ -385,20 +224,13 @@ int > > mlx4_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { > > struct priv *priv = dev->data->dev_private; > > - uint16_t new_mtu; > > - int ret = mlx4_set_sysfs_ulong(priv, "mtu", mtu); > > + struct ifreq request = { .ifr_mtu = mtu, }; > > + int ret = mlx4_ifreq(priv, SIOCSIFMTU, &request); > > > > if (ret) > > return ret; > > Also here. Ditto. > > @@ -417,14 +249,14 @@ mlx4_mtu_set(struct rte_eth_dev *dev, uint16_t > > mtu) static int mlx4_set_flags(struct priv *priv, unsigned int keep, unsigned > > int flags) { > > - unsigned long tmp = 0; > > - int ret = mlx4_get_sysfs_ulong(priv, "flags", &tmp); > > + struct ifreq request; > > + int ret = mlx4_ifreq(priv, SIOCGIFFLAGS, &request); > > > > if (ret) > > return ret; > > And here. Ditto. No need for a v2. -- Adrien Mazarguil 6WIND