[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150205135616.GB5546@pox.localdomain>
Date: Thu, 5 Feb 2015 14:56:16 +0100
From: Thomas Graf <tgraf@...ronetworks.com>
To: Andy Zhou <azhou@...ira.com>
Cc: dev@...nvswitch.com, netdev@...r.kernel.org
Subject: Re: [ovs-dev] [RFC: add openvswitch actions using BPF 2/9] odp: add
a new ODP action: OVS_ACTION_ATTR_BPF_PROG
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(... ?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists