mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
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>
This commit is contained in:
parent
cbd531bebb
commit
91b7514cdf
3 changed files with 11 additions and 6 deletions
|
@ -351,7 +351,7 @@ int ovs_vport_send(struct vport *vport, struct sk_buff *skb)
|
|||
{
|
||||
int sent = vport->ops->send(vport, skb);
|
||||
|
||||
if (likely(sent)) {
|
||||
if (likely(sent > 0)) {
|
||||
struct pcpu_tstats *stats;
|
||||
|
||||
stats = this_cpu_ptr(vport->percpu_stats);
|
||||
|
@ -360,7 +360,12 @@ int ovs_vport_send(struct vport *vport, struct sk_buff *skb)
|
|||
stats->tx_packets++;
|
||||
stats->tx_bytes += sent;
|
||||
u64_stats_update_end(&stats->syncp);
|
||||
}
|
||||
} else if (sent < 0) {
|
||||
ovs_vport_record_error(vport, VPORT_E_TX_ERROR);
|
||||
kfree_skb(skb);
|
||||
} else
|
||||
ovs_vport_record_error(vport, VPORT_E_TX_DROPPED);
|
||||
|
||||
return sent;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue