bool is_frag;
/* Extract flow from 'skb' into 'key'. */
- error = flow_extract(skb, p ? p->port_no : ODPP_NONE, &key, &is_frag);
+ error = flow_extract(skb, p->port_no, &key, &is_frag);
if (unlikely(error)) {
kfree_skb(skb);
return;
[ODP_PACKET_ATTR_ACTIONS] = { .type = NLA_NESTED },
};
-static int execute_packet(const struct odp_upcall __user *uodp_upcall)
+static int execute_packet(const struct odp_packet __user *uodp_packet)
{
struct nlattr *a[ODP_PACKET_ATTR_MAX + 1];
- struct odp_upcall *odp_upcall;
+ struct odp_packet *odp_packet;
struct sk_buff *skb, *packet;
unsigned int actions_len;
struct nlattr *actions;
u32 len;
int err;
- if (get_user(len, &uodp_upcall->len))
+ if (get_user(len, &uodp_packet->len))
return -EFAULT;
- if (len < sizeof(struct odp_upcall))
+ if (len < sizeof(struct odp_packet))
return -EINVAL;
skb = alloc_skb(len, GFP_KERNEL);
return -ENOMEM;
err = -EFAULT;
- if (copy_from_user(__skb_put(skb, len), uodp_upcall, len))
+ if (copy_from_user(__skb_put(skb, len), uodp_packet, len))
goto exit_free_skb;
- odp_upcall = (struct odp_upcall *)skb->data;
+ odp_packet = (struct odp_packet *)skb->data;
err = -EINVAL;
- if (odp_upcall->len != len)
+ if (odp_packet->len != len)
goto exit_free_skb;
- __skb_pull(skb, sizeof(struct odp_upcall));
+ __skb_pull(skb, sizeof(struct odp_packet));
err = nla_parse(a, ODP_PACKET_ATTR_MAX, (struct nlattr *)skb->data,
skb->len, execute_policy);
if (err)
goto exit_free_skb;
rcu_read_lock();
- dp = get_dp(odp_upcall->dp_idx);
+ dp = get_dp(odp_packet->dp_idx);
err = -ENODEV;
if (dp)
err = execute_actions(dp, packet, &key, actions, actions_len);
goto exit;
case ODP_EXECUTE:
- err = execute_packet((struct odp_upcall __user *)argp);
+ err = execute_packet((struct odp_packet __user *)argp);
goto exit;
}