mbox series

[v4,0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver

Message ID 20240223-am65-cpsw-xdp-basic-v4-0-38361a63a48b@baylibre.com (mailing list archive)
Headers show
Series Add minimal XDP support to TI AM65 CPSW Ethernet driver | expand

Message

Julien Panis March 12, 2024, 1:22 p.m. UTC
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 <jpanis@baylibre.com>
---
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/20240223-am65-cpsw-xdp-basic-v3-0-5d944a9d84a0@baylibre.com

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/20240223-am65-cpsw-xdp-basic-v2-0-01c6caacabb6@baylibre.com

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/20240223-am65-cpsw-xdp-basic-v1-1-9f0b6cbda310@baylibre.com

---
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    | 536 +++++++++++++++++++++++++---
 drivers/net/ethernet/ti/am65-cpsw-nuss.h    |  13 +
 drivers/net/ethernet/ti/k3-cppi-desc-pool.c |  36 ++
 drivers/net/ethernet/ti/k3-cppi-desc-pool.h |   4 +
 4 files changed, 539 insertions(+), 50 deletions(-)
---
base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
change-id: 20240223-am65-cpsw-xdp-basic-4db828508b48

Best regards,

Comments

Ratheesh Kannoth March 13, 2024, 1:44 p.m. UTC | #1
On 2024-03-12 at 18:52:39, Julien Panis (jpanis@baylibre.com) wrote:
> This patch adds XDP support to TI AM65 CPSW Ethernet driver.

is this a net-next item ?

>
> 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 <jpanis@baylibre.com>
> ---
> 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/20240223-am65-cpsw-xdp-basic-v3-0-5d944a9d84a0@baylibre.com
>
> 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/20240223-am65-cpsw-xdp-basic-v2-0-01c6caacabb6@baylibre.com
>
> 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/20240223-am65-cpsw-xdp-basic-v1-1-9f0b6cbda310@baylibre.com
>
> ---
> 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    | 536 +++++++++++++++++++++++++---
>  drivers/net/ethernet/ti/am65-cpsw-nuss.h    |  13 +
>  drivers/net/ethernet/ti/k3-cppi-desc-pool.c |  36 ++
>  drivers/net/ethernet/ti/k3-cppi-desc-pool.h |   4 +
>  4 files changed, 539 insertions(+), 50 deletions(-)
> ---
> base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
> change-id: 20240223-am65-cpsw-xdp-basic-4db828508b48
>
> Best regards,
> --
> Julien Panis <jpanis@baylibre.com>
>
Julien Panis March 13, 2024, 2:03 p.m. UTC | #2
On 3/13/24 14:44, Ratheesh Kannoth wrote:
> On 2024-03-12 at 18:52:39, Julien Panis (jpanis@baylibre.com) wrote:
>> This patch adds XDP support to TI AM65 CPSW Ethernet driver.
> is this a net-next item ?

Initially I worked on top of mainline kernel v6.8-rc1. Then, I also ensured that
the series could be applied on top of net-next/main.

>> 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 <jpanis@baylibre.com>
Ratheesh Kannoth March 13, 2024, 2:31 p.m. UTC | #3
> From: Julien Panis <jpanis@baylibre.com>
> Sent: Wednesday, March 13, 2024 7:34 PM
> On 3/13/24 14:44, Ratheesh Kannoth wrote:
> > On 2024-03-12 at 18:52:39, Julien Panis (jpanis@baylibre.com) wrote:
> >> This patch adds XDP support to TI AM65 CPSW Ethernet driver.
> > is this a net-next item ?
> 
> Initially I worked on top of mainline kernel v6.8-rc1. Then, I also ensured that
> the series could be applied on top of net-next/main.
> 
Please post to net-next ; once it is open

https://patchwork.hopto.org/net-next.html
Jesper Dangaard Brouer March 13, 2024, 3:10 p.m. UTC | #4
On 13/03/2024 15.31, Ratheesh Kannoth wrote:
>> From: Julien Panis <jpanis@baylibre.com>
>> Sent: Wednesday, March 13, 2024 7:34 PM
>> On 3/13/24 14:44, Ratheesh Kannoth wrote:
>>> On 2024-03-12 at 18:52:39, Julien Panis (jpanis@baylibre.com) wrote:
>>>> This patch adds XDP support to TI AM65 CPSW Ethernet driver.
>>> is this a net-next item ?
>>
>> Initially I worked on top of mainline kernel v6.8-rc1. Then, I also ensured that
>> the series could be applied on top of net-next/main.
>>
> Please post to net-next ; once it is open
>  > https://patchwork.hopto.org/net-next.html

Funny link, as I usually use:
  https://netdev.bots.linux.dev/net-next.html

As documented in:
  https://kernel.org/doc/html/latest/process/maintainer-netdev.html

--Jesper