From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 50F25A0556; Thu, 20 Feb 2020 15:00:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9BF0A37B0; Thu, 20 Feb 2020 15:00:13 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70090.outbound.protection.outlook.com [40.107.7.90]) by dpdk.org (Postfix) with ESMTP id E03C425B3 for ; Thu, 20 Feb 2020 15:00:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=La+8qIKR4Bwy0v3/tvVF8MELINK85tKYLF4Q0/yXxVcaFlPcd7sUJ93Fk4P7o+cAZE5il3fl1ff11GjLfnNd0zJbiKHOh5FtaWOP02ngTMD6W5pEKTl0Jven9TK3PDSbrZ+2PhQbV36YoDsFH24QZwND/Dz/N1ynNGrzreAulkIMzeEpcK1FPQQHc3UIT7C9nNapM+xHWn2SKSs/NBmvdq1bqtQdKzrk3SZxSmsNWgpcF54HLAQdPVj0KQ/W4mFrnaWinVvXZtUcLLgnSHBRSLKZ0NpCcUi7A/Jidq9Dit99vgMmRb/vys00K9UXPifsSBt2I+ez2v6Xk9sznNxEkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KWSFGn4aX9ruEIa9+sybU3So11JVgoSqrttVFEa1/FQ=; b=jM85KH9KZxCYhSlc2phUEl9L0HoQ6ZI+w/FSm8DtdRbqeyamCe/i1O7rx/x8zBvTsc8EKb6YdrR7oTcbJnXG9YkMqtRzIdMdU5LQTYDah6K+J3XV2rWoE3M0oFpcf9OU2EeiHx2zV7u4DuxsAS7teXMQv78z0mXqdVtOF2BY2M2b0T4jz+OiUc3KqN4e5DiCNVkfqluShP+8/OuNXnjfXzyVN9jR3awSEkjCJlK6ktw+bovvE3SCxK1274ZPrsPMI/6Foj141Iv0ZLekk7nNfYBvE8K+pr5KquubwLQ7ySNeYIzb4G6TwOPCwjwYFXUgsfpROJilFUb/9lGSMHDzHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silicom.co.il; dmarc=pass action=none header.from=silicom.co.il; dkim=pass header.d=silicom.co.il; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SILICOMLTD.onmicrosoft.com; s=selector2-SILICOMLTD-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KWSFGn4aX9ruEIa9+sybU3So11JVgoSqrttVFEa1/FQ=; b=EUiAR8jm+StWizzJ8xqI6ctqVuLrtgRattixArZcPUOG6ETGBP370t5swoE67JtXN6pv/qGXGOtyMCmW7mrhJXs9qvZ/DeKktk8j64fCWVSh4XZkg06rqueNkflbZtdD31VAA8fFpr5BHdqRHJKv4/ryc8vb9YvRk8x+QlJ17UU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=xiaojun.liu@silicom.co.il; Received: from DB7PR04MB5196.eurprd04.prod.outlook.com (20.176.234.140) by DB7PR04MB5354.eurprd04.prod.outlook.com (20.178.107.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.18; Thu, 20 Feb 2020 14:00:10 +0000 Received: from DB7PR04MB5196.eurprd04.prod.outlook.com ([fe80::a400:f6b9:34b1:ed]) by DB7PR04MB5196.eurprd04.prod.outlook.com ([fe80::a400:f6b9:34b1:ed%5]) with mapi id 15.20.2729.033; Thu, 20 Feb 2020 14:00:10 +0000 From: Xiaojun Liu To: xiao.w.wang@intel.com, qi.z.zhang@intel.com, ngai-mint.kwan@intel.com, jacob.e.keller@intel.com Cc: dev@dpdk.org, Xiaojun Liu Date: Thu, 20 Feb 2020 21:59:29 +0800 Message-Id: <1582207174-31037-1-git-send-email-xiaojun.liu@silicom.co.il> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576057875-7677-2-git-send-email-xiaojun.liu@silicom.co.il> References: <1576057875-7677-2-git-send-email-xiaojun.liu@silicom.co.il> Content-Type: text/plain X-ClientProxiedBy: HK2PR06CA0007.apcprd06.prod.outlook.com (2603:1096:202:2e::19) To DB7PR04MB5196.eurprd04.prod.outlook.com (2603:10a6:10:1a::12) MIME-Version: 1.0 Received: from xj-desktop.net-perf.com (119.139.198.174) by HK2PR06CA0007.apcprd06.prod.outlook.com (2603:1096:202:2e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.18 via Frontend Transport; Thu, 20 Feb 2020 14:00:08 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [119.139.198.174] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d5e3c68-ae4f-4d60-7ba5-08d7b60d331a X-MS-TrafficTypeDiagnostic: DB7PR04MB5354: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 031996B7EF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(39850400004)(136003)(376002)(346002)(366004)(199004)(189003)(36756003)(6512007)(86362001)(81166006)(2906002)(81156014)(52116002)(6506007)(8676002)(4326008)(8936002)(16526019)(316002)(6666004)(186003)(6486002)(5660300002)(44832011)(478600001)(66946007)(66476007)(107886003)(26005)(66556008)(2616005)(956004); DIR:OUT; SFP:1102; SCL:1; SRVR:DB7PR04MB5354; H:DB7PR04MB5196.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: silicom.co.il does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NABLk15grk01nxfmjbt96TepxtY86pKZE69mB6MUDoxkBi71H3M9sSjUvdPvSXy1hP4BoO8XCv8jHjsiel9Qjx92/3EthSSY5370jpNagCE7t0eKCa6Pkdq8Kp2bUCtgfqhX81RlipXJvyw6w4IM6I7Ad2rBdm6svjlWaZaCTaDdGhPQHC3IPLJPeqmDAsifZnLrRkUXWBGxlQYnGH+VBsBakEUSQYtTva+A+2zoULzozegiemZyr4ryCA4CiWjKdYlf5k3QVDiNZjqwctj+p5KciYF3EqYJazK+r0wS0ARR5x5gWiuVyT6zStCgUS4Z9e/hcIv5mhI+k93fFBHB2+oFc0erMchYiz7loqby6FT5HjU9FY+GGV8htIMiOMj1to2FVw8byLlaaUxO7k5u/NkfDsP5EWUHGalajt30r04Sj+gv+iZ0Dq0jSq2MPWbS X-MS-Exchange-AntiSpam-MessageData: gKdPQtQSHTGQwuyHomrjP45ADJo3rwjfzNDhZUfe2z+Ew9SYh4TY26bq+dqEDZ3KBTbshzaZr4oHGD31jC90vEPiieQStpjUEWfanbOp+lc3eXxGMrMyiT03WWwmgx6yFC7WYJB0P5rNjcF3YveM5g== X-OriginatorOrg: silicom.co.il X-MS-Exchange-CrossTenant-Network-Message-Id: 0d5e3c68-ae4f-4d60-7ba5-08d7b60d331a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2020 14:00:10.5867 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c9e326d8-ce47-4930-8612-cc99d3c87ad1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AiWkoOUR132UjFKonn3GB71cA1vA+DkRFiccBal51zchwvwC9p4knF//0FLBERz3Vytr+tOWp6xD/LOIoxVCrXp8Pivmx7+szHMeiri7pb8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB5354 Subject: [dpdk-dev] [PATCH v2 0/5] support switch management X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" To avoid configuration for both kernel driver and userspace SDK outside DPDK, we add switch management in FM10K DPDK PMD driver. Split dev init to 2 parts. First only register the port in switch management; second init hook will be called after all the pf are registered and switch initialization. It will finish dev init. Also add switch interrupt support. Add fm10k_mirror_rule_set/fm10k_mirror_rule_reset to support mirror operation. Add fm10k_dev_filter_ctrl to support flow operation. Add dpdk port and pf mapping, so the dpdk port can map to a specific pf and 1 dpdk port can map to 2 pf to get total 100G throughput. Add flow interface to support offload flow into HW. It supports parse vlan and parse mpls, all these data will be transffered to ffu data. Add switch management, includes initialization, port mapping, epl port link, LED controller, interrupt handler. It create 3 threads. One for interrupt handler, one for LED controller, one for statistics. Add ffu to support offload flow into HW. It supports forward, mirror, push VLAN, pop VLAN. It also supports flowset for a group flow definition. The config file can configure debug log, port speed, epl port mapping dpdk port, flowset. All these configuration will be used by switch management. Statistics includes epl port, ffu rule, dpdk port, and error. All these statistics data are read from HW. Modify switch header file to support getting logical port and glort and device info. Add epl serdes include loading spico, controling pcsl, dma, dfe, ical. Add spico code. Add state machine for epl lane and port, it creates a pthread to handle the state changing event. Add external port management, which will use state machine to handle the event from lane and port. The lane state will change between DOWN, WAIT_PLL_LOCK, WAIT_SIGNAL_OK, WAIT_DFE_ICAL, WAIT_DFE_PCAL, UP. The port state will change between DOWN, WAIT_LANE_UP, UP. Add I2C to control the inside LED and PHY. All the operations of I2C are using fm10k I2C register. Add SBUS to communicate with spico(micro code in serdes) by using fm10k SBUS register. This is like I2C operations. Add registers defination, which include all the registers will be used in the driver. Add switch management log API. Add switch management structures. Modify Makefile to add new files building Xiaojun Liu (5): net/fm10k: add basic functions for switch management net/fm10k: add epl serdes and port control functions net/fm10k: add ffu and statistics and config file functions net/fm10k: add flow interface and switch management net/fm10k: add switch management support drivers/net/fm10k/Makefile | 25 + drivers/net/fm10k/fm10k_ethdev.c | 587 +++++- drivers/net/fm10k/switch/fm10k_config.c | 863 ++++++++ drivers/net/fm10k/switch/fm10k_config.h | 178 ++ drivers/net/fm10k/switch/fm10k_debug.h | 19 + drivers/net/fm10k/switch/fm10k_ext_port.c | 841 ++++++++ drivers/net/fm10k/switch/fm10k_ext_port.h | 136 ++ drivers/net/fm10k/switch/fm10k_ffu.c | 1253 +++++++++++ drivers/net/fm10k/switch/fm10k_ffu.h | 31 + drivers/net/fm10k/switch/fm10k_flow.c | 872 ++++++++ drivers/net/fm10k/switch/fm10k_flow.h | 26 + drivers/net/fm10k/switch/fm10k_i2c.c | 310 +++ drivers/net/fm10k/switch/fm10k_i2c.h | 54 + drivers/net/fm10k/switch/fm10k_regs.h | 2302 +++++++++++++++++++++ drivers/net/fm10k/switch/fm10k_sbus.c | 292 +++ drivers/net/fm10k/switch/fm10k_sbus.h | 40 + drivers/net/fm10k/switch/fm10k_serdes.c | 1936 +++++++++++++++++ drivers/net/fm10k/switch/fm10k_serdes.h | 32 + drivers/net/fm10k/switch/fm10k_sm.c | 190 ++ drivers/net/fm10k/switch/fm10k_sm.h | 81 + drivers/net/fm10k/switch/fm10k_spico_code.c | 2966 +++++++++++++++++++++++++++ drivers/net/fm10k/switch/fm10k_spico_code.h | 21 + drivers/net/fm10k/switch/fm10k_stats.c | 1242 +++++++++++ drivers/net/fm10k/switch/fm10k_stats.h | 257 +++ drivers/net/fm10k/switch/fm10k_switch.c | 2376 +++++++++++++++++++++ drivers/net/fm10k/switch/fm10k_switch.h | 475 +++++ 26 files changed, 17364 insertions(+), 41 deletions(-) create mode 100644 drivers/net/fm10k/switch/fm10k_config.c create mode 100644 drivers/net/fm10k/switch/fm10k_config.h create mode 100644 drivers/net/fm10k/switch/fm10k_debug.h create mode 100644 drivers/net/fm10k/switch/fm10k_ext_port.c create mode 100644 drivers/net/fm10k/switch/fm10k_ext_port.h create mode 100644 drivers/net/fm10k/switch/fm10k_ffu.c create mode 100644 drivers/net/fm10k/switch/fm10k_ffu.h create mode 100644 drivers/net/fm10k/switch/fm10k_flow.c create mode 100644 drivers/net/fm10k/switch/fm10k_flow.h create mode 100644 drivers/net/fm10k/switch/fm10k_i2c.c create mode 100644 drivers/net/fm10k/switch/fm10k_i2c.h create mode 100644 drivers/net/fm10k/switch/fm10k_regs.h create mode 100644 drivers/net/fm10k/switch/fm10k_sbus.c create mode 100644 drivers/net/fm10k/switch/fm10k_sbus.h create mode 100644 drivers/net/fm10k/switch/fm10k_serdes.c create mode 100644 drivers/net/fm10k/switch/fm10k_serdes.h create mode 100644 drivers/net/fm10k/switch/fm10k_sm.c create mode 100644 drivers/net/fm10k/switch/fm10k_sm.h create mode 100644 drivers/net/fm10k/switch/fm10k_spico_code.c create mode 100644 drivers/net/fm10k/switch/fm10k_spico_code.h create mode 100644 drivers/net/fm10k/switch/fm10k_stats.c create mode 100644 drivers/net/fm10k/switch/fm10k_stats.h create mode 100644 drivers/net/fm10k/switch/fm10k_switch.c create mode 100644 drivers/net/fm10k/switch/fm10k_switch.h -- 1.8.3.1