[ovs-dev] [PATCH 03/12] dpif: Allow execute to modify the packet.
Ben Pfaff
blp at nicira.com
Mon Nov 11 22:58:29 UTC 2013
On Fri, Nov 08, 2013 at 10:54:35AM -0800, Jarno Rajahalme wrote:
> This is how the users already use the interface, and this allows
> less copying at the userspace datapath.
>
> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>
Because of the exact semantic of 'const' in C, I think you can retain
some of the 'const's that you dropped, e.g. fold in this incremental:
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index bfea02d..42958d3 100644
--- a/lib/dpif-linux.c
+++ b/lib/dpif-linux.c
@@ -1086,7 +1086,7 @@ dpif_linux_execute__(int dp_ifindex, const struct dpif_execute *execute)
}
static int
-dpif_linux_execute(struct dpif *dpif_, struct dpif_execute *execute)
+dpif_linux_execute(struct dpif *dpif_, const struct dpif_execute *execute)
{
const struct dpif_linux *dpif = dpif_linux_cast(dpif_);
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 9e1ade5..5246ec6 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -1027,7 +1027,7 @@ dpif_netdev_flow_dump_done(const struct dpif *dpif OVS_UNUSED, void *state_)
}
static int
-dpif_netdev_execute(struct dpif *dpif, struct dpif_execute *execute)
+dpif_netdev_execute(struct dpif *dpif, const struct dpif_execute *execute)
{
struct dp_netdev *dp = get_dp_netdev(dpif);
struct flow md;
diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
index c5f8b04..1afac99 100644
--- a/lib/dpif-provider.h
+++ b/lib/dpif-provider.h
@@ -316,7 +316,7 @@ struct dpif_class {
* 'execute->key'. ('execute->key' is mostly redundant with
* 'execute->packet', but it contains some metadata that cannot be
* recovered from 'execute->packet', such as tunnel and in_port.) */
- int (*execute)(struct dpif *dpif, struct dpif_execute *execute);
+ int (*execute)(struct dpif *dpif, const struct dpif_execute *execute);
/* Executes each of the 'n_ops' operations in 'ops' on 'dpif', in the order
* in which they are specified, placing each operation's results in the
diff --git a/lib/dpif.c b/lib/dpif.c
index dd77ebf..7a88bb9 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -1116,7 +1116,7 @@ dpif_execute_helper_userspace_cb(void *aux, struct ofpbuf *packet,
*
* This helps with actions that a given 'dpif' doesn't implement directly. */
static int
-dpif_execute_with_help(struct dpif *dpif, struct dpif_execute *execute)
+dpif_execute_with_help(struct dpif *dpif, const struct dpif_execute *execute)
{
struct dpif_execute_helper_aux aux;
enum odp_key_fitness fit;
@@ -1144,7 +1144,7 @@ dpif_execute_with_help(struct dpif *dpif, struct dpif_execute *execute)
}
static int
-dpif_execute__(struct dpif *dpif, struct dpif_execute *execute)
+dpif_execute__(struct dpif *dpif, const struct dpif_execute *execute)
{
int error;
More information about the dev
mailing list