From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/8 net-next] cnic: Convert ctx_flags to bit fields
Date: Wed, 13 Oct 2010 17:06:45 -0700 [thread overview]
Message-ID: <1287014811-10979-3-git-send-email-mchan@broadcom.com> (raw)
In-Reply-To: <1287014811-10979-2-git-send-email-mchan@broadcom.com>
so that we can additional bit definitions without requiring a spinlock.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 4 ++--
drivers/net/cnic.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 0fab720..311b2e6 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -1721,7 +1721,7 @@ static int cnic_bnx2x_iscsi_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
struct kcqe *cqes[1];
u32 hw_cid, type;
- if (!(ctx->ctx_flags & CTX_FL_OFFLD_START))
+ if (!test_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags))
goto skip_cfc_delete;
while (!time_after(jiffies, ctx->timestamp + (2 * HZ)))
@@ -1943,7 +1943,7 @@ static int cnic_bnx2x_connect(struct cnic_dev *dev, struct kwqe *wqes[],
ret = cnic_submit_kwqe_16(dev, L5CM_RAMROD_CMD_ID_TCP_CONNECT,
kwqe1->cid, ISCSI_CONNECTION_TYPE, &l5_data);
if (!ret)
- ctx->ctx_flags |= CTX_FL_OFFLD_START;
+ set_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags);
return ret;
}
diff --git a/drivers/net/cnic.h b/drivers/net/cnic.h
index 676d008..9907cc2 100644
--- a/drivers/net/cnic.h
+++ b/drivers/net/cnic.h
@@ -168,8 +168,8 @@ struct cnic_context {
wait_queue_head_t waitq;
int wait_cond;
unsigned long timestamp;
- u32 ctx_flags;
-#define CTX_FL_OFFLD_START 0x00000001
+ unsigned long ctx_flags;
+#define CTX_FL_OFFLD_START 0
u8 ulp_proto_id;
union {
struct cnic_iscsi *iscsi;
--
1.6.4.GIT
next prev parent reply other threads:[~2010-10-14 1:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-14 0:06 [PATCH 0/8 net-next] cnic: Bug fixes and 57712 support Michael Chan
2010-10-14 0:06 ` [PATCH 1/8 net-next] cnic: Add common cnic_request_irq() Michael Chan
2010-10-14 0:06 ` Michael Chan [this message]
2010-10-14 0:06 ` [PATCH 3/8 net-next] cnic: Add cnic_bnx2x_destroy_ramrod() Michael Chan
2010-10-14 0:06 ` [PATCH 4/8 net-next] cnic: Defer iscsi connection cleanup Michael Chan
2010-10-14 0:06 ` [PATCH 5/8 net-next] cnic: Add cnic_free_uio() Michael Chan
2010-10-14 0:06 ` [PATCH 6/8 net-next] cnic: Add cnic_uio_dev struct Michael Chan
2010-10-14 0:06 ` [PATCH 7/8 net-next] cnic: Decouple uio close from cnic shutdown Michael Chan
2010-10-14 0:06 ` [PATCH 8/8 net-next] cnic: Add support for 57712 device Michael Chan
2010-10-14 17:46 ` [PATCH 0/8 net-next] cnic: Bug fixes and 57712 support 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=1287014811-10979-3-git-send-email-mchan@broadcom.com \
--to=mchan@broadcom.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 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).