From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933408AbbH0WwN (ORCPT ); Thu, 27 Aug 2015 18:52:13 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:47891 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933381AbbH0WwL (ORCPT ); Thu, 27 Aug 2015 18:52:11 -0400 Date: Thu, 27 Aug 2015 15:52:10 -0700 (PDT) Message-Id: <20150827.155210.1669360284386445387.davem@davemloft.net> To: jasowang@redhat.com Cc: mst@redhat.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] virtio-net: avoid unnecessary sg initialzation From: David Miller In-Reply-To: <1440658386-9544-1-git-send-email-jasowang@redhat.com> References: <1440658386-9544-1-git-send-email-jasowang@redhat.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 27 Aug 2015 15:52:11 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Wang Date: Thu, 27 Aug 2015 14:53:06 +0800 > 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 This looks fine, thanks Jason.