diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-10-07 07:09:27 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-07 16:58:27 +0300 |
commit | 163ab96b52ae2bb2d8f188cd29f0b570610f9007 (patch) | |
tree | e7810272ebcb651d2b9f96fbca26a5f192edd990 /net | |
parent | 8211fbfaf2fe66ac4ca28bb52b4e7f61dcac0378 (diff) | |
download | linux-163ab96b52ae2bb2d8f188cd29f0b570610f9007.tar.xz |
net: sockmap: use bitmap for copy info
Don't use bool array in struct sk_msg_sg, save 12 bytes.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/filter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index ed6563622ce3..46196e212413 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -2245,7 +2245,7 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start, * account for the headroom. */ bytes_sg_total = start - offset + bytes; - if (!msg->sg.copy[i] && bytes_sg_total <= len) + if (!test_bit(i, &msg->sg.copy) && bytes_sg_total <= len) goto out; /* At this point we need to linearize multiple scatterlist @@ -2450,7 +2450,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, /* Place newly allocated data buffer */ sk_mem_charge(msg->sk, len); msg->sg.size += len; - msg->sg.copy[new] = false; + __clear_bit(new, &msg->sg.copy); sg_set_page(&msg->sg.data[new], page, len + copy, 0); if (rsge.length) { get_page(sg_page(&rsge)); |