diff options
author | Eric Dumazet <edumazet@google.com> | 2014-10-17 15:45:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-17 23:56:33 -0400 |
commit | f2d9da1a8375cbe53df5b415d059429013a3a79f (patch) | |
tree | 078d45aba9c17fabe189b155397b0d0158ac1328 /drivers/net/ethernet/brocade | |
parent | a28205437b41a2c1333c1599ce1e8f09af7b00d6 (diff) |
bna: fix skb->truesize underestimation
skb->truesize is not meant to be tracking amount of used bytes
in an skb, but amount of reserved/consumed bytes in memory.
For instance, if we use a single byte in last page fragment,
we have to account the full size of the fragment.
skb->truesize can be very different from skb->len, that has
a very specific safety purpose.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/brocade')
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bnad.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index 153cafac323c..c3861de9dc81 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c | |||
@@ -552,6 +552,7 @@ bnad_cq_setup_skb_frags(struct bna_rcb *rcb, struct sk_buff *skb, | |||
552 | 552 | ||
553 | len = (vec == nvecs) ? | 553 | len = (vec == nvecs) ? |
554 | last_fraglen : unmap->vector.len; | 554 | last_fraglen : unmap->vector.len; |
555 | skb->truesize += unmap->vector.len; | ||
555 | totlen += len; | 556 | totlen += len; |
556 | 557 | ||
557 | skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags, | 558 | skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags, |
@@ -563,7 +564,6 @@ bnad_cq_setup_skb_frags(struct bna_rcb *rcb, struct sk_buff *skb, | |||
563 | 564 | ||
564 | skb->len += totlen; | 565 | skb->len += totlen; |
565 | skb->data_len += totlen; | 566 | skb->data_len += totlen; |
566 | skb->truesize += totlen; | ||
567 | } | 567 | } |
568 | 568 | ||
569 | static inline void | 569 | static inline void |