Commit 95b9be64 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

rocker: linearize skb in case frags would not fit into tx descriptor

Suggested-by: default avatarScott Feldman <sfeldma@gmail.com>
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Acked-by: default avatarScott Feldman <sfeldma@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 21518a6e
...@@ -4157,8 +4157,11 @@ static netdev_tx_t rocker_port_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -4157,8 +4157,11 @@ static netdev_tx_t rocker_port_xmit(struct sk_buff *skb, struct net_device *dev)
skb->data, skb_headlen(skb)); skb->data, skb_headlen(skb));
if (err) if (err)
goto nest_cancel; goto nest_cancel;
if (skb_shinfo(skb)->nr_frags > ROCKER_TX_FRAGS_MAX) if (skb_shinfo(skb)->nr_frags > ROCKER_TX_FRAGS_MAX) {
goto nest_cancel; err = skb_linearize(skb);
if (err)
goto unmap_frags;
}
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
const skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
......
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