Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78457
b: refs/heads/master
c: 6179983
h: refs/heads/master
i:
  78455: 58a3b0b
v: v3
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Jan 28, 2008
1 parent d30f2ac commit c4f8f86
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 84a97b0af8c29aa5a47cc5271968a9c6004fb91e
refs/heads/master: 6179983ad30c43313e153b35af52bd9ebd7745c3
2 changes: 2 additions & 0 deletions trunk/net/dccp/ccid.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct tcp_info;
* struct ccid_operations - Interface to Congestion-Control Infrastructure
*
* @ccid_id: numerical CCID ID (up to %CCID_MAX, cf. table 5 in RFC 4340, 10.)
* @ccid_ccmps: the CCMPS including network/transport headers (0 when disabled)
* @ccid_name: alphabetical identifier string for @ccid_id
* @ccid_owner: module which implements/owns this CCID
* @ccid_hc_{r,t}x_slab: memory pool for the receiver/sender half-connection
Expand All @@ -45,6 +46,7 @@ struct tcp_info;
*/
struct ccid_operations {
unsigned char ccid_id;
__u32 ccid_ccmps;
const char *ccid_name;
struct module *ccid_owner;
struct kmem_cache *ccid_hc_rx_slab,
Expand Down
30 changes: 23 additions & 7 deletions trunk/net/dccp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,31 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
return -ENOBUFS;
}

/**
* dccp_determine_ccmps - Find out about CCID-specfic packet-size limits
* We only consider the HC-sender CCID for setting the CCMPS (RFC 4340, 14.),
* since the RX CCID is restricted to feedback packets (Acks), which are small
* in comparison with the data traffic. A value of 0 means "no current CCMPS".
*/
static u32 dccp_determine_ccmps(const struct dccp_sock *dp)
{
const struct ccid *tx_ccid = dp->dccps_hc_tx_ccid;

if (tx_ccid == NULL || tx_ccid->ccid_ops == NULL)
return 0;
return tx_ccid->ccid_ops->ccid_ccmps;
}

unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
{
struct inet_connection_sock *icsk = inet_csk(sk);
struct dccp_sock *dp = dccp_sk(sk);
int mss_now = (pmtu - icsk->icsk_af_ops->net_header_len -
sizeof(struct dccp_hdr) - sizeof(struct dccp_hdr_ext));
u32 ccmps = dccp_determine_ccmps(dp);
int cur_mps = ccmps ? min(pmtu, ccmps) : pmtu;

/* Now subtract optional transport overhead */
mss_now -= icsk->icsk_ext_hdr_len;
/* Account for header lengths and IPv4/v6 option overhead */
cur_mps -= (icsk->icsk_af_ops->net_header_len + icsk->icsk_ext_hdr_len +
sizeof(struct dccp_hdr) + sizeof(struct dccp_hdr_ext));

/*
* FIXME: this should come from the CCID infrastructure, where, say,
Expand All @@ -151,13 +167,13 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
* make it a multiple of 4
*/

mss_now -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4;
cur_mps -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4;

/* And store cached results */
icsk->icsk_pmtu_cookie = pmtu;
dp->dccps_mss_cache = mss_now;
dp->dccps_mss_cache = cur_mps;

return mss_now;
return cur_mps;
}

EXPORT_SYMBOL_GPL(dccp_sync_mss);
Expand Down

0 comments on commit c4f8f86

Please sign in to comment.