From: Jason Wang Date: Thu, 27 Aug 2015 06:53:06 +0000 (+0800) Subject: virtio-net: avoid unnecessary sg initialzation X-Git-Tag: omap-for-v4.3/fixes-rc1~110^2~64 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=547c890cfd26010e01b3faf98f29ca9b2252c8d8;p=pandora-kernel.git virtio-net: avoid unnecessary sg initialzation Usually an skb does not have up to MAX_SKB_FRAGS frags. So no need to initialize the unuse part of sg. This patch initialize the sg based on the real number it will used: - during xmit, it could be inferred from nr_frags and can_push. - for small receive buffer, it will also be 2. Cc: Michael S. Tsirkin Signed-off-by: Jason Wang Signed-off-by: David S. Miller --- Reading git-diff-tree failed