diff options
| author | David S. Miller <davem@davemloft.net> | 2014-05-23 16:29:04 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-05-23 16:29:04 -0400 |
| commit | 76fcee2438b90e473b67ea52b9b9e0648aa501f8 (patch) | |
| tree | 842991b315c84e51fa4c2ececfba60e2992944b9 /include/linux | |
| parent | 0c3592b821eb4069c8ab3934fc0e78f358d88ae4 (diff) | |
| parent | 6b649feafe10b293f4bd5a74aca95faf625ae525 (diff) | |
Merge branch 'inet_csums_part3'
Tom Herbert says:
====================
net: Checksum offload changes - Part III
I am working on overhauling RX checksum offload. Goals of this effort
are:
- Specify what exactly it means when driver returns CHECKSUM_UNNECESSARY
- Preserve CHECKSUM_COMPLETE through encapsulation layers
- Don't do skb_checksum more than once per packet
- Unify GRO and non-GRO csum verification as much as possible
- Unify the checksum functions (checksum_init)
- Simply code
What is in this third patch set:
- Remove sk_no_check from sunrpc (doesn't seem to have any effect)
- Eliminate no_check from protosw. All protocols are using default of
zero for this
- Split sk_no_check into sk_no_check_tx and sk_no_check_rx
- Make enabling of UDP6 more restrictive and explicit
- Support zero UDP6 checksums in l2tp
V2: Took out vxlan changes to set zero csums in IPv6, this will
be in a later patch set.
V3: Fixed bug in restricting UDP6 checksums.
Please review carefully and test if possible, mucking with basic
checksum functions is always a little precarious :-)
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/udp.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/include/linux/udp.h b/include/linux/udp.h index 42278bbf7a88..247cfdcc4b08 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
| @@ -47,7 +47,9 @@ struct udp_sock { | |||
| 47 | #define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node | 47 | #define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node |
| 48 | int pending; /* Any pending frames ? */ | 48 | int pending; /* Any pending frames ? */ |
| 49 | unsigned int corkflag; /* Cork is required */ | 49 | unsigned int corkflag; /* Cork is required */ |
| 50 | __u16 encap_type; /* Is this an Encapsulation socket? */ | 50 | __u8 encap_type; /* Is this an Encapsulation socket? */ |
| 51 | unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ | ||
| 52 | no_check6_rx:1;/* Allow zero UDP6 checksums on RX? */ | ||
| 51 | /* | 53 | /* |
| 52 | * Following member retains the information to create a UDP header | 54 | * Following member retains the information to create a UDP header |
| 53 | * when the socket is uncorked. | 55 | * when the socket is uncorked. |
| @@ -76,6 +78,26 @@ static inline struct udp_sock *udp_sk(const struct sock *sk) | |||
| 76 | return (struct udp_sock *)sk; | 78 | return (struct udp_sock *)sk; |
| 77 | } | 79 | } |
| 78 | 80 | ||
| 81 | static inline void udp_set_no_check6_tx(struct sock *sk, bool val) | ||
| 82 | { | ||
| 83 | udp_sk(sk)->no_check6_tx = val; | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline void udp_set_no_check6_rx(struct sock *sk, bool val) | ||
| 87 | { | ||
| 88 | udp_sk(sk)->no_check6_rx = val; | ||
| 89 | } | ||
| 90 | |||
| 91 | static inline bool udp_get_no_check6_tx(struct sock *sk) | ||
| 92 | { | ||
| 93 | return udp_sk(sk)->no_check6_tx; | ||
| 94 | } | ||
| 95 | |||
| 96 | static inline bool udp_get_no_check6_rx(struct sock *sk) | ||
| 97 | { | ||
| 98 | return udp_sk(sk)->no_check6_rx; | ||
| 99 | } | ||
| 100 | |||
| 79 | #define udp_portaddr_for_each_entry(__sk, node, list) \ | 101 | #define udp_portaddr_for_each_entry(__sk, node, list) \ |
| 80 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) | 102 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) |
| 81 | 103 | ||
