public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia•com>
To: Jakub Kicinski <kuba@kernel•org>
Cc: Petr Machata <petrm@nvidia•com>,
	"David S. Miller" <davem@davemloft•net>,
	Eric Dumazet <edumazet@google•com>,
	Paolo Abeni <pabeni@redhat•com>, <netdev@vger•kernel.org>,
	Ido Schimmel <idosch@nvidia•com>,
	David Ahern <dsahern@kernel•org>, <mlxsw@nvidia•com>
Subject: Re: [PATCH net-next 2/7] net: nexthop: Add NHA_OP_FLAGS
Date: Wed, 28 Feb 2024 16:58:24 +0100	[thread overview]
Message-ID: <87le74o9pu.fsf@nvidia.com> (raw)
In-Reply-To: <20240228071601.7117217c@kernel.org>


Jakub Kicinski <kuba@kernel•org> writes:

> On Wed, 28 Feb 2024 06:48:59 -0800 Jakub Kicinski wrote:
>> > But also I don't know what will be useful in the
>> > future. It would be silly to have to add another flags attribute as
>> > bitfield because this time we actually care about toggling single bits
>> > of an object.  
>> 
>> IDK how you can do RMW on operation flags, that only makes sense if
>> you're modifying something. Besides you're not using BITFIELD right,
>> you're ignoring the mask completely now.
>
> Let me rephrase this a bit since I've had my coffee now :)
> BITFILED is designed to do:
>
> 	object->flags = object->flags & ~bf->mask | bf->flags;
>
> since there's no object, there's nothing to & the mask with.
> Plus if we do have some object flags at some point, chances 
> are we'd want the uAPI flags to mirror the recorded object flags
> so that we don't have to translate bit positions, so new attr
> will be cleaner.
>
> That's just in the way of clarifying my thinking, your call..

Oh, I see, it wouldn't be useful as an attribute in isolation, and if we
ever introduce flags field for the NH objects, we would want a separate
attribute for it anyway. So whatever new uses the OP_FLAGS attribute
would be put to, we know we won't need the mask.

Um, so as I said, I mostly figured let's use bitfield because of the
validation. I really like how it's all part of the policy and there's no
explicit checking code. So I'd keep it as it is.

  reply	other threads:[~2024-02-28 16:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 18:17 [PATCH net-next 0/7] Support for nexthop group statistics Petr Machata
2024-02-27 18:17 ` [PATCH net-next 1/7] net: nexthop: Adjust netlink policy parsing for a new attribute Petr Machata
2024-02-27 18:17 ` [PATCH net-next 2/7] net: nexthop: Add NHA_OP_FLAGS Petr Machata
2024-02-28  3:34   ` Jakub Kicinski
2024-02-28 10:50     ` Petr Machata
2024-02-28 14:48       ` Jakub Kicinski
2024-02-28 15:16         ` Jakub Kicinski
2024-02-28 15:58           ` Petr Machata [this message]
2024-02-28 16:42             ` Jakub Kicinski
2024-02-29 14:03               ` Petr Machata
2024-02-27 18:17 ` [PATCH net-next 3/7] net: nexthop: Add nexthop group entry stats Petr Machata
2024-02-28 14:30   ` Simon Horman
2024-02-28 15:57     ` Petr Machata
2024-02-27 18:17 ` [PATCH net-next 4/7] net: nexthop: Expose nexthop group stats to user space Petr Machata
2024-02-28  3:35   ` Jakub Kicinski
2024-02-28 11:24     ` Petr Machata
2024-02-27 18:17 ` [PATCH net-next 5/7] net: nexthop: Add hardware statistics notifications Petr Machata
2024-02-27 18:17 ` [PATCH net-next 6/7] net: nexthop: Add ability to enable / disable hardware statistics Petr Machata
2024-02-27 18:17 ` [PATCH net-next 7/7] net: nexthop: Expose nexthop group HW stats to user space Petr Machata
2024-02-28  3:39   ` Jakub Kicinski
2024-02-28 17:16     ` Petr Machata
2024-02-28  3:56   ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87le74o9pu.fsf@nvidia.com \
    --to=petrm@nvidia$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=dsahern@kernel$(echo .)org \
    --cc=edumazet@google$(echo .)com \
    --cc=idosch@nvidia$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=mlxsw@nvidia$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox