I am investigating the following bug that I hit recently when creating
a bridge instance over a link aggregation:
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6951628
We are tripping over a new VERIFY statement introduced in build 136.
The code that we are tripping over is in mac_datapath_setup.c
3821 void
3822 mac_tx_srs_setup(mac_client_impl_t *mcip, flow_entry_t *flent)
3823 {
[..]
3834
3835 is_aggr = (mcip->mci_state_flags & MCIS_IS_AGGR) != 0;
[..]
3920 if (is_aggr) {
3921 VERIFY(i_mac_capab_get((mac_handle_t)mip,
3922 MAC_CAPAB_AGGR, &tx->st_capab_aggr));
3923 }
In i_mac_capab_get function in mac_client.c we have:
4018 /*
4019 * To get the capabilities that MAC layer cares about, such as rings,
factory
4020 * mac address, vnic or not, it should directly invoke this function. If
the
4021 * link is part of a bridge, then the only "capability" it has is the
inability
4022 * to do zero copy.
4023 */
4024 boolean_t
4025 i_mac_capab_get(mac_handle_t mh, mac_capab_t cap, void *cap_data)
4026 {
4027 mac_impl_t *mip = (mac_impl_t *)mh;
4028
4029 if (mip->mi_bridge_link != NULL)
4030 return (cap == MAC_CAPAB_NO_ZCOPY);
4031 else if (mip->mi_callbacks->mc_callbacks & MC_GETCAPAB)
4032 return (mip->mi_getcapab(mip->mi_driver, cap, cap_data));
4033 else
4034 return (B_FALSE);
4035 }
So for a link part of a bridge the only capability we advertise is
MAC_CAPAB_NO_ZCOPY.
This triggers the bug if prior to bridging a MAC client is opened on the link
part
of an aggregation. The MAC client state flags will claim the link is part of an
aggregation but once bridging is enabled on the link the MAC handle says it has
no AGGR capability.
Is there a problem with advertising all the capabilities supported by the
underlying
link with the exception of MAC_CAPAB_NO_ZCOPY? For example with the diff noted
below:
/*
* To get the capabilities that MAC layer cares about, such as rings, factory
* mac address, vnic or not, it should directly invoke this function. If the
- * link is part of a bridge, then the only "capability" it has is the inability
- * to do zero copy.
+ * link is part of a bridge, then the link is unable to do zero copy.
*/
boolean_t
i_mac_capab_get(mac_handle_t mh, mac_capab_t cap, void *cap_data)
{
mac_impl_t *mip = (mac_impl_t *)mh;
- if (mip->mi_bridge_link != NULL)
- return (cap == MAC_CAPAB_NO_ZCOPY);
+ if (mip->mi_bridge_link != NULL && cap == MAC_CAPAB_NO_ZCOPY)
+ return (B_FALSE);
else if (mip->mi_callbacks->mc_callbacks & MC_GETCAPAB)
return (mip->mi_getcapab(mip->mi_driver, cap, cap_data));
else
Rishi
_______________________________________________
rbridges-dev mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/rbridges-dev