[ovs-dev] [PATCH v2] datapath: Refactor actions in terms of match fields.

Jesse Gross jesse at nicira.com
Wed Oct 19 20:29:26 UTC 2011


On Wed, Oct 19, 2011 at 1:10 PM, Pravin B Shelar <pshelar at nicira.com> wrote:
> Fixed according to comments from Jesse.

I just quickly skimmed this for changes but I noticed a couple of random things:

> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index f78cda2..17091e0 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> +dp_netdev_set_ipv4(struct ofpbuf *packet, const struct flow *flow,
> +                      const struct ovs_key_ipv4 *ipv4_key)
>  {
> -    if (is_ip(packet, key)) {
> +    /* Check for IP header. */
> +    if (packet->l4 && flow->dl_type == htons(ETH_TYPE_IP)) {

I think this check is unnecessary now too.

> @@ -1278,41 +1319,23 @@ dp_netdev_execute_actions(struct dp_netdev *dp,
>             dp_netdev_action_userspace(dp, packet, key, a);
>             break;
>
> -        case OVS_ACTION_ATTR_PUSH_VLAN:
> -            eth_push_vlan(packet, nl_attr_get_be16(a));
> +        case OVS_ACTION_ATTR_PUSH:
> +            q_key = nl_attr_get_unspec(nl_attr_get(a), sizeof(*q_key));
> +            eth_push_vlan(packet, q_key->q_tci & ~htons(VLAN_CFI));

The CFI bit shouldn't be set here.

> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index 211577b..013c891 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> +nl_msg_put_nested_key(struct ofpbuf *odp_actions,
> +                      enum ovs_action_attr act_type,
> +                      enum ovs_key_attr key_type,
> +                      const void *key, size_t key_size)

Since this is no longer in the netlink.c file it should use a
different prefix in the function name.



More information about the dev mailing list