* [PATCH v3] linux: Report supported user features to the kernel
@ 2013-12-19 15:20 Thomas Graf
2013-12-19 18:14 ` [ovs-dev] " Ben Pfaff
2013-12-20 18:20 ` Jesse Gross
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Graf @ 2013-12-19 15:20 UTC (permalink / raw)
To: jesse-l0M0P4e3n4LQT0dZR+AlfA
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
Following commit (''netlink: Do not enforce alignment of last Netlink
attribute''), signal the ability to receive unaligned Netlink messages
to the datapath to enable utilization of zerocopy optimizations.
Opening a datapath is now done by issueing a OVS_DP_CMD_SET in order
to overwrite previously set user features.
Signed-off-by: Thomas Graf <tgraf-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
V3: Use OVS_DP_CMD_SET when opening the datapath
lib/dpif-linux.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index f64e55b..482ba77 100644
--- a/lib/dpif-linux.c
+++ b/lib/dpif-linux.c
@@ -73,6 +73,7 @@ struct dpif_linux_dp {
/* Attributes. */
const char *name; /* OVS_DP_ATTR_NAME. */
const uint32_t *upcall_pid; /* OVS_DP_ATTR_UPCALL_PID. */
+ uint32_t user_features; /* OVS_DP_ATTR_USER_FEATURES */
struct ovs_dp_stats stats; /* OVS_DP_ATTR_STATS. */
struct ovs_dp_megaflow_stats megaflow_stats;
/* OVS_DP_ATTR_MEGAFLOW_STATS.*/
@@ -231,9 +232,11 @@ dpif_linux_open(const struct dpif_class *class OVS_UNUSED, const char *name,
upcall_pid = 0;
dp_request.upcall_pid = &upcall_pid;
} else {
- dp_request.cmd = OVS_DP_CMD_GET;
+ /* Use OVS_DP_CMD_SET to report user features */
+ dp_request.cmd = OVS_DP_CMD_SET;
}
dp_request.name = name;
+ dp_request.user_features |= OVS_DP_F_UNALIGNED;
error = dpif_linux_dp_transact(&dp_request, &dp, &buf);
if (error) {
return error;
@@ -1931,6 +1934,10 @@ dpif_linux_dp_to_ofpbuf(const struct dpif_linux_dp *dp, struct ofpbuf *buf)
nl_msg_put_u32(buf, OVS_DP_ATTR_UPCALL_PID, *dp->upcall_pid);
}
+ if (dp->user_features) {
+ nl_msg_put_u32(buf, OVS_DP_ATTR_USER_FEATURES, dp->user_features);
+ }
+
/* Skip OVS_DP_ATTR_STATS since we never have a reason to serialize it. */
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [ovs-dev] [PATCH v3] linux: Report supported user features to the kernel
2013-12-19 15:20 [PATCH v3] linux: Report supported user features to the kernel Thomas Graf
@ 2013-12-19 18:14 ` Ben Pfaff
2013-12-20 18:20 ` Jesse Gross
1 sibling, 0 replies; 3+ messages in thread
From: Ben Pfaff @ 2013-12-19 18:14 UTC (permalink / raw)
To: Thomas Graf; +Cc: jesse, dev, netdev
On Thu, Dec 19, 2013 at 04:20:42PM +0100, Thomas Graf wrote:
> Following commit (''netlink: Do not enforce alignment of last Netlink
> attribute''), signal the ability to receive unaligned Netlink messages
> to the datapath to enable utilization of zerocopy optimizations.
>
> Opening a datapath is now done by issueing a OVS_DP_CMD_SET in order
> to overwrite previously set user features.
>
> Signed-off-by: Thomas Graf <tgraf@redhat.com>
Jesse, I'm not sure of the status of this whole effort so I'll just say
that I'm happy with this patch:
Acked-by: Ben Pfaff <blp@nicira.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] linux: Report supported user features to the kernel
2013-12-19 15:20 [PATCH v3] linux: Report supported user features to the kernel Thomas Graf
2013-12-19 18:14 ` [ovs-dev] " Ben Pfaff
@ 2013-12-20 18:20 ` Jesse Gross
1 sibling, 0 replies; 3+ messages in thread
From: Jesse Gross @ 2013-12-20 18:20 UTC (permalink / raw)
To: Thomas Graf; +Cc: dev@openvswitch.org, netdev
On Thu, Dec 19, 2013 at 7:20 AM, Thomas Graf <tgraf@redhat.com> wrote:
> Following commit (''netlink: Do not enforce alignment of last Netlink
> attribute''), signal the ability to receive unaligned Netlink messages
> to the datapath to enable utilization of zerocopy optimizations.
>
> Opening a datapath is now done by issueing a OVS_DP_CMD_SET in order
> to overwrite previously set user features.
>
> Signed-off-by: Thomas Graf <tgraf@redhat.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-20 18:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 15:20 [PATCH v3] linux: Report supported user features to the kernel Thomas Graf
2013-12-19 18:14 ` [ovs-dev] " Ben Pfaff
2013-12-20 18:20 ` Jesse Gross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).