Re: [PATCH bpf-next v2 09/13] selftests/bpf: move ip checksum helper to network helpers

From: Alexis Lothoré
Date: Tue Nov 19 2024 - 03:50:25 EST


Hello Stanislas,

On 11/15/24 16:32, Stanislav Fomichev wrote:
> On 11/14, Alexis Lothoré (eBPF Foundation) wrote:
>> +static unsigned long add_csum_hword(const __u16 *start, int num_u16)
>> +{
>> + unsigned long sum = 0;
>> + int i;
>> +
>> + for (i = 0; i < num_u16; i++)
>> + sum += start[i];
>> +
>> + return sum;
>> +}
>
> Sorry for nitpicking, but can we call it csum_partial? And match
> kernel's prototype with extra sum argument? Should be more greppable
> for the future test cases that might want to use it...

Sure. TBH I did not realize that those were based on the kernel ones. I'll
update this to keep the same prototype.


--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com