Skip to content

Commit

Permalink
qede: Use 'skb_add_rx_frag()' instead of hand coding it
Browse files Browse the repository at this point in the history
Some lines of code can be merged into an equivalent 'skb_add_rx_frag()'
call which is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christophe JAILLET authored and David S. Miller committed Apr 5, 2021
1 parent 1ec3d02 commit 7190e9d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/ethernet/qlogic/qede/qede_fp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,12 +1209,9 @@ static int qede_rx_build_jumbo(struct qede_dev *edev,
dma_unmap_page(rxq->dev, bd->mapping,
PAGE_SIZE, DMA_FROM_DEVICE);

skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
bd->data, rxq->rx_headroom, cur_size);
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, bd->data,
rxq->rx_headroom, cur_size, PAGE_SIZE);

skb->truesize += PAGE_SIZE;
skb->data_len += cur_size;
skb->len += cur_size;
pkt_len -= cur_size;
}

Expand Down

0 comments on commit 7190e9d

Please sign in to comment.