netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: Add BPF_MAP_TYPE_QUEUE and BPF_MAP_TYPE_QUEUE to bpftool-map
@ 2018-11-22 20:59 David Calavera
  2018-11-23 10:56 ` Edward Cree
  0 siblings, 1 reply; 3+ messages in thread
From: David Calavera @ 2018-11-22 20:59 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, netdev

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.

Signed-off-by: David Calavera <david.calavera@gmail.com>
---
 tools/bpf/bpftool/Documentation/bpftool-map.rst | 3 ++-
 tools/bpf/bpftool/map.c                         | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/Documentation/bpftool-map.rst b/tools/bpf/bpftool/Documentation/bpftool-map.rst
index f55a2daed59b..9e827e342d9e 100644
--- a/tools/bpf/bpftool/Documentation/bpftool-map.rst
+++ b/tools/bpf/bpftool/Documentation/bpftool-map.rst
@@ -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
 ===========
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index 7bf38f0e152e..68b656b6edcc 100644
--- a/tools/bpf/bpftool/map.c
+++ b/tools/bpf/bpftool/map.c
@@ -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)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] bpf: Add BPF_MAP_TYPE_QUEUE and BPF_MAP_TYPE_QUEUE to bpftool-map
  2018-11-22 20:59 [PATCH bpf-next] bpf: Add BPF_MAP_TYPE_QUEUE and BPF_MAP_TYPE_QUEUE to bpftool-map David Calavera
@ 2018-11-23 10:56 ` Edward Cree
       [not found]   ` <CAH7nXcsdK-hL7EuwuFo45AUL=NYJH7wm9TJZx_kOzN1PuuiDAg@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Edward Cree @ 2018-11-23 10:56 UTC (permalink / raw)
  To: David Calavera, Alexei Starovoitov, Daniel Borkmann, netdev

On 22/11/18 20:59, David Calavera wrote:
> 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.
>
> Signed-off-by: David Calavera <david.calavera@gmail.com>
> ---
Subject line says 'QUEUE' twice, should one of those be 'STACK'?
>  tools/bpf/bpftool/Documentation/bpftool-map.rst | 3 ++-
>  tools/bpf/bpftool/map.c                         | 2 ++
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/Documentation/bpftool-map.rst b/tools/bpf/bpftool/Documentation/bpftool-map.rst
> index f55a2daed59b..9e827e342d9e 100644
> --- a/tools/bpf/bpftool/Documentation/bpftool-map.rst
> +++ b/tools/bpf/bpftool/Documentation/bpftool-map.rst
> @@ -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
>  ===========
> diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
> index 7bf38f0e152e..68b656b6edcc 100644
> --- a/tools/bpf/bpftool/map.c
> +++ b/tools/bpf/bpftool/map.c
> @@ -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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] bpf: Add BPF_MAP_TYPE_QUEUE and BPF_MAP_TYPE_QUEUE to bpftool-map
       [not found]   ` <CAH7nXcsdK-hL7EuwuFo45AUL=NYJH7wm9TJZx_kOzN1PuuiDAg@mail.gmail.com>
@ 2018-11-23 21:48     ` Daniel Borkmann
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2018-11-23 21:48 UTC (permalink / raw)
  To: David Calavera, ecree; +Cc: Alexei Starovoitov, netdev

On 11/23/2018 06:48 PM, David Calavera wrote:
> 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

> On Fri, Nov 23, 2018 at 2:56 AM Edward Cree <ecree@solarflare.com> wrote:
> 
>> On 22/11/18 20:59, David Calavera wrote:
>>> 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.
>>>
>>> Signed-off-by: David Calavera <david.calavera@gmail.com>
>>> ---
>> Subject line says 'QUEUE' twice, should one of those be 'STACK'?
>>>  tools/bpf/bpftool/Documentation/bpftool-map.rst | 3 ++-
>>>  tools/bpf/bpftool/map.c                         | 2 ++
>>>  2 files changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tools/bpf/bpftool/Documentation/bpftool-map.rst
>> b/tools/bpf/bpftool/Documentation/bpftool-map.rst
>>> index f55a2daed59b..9e827e342d9e 100644
>>> --- a/tools/bpf/bpftool/Documentation/bpftool-map.rst
>>> +++ b/tools/bpf/bpftool/Documentation/bpftool-map.rst
>>> @@ -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
>>>  ===========
>>> diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
>>> index 7bf38f0e152e..68b656b6edcc 100644
>>> --- a/tools/bpf/bpftool/map.c
>>> +++ b/tools/bpf/bpftool/map.c
>>> @@ -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)
>>
>>
>>
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-24  8:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-22 20:59 [PATCH bpf-next] bpf: Add BPF_MAP_TYPE_QUEUE and BPF_MAP_TYPE_QUEUE to bpftool-map David Calavera
2018-11-23 10:56 ` Edward Cree
     [not found]   ` <CAH7nXcsdK-hL7EuwuFo45AUL=NYJH7wm9TJZx_kOzN1PuuiDAg@mail.gmail.com>
2018-11-23 21:48     ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).