2024-04-12 15:47:53

by Julien Panis

[permalink] [raw]
Subject: [PATCH net-next v9 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver

This patch adds XDP support to TI AM65 CPSW Ethernet driver.

The following features are implemented: NETDEV_XDP_ACT_BASIC,
NETDEV_XDP_ACT_REDIRECT, and NETDEV_XDP_ACT_NDO_XMIT.

Zero-copy and non-linear XDP buffer supports are NOT implemented.

Besides, the page pool memory model is used to get better performance.

Signed-off-by: Julien Panis <[email protected]>
---
Changes in v9:
- In k3_cppi_desc_pool_destroy(), free memory allocated for pool.
- In k3_cppi_desc_pool_create_name() function, remove unnecessary
error messages on mem alloc failures.
- In k3_cppi_desc_pool_create_name() function, move desc_infos alloc
forward to leverage pool_name freeing in gen_pool_destroy().
- In k3_cppi_desc_pool_create_name() function, remove unnecessary
'ret = -ENOMEM' since ret is already initialized with -ENOMEM value.
- For rx, do not build the skb upfront any more, Instead, give the page
to the HW then build the skb once HW sends a completion.
- Link to v8: https://lore.kernel.org/r/[email protected]

Changes in v8:
- Fix some warnings reported by patchwork.
- Link to v7: https://lore.kernel.org/r/[email protected]

Changes in v7:
- Move xdp_do_flush() function call in am65_cpsw_nuss_rx_poll().
- Link to v6: https://lore.kernel.org/r/[email protected]

Changes in v6:
- In k3_cppi_*() functions, use const qualifier when the content of
pool is not modified.
- Add allow_direct bool parameter to am65_cpsw_alloc_skb() function
for direct use by page_pool_put_full_page().
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- In k3_cppi_desc_pool_destroy(), free memory allocated for desc_infos.
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Add skb_mark_for_recycle() in am65_cpsw_nuss_rx_packets() function.
- Specify napi page pool parameter in am65_cpsw_create_xdp_rxqs() function.
- Add benchmark numbers (with VS without page pool) in the commit description.
- Add xdp_do_flush() in am65_cpsw_run_xdp() function for XDP_REDIRECT case.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Fix a potential issue with TX buffer type, which is now set for each buffer.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Use page pool memory model instead of MEM_TYPE_PAGE_ORDER0.
- In am65_cpsw_alloc_skb(), release reference on the page pool page
in case of error returned by build_skb().
- [nit] Cleanup am65_cpsw_nuss_common_open/stop() functions.
- [nit] Arrange local variables in reverse xmas tree order.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Julien Panis (3):
net: ethernet: ti: Add accessors for struct k3_cppi_desc_pool members
net: ethernet: ti: Add desc_infos member to struct k3_cppi_desc_pool
net: ethernet: ti: am65-cpsw: Add minimal XDP support

drivers/net/ethernet/ti/am65-cpsw-nuss.c | 659 ++++++++++++++++++++++++----
drivers/net/ethernet/ti/am65-cpsw-nuss.h | 13 +
drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 46 +-
drivers/net/ethernet/ti/k3-cppi-desc-pool.h | 6 +
4 files changed, 623 insertions(+), 101 deletions(-)
---
base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
change-id: 20240223-am65-cpsw-xdp-basic-4db828508b48

Best regards,
--
Julien Panis <[email protected]>



2024-04-12 15:55:09

by Julien Panis

[permalink] [raw]
Subject: [PATCH net-next v9 2/3] net: ethernet: ti: Add desc_infos member to struct k3_cppi_desc_pool

This patch introduces a member and the related accessors which can be
used to store descriptor specific additional information. This member
can store, for instance, an ID to differentiate a skb TX buffer type
from a xdpf TX buffer type.

Signed-off-by: Julien Panis <[email protected]>
---
drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 34 ++++++++++++++++++++++++-----
drivers/net/ethernet/ti/k3-cppi-desc-pool.h | 4 ++++
2 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c
index 414bcac9dcc6..739bae8e11ee 100644
--- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c
+++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c
@@ -22,6 +22,7 @@ struct k3_cppi_desc_pool {
size_t mem_size;
size_t num_desc;
struct gen_pool *gen_pool;
+ void **desc_infos;
};

void k3_cppi_desc_pool_destroy(struct k3_cppi_desc_pool *pool)
@@ -37,7 +38,11 @@ void k3_cppi_desc_pool_destroy(struct k3_cppi_desc_pool *pool)
dma_free_coherent(pool->dev, pool->mem_size, pool->cpumem,
pool->dma_addr);

+ kfree(pool->desc_infos);
+
gen_pool_destroy(pool->gen_pool); /* frees pool->name */
+
+ kfree(pool);
}
EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_destroy);

@@ -50,7 +55,7 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size,
const char *pool_name = NULL;
int ret = -ENOMEM;

- pool = devm_kzalloc(dev, sizeof(*pool), GFP_KERNEL);
+ pool = kzalloc(sizeof(*pool), GFP_KERNEL);
if (!pool)
return ERR_PTR(ret);

@@ -62,18 +67,21 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size,
pool_name = kstrdup_const(name ? name : dev_name(pool->dev),
GFP_KERNEL);
if (!pool_name)
- return ERR_PTR(-ENOMEM);
+ goto gen_pool_create_fail;

pool->gen_pool = gen_pool_create(ilog2(pool->desc_size), -1);
if (!pool->gen_pool) {
- ret = -ENOMEM;
- dev_err(pool->dev, "pool create failed %d\n", ret);
kfree_const(pool_name);
goto gen_pool_create_fail;
}

pool->gen_pool->name = pool_name;

+ pool->desc_infos = kcalloc(pool->num_desc,
+ sizeof(*pool->desc_infos), GFP_KERNEL);
+ if (!pool->desc_infos)
+ goto gen_pool_desc_infos_alloc_fail;
+
pool->cpumem = dma_alloc_coherent(pool->dev, pool->mem_size,
&pool->dma_addr, GFP_KERNEL);

@@ -94,9 +102,11 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size,
dma_free_coherent(pool->dev, pool->mem_size, pool->cpumem,
pool->dma_addr);
dma_alloc_fail:
+ kfree(pool->desc_infos);
+gen_pool_desc_infos_alloc_fail:
gen_pool_destroy(pool->gen_pool); /* frees pool->name */
gen_pool_create_fail:
- devm_kfree(pool->dev, pool);
+ kfree(pool);
return ERR_PTR(ret);
}
EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_create_name);
@@ -144,5 +154,19 @@ void *k3_cppi_desc_pool_cpuaddr(const struct k3_cppi_desc_pool *pool)
}
EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_cpuaddr);

+void k3_cppi_desc_pool_desc_info_set(struct k3_cppi_desc_pool *pool,
+ int desc_idx, void *info)
+{
+ pool->desc_infos[desc_idx] = info;
+}
+EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_desc_info_set);
+
+void *k3_cppi_desc_pool_desc_info(const struct k3_cppi_desc_pool *pool,
+ int desc_idx)
+{
+ return pool->desc_infos[desc_idx];
+}
+EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_desc_info);
+
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("TI K3 CPPI5 descriptors pool API");
diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.h b/drivers/net/ethernet/ti/k3-cppi-desc-pool.h
index 3c6aed0bed71..851d352b338b 100644
--- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.h
+++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.h
@@ -28,5 +28,9 @@ void k3_cppi_desc_pool_free(struct k3_cppi_desc_pool *pool, void *addr);
size_t k3_cppi_desc_pool_avail(struct k3_cppi_desc_pool *pool);
size_t k3_cppi_desc_pool_desc_size(const struct k3_cppi_desc_pool *pool);
void *k3_cppi_desc_pool_cpuaddr(const struct k3_cppi_desc_pool *pool);
+void k3_cppi_desc_pool_desc_info_set(struct k3_cppi_desc_pool *pool,
+ int desc_idx, void *info);
+void *k3_cppi_desc_pool_desc_info(const struct k3_cppi_desc_pool *pool,
+ int desc_idx);

#endif /* K3_CPPI_DESC_POOL_H_ */

--
2.37.3


2024-04-12 23:42:54

by Keller, Jacob E

[permalink] [raw]
Subject: Re: [PATCH net-next v9 2/3] net: ethernet: ti: Add desc_infos member to struct k3_cppi_desc_pool



On 4/12/2024 8:38 AM, Julien Panis wrote:
> This patch introduces a member and the related accessors which can be
> used to store descriptor specific additional information. This member
> can store, for instance, an ID to differentiate a skb TX buffer type
> from a xdpf TX buffer type.
>
> Signed-off-by: Julien Panis <[email protected]>
> ---
> drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 34 ++++++++++++++++++++++++-----
> drivers/net/ethernet/ti/k3-cppi-desc-pool.h | 4 ++++
> 2 files changed, 33 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c
> index 414bcac9dcc6..739bae8e11ee 100644
> --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c
> +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c
> @@ -22,6 +22,7 @@ struct k3_cppi_desc_pool {
> size_t mem_size;
> size_t num_desc;
> struct gen_pool *gen_pool;
> + void **desc_infos;
> };
>
> void k3_cppi_desc_pool_destroy(struct k3_cppi_desc_pool *pool)
> @@ -37,7 +38,11 @@ void k3_cppi_desc_pool_destroy(struct k3_cppi_desc_pool *pool)
> dma_free_coherent(pool->dev, pool->mem_size, pool->cpumem,
> pool->dma_addr);
>
> + kfree(pool->desc_infos);
> +
> gen_pool_destroy(pool->gen_pool); /* frees pool->name */
> +
> + kfree(pool);
> }
> EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_destroy);
>
> @@ -50,7 +55,7 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size,
> const char *pool_name = NULL;
> int ret = -ENOMEM;
>
> - pool = devm_kzalloc(dev, sizeof(*pool), GFP_KERNEL);
> + pool = kzalloc(sizeof(*pool), GFP_KERNEL);

You could refactor pool to use the new __free cleanup annotations along
with return_no_free() to automatically handle cleanup of the pool when
the function exits on an error state. It's pretty recent, and i don't
think its strictly necessary to do here just thought I'd point it out.

Reviewed-by: Jacob Keller <[email protected]>

> if (!pool)
> return ERR_PTR(ret);
>
> @@ -62,18 +67,21 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size,
> pool_name = kstrdup_const(name ? name : dev_name(pool->dev),
> GFP_KERNEL);
> if (!pool_name)
> - return ERR_PTR(-ENOMEM);
> + goto gen_pool_create_fail;
>
> pool->gen_pool = gen_pool_create(ilog2(pool->desc_size), -1);
> if (!pool->gen_pool) {
> - ret = -ENOMEM;
> - dev_err(pool->dev, "pool create failed %d\n", ret);
> kfree_const(pool_name);
> goto gen_pool_create_fail;
> }
>
> pool->gen_pool->name = pool_name;
>
> + pool->desc_infos = kcalloc(pool->num_desc,
> + sizeof(*pool->desc_infos), GFP_KERNEL);
> + if (!pool->desc_infos)
> + goto gen_pool_desc_infos_alloc_fail;
> +
> pool->cpumem = dma_alloc_coherent(pool->dev, pool->mem_size,
> &pool->dma_addr, GFP_KERNEL);
>
> @@ -94,9 +102,11 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size,
> dma_free_coherent(pool->dev, pool->mem_size, pool->cpumem,
> pool->dma_addr);
> dma_alloc_fail:
> + kfree(pool->desc_infos);
> +gen_pool_desc_infos_alloc_fail:
> gen_pool_destroy(pool->gen_pool); /* frees pool->name */
> gen_pool_create_fail:
> - devm_kfree(pool->dev, pool);
> + kfree(pool);
> return ERR_PTR(ret);
> }
> EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_create_name);
> @@ -144,5 +154,19 @@ void *k3_cppi_desc_pool_cpuaddr(const struct k3_cppi_desc_pool *pool)
> }
> EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_cpuaddr);
>
> +void k3_cppi_desc_pool_desc_info_set(struct k3_cppi_desc_pool *pool,
> + int desc_idx, void *info)
> +{
> + pool->desc_infos[desc_idx] = info;
> +}
> +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_desc_info_set);
> +
> +void *k3_cppi_desc_pool_desc_info(const struct k3_cppi_desc_pool *pool,
> + int desc_idx)
> +{
> + return pool->desc_infos[desc_idx];
> +}
> +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_desc_info);
> +
> MODULE_LICENSE("GPL");
> MODULE_DESCRIPTION("TI K3 CPPI5 descriptors pool API");
> diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.h b/drivers/net/ethernet/ti/k3-cppi-desc-pool.h
> index 3c6aed0bed71..851d352b338b 100644
> --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.h
> +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.h
> @@ -28,5 +28,9 @@ void k3_cppi_desc_pool_free(struct k3_cppi_desc_pool *pool, void *addr);
> size_t k3_cppi_desc_pool_avail(struct k3_cppi_desc_pool *pool);
> size_t k3_cppi_desc_pool_desc_size(const struct k3_cppi_desc_pool *pool);
> void *k3_cppi_desc_pool_cpuaddr(const struct k3_cppi_desc_pool *pool);
> +void k3_cppi_desc_pool_desc_info_set(struct k3_cppi_desc_pool *pool,
> + int desc_idx, void *info);
> +void *k3_cppi_desc_pool_desc_info(const struct k3_cppi_desc_pool *pool,
> + int desc_idx);
>
> #endif /* K3_CPPI_DESC_POOL_H_ */
>

2024-04-15 12:20:41

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net-next v9 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver

Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <[email protected]>:

On Fri, 12 Apr 2024 17:38:31 +0200 you wrote:
> This patch adds XDP support to TI AM65 CPSW Ethernet driver.
>
> The following features are implemented: NETDEV_XDP_ACT_BASIC,
> NETDEV_XDP_ACT_REDIRECT, and NETDEV_XDP_ACT_NDO_XMIT.
>
> Zero-copy and non-linear XDP buffer supports are NOT implemented.
>
> [...]

Here is the summary with links:
- [net-next,v9,1/3] net: ethernet: ti: Add accessors for struct k3_cppi_desc_pool members
https://git.kernel.org/netdev/net-next/c/cd8ff81f747f
- [net-next,v9,2/3] net: ethernet: ti: Add desc_infos member to struct k3_cppi_desc_pool
https://git.kernel.org/netdev/net-next/c/84d767a3c0b5
- [net-next,v9,3/3] net: ethernet: ti: am65-cpsw: Add minimal XDP support
https://git.kernel.org/netdev/net-next/c/8acacc40f733

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



2024-04-18 11:01:33

by Siddharth Vadapalli

[permalink] [raw]
Subject: Re: [PATCH net-next v9 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver

On 12-04-2024 21:08, Julien Panis wrote:
> This patch adds XDP support to TI AM65 CPSW Ethernet driver.
>
> The following features are implemented: NETDEV_XDP_ACT_BASIC,
> NETDEV_XDP_ACT_REDIRECT, and NETDEV_XDP_ACT_NDO_XMIT.
>
> Zero-copy and non-linear XDP buffer supports are NOT implemented.
>
> Besides, the page pool memory model is used to get better performance.
>
> Signed-off-by: Julien Panis <[email protected]>

Hello Julien,

This series crashes Linux on AM62ax SoC which also uses the
AM65-CPSW-NUSS driver:
https://gist.github.com/Siddharth-Vadapalli-at-TI/5ed0e436606001c247a7da664f75edee

Regards,
Siddharth.

2024-04-18 11:18:05

by Julien Panis

[permalink] [raw]
Subject: Re: [PATCH net-next v9 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver

On 4/18/24 13:00, Siddharth Vadapalli wrote:
> On 12-04-2024 21:08, Julien Panis wrote:
>> This patch adds XDP support to TI AM65 CPSW Ethernet driver.
>>
>> The following features are implemented: NETDEV_XDP_ACT_BASIC,
>> NETDEV_XDP_ACT_REDIRECT, and NETDEV_XDP_ACT_NDO_XMIT.
>>
>> Zero-copy and non-linear XDP buffer supports are NOT implemented.
>>
>> Besides, the page pool memory model is used to get better performance.
>>
>> Signed-off-by: Julien Panis <[email protected]>
> Hello Julien,
>
> This series crashes Linux on AM62ax SoC which also uses the
> AM65-CPSW-NUSS driver:
> https://gist.github.com/Siddharth-Vadapalli-at-TI/5ed0e436606001c247a7da664f75edee
>
> Regards,
> Siddharth.

Hello Siddharth.

Thanks for the log. I can read:
[    1.966094] Missing net_device from driver

Did you check that nodes exist in the device tree for the net devices ?

Julien


2024-04-18 11:26:26

by Siddharth Vadapalli

[permalink] [raw]
Subject: Re: [PATCH net-next v9 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver

On Thu, Apr 18, 2024 at 01:17:47PM +0200, Julien Panis wrote:
> On 4/18/24 13:00, Siddharth Vadapalli wrote:
> > On 12-04-2024 21:08, Julien Panis wrote:
> > > This patch adds XDP support to TI AM65 CPSW Ethernet driver.
> > >
> > > The following features are implemented: NETDEV_XDP_ACT_BASIC,
> > > NETDEV_XDP_ACT_REDIRECT, and NETDEV_XDP_ACT_NDO_XMIT.
> > >
> > > Zero-copy and non-linear XDP buffer supports are NOT implemented.
> > >
> > > Besides, the page pool memory model is used to get better performance.
> > >
> > > Signed-off-by: Julien Panis <[email protected]>
> > Hello Julien,
> >
> > This series crashes Linux on AM62ax SoC which also uses the
> > AM65-CPSW-NUSS driver:
> > https://gist.github.com/Siddharth-Vadapalli-at-TI/5ed0e436606001c247a7da664f75edee
> >
> > Regards,
> > Siddharth.
>
> Hello Siddharth.
>
> Thanks for the log. I can read:
> [    1.966094] Missing net_device from driver
>
> Did you check that nodes exist in the device tree for the net devices ?

Yes it exists. The device-tree used was also built with linux-next
tagged next-20240417. The node corresponding to eth0 is cpsw_port1 which
is present and enabled in the device-tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts?h=next-20240417#n644

Regards,
Siddharth.

2024-04-18 14:12:44

by Julien Panis

[permalink] [raw]
Subject: Re: [PATCH net-next v9 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver

On 4/18/24 13:25, Siddharth Vadapalli wrote:
> On Thu, Apr 18, 2024 at 01:17:47PM +0200, Julien Panis wrote:
>> On 4/18/24 13:00, Siddharth Vadapalli wrote:
>>> On 12-04-2024 21:08, Julien Panis wrote:
>>>> This patch adds XDP support to TI AM65 CPSW Ethernet driver.
>>>>
>>>> The following features are implemented: NETDEV_XDP_ACT_BASIC,
>>>> NETDEV_XDP_ACT_REDIRECT, and NETDEV_XDP_ACT_NDO_XMIT.
>>>>
>>>> Zero-copy and non-linear XDP buffer supports are NOT implemented.
>>>>
>>>> Besides, the page pool memory model is used to get better performance.
>>>>
>>>> Signed-off-by: Julien Panis <[email protected]>
>>> Hello Julien,
>>>
>>> This series crashes Linux on AM62ax SoC which also uses the
>>> AM65-CPSW-NUSS driver:
>>> https://gist.github.com/Siddharth-Vadapalli-at-TI/5ed0e436606001c247a7da664f75edee
>>>
>>> Regards,
>>> Siddharth.
>> Hello Siddharth.
>>
>> Thanks for the log. I can read:
>> [    1.966094] Missing net_device from driver
>>
>> Did you check that nodes exist in the device tree for the net devices ?
> Yes it exists. The device-tree used was also built with linux-next
> tagged next-20240417. The node corresponding to eth0 is cpsw_port1 which
> is present and enabled in the device-tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts?h=next-20240417#n644
>
> Regards,
> Siddharth.

I could reproduce the bug by disabling 'cpsw_port2' in my device tree,
which is 'k3-am625-sk.dts' for the board I use.

A condition is missing in am65_cpsw_create_xdp_rxqs() and
am65_cpsw_destroy_xdp_rxqs() functions.

For these 2 functions, the code which is in the for loop should be
run only when port ethX is enabled. That's why it crashes with
your device tree (cpsw_port2 is disabled, which is not the case by
default for the board I developed with).

I'll send a patch to fix the issue. Thanks for reporting it.

Julien

2024-04-18 14:29:15

by Siddharth Vadapalli

[permalink] [raw]
Subject: Re: [PATCH net-next v9 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver

On Thu, Apr 18, 2024 at 04:03:15PM +0200, Julien Panis wrote:
> On 4/18/24 13:25, Siddharth Vadapalli wrote:
> > On Thu, Apr 18, 2024 at 01:17:47PM +0200, Julien Panis wrote:
> > > On 4/18/24 13:00, Siddharth Vadapalli wrote:
> > > > On 12-04-2024 21:08, Julien Panis wrote:
> > > > > This patch adds XDP support to TI AM65 CPSW Ethernet driver.
> > > > >
> > > > > The following features are implemented: NETDEV_XDP_ACT_BASIC,
> > > > > NETDEV_XDP_ACT_REDIRECT, and NETDEV_XDP_ACT_NDO_XMIT.
> > > > >
> > > > > Zero-copy and non-linear XDP buffer supports are NOT implemented.
> > > > >
> > > > > Besides, the page pool memory model is used to get better performance.
> > > > >
> > > > > Signed-off-by: Julien Panis <[email protected]>
> > > > Hello Julien,
> > > >
> > > > This series crashes Linux on AM62ax SoC which also uses the
> > > > AM65-CPSW-NUSS driver:
> > > > https://gist.github.com/Siddharth-Vadapalli-at-TI/5ed0e436606001c247a7da664f75edee
> > > >
> > > > Regards,
> > > > Siddharth.
> > > Hello Siddharth.
> > >
> > > Thanks for the log. I can read:
> > > [    1.966094] Missing net_device from driver
> > >
> > > Did you check that nodes exist in the device tree for the net devices ?
> > Yes it exists. The device-tree used was also built with linux-next
> > tagged next-20240417. The node corresponding to eth0 is cpsw_port1 which
> > is present and enabled in the device-tree:
> > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts?h=next-20240417#n644
> >
> > Regards,
> > Siddharth.
>
> I could reproduce the bug by disabling 'cpsw_port2' in my device tree,
> which is 'k3-am625-sk.dts' for the board I use.
>
> A condition is missing in am65_cpsw_create_xdp_rxqs() and
> am65_cpsw_destroy_xdp_rxqs() functions.
>
> For these 2 functions, the code which is in the for loop should be
> run only when port ethX is enabled. That's why it crashes with
> your device tree (cpsw_port2 is disabled, which is not the case by
> default for the board I developed with).
>
> I'll send a patch to fix the issue. Thanks for reporting it.

Thank you for root-causing and working on the fix for this issue.

Regards,
Siddharth.