mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-15 12:46:41 +07:00
648700f76b
Some applications still rely on IP fragmentation, and to be fair linux reassembly unit is not working under any serious load. It uses static hash tables of 1024 buckets, and up to 128 items per bucket (!!!) A work queue is supposed to garbage collect items when host is under memory pressure, and doing a hash rebuild, changing seed used in hash computations. This work queue blocks softirqs for up to 25 ms when doing a hash rebuild, occurring every 5 seconds if host is under fire. Then there is the problem of sharing this hash table for all netns. It is time to switch to rhashtables, and allocate one of them per netns to speedup netns dismantle, since this is a critical metric these days. Lookup is now using RCU. A followup patch will even remove the refcount hold/release left from prior implementation and save a couple of atomic operations. Before this patch, 16 cpus (16 RX queue NIC) could not handle more than 1 Mpps frags DDOS. After the patch, I reach 9 Mpps without any tuning, and can use up to 2GB of storage for the fragments (exact number depends on frags being evicted after timeout) $ grep FRAG /proc/net/sockstat FRAG: inuse 1966916 memory 2140004608 A followup patch will change the limits for 64bit arches. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Kirill Tkhai <ktkhai@virtuozzo.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Florian Westphal <fw@strlen.de> Cc: Jesper Dangaard Brouer <brouer@redhat.com> Cc: Alexander Aring <alex.aring@gmail.com> Cc: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
49 lines
1.3 KiB
C
49 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __IEEE802154_6LOWPAN_I_H__
|
|
#define __IEEE802154_6LOWPAN_I_H__
|
|
|
|
#include <linux/list.h>
|
|
|
|
#include <net/ieee802154_netdev.h>
|
|
#include <net/inet_frag.h>
|
|
#include <net/6lowpan.h>
|
|
|
|
typedef unsigned __bitwise lowpan_rx_result;
|
|
#define RX_CONTINUE ((__force lowpan_rx_result) 0u)
|
|
#define RX_DROP_UNUSABLE ((__force lowpan_rx_result) 1u)
|
|
#define RX_DROP ((__force lowpan_rx_result) 2u)
|
|
#define RX_QUEUED ((__force lowpan_rx_result) 3u)
|
|
|
|
#define LOWPAN_DISPATCH_FRAG1 0xc0
|
|
#define LOWPAN_DISPATCH_FRAGN 0xe0
|
|
|
|
struct frag_lowpan_compare_key {
|
|
u16 tag;
|
|
u16 d_size;
|
|
const struct ieee802154_addr src;
|
|
const struct ieee802154_addr dst;
|
|
};
|
|
|
|
/* Equivalent of ipv4 struct ipq
|
|
*/
|
|
struct lowpan_frag_queue {
|
|
struct inet_frag_queue q;
|
|
};
|
|
|
|
int lowpan_frag_rcv(struct sk_buff *skb, const u8 frag_type);
|
|
void lowpan_net_frag_exit(void);
|
|
int lowpan_net_frag_init(void);
|
|
|
|
void lowpan_rx_init(void);
|
|
void lowpan_rx_exit(void);
|
|
|
|
int lowpan_header_create(struct sk_buff *skb, struct net_device *dev,
|
|
unsigned short type, const void *_daddr,
|
|
const void *_saddr, unsigned int len);
|
|
netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *dev);
|
|
|
|
int lowpan_iphc_decompress(struct sk_buff *skb);
|
|
lowpan_rx_result lowpan_rx_h_ipv6(struct sk_buff *skb);
|
|
|
|
#endif /* __IEEE802154_6LOWPAN_I_H__ */
|