Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178081818
D62138.1795905521.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D62138.1795905521.diff
View Options
diff --git a/usr.sbin/valectl/valectl.8 b/usr.sbin/valectl/valectl.8
--- a/usr.sbin/valectl/valectl.8
+++ b/usr.sbin/valectl/valectl.8
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 30, 2024
+.Dd November 26, 2026
.Dt VALECTL 8
.Os
.Sh NAME
@@ -138,6 +138,9 @@
be polled by the core with the same id.
If a third number is given, then this is repeated for as many consecutive
rings and cores.
+Without
+.Fl C ,
+all interface rings are polled by a single thread on core 0.
.It Fl m Ar memid
Used in conjunction with
.Fl n
diff --git a/usr.sbin/valectl/valectl.c b/usr.sbin/valectl/valectl.c
--- a/usr.sbin/valectl/valectl.c
+++ b/usr.sbin/valectl/valectl.c
@@ -127,8 +127,14 @@
char *w, *tok;
int i, p;
- if (conf == NULL || ! *conf) {
- fprintf(stderr, "invalid null/empty config\n");
+ /* By default one thread on CPU 0 polls all the rings. */
+ v->nr_mode = NETMAP_POLLING_MODE_SINGLE_CPU;
+ v->nr_first_cpu_id = 0;
+ v->nr_num_polling_cpus = 1;
+ if (conf == NULL)
+ return 0;
+ if (*conf == '\0') {
+ fprintf(stderr, "invalid empty config\n");
return -1;
}
w = strdup(conf);
@@ -143,8 +149,10 @@
v->nr_first_cpu_id = p;
break;
case 2:
- if (v->nr_mode != NETMAP_POLLING_MODE_MULTI_CPU) {
- fprintf(stderr, "too many numbers in '%s'\n", conf);
+ if (v->nr_mode != NETMAP_POLLING_MODE_MULTI_CPU &&
+ p != 1) {
+ fprintf(stderr, "the third number must be 1 "
+ "when the first is 0 in '%s'\n", conf);
return -1;
}
v->nr_num_polling_cpus = p;
@@ -281,14 +289,17 @@
break;
case NETMAP_REQ_VALE_POLLING_ENABLE:
+ memset(&vale_polling, 0, sizeof(vale_polling));
+ hdr.nr_body = (uintptr_t)&vale_polling;
+ if (parse_poll_config(a->config, &vale_polling) != 0)
+ return 1;
action = "enable polling on";
- /* fall through */
+ break;
+
case NETMAP_REQ_VALE_POLLING_DISABLE:
memset(&vale_polling, 0, sizeof(vale_polling));
hdr.nr_body = (uintptr_t)&vale_polling;
- parse_poll_config(a->config, &vale_polling);
- if (action == NULL)
- action ="disable polling on";
+ action = "disable polling on";
break;
case NETMAP_REQ_PORT_INFO_GET:
@@ -351,7 +362,7 @@
"\t-p interface start polling. Additional -C x,y,z configures\n"
"\t\t x: 0 (REG_ALL_NIC) or 1 (REG_ONE_NIC),\n"
"\t\t y: CPU core id for ALL_NIC and core/ring for ONE_NIC\n"
- "\t\t z: (ONE_NIC only) num of total cores/rings\n"
+ "\t\t z: num of total cores/rings (1 for ALL_NIC)\n"
"\t-P interface stop polling\n"
"\t-m memid to use when creating a new interface\n"
"\t-v increase verbosity\n"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 28, 10:38 PM (21 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42079938
Default Alt Text
D62138.1795905521.diff (2 KB)
Attached To
Mode
D62138: valectl: Make -p work without -C and with a single thread
Attached
Detach File
Event Timeline