All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Chen <wangchen@cn.fujitsu.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: NETDEV <netdev@vger.kernel.org>
Subject: [PATCH]&[Question] netdevice: Use netdev_priv()
Date: Fri, 01 Aug 2008 17:50:15 +0800	[thread overview]
Message-ID: <4892DC57.2060101@cn.fujitsu.com> (raw)

Dave

This mail is a question mail more than patch mail.
In your commit "netdev: netdev_priv() can now be sane again.",
you said netdev_priv() != netdev->priv, because that time,
netdev->priv = ((char *)dev +((sizeof(struct net_device) +(sizeof(struct net_device_subqueue) *
		(queue_count - 1)) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST))
But now, after you do TX multiqueue improvement.
netdev->priv == netdev_priv() again.

That make me think, what the use of netdev->priv?
We have netdev_priv() and use it flexibly. Why don't kill netdev->priv?

---
>From be26ade29c6a3d0002492f7aab25258cb78ab597 Mon Sep 17 00:00:00 2001
From: Wang Chen <wangchen@cn.fujitsu.com>
Date: Fri, 1 Aug 2008 16:59:59 +0800
Subject: [PATCH] netdevice: Use netdev_priv()

dev->priv is now point to private data again.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
 net/core/dev.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 63d6bcd..9b73624 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4255,11 +4255,8 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
 	dev->num_tx_queues = queue_count;
 	dev->real_num_tx_queues = queue_count;
 
-	if (sizeof_priv) {
-		dev->priv = ((char *)dev +
-			     ((sizeof(struct net_device) + NETDEV_ALIGN_CONST)
-			      & ~NETDEV_ALIGN_CONST));
-	}
+	if (sizeof_priv)
+		dev->priv = netdev_priv(dev);
 
 	dev->gso_max_size = GSO_MAX_SIZE;
 
-- 
1.5.3.4




             reply	other threads:[~2008-08-01  9:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-01  9:50 Wang Chen [this message]
2008-08-01 10:08 ` [PATCH]&[Question] netdevice: Use netdev_priv() David Miller
2008-08-01 10:16   ` Wang Chen
2008-08-01 10:24     ` David Miller
2008-08-01 10:35       ` Wang Chen
2008-08-01 11:05         ` David Miller
2008-08-05  9:55           ` Wang Chen
2008-08-05 10:04             ` David Miller
2008-08-05 17:51               ` Divy Le Ray
2008-08-06  4:21                 ` Wang Chen

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=4892DC57.2060101@cn.fujitsu.com \
    --to=wangchen@cn.fujitsu.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.