/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ #ifndef RX_RING_H #define RX_RING_H #include #include "ring.h" extern void ring_rx_setup(struct ring *ring, int sock, size_t size, int ifindex, struct pollfd *poll, bool v3, bool jumbo_support, bool verbose, uint32_t fanout_group, uint32_t fanout_type); extern void destroy_rx_ring(int sock, struct ring *ring); extern int get_rx_net_stats(int sock, uint64_t *packets, uint64_t *drops, bool v3); static inline int user_may_pull_from_rx(struct tpacket2_hdr *hdr) { return ((hdr->tp_status & TP_STATUS_USER) == TP_STATUS_USER); } static inline void kernel_may_pull_from_rx(struct tpacket2_hdr *hdr) { hdr->tp_status = TP_STATUS_KERNEL; } #ifdef HAVE_TPACKET3 static inline int user_may_pull_from_rx_block(struct block_desc *pbd) { return ((pbd->h1.block_status & TP_STATUS_USER) == TP_STATUS_USER); } static inline void kernel_may_pull_from_rx_block(struct block_desc *pbd) { pbd->h1.block_status = TP_STATUS_KERNEL; } #endif /* HAVE_TPACKET3 */ /* Fanout types. */ #ifndef PACKET_FANOUT_HASH # define PACKET_FANOUT_HASH 0 #endif #ifndef PACKET_FANOUT_LB # define PACKET_FANOUT_LB 1 #endif #ifndef PACKET_FANOUT_CPU # define PACKET_FANOUT_CPU 2 #endif #ifndef PACKET_FANOUT_ROLLOVER # define PACKET_FANOUT_ROLLOVER 3 #endif #ifndef PACKET_FANOUT_RND # define PACKET_FANOUT_RND 4 #endif #ifndef PACKET_FANOUT_QM # define PACKET_FANOUT_QM 5 #endif #ifndef PACKET_FANOUT_FLAG_ROLLOVER # define PACKET_FANOUT_FLAG_ROLLOVER 0x1000 #endif #ifndef PACKET_FANOUT_FLAG_DEFRAG # define PACKET_FANOUT_FLAG_DEFRAG 0x8000 #endif #endif /* RX_RING_H */ 6f'>refslogtreecommitdiff
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@oracle.com>2016-09-15 14:54:41 -0600
committerDavid S. Miller <davem@davemloft.net>2016-09-28 08:24:03 -0700
commitebb99a4c12e4daabe1940ae936e8e7e97ae68c6f (patch)
treee857fbe7a91bb78022da0b9c1abee53ffa06c6df
parent9b2f753ec23710aa32c0d837d2499db92fe9115b (diff)
sparc64: Fix irq stack bootmem allocation.
Currently, irq stack bootmem is allocated for all possible cpus before nr_cpus value changes the list of possible cpus. As a result, there is unnecessary wastage of bootmemory. Move the irq stack bootmem allocation so that it happens after possible cpu list is modified based on nr_cpus value. Signed-off-by: Atish Patra <atish.patra@oracle.com> Reviewed-by: Bob Picco <bob.picco@oracle.com> Reviewed-by: Vijay Kumar <vijay.ac.kumar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>