3838#include "vport.h"
3939
4040static int do_execute_actions (struct datapath * dp , struct sk_buff * skb ,
41+ struct sw_flow_key * key ,
4142 const struct nlattr * attr , int len );
4243
4344static int make_writable (struct sk_buff * skb , int write_len )
@@ -410,16 +411,14 @@ static int do_output(struct datapath *dp, struct sk_buff *skb, int out_port)
410411}
411412
412413static int output_userspace (struct datapath * dp , struct sk_buff * skb ,
413- const struct nlattr * attr )
414+ struct sw_flow_key * key , const struct nlattr * attr )
414415{
415416 struct dp_upcall_info upcall ;
416417 const struct nlattr * a ;
417418 int rem ;
418419
419- BUG_ON (!OVS_CB (skb )-> pkt_key );
420-
421420 upcall .cmd = OVS_PACKET_CMD_ACTION ;
422- upcall .key = OVS_CB ( skb ) -> pkt_key ;
421+ upcall .key = key ;
423422 upcall .userdata = NULL ;
424423 upcall .portid = 0 ;
425424
@@ -445,7 +444,7 @@ static bool last_action(const struct nlattr *a, int rem)
445444}
446445
447446static int sample (struct datapath * dp , struct sk_buff * skb ,
448- const struct nlattr * attr )
447+ struct sw_flow_key * key , const struct nlattr * attr )
449448{
450449 const struct nlattr * acts_list = NULL ;
451450 const struct nlattr * a ;
@@ -493,7 +492,7 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
493492 * return the error code and let the caller (also
494493 * do_execute_actions()) free skb on error.
495494 */
496- return do_execute_actions (dp , sample_skb , a , rem );
495+ return do_execute_actions (dp , sample_skb , key , a , rem );
497496}
498497
499498static int execute_set_action (struct sk_buff * skb ,
@@ -544,6 +543,7 @@ static int execute_set_action(struct sk_buff *skb,
544543
545544/* Execute a list of actions against 'skb'. */
546545static int do_execute_actions (struct datapath * dp , struct sk_buff * skb ,
546+ struct sw_flow_key * key ,
547547 const struct nlattr * attr , int len )
548548{
549549 /* Every output action needs a separate clone of 'skb', but the common
@@ -569,7 +569,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
569569 break ;
570570
571571 case OVS_ACTION_ATTR_USERSPACE :
572- output_userspace (dp , skb , a );
572+ output_userspace (dp , skb , key , a );
573573 break ;
574574
575575 case OVS_ACTION_ATTR_PUSH_VLAN :
@@ -587,7 +587,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
587587 break ;
588588
589589 case OVS_ACTION_ATTR_SAMPLE :
590- err = sample (dp , skb , a );
590+ err = sample (dp , skb , key , a );
591591 if (unlikely (err )) /* skb already freed. */
592592 return err ;
593593 break ;
@@ -608,10 +608,12 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
608608}
609609
610610/* Execute a list of actions against 'skb'. */
611- int ovs_execute_actions (struct datapath * dp , struct sk_buff * skb )
611+ int ovs_execute_actions (struct datapath * dp , struct sk_buff * skb ,
612+ struct sw_flow_key * key )
612613{
613614 struct sw_flow_actions * acts = rcu_dereference (OVS_CB (skb )-> flow -> sf_acts );
614615
615616 OVS_CB (skb )-> tun_key = NULL ;
616- return do_execute_actions (dp , skb , acts -> actions , acts -> actions_len );
617+ return do_execute_actions (dp , skb , key ,
618+ acts -> actions , acts -> actions_len );
617619}
0 commit comments