[ovs-dev] [next 27/35] ofproto: Add a pointer to the owning ofproto to struct ofport.

Ethan Jackson ethan at nicira.com
Tue May 3 21:58:02 UTC 2011


It looks to me like there may have been some rebasing issues in this
patch.  The general approach seems fine though.

> -    connmgr_send_port_status(p->connmgr, &ofport->opp, OFPPR_DELETE);
> -
> -    netdev_monitor_remove(p->netdev_monitor, ofport->netdev);
> -    hmap_remove(&p->ports, &ofport->hmap_node);
> -    shash_delete(&p->port_by_name,
> -                 shash_find(&p->port_by_name,
> -                            netdev_get_name(ofport->netdev)));
> -    if (p->sflow) {
> -        ofproto_sflow_del_port(p->sflow, ofport->odp_port);
> -    }
> -
> +    connmgr_send_port_status(ofport->ofproto->connmgr, &ofport->opp,
> +                             OFPPR_DELETE);
>     ofport_free(ofport);
>  }

Does this code deletion belong in this patch or a separate one?  It's
not clear to me what it has to do with adding a pointer up to the
parent ofproto.

> @@ -1341,7 +1334,7 @@ ofport_remove_with_name(struct ofproto *ofproto, const char *name)
>  * Does not handle a name or port number change.  The caller must implement
>  * such a change as a delete followed by an add.  */
>  static void
> -ofport_modified(struct ofproto *ofproto, struct ofport *port,
> +ofport_modified(struct ofport *port,
>                 struct netdev *netdev, struct ofp_phy_port *opp)
>  {

The code doesn't compile because ofport_modified still needs a
reference to the parent ofproto.  Should be a simple "struct ofproto
*ofproto = port->ofproto;" at the beginning of the funciton.

Ethan



More information about the dev mailing list