Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41732
b: refs/heads/master
c: 3c69526
h: refs/heads/master
v: v3
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Dec 3, 2006
1 parent 7202ca2 commit fcf0b18
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 36 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: 6bb100b9fc8f1ce330231b360028ab705a9f0378
refs/heads/master: 3c6952624a8f600f9a0fbc1f5db5560a7ef9b13e
45 changes: 12 additions & 33 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@ static struct dccp_tx_hist *ccid3_tx_hist;
static struct dccp_rx_hist *ccid3_rx_hist;
static struct dccp_li_hist *ccid3_li_hist;

/* TFRC sender states */
enum ccid3_hc_tx_states {
TFRC_SSTATE_NO_SENT = 1,
TFRC_SSTATE_NO_FBACK,
TFRC_SSTATE_FBACK,
TFRC_SSTATE_TERM,
};

#ifdef CCID3_DEBUG
static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state)
{
Expand Down Expand Up @@ -251,9 +243,8 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
hctx->ccid3hctx_x));
break;
default:
printk(KERN_CRIT "%s: %s, sk=%p, Illegal state (%d)!\n",
__FUNCTION__, dccp_role(sk), sk, hctx->ccid3hctx_state);
dump_stack();
DCCP_BUG("%s, sk=%p, Illegal state (%d)!", dccp_role(sk), sk,
hctx->ccid3hctx_state);
goto out;
}

Expand Down Expand Up @@ -329,9 +320,8 @@ static int ccid3_hc_tx_send_packet(struct sock *sk,
rc = delay > 0 ? delay : 0;
break;
default:
printk(KERN_CRIT "%s: %s, sk=%p, Illegal state (%d)!\n",
__FUNCTION__, dccp_role(sk), sk, hctx->ccid3hctx_state);
dump_stack();
DCCP_BUG("%s, sk=%p, Illegal state (%d)!", dccp_role(sk), sk,
hctx->ccid3hctx_state);
rc = -EINVAL;
break;
}
Expand Down Expand Up @@ -423,9 +413,8 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len)
}
break;
default:
printk(KERN_CRIT "%s: %s, sk=%p, Illegal state (%d)!\n",
__FUNCTION__, dccp_role(sk), sk, hctx->ccid3hctx_state);
dump_stack();
DCCP_BUG("%s, sk=%p, Illegal state (%d)!", dccp_role(sk), sk,
hctx->ccid3hctx_state);
break;
}
}
Expand Down Expand Up @@ -568,9 +557,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
hctx->ccid3hctx_idle = 1;
break;
default:
printk(KERN_CRIT "%s: %s, sk=%p, Illegal state (%d)!\n",
__FUNCTION__, dccp_role(sk), sk, hctx->ccid3hctx_state);
dump_stack();
DCCP_BUG("%s, sk=%p, Illegal state (%d)!", dccp_role(sk), sk,
hctx->ccid3hctx_state);
break;
}
}
Expand Down Expand Up @@ -688,13 +676,6 @@ static void ccid3_hc_tx_exit(struct sock *sk)
* RX Half Connection methods
*/

/* TFRC receiver states */
enum ccid3_hc_rx_states {
TFRC_RSTATE_NO_DATA = 1,
TFRC_RSTATE_DATA,
TFRC_RSTATE_TERM = 127,
};

#ifdef CCID3_DEBUG
static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state)
{
Expand Down Expand Up @@ -744,9 +725,8 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk)
}
break;
default:
printk(KERN_CRIT "%s: %s, sk=%p, Illegal state (%d)!\n",
__FUNCTION__, dccp_role(sk), sk, hcrx->ccid3hcrx_state);
dump_stack();
DCCP_BUG("%s, sk=%p, Illegal state (%d)!", dccp_role(sk), sk,
hcrx->ccid3hcrx_state);
return;
}

Expand Down Expand Up @@ -1088,9 +1068,8 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)
}
return;
default:
printk(KERN_CRIT "%s: %s, sk=%p, Illegal state (%d)!\n",
__FUNCTION__, dccp_role(sk), sk, hcrx->ccid3hcrx_state);
dump_stack();
DCCP_BUG("%s, sk=%p, Illegal state (%d)!", dccp_role(sk), sk,
hcrx->ccid3hcrx_state);
return;
}

Expand Down
19 changes: 17 additions & 2 deletions trunk/net/dccp/ccids/ccid3.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ struct ccid3_options_received {
u32 ccid3or_receive_rate;
};

/* TFRC sender states */
enum ccid3_hc_tx_states {
TFRC_SSTATE_NO_SENT = 1,
TFRC_SSTATE_NO_FBACK,
TFRC_SSTATE_FBACK,
TFRC_SSTATE_TERM,
};

/** struct ccid3_hc_tx_sock - CCID3 sender half connection sock
*
* @ccid3hctx_state - Sender state
Expand Down Expand Up @@ -103,7 +111,7 @@ struct ccid3_hc_tx_sock {
#define ccid3hctx_t_rto ccid3hctx_tfrc.tfrctx_rto
#define ccid3hctx_t_ipi ccid3hctx_tfrc.tfrctx_ipi
u16 ccid3hctx_s;
u8 ccid3hctx_state;
enum ccid3_hc_tx_states ccid3hctx_state:8;
u8 ccid3hctx_last_win_count;
u8 ccid3hctx_idle;
struct timeval ccid3hctx_t_last_win_count;
Expand All @@ -115,15 +123,22 @@ struct ccid3_hc_tx_sock {
struct ccid3_options_received ccid3hctx_options_received;
};

/* TFRC receiver states */
enum ccid3_hc_rx_states {
TFRC_RSTATE_NO_DATA = 1,
TFRC_RSTATE_DATA,
TFRC_RSTATE_TERM = 127,
};

struct ccid3_hc_rx_sock {
struct tfrc_rx_info ccid3hcrx_tfrc;
#define ccid3hcrx_x_recv ccid3hcrx_tfrc.tfrcrx_x_recv
#define ccid3hcrx_rtt ccid3hcrx_tfrc.tfrcrx_rtt
#define ccid3hcrx_p ccid3hcrx_tfrc.tfrcrx_p
u64 ccid3hcrx_seqno_nonloss:48,
ccid3hcrx_ccval_nonloss:4,
ccid3hcrx_state:8,
ccid3hcrx_ccval_last_counter:4;
enum ccid3_hc_rx_states ccid3hcrx_state:8;
u32 ccid3hcrx_bytes_recv;
struct timeval ccid3hcrx_tstamp_last_feedback;
struct timeval ccid3hcrx_tstamp_last_ack;
Expand Down
8 changes: 8 additions & 0 deletions trunk/net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
#include <net/tcp.h>
#include "ackvec.h"

#define DCCP_CRIT(fmt, a...) LIMIT_NETDEBUG(KERN_CRIT fmt " at %s:%d/%s()\n", \
##a, __FILE__, __LINE__, __FUNCTION__)
#define DCCP_BUG(fmt, a...) do { DCCP_CRIT(fmt, ##a); dump_stack(); } while (0)
#define DCCP_BUG_ON(cond) do { if (unlikely((cond) == 0)) \
DCCP_BUG("BUG: condition \"%s\" fails",\
__stringify((cond))); \
} while (0)

#ifdef CONFIG_IP_DCCP_DEBUG
extern int dccp_debug;

Expand Down

0 comments on commit fcf0b18

Please sign in to comment.