-
由 Doron Roberts-Kedes 提交于
decrypt_skb fails if the number of sg elements required to map it is greater than MAX_SKB_FRAGS. nsg must always be calculated, but skb_cow_data adds unnecessary memcpy's for the zerocopy case. The new function skb_nsg calculates the number of scatterlist elements required to map the skb without the extra overhead of skb_cow_data. This patch reduces memcpy by 50% on my encrypted NBD benchmarks. Reported-by: NVakul Garg <Vakul.garg@nxp.com> Reviewed-by: NVakul Garg <Vakul.garg@nxp.com> Tested-by: NVakul Garg <Vakul.garg@nxp.com> Signed-off-by: NDoron Roberts-Kedes <doronrk@fb.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
0927f71d