Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2225214rdb; Fri, 8 Dec 2023 01:48:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEE7a6i2GF4k6i+VXp0oPWwbYl8U4Z1vw8AfhVEdCimocdYP+l9qsEUPYfwumQZ0+FEEsjN X-Received: by 2002:a05:6358:e4a7:b0:170:9c26:cdfa with SMTP id by39-20020a056358e4a700b001709c26cdfamr810350rwb.16.1702028927768; Fri, 08 Dec 2023 01:48:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702028927; cv=none; d=google.com; s=arc-20160816; b=Anp049452HAcvFKPGU4gZz/3wuUmdO8kUR3i4IXzkBVGHarVmY90q7K4gTEA8c2Byp CPavcXSEKgyoUtknvB0r+IOSKeaI1/5xfdgUNi+6di8RQnX8p4veWoWb+SqMtaJefPql c/BP+5rn5Jg6PNYfLIFulaUKdlLeCLISbSnJwo4WDtMz+V7Vt8lQawQTTbe4N5yRab+K oktutE5vjD1DAjf7Uf2hL3NNCkUsto48v1H4aD0gwrTNAtUVy8xnlb2tR1EYwTyHRPW7 J4Sdstg5vo8iZ7IXYJA954xmxwecwjCGX02mIt49PY0xvvKD4vPRYVEZiOtKl0SPb8Y7 UDPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=QtetZFPc2bTOF2sQ9FDeN6il8F0EGp4Yu0qifUqHvlg=; fh=J4St9tMjBInT3r1VVHSF1O7f2qS3KxSaZBHCVggmRHk=; b=K4I7ETPOQSW4y/js73jzv3dPvqXv9DYc+NqicNA75u8/VwdGg7/DeIpZl97J3JV71R B4s86dPmiLDXJuxMPjtZVbsSPCiIkMwZj8aAVzNf4YEeRP0+qERHw5J16+HY25Watbsg EztWuuFZCR5/gZygaQDWoRuUX+6krVT9JNa/trp6KwdyZ+IzybAbnxufTLBIW8Tu1Lun +5bIaCtdYWZzUE4rDprTftHvzGBob7iYOMBfRbG4xN3xEL9OvdK4Eu3SuJf8+XbvDFvk nbT2Dd1wUznoJJTgm+hgaXkPLexH5ifRKCuxm05E+9K0JONWhqJLfO3y+tZQe3qI8TZe P+Lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id i9-20020a17090332c900b001d0bcd70826si1351977plr.158.2023.12.08.01.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 01:48:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 68F8D82A9B81; Fri, 8 Dec 2023 01:48:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573475AbjLHJsM (ORCPT + 99 others); Fri, 8 Dec 2023 04:48:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233242AbjLHJsF (ORCPT ); Fri, 8 Dec 2023 04:48:05 -0500 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 108C1D5B; Fri, 8 Dec 2023 01:48:10 -0800 (PST) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3B89lgiuF802602, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 3B89lgiuF802602 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Dec 2023 17:47:42 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Fri, 8 Dec 2023 17:47:43 +0800 Received: from RTDOMAIN (172.21.210.160) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 8 Dec 2023 17:47:42 +0800 From: Justin Lai To: CC: , , , , , , , , Justin Lai Subject: [PATCH net-next v14 00/13] Add Realtek automotive PCIe driver Date: Fri, 8 Dec 2023 17:47:20 +0800 Message-ID: <20231208094733.1671296-1-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.210.160] X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 08 Dec 2023 01:48:39 -0800 (PST) This series includes adding realtek automotive ethernet driver and adding rtase ethernet driver entry in MAINTAINERS file. This ethernet device driver for the PCIe interface of Realtek Automotive Ethernet Switch,applicable to RTL9054, RTL9068, RTL9072, RTL9075, RTL9068, RTL9071. v1 -> v2: - Remove redundent debug message. - Modify coding rule. - Remove other function codes not related to netdev. v2 -> v3: - Remove SR-IOV function - We will add the SR-IOV function together when uploading the vf driver in the future. - Remove other unnecessary code and macro. v3 -> v4: - Remove function prototype - Our driver does not use recursion, so we have reordered the code and removed the function prototypes. - Define macro precisely - Improve macro code readability to make the source code cleaner. v4 -> v5: - Modify ethtool function - Remove some unnecessary code. - Don't use inline function - Let the compiler decide. v5 -> v6: - Some old macro definitions have been removed and replaced with the lastest usage. - Replace s32 with int to ensure consistency. - Clearly point out the objects of the service and remove unnecessary struct. v6 -> v7: - Split this driver into multiple patches. - Reorganize this driver code and remove redundant code to make this driver more concise. v7 -> v8: - Add the function to calculate time mitigation and the function to calculate packet number mitigation. Users can use these two functions to calculate the reg value that needs to be set for the mitigation value they want to set. - This device is usually used in automotive embedded systems. The page pool api will use more memory in receiving packets and requires more verification, so we currently do not plan to use it in this patch. v8 -> v9: - Declare functions that are not extern as static functions and increase the size of the character array named name in the rtase_int_vector struct to correct the build warning noticed by the kernel test robot. v9 -> v10: - Currently we change to use the page pool api. However, when we allocate more than one page to an rx buffer, it will cause system errors in some cases. Therefore, we set the rx buffer to fixed size with 3776 (PAGE_SIZE - SKB_DATA_ALIGN(sizeof(skb_shared_info) )), and the maximum value of mtu is set to 3754(rx buffer size - VLAN_ETH_HLEN - ETH_FCS_LEN). - When ndo_tx_timeout is called, it will dump some device information, which can be used for debugging. - When the mtu is greater than 1500, the device supports checksums but not TSO. - Fix compiler warnning. v10 -> v11: - Added error handling of rtase_init_ring(). - Modify the error related to asymmetric pause in rtase_get_settings. - Fix compiler error. v11 -> v12: - Use pm_sleep_ptr and related macros. - Remove multicast filter limit. - Remove VLAN support and CBS offload functions. - Remove redundent code. - Fix compiler warnning. v12 -> v13: - Fixed the compiler warning of unuse rtase_suspend() and rtase_resume() when there is no define CONFIG_PM_SLEEP. v13 -> v14: - Remove unuse include. - call eth_hw_addr_random() to generate random MAC and set device flag - use pci_enable_msix_exact() instead of pci_enable_msix_range() - If dev->dma_mask is non-NULL, dma_set_mask_and_coherent with a 64-bit mask will never fail, so remove the part that determines the 32-bit mask. - set dev->pcpu_stat_type before register_netdev() and core will allocate stats - call NAPI instance at the right location Justin Lai (13): rtase: Add pci table supported in this module rtase: Implement the .ndo_open function rtase: Implement the rtase_down function rtase: Implement the interrupt routine and rtase_poll rtase: Implement hardware configuration function rtase: Implement .ndo_start_xmit function rtase: Implement a function to receive packets rtase: Implement net_device_ops rtase: Implement pci_driver suspend and resume function rtase: Implement ethtool function rtase: Add a Makefile in the rtase folder realtek: Update the Makefile and Kconfig in the realtek folder MAINTAINERS: Add the rtase ethernet driver entry MAINTAINERS | 7 + drivers/net/ethernet/realtek/Kconfig | 17 + drivers/net/ethernet/realtek/Makefile | 1 + drivers/net/ethernet/realtek/rtase/Makefile | 10 + drivers/net/ethernet/realtek/rtase/rtase.h | 335 +++ .../net/ethernet/realtek/rtase/rtase_main.c | 2372 +++++++++++++++++ 6 files changed, 2742 insertions(+) create mode 100644 drivers/net/ethernet/realtek/rtase/Makefile create mode 100644 drivers/net/ethernet/realtek/rtase/rtase.h create mode 100644 drivers/net/ethernet/realtek/rtase/rtase_main.c -- 2.34.1