Re: [PATCH v5 net-next 1/3] net/udp: Add a new struct for hash2 slot

From: Paolo Abeni
Date: Thu Oct 24 2024 - 10:38:29 EST




On 10/24/24 16:31, Paolo Abeni wrote:
> On 10/18/24 13:45, Philo Lu wrote:
>> @@ -3438,16 +3436,17 @@ void __init udp_table_init(struct udp_table *table, const char *name)
>> UDP_HTABLE_SIZE_MIN,
>> UDP_HTABLE_SIZE_MAX);
>>
>> - table->hash2 = table->hash + (table->mask + 1);
>> + table->hash2 = (void *)(table->hash + (table->mask + 1));
>> for (i = 0; i <= table->mask; i++) {
>> INIT_HLIST_HEAD(&table->hash[i].head);
>> table->hash[i].count = 0;
>> spin_lock_init(&table->hash[i].lock);
>> }
>> for (i = 0; i <= table->mask; i++) {
>> - INIT_HLIST_HEAD(&table->hash2[i].head);
>> - table->hash2[i].count = 0;
>> - spin_lock_init(&table->hash2[i].lock);
>> + INIT_HLIST_HEAD(&table->hash2[i].hslot.head);
>> + table->hash2[i].hslot.count = 0;
>> + spin_lock_init(&table->hash2[i].hslot.lock);
>> + table->hash2[i].hash4_cnt = 0;
>
> Does not build for CONFIG_BASE_SMALL=y kernels. You need to put all the
> hash4_cnt access under compiler guards.

I see now it's fixed in the next patch, but it's not good enough: we
want to preserve bisectability. You should introduce
udp_table_hash4_init() in this patch.

Thanks,

Paolo