projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[deliverable/linux.git]
/
drivers
/
block
/
aoe
/
aoecmd.c
diff --git
a/drivers/block/aoe/aoecmd.c
b/drivers/block/aoe/aoecmd.c
index 97f7f535f41208cfcb695bd7d8f7d7b1f928c13b..99672017ca56f5212229db8fb9312e7c81842e7b 100644
(file)
--- a/
drivers/block/aoe/aoecmd.c
+++ b/
drivers/block/aoe/aoecmd.c
@@
-9,6
+9,7
@@
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/genhd.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/genhd.h>
+#include <net/net_namespace.h>
#include <asm/unaligned.h>
#include "aoe.h"
#include <asm/unaligned.h>
#include "aoe.h"
@@
-27,11
+28,10
@@
new_skb(ulong len)
skb = alloc_skb(len, GFP_ATOMIC);
if (skb) {
skb = alloc_skb(len, GFP_ATOMIC);
if (skb) {
- skb->nh.raw = skb->mac.raw = skb->data;
+ skb_reset_mac_header(skb);
+ skb_reset_network_header(skb);
skb->protocol = __constant_htons(ETH_P_AOE);
skb->priority = 0;
skb->protocol = __constant_htons(ETH_P_AOE);
skb->priority = 0;
- skb_put(skb, len);
- memset(skb->head, 0, len);
skb->next = skb->prev = NULL;
/* tell the network layer not to perform IP checksums
skb->next = skb->prev = NULL;
/* tell the network layer not to perform IP checksums
@@
-120,10
+120,10
@@
aoecmd_ata_rw(struct aoedev *d, struct frame *f)
/* initialize the headers & frame */
skb = f->skb;
/* initialize the headers & frame */
skb = f->skb;
- h =
(struct aoe_hdr *) skb->mac.raw
;
+ h =
aoe_hdr(skb)
;
ah = (struct aoe_atahdr *) (h+1);
ah = (struct aoe_atahdr *) (h+1);
- skb
->len = sizeof *h + sizeof *ah
;
- memset(h, 0,
ETH_ZLEN
);
+ skb
_put(skb, sizeof *h + sizeof *ah)
;
+ memset(h, 0,
skb->len
);
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
f->buf = buf;
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
f->buf = buf;
@@
-149,7
+149,6
@@
aoecmd_ata_rw(struct aoedev *d, struct frame *f)
skb->len += bcnt;
skb->data_len = bcnt;
} else {
skb->len += bcnt;
skb->data_len = bcnt;
} else {
- skb->len = ETH_ZLEN;
writebit = 0;
}
writebit = 0;
}
@@
-196,20
+195,21
@@
aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail)
sl = sl_tail = NULL;
read_lock(&dev_base_lock);
sl = sl_tail = NULL;
read_lock(&dev_base_lock);
- for
(ifp = dev_base; ifp; dev_put(ifp), ifp = ifp->next
) {
+ for
_each_netdev(&init_net, ifp
) {
dev_hold(ifp);
if (!is_aoe_netif(ifp))
dev_hold(ifp);
if (!is_aoe_netif(ifp))
-
continue
;
+
goto cont
;
skb = new_skb(sizeof *h + sizeof *ch);
if (skb == NULL) {
printk(KERN_INFO "aoe: skb alloc failure\n");
skb = new_skb(sizeof *h + sizeof *ch);
if (skb == NULL) {
printk(KERN_INFO "aoe: skb alloc failure\n");
-
continue
;
+
goto cont
;
}
}
+ skb_put(skb, sizeof *h + sizeof *ch);
skb->dev = ifp;
if (sl_tail == NULL)
sl_tail = skb;
skb->dev = ifp;
if (sl_tail == NULL)
sl_tail = skb;
- h =
(struct aoe_hdr *) skb->mac.raw
;
+ h =
aoe_hdr(skb)
;
memset(h, 0, sizeof *h + sizeof *ch);
memset(h->dst, 0xff, sizeof h->dst);
memset(h, 0, sizeof *h + sizeof *ch);
memset(h->dst, 0xff, sizeof h->dst);
@@
-222,6
+222,8
@@
aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail)
skb->next = sl;
sl = skb;
skb->next = sl;
sl = skb;
+cont:
+ dev_put(ifp);
}
read_unlock(&dev_base_lock);
}
read_unlock(&dev_base_lock);
@@
-243,6
+245,7
@@
freeframe(struct aoedev *d)
continue;
if (atomic_read(&skb_shinfo(f->skb)->dataref) == 1) {
skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
continue;
if (atomic_read(&skb_shinfo(f->skb)->dataref) == 1) {
skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
+ skb_trim(f->skb, 0);
return f;
}
n++;
return f;
}
n++;
@@
-301,7
+304,7
@@
rexmit(struct aoedev *d, struct frame *f)
aoechr_error(buf);
skb = f->skb;
aoechr_error(buf);
skb = f->skb;
- h =
(struct aoe_hdr *) skb->mac.raw
;
+ h =
aoe_hdr(skb)
;
ah = (struct aoe_atahdr *) (h+1);
f->tag = n;
h->tag = cpu_to_be32(n);
ah = (struct aoe_atahdr *) (h+1);
f->tag = n;
h->tag = cpu_to_be32(n);
@@
-530,8
+533,8
@@
aoecmd_ata_rsp(struct sk_buff *skb)
char ebuf[128];
u16 aoemajor;
char ebuf[128];
u16 aoemajor;
- hin =
(struct aoe_hdr *) skb->mac.raw
;
- aoemajor = be16_to_cpu(
hin->major
);
+ hin =
aoe_hdr(skb)
;
+ aoemajor = be16_to_cpu(
get_unaligned(&hin->major)
);
d = aoedev_by_aoeaddr(aoemajor, hin->minor);
if (d == NULL) {
snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response "
d = aoedev_by_aoeaddr(aoemajor, hin->minor);
if (d == NULL) {
snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response "
@@
-543,7
+546,7
@@
aoecmd_ata_rsp(struct sk_buff *skb)
spin_lock_irqsave(&d->lock, flags);
spin_lock_irqsave(&d->lock, flags);
- n = be32_to_cpu(
hin->tag
);
+ n = be32_to_cpu(
get_unaligned(&hin->tag)
);
f = getframe(d, n);
if (f == NULL) {
calc_rttavg(d, -tsince(n));
f = getframe(d, n);
if (f == NULL) {
calc_rttavg(d, -tsince(n));
@@
-551,9
+554,9
@@
aoecmd_ata_rsp(struct sk_buff *skb)
snprintf(ebuf, sizeof ebuf,
"%15s e%d.%d tag=%08x@%08lx\n",
"unexpected rsp",
snprintf(ebuf, sizeof ebuf,
"%15s e%d.%d tag=%08x@%08lx\n",
"unexpected rsp",
- be16_to_cpu(
hin->major
),
+ be16_to_cpu(
get_unaligned(&hin->major)
),
hin->minor,
hin->minor,
- be32_to_cpu(
hin->tag
),
+ be32_to_cpu(
get_unaligned(&hin->tag)
),
jiffies);
aoechr_error(ebuf);
return;
jiffies);
aoechr_error(ebuf);
return;
@@
-562,7
+565,7
@@
aoecmd_ata_rsp(struct sk_buff *skb)
calc_rttavg(d, tsince(f->tag));
ahin = (struct aoe_atahdr *) (hin+1);
calc_rttavg(d, tsince(f->tag));
ahin = (struct aoe_atahdr *) (hin+1);
- hout =
(struct aoe_hdr *) f->skb->mac.raw
;
+ hout =
aoe_hdr(f->skb)
;
ahout = (struct aoe_atahdr *) (hout+1);
buf = f->buf;
ahout = (struct aoe_atahdr *) (hout+1);
buf = f->buf;
@@
-632,7
+635,7
@@
aoecmd_ata_rsp(struct sk_buff *skb)
printk(KERN_INFO
"aoe: unrecognized ata command %2.2Xh for %d.%d\n",
ahout->cmdstat,
printk(KERN_INFO
"aoe: unrecognized ata command %2.2Xh for %d.%d\n",
ahout->cmdstat,
- be16_to_cpu(
hin->major
),
+ be16_to_cpu(
get_unaligned(&hin->major)
),
hin->minor);
}
}
hin->minor);
}
}
@@
-650,7
+653,7
@@
aoecmd_ata_rsp(struct sk_buff *skb)
disk_stat_add(disk, sectors[rw], n_sect);
disk_stat_add(disk, io_ticks, duration);
n = (buf->flags & BUFFL_FAIL) ? -EIO : 0;
disk_stat_add(disk, sectors[rw], n_sect);
disk_stat_add(disk, io_ticks, duration);
n = (buf->flags & BUFFL_FAIL) ? -EIO : 0;
- bio_endio(buf->bio,
buf->bio->bi_size,
n);
+ bio_endio(buf->bio, n);
mempool_free(buf, d->bufpool);
}
}
mempool_free(buf, d->bufpool);
}
}
@@
-696,10
+699,10
@@
aoecmd_ata_id(struct aoedev *d)
/* initialize the headers & frame */
skb = f->skb;
/* initialize the headers & frame */
skb = f->skb;
- h =
(struct aoe_hdr *) skb->mac.raw
;
+ h =
aoe_hdr(skb)
;
ah = (struct aoe_atahdr *) (h+1);
ah = (struct aoe_atahdr *) (h+1);
- skb
->len = ETH_ZLEN
;
- memset(h, 0,
ETH_ZLEN
);
+ skb
_put(skb, sizeof *h + sizeof *ah)
;
+ memset(h, 0,
skb->len
);
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
@@
-727,14
+730,14
@@
aoecmd_cfg_rsp(struct sk_buff *skb)
enum { MAXFRAMES = 16 };
u16 n;
enum { MAXFRAMES = 16 };
u16 n;
- h =
(struct aoe_hdr *) skb->mac.raw
;
+ h =
aoe_hdr(skb)
;
ch = (struct aoe_cfghdr *) (h+1);
/*
* Enough people have their dip switches set backwards to
* warrant a loud message for this special case.
*/
ch = (struct aoe_cfghdr *) (h+1);
/*
* Enough people have their dip switches set backwards to
* warrant a loud message for this special case.
*/
- aoemajor = be16_to_cpu(
h->major
);
+ aoemajor = be16_to_cpu(
get_unaligned(&h->major)
);
if (aoemajor == 0xfff) {
printk(KERN_ERR "aoe: Warning: shelf address is all ones. "
"Check shelf dip switches.\n");
if (aoemajor == 0xfff) {
printk(KERN_ERR "aoe: Warning: shelf address is all ones. "
"Check shelf dip switches.\n");
This page took
0.02966 seconds
and
5
git commands to generate.