All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Kubecek <mkubecek@suse.cz>
To: Adrian Pop <popadrian1996@gmail.com>
Cc: netdev@vger.kernel.org, linville@tuxdriver.com,
	davem@davemloft.net, kuba@kernel.org, jiri@mellanox.com,
	vadimp@mellanox.com, mlxsw@mellanox.com, idosch@mellanox.com,
	andrew@lunn.ch
Subject: Re: [PATCH] ethtool: Add QSFP-DD support
Date: Tue, 4 Aug 2020 12:14:56 +0200	[thread overview]
Message-ID: <20200804101456.4cfv4agv6etufi7a@lion.mk-sys.cz> (raw)
In-Reply-To: <20200731084725.7804-1-popadrian1996@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3596 bytes --]

On Fri, Jul 31, 2020 at 11:47:25AM +0300, Adrian Pop wrote:
> The Common Management Interface Specification (CMIS) for QSFP-DD shares
> some similarities with other form factors such as QSFP or SFP, but due to
> the fact that the module memory map is different, the current ethtool
> version is not able to provide relevant information about an interface.
> 
> This patch adds QSFP-DD support to ethtool. The changes are similar to
> the ones already existing in qsfp.c, but customized to use the memory
> addresses and logic as defined in the specifications document.
> 
> Page 0x00 (lower and higher memory) are always implemented, so the ethtool
> expects at least 256 bytes if the identifier matches the one for QSFP-DD.
> For optical connected cables, additional pages are usually available (the
> contain module defined  thresholds or lane diagnostic information). In
> this case, ethtool expects to receive 768 bytes in the following format:
> 
>     +----------+----------+----------+----------+----------+----------+
>     |   Page   |   Page   |   Page   |   Page   |   Page   |   Page   |
>     |   0x00   |   0x00   |   0x01   |   0x02   |   0x10   |   0x11   |
>     |  (lower) | (higher) | (higher) | (higher) | (higher) | (higher) |
>     |   128B   |   128B   |   128B   |   128B   |   128B   |   128B   |
>     +----------+----------+----------+----------+----------+----------
> 
> Several functions from qsfp.c could be reused, so an additional parameter
> was added to each and the functions were moved to sff-common.c.
> 
> Signed-off-by: Adrian Pop <popadrian1996@gmail.com>
> Tested-by: Ido Schimmel <idosch@mellanox.com>

AFAICS the kernel counterpart is going to reach mainline in 5.9-rc1
merge window. Please base your patch on "next" branch or wait until next
is merged into master after 5.8 release (which should be later today or
tomorrow).

> ---
>  Makefile.am  |   7 +-
>  qsfp-dd.c    | 561 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  qsfp-dd.h    | 236 ++++++++++++++++++++++
>  qsfp.c       |  60 ++----
>  qsfp.h       |   8 -
>  sff-common.c |  52 +++++
>  sff-common.h |  26 ++-
>  7 files changed, 894 insertions(+), 56 deletions(-)
>  create mode 100644 qsfp-dd.c
>  create mode 100644 qsfp-dd.h
> 
> diff --git a/Makefile.am b/Makefile.am
> index 2abb274..9fd8024 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -17,7 +17,8 @@ ethtool_SOURCES += \
>  		  smsc911x.c at76c50x-usb.c sfc.c stmmac.c	\
>  		  sff-common.c sff-common.h sfpid.c sfpdiag.c	\
>  		  ixgbevf.c tse.c vmxnet3.c qsfp.c qsfp.h fjes.c lan78xx.c \
> -		  igc.c
> +		  igc.c \
> +		  qsfp-dd.c qsfp-dd.h

There is no need to start a new line.

>  endif
>  
>  if ENABLE_BASH_COMPLETION
> @@ -47,12 +48,12 @@ endif
>  
>  TESTS = test-cmdline
>  check_PROGRAMS = test-cmdline
> -test_cmdline_SOURCES = test-cmdline.c test-common.c $(ethtool_SOURCES) 
> +test_cmdline_SOURCES = test-cmdline.c test-common.c $(ethtool_SOURCES)
>  test_cmdline_CFLAGS = -DTEST_ETHTOOL
>  if !ETHTOOL_ENABLE_NETLINK
>  TESTS += test-features
>  check_PROGRAMS += test-features
> -test_features_SOURCES = test-features.c test-common.c $(ethtool_SOURCES) 
> +test_features_SOURCES = test-features.c test-common.c $(ethtool_SOURCES)
>  test_features_CFLAGS = -DTEST_ETHTOOL
>  endif
>  

Do not mix unrelated changes like whitespace cleanups with your
functional changes, it makes it harder to see what the patch is doing.
Please split the cleanups (there are some more in qsfp.c) into
a separate patch.

Michal

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2020-08-04 10:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31  8:47 [PATCH] ethtool: Add QSFP-DD support Adrian Pop
2020-08-02 16:55 ` Andrew Lunn
2020-08-04  7:44 ` Ido Schimmel
2020-08-04  8:23   ` Adrian Pop
2020-08-04 10:14 ` Michal Kubecek [this message]
2020-08-04 10:25   ` Adrian Pop
2020-08-04 17:18     ` Michal Kubecek
2020-08-06 15:13       ` Adrian Pop
2020-08-04 10:30 ` Michal Kubecek
  -- strict thread matches above, loose matches on Subject: below --
2019-11-09 12:42 Adrian Pop
2019-11-09 15:33 ` Andrew Lunn
     [not found]   ` <CAL_jBfQhVAy24xbz_VbpPM0QtRu-Uzawhyn=AY0b41B9=v3Ytg@mail.gmail.com>
2019-11-13 13:59     ` Andrew Lunn
2019-11-15 19:00       ` Adrian Pop
     [not found] ` <20191115201508.GF24205@lunn.ch>
2019-11-15 21:34   ` Adrian Pop

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=20200804101456.4cfv4agv6etufi7a@lion.mk-sys.cz \
    --to=mkubecek@suse.cz \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=popadrian1996@gmail.com \
    --cc=vadimp@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 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.