Commit 6a3a1056 authored by Zhouyi Zhou's avatar Zhouyi Zhou Committed by Doug Ledford

infiniband: nes: return value of skb_linearize should be handled

Return value of skb_linearize should be handled in function
nes_netdev_start_xmit.

Compiled in x86_64
Signed-off-by: default avatarZhouyi Zhou <yizhouzhou@ict.ac.cn>
Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 3b9d9650
...@@ -662,10 +662,14 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -662,10 +662,14 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
nesnic->sq_head &= nesnic->sq_size-1; nesnic->sq_head &= nesnic->sq_size-1;
} }
} else { } else {
nesvnic->linearized_skbs++;
hoffset = skb_transport_header(skb) - skb->data; hoffset = skb_transport_header(skb) - skb->data;
nhoffset = skb_network_header(skb) - skb->data; nhoffset = skb_network_header(skb) - skb->data;
skb_linearize(skb); if (skb_linearize(skb)) {
nesvnic->tx_sw_dropped++;
kfree_skb(skb);
return NETDEV_TX_OK;
}
nesvnic->linearized_skbs++;
skb_set_transport_header(skb, hoffset); skb_set_transport_header(skb, hoffset);
skb_set_network_header(skb, nhoffset); skb_set_network_header(skb, nhoffset);
if (!nes_nic_send(skb, netdev)) if (!nes_nic_send(skb, netdev))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment