diff options
author | Jiri Pirko <jiri@resnulli.us> | 2015-08-02 20:56:38 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-03 14:22:26 -0700 |
commit | 95b9be64d1683c4552ab94d94c08bf833561b1c4 (patch) | |
tree | 0801f771ed8cbdc7104d74e3538c0919a9a4a47d /drivers/net/ethernet/rocker/rocker.c | |
parent | 21518a6eb92afa9c285ae7b33dd9357a99224b8f (diff) | |
download | linux-95b9be64d1683c4552ab94d94c08bf833561b1c4.tar.bz2 |
rocker: linearize skb in case frags would not fit into tx descriptor
Suggested-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/rocker/rocker.c')
-rw-r--r-- | drivers/net/ethernet/rocker/rocker.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c index 730bdc01b944..4cd5a71ad45e 100644 --- a/drivers/net/ethernet/rocker/rocker.c +++ b/drivers/net/ethernet/rocker/rocker.c @@ -4157,8 +4157,11 @@ static netdev_tx_t rocker_port_xmit(struct sk_buff *skb, struct net_device *dev) skb->data, skb_headlen(skb)); if (err) goto nest_cancel; - if (skb_shinfo(skb)->nr_frags > ROCKER_TX_FRAGS_MAX) - goto nest_cancel; + if (skb_shinfo(skb)->nr_frags > ROCKER_TX_FRAGS_MAX) { + err = skb_linearize(skb); + if (err) + goto unmap_frags; + } for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { const skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |