RE: [PATCH net-next 1/3] Add LAN743X driver

2017-08-14 Thread Bryan.Whitehead
> > The statistics code here is confused. > You are already counting rx_packets in software in napi_poll Then you get > values from MAC. One or the other? > There are two copies of stats, one in netdev and other in your mac structure. > > Also what about byte and error counts? > > If possible im

RE: [PATCH net-next 1/3] Add LAN743X driver

2017-08-14 Thread Bryan.Whitehead
> Could you split it up a bit. Take the PTP support out for the moment, and > submit it later once the core driver is accepted. The same for any other > optional bits. > > Andrew Andrew, thanks for the feedback. I will work on them and submit again later. Bryan

RE: [PATCH net-next 1/3] Add LAN743X driver

2017-08-14 Thread Bryan.Whitehead
> -Original Message- > From: David Miller [mailto:da...@davemloft.net] > Sent: Friday, August 11, 2017 6:12 PM > To: Bryan Whitehead - C21958 > Cc: netdev@vger.kernel.org; UNGLinuxDriver > Subject: Re: [PATCH net-next 1/3] Add LAN743X driver > > From: > Date

Re: [PATCH net-next 1/3] Add LAN743X driver

2017-08-11 Thread Stephen Hemminger
On Fri, 11 Aug 2017 19:47:57 + wrote: > +static void lan743x_pcidev_remove(struct pci_dev *pdev) > +{ > + struct net_device *netdev = NULL; > + struct lan743x_adapter *adapter = NULL; > + > + netdev = pci_get_drvdata(pdev); > + adapter = netdev_priv(netdev); Useless double in

Re: [PATCH net-next 1/3] Add LAN743X driver

2017-08-11 Thread Stephen Hemminger
On Fri, 11 Aug 2017 19:47:57 + wrote: > + > +static struct net_device_stats *mac_get_stats(struct lan743x_adapter > *adapter) > +{ > + struct lan743x_mac *mac = &adapter->mac; > + > + memset(&mac->statistics, 0, sizeof(mac->statistics)); > + mac->statistics.rx_packets = lan743x_c

Re: [PATCH net-next 1/3] Add LAN743X driver

2017-08-11 Thread Stephen Hemminger
On Fri, 11 Aug 2017 19:47:57 + wrote: > + > +static int lan743x_rx_napi_poll(struct napi_struct *napi, int weight) > +{ > + int count; > + bool finished = false; > + struct lan743x_rx *rx = container_of(napi, > + struct lan743x_rx, napi); > + struct lan743x_adapter

Re: [PATCH net-next 1/3] Add LAN743X driver

2017-08-11 Thread Stephen Hemminger
On Fri, 11 Aug 2017 19:47:57 + wrote: > + > +static int lan743x_ethtool_get_eeprom_len(struct net_device *netdev) > +{ > + return 0; > +} > + This stub should go. If you have no eeprom, take the ethtool default.

Re: [PATCH net-next 1/3] Add LAN743X driver

2017-08-11 Thread Stephen Hemminger
On Fri, 11 Aug 2017 19:47:57 + wrote: > + > + netdev = alloc_etherdev(sizeof(struct lan743x_adapter)); > + if (!netdev) { > + NETIF_ERROR(adapter, probe, adapter->netdev, > + "alloc_etherdev returned NULL"); > + ret = -ENOMEM; > +

Re: [PATCH net-next 1/3] Add LAN743X driver

2017-08-11 Thread Stephen Hemminger
; > + > +static void lan743x_rx_isr(void *context, u32 int_sts); > + > +static int lan743x_rx_ring_init(struct lan743x_rx *rx); > +static void lan743x_rx_ring_cleanup(struct lan743x_rx *rx); > +static int lan743x_rx_init(struct lan743x_rx *rx, > +struct lan743x_adapter *adap

Re: [PATCH net-next 1/3] Add LAN743X driver

2017-08-11 Thread Andrew Lunn
> This thing is huge, I'm not reviewing any more of this enormous submission. Yes. Could you split it up a bit. Take the PTP support out for the moment, and submit it later once the core driver is accepted. The same for any other optional bits. Andrew

Re: [PATCH net-next 1/3] Add LAN743X driver

2017-08-11 Thread Andrew Lunn
On Fri, Aug 11, 2017 at 07:47:57PM +, bryan.whiteh...@microchip.com wrote: > From: Bryan Whitehead > > Add Microchip LAN743X Driver files > LAN743X is a PCIe Gigabit ethernet adapter > > Signed-off-by: Bryan Whitehead > --- > drivers/net/ethernet/microchip/lan743x.c | 6842 > +

Re: [PATCH net-next 1/3] Add LAN743X driver

2017-08-11 Thread David Miller
From: Date: Fri, 11 Aug 2017 19:47:57 + > +static int lan743x_pci_init(struct lan743x_adapter *adapter, > + struct pci_dev *pdev) > +{ > + int ret = -ENODEV; > + int bars = 0; > + struct lan743x_pci *pci = &adapter->pci; Please always order local variable