From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH] mlx5: fix get link settings call for speed and duplex values Date: Mon, 24 Jul 2017 14:09:08 +0200 Message-ID: <20170724120908.GE2320@autoinstall.dev.6wind.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Adrien Mazarguil , dev@dpdk.org, Thomas Monjalon , Ferruh Yigit To: Gowrishankar Return-path: Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by dpdk.org (Postfix) with ESMTP id 8B3CD2629 for ; Mon, 24 Jul 2017 14:09:18 +0200 (CEST) Received: by mail-wr0-f179.google.com with SMTP id v105so75076718wrb.0 for ; Mon, 24 Jul 2017 05:09:18 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Gowrishankar, Sorry, it took me a little time to test this patch, nice catch. Small format points, the title should be net/mlx5 and there is a complain with checkpatch see below. On Tue, Jul 18, 2017 at 11:58:34AM +0530, Gowrishankar wrote: > From: Gowrishankar Muthukrishnan > > mlx5 pmd does not correctly retrieve link speed and duplex values > in linksetting struct through ETHTOOL_GLINKSETTINGS ioctl call. I would suggest to make it a little shorter by adding the following fact: This returns an inconsistent link status. It does not only impact traffic generator but anything relying on the link status. > Due to which pktgen application could not correctly calculate tx/rx > rate and hence, very few packets (of count 32) only sent all the time. > > Link settings can be derived through ETHTOOL_GLINKSETTINGS ioctl > only after updating ethtool_link_settings struct with appropriate > link mode bitmask words returned by its kernel side implementation. > With this patch, pktgen app is able to tx/rx packets on mlx5 ports. As it is fixing an issue it should have the fixes tag line, in this case add the following one: Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds") Cc: stable@dpdk.org > Signed-off-by: Gowrishankar Muthukrishnan > --- > drivers/net/mlx5/mlx5_ethdev.c | 27 +++++++++++++++++++-------- > 1 file changed, 19 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c > index b70b7b9..003cef3 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) > > /** > * Return private structure associated with an Ethernet device. > @@ -807,9 +808,11 @@ 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 { > + struct ethtool_link_settings edata; > + __u32 link_mode_data[3 * ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32]; Checkpatch complains about the line size here. Thanks, -- Nélio Laranjeiro 6WIND