Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-ravb-soc-specific-configuration'

Lad Prabhakar says:

====================
net: ravb: SoC-specific configuration

This series addresses several issues in the Renesas Ethernet AVB (ravb)
driver related to SoC-specific resource configuration.

The series includes the following changes:

- Make DBAT entry count configurable per SoC
The number of descriptor base address table (DBAT) entries is not uniform
across all SoCs. Pass this information via the hardware info structure and
allocate resources accordingly.

- Allocate correct number of queues based on SoC support
Use the per-SoC configuration to determine whether a network control queue
is available, and allocate queues dynamically to match the SoC's
capability.

v2: https://lore.kernel.org/20251017151830.171062-1-prabhakar.mahadev-lad.rj@bp.renesas.com
====================

Link: https://patch.msgid.link/20251023112111.215198-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+12 -6
+1 -1
drivers/net/ethernet/renesas/ravb.h
··· 1017 1017 #define CSR2_CSUM_ENABLE (CSR2_RTCP4 | CSR2_RUDP4 | CSR2_RICMP4 | \ 1018 1018 CSR2_RTCP6 | CSR2_RUDP6 | CSR2_RICMP6) 1019 1019 1020 - #define DBAT_ENTRY_NUM 22 1021 1020 #define RX_QUEUE_OFFSET 4 1022 1021 #define NUM_RX_QUEUE 2 1023 1022 #define NUM_TX_QUEUE 2 ··· 1061 1062 u32 rx_max_frame_size; 1062 1063 u32 rx_buffer_size; 1063 1064 u32 rx_desc_size; 1065 + u32 dbat_entry_num; 1064 1066 unsigned aligned_tx: 1; 1065 1067 unsigned coalesce_irqs:1; /* Needs software IRQ coalescing */ 1066 1068
+11 -5
drivers/net/ethernet/renesas/ravb_main.c
··· 2714 2714 .rx_buffer_size = SZ_2K + 2715 2715 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)), 2716 2716 .rx_desc_size = sizeof(struct ravb_ex_rx_desc), 2717 + .dbat_entry_num = 22, 2717 2718 .aligned_tx = 1, 2718 2719 .gptp = 1, 2719 2720 .nc_queues = 1, ··· 2738 2737 .rx_buffer_size = SZ_2K + 2739 2738 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)), 2740 2739 .rx_desc_size = sizeof(struct ravb_ex_rx_desc), 2740 + .dbat_entry_num = 22, 2741 2741 .internal_delay = 1, 2742 2742 .tx_counters = 1, 2743 2743 .multi_irqs = 1, ··· 2765 2763 .rx_buffer_size = SZ_2K + 2766 2764 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)), 2767 2765 .rx_desc_size = sizeof(struct ravb_ex_rx_desc), 2766 + .dbat_entry_num = 22, 2768 2767 .internal_delay = 1, 2769 2768 .tx_counters = 1, 2770 2769 .multi_irqs = 1, ··· 2792 2789 .rx_buffer_size = SZ_2K + 2793 2790 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)), 2794 2791 .rx_desc_size = sizeof(struct ravb_ex_rx_desc), 2792 + .dbat_entry_num = 22, 2795 2793 .multi_irqs = 1, 2796 2794 .err_mgmt_irqs = 1, 2797 2795 .gptp = 1, ··· 2818 2814 .rx_max_frame_size = SZ_8K, 2819 2815 .rx_buffer_size = SZ_2K, 2820 2816 .rx_desc_size = sizeof(struct ravb_rx_desc), 2817 + .dbat_entry_num = 2, 2821 2818 .aligned_tx = 1, 2822 2819 .coalesce_irqs = 1, 2823 2820 .tx_counters = 1, ··· 2946 2941 return dev_err_probe(&pdev->dev, PTR_ERR(rstc), 2947 2942 "failed to get cpg reset\n"); 2948 2943 2944 + info = of_device_get_match_data(&pdev->dev); 2945 + 2949 2946 ndev = alloc_etherdev_mqs(sizeof(struct ravb_private), 2950 - NUM_TX_QUEUE, NUM_RX_QUEUE); 2947 + info->nc_queues ? NUM_TX_QUEUE : 1, 2948 + info->nc_queues ? NUM_RX_QUEUE : 1); 2951 2949 if (!ndev) 2952 2950 return -ENOMEM; 2953 - 2954 - info = of_device_get_match_data(&pdev->dev); 2955 2951 2956 2952 ndev->features = info->net_features; 2957 2953 ndev->hw_features = info->net_hw_features; ··· 3051 3045 ravb_parse_delay_mode(np, ndev); 3052 3046 3053 3047 /* Allocate descriptor base address table */ 3054 - priv->desc_bat_size = sizeof(struct ravb_desc) * DBAT_ENTRY_NUM; 3048 + priv->desc_bat_size = sizeof(struct ravb_desc) * info->dbat_entry_num; 3055 3049 priv->desc_bat = dma_alloc_coherent(ndev->dev.parent, priv->desc_bat_size, 3056 3050 &priv->desc_bat_dma, GFP_KERNEL); 3057 3051 if (!priv->desc_bat) { ··· 3061 3055 error = -ENOMEM; 3062 3056 goto out_rpm_put; 3063 3057 } 3064 - for (q = RAVB_BE; q < DBAT_ENTRY_NUM; q++) 3058 + for (q = RAVB_BE; q < info->dbat_entry_num; q++) 3065 3059 priv->desc_bat[q].die_dt = DT_EOS; 3066 3060 3067 3061 /* Initialise HW timestamp list */