projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: Add test suite for packets.h.
[openvswitch]
/
datapath
/
actions.c
diff --git
a/datapath/actions.c
b/datapath/actions.c
index c61e5ff0523595bb288ea4bb48274224c7ebe6ec..3223c65bd66b75680caf790ac470ff9f498e6d58 100644
(file)
--- a/
datapath/actions.c
+++ b/
datapath/actions.c
@@
-1,6
+1,6
@@
/*
* Distributed under the terms of the GNU GPL version 2.
/*
* Distributed under the terms of the GNU GPL version 2.
- * Copyright (c) 2007, 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2007, 2008, 2009, 2010
, 2011
Nicira Networks.
*
* Significant portions of this file may be copied from parts of the Linux
* kernel, by Linus Torvalds and others.
*
* Significant portions of this file may be copied from parts of the Linux
* kernel, by Linus Torvalds and others.
@@
-243,7
+243,7
@@
static struct sk_buff *set_nw_addr(struct sk_buff *skb,
return NULL;
nh = ip_hdr(skb);
return NULL;
nh = ip_hdr(skb);
- nwaddr = nla_type(a) == ODP
AT
_SET_NW_SRC ? &nh->saddr : &nh->daddr;
+ nwaddr = nla_type(a) == ODP
_ACTION_ATTR
_SET_NW_SRC ? &nh->saddr : &nh->daddr;
check = get_l4_checksum(skb, key);
if (likely(check))
check = get_l4_checksum(skb, key);
if (likely(check))
@@
-306,7
+306,7
@@
static struct sk_buff *set_tp_port(struct sk_buff *skb,
* supports those protocols.
*/
th = udp_hdr(skb);
* supports those protocols.
*/
th = udp_hdr(skb);
- port = nla_type(a) == ODP
AT
_SET_TP_SRC ? &th->source : &th->dest;
+ port = nla_type(a) == ODP
_ACTION_ATTR
_SET_TP_SRC ? &th->source : &th->dest;
inet_proto_csum_replace2(check, skb, *port, nla_get_be16(a), 0);
*port = nla_get_be16(a);
inet_proto_csum_replace2(check, skb, *port, nla_get_be16(a), 0);
*port = nla_get_be16(a);
@@
-369,7
+369,7
@@
static int output_control(struct datapath *dp, struct sk_buff *skb, u64 arg,
if (!skb)
return -ENOMEM;
if (!skb)
return -ENOMEM;
- upcall.
type = _ODPL_ACTION_NR
;
+ upcall.
cmd = ODP_PACKET_CMD_ACTION
;
upcall.key = key;
upcall.userdata = arg;
upcall.sample_pool = 0;
upcall.key = key;
upcall.userdata = arg;
upcall.sample_pool = 0;
@@
-399,11
+399,11
@@
static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
}
switch (nla_type(a)) {
}
switch (nla_type(a)) {
- case ODP
AT
_OUTPUT:
+ case ODP
_ACTION_ATTR
_OUTPUT:
prev_port = nla_get_u32(a);
break;
prev_port = nla_get_u32(a);
break;
- case ODP
AT
_CONTROLLER:
+ case ODP
_ACTION_ATTR
_CONTROLLER:
err = output_control(dp, skb, nla_get_u64(a), key);
if (err) {
kfree_skb(skb);
err = output_control(dp, skb, nla_get_u64(a), key);
if (err) {
kfree_skb(skb);
@@
-411,57
+411,57
@@
static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
}
break;
}
break;
- case ODP
AT
_SET_TUNNEL:
+ case ODP
_ACTION_ATTR
_SET_TUNNEL:
OVS_CB(skb)->tun_id = nla_get_be64(a);
break;
OVS_CB(skb)->tun_id = nla_get_be64(a);
break;
- case ODP
AT
_SET_DL_TCI:
+ case ODP
_ACTION_ATTR
_SET_DL_TCI:
skb = modify_vlan_tci(dp, skb, key, a, rem);
if (IS_ERR(skb))
return PTR_ERR(skb);
break;
skb = modify_vlan_tci(dp, skb, key, a, rem);
if (IS_ERR(skb))
return PTR_ERR(skb);
break;
- case ODP
AT
_STRIP_VLAN:
+ case ODP
_ACTION_ATTR
_STRIP_VLAN:
skb = strip_vlan(skb);
break;
skb = strip_vlan(skb);
break;
- case ODP
AT
_SET_DL_SRC:
+ case ODP
_ACTION_ATTR
_SET_DL_SRC:
skb = make_writable(skb, 0);
if (!skb)
return -ENOMEM;
memcpy(eth_hdr(skb)->h_source, nla_data(a), ETH_ALEN);
break;
skb = make_writable(skb, 0);
if (!skb)
return -ENOMEM;
memcpy(eth_hdr(skb)->h_source, nla_data(a), ETH_ALEN);
break;
- case ODP
AT
_SET_DL_DST:
+ case ODP
_ACTION_ATTR
_SET_DL_DST:
skb = make_writable(skb, 0);
if (!skb)
return -ENOMEM;
memcpy(eth_hdr(skb)->h_dest, nla_data(a), ETH_ALEN);
break;
skb = make_writable(skb, 0);
if (!skb)
return -ENOMEM;
memcpy(eth_hdr(skb)->h_dest, nla_data(a), ETH_ALEN);
break;
- case ODP
AT
_SET_NW_SRC:
- case ODP
AT
_SET_NW_DST:
+ case ODP
_ACTION_ATTR
_SET_NW_SRC:
+ case ODP
_ACTION_ATTR
_SET_NW_DST:
skb = set_nw_addr(skb, key, a);
break;
skb = set_nw_addr(skb, key, a);
break;
- case ODP
AT
_SET_NW_TOS:
+ case ODP
_ACTION_ATTR
_SET_NW_TOS:
skb = set_nw_tos(skb, key, nla_get_u8(a));
break;
skb = set_nw_tos(skb, key, nla_get_u8(a));
break;
- case ODP
AT
_SET_TP_SRC:
- case ODP
AT
_SET_TP_DST:
+ case ODP
_ACTION_ATTR
_SET_TP_SRC:
+ case ODP
_ACTION_ATTR
_SET_TP_DST:
skb = set_tp_port(skb, key, a);
break;
skb = set_tp_port(skb, key, a);
break;
- case ODP
AT
_SET_PRIORITY:
+ case ODP
_ACTION_ATTR
_SET_PRIORITY:
skb->priority = nla_get_u32(a);
break;
skb->priority = nla_get_u32(a);
break;
- case ODP
AT
_POP_PRIORITY:
+ case ODP
_ACTION_ATTR
_POP_PRIORITY:
skb->priority = priority;
break;
skb->priority = priority;
break;
- case ODP
AT
_DROP_SPOOFED_ARP:
+ case ODP
_ACTION_ATTR
_DROP_SPOOFED_ARP:
if (unlikely(is_spoofed_arp(skb, key)))
goto exit;
break;
if (unlikely(is_spoofed_arp(skb, key)))
goto exit;
break;
@@
-496,7
+496,7
@@
static void sflow_sample(struct datapath *dp, struct sk_buff *skb,
if (unlikely(!nskb))
return;
if (unlikely(!nskb))
return;
- upcall.
type = _ODPL_SFLOW_NR
;
+ upcall.
cmd = ODP_PACKET_CMD_SAMPLE
;
upcall.key = key;
upcall.userdata = 0;
upcall.sample_pool = atomic_read(&p->sflow_pool);
upcall.key = key;
upcall.userdata = 0;
upcall.sample_pool = atomic_read(&p->sflow_pool);