Re: [PATCH man] ebpf.2: various updates to address some fixmes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux