Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp776944rdg; Thu, 10 Aug 2023 21:47:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEg/5WBEZSu9W1b+/2grc+mCO/DD7kOXPxGF+uLzpj3Ya5UKivYYCpDL5Kl4E6kiEYxbNH/ X-Received: by 2002:a17:906:1bb2:b0:99c:20f0:dec0 with SMTP id r18-20020a1709061bb200b0099c20f0dec0mr696851ejg.43.1691729237911; Thu, 10 Aug 2023 21:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691729237; cv=none; d=google.com; s=arc-20160816; b=hz+eic/7/W/ZMvXoCtZARxYHnETVjGqsU4spPiAxNFVodu5U3v/LgKkooNkIifkb/c urinU0pWkIB5n9kOvDKWC7p4d7Nr1ZVrkthKxDYtwJ2bnpQjTIBkTRPZ46RJiYJKJUH6 /H4Ft22LNqQW/aVg3iE2tpe7ZOQRr1+FcruFiBNdJMrmXvb6F/kQPXztVFevfYsXTcx/ oyeg4v2jEoKhdlbW5GsruU/td0G+V222MNOWPanJU3qda6RGxHwqsW5iad7m+c0YWfSn YvHlBmQiATk6FOup9PiobcYwx/B1SMJ1byXl06vdYNDOj8gcjFzvqIS16ixYPeXsGRjj Tk/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:authenticated-by; bh=a5ICGB1o7NEUZT5DVe0mR8nZkWF9q6iaelOkphQpAbM=; fh=Am76m85Wub4Tfou4DIPLY6b8ACS2R6coYVh/n7W3W+I=; b=OQzTIsqSwH2I7tNh5VNeoivTorKYVwjsRv88obS+846Tsc7dmQUAcFFZcF2nSSMzuT +aoUIezDRqnEzp3LAmktdBrtc6ZOuXEvwyyjW3uz+CmIMeaZMt2uizMj4QycmxsT0QOo vS8eV7utQzFaLV7SriRV7rH+yq8OuL/J7o6NPCbibifYuUZXPnZb77G5wKkyz/CEh9hu fV+hJFjykBwhXjNmIn2WRZ4kVRHHDySKe/NYX3dvie7+IbzdwlzH4nLtWp71ZojZ/KTl OUjn4w3KqFWF0ze4+hnkZtuO06ogw374Nbe2xJEsneR+t8rfulJodd8DobMSpw73i0G+ 8c3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jj4-20020a170907984400b00992f45c9342si2527775ejc.1020.2023.08.10.21.46.52; Thu, 10 Aug 2023 21:47:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231944AbjHKDes convert rfc822-to-8bit (ORCPT + 99 others); Thu, 10 Aug 2023 23:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbjHKDer (ORCPT ); Thu, 10 Aug 2023 23:34:47 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 19F7F2D66; Thu, 10 Aug 2023 20:34:44 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 37B3Xx7yA009363, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 37B3Xx7yA009363 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Aug 2023 11:33:59 +0800 Received: from RTEXMBS05.realtek.com.tw (172.21.6.98) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Fri, 11 Aug 2023 11:34:17 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS05.realtek.com.tw (172.21.6.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 11 Aug 2023 11:34:17 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d]) by RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d%5]) with mapi id 15.01.2375.007; Fri, 11 Aug 2023 11:34:17 +0800 From: Justin Lai To: Andrew Lunn CC: "kuba@kernel.org" , "davem@davemloft.net" , "edumazet@google.com" , "pabeni@redhat.com" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" Subject: RE: [PATCH net-next v2 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code Thread-Topic: [PATCH net-next v2 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code Thread-Index: AQHZy1QCmgVf5/SQ0U+g6HlrD3yFj6/jFKEAgAFd0RA= Date: Fri, 11 Aug 2023 03:34:17 +0000 Message-ID: <1e79bf4cdb8e4a75873d029cb7c56227@realtek.com> References: <20230810062915.252881-1-justinlai0215@realtek.com> <20230810062915.252881-2-justinlai0215@realtek.com> <8746dad6-a6f1-4db0-958b-7b66d9dbd1f5@lunn.ch> In-Reply-To: <8746dad6-a6f1-4db0-958b-7b66d9dbd1f5@lunn.ch> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.210.185] x-kse-serverinfo: RTEXMBS05.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +#include > > +#include > > + > > +#define RTL_ALLOC_SKB_INTR(napi, length) napi_alloc_skb(&(napi), > > +length) > > + > > +#define NETIF_F_ALL_CSUM NETIF_F_CSUM_MASK > > + > > +#define NETIF_F_HW_VLAN_RX NETIF_F_HW_VLAN_CTAG_RX #define > > +NETIF_F_HW_VLAN_TX NETIF_F_HW_VLAN_CTAG_TX > > + > > +#define CONFIG_SRIOV 1 > > + > > +#ifndef NETIF_F_RXALL > > +#define NETIF_F_RXALL 0u > > +#endif > > + > > +#ifndef NETIF_F_RXFCS > > +#define NETIF_F_RXFCS 0u > > +#endif > > + > > +#ifndef SET_NETDEV_DEV > > +#define SET_NETDEV_DEV(net, pdev) > > +#endif > > + > > +#ifndef SET_MODULE_OWNER > > +#define SET_MODULE_OWNER(dev) > > +#endif > > + > > +#ifndef SA_SHIRQ > > +#define SA_SHIRQ IRQF_SHARED > > +#endif > > + > > +#ifndef NETIF_F_GSO > > +#define gso_size tso_size > > +#define gso_segs tso_segs > > +#endif > > + > > +#ifndef dma_mapping_error > > +#define dma_mapping_error(a, b) 0 > > +#endif > > + > > +#ifndef netif_err > > +#define netif_err(a, b, c, d) > > +#endif > > + > > +#ifndef FALSE > > +#define FALSE 0 > > +#endif > > + > > +#ifndef TRUE > > +#define TRUE 1 > > +#endif > > + > > +#ifndef false > > +#define false 0 > > +#endif > > + > > +#ifndef true > > +#define true 1 > > +#endif > > When i see code like this, it just shouts 'vendor crap, don't bother reviewing'. > > Really, truly, get help from an experienced mainline developer to rewrite this > code to mainline quality. Then post version 3. > > Just as a hint, you are targeting net-next/main, and only net-next/main. You > can and should use everything which is in net-next/main, and you should > assume it exists. You are not targeting older kernels, and you should not have > 'vendor crap' like this so it will compile with older kernels. > > Spend some time looking at other drivers in mainline. If you are doing > something which other driver don't do, very likely you are doing something > wrong. Do you see other drivers looking to see if NETIF_F_RXALL exists, and it > not setting it to 0? > > And please don't just fix this and repost. There is a lot more wrong. > Find a mentor to help you. The community would like to see this driver in the > kernel, but an entity the size of Realtek can easily contract somebody to help > get the code into shape. > > Andrew Thank you for your suggestions, I will check our code again and make changes.