Wednesday October 03, 2007 | Artem's Weblog |
|
After 7 years of pretending to know something about I/O, I decided to see if I can pull the same trick with networking. The first project I chose to sabotage is Brussels. Project's mission can be described with a thousand words, but, the creative type that I am, I drew you a cool picture:
The first bit of code I've just contributed (here's the webrev) is mainly for the MAC services module. I added per-link property handles, which the network drivers can use like so:
err = mac_prop_init("driver", instance, &handle);
val = mac_prop_get_uint64(handle, "property");
mac_prop_fini(handle);
For each plumbed link, MAC keeps a list of properties that ever entered the kernel. Pointers to these lists are stored in a hash table, using link name as a key. I also added MDB support for these data structures. The > ::walk mac_proplist | ::walk mac_prop | ::print mac_prop_t Even more convenient is the new
> ::help mac_prop
NAME
mac_prop - display MAC properties of a link or all links
SYNOPSIS
::mac_prop [link]
ATTRIBUTES
Target: kvm
Module: mac
Interface Stability: Unstable
> ::mac_prop
ADDR LINK PROPERTY SIZE VALUE
fffffffec7d80480 bge0 default_mtu 8 1500
fffffffec7d80a80 bge0 adv_autoneg_cap 1 1
>
There wasn't an existing MDB module for MAC, so I created it too. Here's a good opportunity for other contributors to the MAC layer, hint hint, to add more MAC data structures to MDB.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||