![Florian Westphal](/assets/img/avatar_default.png)
skb_gso_segment is expensive, so it would be nice if we could avoid it in the future. However, userspace needs to be prepared to receive larger-than-mtu-packets (which will also have incorrect l3/l4 checksums), so we cannot simply remove it. The plan is to add a per-queue feature flag that userspace can set when binding the queue. The problem is that in nf_queue, we only have a queue number, not the queue context/configuration settings. This patch should have no impact other than the skb_gso_segment call now being in a function that has access to the queue config data. A new size attribute in nf_queue_entry is needed so nfnetlink_queue can duplicate the entry of the gso skb when segmenting the skb while also copying the route key. The follow up patch adds switch to disable skb_gso_segment when queue config says so. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
37 lines
979 B
C
37 lines
979 B
C
#ifndef _NF_QUEUE_H
|
|
#define _NF_QUEUE_H
|
|
|
|
/* Each queued (to userspace) skbuff has one of these. */
|
|
struct nf_queue_entry {
|
|
struct list_head list;
|
|
struct sk_buff *skb;
|
|
unsigned int id;
|
|
|
|
struct nf_hook_ops *elem;
|
|
u_int8_t pf;
|
|
u16 size; /* sizeof(entry) + saved route keys */
|
|
unsigned int hook;
|
|
struct net_device *indev;
|
|
struct net_device *outdev;
|
|
int (*okfn)(struct sk_buff *);
|
|
|
|
/* extra space to store route keys */
|
|
};
|
|
|
|
#define nf_queue_entry_reroute(x) ((void *)x + sizeof(struct nf_queue_entry))
|
|
|
|
/* Packet queuing */
|
|
struct nf_queue_handler {
|
|
int (*outfn)(struct nf_queue_entry *entry,
|
|
unsigned int queuenum);
|
|
};
|
|
|
|
void nf_register_queue_handler(const struct nf_queue_handler *qh);
|
|
void nf_unregister_queue_handler(void);
|
|
extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
|
|
|
|
bool nf_queue_entry_get_refs(struct nf_queue_entry *entry);
|
|
void nf_queue_entry_release_refs(struct nf_queue_entry *entry);
|
|
|
|
#endif /* _NF_QUEUE_H */
|