From: Justin Lai <justinlai0215@realtek.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "kuba@kernel.org" <kuba@kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [PATCH net-next v2 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code
Date: Fri, 11 Aug 2023 03:34:17 +0000 [thread overview]
Message-ID: <1e79bf4cdb8e4a75873d029cb7c56227@realtek.com> (raw)
In-Reply-To: <8746dad6-a6f1-4db0-958b-7b66d9dbd1f5@lunn.ch>
> > +#include <linux/version.h>
> > +#include <linux/ethtool.h>
> > +
> > +#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.
next prev parent reply other threads:[~2023-08-11 3:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 6:29 [PATCH net-next v2 0/2] Add Realtek automotive PCIe driver Justin Lai
2023-08-10 6:29 ` [PATCH net-next v2 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code Justin Lai
2023-08-10 14:41 ` Andrew Lunn
2023-08-11 3:34 ` Justin Lai [this message]
2023-08-14 9:35 ` Heiner Kallweit
2023-08-15 5:38 ` Justin Lai
2023-08-10 6:29 ` [PATCH net-next v2 2/2] MAINTAINERS: Add the rtase ethernet driver entry Justin Lai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1e79bf4cdb8e4a75873d029cb7c56227@realtek.com \
--to=justinlai0215@realtek.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome