From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: Shahaf Shuler <shahafs@mellanox.com>
Cc: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>,
"Yongseok Koh" <yskoh@mellanox.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1] net/mlx: control netdevices through ioctl only
Date: Mon, 12 Feb 2018 09:47:15 +0100 [thread overview]
Message-ID: <20180212084715.GF4256@6wind.com> (raw)
In-Reply-To: <VI1PR05MB3149122A2688A3A1DC7A9026C3F00@VI1PR05MB3149.eurprd05.prod.outlook.com>
Hi Shahaf,
On Sun, Feb 11, 2018 at 11:55:44AM +0000, Shahaf Shuler wrote:
> Hi Adrien,
>
> Small doc issues.
<snip>
> > -/**
> > * 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.
<snip>
> > @@ -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.
<snip>
> > @@ -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
prev parent reply other threads:[~2018-02-12 8:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 16:37 Adrien Mazarguil
2018-02-09 20:33 ` Marcelo Ricardo Leitner
2018-02-28 8:07 ` Shahaf Shuler
2018-02-11 11:55 ` Shahaf Shuler
2018-02-12 8:47 ` Adrien Mazarguil [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180212084715.GF4256@6wind.com \
--to=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=nelio.laranjeiro@6wind.com \
--cc=shahafs@mellanox.com \
--cc=yskoh@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).