On Tue, May 20, 2014 at 12:25:50PM -0700, Jarno Rajahalme wrote:
> Acked-by: Jarno Rajahalme <jrajaha...@nicira.com>

Thanks.

> > @@ -733,7 +731,7 @@ do_add_port(struct dp_netdev *dp, const char *devname, 
> > const char *type,
> >     }
> >     ovs_refcount_init(&port->ref_cnt);
> > 
> > -    hmap_insert(&dp->ports, &port->node, hash_int(odp_to_u32(port_no), 0));
> > +    cmap_insert(&dp->ports, &port->node, hash_int(odp_to_u32(port_no), 0));
> 
> Could use the new hash_port_no() here.

Thanks, I made that change here and in another place.

> > @@ -1783,10 +1784,9 @@ dpif_netdev_run(struct dpif *dpif)
> > {
> >     struct dp_netdev_port *port;
> >     struct dp_netdev *dp = get_dp_netdev(dpif);
> > +    struct cmap_cursor cursor;
> > 
> > -    ovs_rwlock_rdlock(&dp->port_rwlock);
> > -
> 
> Unless it is OK to sometimes skip a port (due a concurrent insert,
> etc.) then we should still exclude writers here.

It's OK to skip a port here.  We'll hit it on the next call.

> > @@ -1804,10 +1802,9 @@ dpif_netdev_wait(struct dpif *dpif)
> > {
> >     struct dp_netdev_port *port;
> >     struct dp_netdev *dp = get_dp_netdev(dpif);
> > +    struct cmap_cursor cursor;
> > 
> > -    ovs_rwlock_rdlock(&dp->port_rwlock);
> > -
> 
> Same here.

I thought I had a reason it wasn't needed here, but I can't remember
it.  I added the lock.

> > @@ -1831,12 +1827,12 @@ pmd_load_queues(struct pmd_thread *f,
> >     struct dp_netdev *dp = f->dp;
> >     struct rxq_poll *poll_list = *ppoll_list;
> >     struct dp_netdev_port *port;
> > +    struct cmap_cursor cursor;
> >     int id = f->id;
> >     int index;
> >     int i;
> > 
> >     /* Simple scheduler for netdev rx polling. */
> > -    ovs_rwlock_rdlock(&dp->port_rwlock);
> 
> And here.

This shouldn't need the lock; it gets called again if the port
membership changes, based on port_seq values.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to