From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>
Cc: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>,
stable@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>,
Yuanhan Liu <yliu@fridaylinux.org>
Subject: Re: [PATCH] net/mlx5: fix inconsistent link status query
Date: Tue, 25 Jul 2017 11:41:37 +0200 [thread overview]
Message-ID: <20170725094137.GJ2320@autoinstall.dev.6wind.com> (raw)
In-Reply-To: <e731e92c16819cd957cc5e432973b2266c3ce9fe.1500968570.git.gowrishankar.m@linux.vnet.ibm.com>
On Tue, Jul 25, 2017 at 01:37:39PM +0530, Gowrishankar wrote:
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>
> ETHTOOL_GLINKSETTINGS ioctl call in mlx5 pmd returns inconsistent
> link status due to which any application relying on it would not
> function correctly.
>
> Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")
> Cc: stable@dpdk.org
>
> Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> ---
> v3:
> - stick with C standard for uint32_t
>
> drivers/net/mlx5/mlx5_ethdev.c | 28 ++++++++++++++++++++--------
> 1 file changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
> index b70b7b9..01f881e 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -119,6 +119,7 @@ struct ethtool_link_settings {
> #define ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT 38
> #define ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT 39
> #endif
> +#define ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32 (SCHAR_MAX)
As I have another comment about compilation stuff, I would also ask to
remove those extra spaces.
> /**
> * Return private structure associated with an Ethernet device.
> @@ -807,9 +808,12 @@ struct priv *
> mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev, int wait_to_complete)
> {
> struct priv *priv = mlx5_get_priv(dev);
> - struct ethtool_link_settings edata = {
> - .cmd = ETHTOOL_GLINKSETTINGS,
> - };
> + struct {
Misses the __extension__ before struct here.
struct ethtool_link_settings is finishing with a flexible array (e.g.
[0]) which avoids it to be included in another structure as it breaks
the standard.
> + struct ethtool_link_settings edata;
> + uint32_t link_mode_data[3 *
> + ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32];
> + } ecmd;
Please add this __extension__ and it will be good ;)
Thanks,
--
Nélio Laranjeiro
6WIND
next prev parent reply other threads:[~2017-07-25 9:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 6:28 [PATCH] mlx5: fix get link settings call for speed and duplex values Gowrishankar
2017-07-24 12:09 ` Nélio Laranjeiro
2017-07-24 14:30 ` [PATCH v2] net/mlx5: " Gowrishankar
2017-07-25 8:07 ` [PATCH] net/mlx5: fix inconsistent link status query Gowrishankar
2017-07-25 9:41 ` Nélio Laranjeiro [this message]
2017-07-25 13:38 ` [PATCH v4] " Gowrishankar
2017-07-25 14:01 ` Nélio Laranjeiro
2017-07-31 12:36 ` Ferruh Yigit
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=20170725094137.GJ2320@autoinstall.dev.6wind.com \
--to=nelio.laranjeiro@6wind.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=gowrishankar.m@linux.vnet.ibm.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
--cc=yliu@fridaylinux.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.