[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230525205454.1c766852@kernel.org>
Date: Thu, 25 May 2023 20:54:54 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Justin Chen <justin.chen@...adcom.com>
Cc: netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
bcm-kernel-feedback-list@...adcom.com, florian.fainelli@...adcom.com,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
opendmb@...il.com, andrew@...n.ch, hkallweit1@...il.com,
linux@...linux.org.uk, richardcochran@...il.com, sumit.semwal@...aro.org,
christian.koenig@....com, simon.horman@...igine.com
Subject: Re: [PATCH net-next v5 3/6] net: bcmasp: Add support for ASP2.0
Ethernet controller
On Wed, 24 May 2023 16:01:50 -0700 Justin Chen wrote:
> Add support for the Broadcom ASP 2.0 Ethernet controller which is first
> introduced with 72165. This controller features two distinct Ethernet
> ports that can be independently operated.
>
> This patch supports:
>
> - Wake-on-LAN using magic packets
> - basic ethtool operations (link, counters, message level)
> - MAC destination address filtering (promiscuous, ALL_MULTI, etc.)
> +static netdev_tx_t bcmasp_xmit(struct sk_buff *skb, struct net_device *dev)
> +{
> + struct bcmasp_intf *intf = netdev_priv(dev);
> + int spb_index, nr_frags, ret, i, j;
> + unsigned int total_bytes, size;
> + struct bcmasp_tx_cb *txcb;
> + dma_addr_t mapping, valid;
> + struct bcmasp_desc *desc;
> + bool csum_hw = false;
> + struct device *kdev;
> + skb_frag_t *frag;
> +
> + kdev = &intf->parent->pdev->dev;
> +
> + spin_lock(&intf->tx_lock);
What is the tx_lock for? netdevs already have a tx lock, unless you
declare the device as lockless.
> +static void bcmasp_tx_timeout(struct net_device *dev, unsigned int txqueue)
> +{
> + struct bcmasp_intf *intf = netdev_priv(dev);
> +
> + netif_dbg(intf, tx_err, dev, "transmit timeout!\n");
> +
> + netif_trans_update(dev);
> + dev->stats.tx_errors++;
> +
> + netif_wake_queue(dev);
If the queue is full xmit will just put it back to sleep.
You want to try to reap completions if anything, no?
> +static struct net_device_stats *bcmasp_get_stats(struct net_device *dev)
> +{
> + return &dev->stats;
> +}
you don't have to do this, core will use device stats if there's no ndo
> + ndev = alloc_etherdev(sizeof(struct bcmasp_intf));
> + if (!dev) {
*blink* condition is typo'ed
> + dev_warn(dev, "%s: unable to alloc ndev\n", ndev_dn->name);
> + goto err;
> + }
--
pw-bot: cr
Powered by blists - more mailing lists