[OpenIndiana-discuss] MAC_RING_TYPE_TX fill_group with infop set to NULL
Santosh R
skrastapur at gmail.com
Tue Feb 18 16:58:48 UTC 2014
Hi,
I am working on adding the dynamic polling support in our adapter
(oi_151a8).
Below is the code snippet. This works fine for Rx Rings.. For Tx rings, I
am getting an extra call to fill_group with infop set as NULL after
fill_ring is called for all the rings in that tx group.
It works fine, If I set mr_gnum to 0 for Tx Rings.
Is this expected or am I missing some additional code to add to this
framework.
I do see a call with infop set as NULL in mac.c.
3 mac.c mac_init_rings 3851 cap_rings->mr_gget(mip->mi_driver, rtype, g,
&group_info,
4 mac.c mac_init_rings 4027 cap_rings->mr_gget(mip->mi_driver, rtype, 0,
NULL,
My driver code snippet.
mc_getcapab(void *arg, mac_capab_t cap, void *data)
{
...
case MAC_CAPAB_RINGS: {
mac_capab_rings_t *cap_rings = data;
switch (cap_rings->mr_type) {
case MAC_RING_TYPE_RX:
cap_rings->mr_group_type = MAC_GROUP_TYPE_STATIC;
cap_rings->mr_rnum = nrxq;
cap_rings->mr_gnum = 1;
cap_rings->mr_rget = fill_ring;
cap_rings->mr_gget = fill_group;
break;
case MAC_RING_TYPE_TX:
cap_rings->mr_group_type = MAC_GROUP_TYPE_STATIC;
cap_rings->mr_rnum = ntxq;
cap_rings->mr_gnum = 1;
cap_rings->mr_gget = fill_group;
cap_rings->mr_rget = fill_ring;
break;
}
break;
}
...
}
fill_group(void *arg, mac_ring_type_t rtype, const int rg_index,
mac_group_info_t *infop, mac_group_handle_t gh)
{
switch (rtype) {
case MAC_RING_TYPE_RX: {
infop->mgi_driver = (mac_group_driver_t)arg;
infop->mgi_addmac = addmac;
infop->mgi_remmac = remmac;
infop->mgi_count = nrxq;
break;
}
case MAC_RING_TYPE_TX:
infop->mgi_driver = (mac_group_driver_t)arg;
infop->mgi_count = ntxq;
break;
}
}
fill_ring(void *arg, mac_ring_type_t rtype, const int group_index,
const int ring_index, mac_ring_info_t *infop, mac_ring_handle_t rh)
{
...
switch (rtype) {
case MAC_RING_TYPE_RX: {
rxq->ring_handle = rh;
infop->mri_driver = (mac_ring_driver_t)rxq;
infop->mri_start = ring_start;
infop->mri_poll = poll_ring;
infop->mri_stat = rx_stat;
mintr = &infop->mri_intr;
mintr->mi_handle = (mac_intr_handle_t)rxq;
mintr->mi_enable = ring_intr_enable;
mintr->mi_disable = ring_intr_disable;
break;
}
case MAC_RING_TYPE_TX: {
txq->ring_handle = rh;
infop->mri_driver = (mac_ring_driver_t)txq;
infop->mri_tx = eth_tx;
infop->mri_stat = tx_stat;
mintr = &infop->mri_intr;
mintr->mi_handle = (mac_intr_handle_t)txq;
break;
}
}
Regards
-Santosh
More information about the OpenIndiana-discuss
mailing list