Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Oct 2005 12:01:03 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Yar Tikhiy <yar@comp.chem.msu.su>
Cc:        freebsd-net@FreeBSD.org, ru@FreeBSD.org, Andrew Thompson <thompsa@FreeBSD.org>
Subject:   Re: vlan patch
Message-ID:  <20051021080103.GH59364@cell.sick.ru>
In-Reply-To: <20051021074606.GF69814@comp.chem.msu.su>
References:  <20051019102559.GA45909@heff.fud.org.nz> <20051020070054.GZ59364@cell.sick.ru> <20051020085721.GC27114@comp.chem.msu.su> <20051021053033.GW59364@cell.sick.ru> <20051021060654.GC69814@comp.chem.msu.su> <20051021064028.GZ59364@cell.sick.ru> <20051021074606.GF69814@comp.chem.msu.su>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 21, 2005 at 11:46:07AM +0400, Yar Tikhiy wrote:
Y> > Or are you going to implement per-vlan lock? Is this going to be a benefit?
Y> > Since all packets on trunk are serialized by NIC driver, can there be any
Y> > benefit in creating a mutex per vlan interface, not per vlan trunk?
Y> 
Y> I think you make a good point.  Indeed, today 2 threads won't process
Y> at once 2 vlan packets coming from the same parent interface.  The
Y> curious question is whether this state of matters will stay forever.
Y> The other approach would be to have separate threads for ip_input,
Y> ipfw, ip_output, and the rest of network stack functions, but it
Y> appears too inefficient in our case due to the overhead of context
Y> switches and locking.  So I agree that locking vlans per trunk is
Y> better today.
Y> 
Y> Do you think we should stick the vlan mutex into struct ifnet, too,
Y> along with the pointer to the vlan hash?  Perhaps, it's time to
Y> separate vlan-related fields into a separate struct?

Not sure yet. Now we have only if_nvlans in ifnet, right? If we
eliminate the global vlan list search, then we need to invent
some if_vlantrunk structure, where we are going to have at least:

  - nvlans
  - mutex
  - hash

The question is whether should we embed the structure into ifnet,
or allocate it on first vlan created and store only pointer in ifnet.

Embedding removes one pointer derefernce and that's good. However
embedding enlarges size of ifnet.

Dynamic allocation has one more benefit - we can leave vlan interfaces
when the parent is destroyed. However, I'm not sure this is a positive
feature.

-- 
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051021080103.GH59364>