Natasha Gude natasha@nicira.com
Neil McKee neil.mckee@inmon.com
Paul Fazzone pfazzone@nicira.com
+Pravin B Shelar pshelar@nicira.com
Reid Price reid@nicira.com
Romain Lenglet romain.lenglet@berabera.info
Sajjad Lateef slateef@nicira.com
kfree_skb(skb);
}
-static int output_control(struct datapath *dp, struct sk_buff *skb, u64 arg)
+static int output_userspace(struct datapath *dp, struct sk_buff *skb, u64 arg)
{
struct dp_upcall_info upcall;
prev_port = nla_get_u32(a);
break;
- case ODP_ACTION_ATTR_CONTROLLER:
- err = output_control(dp, skb, nla_get_u64(a));
+ case ODP_ACTION_ATTR_USERSPACE:
+ err = output_userspace(dp, skb, nla_get_u64(a));
break;
case ODP_ACTION_ATTR_SET_TUNNEL:
static LIST_HEAD(dps);
static struct vport *new_vport(const struct vport_parms *);
-static int queue_control_packets(struct datapath *, struct sk_buff *,
+static int queue_userspace_packets(struct datapath *, struct sk_buff *,
const struct dp_upcall_info *);
/* Must be called with rcu_read_lock, genl_mutex, or RTNL lock. */
skb = nskb;
}
- err = queue_control_packets(dp, skb, upcall_info);
+ err = queue_userspace_packets(dp, skb, upcall_info);
if (err)
goto err;
* 'upcall_info'. There will be only one packet unless we broke up a GSO
* packet.
*/
-static int queue_control_packets(struct datapath *dp, struct sk_buff *skb,
+static int queue_userspace_packets(struct datapath *dp, struct sk_buff *skb,
const struct dp_upcall_info *upcall_info)
{
u32 group = packet_mc_group(dp, upcall_info->cmd);
nla_for_each_nested(a, attr, rem) {
static const u32 action_lens[ODP_ACTION_ATTR_MAX + 1] = {
[ODP_ACTION_ATTR_OUTPUT] = 4,
- [ODP_ACTION_ATTR_CONTROLLER] = 8,
+ [ODP_ACTION_ATTR_USERSPACE] = 8,
[ODP_ACTION_ATTR_SET_DL_TCI] = 2,
[ODP_ACTION_ATTR_STRIP_VLAN] = 0,
[ODP_ACTION_ATTR_SET_DL_SRC] = ETH_ALEN,
case ODP_ACTION_ATTR_UNSPEC:
return -EINVAL;
- case ODP_ACTION_ATTR_CONTROLLER:
+ case ODP_ACTION_ATTR_USERSPACE:
case ODP_ACTION_ATTR_STRIP_VLAN:
case ODP_ACTION_ATTR_SET_DL_SRC:
case ODP_ACTION_ATTR_SET_DL_DST:
/* Kernel-to-user notifications. */
ODP_PACKET_CMD_MISS, /* Flow table miss. */
- ODP_PACKET_CMD_ACTION, /* ODP_ACTION_ATTR_CONTROLLER action. */
+ ODP_PACKET_CMD_ACTION, /* ODP_ACTION_ATTR_USERSPACE action. */
ODP_PACKET_CMD_SAMPLE, /* Sampled packet. */
/* User commands. */
* @ODP_PACKET_ATTR_PACKET: Present for all notifications. Contains the entire
* packet as received, from the start of the Ethernet header onward. For
* %ODP_PACKET_CMD_ACTION, %ODP_PACKET_ATTR_PACKET reflects changes made by
- * actions preceding %ODP_ACTION_ATTR_CONTROLLER, but %ODP_PACKET_ATTR_KEY is
+ * actions preceding %ODP_ACTION_ATTR_USERSPACE, but %ODP_PACKET_ATTR_KEY is
* the flow key extracted from the packet as originally received.
* @ODP_PACKET_ATTR_KEY: Present for all notifications. Contains the flow key
* extracted from the packet as nested %ODP_KEY_ATTR_* attributes. This allows
* userspace to adapt its flow setup strategy by comparing its notion of the
* flow key against the kernel's.
* @ODP_PACKET_ATTR_USERDATA: Present for an %ODP_PACKET_CMD_ACTION
- * notification if the %ODP_ACTION_ATTR_CONTROLLER, action's argument was
+ * notification if the %ODP_ACTION_ATTR_USERSPACE, action's argument was
* nonzero.
* @ODP_PACKET_ATTR_SAMPLE_POOL: Present for %ODP_PACKET_CMD_SAMPLE. Contains
* the number of packets processed so far that were candidates for sampling.
ODP_PACKET_ATTR_UNSPEC,
ODP_PACKET_ATTR_PACKET, /* Packet data. */
ODP_PACKET_ATTR_KEY, /* Nested ODP_KEY_ATTR_* attributes. */
- ODP_PACKET_ATTR_USERDATA, /* u64 ODP_ACTION_ATTR_CONTROLLER arg. */
+ ODP_PACKET_ATTR_USERDATA, /* u64 ODP_ACTION_ATTR_USERSPACE arg. */
ODP_PACKET_ATTR_SAMPLE_POOL, /* # sampling candidate packets so far. */
ODP_PACKET_ATTR_ACTIONS, /* Nested ODP_ACTION_ATTR_* attributes. */
__ODP_PACKET_ATTR_MAX
enum odp_action_type {
ODP_ACTION_ATTR_UNSPEC,
ODP_ACTION_ATTR_OUTPUT, /* Output to switch port. */
- ODP_ACTION_ATTR_CONTROLLER, /* Send copy to controller. */
+ ODP_ACTION_ATTR_USERSPACE, /* Send copy to userspace. */
ODP_ACTION_ATTR_SET_DL_TCI, /* Set the 802.1q TCI value. */
ODP_ACTION_ATTR_STRIP_VLAN, /* Strip the 802.1q header. */
ODP_ACTION_ATTR_SET_DL_SRC, /* Ethernet source address. */
static int do_del_port(struct dp_netdev *, uint16_t port_no);
static int dpif_netdev_open(const struct dpif_class *, const char *name,
bool create, struct dpif **);
-static int dp_netdev_output_control(struct dp_netdev *, const struct ofpbuf *,
+static int dp_netdev_output_userspace(struct dp_netdev *, const struct ofpbuf *,
int queue_no, const struct flow *,
uint64_t arg);
static int dp_netdev_execute_actions(struct dp_netdev *,
}
break;
- case ODP_ACTION_ATTR_CONTROLLER:
+ case ODP_ACTION_ATTR_USERSPACE:
break;
case ODP_ACTION_ATTR_SET_DL_TCI:
dp->n_hit++;
} else {
dp->n_missed++;
- dp_netdev_output_control(dp, packet, DPIF_UC_MISS, &key, 0);
+ dp_netdev_output_userspace(dp, packet, DPIF_UC_MISS, &key, 0);
}
}
}
static int
-dp_netdev_output_control(struct dp_netdev *dp, const struct ofpbuf *packet,
+dp_netdev_output_userspace(struct dp_netdev *dp, const struct ofpbuf *packet,
int queue_no, const struct flow *flow, uint64_t arg)
{
struct dp_netdev_queue *q = &dp->queues[queue_no];
dp_netdev_output_port(dp, packet, nl_attr_get_u32(a));
break;
- case ODP_ACTION_ATTR_CONTROLLER:
- dp_netdev_output_control(dp, packet, DPIF_UC_ACTION,
+ case ODP_ACTION_ATTR_USERSPACE:
+ dp_netdev_output_userspace(dp, packet, DPIF_UC_ACTION,
key, nl_attr_get_u64(a));
break;
enum dpif_upcall_type {
DPIF_UC_MISS, /* Miss in flow table. */
- DPIF_UC_ACTION, /* ODP_ACTION_ATTR_CONTROLLER action. */
+ DPIF_UC_ACTION, /* ODP_ACTION_ATTR_USERSPACE action. */
DPIF_UC_SAMPLE, /* Packet sampling. */
DPIF_N_UC_TYPES
};
size_t key_len; /* Length of 'key' in bytes. */
/* DPIF_UC_ACTION only. */
- uint64_t userdata; /* Argument to ODP_ACTION_ATTR_CONTROLLER. */
+ uint64_t userdata; /* Argument to ODP_ACTION_ATTR_USERSPACE. */
/* DPIF_UC_SAMPLE only. */
uint32_t sample_pool; /* # of sampling candidate packets so far. */
switch ((enum odp_action_type) type) {
case ODP_ACTION_ATTR_OUTPUT: return 4;
- case ODP_ACTION_ATTR_CONTROLLER: return 8;
+ case ODP_ACTION_ATTR_USERSPACE: return 8;
case ODP_ACTION_ATTR_SET_DL_TCI: return 2;
case ODP_ACTION_ATTR_STRIP_VLAN: return 0;
case ODP_ACTION_ATTR_SET_DL_SRC: return ETH_ADDR_LEN;
case ODP_ACTION_ATTR_OUTPUT:
ds_put_format(ds, "%"PRIu16, nl_attr_get_u32(a));
break;
- case ODP_ACTION_ATTR_CONTROLLER:
- ds_put_format(ds, "ctl(%"PRIu64")", nl_attr_get_u64(a));
+ case ODP_ACTION_ATTR_USERSPACE:
+ ds_put_format(ds, "userspace(%"PRIu64")", nl_attr_get_u64(a));
break;
case ODP_ACTION_ATTR_SET_TUNNEL:
ds_put_format(ds, "set_tunnel(%#"PRIx64")",
struct ofpbuf *packet)
{
if (actions_len == NLA_ALIGN(NLA_HDRLEN + sizeof(uint64_t))
- && odp_actions->nla_type == ODP_ACTION_ATTR_CONTROLLER) {
+ && odp_actions->nla_type == ODP_ACTION_ATTR_USERSPACE) {
/* As an optimization, avoid a round-trip from userspace to kernel to
* userspace. This also avoids possibly filling up kernel packet
* buffers along the way. */
break;
case OFPP_CONTROLLER:
commit_odp_actions(ctx);
- nl_msg_put_u64(ctx->odp_actions, ODP_ACTION_ATTR_CONTROLLER, max_len);
+ nl_msg_put_u64(ctx->odp_actions, ODP_ACTION_ATTR_USERSPACE, max_len);
break;
case OFPP_LOCAL:
add_output_action(ctx, OFPP_LOCAL);