Commit d2ea70ca authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent d7120a3e
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -40,11 +40,6 @@
#define SPDK_SCSI_SPEC_H

#include <stdint.h>
#ifdef __linux__
#include <endian.h>
#elif defined(__FreeBSD__)
#include <sys/endian.h>
#endif

#include "spdk/assert.h"

+3 −2
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
#include <rte_malloc.h>

#include "spdk/conf.h"
#include "spdk/endian.h"
#include "spdk/pci.h"
#include "spdk/log.h"
#include "spdk/bdev.h"
@@ -620,8 +621,8 @@ blockdev_nvme_unmap(struct nvme_blockdev *nbdev, struct nvme_blockio *bio,

	for (i = 0; i < bdesc_count; i++) {
		bio->dsm_range[i].starting_lba =
			nbdev->lba_start + be64toh(unmap_d->lba);
		bio->dsm_range[i].length = be32toh(unmap_d->block_count);
			nbdev->lba_start + from_be64(&unmap_d->lba);
		bio->dsm_range[i].length = from_be32(&unmap_d->block_count);
		unmap_d++;
	}

+2 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#include <rte_cycles.h>
#include <rte_timer.h>

#include "spdk/endian.h"
#include "spdk/trace.h"
#include "spdk/log.h"
#include "spdk/net.h"
@@ -1010,7 +1011,7 @@ spdk_iscsi_conn_flush_pdus_internal(struct spdk_iscsi_conn *conn)
			    (conn->sess->ErrorRecoveryLevel >= 1) &&
			    spdk_iscsi_is_deferred_free_pdu(pdu)) {
				SPDK_TRACELOG(SPDK_TRACE_DEBUG, "stat_sn=%d\n",
					      be32toh(pdu->bhs.stat_sn));
					      from_be32(&pdu->bhs.stat_sn));
				TAILQ_INSERT_TAIL(&conn->snack_pdu_list, pdu,
						  tailq);
			} else {
+117 −117

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -439,7 +439,7 @@ spdk_bdev_scsi_inquiry(struct spdk_bdev *bdev, struct spdk_scsi_task *task,
				sdesc->reserved = 0;

				/* RELATIVE PORT IDENTIFIER */
				sdesc->rel_port_id = htobe16(dev->port[i].index);
				to_be16(&sdesc->rel_port_id, dev->port[i].index);

				/* Reserved */
				sdesc->reserved2 = 0;
@@ -481,7 +481,7 @@ spdk_bdev_scsi_inquiry(struct spdk_bdev *bdev, struct spdk_scsi_task *task,
				plen2 += 4 + plen;

				/* TARGET PORT DESCRIPTORS LENGTH */
				sdesc->tgt_desc_len = htobe16(plen2);
				to_be16(&sdesc->tgt_desc_len, plen2);

				len += plen2;
			}
Loading