netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Jakub Kicinski <kuba@kernel.org>, Petr Machata <petrm@nvidia.com>,
	"David Ahern" <dsahern@kernel.org>, <netdev@vger.kernel.org>,
	Ido Schimmel <idosch@nvidia.com>, <mlxsw@nvidia.com>
Subject: Re: [PATCH iproute2-next 1/4] libnetlink: Add rta_getattr_uint()
Date: Mon, 11 Mar 2024 11:53:50 +0100	[thread overview]
Message-ID: <87jzm9kpc4.fsf@nvidia.com> (raw)
In-Reply-To: <20240309092158.5a8191dc@hermes.local>


Stephen Hemminger <stephen@networkplumber.org> writes:

> On Fri, 8 Mar 2024 19:43:34 -0800
> Jakub Kicinski <kuba@kernel.org> wrote:
>
>> On Fri, 8 Mar 2024 14:58:59 -0800 Stephen Hemminger wrote:
>> > > +static inline __u64 rta_getattr_uint(const struct rtattr *rta)
>> > > +{
>> > > +	if (RTA_PAYLOAD(rta) == sizeof(__u32))
>> > > +		return rta_getattr_u32(rta);
>> > > +	return rta_getattr_u64(rta);    
>> > 
>> > Don't understand the use case here.
>> > The kernel always sends the same payload size for the same attribute.  
>> 
>> Please see commit 374d345d9b5e13380c in the kernel.
>
> Ok, but maybe go further and handle u16 and u8

I intended this as a getter of the corresponding kernel attribute type,
which only ever sends 4- and 8-byte payloads, but sure, I can add that.

  parent reply	other threads:[~2024-03-11 10:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 22:29 [PATCH iproute2-next 0/4] Support for nexthop group statistics Petr Machata
2024-03-08 22:29 ` [PATCH iproute2-next 1/4] libnetlink: Add rta_getattr_uint() Petr Machata
2024-03-08 22:58   ` Stephen Hemminger
2024-03-09  3:43     ` Jakub Kicinski
2024-03-09 17:21       ` Stephen Hemminger
2024-03-09 18:37         ` Jakub Kicinski
2024-03-11 10:53         ` Petr Machata [this message]
2024-03-08 22:29 ` [PATCH iproute2-next 2/4] ip: ipnexthop: Support dumping next hop group stats Petr Machata
2024-03-08 22:57   ` Stephen Hemminger
2024-03-08 22:29 ` [PATCH iproute2-next 3/4] ip: ipnexthop: Support dumping next hop group HW stats Petr Machata
2024-03-08 22:29 ` [PATCH iproute2-next 4/4] ip: ipnexthop: Allow toggling collection of nexthop group HW statistics Petr Machata

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=87jzm9kpc4.fsf@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=dsahern@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).