From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?Tmljb2xhcyBkZSBQZXNsb8O8YW4=?= Subject: Re: [RFC patch net-next-2.6] net: allow multiple rx_handler registration Date: Thu, 30 Jun 2011 21:50:52 +0200 Message-ID: <4E0CD39C.8060209@gmail.com> References: <1309447009-8898-1-git-send-email-jpirko@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: netdev@vger.kernel.org, davem@davemloft.net, shemminger@linux-foundation.org, kaber@trash.net, fubar@us.ibm.com, eric.dumazet@gmail.com, andy@greyhouse.net, Ben Greear To: Jiri Pirko Return-path: Received: from mail-fx0-f52.google.com ([209.85.161.52]:58155 "EHLO mail-fx0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752926Ab1F3Tu5 (ORCPT ); Thu, 30 Jun 2011 15:50:57 -0400 Received: by fxd18 with SMTP id 18so2575271fxd.11 for ; Thu, 30 Jun 2011 12:50:55 -0700 (PDT) In-Reply-To: <1309447009-8898-1-git-send-email-jpirko@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: Le 30/06/2011 17:16, Jiri Pirko a =C3=A9crit : > For some net topos it is necessary to have multiple "soft-net-devices= " > hooked on one netdev. For example very common is to have > eth<->(br+vlan). Vlan is not using rh_handler (yet) but also for exam= ple > macvlan would be useful to have hooked on same netdev as br. > > This patch introduces rx_handler list. size struct net_device stays > intact. Measured performance regression on eth-br topo is ~1% (on rec= eived > pkts generated by pktgen) and on eth-bond topo it is ~0.25% > > On br I think that the performance can be brought back maybe by using= per-cpu > variables to store port in rx_path (I must check this) > > Please comment. > > Signed-off-by: Jiri Pirko I like the idea of this patch. I didn't take time for a technical review yet, but I'm not sure orderin= g should be static, depending=20 on the kind of device (bond, br, macvlan). Ordering is currently static= , because it is hard coded. I think rx_handler_prio should be exposed to userspace, to allow user s= etup to decide the exact=20 order. Default order should be safe, but user should be allowed to forc= e a different order for=20 special setups. Nicolas.