* [PATCH what 1/3] what: add bits.b() for binary number "literals"
2026-02-24 8:56 [PATCH what 0/3] ice: add LLDP filter control 0x0A0A Jakub Slepecki
@ 2026-02-24 8:56 ` Jakub Slepecki
2026-02-24 8:56 ` [PATCH what 2/3] ice: add LLDP filter control 0x0A0A Jakub Slepecki
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jakub Slepecki @ 2026-02-24 8:56 UTC (permalink / raw)
To: patches; +Cc: please, Jakub Slepecki
Good chunk of documentation uses the "1001b" notation. Lua does not
support it, but we can leverage function calls syntax sugar to be somewhat
similar to it.
Signed-off-by: Jakub Slepecki <jakub.slepecki@intel.com>
---
spec/bits_spec.lua | 25 +++++++++++++++++++++++++
what/bits.lua | 20 ++++++++++++++++++++
2 files changed, 45 insertions(+)
create mode 100644 spec/bits_spec.lua
diff --git a/spec/bits_spec.lua b/spec/bits_spec.lua
new file mode 100644
index 000000000000..931ce32048d7
--- /dev/null
+++ b/spec/bits_spec.lua
@@ -0,0 +1,25 @@
+local bits = require"what.bits"
+local b = bits.b
+
+
+describe("bits.b()", function()
+ describe("builds integers from", function()
+ it("some examples", function()
+ assert.are.equal(1, b"1")
+ assert.are.equal(3, b"11")
+ assert.are.equal(5, b"101")
+ assert.are.equal(15, b"1111")
+ assert.are.equal(0, b"0000")
+ assert.are.equal(37, b"100101")
+ end)
+ end)
+
+ it("allows an empty string", function()
+ assert.are.equal(0, b"")
+ end)
+
+ it("rejects malformed strings", function()
+ assert.is_nil(b"abc")
+ assert.is_nil(b"10a1")
+ end)
+end)
diff --git a/what/bits.lua b/what/bits.lua
index c11571a725bd..440d5bacd36a 100644
--- a/what/bits.lua
+++ b/what/bits.lua
@@ -131,4 +131,24 @@ function bits.bit (nth)
end
+--- Build an integer based on a string containing a [[binary]]
+--- representation of it, for example:
+---
+--- bits.b"011" --> 3
+--- bits.b"101" --> 5
+function bits.b (binary)
+ if not binary:match"^[01]*$" then
+ return nil
+ end
+ local len = #binary
+ local val = 0
+ local pos = binary:find"1"
+ while pos do
+ val = val + 2 ^ (len - pos)
+ pos = binary:find("1", pos + 1)
+ end
+ return math.tointeger(val)
+end
+
+
return bits
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH what 2/3] ice: add LLDP filter control 0x0A0A
2026-02-24 8:56 [PATCH what 0/3] ice: add LLDP filter control 0x0A0A Jakub Slepecki
2026-02-24 8:56 ` [PATCH what 1/3] what: add bits.b() for binary number "literals" Jakub Slepecki
@ 2026-02-24 8:56 ` Jakub Slepecki
2026-02-24 8:56 ` [PATCH what 3/3] scripts: add ID=ubuntu to scripts/install Jakub Slepecki
2026-02-24 9:08 ` [PATCH what 0/3] ice: add LLDP filter control 0x0A0A Aki
3 siblings, 0 replies; 5+ messages in thread
From: Jakub Slepecki @ 2026-02-24 8:56 UTC (permalink / raw)
To: patches; +Cc: please, Jakub Slepecki
Signed-off-by: Jakub Slepecki <jakub.slepecki@intel.com>
---
samples/linux.log | 8 +++++++
what/ice/opcodes/0x0a0a.lua | 43 +++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
create mode 100644 what/ice/opcodes/0x0a0a.lua
diff --git a/samples/linux.log b/samples/linux.log
index a32fcd06bf75..b1f15c4ab890 100644
--- a/samples/linux.log
+++ b/samples/linux.log
@@ -26,3 +26,11 @@
addr (h,l) 0x00000004 0x3CB75000
[ 5.000000] ice 0x00000004 0x3CB75000 00000000: 00 40 80 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 5.000000] ice 0x00000004 0x3CB75000 00000010: e0 00 00 00 00 00 04 00
+[ 5.000000] ice 0000:01:00.0: AQ Command: opcode 0x0A0A, flags 0x2000, datalen 0x0000, retval 0x0000
+ cookie (h,l) 0x00000000 0x00000000
+ param (0,1) 0x00030001 0x00000000
+ addr (h,l) 0x00000000 0x00000000
+[ 5.000000] ice 0000:01:00.0: AQ Response: opcode 0x0A0A, flags 0x2003, datalen 0x0000, retval 0x0000
+ cookie (h,l) 0x00000000 0x00000000
+ param (0,1) 0x00030001 0x00000000
+ addr (h,l) 0x00000000 0x00000000
diff --git a/what/ice/opcodes/0x0a0a.lua b/what/ice/opcodes/0x0a0a.lua
new file mode 100644
index 000000000000..f9ce3bc3a177
--- /dev/null
+++ b/what/ice/opcodes/0x0a0a.lua
@@ -0,0 +1,43 @@
+local b = require "what.bits".b
+local dis = require "what.dissecting"
+local flags = require "what.ice.flags"
+local lldp_filter_ctl = {}
+local dump = [[
+---
+opcode: 0x0a0a (LLDP Filter Control)
+kind: %s %s
+flags: %s
+retval: 0x%x
+cookie: 0x%08x 0x%08x
+Command Flag: %s
+VSI: %d
+...]]
+
+
+--- 9.8.5.2.2.11 LLDP Filter Control (0x0A0A) [E810]
+--- Table 9-93. LLDP Filter Control Command [E810]
+--- Table 9-94. LLDP Filter Control Response [E810]
+local command_buffer = dis.new{
+ ["16.0-16.1"] = dis.toggle "Command Flag" {
+ [b'00'] = "Add",
+ [b'01'] = "Delete",
+ [b'10'] = "Update (change VSI number)",
+ [b'11'] = "Reserved",
+ },
+ ["18.0-19.7"] = dis.decimal "VSI",
+}
+
+
+function lldp_filter_ctl:dump ()
+ local res = command_buffer({}, self:command_buffer())
+ return dump:format(
+ self.queue, self.kind,
+ flags.dump(self.flags),
+ self.retval,
+ self.cookie_h, self.cookie_l,
+ res["Command Flag"],
+ res["VSI"])
+end
+
+
+return lldp_filter_ctl
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH what 3/3] scripts: add ID=ubuntu to scripts/install
2026-02-24 8:56 [PATCH what 0/3] ice: add LLDP filter control 0x0A0A Jakub Slepecki
2026-02-24 8:56 ` [PATCH what 1/3] what: add bits.b() for binary number "literals" Jakub Slepecki
2026-02-24 8:56 ` [PATCH what 2/3] ice: add LLDP filter control 0x0A0A Jakub Slepecki
@ 2026-02-24 8:56 ` Jakub Slepecki
2026-02-24 9:08 ` [PATCH what 0/3] ice: add LLDP filter control 0x0A0A Aki
3 siblings, 0 replies; 5+ messages in thread
From: Jakub Slepecki @ 2026-02-24 8:56 UTC (permalink / raw)
To: patches; +Cc: please, Jakub Slepecki
Note, that packages may be "shared" between debian and ubuntu.
Consider joining these two or a fall-through.
Signed-off-by: Jakub Slepecki <jakub.slepecki@intel.com>
---
scripts/install | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/install b/scripts/install
index 9c5d3b405232..545a82a22d37 100755
--- a/scripts/install
+++ b/scripts/install
@@ -34,5 +34,10 @@ debian)
[ -n "$runtime" ] && runtime=
echo apt install $buildtime $runtime
;;
+ubuntu)
+ [ -n "$buildtime" ] && buildtime=lua-busted
+ [ -n "$runtime" ] && runtime=
+ echo apt install $buildtime $runtime
+ ;;
*) echo "ID=$ID" >&2; exit 1;;
esac
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH what 0/3] ice: add LLDP filter control 0x0A0A
2026-02-24 8:56 [PATCH what 0/3] ice: add LLDP filter control 0x0A0A Jakub Slepecki
` (2 preceding siblings ...)
2026-02-24 8:56 ` [PATCH what 3/3] scripts: add ID=ubuntu to scripts/install Jakub Slepecki
@ 2026-02-24 9:08 ` Aki
3 siblings, 0 replies; 5+ messages in thread
From: Aki @ 2026-02-24 9:08 UTC (permalink / raw)
To: Jakub Slepecki, patches
On 24/02/2026 09:56, Jakub Slepecki wrote:
> Jakub Slepecki (3):
> what: add bits.b for binary number "literals"
> ice: add LLDP filter control 0x0A0A
> scripts: add ID=ubuntu to scripts/install
Merged as:
831984516810b2a4a01338a198e8d355666b4414
93c9175065ad21824b2fab2b9147c06d71675cbd
db706393090fc32bb263abd06ca59542e5519e6e
^ permalink raw reply [flat|nested] 5+ messages in thread