From: Alexei Starovoitov <ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
To: Daniel Borkmann <daniel-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH man] ebpf.2: various updates to address some fixmes
Date: Tue, 28 Jul 2015 11:01:20 -0700 [thread overview]
Message-ID: <55B7C370.1050708@plumgrid.com> (raw)
In-Reply-To: <55B7BD6E.4080205-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org>
On 7/28/15 10:35 AM, Daniel Borkmann wrote:
> On 07/28/2015 07:25 PM, Alexei Starovoitov wrote:
>> On 7/28/15 8:29 AM, Daniel Borkmann wrote:
>>> +.BR __sync_fetch_and_add()
>>> +can be used on map values in case the map has a value_size of
>>> sizeof(long).
>>> +This is quite often useful for aggregation and accounting of events.
>>
>> The above is a bit not clear, since both u32 and u64 can be used
>> as atomic counters.
>
> Right, it's unclear indeed. Perhaps the sizeof(long) should be dropped and
> it should say instead "the map has a value_size of 4 or 8 bytes".
that also probably not ideal, since value_size == sizeof(struct elemval)
struct elemval {
u64 packet_rx;
u64 byte_rx;
u32 another_counter;
...
u32 some_useful_field;
};
so the program can keep multiple counters in each map element.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-07-28 18:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 15:29 [PATCH man] ebpf.2: various updates to address some fixmes Daniel Borkmann
[not found] ` <a8aa1bd1ddb4cd90a26887f2ce68d79c1e1e4c1f.1438097188.git.daniel-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org>
2015-07-28 17:25 ` Alexei Starovoitov
[not found] ` <55B7BB08.9070608-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
2015-07-28 17:35 ` Daniel Borkmann
[not found] ` <55B7BD6E.4080205-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org>
2015-07-28 18:01 ` Alexei Starovoitov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55B7C370.1050708@plumgrid.com \
--to=ast-uqk4ao+rvk5wk0htik3j/w@public.gmane.org \
--cc=daniel-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.