diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-05-13 11:22:34 -0400 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2013-06-14 18:09:10 -0400 |
commit | 91b7514cdff406ad8f63d09b74f664c37bed2e01 (patch) | |
tree | e74b566546cfb0ec1b48baa9cc39acd647256bd9 /net/openvswitch/vport.c | |
parent | cbd531bebb02bc6c0fc3619a2cfc32f7d8843b18 (diff) |
openvswitch: Unify vport error stats handling.
Following patch changes vport->send return type so that vport
layer can do error accounting.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net/openvswitch/vport.c')
-rw-r--r-- | net/openvswitch/vport.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 720623190eaa..7f20f6d1be94 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c | |||
@@ -351,7 +351,7 @@ int ovs_vport_send(struct vport *vport, struct sk_buff *skb) | |||
351 | { | 351 | { |
352 | int sent = vport->ops->send(vport, skb); | 352 | int sent = vport->ops->send(vport, skb); |
353 | 353 | ||
354 | if (likely(sent)) { | 354 | if (likely(sent > 0)) { |
355 | struct pcpu_tstats *stats; | 355 | struct pcpu_tstats *stats; |
356 | 356 | ||
357 | stats = this_cpu_ptr(vport->percpu_stats); | 357 | stats = this_cpu_ptr(vport->percpu_stats); |
@@ -360,7 +360,12 @@ int ovs_vport_send(struct vport *vport, struct sk_buff *skb) | |||
360 | stats->tx_packets++; | 360 | stats->tx_packets++; |
361 | stats->tx_bytes += sent; | 361 | stats->tx_bytes += sent; |
362 | u64_stats_update_end(&stats->syncp); | 362 | u64_stats_update_end(&stats->syncp); |
363 | } | 363 | } else if (sent < 0) { |
364 | ovs_vport_record_error(vport, VPORT_E_TX_ERROR); | ||
365 | kfree_skb(skb); | ||
366 | } else | ||
367 | ovs_vport_record_error(vport, VPORT_E_TX_DROPPED); | ||
368 | |||
364 | return sent; | 369 | return sent; |
365 | } | 370 | } |
366 | 371 | ||