iscsi: move g_flush_timeout into iSCSI globals
Change-Id: Ib77db9c4f0f1487fa8eb9e46409c7661dbb08cbc Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
ab90ab3cda
commit
b8e5fbe688
@ -47,8 +47,6 @@
|
|||||||
#include "spdk/log.h"
|
#include "spdk/log.h"
|
||||||
#include "spdk/net.h"
|
#include "spdk/net.h"
|
||||||
|
|
||||||
uint64_t g_flush_timeout;
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_iscsi_dump_memory_info(void)
|
spdk_iscsi_dump_memory_info(void)
|
||||||
{
|
{
|
||||||
|
@ -1077,7 +1077,7 @@ spdk_iscsi_conn_execute(struct spdk_iscsi_conn *conn)
|
|||||||
|
|
||||||
/* If flush timer has expired, flush all PDUs */
|
/* If flush timer has expired, flush all PDUs */
|
||||||
tsc = rte_get_timer_cycles();
|
tsc = rte_get_timer_cycles();
|
||||||
if (tsc - conn->last_flush > g_flush_timeout) {
|
if (tsc - conn->last_flush > g_spdk_iscsi.flush_timeout) {
|
||||||
conn->last_flush = tsc;
|
conn->last_flush = tsc;
|
||||||
if (spdk_iscsi_conn_flush_pdus(conn) != 0) {
|
if (spdk_iscsi_conn_flush_pdus(conn) != 0) {
|
||||||
conn->state = ISCSI_CONN_STATE_EXITING;
|
conn->state = ISCSI_CONN_STATE_EXITING;
|
||||||
|
@ -54,8 +54,6 @@
|
|||||||
#define SPDK_ISCSI_DEFAULT_AUTHFILE SPDK_ISCSI_BUILD_ETC "/auth.conf"
|
#define SPDK_ISCSI_DEFAULT_AUTHFILE SPDK_ISCSI_BUILD_ETC "/auth.conf"
|
||||||
#define SPDK_ISCSI_DEFAULT_NODEBASE "iqn.2016-06.io.spdk"
|
#define SPDK_ISCSI_DEFAULT_NODEBASE "iqn.2016-06.io.spdk"
|
||||||
|
|
||||||
extern uint64_t g_flush_timeout;
|
|
||||||
|
|
||||||
#define DEFAULT_MAXR2T 4
|
#define DEFAULT_MAXR2T 4
|
||||||
#define MAX_INITIATOR_NAME 256
|
#define MAX_INITIATOR_NAME 256
|
||||||
#define MAX_TARGET_NAME 256
|
#define MAX_TARGET_NAME 256
|
||||||
@ -273,6 +271,7 @@ struct spdk_iscsi_globals {
|
|||||||
int req_discovery_auth;
|
int req_discovery_auth;
|
||||||
int req_discovery_auth_mutual;
|
int req_discovery_auth_mutual;
|
||||||
int discovery_auth_group;
|
int discovery_auth_group;
|
||||||
|
uint64_t flush_timeout;
|
||||||
|
|
||||||
uint32_t MaxSessions;
|
uint32_t MaxSessions;
|
||||||
uint32_t MaxConnectionsPerSession;
|
uint32_t MaxConnectionsPerSession;
|
||||||
|
@ -819,14 +819,11 @@ spdk_iscsi_app_read_parameters(void)
|
|||||||
|
|
||||||
val = spdk_conf_section_get_val(sp, "FlushTimeout");
|
val = spdk_conf_section_get_val(sp, "FlushTimeout");
|
||||||
if (val == NULL) {
|
if (val == NULL) {
|
||||||
g_flush_timeout = DEFAULT_FLUSH_TIMEOUT *
|
g_spdk_iscsi.flush_timeout = DEFAULT_FLUSH_TIMEOUT * (rte_get_timer_hz() >> 20);
|
||||||
(rte_get_timer_hz() >> 20);
|
|
||||||
} else {
|
} else {
|
||||||
g_flush_timeout = strtoul(val, NULL, 10) *
|
g_spdk_iscsi.flush_timeout = strtoul(val, NULL, 10) * (rte_get_timer_hz() >> 20);
|
||||||
(rte_get_timer_hz() >> 20);
|
|
||||||
}
|
}
|
||||||
SPDK_TRACELOG(SPDK_TRACE_DEBUG, "FlushTimeout %"PRIu64"\n",
|
SPDK_TRACELOG(SPDK_TRACE_DEBUG, "FlushTimeout %"PRIu64"\n", g_spdk_iscsi.flush_timeout);
|
||||||
g_flush_timeout);
|
|
||||||
|
|
||||||
nopininterval = spdk_conf_section_get_intval(sp, "NopInInterval");
|
nopininterval = spdk_conf_section_get_intval(sp, "NopInInterval");
|
||||||
if (nopininterval < 0) {
|
if (nopininterval < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user