2013-07-04 06:09:06 +08:00
|
|
|
/* Copyright (c) 2013 Coraid, Inc. See COPYING for GPL terms. */
|
2013-07-04 06:09:07 +08:00
|
|
|
#define VERSION "83"
|
2005-04-17 06:20:36 +08:00
|
|
|
#define AOE_MAJOR 152
|
|
|
|
#define DEVICE_NAME "aoe"
|
2005-04-19 13:00:17 +08:00
|
|
|
|
|
|
|
/* set AOE_PARTITIONS to 1 to use whole-disks only
|
|
|
|
* default is 16, which is 15 partitions plus the whole disk
|
|
|
|
*/
|
2005-04-17 06:20:36 +08:00
|
|
|
#ifndef AOE_PARTITIONS
|
2005-08-20 04:54:43 +08:00
|
|
|
#define AOE_PARTITIONS (16)
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif
|
2005-04-19 13:00:17 +08:00
|
|
|
|
2012-12-18 08:04:15 +08:00
|
|
|
#define WHITESPACE " \t\v\f\n,"
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
enum {
|
|
|
|
AOECMD_ATA,
|
|
|
|
AOECMD_CFG,
|
2009-02-19 06:48:13 +08:00
|
|
|
AOECMD_VEND_MIN = 0xf0,
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
AOEFL_RSP = (1<<3),
|
|
|
|
AOEFL_ERR = (1<<2),
|
|
|
|
|
|
|
|
AOEAFL_EXT = (1<<6),
|
|
|
|
AOEAFL_DEV = (1<<4),
|
|
|
|
AOEAFL_ASYNC = (1<<1),
|
|
|
|
AOEAFL_WRITE = (1<<0),
|
|
|
|
|
|
|
|
AOECCMD_READ = 0,
|
|
|
|
AOECCMD_TEST,
|
|
|
|
AOECCMD_PTEST,
|
|
|
|
AOECCMD_SET,
|
|
|
|
AOECCMD_FSET,
|
|
|
|
|
|
|
|
AOE_HVER = 0x10,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct aoe_hdr {
|
|
|
|
unsigned char dst[6];
|
|
|
|
unsigned char src[6];
|
2005-04-19 13:00:20 +08:00
|
|
|
__be16 type;
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned char verfl;
|
|
|
|
unsigned char err;
|
2005-04-19 13:00:20 +08:00
|
|
|
__be16 major;
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned char minor;
|
|
|
|
unsigned char cmd;
|
2005-04-19 13:00:20 +08:00
|
|
|
__be32 tag;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct aoe_atahdr {
|
|
|
|
unsigned char aflags;
|
|
|
|
unsigned char errfeat;
|
|
|
|
unsigned char scnt;
|
|
|
|
unsigned char cmdstat;
|
|
|
|
unsigned char lba0;
|
|
|
|
unsigned char lba1;
|
|
|
|
unsigned char lba2;
|
|
|
|
unsigned char lba3;
|
|
|
|
unsigned char lba4;
|
|
|
|
unsigned char lba5;
|
|
|
|
unsigned char res[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct aoe_cfghdr {
|
2005-04-19 13:00:20 +08:00
|
|
|
__be16 bufcnt;
|
|
|
|
__be16 fwver;
|
2006-09-21 02:36:49 +08:00
|
|
|
unsigned char scnt;
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned char aoeccmd;
|
|
|
|
unsigned char cslen[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
DEVFL_UP = 1, /* device is installed in system and ready for AoE->ATA commands */
|
|
|
|
DEVFL_TKILL = (1<<1), /* flag for timer to know when to kill self */
|
|
|
|
DEVFL_EXT = (1<<2), /* device accepts lba48 commands */
|
2012-10-05 08:16:35 +08:00
|
|
|
DEVFL_GDALLOC = (1<<3), /* need to alloc gendisk */
|
aoe: avoid races between device destruction and discovery
This change avoids a race that could result in a NULL pointer derference
following a WARNing from kobject_add_internal, "don't try to register
things with the same name in the same directory."
The problem was found with a test that forgets and discovers an
aoe device in a loop:
while test ! -r /tmp/stop; do
aoe-flush -a
aoe-discover
done
The race was between aoedev_flush taking aoedevs out of the devlist,
allowing a new discovery of the same AoE target to take place before the
driver gets around to calling sysfs_remove_group. Fixing that one
revealed another race between do_open and add_disk, and this patch avoids
that, too.
The fix required some care, because for flushing (forgetting) an aoedev,
some of the steps must be performed under lock and some must be able to
sleep. Also, for discovering a new aoedev, some steps might sleep.
The check for a bad aoedev pointer remains from a time when about half of
this patch was done, and it was possible for the
bdev->bd_disk->private_data to become corrupted. The check should be
removed eventually, but it is not expected to add significant overhead,
occurring in the aoeblk_open routine.
Signed-off-by: Ed Cashin <ecashin@coraid.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-18 08:04:09 +08:00
|
|
|
DEVFL_GD_NOW = (1<<4), /* allocating gendisk */
|
|
|
|
DEVFL_KICKME = (1<<5), /* slow polling network card catch */
|
|
|
|
DEVFL_NEWSIZE = (1<<6), /* need to update dev size in block layer */
|
|
|
|
DEVFL_FREEING = (1<<7), /* set when device is being cleaned up */
|
|
|
|
DEVFL_FREED = (1<<8), /* device has been cleaned up */
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
2006-09-21 02:36:49 +08:00
|
|
|
DEFAULTBCNT = 2 * 512, /* 2 sectors */
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
MIN_BUFS = 16,
|
2012-12-18 08:04:11 +08:00
|
|
|
NTARGETS = 4,
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
NAOEIFS = 8,
|
2012-10-05 08:16:23 +08:00
|
|
|
NSKBPOOLMAX = 256,
|
2012-10-05 08:16:33 +08:00
|
|
|
NFACTIVE = 61,
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
|
|
|
|
TIMERTICK = HZ / 10,
|
2012-12-18 08:03:43 +08:00
|
|
|
RTTSCALE = 8,
|
|
|
|
RTTDSCALE = 3,
|
2012-12-18 08:03:49 +08:00
|
|
|
RTTAVG_INIT = USEC_PER_SEC / 4 << RTTSCALE,
|
2012-12-18 08:03:43 +08:00
|
|
|
RTTDEV_INIT = RTTAVG_INIT / 4,
|
2012-12-18 08:04:08 +08:00
|
|
|
|
|
|
|
HARD_SCORN_SECS = 10, /* try another remote port after this */
|
|
|
|
MAX_TAINT = 1000, /* cap on aoetgt taint */
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct buf {
|
|
|
|
ulong nframesout;
|
|
|
|
ulong resid;
|
|
|
|
ulong bv_resid;
|
|
|
|
sector_t sector;
|
|
|
|
struct bio *bio;
|
|
|
|
struct bio_vec *bv;
|
2012-10-05 08:16:23 +08:00
|
|
|
struct request *rq;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2012-12-18 08:04:08 +08:00
|
|
|
enum frame_flags {
|
|
|
|
FFL_PROBE = 1,
|
|
|
|
};
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
struct frame {
|
2012-10-05 08:16:21 +08:00
|
|
|
struct list_head head;
|
|
|
|
u32 tag;
|
2012-12-18 08:03:49 +08:00
|
|
|
struct timeval sent; /* high-res time packet was sent */
|
|
|
|
u32 sent_jiffs; /* low-res jiffies-based sent time */
|
2005-04-17 06:20:36 +08:00
|
|
|
ulong waited;
|
2012-12-18 08:03:51 +08:00
|
|
|
ulong waited_total;
|
2012-10-05 08:16:21 +08:00
|
|
|
struct aoetgt *t; /* parent target I belong to */
|
2006-09-21 02:36:49 +08:00
|
|
|
sector_t lba;
|
2012-10-05 08:16:21 +08:00
|
|
|
struct sk_buff *skb; /* command skb freed on module exit */
|
|
|
|
struct sk_buff *r_skb; /* response skb for async processing */
|
2012-10-05 08:16:23 +08:00
|
|
|
struct buf *buf;
|
2012-10-05 08:16:20 +08:00
|
|
|
struct bio_vec *bv;
|
2012-10-05 08:16:23 +08:00
|
|
|
ulong bcnt;
|
2012-10-05 08:16:20 +08:00
|
|
|
ulong bv_off;
|
2012-12-18 08:04:08 +08:00
|
|
|
char flags;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
struct aoeif {
|
|
|
|
struct net_device *nd;
|
2012-10-05 08:16:27 +08:00
|
|
|
ulong lost;
|
|
|
|
int bcnt;
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct aoetgt {
|
|
|
|
unsigned char addr[6];
|
2012-12-18 08:03:29 +08:00
|
|
|
ushort nframes; /* cap on frames to use */
|
2012-10-05 08:16:21 +08:00
|
|
|
struct aoedev *d; /* parent device I belong to */
|
|
|
|
struct list_head ffree; /* list of free frames */
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
struct aoeif ifs[NAOEIFS];
|
|
|
|
struct aoeif *ifp; /* current aoeif in use */
|
2012-12-18 08:04:01 +08:00
|
|
|
ushort nout; /* number of AoE commands outstanding */
|
2012-12-18 08:03:29 +08:00
|
|
|
ushort maxout; /* current value for max outstanding */
|
2012-12-18 08:03:43 +08:00
|
|
|
ushort next_cwnd; /* incr maxout after decrementing to zero */
|
|
|
|
ushort ssthresh; /* slow start threshold */
|
2012-12-18 08:03:29 +08:00
|
|
|
ulong falloc; /* number of allocated frames */
|
2012-12-18 08:04:08 +08:00
|
|
|
int taint; /* how much we want to avoid this aoetgt */
|
2012-10-05 08:16:27 +08:00
|
|
|
int minbcnt;
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
int wpkts, rpkts;
|
2012-12-18 08:04:08 +08:00
|
|
|
char nout_probes;
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
};
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
struct aoedev {
|
|
|
|
struct aoedev *next;
|
|
|
|
ulong sysminor;
|
|
|
|
ulong aoemajor;
|
2012-12-18 08:03:49 +08:00
|
|
|
u32 rttavg; /* scaled AoE round trip time average */
|
|
|
|
u32 rttdev; /* scaled round trip time mean deviation */
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
u16 aoeminor;
|
|
|
|
u16 flags;
|
2006-09-21 02:36:49 +08:00
|
|
|
u16 nopen; /* (bd_openers isn't available without sleeping) */
|
2005-04-17 06:20:36 +08:00
|
|
|
u16 fw_ver; /* version of blade's firmware */
|
2012-10-05 08:16:33 +08:00
|
|
|
u16 lasttag; /* last tag sent */
|
|
|
|
u16 useme;
|
2012-10-05 08:16:23 +08:00
|
|
|
ulong ref;
|
2005-04-17 06:20:36 +08:00
|
|
|
struct work_struct work;/* disk create work struct */
|
|
|
|
struct gendisk *gd;
|
2009-09-09 20:10:18 +08:00
|
|
|
struct request_queue *blkq;
|
2012-12-18 08:03:39 +08:00
|
|
|
struct hd_geometry geo;
|
2005-04-17 06:20:36 +08:00
|
|
|
sector_t ssize;
|
|
|
|
struct timer_list timer;
|
|
|
|
spinlock_t lock;
|
2008-09-22 13:36:49 +08:00
|
|
|
struct sk_buff_head skbpool;
|
2005-04-17 06:20:36 +08:00
|
|
|
mempool_t *bufpool; /* for deadlock-free Buf allocation */
|
2012-10-05 08:16:23 +08:00
|
|
|
struct { /* pointers to work in progress */
|
|
|
|
struct buf *buf;
|
|
|
|
struct bio *nxbio;
|
|
|
|
struct request *rq;
|
|
|
|
} ip;
|
2012-10-05 08:16:27 +08:00
|
|
|
ulong maxbcnt;
|
2012-10-05 08:16:33 +08:00
|
|
|
struct list_head factive[NFACTIVE]; /* hash of active frames */
|
2012-12-18 08:03:43 +08:00
|
|
|
struct list_head rexmitq; /* deferred retransmissions */
|
2012-12-18 08:04:11 +08:00
|
|
|
struct aoetgt **targets;
|
|
|
|
ulong ntargets; /* number of allocated aoetgt pointers */
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
struct aoetgt **tgt; /* target in use when working */
|
2012-10-05 08:16:21 +08:00
|
|
|
ulong kicked;
|
2012-12-18 08:03:42 +08:00
|
|
|
char ident[512];
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2012-10-05 08:16:21 +08:00
|
|
|
/* kthread tracking */
|
|
|
|
struct ktstate {
|
|
|
|
struct completion rendez;
|
|
|
|
struct task_struct *task;
|
|
|
|
wait_queue_head_t *waitq;
|
2013-07-04 06:09:05 +08:00
|
|
|
int (*fn) (int);
|
|
|
|
char name[12];
|
2012-10-05 08:16:21 +08:00
|
|
|
spinlock_t *lock;
|
2013-07-04 06:09:05 +08:00
|
|
|
int id;
|
|
|
|
int active;
|
2012-10-05 08:16:21 +08:00
|
|
|
};
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
int aoeblk_init(void);
|
|
|
|
void aoeblk_exit(void);
|
|
|
|
void aoeblk_gdalloc(void *);
|
|
|
|
void aoedisk_rm_sysfs(struct aoedev *d);
|
|
|
|
|
|
|
|
int aoechr_init(void);
|
|
|
|
void aoechr_exit(void);
|
|
|
|
void aoechr_error(char *);
|
|
|
|
|
|
|
|
void aoecmd_work(struct aoedev *d);
|
2006-01-20 02:46:19 +08:00
|
|
|
void aoecmd_cfg(ushort aoemajor, unsigned char aoeminor);
|
2012-10-05 08:16:21 +08:00
|
|
|
struct sk_buff *aoecmd_ata_rsp(struct sk_buff *);
|
2005-04-17 06:20:36 +08:00
|
|
|
void aoecmd_cfg_rsp(struct sk_buff *);
|
2006-11-22 22:57:56 +08:00
|
|
|
void aoecmd_sleepwork(struct work_struct *);
|
2012-12-18 08:03:43 +08:00
|
|
|
void aoecmd_wreset(struct aoetgt *t);
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
void aoecmd_cleanslate(struct aoedev *);
|
2012-10-05 08:16:21 +08:00
|
|
|
void aoecmd_exit(void);
|
|
|
|
int aoecmd_init(void);
|
aoe: handle multiple network paths to AoE device
A remote AoE device is something can process ATA commands and is identified by
an AoE shelf number and an AoE slot number. Such a device might have more
than one network interface, and it might be reachable by more than one local
network interface. This patch tracks the available network paths available to
each AoE device, allowing them to be used more efficiently.
Andrew Morton asked about the call to msleep_interruptible in the revalidate
function. Yes, if a signal is pending, then msleep_interruptible will not
return 0. That means we will not loop but will call aoenet_xmit with a NULL
skb, which is a noop. If the system is too low on memory or the aoe driver is
too low on frames, then the user can hit control-C to interrupt the attempt to
do a revalidate. I have added a comment to the code summarizing that.
Andrew Morton asked whether the allocation performed inside addtgt could use a
more relaxed allocation like GFP_KERNEL, but addtgt is called when the aoedev
lock has been locked with spin_lock_irqsave. It would be nice to allocate the
memory under fewer restrictions, but targets are only added when the device is
being discovered, and if the target can't be added right now, we can try again
in a minute when then next AoE config query broadcast goes out.
Andrew Morton pointed out that the "too many targets" message could be printed
for failing GFP_ATOMIC allocations. The last patch in this series makes the
messages more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 20:20:00 +08:00
|
|
|
struct sk_buff *aoecmd_ata_id(struct aoedev *);
|
2012-10-05 08:16:21 +08:00
|
|
|
void aoe_freetframe(struct frame *);
|
2012-10-05 08:16:23 +08:00
|
|
|
void aoe_flush_iocq(void);
|
2013-07-04 06:09:05 +08:00
|
|
|
void aoe_flush_iocq_by_index(int);
|
2012-10-05 08:16:23 +08:00
|
|
|
void aoe_end_request(struct aoedev *, struct request *, int);
|
2012-10-05 08:16:25 +08:00
|
|
|
int aoe_ktstart(struct ktstate *k);
|
|
|
|
void aoe_ktstop(struct ktstate *k);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
int aoedev_init(void);
|
|
|
|
void aoedev_exit(void);
|
2012-10-05 08:16:40 +08:00
|
|
|
struct aoedev *aoedev_by_aoeaddr(ulong maj, int min, int do_alloc);
|
2005-04-17 06:20:36 +08:00
|
|
|
void aoedev_downdev(struct aoedev *d);
|
2008-02-08 20:20:03 +08:00
|
|
|
int aoedev_flush(const char __user *str, size_t size);
|
2012-10-05 08:16:23 +08:00
|
|
|
void aoe_failbuf(struct aoedev *, struct buf *);
|
|
|
|
void aoedev_put(struct aoedev *);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
int aoenet_init(void);
|
|
|
|
void aoenet_exit(void);
|
2008-09-22 13:36:49 +08:00
|
|
|
void aoenet_xmit(struct sk_buff_head *);
|
2005-04-17 06:20:36 +08:00
|
|
|
int is_aoe_netif(struct net_device *ifp);
|
|
|
|
int set_aoe_iflist(const char __user *str, size_t size);
|