summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2008-03-16 22:22:54 +0000
committerJeff Garzik <jeff@garzik.org>2008-03-26 00:18:46 -0400
commitfa3a6cb4a6feacd712ca58fd1c6e99b33fde5d5d (patch)
tree9744e665b468b29d48218d5e9683fdc2c0752c2c /drivers
parent2f220e305b23ab277aa0f91e2a65978f5cc1a785 (diff)
downloadop-kernel-dev-fa3a6cb4a6feacd712ca58fd1c6e99b33fde5d5d.zip
op-kernel-dev-fa3a6cb4a6feacd712ca58fd1c6e99b33fde5d5d.tar.gz
annotate cxgb3 (ab)uses of skb->priority/skb->csum
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index 901c824..ff9c013 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -833,10 +833,26 @@ static int do_trace(struct t3cdev *dev, struct sk_buff *skb)
return 0;
}
+/*
+ * That skb would better have come from process_responses() where we abuse
+ * ->priority and ->csum to carry our data. NB: if we get to per-arch
+ * ->csum, the things might get really interesting here.
+ */
+
+static inline u32 get_hwtid(struct sk_buff *skb)
+{
+ return ntohl((__force __be32)skb->priority) >> 8 & 0xfffff;
+}
+
+static inline u32 get_opcode(struct sk_buff *skb)
+{
+ return G_OPCODE(ntohl((__force __be32)skb->csum));
+}
+
static int do_term(struct t3cdev *dev, struct sk_buff *skb)
{
- unsigned int hwtid = ntohl(skb->priority) >> 8 & 0xfffff;
- unsigned int opcode = G_OPCODE(ntohl(skb->csum));
+ unsigned int hwtid = get_hwtid(skb);
+ unsigned int opcode = get_opcode(skb);
struct t3c_tid_entry *t3c_tid;
t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid);
@@ -914,7 +930,7 @@ int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n)
{
while (n--) {
struct sk_buff *skb = *skbs++;
- unsigned int opcode = G_OPCODE(ntohl(skb->csum));
+ unsigned int opcode = get_opcode(skb);
int ret = cpl_handlers[opcode] (dev, skb);
#if VALIDATE_TID
OpenPOWER on IntegriCloud