Commit Graph

1570 Commits

Author SHA1 Message Date
Jim Harris
f93bb8a32d Switch spdk_bdev_read/write arg order for length and offset.
This matches the general order (LBA start then LBA count) for
the NVMe API.

While here, fix a copy/paste error in a debug message (write
instead of writev).

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ice326af5d6025867dffed4d1f6c7b81fb9eba5eb
2016-09-14 10:51:25 -07:00
Jim Harris
edbed73064 Rename and move fd related helper functions to fd.c.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ieccdd778348e8709ca4ef6cdf4f58f40021638db
2016-09-14 10:51:25 -07:00
Daniel Verkamp
7bdba4437d bdev: make fn_table a const pointer
The table of bdev function pointers should not need to be modified at
runtime.

Change-Id: I3e8876fc83df9296ce528231269b1a905c96072c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-02 09:30:28 -07:00
Daniel Verkamp
02ccb0f791 bdev: make check_io callback optional
If a bdev doesn't need to be polled, allow it to specify NULL for the
check_io function pointer to indicate that no poller needs to be
registered.

This will be useful for virtual blockdevs that don't have any associated
hardware to poll.

Change-Id: I0ef8f848587b0c200296805ccc710340dde683b5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-02 09:30:15 -07:00
Daniel Verkamp
70ba1ba7cc bdev: clean up child I/O in bdev core
When an I/O with children is being freed, also free its child I/O
requests that were allocated via spdk_bdev_get_child_io().

Change-Id: I2d44aed845c1035ae8f8cb07c5992da855f1dc99
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-02 09:29:33 -07:00
Daniel Verkamp
ffbc120d3e bdev: remove unused children counter
Change-Id: I0255c09d6fa46f8d02f30d77f1d8b330e388d375
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-02 09:29:32 -07:00
Daniel Verkamp
efa06a2bab bdev: remove free_request bdev backend function
This callback was only used for freeing buffers, but the buffers are now
managed by the bdev core, so none of the free_request callbacks actually
do anything.

Change-Id: Icfe2e6169e829159dda5e3d75a27d8f040de07c6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-02 09:29:32 -07:00
Daniel Verkamp
398ba3b19d bdev/malloc: add unmap support
Add unmap support to the ramdisk block device for testing purposes.

Change-Id: Ibeb5530b2b5a31603d09d2d1de07760f32dea0f8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-02 09:24:47 -07:00
Daniel Verkamp
46a52cee67 bdev: drop "iSCSI" from blockdev name strings
The bdev layer can be used independently of iSCSI, so fix the
misleading names.

Change-Id: I3fd5b113403acdd7578ce93234dde0fd4f148e96
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-30 10:19:48 -07:00
Ben Walker
6e09a48e42 bdev: Separate the module header from the public header
Bdev modules need a separate interface than public
consumers of the blockdevs.

Change-Id: I581ee493570c114f7e96b31a425bc077a791c71e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-26 09:40:06 -07:00
Ben Walker
0ea0a4e646 bdev: Use the reset enum type instead of an int
Change-Id: Ia1b6503b707d71d6e2687800e750f3c07634f8f3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-26 09:40:01 -07:00
Daniel Verkamp
9272088d93 bdev: add API to query supported I/O types
Some block devices do not support the unmap operation, and we may add
other optional I/O types in the future.  Add a method to check which I/O
types a specific block device supports.

Change-Id: I6e6414bf6b6482ea0224022d8326b252bd363c7f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-26 09:16:36 -07:00
Daniel Verkamp
d2ea70cafd iscsi: use spdk/endian.h functions
Switch from the non-portable <sys/endian.h> functions (htobeXX/beXXtoh)
to the SPDK endian conversion functions.

Change-Id: Id49b87f2e536c68f0d5d567e78e1990c0a37ef14
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-25 13:29:56 -07:00
Daniel Verkamp
5d8c94536a event: hide struct spdk_poller internals
This leaves more flexibility for future changes to the poller
representation without requiring API changes (after this one).

It also prevents the user from accidentally using poller fields in a
non-thread-safe way, since they can't be accessed directly anymore.

Change-Id: I7677d5b93668665d29ae39c5e0ba74333ad3f878
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-12 10:42:12 -07:00
Daniel Verkamp
5c9d560b5a Work around DPDK 16.07 FreeBSD rte_zmalloc() bug
Replace other critical rte_zmalloc() sites that actually depend on the
memory being zeroed.

Change-Id: If6856ad44a4c50869811d3ce9411c993ce88018d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-11 17:59:38 -07:00
Daniel Verkamp
021be6df16 bdev: add Linux AIO (libaio) backend
Change-Id: I6e7de4330f0c792514df21557a3010adef08c670
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-05 09:08:23 -07:00
Daniel Verkamp
c41ab41c17 event: add timer-based pollers
Allow pollers to be scheduled to be run periodically every N
microseconds instead of every iteration of the reactor loop.

Change-Id: Iaea3e98965d81044e6dc5ce5f406bcb7a455289e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-03 09:00:54 -07:00
Ben Walker
d95d6822f9 scsi: No longer mark a bdev claimed when getting it by name
Just getting a reference to a bdev should not claim it.

Change-Id: I21e07160662490ec95b52fa31ea1d2ae93a21f09
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-02 10:07:34 -07:00
Ben Walker
e648950f89 bdev: Delete bdev_db
Combine the necessary functionality with the main bdev file.

Change-Id: I96d796bc87ac2a8688cdf1fd3c16d2a7c8aef730
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-02 09:08:51 -07:00
Daniel Verkamp
861e78bf48 bdev: add block device abstraction layer
Change-Id: I235cf146a52714756c9782c03b118f518c5f5182
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-21 10:35:03 -07:00