Skip to content

Commit db8dac2

Browse files
committed
[UDP]: Revert udplite and code split.
This reverts commit db1ed68 ("[IPV6] UDP: Rename IPv6 UDP files."), commit 8be8af8 ("[IPV4] UDP: Move IPv4-specific bits to other file.") and commit e898d4d ("[UDP]: Allow users to configure UDP-Lite."). First, udplite is of such small cost, and it is a core protocol just like TCP and normal UDP are. We spent enormous amounts of effort to make udplite share as much code with core UDP as possible. All of that work is less valuable if we're just going to slap a config option on udplite support. It is also causing build failures, as reported on linux-next, showing that the changeset was not tested very well. In fact, this is the second build failure resulting from the udplite change. Finally, the config options provided was a bool, instead of a modular option. Meaning the udplite code does not even get build tested by allmodconfig builds, and furthermore the user is not presented with a reasonable modular build option which is particularly needed by distribution vendors. Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ba0fa45 commit db8dac2

17 files changed

Lines changed: 1101 additions & 1222 deletions

File tree

‎include/linux/udp.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ struct udp_sock {
7070
#define UDPLITE_BIT 0x1 /* set by udplite proto init function */
7171
#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */
7272
#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */
73-
#ifdef CONFIG_IP_UDPLITE
7473
__u8 pcflag; /* marks socket as UDP-Lite if > 0 */
7574
__u8 unused[3];
76-
#endif
7775
/*
7876
* For encapsulation sockets.
7977
*/
@@ -85,15 +83,7 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
8583
return (struct udp_sock *)sk;
8684
}
8785

88-
#ifdef CONFIG_IP_UDPLITE
8986
#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
90-
#define IS_PROTO_UDPLITE(__proto) ((__proto) == IPPROTO_UDPLITE)
91-
#define IS_SOL_UDPFAMILY(level) ((level) == SOL_UDP || (level) == SOL_UDPLITE)
92-
#else
93-
#define IS_UDPLITE(__sk) 0
94-
#define IS_PROTO_UDPLITE(__proto) 0
95-
#define IS_SOL_UDPFAMILY(level) ((level) == SOL_UDP)
96-
#endif
9787

9888
#endif
9989

‎include/net/ipv6.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,8 @@ extern int tcp6_proc_init(void);
599599
extern void tcp6_proc_exit(void);
600600
extern int udp6_proc_init(void);
601601
extern void udp6_proc_exit(void);
602-
#ifdef CONFIG_IP_UDPLITE
603602
extern int udplite6_proc_init(void);
604603
extern void udplite6_proc_exit(void);
605-
#else
606-
static inline int udplite6_proc_init(void) { return 0; }
607-
static inline void udplite6_proc_exit(void) { }
608-
#endif
609604
extern int ipv6_misc_proc_init(void);
610605
extern void ipv6_misc_proc_exit(void);
611606
extern int snmp6_register_dev(struct inet6_dev *idev);

‎include/net/transp_v6.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,8 @@ extern int rawv6_init(void);
2727
extern void rawv6_exit(void);
2828
extern int udpv6_init(void);
2929
extern void udpv6_exit(void);
30-
#ifdef CONFIG_IP_UDPLITE
3130
extern int udplitev6_init(void);
3231
extern void udplitev6_exit(void);
33-
#else
34-
static inline int udplitev6_init(void) { return 0; }
35-
static inline void udplitev6_exit(void) { }
36-
#endif
3732
extern int tcpv6_init(void);
3833
extern void tcpv6_exit(void);
3934

‎include/net/udplite.h‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ static __inline__ int udplite_getfrag(void *from, char *to, int offset,
2525
/* Designate sk as UDP-Lite socket */
2626
static inline int udplite_sk_init(struct sock *sk)
2727
{
28-
#ifdef CONFIG_IP_UDPLITE
2928
udp_sk(sk)->pcflag = UDPLITE_BIT;
30-
#endif
3129
return 0;
3230
}
3331

@@ -71,7 +69,7 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
7169
static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh)
7270
{
7371
int cscov = up->len;
74-
#ifdef CONFIG_IP_UDPLITE
72+
7573
/*
7674
* Sender has set `partial coverage' option on UDP-Lite socket
7775
*/
@@ -95,15 +93,13 @@ static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh)
9593
* illegal, we fall back to the defaults here.
9694
*/
9795
}
98-
#endif
9996
return cscov;
10097
}
10198

10299
static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
103100
{
104-
__wsum csum = 0;
105-
#ifdef CONFIG_IP_UDPLITE
106101
int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
102+
__wsum csum = 0;
107103

108104
skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
109105

@@ -116,7 +112,6 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
116112
if ((cscov -= len) <= 0)
117113
break;
118114
}
119-
#endif
120115
return csum;
121116
}
122117

‎net/ipv4/Kconfig‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -632,15 +632,5 @@ config TCP_MD5SIG
632632

633633
If unsure, say N.
634634

635-
config IP_UDPLITE
636-
bool "IP: UDP-Lite Protocol (RFC 3828)"
637-
default n
638-
---help---
639-
UDP-Lite (RFC 3828) is a UDP-like protocol with variable-length
640-
checksum. Read <file:Documentation/networking/udplite.txt> for
641-
details.
642-
643-
If unsure, say N.
644-
645635
source "net/ipv4/ipvs/Kconfig"
646636

‎net/ipv4/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ obj-y := route.o inetpeer.o protocol.o \
88
inet_timewait_sock.o inet_connection_sock.o \
99
tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \
1010
tcp_minisocks.o tcp_cong.o \
11-
datagram.o raw.o udp.o udp_ipv4.o \
11+
datagram.o raw.o udp.o udplite.o \
1212
arp.o icmp.o devinet.o af_inet.o igmp.o \
1313
fib_frontend.o fib_semantics.o \
1414
inet_fragment.o
@@ -49,7 +49,6 @@ obj-$(CONFIG_TCP_CONG_SCALABLE) += tcp_scalable.o
4949
obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o
5050
obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o
5151
obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o
52-
obj-$(CONFIG_IP_UDPLITE) += udplite_ipv4.o
5352
obj-$(CONFIG_NETLABEL) += cipso_ipv4.o
5453

5554
obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \

‎net/ipv4/af_inet.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,18 +1317,15 @@ static int __init init_ipv4_mibs(void)
13171317
if (snmp_mib_init((void **)udp_statistics,
13181318
sizeof(struct udp_mib)) < 0)
13191319
goto err_udp_mib;
1320-
#ifdef CONFIG_IP_UDPLITE
13211320
if (snmp_mib_init((void **)udplite_statistics,
13221321
sizeof(struct udp_mib)) < 0)
13231322
goto err_udplite_mib;
1324-
#endif
1323+
13251324
tcp_mib_init();
13261325

13271326
return 0;
13281327

1329-
#ifdef CONFIG_IP_UDPLITE
13301328
err_udplite_mib:
1331-
#endif
13321329
snmp_mib_free((void **)udp_statistics);
13331330
err_udp_mib:
13341331
snmp_mib_free((void **)tcp_statistics);
@@ -1426,10 +1423,8 @@ static int __init inet_init(void)
14261423
/* Setup UDP memory threshold */
14271424
udp_init();
14281425

1429-
#ifdef CONFIG_IP_UDPLITE
14301426
/* Add UDP-Lite (RFC 3828) */
14311427
udplite4_register();
1432-
#endif
14331428

14341429
/*
14351430
* Set the ICMP layer up

‎net/ipv4/proc.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ static int sockstat_seq_show(struct seq_file *seq, void *v)
5959
atomic_read(&tcp_memory_allocated));
6060
seq_printf(seq, "UDP: inuse %d mem %d\n", sock_prot_inuse_get(&udp_prot),
6161
atomic_read(&udp_memory_allocated));
62-
#ifdef CONFIG_IP_UDPLITE
6362
seq_printf(seq, "UDPLITE: inuse %d\n", sock_prot_inuse_get(&udplite_prot));
64-
#endif
6563
seq_printf(seq, "RAW: inuse %d\n", sock_prot_inuse_get(&raw_prot));
6664
seq_printf(seq, "FRAG: inuse %d memory %d\n",
6765
ip_frag_nqueues(&init_net), ip_frag_mem(&init_net));
@@ -351,7 +349,6 @@ static int snmp_seq_show(struct seq_file *seq, void *v)
351349
snmp_fold_field((void **)udp_statistics,
352350
snmp4_udp_list[i].entry));
353351

354-
#ifdef CONFIG_IP_UDPLITE
355352
/* the UDP and UDP-Lite MIBs are the same */
356353
seq_puts(seq, "\nUdpLite:");
357354
for (i = 0; snmp4_udp_list[i].name != NULL; i++)
@@ -362,7 +359,7 @@ static int snmp_seq_show(struct seq_file *seq, void *v)
362359
seq_printf(seq, " %lu",
363360
snmp_fold_field((void **)udplite_statistics,
364361
snmp4_udp_list[i].entry));
365-
#endif
362+
366363
seq_putc(seq, '\n');
367364
return 0;
368365
}

0 commit comments

Comments
 (0)