Re: [PATCH] pktgen: create packet use IPv6 source address between src6_min and src6_max.

From: Stephen Hemminger
Date: Fri Jan 10 2020 - 10:51:39 EST


On Fri, 10 Jan 2020 18:28:42 +0800
Niu Xilei <niu_xilei@xxxxxxx> wrote:

> +/* Kernel not implement __int128's divide and modulo operator. Implement these
> + * operation use shift-subtract division algorithm adpater from
> + * https://chromium.googlesource.com/chromium/src/third_party/+/master/abseil-cpp/absl/numeric/int128.cc */

Some rewording of this comment is necessary to fix the English grammar.
And Linux style is not to put comment closing on same line.

Something like:

/* The Linux kernel does not implement 128 bit divide and modulus operations.
* Implement these operations using shift-subtract division algorithm
* from Chrome.
* https://chromium.googlesource.com/chromium/src/third_party/+/master/abseil-cpp/absl/numeric/int128.cc
*/

Also, the int128 code you referenced is Apache licensed (not GPL-v2 like kernel).

For div128_u128 the function should be static to avoid name conflicts.

The declarations need to be in reverse christmas tree order as well.

It does seem a bit like overkill since doing source address over a 64 bit
range should be more than enough for any test in this decade.