cxgbetool.c (ac02945f7e2b5ab84fe510fc052c35350e31220d) | cxgbetool.c (811a82d53aaf905bebb523600d375a457069f022) |
---|---|
1/*- 2 * Copyright (c) 2011 Chelsio Communications, Inc. 3 * All rights reserved. 4 * Written by: Navdeep Parhar <np@FreeBSD.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 3136 unchanged lines hidden (view full) --- 3145 warnx("invalid scheduling class \"%s\". " 3146 "\"class\" needs an integer value where " 3147 "0 <= value <= 15", param); 3148 return (EINVAL); 3149 } 3150 os->sched_class = val; 3151 } else if (!strcmp(s, "bind") || !strcmp(s, "txq") || 3152 !strcmp(s, "rxq")) { | 1/*- 2 * Copyright (c) 2011 Chelsio Communications, Inc. 3 * All rights reserved. 4 * Written by: Navdeep Parhar <np@FreeBSD.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 3136 unchanged lines hidden (view full) --- 3145 warnx("invalid scheduling class \"%s\". " 3146 "\"class\" needs an integer value where " 3147 "0 <= value <= 15", param); 3148 return (EINVAL); 3149 } 3150 os->sched_class = val; 3151 } else if (!strcmp(s, "bind") || !strcmp(s, "txq") || 3152 !strcmp(s, "rxq")) { |
3153 val = -1; 3154 if (strcmp(param, "random")) { | 3153 if (!strcmp(param, "random")) { 3154 val = QUEUE_RANDOM; 3155 } else if (!strcmp(param, "roundrobin")) { 3156 val = QUEUE_ROUNDROBIN; 3157 } else { |
3155 p = str_to_number(param, &val, NULL); 3156 if (*p || val < 0 || val > 0xffff) { 3157 warnx("invalid queue specification " 3158 "\"%s\". \"%s\" needs an integer" | 3158 p = str_to_number(param, &val, NULL); 3159 if (*p || val < 0 || val > 0xffff) { 3160 warnx("invalid queue specification " 3161 "\"%s\". \"%s\" needs an integer" |
3159 " value, or \"random\".", 3160 param, s); | 3162 " value, \"random\", or " 3163 "\"roundrobin\".", param, s); |
3161 return (EINVAL); 3162 } 3163 } 3164 if (!strcmp(s, "bind")) { 3165 os->txq = val; 3166 os->rxq = val; 3167 } else if (!strcmp(s, "txq")) { 3168 os->txq = val; --- 33 unchanged lines hidden (view full) --- 3202 .cong_algo = -1, 3203 .sched_class = -1, 3204 .tstamp = -1, 3205 .sack = -1, 3206 .nagle = -1, 3207 .ecn = -1, 3208 .ddp = -1, 3209 .tls = -1, | 3164 return (EINVAL); 3165 } 3166 } 3167 if (!strcmp(s, "bind")) { 3168 os->txq = val; 3169 os->rxq = val; 3170 } else if (!strcmp(s, "txq")) { 3171 os->txq = val; --- 33 unchanged lines hidden (view full) --- 3205 .cong_algo = -1, 3206 .sched_class = -1, 3207 .tstamp = -1, 3208 .sack = -1, 3209 .nagle = -1, 3210 .ecn = -1, 3211 .ddp = -1, 3212 .tls = -1, |
3210 .txq = -1, 3211 .rxq = -1, | 3213 .txq = QUEUE_RANDOM, 3214 .rxq = QUEUE_RANDOM, |
3212 .mss = -1, 3213 }; 3214 3215 *os = default_settings; 3216 3217 next = settings = strdup(settings_ro); 3218 if (settings == NULL) { 3219 warn (NULL); --- 503 unchanged lines hidden --- | 3215 .mss = -1, 3216 }; 3217 3218 *os = default_settings; 3219 3220 next = settings = strdup(settings_ro); 3221 if (settings == NULL) { 3222 warn (NULL); --- 503 unchanged lines hidden --- |