[dpdk-stable] patch 'net/mlx5: fix invalid network interface index' has been queued to stable release 18.05.1

Yongseok Koh yskoh at mellanox.com
Wed Aug 1 22:49:15 CEST 2018


> On Jul 30, 2018, at 9:13 AM, Christian Ehrhardt <christian.ehrhardt at canonical.com> wrote:
> 
> Hi,
> 
> FYI, your patch has been queued to stable release 18.05.1
> 
> Note it hasn't been pushed to https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdpdk.org%2Fbrowse%2Fdpdk-stable&data=02%7C01%7Cyskoh%40mellanox.com%7C672bbc6bc5d74492636508d5f6387a4e%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636685644792733413&sdata=jqe2g7yUGj6J6lLNo0k0G4s2SUY1vf2ji98YCc0y9wM%3D&reserved=0 yet.
> It will be pushed if I get no objections before 08/01/18. So please
> shout if anyone has objections.
> 
> Thanks.
> 
> Christian Ehrhardt <christian.ehrhardt at canonical.com>
> 
> ---
> From 2049afe07c264d2e4e3754588a264dd17cadaf4f Mon Sep 17 00:00:00 2001
> From: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
> Date: Wed, 25 Jul 2018 13:24:33 +0200
> Subject: [PATCH] net/mlx5: fix invalid network interface index
> 
> [ upstream commit 3f8cb05df5407369025fbc8b67f0f9595b781f73 ]
> 
> Network interface indices being unsigned, an invalid index or error is
> normally expressed through a zero value (see if_nametoindex()).
> 
> mlx5_ifindex() has a signed return type for negative values in case of
> error. Since mlx5_nl.c does not check for errors, these may be fed back as
> invalid interfaces indices to subsequent system calls. This usage would
> have been correct if mlx5_ifindex() returned a zero value instead.
> 
> This patch makes mlx5_ifindex() unsigned for convenience.
> 
> Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
> Acked-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
> Acked-by: Yongseok Koh <yskoh at mellanox.com>
> ---
> drivers/net/mlx5/mlx5.h        |  1 +
> drivers/net/mlx5/mlx5_ethdev.c | 20 ++++++++------------
> drivers/net/mlx5/mlx5_nl.c     |  6 +++---
> 3 files changed, 12 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
> index 997b04a33..8f1335200 100644
> --- a/drivers/net/mlx5/mlx5.h
> +++ b/drivers/net/mlx5/mlx5.h
> @@ -211,6 +211,7 @@ int mlx5_getenv_int(const char *);
> 
> int mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[IF_NAMESIZE]);
> int mlx5_ifindex(const struct rte_eth_dev *dev);
> +unsigned int mlx5_ifindex(const struct rte_eth_dev *dev);

Hi Christian

This line is to replace the upper line. In the original patch:

-int mlx5_ifindex(const struct rte_eth_dev *dev);
+unsigned int mlx5_ifindex(const struct rte_eth_dev *dev);

Please fix it.


Thanks,
Yongseok



More information about the stable mailing list