From: Ben Pfaff Date: Tue, 1 Mar 2011 23:31:32 +0000 (-0800) Subject: datapath: Simplify send_frags(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81158e4f4a7071c689aac7ac4fb1389c8e8d3875;p=openvswitch datapath: Simplify send_frags(). This should make no difference at runtime, but it is shorter and looks more straightforward to me. Signed-off-by: Ben Pfaff Acked-by: Jesse Gross --- diff --git a/datapath/tunnel.c b/datapath/tunnel.c index f1711f1f..07bb00b6 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -1105,25 +1105,21 @@ static int send_frags(struct sk_buff *skb, const struct tnl_mutable_config *mutable) { int sent_len; - int err; sent_len = 0; while (skb) { struct sk_buff *next = skb->next; int frag_len = skb->len - mutable->tunnel_hlen; + int err; skb->next = NULL; memset(IPCB(skb), 0, sizeof(*IPCB(skb))); err = ip_local_out(skb); - if (likely(net_xmit_eval(err) == 0)) - sent_len += frag_len; - else { - skb = next; - goto free_frags; - } - skb = next; + if (unlikely(net_xmit_eval(err))) + goto free_frags; + sent_len += frag_len; } return sent_len;