9 Commits

Author SHA1 Message Date
Jesper Dangaard Brouer 20916547db AF_XDP-interaction: Add BPF object/code for unit test
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2022-04-22 08:33:40 +02:00
Jesper Dangaard Brouer 2b3fcf932d AF_XDP-interaction: Add btf_unit_test
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2022-03-21 15:10:46 +01:00
Jesper Dangaard Brouer 446653f4b4 AF_XDP-interaction: Add option for real-time priority
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-16 20:12:04 +01:00
Jesper Dangaard Brouer 9bca7ea4ff AF_XDP-interaction: Implement ethtool_get_max_queues
Need to get configured queues on the NIC device

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-16 13:03:38 +01:00
Ederson de Souza 34ef433573 Proposed: Helpers to access XDP hints based on BTF definitions
Based on:
 Subj: libbpf: Helpers to access XDP hints based on BTF definitions
  https://lore.kernel.org/all/20210803010331.39453-15-ederson.desouza@intel.com/
 From: Ederson de Souza <ederson.desouza@intel.com>

Ederson says:

 A new set of functions to help get the BTF definition of XDP hints
 structure and get the information based on it.

 `xsk_umem__btf_id` helps retrieve the BTF id of XDP metadata.
 `xsk_btf__init` sets up a context based on the BTF, including a hashmap,
 so that subsequent queries are faster.
 `xsk_btf__read` returns a pointer to the position in the XDP metadata
 containing a given field.
 `xsk_btf__has_field` checks the presence of a field in the BTF.
 `xsk_btf__free` frees up the context.

 Besides those, a macro `XSK_BTF_READ_INTO` acts as a convenient helper
 to read the field contents into a given variable.

 Note that currently, the hashmap used to speed-up offset location into
 the BTF doesn't use the field name as a string as key to the hashmap. It
 directly uses the pointer value instead, as it is expected that most of
 time, field names will be addressed by a shared constant string residing
 on read-only memory, thus saving some time. If this assumption is not
 entirely true, this optimisation needs to be rethought (or discarded
 altogether).

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-03 12:23:56 +01:00
Jesper Dangaard Brouer bb5105e5ca AF_XDP-interaction: Makefile add hashmap to be compiled
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-03 11:34:58 +01:00
Jesper Dangaard Brouer d4d325ddfc Introduce USER_TARGETS_OBJS_DEPS for extra dependencies
This USER_TARGETS_OBJS_DEPS allows makefiles to define
dependencies for USER_TARGETS_OBJS targets.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-26 16:02:25 +02:00
Jesper Dangaard Brouer 5d10995545 AF_XDP-interaction: Use USER_TARGETS_OBJS for common_* objects
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-26 15:31:33 +02:00
Jesper Dangaard Brouer 7c7c1a9039 AF_XDP-interaction: Add Makefile
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-15 18:26:24 +02:00