netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>
Cc: kuba@kernel.org, andrew@lunn.ch, mickeyr@marvell.com,
	serhiy.pshyk@plvision.eu, taras.chornyi@plvision.eu,
	Volodymyr Mytnyk <vmytnyk@marvell.com>,
	Vadym Kochan <vkochan@marvell.com>,
	Yevhen Orlov <yevhen.orlov@plvision.eu>,
	Taras Chornyi <tchornyi@marvell.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v4] net: marvell: prestera: add firmware v4.0 support
Date: Thu, 4 Nov 2021 19:59:20 -0700	[thread overview]
Message-ID: <20211105025920.GA2923425@roeck-us.net> (raw)
In-Reply-To: <1635485889-27504-1-git-send-email-volodymyr.mytnyk@plvision.eu>

On Fri, Oct 29, 2021 at 08:38:07AM +0300, Volodymyr Mytnyk wrote:
> From: Volodymyr Mytnyk <vmytnyk@marvell.com>
> 
> Add firmware (FW) version 4.0 support for Marvell Prestera
> driver.
> 
> Major changes have been made to new v4.0 FW ABI to add support
> of new features, introduce the stability of the FW ABI and ensure
> better forward compatibility for the future driver vesrions.
> 
> Current v4.0 FW feature set support does not expect any changes
> to ABI, as it was defined and tested through long period of time.
> The ABI may be extended in case of new features, but it will not
> break the backward compatibility.
> 
> ABI major changes done in v4.0:
> - L1 ABI, where MAC and PHY API configuration are split.
> - ACL has been split to low-level TCAM and Counters ABI
>   to provide more HW ACL capabilities for future driver
>   versions.
> 
> To support backward support, the addition compatibility layer is
> required in the driver which will have two different codebase under
> "if FW-VER elif FW-VER else" conditions that will be removed
> in the future anyway, So, the idea was to break backward support
> and focus on more stable FW instead of supporting old version
> with very minimal and limited set of features/capabilities.
> 
> Improve FW msg validation:
>  * Use __le64, __le32, __le16 types in msg to/from FW to
>    catch endian mismatch by sparse.
>  * Use BUILD_BUG_ON for structures sent/recv to/from FW.
> 
> Co-developed-by: Vadym Kochan <vkochan@marvell.com>
> Signed-off-by: Vadym Kochan <vkochan@marvell.com>
> Signed-off-by: Yevhen Orlov <yevhen.orlov@plvision.eu>
> Signed-off-by: Taras Chornyi <tchornyi@marvell.com>
> Signed-off-by: Volodymyr Mytnyk <vmytnyk@marvell.com>

Compiling this file on m68k results in:

In file included from <command-line>:
In function 'prestera_hw_build_tests',
    inlined from 'prestera_hw_switch_init' at drivers/net/ethernet/marvell/prestera/prestera_hw.c:788:2:
include/linux/compiler_types.h:317:45: error: call to '__compiletime_assert_351' declared with attribute error: BUILD_BUG_ON failed: sizeof(struct prestera_msg_switch_attr_req) != 16

The size of struct prestera_msg_switch_attr_req is not well defined.

struct prestera_msg_switch_attr_req {
        struct prestera_msg_cmd cmd;			// 4 bytes
        __le32 attr;					// 4 bytes
        union prestera_msg_switch_param param;		// 6 bytes
};

The compiler may well decide, in this situation, to generate a structure of
size 14, not 16. The error is therefore not surprising.

Guenter

  parent reply	other threads:[~2021-11-05  2:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29  5:38 [PATCH net-next v4] net: marvell: prestera: add firmware v4.0 support Volodymyr Mytnyk
2021-10-29 12:53 ` Andrew Lunn
2021-10-29 14:45   ` Volodymyr Mytnyk [C]
2021-11-05  2:59 ` Guenter Roeck [this message]
2021-11-05  8:36   ` Volodymyr Mytnyk

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=20211105025920.GA2923425@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mickeyr@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=serhiy.pshyk@plvision.eu \
    --cc=taras.chornyi@plvision.eu \
    --cc=tchornyi@marvell.com \
    --cc=vkochan@marvell.com \
    --cc=vmytnyk@marvell.com \
    --cc=volodymyr.mytnyk@plvision.eu \
    --cc=yevhen.orlov@plvision.eu \
    /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).