netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] openvswitch: Print error when ovs_execute_actions() fails
@ 2019-08-05  2:56 Yifeng Sun
  2019-08-05 20:50 ` Pravin Shelar
  2019-08-06 21:38 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Yifeng Sun @ 2019-08-05  2:56 UTC (permalink / raw)
  To: netdev, pshelar, gvrose8192; +Cc: Yifeng Sun

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.
---
v1->v2: Fixed according to Pravin's review.

 net/openvswitch/datapath.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 892287d..12d9850 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)
 	struct dp_stats_percpu *stats;
 	u64 *stats_counter;
 	u32 n_mask_hit;
+	int error;
 
 	stats = this_cpu_ptr(dp->stats_percpu);
 
@@ -229,7 +230,6 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
 	flow = ovs_flow_tbl_lookup_stats(&dp->table, key, &n_mask_hit);
 	if (unlikely(!flow)) {
 		struct dp_upcall_info upcall;
-		int error;
 
 		memset(&upcall, 0, sizeof(upcall));
 		upcall.cmd = OVS_PACKET_CMD_MISS;
@@ -246,7 +246,10 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
 
 	ovs_flow_stats_update(flow, key->tp.flags, skb);
 	sf_acts = rcu_dereference(flow->sf_acts);
-	ovs_execute_actions(dp, skb, sf_acts, key);
+	error = ovs_execute_actions(dp, skb, sf_acts, key);
+	if (unlikely(error))
+		net_dbg_ratelimited("ovs: action execution error on datapath %s: %d\n",
+							ovs_dp_name(dp), error);
 
 	stats_counter = &stats->n_hit;
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] openvswitch: Print error when ovs_execute_actions() fails
  2019-08-05  2:56 [PATCH net-next v2] openvswitch: Print error when ovs_execute_actions() fails Yifeng Sun
@ 2019-08-05 20:50 ` Pravin Shelar
  2019-08-05 21:43   ` Yifeng Sun
  2019-08-06 21:38 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Pravin Shelar @ 2019-08-05 20:50 UTC (permalink / raw)
  To: Yifeng Sun; +Cc: Linux Kernel Network Developers, Greg Rose

On Sun, Aug 4, 2019 at 7:56 PM Yifeng Sun <pkusunyifeng@gmail.com> wrote:
>
> 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.
> ---
> v1->v2: Fixed according to Pravin's review.
>

Looks good.
Acked-by: Pravin B Shelar <pshelar@ovn.org>

Thanks,
Pravin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] openvswitch: Print error when ovs_execute_actions() fails
  2019-08-05 20:50 ` Pravin Shelar
@ 2019-08-05 21:43   ` Yifeng Sun
  0 siblings, 0 replies; 4+ messages in thread
From: Yifeng Sun @ 2019-08-05 21:43 UTC (permalink / raw)
  To: Pravin Shelar; +Cc: Linux Kernel Network Developers, Greg Rose

Thanks Pravin!

Best,
Yifeng

On Mon, Aug 5, 2019 at 1:49 PM Pravin Shelar <pshelar@ovn.org> wrote:
>
> On Sun, Aug 4, 2019 at 7:56 PM Yifeng Sun <pkusunyifeng@gmail.com> wrote:
> >
> > 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.
> > ---
> > v1->v2: Fixed according to Pravin's review.
> >
>
> Looks good.
> Acked-by: Pravin B Shelar <pshelar@ovn.org>
>
> Thanks,
> Pravin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] openvswitch: Print error when ovs_execute_actions() fails
  2019-08-05  2:56 [PATCH net-next v2] openvswitch: Print error when ovs_execute_actions() fails Yifeng Sun
  2019-08-05 20:50 ` Pravin Shelar
@ 2019-08-06 21:38 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-08-06 21:38 UTC (permalink / raw)
  To: pkusunyifeng; +Cc: netdev, pshelar, gvrose8192

From: Yifeng Sun <pkusunyifeng@gmail.com>
Date: Sun,  4 Aug 2019 19:56:11 -0700

> 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.
> ---
> v1->v2: Fixed according to Pravin's review.

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-06 21:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-05  2:56 [PATCH net-next v2] openvswitch: Print error when ovs_execute_actions() fails Yifeng Sun
2019-08-05 20:50 ` Pravin Shelar
2019-08-05 21:43   ` Yifeng Sun
2019-08-06 21:38 ` David Miller

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).