[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221123153719.483800-1-alexandr.lobakin@intel.com>
Date: Wed, 23 Nov 2022 16:37:19 +0100
From: Alexander Lobakin <alexandr.lobakin@...el.com>
To: Nikolay Borisov <nikolay.borisov@...tuozzo.com>
Cc: Alexander Lobakin <alexandr.lobakin@...el.com>,
nhorman@...driver.com, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 2/3] drop_monitor: Add namespace filtering/reporting for hardware drops
From: Nikolay Borisov <nikolay.borisov@...tuozzo.com>
Date: Wed, 23 Nov 2022 16:28:16 +0200
> Add support for filtering and conveying the netnamespace where a
> particular drop event occured. This is counterpart to the software
> drop events support that was added earlier.
>
> Signed-off-by: Nikolay Borisov <nikolay.borisov@...tuozzo.com>
> ---
> include/uapi/linux/net_dropmon.h | 1 +
> net/core/drop_monitor.c | 28 ++++++++++++++++++++++++++--
> 2 files changed, 27 insertions(+), 2 deletions(-)
[...]
> @@ -452,6 +456,21 @@ static void net_dm_hw_summary_work(struct work_struct *work)
> kfree(hw_entries);
> }
>
> +static bool hw_entry_matches(struct net_dm_hw_entry *entry,
> + const char *trap_name, unsigned long ns_id)
> +{
> + if (net_dm_ns && entry->ns_id == net_dm_ns &&
> + !strncmp(entry->trap_name, trap_name,
> + NET_DM_MAX_HW_TRAP_NAME_LEN - 1))
> + return true;
> + else if (net_dm_ns == 0 && entry->ns_id == ns_id &&
> + !strncmp(entry->trap_name, trap_name,
> + NET_DM_MAX_HW_TRAP_NAME_LEN - 1))
> + return true;
> + else
> + return false;
Same as in my previous mail.
> +}
> +
> static void
> net_dm_hw_trap_summary_probe(void *ignore, const struct devlink *devlink,
> struct sk_buff *skb,
[...]
> --
> 2.34.1
Thanks,
Olek
Powered by blists - more mailing lists