Cosmetic change: Made use of definition instead of raw value

This commit is contained in:
Mikio Hara committed 2009-07-16 12:53:19 -07:00
1 parent 45e7855e46
commit 59c9a188d6
10 files changed
+16 -22

No files matched your search

+1 -7
View File
@@ -77,10 +77,6 @@ EXPORT_SYMBOL(dp_del_if_hook);
/* Number of milliseconds between runs of the maintenance thread. */
#define MAINT_SLEEP_MSECS 1000
#define UINT32_MAX 4294967295U
#define UINT16_MAX 65535
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
static struct genl_family dp_genl_family;
/*
@@ -659,9 +655,7 @@ int dp_output_port(struct datapath *dp, struct sk_buff *skb, int out_port,
return output_all(dp, skb, 0);
case OFPP_CONTROLLER:
return dp_output_control(dp, skb,
PKTSIZ_ENOUGH_TO_CARRY_ENTIRE_PACKET,
OFPR_ACTION);
return dp_output_control(dp, skb, UINT16_MAX, OFPR_ACTION);
case OFPP_LOCAL: {
struct net_device *dev = dp->netdev;
+1 -1
View File
@@ -480,7 +480,7 @@ void execute_actions(struct datapath *dp, struct sk_buff *skb,
* then freeing the original skbuff is wasteful. So the following code
* is slightly obscure just to avoid that. */
int prev_port;
size_t max_len = PKTSIZ_ENOUGH_TO_CARRY_ENTIRE_PACKET;
size_t max_len = UINT16_MAX;
uint8_t *p = (uint8_t *)actions;
prev_port = -1;
+2 -2
View File
@@ -248,8 +248,8 @@ add_flow(struct sw_chain *chain, const struct sender *sender,
}
if (ntohs(ofm->flags) & OFPFF_EMERG) {
if (ntohs(ofm->idle_timeout) != 0
|| ntohs(ofm->hard_timeout) != 0) {
if (ntohs(ofm->idle_timeout) != OFP_FLOW_PERMANENT
|| ntohs(ofm->hard_timeout) != OFP_FLOW_PERMANENT) {
dp_send_error_msg(chain->dp, sender,
OFPET_FLOW_MOD_FAILED,
OFPFMFC_BAD_EMERG_TIMEOUT,
+3 -1
View File
@@ -20,7 +20,9 @@ struct sender;
#define PKT_COOKIE_BITS (32 - PKT_BUFFER_BITS)
#define PKTSIZ_ENOUGH_TO_CARRY_ENTIRE_PACKET 65535
#define UINT32_MAX 4294967295U
#define UINT16_MAX 65535
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
void fwd_port_input(struct sw_chain *, struct sk_buff *,
struct net_bridge_port *);
+2 -2
View File
@@ -77,8 +77,8 @@ protection_callback(struct sw_flow *flow, void *private_)
flow_extract_match(&tgtflow->key, &match);
/* Fill out flow. */
tgtflow->priority = flow->priority;
tgtflow->idle_timeout = 0;
tgtflow->hard_timeout = 0;
tgtflow->idle_timeout = OFP_FLOW_PERMANENT;
tgtflow->hard_timeout = OFP_FLOW_PERMANENT;
tgtflow->send_flow_rem = flow->send_flow_rem;
tgtflow->emerg_flow = 0;
flow_setup_actions(tgtflow, actions->actions, actions->actions_len);
+1 -1
View File
@@ -924,7 +924,7 @@ make_add_simple_flow(const struct flow *flow,
oao->len = htons(sizeof *oao);
oao->port = htons(out_port);
if (oao->port == htons(OFPP_CONTROLLER))
oao->max_len = htons(65535); /* Enough to carry entire packet */
oao->max_len = htons(UINT16_MAX); /* Enough to carry entire packet */
return buffer;
}
+3 -3
View File
@@ -563,8 +563,7 @@ dp_output_port(struct datapath *dp, struct ofpbuf *buffer,
break;
case OFPP_CONTROLLER:
dp_output_control(dp, buffer, in_port,
PKTSIZ_ENOUGH_TO_CARRY_ENTIRE_PACKET, OFPR_ACTION);
dp_output_control(dp, buffer, in_port, UINT16_MAX, OFPR_ACTION);
break;
case OFPP_LOCAL:
@@ -1019,7 +1018,8 @@ add_flow(struct datapath *dp, const struct sender *sender,
}
if (ntohs(ofm->flags) & OFPFF_EMERG) {
if (ntohs(ofm->idle_timeout) != 0 || ntohs(ofm->hard_timeout) != 0) {
if (ntohs(ofm->idle_timeout) != OFP_FLOW_PERMANENT
|| ntohs(ofm->hard_timeout) != OFP_FLOW_PERMANENT) {
dp_send_error_msg(dp, sender, OFPET_FLOW_MOD_FAILED,
OFPFMFC_BAD_EMERG_TIMEOUT, ofm,
ntohs(ofm->header.length));
-2
View File
@@ -63,8 +63,6 @@ struct sw_port {
#define DP_MAX_PORTS 255
BUILD_ASSERT_DECL(DP_MAX_PORTS <= OFPP_MAX);
#define PKTSIZ_ENOUGH_TO_CARRY_ENTIRE_PACKET 65535
struct datapath {
/* Remote connections. */
struct list remotes; /* All connections (including controller). */
+1 -1
View File
@@ -470,7 +470,7 @@ void execute_actions(struct datapath *dp, struct ofpbuf *buffer,
* freeing the original buffer is wasteful. So the following code is
* slightly obscure just to avoid that. */
int prev_port;
size_t max_len = PKTSIZ_ENOUGH_TO_CARRY_ENTIRE_PACKET;
size_t max_len = UINT16_MAX;
uint16_t in_port = ntohs(key->flow.in_port);
uint8_t *p = (uint8_t *)actions;
+2 -2
View File
@@ -80,8 +80,8 @@ protection_callback(struct sw_flow *flow, void *private_)
flow_extract_match(&tgtflow->key, &match);
/* Fill out flow. */
tgtflow->priority = flow->priority;
tgtflow->idle_timeout = 0;
tgtflow->hard_timeout = 0;
tgtflow->idle_timeout = OFP_FLOW_PERMANENT;
tgtflow->hard_timeout = OFP_FLOW_PERMANENT;
tgtflow->send_flow_rem = flow->send_flow_rem;
tgtflow->emerg_flow = 0;
flow_setup_actions(tgtflow, actions->actions, actions->actions_len);