DPDK patches and discussions
 help / color / mirror / Atom feed
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>,
	Ferruh Yigit <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH] mlx5: fix get link settings call for speed and duplex values
Date: Mon, 24 Jul 2017 14:09:08 +0200	[thread overview]
Message-ID: <20170724120908.GE2320@autoinstall.dev.6wind.com> (raw)
In-Reply-To: <f4f3ef7e89eb42d415ad6cfe8e875d93b28a3547.1500359265.git.gowrishankar.m@linux.vnet.ibm.com>

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 <gowrishankar.m@linux.vnet.ibm.com>
> 
> 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 <gowrishankar.m@linux.vnet.ibm.com>
> ---
>  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

  reply	other threads:[~2017-07-24 12:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18  6:28 Gowrishankar
2017-07-24 12:09 ` Nélio Laranjeiro [this message]
2017-07-24 14:30 ` [dpdk-dev] [PATCH v2] net/mlx5: " Gowrishankar
2017-07-25  8:07   ` [dpdk-dev] [PATCH] net/mlx5: fix inconsistent link status query Gowrishankar
2017-07-25  9:41     ` Nélio Laranjeiro
2017-07-25 13:38     ` [dpdk-dev] [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=20170724120908.GE2320@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=thomas@monjalon.net \
    /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).