rocker: linearize skb in case frags would not fit into tx descriptor
authorJiri Pirko <jiri@resnulli.us>
Sun, 2 Aug 2015 18:56:38 +0000 (20:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Aug 2015 21:22:26 +0000 (14:22 -0700)
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>
drivers/net/ethernet/rocker/rocker.c

index 730bdc0..4cd5a71 100644 (file)
@@ -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];