All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"nbd@nbd.name" <nbd@nbd.name>,
	"lorenzo.bianconi83@gmail.com" <lorenzo.bianconi83@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"conor@kernel.org" <conor@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"krzysztof.kozlowski+dt@linaro.org"
	<krzysztof.kozlowski+dt@linaro.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"will@kernel.org" <will@kernel.org>,
	"upstream@airoha.com" <upstream@airoha.com>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>,
	"benjamin.larsson@genexis.eu" <benjamin.larsson@genexis.eu>
Subject: Re: [EXTERNAL] [PATCH net-next 3/3] net: airoha: Introduce ethernet support for EN7581 SoC
Date: Mon, 3 Jun 2024 09:53:31 +0200	[thread overview]
Message-ID: <Zl12e1LjSqf-M7cb@lore-desk> (raw)
In-Reply-To: <BY3PR18MB4737F74D6674C04CAFDCD9C9C6FF2@BY3PR18MB4737.namprd18.prod.outlook.com>


[-- Attachment #1.1: Type: text/plain, Size: 3787 bytes --]

> 
> 
> >-----Original Message-----
> >From: Lorenzo Bianconi <lorenzo@kernel.org>
> >Sent: Friday, May 31, 2024 3:52 PM
> >To: netdev@vger.kernel.org
> >Cc: nbd@nbd.name; lorenzo.bianconi83@gmail.com; davem@davemloft.net;
> >edumazet@google.com; kuba@kernel.org; pabeni@redhat.com;
> >conor@kernel.org; linux-arm-kernel@lists.infradead.org; robh+dt@kernel.org;
> >krzysztof.kozlowski+dt@linaro.org; conor+dt@kernel.org;
> >devicetree@vger.kernel.org; catalin.marinas@arm.com; will@kernel.org;
> >upstream@airoha.com; angelogioacchino.delregno@collabora.com;
> >benjamin.larsson@genexis.eu
> >Subject: [EXTERNAL] [PATCH net-next 3/3] net: airoha: Introduce ethernet
> >support for EN7581 SoC
> >
> >Prioritize security for external emails: Confirm sender and content safety before
> >clicking links or opening attachments
> >
> >----------------------------------------------------------------------
> >Add airoha_eth driver in order to introduce ethernet support for
> >Airoha EN7581 SoC available on EN7581 development board (en7581-evb).
> >en7581-evb networking architecture is composed by airoha_eth as mac
> >controller (cpu port) and a mt7530 dsa based switch.
> >EN7581 mac controller is mainly composed by Frame Engine (FE) and
> >QoS-DMA (QDMA) modules. FE is used for traffic offloading (just basic
> >functionalities are supported now) while QDMA is used for DMA operation
> >and QOS functionalities between mac layer and the dsa switch (hw QoS is
> >not available yet and it will be added in the future).
> >Currently only hw lan features are available, hw wan will be added with
> >subsequent patches.
> >
> >Tested-by: Benjamin Larsson <benjamin.larsson@genexis.eu>
> >Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> >---
> ......
> >+
> >+static int airoha_qdma_rx_process(struct airoha_queue *q, int budget)
> >+{
> >+	struct airoha_eth *eth = q->eth;
> >+	struct device *dev = eth->net_dev->dev.parent;
> >+	int done = 0, qid = q - &eth->q_rx[0];
> >+
> >+	spin_lock_bh(&q->lock);
> 
> There is one napi per queue, why lock ?

we can get rid of it for rx queues (I will do in v2) but not for xmit ones
since airoha_qdma_tx_napi_poll() can run in parallel with airoha_dev_xmit()

> 
> ...........................
> >+
> >+	q = &eth->q_tx[qid];
> >+	spin_lock_bh(&q->lock);
> 
> Same here, is this lock needed ?
> If yes, can you please elaborate why.

ndo_start_xmit callback can run in parallel with airoha_qdma_tx_napi_poll()

> 
> >+
> >+	if (q->queued + nr_frags > q->ndesc) {
> >+		/* not enough space in the queue */
> >+		spin_unlock_bh(&q->lock);
> >+		return NETDEV_TX_BUSY;
> >+	}
> >+
> 
> I do not see netif_set_tso_max_segs() being set, so HW doesn't have any limit wrt
> number of TSO segs and number of fragments in skb, is it ??

I do not think there is any specific limitation for it

> 
> ...........
> >+static int airoha_probe(struct platform_device *pdev)
> >+{
> >+	struct device_node *np = pdev->dev.of_node;
> >+	struct net_device *dev;
> >+	struct airoha_eth *eth;
> >+	int err;
> >+
> >+	dev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(*eth),
> >+				      AIROHA_NUM_TX_RING,
> >AIROHA_NUM_RX_RING);
> 
> Always 32 queues, even if kernel is booted with less number cores ?

ethtool is not supported yet, I will add it with followup patches

> 
> 
> Overall this is a big patch deserving to be split, probably separate patches for init and datapath logic.

I guess specific parts (initialization, tx or rx code) are not big enough to deserve a dedicated patches.

> Also I do not see basic functionality like BQL not being supported, is that intentional ?

ack, I will add it in v2.

Regards,
Lorenzo

> 
> Thanks,
> Sunil.
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"nbd@nbd.name" <nbd@nbd.name>,
	"lorenzo.bianconi83@gmail.com" <lorenzo.bianconi83@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"conor@kernel.org" <conor@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"krzysztof.kozlowski+dt@linaro.org"
	<krzysztof.kozlowski+dt@linaro.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"will@kernel.org" <will@kernel.org>,
	"upstream@airoha.com" <upstream@airoha.com>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>,
	"benjamin.larsson@genexis.eu" <benjamin.larsson@genexis.eu>
Subject: Re: [EXTERNAL] [PATCH net-next 3/3] net: airoha: Introduce ethernet support for EN7581 SoC
Date: Mon, 3 Jun 2024 09:53:31 +0200	[thread overview]
Message-ID: <Zl12e1LjSqf-M7cb@lore-desk> (raw)
In-Reply-To: <BY3PR18MB4737F74D6674C04CAFDCD9C9C6FF2@BY3PR18MB4737.namprd18.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 3787 bytes --]

> 
> 
> >-----Original Message-----
> >From: Lorenzo Bianconi <lorenzo@kernel.org>
> >Sent: Friday, May 31, 2024 3:52 PM
> >To: netdev@vger.kernel.org
> >Cc: nbd@nbd.name; lorenzo.bianconi83@gmail.com; davem@davemloft.net;
> >edumazet@google.com; kuba@kernel.org; pabeni@redhat.com;
> >conor@kernel.org; linux-arm-kernel@lists.infradead.org; robh+dt@kernel.org;
> >krzysztof.kozlowski+dt@linaro.org; conor+dt@kernel.org;
> >devicetree@vger.kernel.org; catalin.marinas@arm.com; will@kernel.org;
> >upstream@airoha.com; angelogioacchino.delregno@collabora.com;
> >benjamin.larsson@genexis.eu
> >Subject: [EXTERNAL] [PATCH net-next 3/3] net: airoha: Introduce ethernet
> >support for EN7581 SoC
> >
> >Prioritize security for external emails: Confirm sender and content safety before
> >clicking links or opening attachments
> >
> >----------------------------------------------------------------------
> >Add airoha_eth driver in order to introduce ethernet support for
> >Airoha EN7581 SoC available on EN7581 development board (en7581-evb).
> >en7581-evb networking architecture is composed by airoha_eth as mac
> >controller (cpu port) and a mt7530 dsa based switch.
> >EN7581 mac controller is mainly composed by Frame Engine (FE) and
> >QoS-DMA (QDMA) modules. FE is used for traffic offloading (just basic
> >functionalities are supported now) while QDMA is used for DMA operation
> >and QOS functionalities between mac layer and the dsa switch (hw QoS is
> >not available yet and it will be added in the future).
> >Currently only hw lan features are available, hw wan will be added with
> >subsequent patches.
> >
> >Tested-by: Benjamin Larsson <benjamin.larsson@genexis.eu>
> >Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> >---
> ......
> >+
> >+static int airoha_qdma_rx_process(struct airoha_queue *q, int budget)
> >+{
> >+	struct airoha_eth *eth = q->eth;
> >+	struct device *dev = eth->net_dev->dev.parent;
> >+	int done = 0, qid = q - &eth->q_rx[0];
> >+
> >+	spin_lock_bh(&q->lock);
> 
> There is one napi per queue, why lock ?

we can get rid of it for rx queues (I will do in v2) but not for xmit ones
since airoha_qdma_tx_napi_poll() can run in parallel with airoha_dev_xmit()

> 
> ...........................
> >+
> >+	q = &eth->q_tx[qid];
> >+	spin_lock_bh(&q->lock);
> 
> Same here, is this lock needed ?
> If yes, can you please elaborate why.

ndo_start_xmit callback can run in parallel with airoha_qdma_tx_napi_poll()

> 
> >+
> >+	if (q->queued + nr_frags > q->ndesc) {
> >+		/* not enough space in the queue */
> >+		spin_unlock_bh(&q->lock);
> >+		return NETDEV_TX_BUSY;
> >+	}
> >+
> 
> I do not see netif_set_tso_max_segs() being set, so HW doesn't have any limit wrt
> number of TSO segs and number of fragments in skb, is it ??

I do not think there is any specific limitation for it

> 
> ...........
> >+static int airoha_probe(struct platform_device *pdev)
> >+{
> >+	struct device_node *np = pdev->dev.of_node;
> >+	struct net_device *dev;
> >+	struct airoha_eth *eth;
> >+	int err;
> >+
> >+	dev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(*eth),
> >+				      AIROHA_NUM_TX_RING,
> >AIROHA_NUM_RX_RING);
> 
> Always 32 queues, even if kernel is booted with less number cores ?

ethtool is not supported yet, I will add it with followup patches

> 
> 
> Overall this is a big patch deserving to be split, probably separate patches for init and datapath logic.

I guess specific parts (initialization, tx or rx code) are not big enough to deserve a dedicated patches.

> Also I do not see basic functionality like BQL not being supported, is that intentional ?

ack, I will add it in v2.

Regards,
Lorenzo

> 
> Thanks,
> Sunil.
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-06-03  7:53 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 10:22 [PATCH net-next 0/3] Introduce EN7581 ethernet support Lorenzo Bianconi
2024-05-31 10:22 ` Lorenzo Bianconi
2024-05-31 10:22 ` [PATCH net-next 1/3] dt-bindings: net: airoha: Add EN7581 ethernet controller Lorenzo Bianconi
2024-05-31 10:22   ` Lorenzo Bianconi
2024-05-31 11:33   ` Rob Herring (Arm)
2024-05-31 11:33     ` Rob Herring (Arm)
2024-06-01  8:46     ` Lorenzo Bianconi
2024-06-01  8:46       ` Lorenzo Bianconi
2024-05-31 10:22 ` [PATCH net-next 2/3] arm64: dts: airoha: Add EN7581 ethernet node Lorenzo Bianconi
2024-05-31 10:22   ` Lorenzo Bianconi
2024-06-02 17:05   ` Andrew Lunn
2024-06-02 17:05     ` Andrew Lunn
2024-06-02 17:38     ` Lorenzo Bianconi
2024-06-02 17:38       ` Lorenzo Bianconi
2024-06-02 17:49       ` Andrew Lunn
2024-06-02 17:49         ` Andrew Lunn
2024-06-02 18:00         ` Lorenzo Bianconi
2024-06-02 18:00           ` Lorenzo Bianconi
2024-05-31 10:22 ` [PATCH net-next 3/3] net: airoha: Introduce ethernet support for EN7581 SoC Lorenzo Bianconi
2024-05-31 10:22   ` Lorenzo Bianconi
2024-05-31 11:59   ` [EXTERNAL] " Subbaraya Sundeep Bhatta
2024-05-31 11:59     ` Subbaraya Sundeep Bhatta
2024-06-01  9:04     ` Lorenzo Bianconi
2024-06-01  9:04       ` Lorenzo Bianconi
2024-06-02 17:56     ` Andrew Lunn
2024-06-02 17:56       ` Andrew Lunn
2024-06-02 17:38   ` Andrew Lunn
2024-06-02 17:38     ` Andrew Lunn
2024-06-02 21:15     ` Lorenzo Bianconi
2024-06-02 21:15       ` Lorenzo Bianconi
2024-06-02 17:40   ` Andrew Lunn
2024-06-02 17:40     ` Andrew Lunn
2024-06-02 18:10     ` Lorenzo Bianconi
2024-06-02 18:10       ` Lorenzo Bianconi
2024-06-03  5:19   ` [EXTERNAL] " Sunil Kovvuri Goutham
2024-06-03  5:19     ` Sunil Kovvuri Goutham
2024-06-03  7:53     ` Lorenzo Bianconi [this message]
2024-06-03  7:53       ` Lorenzo Bianconi
2024-06-03  9:04       ` Sunil Kovvuri Goutham
2024-06-03  9:04         ` Sunil Kovvuri Goutham
2024-06-03  6:27   ` Ratheesh Kannoth
2024-06-03  6:27     ` Ratheesh Kannoth
2024-06-03  9:37     ` Lorenzo Bianconi
2024-06-03  9:37       ` Lorenzo Bianconi

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=Zl12e1LjSqf-M7cb@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=benjamin.larsson@genexis.eu \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=sgoutham@marvell.com \
    --cc=upstream@airoha.com \
    --cc=will@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.