summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriyEshenko <dmitriy.eshenko@vyos.io>2020-09-17 09:09:56 +0000
committerDmitriyEshenko <dmitriy.eshenko@vyos.io>2020-09-17 09:09:56 +0000
commit0adc41a62b6d532da7c4b47cb5da920d1ed39664 (patch)
tree06a24f22ecb87de1fe33dc7e6eed33b67c2b4905
parentcae9145346b60ebd6251643a5ce0ceed2a0f2364 (diff)
downloadvyatta-cfg-system-0adc41a62b6d532da7c4b47cb5da920d1ed39664.tar.gz
vyatta-cfg-system-0adc41a62b6d532da7c4b47cb5da920d1ed39664.zip
ethernet: T2891: Add ethernet ring-buffer CLI commands
-rw-r--r--templates/interfaces/ethernet/node.tag/ring-buffer/node.def1
-rw-r--r--templates/interfaces/ethernet/node.tag/ring-buffer/rx/node.def12
-rw-r--r--templates/interfaces/ethernet/node.tag/ring-buffer/tx/node.def14
3 files changed, 27 insertions, 0 deletions
diff --git a/templates/interfaces/ethernet/node.tag/ring-buffer/node.def b/templates/interfaces/ethernet/node.tag/ring-buffer/node.def
new file mode 100644
index 00000000..4de7ae9b
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/ring-buffer/node.def
@@ -0,0 +1 @@
+help: Shared buffer between the device driver and NIC
diff --git a/templates/interfaces/ethernet/node.tag/ring-buffer/rx/node.def b/templates/interfaces/ethernet/node.tag/ring-buffer/rx/node.def
new file mode 100644
index 00000000..f55244e0
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/ring-buffer/rx/node.def
@@ -0,0 +1,12 @@
+#
+# Configuration template for ring-buffer options
+#
+
+priority: 319 # Failure barrier only - no ordering constraints
+
+type: u32
+help: Configure RX ring buffer
+syntax:expression: $VAR(@) >= 80 && $VAR(@) <= 16384; "RX ring-buffer must be between 80 and 16384"
+val_help: u32:80-16384; RX ring buffer size
+
+update: sudo ethtool -G $VAR(../../@) rx $VAR(@) || exit 0
diff --git a/templates/interfaces/ethernet/node.tag/ring-buffer/tx/node.def b/templates/interfaces/ethernet/node.tag/ring-buffer/tx/node.def
new file mode 100644
index 00000000..862f2eb7
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/ring-buffer/tx/node.def
@@ -0,0 +1,14 @@
+#
+# Configuration template for ring-buffer options
+#
+
+priority: 319 # Failure barrier only - no ordering constraints
+
+type: u32
+help: Configure TX ring buffer
+syntax:expression: $VAR(@) >= 80 && $VAR(@) <= 16384; "TX ring-buffer must be between 80 and 16384"
+val_help: u32:80-16384; TX ring buffer size
+
+update: if ! sudo ethtool -G $VAR(../../@) tx $VAR(@)
+ then echo "Could not set TX ring-buffer for $VAR(../../@)"; exit 0
+ fi