[ovs-dev] [PATCH 4/6] vxlan: Change dpif_backer->tnl backer to a "struct simap"

Kyle Mestery (kmestery) kmestery at cisco.com
Thu Feb 14 18:11:46 UTC 2013


On Feb 14, 2013, at 12:07 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Thu, Feb 14, 2013 at 09:37:28AM -0500, Kyle Mestery wrote:
>> Move dpif_backer->tnl_backers from a "struct sset" to a
>> "struct simap". Store odp_port in the new map.  This will make it easier to
>> access the odp_port for future patches.
>> 
>> Signed-off-by: Kyle Mestery <kmestery at cisco.com>
>> Acked-by: Ethan Jackson <ethan at nicira.com>
> 
> simap is more useful than I foresaw at the time.
> 
> I moved the port_no declaration to an inner block, like this:
> 
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index aa17244..c1b9b69 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> @@ -3007,7 +3007,6 @@ port_add(struct ofproto *ofproto_, struct netdev *netdev)
>     struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
>     const char *dp_port_name = netdev_vport_get_dpif_port(netdev);
>     const char *devname = netdev_get_name(netdev);
> -    uint32_t port_no = UINT32_MAX;
> 
>     if (netdev_vport_is_patch(netdev)) {
>         sset_add(&ofproto->ghost_ports, netdev_get_name(netdev));
> @@ -3015,7 +3014,10 @@ port_add(struct ofproto *ofproto_, struct netdev *netdev)
>     }
> 
>     if (!dpif_port_exists(ofproto->backer->dpif, dp_port_name)) {
> -        int error = dpif_port_add(ofproto->backer->dpif, netdev, &port_no);
> +        uint32_t port_no = UINT32_MAX;
> +        int error;
> +
> +        error = dpif_port_add(ofproto->backer->dpif, netdev, &port_no);
>         if (error) {
>             return error;
>         }
> 
> and I've queued this up.
> 
> Thanks,
> 
> Ben.

Looks good, thanks!


More information about the dev mailing list