Skip to content

Commit 410e27a

Browse files
author
Gerrit Renker
committed
This reverts "Merge branch 'dccp' of git://eden-feed.erg.abdn.ac.uk/dccp_exp"
as it accentally contained the wrong set of patches. These will be submitted separately. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
1 parent 0a68a20 commit 410e27a

36 files changed

Lines changed: 2884 additions & 3971 deletions

‎Documentation/networking/dccp.txt‎

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,6 @@ http://linux-net.osdl.org/index.php/DCCP_Testing#Experimental_DCCP_source_tree
4545

4646
Socket options
4747
==============
48-
DCCP_SOCKOPT_QPOLICY_ID sets the dequeuing policy for outgoing packets. It takes
49-
a policy ID as argument and can only be set before the connection (i.e. changes
50-
during an established connection are not supported). Currently, two policies are
51-
defined: the "simple" policy (DCCPQ_POLICY_SIMPLE), which does nothing special,
52-
and a priority-based variant (DCCPQ_POLICY_PRIO). The latter allows to pass an
53-
u32 priority value as ancillary data to sendmsg(), where higher numbers indicate
54-
a higher packet priority (similar to SO_PRIORITY). This ancillary data needs to
55-
be formatted using a cmsg(3) message header filled in as follows:
56-
cmsg->cmsg_level = SOL_DCCP;
57-
cmsg->cmsg_type = DCCP_SCM_PRIORITY;
58-
cmsg->cmsg_len = CMSG_LEN(sizeof(uint32_t)); /* or CMSG_LEN(4) */
59-
60-
DCCP_SOCKOPT_QPOLICY_TXQLEN sets the maximum length of the output queue. A zero
61-
value is always interpreted as unbounded queue length. If different from zero,
62-
the interpretation of this parameter depends on the current dequeuing policy
63-
(see above): the "simple" policy will enforce a fixed queue size by returning
64-
EAGAIN, whereas the "prio" policy enforces a fixed queue length by dropping the
65-
lowest-priority packet first. The default value for this parameter is
66-
initialised from /proc/sys/net/dccp/default/tx_qlen.
6748

6849
DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of
6950
service codes (RFC 4340, sec. 8.1.2); if this socket option is not set,
@@ -76,24 +57,6 @@ can be set before calling bind().
7657
DCCP_SOCKOPT_GET_CUR_MPS is read-only and retrieves the current maximum packet
7758
size (application payload size) in bytes, see RFC 4340, section 14.
7859

79-
DCCP_SOCKOPT_AVAILABLE_CCIDS is also read-only and returns the list of CCIDs
80-
supported by the endpoint (see include/linux/dccp.h for symbolic constants).
81-
The caller needs to provide a sufficiently large (> 2) array of type uint8_t.
82-
83-
DCCP_SOCKOPT_CCID is write-only and sets both the TX and RX CCIDs at the same
84-
time, combining the operation of the next two socket options. This option is
85-
preferrable over the latter two, since often applications will use the same
86-
type of CCID for both directions; and mixed use of CCIDs is not currently well
87-
understood. This socket option takes as argument at least one uint8_t value, or
88-
an array of uint8_t values, which must match available CCIDS (see above). CCIDs
89-
must be registered on the socket before calling connect() or listen().
90-
91-
DCCP_SOCKOPT_TX_CCID is read/write. It returns the current CCID (if set) or sets
92-
the preference list for the TX CCID, using the same format as DCCP_SOCKOPT_CCID.
93-
Please note that the getsockopt argument type here is `int', not uint8_t.
94-
95-
DCCP_SOCKOPT_RX_CCID is analogous to DCCP_SOCKOPT_TX_CCID, but for the RX CCID.
96-
9760
DCCP_SOCKOPT_SERVER_TIMEWAIT enables the server (listening socket) to hold
9861
timewait state when closing the connection (RFC 4340, 8.3). The usual case is
9962
that the closing server sends a CloseReq, whereupon the client holds timewait
@@ -152,16 +115,23 @@ retries2
152115
importance for retransmitted acknowledgments and feature negotiation,
153116
data packets are never retransmitted. Analogue of tcp_retries2.
154117

118+
send_ndp = 1
119+
Whether or not to send NDP count options (sec. 7.7.2).
120+
121+
send_ackvec = 1
122+
Whether or not to send Ack Vector options (sec. 11.5).
123+
124+
ack_ratio = 2
125+
The default Ack Ratio (sec. 11.3) to use.
126+
155127
tx_ccid = 2
156-
Default CCID for the sender-receiver half-connection. Depending on the
157-
choice of CCID, the Send Ack Vector feature is enabled automatically.
128+
Default CCID for the sender-receiver half-connection.
158129

159130
rx_ccid = 2
160-
Default CCID for the receiver-sender half-connection; see tx_ccid.
131+
Default CCID for the receiver-sender half-connection.
161132

162133
seq_window = 100
163-
The initial sequence window (sec. 7.5.2) of the sender. This influences
164-
the local ackno validity and the remote seqno validity windows (7.5.1).
134+
The initial sequence window (sec. 7.5.2).
165135

166136
tx_qlen = 5
167137
The size of the transmit buffer in packets. A value of 0 corresponds

‎include/linux/dccp.h‎

Lines changed: 71 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,9 @@ enum {
165165
DCCPO_TIMESTAMP_ECHO = 42,
166166
DCCPO_ELAPSED_TIME = 43,
167167
DCCPO_MAX = 45,
168-
DCCPO_MIN_RX_CCID_SPECIFIC = 128, /* from sender to receiver */
169-
DCCPO_MAX_RX_CCID_SPECIFIC = 191,
170-
DCCPO_MIN_TX_CCID_SPECIFIC = 192, /* from receiver to sender */
171-
DCCPO_MAX_TX_CCID_SPECIFIC = 255,
168+
DCCPO_MIN_CCID_SPECIFIC = 128,
169+
DCCPO_MAX_CCID_SPECIFIC = 255,
172170
};
173-
/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
174-
#define DCCP_SINGLE_OPT_MAXLEN 253
175171

176172
/* DCCP CCIDS */
177173
enum {
@@ -180,36 +176,27 @@ enum {
180176
};
181177

182178
/* DCCP features (RFC 4340 section 6.4) */
183-
enum dccp_feature_numbers {
179+
enum {
184180
DCCPF_RESERVED = 0,
185181
DCCPF_CCID = 1,
186-
DCCPF_SHORT_SEQNOS = 2,
182+
DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */
187183
DCCPF_SEQUENCE_WINDOW = 3,
188-
DCCPF_ECN_INCAPABLE = 4,
184+
DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */
189185
DCCPF_ACK_RATIO = 5,
190186
DCCPF_SEND_ACK_VECTOR = 6,
191187
DCCPF_SEND_NDP_COUNT = 7,
192188
DCCPF_MIN_CSUM_COVER = 8,
193-
DCCPF_DATA_CHECKSUM = 9,
189+
DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */
194190
/* 10-127 reserved */
195191
DCCPF_MIN_CCID_SPECIFIC = 128,
196-
DCCPF_SEND_LEV_RATE = 192, /* RFC 4342, sec. 8.4 */
197192
DCCPF_MAX_CCID_SPECIFIC = 255,
198193
};
199194

200-
/* DCCP socket control message types for cmsg */
201-
enum dccp_cmsg_type {
202-
DCCP_SCM_PRIORITY = 1,
203-
DCCP_SCM_QPOLICY_MAX = 0xFFFF,
204-
/* ^-- Up to here reserved exclusively for qpolicy parameters */
205-
DCCP_SCM_MAX
206-
};
207-
208-
/* DCCP priorities for outgoing/queued packets */
209-
enum dccp_packet_dequeueing_policy {
210-
DCCPQ_POLICY_SIMPLE,
211-
DCCPQ_POLICY_PRIO,
212-
DCCPQ_POLICY_MAX
195+
/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */
196+
struct dccp_so_feat {
197+
__u8 dccpsf_feat;
198+
__u8 __user *dccpsf_val;
199+
__u8 dccpsf_len;
213200
};
214201

215202
/* DCCP socket options */
@@ -221,12 +208,6 @@ enum dccp_packet_dequeueing_policy {
221208
#define DCCP_SOCKOPT_SERVER_TIMEWAIT 6
222209
#define DCCP_SOCKOPT_SEND_CSCOV 10
223210
#define DCCP_SOCKOPT_RECV_CSCOV 11
224-
#define DCCP_SOCKOPT_AVAILABLE_CCIDS 12
225-
#define DCCP_SOCKOPT_CCID 13
226-
#define DCCP_SOCKOPT_TX_CCID 14
227-
#define DCCP_SOCKOPT_RX_CCID 15
228-
#define DCCP_SOCKOPT_QPOLICY_ID 16
229-
#define DCCP_SOCKOPT_QPOLICY_TXQLEN 17
230211
#define DCCP_SOCKOPT_CCID_RX_INFO 128
231212
#define DCCP_SOCKOPT_CCID_TX_INFO 192
232213

@@ -374,13 +355,62 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
374355
return __dccp_hdr_len(dccp_hdr(skb));
375356
}
376357

358+
359+
/* initial values for each feature */
360+
#define DCCPF_INITIAL_SEQUENCE_WINDOW 100
361+
#define DCCPF_INITIAL_ACK_RATIO 2
362+
#define DCCPF_INITIAL_CCID DCCPC_CCID2
363+
#define DCCPF_INITIAL_SEND_ACK_VECTOR 1
364+
/* FIXME: for now we're default to 1 but it should really be 0 */
365+
#define DCCPF_INITIAL_SEND_NDP_COUNT 1
366+
367+
/**
368+
* struct dccp_minisock - Minimal DCCP connection representation
369+
*
370+
* Will be used to pass the state from dccp_request_sock to dccp_sock.
371+
*
372+
* @dccpms_sequence_window - Sequence Window Feature (section 7.5.2)
373+
* @dccpms_ccid - Congestion Control Id (CCID) (section 10)
374+
* @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5)
375+
* @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2)
376+
* @dccpms_ack_ratio - Ack Ratio Feature (section 11.3)
377+
* @dccpms_pending - List of features being negotiated
378+
* @dccpms_conf -
379+
*/
380+
struct dccp_minisock {
381+
__u64 dccpms_sequence_window;
382+
__u8 dccpms_rx_ccid;
383+
__u8 dccpms_tx_ccid;
384+
__u8 dccpms_send_ack_vector;
385+
__u8 dccpms_send_ndp_count;
386+
__u8 dccpms_ack_ratio;
387+
struct list_head dccpms_pending;
388+
struct list_head dccpms_conf;
389+
};
390+
391+
struct dccp_opt_conf {
392+
__u8 *dccpoc_val;
393+
__u8 dccpoc_len;
394+
};
395+
396+
struct dccp_opt_pend {
397+
struct list_head dccpop_node;
398+
__u8 dccpop_type;
399+
__u8 dccpop_feat;
400+
__u8 *dccpop_val;
401+
__u8 dccpop_len;
402+
int dccpop_conf;
403+
struct dccp_opt_conf *dccpop_sc;
404+
};
405+
406+
extern void dccp_minisock_init(struct dccp_minisock *dmsk);
407+
377408
/**
378409
* struct dccp_request_sock - represent DCCP-specific connection request
379410
* @dreq_inet_rsk: structure inherited from
380411
* @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1)
381412
* @dreq_isr: initial sequence number received on the Request
382413
* @dreq_service: service code present on the Request (there is just one)
383-
* @dreq_featneg: feature negotiation options for this connection
384414
* The following two fields are analogous to the ones in dccp_sock:
385415
* @dreq_timestamp_echo: last received timestamp to echo (13.1)
386416
* @dreq_timestamp_echo: the time of receiving the last @dreq_timestamp_echo
@@ -390,7 +420,6 @@ struct dccp_request_sock {
390420
__u64 dreq_iss;
391421
__u64 dreq_isr;
392422
__be32 dreq_service;
393-
struct list_head dreq_featneg;
394423
__u32 dreq_timestamp_echo;
395424
__u32 dreq_timestamp_time;
396425
};
@@ -462,28 +491,21 @@ struct dccp_ackvec;
462491
* @dccps_timestamp_time - time of receiving latest @dccps_timestamp_echo
463492
* @dccps_l_ack_ratio - feature-local Ack Ratio
464493
* @dccps_r_ack_ratio - feature-remote Ack Ratio
465-
* @dccps_l_seq_win - local Sequence Window (influences ack number validity)
466-
* @dccps_r_seq_win - remote Sequence Window (influences seq number validity)
467494
* @dccps_pcslen - sender partial checksum coverage (via sockopt)
468495
* @dccps_pcrlen - receiver partial checksum coverage (via sockopt)
469-
* @dccps_send_ndp_count - local Send NDP Count feature (7.7.2)
470496
* @dccps_ndp_count - number of Non Data Packets since last data packet
471497
* @dccps_mss_cache - current value of MSS (path MTU minus header sizes)
472498
* @dccps_rate_last - timestamp for rate-limiting DCCP-Sync (RFC 4340, 7.5.4)
473-
* @dccps_featneg - tracks feature-negotiation state (mostly during handshake)
499+
* @dccps_minisock - associated minisock (accessed via dccp_msk)
474500
* @dccps_hc_rx_ackvec - rx half connection ack vector
475501
* @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection)
476502
* @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection)
477503
* @dccps_options_received - parsed set of retrieved options
478-
* @dccps_qpolicy - TX dequeueing policy, one of %dccp_packet_dequeueing_policy
479-
* @dccps_tx_qlen - maximum length of the TX queue
480504
* @dccps_role - role of this sock, one of %dccp_role
481505
* @dccps_hc_rx_insert_options - receiver wants to add options when acking
482506
* @dccps_hc_tx_insert_options - sender wants to add options when sending
483507
* @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3)
484-
* @dccps_sync_scheduled - flag which signals "send out-of-band message soon"
485-
* @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets
486-
* @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing)
508+
* @dccps_xmit_timer - timer for when CCID is not ready to send
487509
* @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs)
488510
*/
489511
struct dccp_sock {
@@ -507,26 +529,19 @@ struct dccp_sock {
507529
__u32 dccps_timestamp_time;
508530
__u16 dccps_l_ack_ratio;
509531
__u16 dccps_r_ack_ratio;
510-
__u64 dccps_l_seq_win:48;
511-
__u64 dccps_r_seq_win:48;
512-
__u8 dccps_pcslen:4;
513-
__u8 dccps_pcrlen:4;
514-
__u8 dccps_send_ndp_count:1;
532+
__u16 dccps_pcslen;
533+
__u16 dccps_pcrlen;
515534
__u64 dccps_ndp_count:48;
516535
unsigned long dccps_rate_last;
517-
struct list_head dccps_featneg;
536+
struct dccp_minisock dccps_minisock;
518537
struct dccp_ackvec *dccps_hc_rx_ackvec;
519538
struct ccid *dccps_hc_rx_ccid;
520539
struct ccid *dccps_hc_tx_ccid;
521540
struct dccp_options_received dccps_options_received;
522-
__u8 dccps_qpolicy;
523-
__u32 dccps_tx_qlen;
524541
enum dccp_role dccps_role:2;
525542
__u8 dccps_hc_rx_insert_options:1;
526543
__u8 dccps_hc_tx_insert_options:1;
527544
__u8 dccps_server_timewait:1;
528-
__u8 dccps_sync_scheduled:1;
529-
struct tasklet_struct dccps_xmitlet;
530545
struct timer_list dccps_xmit_timer;
531546
};
532547

@@ -535,6 +550,11 @@ static inline struct dccp_sock *dccp_sk(const struct sock *sk)
535550
return (struct dccp_sock *)sk;
536551
}
537552

553+
static inline struct dccp_minisock *dccp_msk(const struct sock *sk)
554+
{
555+
return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock;
556+
}
557+
538558
static inline const char *dccp_role(const struct sock *sk)
539559
{
540560
switch (dccp_sk(sk)->dccps_role) {

‎include/net/tcp.h‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -782,21 +782,6 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk)
782782
/* Use define here intentionally to get WARN_ON location shown at the caller */
783783
#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out)
784784

785-
/*
786-
* Convert RFC3390 larger initial windows into an equivalent number of packets.
787-
*
788-
* John Heffner states:
789-
*
790-
* The RFC specifies a window of no more than 4380 bytes
791-
* unless 2*MSS > 4380. Reading the pseudocode in the RFC
792-
* is a bit misleading because they use a clamp at 4380 bytes
793-
* rather than a multiplier in the relevant range.
794-
*/
795-
static inline u32 rfc3390_bytes_to_packets(const u32 bytes)
796-
{
797-
return bytes <= 1095 ? 4 : (bytes > 1460 ? 2 : 3);
798-
}
799-
800785
extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
801786
extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst);
802787

‎net/dccp/Kconfig‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ config INET_DCCP_DIAG
2525
def_tristate y if (IP_DCCP = y && INET_DIAG = y)
2626
def_tristate m
2727

28+
config IP_DCCP_ACKVEC
29+
bool
30+
2831
source "net/dccp/ccids/Kconfig"
2932

3033
menu "DCCP Kernel Hacking"

‎net/dccp/Makefile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
obj-$(CONFIG_IP_DCCP) += dccp.o dccp_ipv4.o
22

3-
dccp-y := ccid.o feat.o input.o minisocks.o options.o \
4-
qpolicy.o output.o proto.o timer.o ackvec.o
3+
dccp-y := ccid.o feat.o input.o minisocks.o options.o output.o proto.o timer.o
54

65
dccp_ipv4-y := ipv4.o
76

87
# build dccp_ipv6 as module whenever either IPv6 or DCCP is a module
98
obj-$(subst y,$(CONFIG_IP_DCCP),$(CONFIG_IPV6)) += dccp_ipv6.o
109
dccp_ipv6-y := ipv6.o
1110

11+
dccp-$(CONFIG_IP_DCCP_ACKVEC) += ackvec.o
12+
1213
obj-$(CONFIG_INET_DCCP_DIAG) += dccp_diag.o
1314
obj-$(CONFIG_NET_DCCPPROBE) += dccp_probe.o
1415

0 commit comments

Comments
 (0)