diff options
author | Magnus Karlsson <magnus.karlsson@intel.com> | 2019-12-19 13:39:27 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-12-20 16:00:09 -0800 |
commit | 03896ef1f0cb23d2742ddf486c531c700a2da7d6 (patch) | |
tree | d1d460f61ce001d65f104df8fd8cd2a2b08dc486 /net/xdp/xsk.c | |
parent | c5ed924b54c892ee637d2e6889ef83341835a560 (diff) | |
download | linux-03896ef1f0cb23d2742ddf486c531c700a2da7d6.tar.gz linux-03896ef1f0cb23d2742ddf486c531c700a2da7d6.tar.bz2 linux-03896ef1f0cb23d2742ddf486c531c700a2da7d6.zip |
xsk: Change names of validation functions
Change the names of the validation functions to better reflect what
they are doing. The uppermost ones are reading entries from the rings
and only the bottom ones validate entries. So xskq_cons_read_ is a
better prefix name.
Also change the xskq_cons_read_ functions to return a bool
as the the descriptor or address is already returned by reference
in the parameters. Everyone is using the return value as a bool
anyway.
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/1576759171-28550-9-git-send-email-magnus.karlsson@intel.com
Diffstat (limited to 'net/xdp/xsk.c')
-rw-r--r-- | net/xdp/xsk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index cd84b9d0f1e1..4e932a930b3a 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -45,7 +45,7 @@ bool xsk_umem_has_addrs(struct xdp_umem *umem, u32 cnt) } EXPORT_SYMBOL(xsk_umem_has_addrs); -u64 *xsk_umem_peek_addr(struct xdp_umem *umem, u64 *addr) +bool xsk_umem_peek_addr(struct xdp_umem *umem, u64 *addr) { return xskq_cons_peek_addr(umem->fq, addr, umem); } @@ -126,7 +126,7 @@ static void __xsk_rcv_memcpy(struct xdp_umem *umem, u64 addr, void *from_buf, void *to_buf = xdp_umem_get_data(umem, addr); addr = xsk_umem_add_offset_to_addr(addr); - if (xskq_crosses_non_contig_pg(umem, addr, len + metalen)) { + if (xskq_cons_crosses_non_contig_pg(umem, addr, len + metalen)) { void *next_pg_addr = umem->pages[(addr >> PAGE_SHIFT) + 1].addr; u64 page_start = addr & ~(PAGE_SIZE - 1); u64 first_len = PAGE_SIZE - (addr - page_start); |