virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	virtualization@lists.linux-foundation.org
Subject: [PATCH 2/5] virtio-net: remove unused skb_vnet_hdr->num_sg field
Date: Wed, 17 Oct 2012 00:00:49 +1030	[thread overview]
Message-ID: <1350394252-23934-2-git-send-email-rusty@rustcorp.com.au> (raw)
In-Reply-To: <1350394252-23934-1-git-send-email-rusty@rustcorp.com.au>

From: "Michael S. Tsirkin" <mst@redhat.com>

[Split from "correct capacity math on ring full" -- Rusty]

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 drivers/net/virtio_net.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index cbf8b06..20880fb 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -95,7 +95,6 @@ struct skb_vnet_hdr {
 		struct virtio_net_hdr hdr;
 		struct virtio_net_hdr_mrg_rxbuf mhdr;
 	};
-	unsigned int num_sg;
 };
 
 struct padded_vnet_hdr {
@@ -581,6 +580,7 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
 {
 	struct skb_vnet_hdr *hdr = skb_vnet_hdr(skb);
 	const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
+	unsigned num_sg;
 
 	pr_debug("%s: xmit %p %pM\n", vi->dev->name, skb, dest);
 
@@ -619,8 +619,8 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
 	else
 		sg_set_buf(vi->tx_sg, &hdr->hdr, sizeof hdr->hdr);
 
-	hdr->num_sg = skb_to_sgvec(skb, vi->tx_sg + 1, 0, skb->len) + 1;
-	return virtqueue_add_buf(vi->svq, vi->tx_sg, hdr->num_sg,
+	num_sg = skb_to_sgvec(skb, vi->tx_sg + 1, 0, skb->len) + 1;
+	return virtqueue_add_buf(vi->svq, vi->tx_sg, num_sg,
 				 0, skb, GFP_ATOMIC);
 }
 
-- 
1.7.9.5

  reply	other threads:[~2012-10-16 13:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 13:30 [PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue Rusty Russell
2012-10-16 13:30 ` Rusty Russell [this message]
2012-10-16 13:30 ` [PATCH 3/5] virtio-net: correct capacity math on ring full Rusty Russell
2012-10-16 13:30 ` [PATCH 4/5] virtio_net: don't rely on virtqueue_add_buf() returning capacity Rusty Russell
2012-10-16 13:47   ` Michael S. Tsirkin
2012-10-16 13:30 ` [PATCH 5/5] virtio: make virtqueue_add_buf() returning 0 on success, not capacity Rusty Russell
2012-10-16 13:49   ` Rusty Russell
2012-10-16 13:53 ` [PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue Michael S. Tsirkin
2012-10-16 14:19   ` Rusty Russell
2012-10-16 14:34 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350394252-23934-2-git-send-email-rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).