aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch
diff options
context:
space:
mode:
authorYifeng Sun <pkusunyifeng@gmail.com>2019-08-04 22:56:11 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-06 17:38:12 -0400
commitaa733660dbd8d9192b8c528ae0f4b84f3fef74e4 (patch)
tree2ba07acdc7904a9350a6a0b7761c87bea3ec2256 /net/openvswitch
parentef68de56c7ad6f708bee8db5e08b83013083e757 (diff)
openvswitch: Print error when ovs_execute_actions() fails
Currently in function ovs_dp_process_packet(), return values of ovs_execute_actions() are silently discarded. This patch prints out an debug message when error happens so as to provide helpful hints for debugging. Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch')
-rw-r--r--net/openvswitch/datapath.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 892287d06c17..12d985029eb1 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -222,6 +222,7 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
222 struct dp_stats_percpu *stats; 222 struct dp_stats_percpu *stats;
223 u64 *stats_counter; 223 u64 *stats_counter;
224 u32 n_mask_hit; 224 u32 n_mask_hit;
225 int error;
225 226
226 stats = this_cpu_ptr(dp->stats_percpu); 227 stats = this_cpu_ptr(dp->stats_percpu);
227 228
@@ -229,7 +230,6 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
229 flow = ovs_flow_tbl_lookup_stats(&dp->table, key, &n_mask_hit); 230 flow = ovs_flow_tbl_lookup_stats(&dp->table, key, &n_mask_hit);
230 if (unlikely(!flow)) { 231 if (unlikely(!flow)) {
231 struct dp_upcall_info upcall; 232 struct dp_upcall_info upcall;
232 int error;
233 233
234 memset(&upcall, 0, sizeof(upcall)); 234 memset(&upcall, 0, sizeof(upcall));
235 upcall.cmd = OVS_PACKET_CMD_MISS; 235 upcall.cmd = OVS_PACKET_CMD_MISS;
@@ -246,7 +246,10 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
246 246
247 ovs_flow_stats_update(flow, key->tp.flags, skb); 247 ovs_flow_stats_update(flow, key->tp.flags, skb);
248 sf_acts = rcu_dereference(flow->sf_acts); 248 sf_acts = rcu_dereference(flow->sf_acts);
249 ovs_execute_actions(dp, skb, sf_acts, key); 249 error = ovs_execute_actions(dp, skb, sf_acts, key);
250 if (unlikely(error))
251 net_dbg_ratelimited("ovs: action execution error on datapath %s: %d\n",
252 ovs_dp_name(dp), error);
250 253
251 stats_counter = &stats->n_hit; 254 stats_counter = &stats->n_hit;
252 255