Skip to contentSkip to conversation

bpf: Add BPF_MAP_TYPE_QUEUE and BPF_MAP_TYPE_QUEUE to bpftool-map

PATCH In review David Calavera 3 participants 3 messages Nov 23, 2018 – Nov 24, 2018 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: Add BPF_MAP_TYPE_QUEUE and BPF_MAP_TYPE_QUEUE to bpftool-map

I noticed that these two new BPF Maps are not defined in bpftool. This patch defines those two maps and adds their names to the bpftool-map documentation.

---
 tools/bpf/bpftool/Documentation/bpftool-map.rst | 3 ++-
 tools/bpf/bpftool/map.c                         | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
tools/bpf/bpftool/Documentation/bpftool-map.rst +2 -1
index f55a2daed59b..9e827e342d9e 100644
@@ -42,7 +42,8 @@ MAP COMMANDS
 |		| **percpu_array** | **stack_trace** | **cgroup_array** | **lru_hash**
 |		| **lru_percpu_hash** | **lpm_trie** | **array_of_maps** | **hash_of_maps**
 |		| **devmap** | **sockmap** | **cpumap** | **xskmap** | **sockhash**
-|		| **cgroup_storage** | **reuseport_sockarray** | **percpu_cgroup_storage** }
+|		| **cgroup_storage** | **reuseport_sockarray** | **percpu_cgroup_storage**
+|		| **queue** | **stack** }
 
 DESCRIPTION
 ===========
tools/bpf/bpftool/map.c +2 -0
index 7bf38f0e152e..68b656b6edcc 100644
@@ -74,6 +74,8 @@ static const char * const map_type_name[] = {
 	[BPF_MAP_TYPE_CGROUP_STORAGE]	= "cgroup_storage",
 	[BPF_MAP_TYPE_REUSEPORT_SOCKARRAY] = "reuseport_sockarray",
 	[BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE]	= "percpu_cgroup_storage",
+	[BPF_MAP_TYPE_QUEUE] = "queue",
+	[BPF_MAP_TYPE_STACK] = "stack",
 };
 
 static bool map_is_per_cpu(__u32 type)
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · David Calavera

I noticed that these two new BPF Maps are not defined in bpftool. This patch defines those two maps and adds their names to the bpftool-map documentation.

---

Subject line says 'QUEUE' twice, should one of those be 'STACK'?

Quoted 31 lines
 tools/bpf/bpftool/Documentation/bpftool-map.rst | 3 ++-
 tools/bpf/bpftool/map.c                         | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
tools/bpf/bpftool/Documentation/bpftool-map.rst +2 -1
index f55a2daed59b..9e827e342d9e 100644
@@ -42,7 +42,8 @@ MAP COMMANDS
 |		| **percpu_array** | **stack_trace** | **cgroup_array** | **lru_hash**
 |		| **lru_percpu_hash** | **lpm_trie** | **array_of_maps** | **hash_of_maps**
 |		| **devmap** | **sockmap** | **cpumap** | **xskmap** | **sockhash**
-|		| **cgroup_storage** | **reuseport_sockarray** | **percpu_cgroup_storage** }
+|		| **cgroup_storage** | **reuseport_sockarray** | **percpu_cgroup_storage**
+|		| **queue** | **stack** }
 
 DESCRIPTION
 ===========
tools/bpf/bpftool/map.c +2 -0
index 7bf38f0e152e..68b656b6edcc 100644
@@ -74,6 +74,8 @@ static const char * const map_type_name[] = {
 	[BPF_MAP_TYPE_CGROUP_STORAGE]	= "cgroup_storage",
 	[BPF_MAP_TYPE_REUSEPORT_SOCKARRAY] = "reuseport_sockarray",
 	[BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE]	= "percpu_cgroup_storage",
+	[BPF_MAP_TYPE_QUEUE] = "queue",
+	[BPF_MAP_TYPE_STACK] = "stack",
 };
 
 static bool map_is_per_cpu(__u32 type)

A message that is not in the archive (sent off-list or not yet received): CAH7nXcsdK-hL7EuwuFo45AUL=NYJH7wm9TJZx_kOzN1PuuiDAg@mail.gmail.com

maintainer
#3 lore raw
Quoted 8 lines · David Calavera

Hi,

Sorry for the mistake, I'll send a new patch. Before doing that, I've noticed that the array of map names in tools/bpf/bpftool/map.c is very inconsistent in formatting, some lines use tabs to align the names, others use spaces, and other are not aligned at all. Is there any formatting convention for this? I can fix those lines if you have a preferred method now that I'm adding new elements to that array.

I've fixed the typo from the subject and applied your patch. If you want to send a patch with white-space cleanup for all the entries that would be fine with me, sure. You could align all the '=' with tabs to the one from percpu_cgroup_storage.

Thanks,
Daniel

Quoted 51 lines · Edward Cree
Quoted 49 lines · David Calavera
Quoted 6 lines

I noticed that these two new BPF Maps are not defined in bpftool. This patch defines those two maps and adds their names to the bpftool-map documentation.

---

Subject line says 'QUEUE' twice, should one of those be 'STACK'?

Review

Quoted 5 lines
 tools/bpf/bpftool/Documentation/bpftool-map.rst | 3 ++-
 tools/bpf/bpftool/map.c                         | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/tools/bpf/bpftool/Documentation/bpftool-map.rst

tools/bpf/bpftool/Documentation/bpftool-map.rst MAP COMMANDS · line 42

Quoted 5 lines

index f55a2daed59b..9e827e342d9e 100644

tools/bpf/bpftool/Documentation/bpftool-map.rst +0 -0
@@ -42,7 +42,8 @@ MAP COMMANDS
 |            | **percpu_array** | **stack_trace** | **cgroup_array** |

**lru_hash**

tools/bpf/bpftool/Documentation/bpftool-map.rst MAP COMMANDS · line 43

Quoted 1 line
tools/bpf/bpftool/Documentation/bpftool-map.rst +0 -0
 |            | **lru_percpu_hash** | **lpm_trie** | **array_of_maps** |

**hash_of_maps**

tools/bpf/bpftool/Documentation/bpftool-map.rst MAP COMMANDS · line 44

Quoted 1 line
tools/bpf/bpftool/Documentation/bpftool-map.rst +0 -0
 |            | **devmap** | **sockmap** | **cpumap** | **xskmap** |

**sockhash**

tools/bpf/bpftool/Documentation/bpftool-map.rst MAP COMMANDS · line 45

Quoted 1 line
tools/bpf/bpftool/Documentation/bpftool-map.rst +0 -1
-|            | **cgroup_storage** | **reuseport_sockarray** |

**percpu_cgroup_storage** }

tools/bpf/bpftool/Documentation/bpftool-map.rst MAP COMMANDS · line 45

Quoted 1 line
tools/bpf/bpftool/Documentation/bpftool-map.rst +1 -0
+|            | **cgroup_storage** | **reuseport_sockarray** |

**percpu_cgroup_storage**

Quoted 17 lines
tools/bpf/bpftool/Documentation/bpftool-map.rst +1 -0
+|            | **queue** | **stack** }
 
 DESCRIPTION
 ===========
tools/bpf/bpftool/map.c +2 -0
index 7bf38f0e152e..68b656b6edcc 100644
@@ -74,6 +74,8 @@ static const char * const map_type_name[] = {
      [BPF_MAP_TYPE_CGROUP_STORAGE]   = "cgroup_storage",
      [BPF_MAP_TYPE_REUSEPORT_SOCKARRAY] = "reuseport_sockarray",
      [BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE]    = "percpu_cgroup_storage",
+     [BPF_MAP_TYPE_QUEUE] = "queue",
+     [BPF_MAP_TYPE_STACK] = "stack",
 };
 
 static bool map_is_per_cpu(__u32 type)