aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/device-mapper.h5
-rw-r--r--include/net/ip_vs.h1
-rw-r--r--include/net/udplite.h63
3 files changed, 37 insertions, 32 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 3fa1f3d90ce0..99e3e50b5c57 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -197,6 +197,11 @@ struct dm_target {
197 * whether or not its underlying devices have support. 197 * whether or not its underlying devices have support.
198 */ 198 */
199 unsigned discards_supported:1; 199 unsigned discards_supported:1;
200
201 /*
202 * Set if this target does not return zeroes on discarded blocks.
203 */
204 unsigned discard_zeroes_data_unsupported:1;
200}; 205};
201 206
202/* Each target can link one of these into the table */ 207/* Each target can link one of these into the table */
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 1aaf915656f3..8fa4430f99c1 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -900,6 +900,7 @@ struct netns_ipvs {
900 volatile int sync_state; 900 volatile int sync_state;
901 volatile int master_syncid; 901 volatile int master_syncid;
902 volatile int backup_syncid; 902 volatile int backup_syncid;
903 struct mutex sync_mutex;
903 /* multicast interface name */ 904 /* multicast interface name */
904 char master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; 905 char master_mcast_ifn[IP_VS_IFNAME_MAXLEN];
905 char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; 906 char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN];
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 673a024c6b2a..5f097ca7d5c5 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -66,40 +66,34 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
66 return 0; 66 return 0;
67} 67}
68 68
69static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) 69/* Slow-path computation of checksum. Socket is locked. */
70static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
70{ 71{
72 const struct udp_sock *up = udp_sk(skb->sk);
71 int cscov = up->len; 73 int cscov = up->len;
74 __wsum csum = 0;
72 75
73 /* 76 if (up->pcflag & UDPLITE_SEND_CC) {
74 * Sender has set `partial coverage' option on UDP-Lite socket 77 /*
75 */ 78 * Sender has set `partial coverage' option on UDP-Lite socket.
76 if (up->pcflag & UDPLITE_SEND_CC) { 79 * The special case "up->pcslen == 0" signifies full coverage.
80 */
77 if (up->pcslen < up->len) { 81 if (up->pcslen < up->len) {
78 /* up->pcslen == 0 means that full coverage is required, 82 if (0 < up->pcslen)
79 * partial coverage only if 0 < up->pcslen < up->len */ 83 cscov = up->pcslen;
80 if (0 < up->pcslen) { 84 udp_hdr(skb)->len = htons(up->pcslen);
81 cscov = up->pcslen;
82 }
83 uh->len = htons(up->pcslen);
84 } 85 }
85 /* 86 /*
86 * NOTE: Causes for the error case `up->pcslen > up->len': 87 * NOTE: Causes for the error case `up->pcslen > up->len':
87 * (i) Application error (will not be penalized). 88 * (i) Application error (will not be penalized).
88 * (ii) Payload too big for send buffer: data is split 89 * (ii) Payload too big for send buffer: data is split
89 * into several packets, each with its own header. 90 * into several packets, each with its own header.
90 * In this case (e.g. last segment), coverage may 91 * In this case (e.g. last segment), coverage may
91 * exceed packet length. 92 * exceed packet length.
92 * Since packets with coverage length > packet length are 93 * Since packets with coverage length > packet length are
93 * illegal, we fall back to the defaults here. 94 * illegal, we fall back to the defaults here.
94 */ 95 */
95 } 96 }
96 return cscov;
97}
98
99static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
100{
101 int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
102 __wsum csum = 0;
103 97
104 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ 98 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
105 99
@@ -115,16 +109,21 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
115 return csum; 109 return csum;
116} 110}
117 111
112/* Fast-path computation of checksum. Socket may not be locked. */
118static inline __wsum udplite_csum(struct sk_buff *skb) 113static inline __wsum udplite_csum(struct sk_buff *skb)
119{ 114{
120 struct sock *sk = skb->sk; 115 const struct udp_sock *up = udp_sk(skb->sk);
121 int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
122 const int off = skb_transport_offset(skb); 116 const int off = skb_transport_offset(skb);
123 const int len = skb->len - off; 117 int len = skb->len - off;
124 118
119 if ((up->pcflag & UDPLITE_SEND_CC) && up->pcslen < len) {
120 if (0 < up->pcslen)
121 len = up->pcslen;
122 udp_hdr(skb)->len = htons(up->pcslen);
123 }
125 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ 124 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
126 125
127 return skb_checksum(skb, off, min(cscov, len), 0); 126 return skb_checksum(skb, off, len, 0);
128} 127}
129 128
130extern void udplite4_register(void); 129extern void udplite4_register(void);