[ovs-dev,3/8] dpdk: reject --user option
diff mbox

Message ID 1442969477-11026-3-git-send-email-azhou@nicira.com
State Accepted
Headers show

Commit Message

Andy Zhou Sept. 23, 2015, 12:51 a.m. UTC
dpdk datapath needs to run as root. Block the --user
option for now. It is likely we will revisit this issue for possibly
supporting --user option for dpdk datapath process as well.

Signed-off-by: Andy Zhou <azhou@nicira.com>
---
 lib/netdev-dpdk.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Ben Pfaff Sept. 30, 2015, 5:38 a.m. UTC | #1
On Tue, Sep 22, 2015 at 05:51:12PM -0700, Andy Zhou wrote:
> dpdk datapath needs to run as root. Block the --user
> option for now. It is likely we will revisit this issue for possibly
> supporting --user option for dpdk datapath process as well.
> 
> Signed-off-by: Andy Zhou <azhou@nicira.com>

Acked-by: Ben Pfaff <blp@nicira.com>

> +    /* Reject --user option */
> +    int i;
> +    for (i =0; i< argc; i++) {

I'd write the above line as:
    for (int i = 0; i < argc; i++) {

> +         if (!strcmp(argv[i], "--user")) {
> +            VLOG_ERR("Can not specify both --dpdk and --user, aborting.");
> +        }
> +    }
> +

Thanks,

Ben.
Andy Zhou Oct. 1, 2015, 3:56 a.m. UTC | #2
On Tue, Sep 29, 2015 at 10:38 PM, Ben Pfaff <blp@nicira.com> wrote:
> On Tue, Sep 22, 2015 at 05:51:12PM -0700, Andy Zhou wrote:
>> dpdk datapath needs to run as root. Block the --user
>> option for now. It is likely we will revisit this issue for possibly
>> supporting --user option for dpdk datapath process as well.
>>
>> Signed-off-by: Andy Zhou <azhou@nicira.com>
>
> Acked-by: Ben Pfaff <blp@nicira.com>
>
>> +    /* Reject --user option */
>> +    int i;
>> +    for (i =0; i< argc; i++) {
>
> I'd write the above line as:
>     for (int i = 0; i < argc; i++) {
>
>> +         if (!strcmp(argv[i], "--user")) {
>> +            VLOG_ERR("Can not specify both --dpdk and --user, aborting.");
>> +        }
>> +    }
>> +
>
> Thanks,
>
> Ben.
Applied with the white space fixes.

Patch
diff mbox

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index e7eb526..fc62c0e 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1,5 +1,5 @@ 
 /*
- * Copyright (c) 2014 Nicira, Inc.
+ * Copyright (c) 2014, 2015 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -2142,6 +2142,14 @@  dpdk_init(int argc, char **argv)
     argc--;
     argv++;
 
+    /* Reject --user option */
+    int i;
+    for (i =0; i< argc; i++) {
+         if (!strcmp(argv[i], "--user")) {
+            VLOG_ERR("Can not specify both --dpdk and --user, aborting.");
+        }
+    }
+
 #ifdef VHOST_CUSE
     if (process_vhost_flags("-cuse_dev_name", strdup("vhost-net"),
                             PATH_MAX, argv, &cuse_dev_name)) {