[ovs-dev] [arp-rw 06/13] netdev-dummy: Add pcap feature.

Alex Wang alexw at nicira.com
Tue Oct 8 22:53:00 UTC 2013


Yes, it is protected.  I missed that.


On Tue, Oct 8, 2013 at 3:49 PM, Ben Pfaff <blp at nicira.com> wrote:

> I think that it is protected by the lock.  The line above the first
> context line takes the lock, no?
>
> On Tue, Oct 08, 2013 at 02:42:54PM -0700, Alex Wang wrote:
> > Looks good to me, just one point,
> >
> > I think the following code should be protected by the lock.
> >
> > @@ -503,6 +533,14 @@ netdev_dummy_send(struct netdev *netdev, const void
> > > *buffer, size_t size)
> > >      dev->stats.tx_packets++;
> > >      dev->stats.tx_bytes += size;
> > >
> > > +    if (dev->tx_pcap) {
> > > +        struct ofpbuf packet;
> > > +
> > > +        ofpbuf_use_const(&packet, buffer, size);
> > > +        pcap_write(dev->tx_pcap, &packet);
> > > +        fflush(dev->tx_pcap);
> > > +    }
> > > +
> > >      for (i = 0; i < dev->n_streams; i++) {
> > >          struct dummy_stream *s = &dev->streams[i]
> > >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20131008/79b5ccb4/attachment-0003.html>


More information about the dev mailing list