+static void
+add_port_queue(char *s)
+{
+ char *save_ptr = NULL;
+ char *port_name;
+ char *queue_id;
+
+ port_name = strtok_r(s, ":", &save_ptr);
+ queue_id = strtok_r(NULL, "", &save_ptr);
+ if (!queue_id) {
+ ovs_fatal(0, "argument to -Q or --port-queue should take the form "
+ "\"<port-name>:<queue-id>\"");
+ }
+
+ if (!shash_add_once(&port_queues, port_name,
+ (void *) (uintptr_t) atoi(queue_id))) {
+ ovs_fatal(0, "<port-name> arguments for -Q or --port-queue must "
+ "be unique");
+ }
+}
+