On 02/04/15 at 02:49pm, Andy Zhou wrote:
>  /**
> + * struct ovs_action_bpf_prog - %OVS_ACTION_ATTR_BPF_PROG action argument.
> + *
> + *  XXX provides bpf program id and execution context.
> + *
> + */
> +struct ovs_action_bpf_prog {
> +     __be32 prog_fd;
> +     __be32 arg0;
> +     __be32 arg1;
> +};

I assume you intend to replace this with a nested Netlink attribute with a
series of U32 attributes to carry args in the future?

> +enum ovs_bpf_func_id {
> +     OVS_BPF_FUNC_unspec,
> +     OVS_BPF_FUNC_output,          /* int ovs_bpf_output(ctxt) */
> +     __OVS_BPF_FUNC_MAX_ID,
> +};

The mix of cap / no-cap looks a bit weird.

> +static void
> +format_bpf_prog_action(struct ds *ds, const struct nlattr *a)
> +{
> +    struct ovs_action_bpf_prog *bpf_act = (struct ovs_action_bpf_prog *)
> +                                          nl_attr_get(a);
> +
> +    ds_put_cstr(ds, "bpf");
> +    ds_put_format(ds, "(%u,%u,%u)", ntohl(bpf_act->prog_fd),
> +                  ntohl(bpf_act->arg0), ntohl(bpf_act->arg1));
> +}

Maybe ds_put_format(ds, "bpf(... ?
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to