[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201027075921.69976131@hermes.local>
Date: Tue, 27 Oct 2020 07:59:21 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Henrik Bjoernlund via Bridge <bridge@...ts.linux-foundation.org>
Cc: Henrik Bjoernlund <henrik.bjoernlund@...rochip.com>,
<davem@...emloft.net>, <kuba@...nel.org>, <roopa@...dia.com>,
<nikolay@...dia.com>, <jiri@...lanox.com>, <idosch@...lanox.com>,
<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<UNGLinuxDriver@...rochip.com>,
Horatiu Vultur <horatiu.vultur@...rochip.com>
Subject: Re: [Bridge] [PATCH net-next v7 01/10] net: bridge: extend the
process of special frames
On Tue, 27 Oct 2020 10:02:42 +0000
Henrik Bjoernlund via Bridge <bridge@...ts.linux-foundation.org> wrote:
> +/* Return 0 if the frame was not processed otherwise 1
> + * note: already called with rcu_read_lock
> + */
> +static int br_process_frame_type(struct net_bridge_port *p,
> + struct sk_buff *skb)
> +{
> + struct br_frame_type *tmp;
> +
> + hlist_for_each_entry_rcu(tmp, &p->br->frame_type_list, list)
> + if (unlikely(tmp->type == skb->protocol))
> + return tmp->frame_handler(p, skb);
> +
> + return 0;
> +}
Does the linear search of frame types have noticable impact on performance?
Hint: maybe a bitmap or something would be faster.
Powered by blists - more mailing lists