* [patch iproute2] iplink: add support for num[tr]xqueues
@ 2012-07-20 12:29 Jiri Pirko
0 siblings, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2012-07-20 12:29 UTC (permalink / raw)
To: netdev; +Cc: davem, edumazet, shemminger
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
include/linux/if_link.h | 2 ++
ip/iplink.c | 20 ++++++++++++++++++++
man/man8/ip-link.8.in | 13 +++++++++++++
3 files changed, 35 insertions(+)
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 00e5868..46f03db 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -140,6 +140,8 @@ enum {
IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
#define IFLA_PROMISCUITY IFLA_PROMISCUITY
+ IFLA_NUM_TX_QUEUES,
+ IFLA_NUM_RX_QUEUES,
__IFLA_MAX
};
diff --git a/ip/iplink.c b/ip/iplink.c
index 679091e..0baa128 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -48,6 +48,8 @@ void iplink_usage(void)
fprintf(stderr, " [ address LLADDR ]\n");
fprintf(stderr, " [ broadcast LLADDR ]\n");
fprintf(stderr, " [ mtu MTU ]\n");
+ fprintf(stderr, " [ numtxqueues QUEUE_COUNT ]\n");
+ fprintf(stderr, " [ numrxqueues QUEUE_COUNT ]\n");
fprintf(stderr, " type TYPE [ ARGS ]\n");
fprintf(stderr, " ip link delete DEV type TYPE [ ARGS ]\n");
fprintf(stderr, "\n");
@@ -279,6 +281,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
int mtu = -1;
int netns = -1;
int vf = -1;
+ int numtxqueues = -1;
+ int numrxqueues = -1;
*group = -1;
ret = argc;
@@ -445,6 +449,22 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
invarg("Invalid operstate\n", *argv);
addattr8(&req->n, sizeof(*req), IFLA_OPERSTATE, state);
+ } else if (strcmp(*argv, "numtxqueues") == 0) {
+ NEXT_ARG();
+ if (numtxqueues != -1)
+ duparg("numtxqueues", *argv);
+ if (get_integer(&numtxqueues, *argv, 0))
+ invarg("Invalid \"numtxqueues\" value\n", *argv);
+ addattr_l(&req->n, sizeof(*req), IFLA_NUM_TX_QUEUES,
+ &numtxqueues, 4);
+ } else if (strcmp(*argv, "numrxqueues") == 0) {
+ NEXT_ARG();
+ if (numrxqueues != -1)
+ duparg("numrxqueues", *argv);
+ if (get_integer(&numrxqueues, *argv, 0))
+ invarg("Invalid \"numrxqueues\" value\n", *argv);
+ addattr_l(&req->n, sizeof(*req), IFLA_NUM_RX_QUEUES,
+ &numrxqueues, 4);
} else {
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 9386cc6..8a24e51 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -40,6 +40,11 @@ ip-link \- network device configuration
.RB "[ " mtu
.IR MTU " ]"
.br
+.RB "[ " numtxqueues
+.IR QUEUE_COUNT " ]"
+.RB "[ " numrxqueues
+.IR QUEUE_COUNT " ]"
+.br
.BR type " TYPE"
.RI "[ " ARGS " ]"
@@ -156,6 +161,14 @@ Link types:
- Ethernet Bridge device
.in -8
+.TP
+.BI numtxqueues " QUEUE_COUNT "
+specifies the number of transmit queues for new device.
+
+.TP
+.BI numrxqueues " QUEUE_COUNT "
+specifies the number of receive queues for new device.
+
.SS ip link delete - delete virtual link
.I DEVICE
specifies the virtual device to act operate on.
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [patch iproute2] iplink: add support for num[tr]xqueues
2012-07-20 18:12 Stephen Hemminger
@ 2012-07-20 18:22 ` Jiri Pirko
0 siblings, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2012-07-20 18:22 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev, edumazet, shemminger
Fri, Jul 20, 2012 at 08:12:55PM CEST, stephen.hemminger@vyatta.com wrote:
>
>Or use matches("numtxqueues") rather than strcmp
Okay - I will repost with "matches"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch iproute2] iplink: add support for num[tr]xqueues
@ 2012-07-20 18:12 Stephen Hemminger
2012-07-20 18:22 ` Jiri Pirko
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2012-07-20 18:12 UTC (permalink / raw)
To: David Miller; +Cc: jiri, netdev, edumazet, shemminger
Or use matches("numtxqueues") rather than strcmp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch iproute2] iplink: add support for num[tr]xqueues
2012-07-20 18:08 ` Jiri Pirko
@ 2012-07-20 18:10 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-07-20 18:10 UTC (permalink / raw)
To: jiri; +Cc: stephen.hemminger, netdev, edumazet, shemminger
From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 20 Jul 2012 20:08:13 +0200
> Fri, Jul 20, 2012 at 05:52:18PM CEST, stephen.hemminger@vyatta.com wrote:
>>I like the option, but numtxqueue is too verbose for the syntax model
>>of iproute. Why not use txq and rxq?
>
> There is "txqueuelen" present already in iplink. I tried to be uniform here.
> Isn't "txq" and "rxq" rather too short? And afterall, these parameters
> are not supposed to be used on daily basis by anyone :)
Perhaps a good compromise is numtxq and numrxq?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch iproute2] iplink: add support for num[tr]xqueues
2012-07-20 15:52 Stephen Hemminger
@ 2012-07-20 18:08 ` Jiri Pirko
2012-07-20 18:10 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Jiri Pirko @ 2012-07-20 18:08 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, David Miller, edumazet, shemminger
Fri, Jul 20, 2012 at 05:52:18PM CEST, stephen.hemminger@vyatta.com wrote:
>I like the option, but numtxqueue is too verbose for the syntax model
>of iproute. Why not use txq and rxq?
There is "txqueuelen" present already in iplink. I tried to be uniform here.
Isn't "txq" and "rxq" rather too short? And afterall, these parameters
are not supposed to be used on daily basis by anyone :)
Jirka
>
>Sent from my ASUS Pad
>
>Jiri Pirko <jiri@resnulli.us> wrote:
>
>>Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>---
>> include/linux/if_link.h | 2 ++
>> ip/iplink.c | 20 ++++++++++++++++++++
>> man/man8/ip-link.8.in | 13 +++++++++++++
>> 3 files changed, 35 insertions(+)
>>
>>diff --git a/include/linux/if_link.h b/include/linux/if_link.h
>>index 00e5868..46f03db 100644
>>--- a/include/linux/if_link.h
>>+++ b/include/linux/if_link.h
>>@@ -140,6 +140,8 @@ enum {
>> IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
>> IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
>> #define IFLA_PROMISCUITY IFLA_PROMISCUITY
>>+ IFLA_NUM_TX_QUEUES,
>>+ IFLA_NUM_RX_QUEUES,
>> __IFLA_MAX
>> };
>>
>>diff --git a/ip/iplink.c b/ip/iplink.c
>>index 679091e..0baa128 100644
>>--- a/ip/iplink.c
>>+++ b/ip/iplink.c
>>@@ -48,6 +48,8 @@ void iplink_usage(void)
>> fprintf(stderr, " [ address LLADDR ]\n");
>> fprintf(stderr, " [ broadcast LLADDR ]\n");
>> fprintf(stderr, " [ mtu MTU ]\n");
>>+ fprintf(stderr, " [ numtxqueues QUEUE_COUNT ]\n");
>>+ fprintf(stderr, " [ numrxqueues QUEUE_COUNT ]\n");
>> fprintf(stderr, " type TYPE [ ARGS ]\n");
>> fprintf(stderr, " ip link delete DEV type TYPE [ ARGS ]\n");
>> fprintf(stderr, "\n");
>>@@ -279,6 +281,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
>> int mtu = -1;
>> int netns = -1;
>> int vf = -1;
>>+ int numtxqueues = -1;
>>+ int numrxqueues = -1;
>>
>> *group = -1;
>> ret = argc;
>>@@ -445,6 +449,22 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
>> invarg("Invalid operstate\n", *argv);
>>
>> addattr8(&req->n, sizeof(*req), IFLA_OPERSTATE, state);
>>+ } else if (strcmp(*argv, "numtxqueues") == 0) {
>>+ NEXT_ARG();
>>+ if (numtxqueues != -1)
>>+ duparg("numtxqueues", *argv);
>>+ if (get_integer(&numtxqueues, *argv, 0))
>>+ invarg("Invalid \"numtxqueues\" value\n", *argv);
>>+ addattr_l(&req->n, sizeof(*req), IFLA_NUM_TX_QUEUES,
>>+ &numtxqueues, 4);
>>+ } else if (strcmp(*argv, "numrxqueues") == 0) {
>>+ NEXT_ARG();
>>+ if (numrxqueues != -1)
>>+ duparg("numrxqueues", *argv);
>>+ if (get_integer(&numrxqueues, *argv, 0))
>>+ invarg("Invalid \"numrxqueues\" value\n", *argv);
>>+ addattr_l(&req->n, sizeof(*req), IFLA_NUM_RX_QUEUES,
>>+ &numrxqueues, 4);
>> } else {
>> if (strcmp(*argv, "dev") == 0) {
>> NEXT_ARG();
>>diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
>>index 9386cc6..8a24e51 100644
>>--- a/man/man8/ip-link.8.in
>>+++ b/man/man8/ip-link.8.in
>>@@ -40,6 +40,11 @@ ip-link \- network device configuration
>> .RB "[ " mtu
>> .IR MTU " ]"
>> .br
>>+.RB "[ " numtxqueues
>>+.IR QUEUE_COUNT " ]"
>>+.RB "[ " numrxqueues
>>+.IR QUEUE_COUNT " ]"
>>+.br
>> .BR type " TYPE"
>> .RI "[ " ARGS " ]"
>>
>>@@ -156,6 +161,14 @@ Link types:
>> - Ethernet Bridge device
>> .in -8
>>
>>+.TP
>>+.BI numtxqueues " QUEUE_COUNT "
>>+specifies the number of transmit queues for new device.
>>+
>>+.TP
>>+.BI numrxqueues " QUEUE_COUNT "
>>+specifies the number of receive queues for new device.
>>+
>> .SS ip link delete - delete virtual link
>> .I DEVICE
>> specifies the virtual device to act operate on.
>>--
>>1.7.10.4
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch iproute2] iplink: add support for num[tr]xqueues
@ 2012-07-20 15:52 Stephen Hemminger
2012-07-20 18:08 ` Jiri Pirko
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2012-07-20 15:52 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, David Miller, edumazet, shemminger
I like the option, but numtxqueue is too verbose for the syntax model
of iproute. Why not use txq and rxq?
Sent from my ASUS Pad
Jiri Pirko <jiri@resnulli.us> wrote:
>Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>---
> include/linux/if_link.h | 2 ++
> ip/iplink.c | 20 ++++++++++++++++++++
> man/man8/ip-link.8.in | 13 +++++++++++++
> 3 files changed, 35 insertions(+)
>
>diff --git a/include/linux/if_link.h b/include/linux/if_link.h
>index 00e5868..46f03db 100644
>--- a/include/linux/if_link.h
>+++ b/include/linux/if_link.h
>@@ -140,6 +140,8 @@ enum {
> IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
> IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
> #define IFLA_PROMISCUITY IFLA_PROMISCUITY
>+ IFLA_NUM_TX_QUEUES,
>+ IFLA_NUM_RX_QUEUES,
> __IFLA_MAX
> };
>
>diff --git a/ip/iplink.c b/ip/iplink.c
>index 679091e..0baa128 100644
>--- a/ip/iplink.c
>+++ b/ip/iplink.c
>@@ -48,6 +48,8 @@ void iplink_usage(void)
> fprintf(stderr, " [ address LLADDR ]\n");
> fprintf(stderr, " [ broadcast LLADDR ]\n");
> fprintf(stderr, " [ mtu MTU ]\n");
>+ fprintf(stderr, " [ numtxqueues QUEUE_COUNT ]\n");
>+ fprintf(stderr, " [ numrxqueues QUEUE_COUNT ]\n");
> fprintf(stderr, " type TYPE [ ARGS ]\n");
> fprintf(stderr, " ip link delete DEV type TYPE [ ARGS ]\n");
> fprintf(stderr, "\n");
>@@ -279,6 +281,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
> int mtu = -1;
> int netns = -1;
> int vf = -1;
>+ int numtxqueues = -1;
>+ int numrxqueues = -1;
>
> *group = -1;
> ret = argc;
>@@ -445,6 +449,22 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
> invarg("Invalid operstate\n", *argv);
>
> addattr8(&req->n, sizeof(*req), IFLA_OPERSTATE, state);
>+ } else if (strcmp(*argv, "numtxqueues") == 0) {
>+ NEXT_ARG();
>+ if (numtxqueues != -1)
>+ duparg("numtxqueues", *argv);
>+ if (get_integer(&numtxqueues, *argv, 0))
>+ invarg("Invalid \"numtxqueues\" value\n", *argv);
>+ addattr_l(&req->n, sizeof(*req), IFLA_NUM_TX_QUEUES,
>+ &numtxqueues, 4);
>+ } else if (strcmp(*argv, "numrxqueues") == 0) {
>+ NEXT_ARG();
>+ if (numrxqueues != -1)
>+ duparg("numrxqueues", *argv);
>+ if (get_integer(&numrxqueues, *argv, 0))
>+ invarg("Invalid \"numrxqueues\" value\n", *argv);
>+ addattr_l(&req->n, sizeof(*req), IFLA_NUM_RX_QUEUES,
>+ &numrxqueues, 4);
> } else {
> if (strcmp(*argv, "dev") == 0) {
> NEXT_ARG();
>diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
>index 9386cc6..8a24e51 100644
>--- a/man/man8/ip-link.8.in
>+++ b/man/man8/ip-link.8.in
>@@ -40,6 +40,11 @@ ip-link \- network device configuration
> .RB "[ " mtu
> .IR MTU " ]"
> .br
>+.RB "[ " numtxqueues
>+.IR QUEUE_COUNT " ]"
>+.RB "[ " numrxqueues
>+.IR QUEUE_COUNT " ]"
>+.br
> .BR type " TYPE"
> .RI "[ " ARGS " ]"
>
>@@ -156,6 +161,14 @@ Link types:
> - Ethernet Bridge device
> .in -8
>
>+.TP
>+.BI numtxqueues " QUEUE_COUNT "
>+specifies the number of transmit queues for new device.
>+
>+.TP
>+.BI numrxqueues " QUEUE_COUNT "
>+specifies the number of receive queues for new device.
>+
> .SS ip link delete - delete virtual link
> .I DEVICE
> specifies the virtual device to act operate on.
>--
>1.7.10.4
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-07-20 18:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 12:29 [patch iproute2] iplink: add support for num[tr]xqueues Jiri Pirko
2012-07-20 15:52 Stephen Hemminger
2012-07-20 18:08 ` Jiri Pirko
2012-07-20 18:10 ` David Miller
2012-07-20 18:12 Stephen Hemminger
2012-07-20 18:22 ` Jiri Pirko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.