On 11 Jul 2006, at 3:57pm, Dong-Hai Han wrote:
I am posting the materials Mike mentioned earlier, the webrev of
the changes is:
http://www.omnicron.com/~ford/webrev_bridging_dlpi.premacplugin/
I've taken a quick look at this and, as you know, have incorporated a
previous version of the code into the gate for the Matrix project[1].
The general approach seems workable, but I think that the details
have to be right. For example, i_dl_txloop() assumes that a MAC
driver will consume either all or none of the packets passed to it:
263 /*
264 * Transmit function, used when the link is doing local loopback
265 */
266 static mblk_t *
267 i_dls_txloop(dls_impl_t *dip, mblk_t *mp)
268 {
269 const mac_txinfo_t *mtp = dip->di_txinfo;
270 dls_link_t *dlp = dip->di_dvp->dv_dlp;
271 mblk_t *nextp;
272 mblk_t *bp;
273
274 while (mp != NULL) {
275 nextp = mp->b_next;
276 mp->b_next = NULL;
277
278 dlp->dl_local_loopback(dip->di_dvp->dv_dlp, mp,
dip);
279
280 if ((bp = mtp->mt_fn(mtp->mt_arg, mp)) != NULL) {
281 ASSERT(bp == mp);
282 goto noresources;
283 }
284
285 mp = nextp;
286 }
287
288 return (NULL);
289
290 noresources:
291 mp->b_next = nextp;
292 return (mp);
293 }
294
(Note lines 280/281.)
Quick inspection of the Broadcom driver shows that it's entirely
possible that the MAC driver's transmit routine will accept some but
not all of the packets passed down. i_dls_txloop() needs to allow
for this.
It's also the case that this newer version of the code will loopback
packets that are not accepted for transmission by the MAC driver (the
loopback happens before the packets are passed down). This differs
from the older code, where the loopback occurred only if the MAC
driver accepted the packets.
[1] http://www.opensolaris.org/os/community/xen.
dme.
_______________________________________________
networking-discuss mailing list
[email protected]