Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1392208ybm; Sat, 30 May 2020 07:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9llaVwyhwyiJdLyZWz5lp0MX0mEIki2Gl97X2ibkIfHo0hDtrwASfw5gCVOMjbsJ8dAnd X-Received: by 2002:a17:906:edb6:: with SMTP id sa22mr12630332ejb.393.1590849130585; Sat, 30 May 2020 07:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590849130; cv=none; d=google.com; s=arc-20160816; b=A8P7kQ4+7/H17nJ5U62tTk/buyCajugNJDX5N9A3wpJWiDljpGbjEFafI3N9ZNInzx /7TS/i7GzTS1K1hd98QET49SUS8lRL2PkJ/bcIhfyJBhHa5PH0sZ+YstLwv2F3I1LK5+ 15UQgDUbtf9Ecu8rOi5hwd0UnEE4W42U4OckkNW3ENVfX6FtWK85lfPpu/VvtBL9t47c d3giIlOSuKI+pk/qYshHZVU/n0Gvk2lsbrFv/n6yw8f8ljFl15BVXfwZtdYO8LPEvnUc HCPdklRHpwV6GBnOJOMF0cDRTaRYs9asV2n/uE5t7phs/5+4RSja1aXYaSujm6lKEfBJ AfUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kuJiJKc5mFCOwmq3bSomtUAFie+bbk1POoEFi7m75Po=; b=DS815ibTWgK+GBVjHYkkpvRC567Bi3NZwGNvtOvdlmwyOxUW8k1cRe3d27J4pnczkR /PXj/84a4SzYTEZ3ItAO7YKVIBStltJ7bAatl4OfUw4RarIxZhcPhhSBe+dxU54GT2Mc Zv4tAdXDPWBzwsnbnteaHiZiMyETDN5cc5utk3Zm1Bwl82+n2Fukd0vxzWV6vWsUIRQf v48fj2n77TIpDcEAGycUui4KjP//+r15TDIlOdzlO37nagz4gT1zjhr7sB7IWqXiSfhE dJwF6vdj12ROxzBsunCqpyreOLSaUBkUA6AvXLkRXbgMaCXGh1JU2WYuG9lHaaiPy9HN 7LKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=CtudZyY5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m27si7215577ejd.630.2020.05.30.07.31.45; Sat, 30 May 2020 07:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=CtudZyY5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729069AbgE3O3k (ORCPT + 99 others); Sat, 30 May 2020 10:29:40 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:35481 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728927AbgE3O3j (ORCPT ); Sat, 30 May 2020 10:29:39 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 079FA580324; Sat, 30 May 2020 10:29:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 30 May 2020 10:29:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=kuJiJK c5mFCOwmq3bSomtUAFie+bbk1POoEFi7m75Po=; b=CtudZyY52hIGT0TCNwJ469 8aKRUQJ6TU6mxrorzFpTgCrVBmR0egsXRA49NG4UIruYYPfTxzGoxMkbGtWt2Mjr 5K18nGw5Vk1J2AInwZnyy/MglHLlflIfjSK/t+IYMLIlal1kaWFhXpiprI4vC7KT fal4l3uwRj1eSIodAvLkQGhdTTy+CPDOSLb35LXu709LUKCAsC8AgJez4NsE2P6T r85Q/oBv8+SS3jeEpUQ5QSJrzdBzEjReFfLmki1bFpr5oLTg4SxTsazgNwwBzTrY jgujWHCY+vjM4kudyjS4NVeixfySdc2IKsul6q/XB2obXFwrtbOFLJeYK3DstGyA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeftddgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkughoucfu tghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrghtth gvrhhnpedtffekkeefudffveegueejffejhfetgfeuuefgvedtieehudeuueekhfduheel teenucfkphepjeelrddujeeirddvgedruddtjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehiughoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Received: from localhost (bzq-79-176-24-107.red.bezeqint.net [79.176.24.107]) by mail.messagingengine.com (Postfix) with ESMTPA id AAB023060F09; Sat, 30 May 2020 10:29:35 -0400 (EDT) Date: Sat, 30 May 2020 17:29:28 +0300 From: Ido Schimmel To: Vadym Kochan Cc: "David S. Miller" , Jakub Kicinski , Jiri Pirko , Ido Schimmel , Andrew Lunn , Oleksandr Mazur , Serhiy Boiko , Serhiy Pshyk , Volodymyr Mytnyk , Taras Chornyi , Andrii Savka , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Mickey Rachamim Subject: Re: [net-next 0/6] net: marvell: prestera: Add Switchdev driver for Prestera family ASIC device 98DX326x (AC3x) Message-ID: <20200530142928.GA1624759@splinter> References: <20200528151245.7592-1-vadym.kochan@plvision.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200528151245.7592-1-vadym.kochan@plvision.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 28, 2020 at 06:12:39PM +0300, Vadym Kochan wrote: > Marvell Prestera 98DX326x integrates up to 24 ports of 1GbE with 8 > ports of 10GbE uplinks or 2 ports of 40Gbps stacking for a largely > wireless SMB deployment. > > Prestera Switchdev is a firmware based driver that operates via PCI bus. The > current implementation supports only boards designed for the Marvell Switchdev > solution and requires special firmware. > > This driver implementation includes only L1, basic L2 support, and RX/TX. > > The core Prestera switching logic is implemented in prestera_main.c, there is > an intermediate hw layer between core logic and firmware. It is > implemented in prestera_hw.c, the purpose of it is to encapsulate hw > related logic, in future there is a plan to support more devices with > different HW related configurations. > > The following Switchdev features are supported: > > - VLAN-aware bridge offloading > - VLAN-unaware bridge offloading > - FDB offloading (learning, ageing) > - Switchport configuration > > The firmware image will be uploaded soon to the linux-firmware repository. > > PATCH: > 1) Fixed W=1 warnings Hi, I just applied the patches for review and checkpatch had a lot of complaints. Some are even ERRORs. For example: WARNING: do not add new typedefs #1064: FILE: drivers/net/ethernet/marvell/prestera/prestera_hw.h:32: +typedef void (*prestera_event_cb_t) WARNING: line over 80 characters #2007: FILE: drivers/net/ethernet/marvell/prestera/prestera_rxtx.c:321: + __skb_trim(buf->skb, PRESTERA_SDMA_RX_DESC_PKT_LEN(desc)); WARNING: line over 80 characters #2007: FILE: drivers/net/ethernet/marvell/prestera/prestera_rxtx.c:321: + __skb_trim(buf->skb, PRESTERA_SDMA_RX_DESC_PKT_LEN(desc)); ERROR: Macros with complex values should be enclosed in parentheses #196: FILE: drivers/net/ethernet/marvell/prestera/prestera_pci.c:161: +#define PRESTERA_FW_REG_ADDR(fw, reg) PRESTERA_FW_REG_BASE(fw) + (reg) WARNING: prefer 'help' over '---help---' for new help texts #52: FILE: drivers/net/ethernet/marvell/prestera/Kconfig:15: +config PRESTERA_PCI ... Also, smatch complaints about: drivers/net/ethernet/marvell/prestera//prestera_ethtool.c:713 prestera_ethtool_get_strings() error: memcpy() '*prestera_cnt_name' too small (32 vs 960) And coccicheck about: drivers/net/ethernet/marvell/prestera/prestera_hw.c:681:2-3: Unneeded semicolon > > 2) Renamed PCI driver name to be more generic "Prestera DX" because > there will be more devices supported. > > 3) Changed firmware image dir path: marvell/ -> mrvl/prestera/ > to be aligned with location in linux-firmware.git (if such > will be accepted). > > RFC v3: > 1) Fix prestera prefix in prestera_rxtx.c > > 2) Protect concurrent access from multiple ports on multiple CPU system > on tx path by spinlock in prestera_rxtx.c > > 3) Try to get base mac address from device-tree, otherwise use a random generated one. > > 4) Move ethtool interface support into separate prestera_ethtool.c file. > > 5) Add basic devlink support and get rid of physical port naming ops. > > 6) Add STP support in Switchdev driver. > > 7) Removed MODULE_AUTHOR > > 8) Renamed prestera.c -> prestera_main.c, and kernel module to > prestera.ko > > RFC v2: > 1) Use "pestera_" prefix in struct's and functions instead of mvsw_pr_ > > 2) Original series split into additional patches for Switchdev ethtool support. > > 3) Use major and minor firmware version numbers in the firmware image filename. > > 4) Removed not needed prints. > > 5) Use iopoll API for waiting on register's value in prestera_pci.c > > 6) Use standart approach for describing PCI ID matching section instead of using > custom wrappers in prestera_pci.c > > 7) Add RX/TX support in prestera_rxtx.c. > > 8) Rewritten prestera_switchdev.c with following changes: > - handle netdev events from prestera.c > > - use struct prestera_bridge for bridge objects, and get rid of > struct prestera_bridge_device which may confuse. > > - use refcount_t > > 9) Get rid of macro usage for sending fw requests in prestera_hw.c > > 10) Add base_mac setting as module parameter. base_mac is required for > generation default port's mac. > > Vadym Kochan (6): > net: marvell: prestera: Add driver for Prestera family ASIC devices > net: marvell: prestera: Add PCI interface support > net: marvell: prestera: Add basic devlink support > net: marvell: prestera: Add ethtool interface support > net: marvell: prestera: Add Switchdev driver implementation > dt-bindings: marvell,prestera: Add description for device-tree > bindings > > .../bindings/net/marvell,prestera.txt | 34 + > drivers/net/ethernet/marvell/Kconfig | 1 + > drivers/net/ethernet/marvell/Makefile | 1 + > drivers/net/ethernet/marvell/prestera/Kconfig | 25 + > .../net/ethernet/marvell/prestera/Makefile | 7 + > .../net/ethernet/marvell/prestera/prestera.h | 208 +++ > .../marvell/prestera/prestera_devlink.c | 111 ++ > .../marvell/prestera/prestera_devlink.h | 25 + > .../ethernet/marvell/prestera/prestera_dsa.c | 134 ++ > .../ethernet/marvell/prestera/prestera_dsa.h | 37 + > .../marvell/prestera/prestera_ethtool.c | 737 ++++++++++ > .../marvell/prestera/prestera_ethtool.h | 37 + > .../ethernet/marvell/prestera/prestera_hw.c | 1225 ++++++++++++++++ > .../ethernet/marvell/prestera/prestera_hw.h | 180 +++ > .../ethernet/marvell/prestera/prestera_main.c | 663 +++++++++ > .../ethernet/marvell/prestera/prestera_pci.c | 825 +++++++++++ > .../ethernet/marvell/prestera/prestera_rxtx.c | 860 +++++++++++ > .../ethernet/marvell/prestera/prestera_rxtx.h | 21 + > .../marvell/prestera/prestera_switchdev.c | 1286 +++++++++++++++++ > .../marvell/prestera/prestera_switchdev.h | 16 + > 20 files changed, 6433 insertions(+) > create mode 100644 drivers/net/ethernet/marvell/prestera/Kconfig > create mode 100644 drivers/net/ethernet/marvell/prestera/Makefile > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera.h > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_devlink.c > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_devlink.h > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_dsa.c > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_dsa.h > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_ethtool.c > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_ethtool.h > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_hw.c > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_hw.h > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_main.c > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_pci.c > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_rxtx.c > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_rxtx.h > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_switchdev.c > create mode 100644 drivers/net/ethernet/marvell/prestera/prestera_switchdev.h > > -- > 2.17.1 >