From: frank.blaschka@de.ibm.com
To: jgarzik@pobox.com
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [patch 4/6] qeth: do not spin for SETIP ip assist command
Date: Fri, 02 Jan 2009 16:01:43 +0100 [thread overview]
Message-ID: <20090102150255.266826000@de.ibm.com> (raw)
In-Reply-To: 20090102150139.830998000@de.ibm.com
[-- Attachment #1: 608-qeth-nospin.diff --]
[-- Type: text/plain, Size: 2275 bytes --]
From: Frank Blaschka <frank.blaschka@de.ibm.com>
The ip assist hw command for setting an IP address last unacceptable
long so we can not spin while we waiting for the irq. Since we can
ensure process context for all occurrences of this command we can use
wait.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 40 +++++++++++++++++++++++++++-----------
1 file changed, 29 insertions(+), 11 deletions(-)
diff -urpN linux-2.6/drivers/s390/net/qeth_core_main.c linux-2.6-patched/drivers/s390/net/qeth_core_main.c
--- linux-2.6/drivers/s390/net/qeth_core_main.c 2009-01-02 10:22:07.000000000 +0100
+++ linux-2.6-patched/drivers/s390/net/qeth_core_main.c 2009-01-02 10:22:07.000000000 +0100
@@ -1685,6 +1685,7 @@ int qeth_send_control_data(struct qeth_c
unsigned long flags;
struct qeth_reply *reply = NULL;
unsigned long timeout;
+ struct qeth_ipa_cmd *cmd;
QETH_DBF_TEXT(TRACE, 2, "sendctl");
@@ -1731,17 +1732,34 @@ int qeth_send_control_data(struct qeth_c
wake_up(&card->wait_q);
return rc;
}
- while (!atomic_read(&reply->received)) {
- if (time_after(jiffies, timeout)) {
- spin_lock_irqsave(&reply->card->lock, flags);
- list_del_init(&reply->list);
- spin_unlock_irqrestore(&reply->card->lock, flags);
- reply->rc = -ETIME;
- atomic_inc(&reply->received);
- wake_up(&reply->wait_q);
- }
- cpu_relax();
- };
+
+ /* we have only one long running ipassist, since we can ensure
+ process context of this command we can sleep */
+ cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
+ if ((cmd->hdr.command == IPA_CMD_SETIP) &&
+ (cmd->hdr.prot_version == QETH_PROT_IPV4)) {
+ if (!wait_event_timeout(reply->wait_q,
+ atomic_read(&reply->received), timeout))
+ goto time_err;
+ } else {
+ while (!atomic_read(&reply->received)) {
+ if (time_after(jiffies, timeout))
+ goto time_err;
+ cpu_relax();
+ };
+ }
+
+ rc = reply->rc;
+ qeth_put_reply(reply);
+ return rc;
+
+time_err:
+ spin_lock_irqsave(&reply->card->lock, flags);
+ list_del_init(&reply->list);
+ spin_unlock_irqrestore(&reply->card->lock, flags);
+ reply->rc = -ETIME;
+ atomic_inc(&reply->received);
+ wake_up(&reply->wait_q);
rc = reply->rc;
qeth_put_reply(reply);
return rc;
--
next prev parent reply other threads:[~2009-01-02 15:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-02 15:01 [patch 0/6] s390: qeth fixes 2.6.29 frank.blaschka
2009-01-02 15:01 ` [patch 1/6] HiperSockets mcl string conversion (pre z9 mach) frank.blaschka
2009-01-05 1:36 ` David Miller
2009-01-02 15:01 ` [patch 2/6] qeth: exploit source MAC address for inbound layer3 packets frank.blaschka
2009-01-05 1:36 ` David Miller
2009-01-02 15:01 ` [patch 3/6] qeth: avoid crash in case of layer mismatch for VSWITCH frank.blaschka
2009-01-05 1:36 ` David Miller
2009-01-02 15:01 ` frank.blaschka [this message]
2009-01-05 1:37 ` [patch 4/6] qeth: do not spin for SETIP ip assist command David Miller
2009-01-02 15:01 ` [patch 5/6] qeth: No large send using EDDP for HiperSockets frank.blaschka
2009-01-05 1:37 ` David Miller
2009-01-02 15:01 ` [patch 6/6] qeth: get rid of extra argument after printk to dev_* conversion frank.blaschka
2009-01-05 1:37 ` David Miller
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=20090102150255.266826000@de.ibm.com \
--to=frank.blaschka@de.ibm.com \
--cc=jgarzik@pobox.com \
--cc=linux-s390@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 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.