On Mon, Sep 30, 2013 at 2:20 PM, Ben Pfaff <b...@nicira.com> wrote:
> On Wed, Sep 25, 2013 at 12:55:43AM -0700, Gurucharan Shetty wrote:
>> With this commit, whenever the verbosity is enabled with '-m'
>> option, the ovs-dpctl dump-flows command will display the flows with
>> in_port field showing the name instead of a port number.
>>
>> Conversely, one can also use a name in the in_port field with del-flow,
>> add-flow and mod-flow commands of ovs-dpctl. One should also be able
>> to use the port name when supplying the datapath flow as an input
>> to ofproto/trace command.
>>
>> Signed-off-by: Gurucharan Shetty <gshe...@nicira.com>
>
> Does ofproto_unixctl_trace() leak its port_names simap?
Yes, it does.

I plan to add the following incremental.
index 2e61515..43db1b8 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5354,6 +5354,7 @@ ofproto_unixctl_trace(struct unixctl_conn *conn,
int argc, const char *argv[],
     ds_init(&result);
     ofpbuf_init(&odp_key, 0);
     ofpbuf_init(&odp_mask, 0);
+    simap_init(&port_names);

     /* Handle "-generate" or a hex string as the last argument. */
     if (!strcmp(argv[argc - 1], "-generate")) {
@@ -5389,7 +5390,6 @@ ofproto_unixctl_trace(struct unixctl_conn *conn,
int argc, const char *argv[],
             backer = node->data;
         }
     }
-    simap_init(&port_names);
     if (backer && backer->dpif) {
         struct dpif_port dpif_port;
         struct dpif_port_dump port_dump;
@@ -5459,6 +5459,7 @@ exit:
     ofpbuf_delete(packet);
     ofpbuf_uninit(&odp_key);
     ofpbuf_uninit(&odp_mask);
+    simap_destroy(&port_names);
 }

>
> Would you mind refining this comment to something like "A map from odp
> port number to name." so that it's clear what the main direction of the
> mapping is?
Done.

>> +/* A map between odp port number and its name. */
>> +struct odp_portno_names {
>
> Acked-by: Ben Pfaff <b...@nicira.com>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to