在 2022/8/11 23:13, Jakub Kicinski 写道:
On Thu, 11 Aug 2022 15:07:57 +0200 Alexander Lobakin wrote:
Yes, Jakub also mentioned this.
But there are many existed features interfaces(e.g. ndo_fix_features, ndo_features_check), use netdev_features_t as return value. Then we have to change their prototype.
We have to do 12k lines of changes already :D You know, 16 bytes is probably fine to return directly and it will be enough for up to 128 features (+64 more comparing to the mainline). OTOH, using pointers removes that "what if/when", so it's more flexible in that term. So that's why I asked for other folks' opinions -- 2 PoVs doesn't seem enough here. From a quick grep it seems like the and() is mostly used in some form
of:
features = and(features, mask);
and we already have netdev_features_clear() which modifies its first argument. I'd also have and() update its first arg rather than return the result as a value.
ok, I will follow the behaviour of bitmap_and().
It will require changing the prototype of ndo_features_check() :( But yeah, I reckon we shouldn't be putting of refactoring, best if we make all the changes at once than have to revisit this once the flags grow again and return by value starts to be a problem. .
Thanks, Jian