-
Notifications
You must be signed in to change notification settings - Fork 43
/
homa_offload.h
94 lines (81 loc) · 2.8 KB
/
homa_offload.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* SPDX-License-Identifier: BSD-2-Clause */
/* This file contains definitions related to homa_offload.c. */
#ifndef _HOMA_OFFLOAD_H
#define _HOMA_OFFLOAD_H
#include <linux/types.h>
/**
* struct homa_offload_core - Stores core-specific information used during
* GRO operations.
*/
struct homa_offload_core {
/**
* @last_active: the last time (in get_cycle() units) that
* there was system activity, such NAPI or SoftIRQ, on this
* core. Used for load balancing.
*/
__u64 last_active;
/**
* @last_gro: the last time (in get_cycle() units) that
* homa_gro_receive returned on this core. Used to determine
* whether GRO is keeping a core busy.
*/
__u64 last_gro;
/**
* @softirq_backlog: the number of batches of packets that have
* been queued for SoftIRQ processing on this core but haven't
* yet been processed.
*/
atomic_t softirq_backlog;
/**
* @softirq_offset: used when rotating SoftIRQ assignment among
* the next cores; contains an offset to add to the current core
* to produce the core for SoftIRQ.
*/
int softirq_offset;
/**
* @gen3_softirq_cores: when the Gen3 load balancer is in use,
* GRO will arrange for SoftIRQ processing to occur on one of
* these cores; -1 values are ignored (see balance.txt for more
* on lewd balancing). This information is filled in via sysctl.
*/
#define NUM_GEN3_SOFTIRQ_CORES 3
int gen3_softirq_cores[NUM_GEN3_SOFTIRQ_CORES];
/**
* @last_app_active: the most recent time (get_cycles() units)
* when an application was actively using Homa on this core (e.g.,
* by sending or receiving messages). Used for load balancing
* (see balance.txt).
*/
__u64 last_app_active;
/**
* held_skb: last packet buffer known to be available for
* merging other packets into on this core (note: may not still
* be available), or NULL if none.
*/
struct sk_buff *held_skb;
/**
* @held_bucket: the index, within napi->gro_hash, of the list
* containing @held_skb; undefined if @held_skb is NULL. Used to
* verify that @held_skb is still available.
*/
int held_bucket;
};
DECLARE_PER_CPU(struct homa_offload_core, homa_offload_core);
extern int homa_gro_complete(struct sk_buff *skb, int thoff);
extern void homa_gro_gen2(struct sk_buff *skb);
extern void homa_gro_gen3(struct sk_buff *skb);
extern void homa_gro_hook_tcp(void);
extern void homa_gro_unhook_tcp(void);
extern struct sk_buff
*homa_gro_receive(struct list_head *gro_list,
struct sk_buff *skb);
extern struct sk_buff
*homa_gso_segment(struct sk_buff *skb,
netdev_features_t features);
extern int homa_offload_end(void);
extern int homa_offload_init(void);
extern void homa_send_ipis(void);
extern struct sk_buff
*homa_tcp_gro_receive(struct list_head *held_list,
struct sk_buff *skb);
#endif /* _HOMA_OFFLOAD_H */