lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27777e66-ca76-4d70-85e9-29347a358b7e@kernel.org>
Date: Fri, 1 Mar 2024 08:36:58 -0700
From: David Ahern <dsahern@...nel.org>
To: Petr Machata <petrm@...dia.com>, "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Cc: Ido Schimmel <idosch@...dia.com>, Simon Horman <horms@...nel.org>,
 mlxsw@...dia.com
Subject: Re: [PATCH net-next v2 3/7] net: nexthop: Add nexthop group entry
 stats

On 2/29/24 11:16 AM, Petr Machata wrote:
> From: Ido Schimmel <idosch@...dia.com>
> 
> Add nexthop group entry stats to count the number of packets forwarded
> via each nexthop in the group. The stats will be exposed to user space
> for better data path observability in the next patch.
> 
> The per-CPU stats pointer is placed at the beginning of 'struct
> nh_grp_entry', so that all the fields accessed for the data path reside
> on the same cache line:
> 
> struct nh_grp_entry {
>         struct nexthop *           nh;                   /*     0     8 */
>         struct nh_grp_entry_stats * stats;               /*     8     8 */
>         u8                         weight;               /*    16     1 */
> 
>         /* XXX 7 bytes hole, try to pack */
> 
>         union {
>                 struct {
>                         atomic_t   upper_bound;          /*    24     4 */
>                 } hthr;                                  /*    24     4 */
>                 struct {
>                         struct list_head uw_nh_entry;    /*    24    16 */
>                         u16        count_buckets;        /*    40     2 */
>                         u16        wants_buckets;        /*    42     2 */
>                 } res;                                   /*    24    24 */
>         };                                               /*    24    24 */
>         struct list_head           nh_list;              /*    48    16 */
>         /* --- cacheline 1 boundary (64 bytes) --- */
>         struct nexthop *           nh_parent;            /*    64     8 */
> 
>         /* size: 72, cachelines: 2, members: 6 */
>         /* sum members: 65, holes: 1, sum holes: 7 */
>         /* last cacheline: 8 bytes */
> };
> 
> Signed-off-by: Ido Schimmel <idosch@...dia.com>
> Signed-off-by: Petr Machata <petrm@...dia.com>
> ---
> 
> Notes:
>     v2:
>     - Set err on nexthop_create_group() error path
> 
>  include/net/nexthop.h |  6 ++++++
>  net/ipv4/nexthop.c    | 25 +++++++++++++++++++++----
>  2 files changed, 27 insertions(+), 4 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@...nel.org>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ