Thread (10 messages) read the whole thread 10 messages, 2 authors, 2017-03-16

Re: [net-next sample action optimization v2 4/4] Openvswitch: Refactor sample and recirc actions implementation

From: Pravin Shelar <hidden>
Date: 2017-03-16 17:29:26

On Tue, Mar 14, 2017 at 4:08 PM, Andy Zhou [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Added execute_or_defer_actions() that both sample and recirc
action's implementation can use.

Signed-off-by: Andy Zhou <redacted>
---
 net/openvswitch/actions.c | 96 +++++++++++++++++++++++++++++------------------
 1 file changed, 59 insertions(+), 37 deletions(-)
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 1638370..fd7d903 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
...
...
quoted hunk ↗ jump to hunk
@@ -1286,6 +1262,52 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
        return 0;
 }

+static int execute_or_defer_actions(struct datapath *dp, struct sk_buff *skb,
+                                   struct sw_flow_key *clone,
+                                   struct sw_flow_key *key,
+                                   u32 *recirc_id,
+                                   const struct nlattr *actions, int len)
+{
The action pointer can be checked if it is recirc or sample action. so
no need to pass pointer to recirc id.
we can pass the last and clone_key flags to this function to clone the
skb and key in this function itself. This would make code bit easy to
read.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help