From: Gregory Haskins <ghaskins@novell.com>
To: alacrityvm-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [NET PATCH 5/9] venet: cache the ringlen values at init
Date: Wed, 14 Oct 2009 11:59:12 -0400 [thread overview]
Message-ID: <20091014155912.18864.83106.stgit@dev.haskins.net> (raw)
In-Reply-To: <20091014154457.18864.28382.stgit@dev.haskins.net>
We want to prevent the condition where changes to the module-params
could affect the run-time validity of the ringstate
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
---
drivers/net/vbus-enet.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vbus-enet.c b/drivers/net/vbus-enet.c
index 63237f3..fe9eeca 100644
--- a/drivers/net/vbus-enet.c
+++ b/drivers/net/vbus-enet.c
@@ -50,6 +50,7 @@ module_param(sg_enabled, int, 0444);
struct vbus_enet_queue {
struct ioq *queue;
struct ioq_notifier notifier;
+ unsigned long count;
};
struct vbus_enet_priv {
@@ -94,6 +95,8 @@ queue_init(struct vbus_enet_priv *priv,
q->queue->notifier = &q->notifier;
}
+ q->count = ringsize;
+
return 0;
}
@@ -222,7 +225,7 @@ tx_setup(struct vbus_enet_priv *priv)
/* pre-allocate our descriptor pool if pmtd is enabled */
if (priv->pmtd.enabled) {
struct vbus_device_proxy *dev = priv->vdev;
- size_t poollen = len * tx_ringlen;
+ size_t poollen = len * priv->txq.count;
char *pool;
int shmid;
@@ -251,7 +254,7 @@ tx_setup(struct vbus_enet_priv *priv)
/*
* Now populate each descriptor with an empty SG descriptor
*/
- for (i = 0; i < tx_ringlen; i++) {
+ for (i = 0; i < priv->txq.count; i++) {
struct venet_sg *vsg;
if (priv->pmtd.enabled) {
next prev parent reply other threads:[~2009-10-14 15:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 15:58 [NET PATCH 0/9] ZC/L4RO enhancements to alacrityvm::vbus-enet driver Gregory Haskins
2009-10-14 15:58 ` [NET PATCH 1/9] venet: Update maintainer Gregory Haskins
2009-10-14 15:58 ` [NET PATCH 2/9] venet: fix gso.hdr_len to report correct length Gregory Haskins
2009-10-14 15:59 ` [NET PATCH 3/9] venet: add pre-mapped tx descriptor feature Gregory Haskins
2009-10-14 15:59 ` [NET PATCH 4/9] venet: report actual used descriptor size Gregory Haskins
2009-10-14 15:59 ` Gregory Haskins [this message]
2009-10-14 15:59 ` [NET PATCH 6/9] venet: add eventq protocol Gregory Haskins
2009-10-14 15:59 ` [NET PATCH 7/9] venet: use an skblist for outstanding descriptors Gregory Haskins
2009-10-14 15:59 ` [NET PATCH 8/9] venet: add a tx-complete event for out-of-order support Gregory Haskins
2009-10-14 15:59 ` [NET PATCH 9/9] venet: add Layer-4 Reassembler Offload (L4RO) support Gregory Haskins
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=20091014155912.18864.83106.stgit@dev.haskins.net \
--to=ghaskins@novell.com \
--cc=alacrityvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--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 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).