Thanks for taking time reviewing it, my reply is inline.

----- Original Message -----
From: David Edmondson <[EMAIL PROTECTED]>
Date: Monday, July 17, 2006 9:53 pm
Subject: Re: [networking-discuss] Promiscuous DLPI packet loopback (was 
something else)
To: Dong-Hai Han <[EMAIL PROTECTED]>
Cc: networking-discuss@opensolaris.org

> 
> 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.
Meem has pointed out what's happening here, thanks Meem.

> 
> 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.
Yes, it's changed. Mike and I have dicussed it, our conclusion is that:
1. Even if MAC driver returns OK, it doesn't mean that the packet is safe on
    the line, or even being sent out.
2. For xen case, when domUs are communicating with each other, does
    it make sense to cut the virtual link when the packet can't go through the
    physical link?

So, we chose this approach.

> 
> [1] http://www.opensolaris.org/os/community/xen.
> 
> dme.
> 
> 

Best,

Donghai.
_______________________________________________
networking-discuss mailing list
networking-discuss@opensolaris.org

Reply via email to