Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758916AbcLUJEN (ORCPT ); Wed, 21 Dec 2016 04:04:13 -0500 Received: from mail-bn3nam01on0069.outbound.protection.outlook.com ([104.47.33.69]:52484 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757051AbcLUJDk (ORCPT ); Wed, 21 Dec 2016 04:03:40 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Satha.Rao@cavium.com; From: Satha Koteswara Rao To: CC: , , , , , , , , , Subject: [RFC PATCH 0/7] ThunderX Embedded switch support Date: Wed, 21 Dec 2016 14:16:44 +0530 Message-ID: <1482310011-1862-1-git-send-email-satha.rao@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MAXPR01CA0030.INDPRD01.PROD.OUTLOOK.COM (10.164.147.37) To CY4PR07MB2838.namprd07.prod.outlook.com (10.169.252.16) X-MS-Office365-Filtering-Correlation-Id: 04347dba-3a6f-4485-5427-08d4297e0a31 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR07MB2838; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB2838;3:hrpw8obdTTcnCU7P0JqhHrsTnOFYo58Iiao0cpy3IuLJggS8SSXb8CZ11Cx8/1fwMgZjy7KQQ29XwJAcDh4/9c8+lrruErBm5hp/c9gAMsX0HGYpSo6x80FG1c5eGjvnOyWuZx2dI2vzrrqrqBRFvNwgGhMvwMGul/j47lkK3bp9H7We86X/afH0ESPtoBCXqXLZ+wAkSGEpEe/2y2smsJRLFKhf32AoNTGjDcVbwIC2QIFktO0uWPLnmcwBiBq7dkqWPQpR9tzEErdAf+wS2Q==;25:H2OT8mgkOhKU3qhWLU43CcMNVSm43+h+pvE6Qqlo7ItaXavdqXtiNNUTX3MTu6QuD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Na9ak0jvF3n8a1yFAA2zJW2IecK5qXlnWU2+3Th7n4G/62BjZ2G0isg+5R5EqlZOMjZDsB0woEIvEeIlzM37Nlmg9Rs2iX6smUXEccfFkfMn9eXLXO8AnPdHvNSkwNDBxgq9nU3yrm50BDRRGA5/yumtFreK5NWQhs2kpdJPS6lzNjvJtiiHGWcG9pK5tLzvfbiZ3jK+bOj0PNgRXgHy/uWPSyVKr/kjAJiSGw9eGQo80FXQOt6o4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(84791874153150)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(6072148);SRVR:CY4PR07MB2838;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB2838; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB2838;4:NydOwb9zKZRj6os3XALr+cqPjQl9+b8J8S7LKXhod50Km//G2qEqF+DvLIAmAiomdi6O9vl5Y2VQ+nK8t6zX2PqE653Ju+/7esz6mg5Z6iDLY2rvcE5CAAj3MiP0YeirafHReCufMy3ZpuW9cPmPjM+FEdTcWAxcTNtufsscRELQMjVblC4d6BJrAFgmKkQtEUE4Ts5+HwNs4QvfrFaDR4dZI4aaJhHCBO9dsdfejelw1GX8DYF55ONNymCDmorahcQDjIXHHpZVfJ92nl39Zmdp1ElMDbgiCDSOaa79d6vFNhbc+q1R7sW/nBAFo6Sz3TglcVxrtO+HWbGGO4pG6FU0fNAwXmPyPvcKBmJxLgTdHkOeDmLVcp/QlA6oQwa1jxgxEHJoFenQtyKRr7hSyx04QugHXz3sKryRGhb3G6YbDImyYBcj1x7jAqj6SFnBGZMDQ4vx7fwj+vJJLVvxzZ1Aj2kyBFOgHga69u3zg3Z3hJEmszJknpdIe9SxWYoSft5cnu9gawZuDMcspQHGkUSna8y5LXyBtNB6UrklD2CtP50TGObWW4Cn+53RfmUbxBUxgGCcUP4YvpL/4+5Ll9hbjtDjAGMHwnvgyIVtVHjJL5UST9CC2ioULmocsj2pwsksBbMSldLuygS+8QKo2w== X-Forefront-PRVS: 01630974C0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(189002)(199003)(2906002)(4326007)(101416001)(33646002)(5009440100003)(106356001)(2351001)(68736007)(105586002)(8676002)(5890100001)(50986999)(5003940100001)(53416004)(76506005)(48376002)(81156014)(81166006)(42186005)(66066001)(5660300001)(92566002)(50466002)(6506006)(575784001)(110136003)(7736002)(6916009)(47776003)(189998001)(36756003)(6116002)(50226002)(3846002)(97736004)(42882006)(25786008)(305945005)(6512006)(69596002)(38730400001)(6486002)(4720700003)(7099028)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB2838;H:localhost.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR07MB2838;23:k07HvHIlrikskcUMF33rLnTBPDwOTlBnfq9P5NV3Q?= =?us-ascii?Q?56rYra4HkW9NRTPRI4vuGF5GZCsyaccAHliCdkqCKJ1hJvcDNaE3x1gTShMq?= =?us-ascii?Q?qdJfwV/Jz28W9l1iwCKIYeHT+P9T4hoVGLwrHVFXJg3/lfNj4gXMSWlazUKg?= =?us-ascii?Q?WApnG2tKo+BFe6vrcl0TxVA0vQRDFxHZasx74slphPFq5At1pPkn+Vig2Fib?= =?us-ascii?Q?Ntr1JFm0zfmB/T6KEEY654m+SPFhCp9bTD3/+7QINWEz0xG6Whn5oKrxs7EH?= =?us-ascii?Q?F+9IlJ3ZVu2pDOOQV2Kxyj6XsmHhjsoobdItALFvRfobd38K/aXHaXF1G5vf?= =?us-ascii?Q?USUmnTAwyZkHcFaVMM6KAXjMnDwgfu2QLXbiI55QlI5s5ljXKjwmENdkeuzH?= =?us-ascii?Q?MKu4t1Ca1/rMCSgxYwhgiGKLLUvEeE/Fgk5hwFsYss07zBMfVMeZlL91Y4Bo?= =?us-ascii?Q?w+I1kSeD9GnKoZugfbK6NTGaUD+ABMRuE02Wq0bENKpvhHuj2YioWIbVKErg?= =?us-ascii?Q?UwyOgt7zcIE44Yvhkx0P++/DVFLo6p2hRlnIyrDycd3KdxAvkZmRm366Wb/A?= =?us-ascii?Q?b909s5N9/4TEhymIDT01g4F80qJD0tuhGj37T50tNu6YDHOL0UJccLooYHU+?= =?us-ascii?Q?o9gNZ9sDxfwjEcywkjN9jlndrgxyBCFPAfPpqhy7eJYKJA1Rdl0suQCixqoE?= =?us-ascii?Q?8zezSIGonunUwup41sz6f1X7JDDWmENbiZrKZEDdyjWyExxYihy/J7oFX3gg?= =?us-ascii?Q?SI1GRxdaZ223OGFiP2QxOCmkrEzwF/bgomQzQD0IFUXZuwgZK1vF9aODjOy4?= =?us-ascii?Q?wwe0r8iqvvHpD++vZ8zrvcZMzNHgBJtpwuGq8g9amQPfVjZBacESO8/sE+9S?= =?us-ascii?Q?fKPK8xGexlusYm/8FYu/4X8CJj1qtOmUIg1HMf0yUZUQBiMiY/m6kUX8OS09?= =?us-ascii?Q?JTp3v9+S++VEuQ6B6k4sWNYg10egXDQdggdmBXzyAIP+9jyimx+DA9JQdnfz?= =?us-ascii?Q?2fDz7JVVPYJX1rkh4c5BFqK0aUN0TQI+yJkdcbTKQA/kqwikaPBtZM4J4YAD?= =?us-ascii?Q?bKlivINg/UA4H1wGqZvZpINkpuWb/EPP6AviLW4hJqefJSvjy7VlN1onydoo?= =?us-ascii?Q?xoPjwMRjT5s5GaH5oDL8UQ4YQUb4O1USJuyGf8N6W3wElHhT/fUv3A2+Q7Ri?= =?us-ascii?Q?hpXGcS2lo3vAmxf07TiCtPo6dH37NJ5vImCSTDPTs0emDCK6bHiiz7a7B80K?= =?us-ascii?Q?XkKIC9f+pUees8iNIMxdwmh4hV/yF07TAadhD23?= X-Microsoft-Exchange-Di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zgC0DJ/2Q6Gd1I/8XXe+xJqLUg5DF/UxgdaVnP/70VquoGsSYXcXJif4rDvjq85KmvgynM9TgLKqidmTHhi43MqMdHEJYprxBh7LlYs6svpzlh4hDuDcLEvr6haQiQFLcJtvmGiyvFtFcJQxvajqlu5Kx1ZqWh/dXtBN3/1d1Jko9qovwW2ERjPe8MLj/a00rbBXbyzK+Ovh4N3A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2016 08:47:44.7768 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB2838 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4660 Lines: 127 Background ========== Proposed patch configures programmable ThunderX embedded network switch to emulate functions of e-switch found in most industry standard NICs. Embedded switch is pre-configured by loading firmware image which exposes several firmware defined tables allowing configuration of VLAN and MAC filters. Embedded switch configuration profile and the driver introduce the following features: * Support of configurable number of VFs per physical port (see num_vfs below) * VLAN filters per VF * Unicast MAC-DA filters per VF * Multicast MAC-DA filters per VF * Support of dedicated VF allowing packet mirroring of all traffic traversing physical port (such VF is attached to the interface representing physical port) * Administrative VLAN enforcement per VF (i.e. inserting/overwriting VLAN tag on all traffic originated by particular VF) Each VF operates in two modes: a) full filter mode, where it receives only registered MAC-DA/VLAN packets and b) multicast promiscuous mode. The latter is enabled when VF reaches it's maximum MAC-DA filter limit: in this mode VF receives all multicast and registered unicast MAC frames. Special effort is made to track association of interface switching groups to underlying physical ports: entry of /sys/class/net//phys_port_name contains string describing underlying physical port the interface is attached to in a form --. Set of patches include following changes: 1) Patch to original NIC drivers to enable internal switch, and load firmware image. 2) Modification of VF driver to subscribe to interface MAC/VLAN ADD/DELETE notifications and send them to the PF driver. 3) Modification of PF driver to receive MBOX interrupts from VF for ADD/DELETE MAC/VLAN registrations. 4) E-switch initialization code 5) API to access firmware-defined tables embedded switch tables. The following new parameter is introduced by the driver: num_vfs: Number of VFs attached to each physical port, default value of this parameter is 0, in which case driver operates in backward-compatible switch bypass mode. Set of patches uses below git branch git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git patchset generated against below commit commit 69973b830859bc6529a7a0468ba0d80ee5117826 Author: Linus Torvalds Date: Sun Dec 11 11:17:54 2016 -0800 Linux 4.9 Thank You! ------------------------------------------------------------------------------- Satha Koteswara Rao (7): * Patch 1: * PF driver modified to enable HW filter support, changes works in backward compatibility mode. Enable required things in Makefile. Enable LZ4 dependecy inside config file * Patch 2: * VF driver changes to enable hooks to get kernel notifications * Patch 3: * Enable pause frame support * Patch 4: * HW Filter Initialization code and register access APIs * Patch 5: * Multiple VF's grouped together under single physical port called PF group. PF Group maintainance API's. * Patch 6: * HW Filter Table access API's * Patch 7: * Get notifications from PF driver and configure filter block based on requested data. drivers/net/ethernet/cavium/Kconfig | 1 + drivers/net/ethernet/cavium/thunder/Makefile | 2 +- drivers/net/ethernet/cavium/thunder/nic.h | 203 ++- drivers/net/ethernet/cavium/thunder/nic_main.c | 735 ++++++++- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 579 ++++++- drivers/net/ethernet/cavium/thunder/pf_filter.c | 1678 +++++++++++++++++++++ drivers/net/ethernet/cavium/thunder/pf_globals.h | 78 + drivers/net/ethernet/cavium/thunder/pf_locals.h | 365 +++++ drivers/net/ethernet/cavium/thunder/pf_reg.c | 660 ++++++++ drivers/net/ethernet/cavium/thunder/pf_vf.c | 207 +++ drivers/net/ethernet/cavium/thunder/tbl_access.c | 262 ++++ drivers/net/ethernet/cavium/thunder/tbl_access.h | 61 + drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 25 + drivers/net/ethernet/cavium/thunder/thunder_bgx.h | 7 + 14 files changed, 4712 insertions(+), 151 deletions(-) create mode 100644 drivers/net/ethernet/cavium/thunder/pf_filter.c create mode 100644 drivers/net/ethernet/cavium/thunder/pf_globals.h create mode 100644 drivers/net/ethernet/cavium/thunder/pf_locals.h create mode 100644 drivers/net/ethernet/cavium/thunder/pf_reg.c create mode 100644 drivers/net/ethernet/cavium/thunder/pf_vf.c create mode 100644 drivers/net/ethernet/cavium/thunder/tbl_access.c create mode 100644 drivers/net/ethernet/cavium/thunder/tbl_access.h -- 1.8.3.1