diff --git a/SOURCES/0001-enable-MaxOutstandingR2T-negotiation.patch b/SOURCES/0001-enable-MaxOutstandingR2T-negotiation.patch new file mode 100644 index 0000000..ad99460 --- /dev/null +++ b/SOURCES/0001-enable-MaxOutstandingR2T-negotiation.patch @@ -0,0 +1,91 @@ +From a54966e121ef5deaee2e113d1c912a7dd85aca86 Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Wed, 20 Jun 2018 22:09:35 -0700 +Subject: [PATCH 1/1] enable MaxOutstandingR2T negotiation + +The iscsi_tcp kernel side R2T handling is in libiscsi_tcp and is shared +with at least cxgbi3, and the drivers claim CAP_MULTI_R2T. But the +iscsid login parameter negotiation code never enabled MaxOutstandingR2T. + +I've tested this against an LIO target, negotiating to 2 and 4 R2Ts. +The network traces looked good, with the initiator keeping track of +multiple outstanding R2Ts and using the correct next identifier. +Throughput of bulk write data was improved, even over low latency virtio +links. + +Signed-off-by: Chris Leech +--- + usr/initiator.h | 1 + + usr/initiator_common.c | 3 ++- + usr/login.c | 14 +++++--------- + 3 files changed, 8 insertions(+), 10 deletions(-) + +diff --git a/usr/initiator.h b/usr/initiator.h +index 4f96d6b6e2c5..3ee1454b6de2 100644 +--- a/usr/initiator.h ++++ b/usr/initiator.h +@@ -212,6 +212,7 @@ typedef struct iscsi_session { + int erl; + uint32_t imm_data_en; + uint32_t initial_r2t_en; ++ uint32_t max_r2t; + uint32_t fast_abort; + uint32_t first_burst; + uint32_t max_burst; +diff --git a/usr/initiator_common.c b/usr/initiator_common.c +index 191e779bb942..d00bd9e7469b 100644 +--- a/usr/initiator_common.c ++++ b/usr/initiator_common.c +@@ -173,6 +173,7 @@ iscsi_copy_operational_params(struct iscsi_conn *conn, + + /* session's operational parameters */ + session->initial_r2t_en = session_conf->InitialR2T; ++ session->max_r2t = session_conf->MaxOutstandingR2T; + session->imm_data_en = session_conf->ImmediateData; + session->first_burst = align_32_down(session_conf->FirstBurstLength); + /* +@@ -375,7 +376,7 @@ int iscsi_session_set_neg_params(struct iscsi_conn *conn) + .conn_only = 0, + }, { + .param = ISCSI_PARAM_MAX_R2T, +- .value = &one, /* FIXME: session->max_r2t */ ++ .value = &session->max_r2t, + .type = ISCSI_INT, + .conn_only = 0, + }, { +diff --git a/usr/login.c b/usr/login.c +index 294ad0bf73fd..d7dad21180cf 100644 +--- a/usr/login.c ++++ b/usr/login.c +@@ -524,14 +524,9 @@ get_op_params_text_keys(iscsi_session_t *session, int cid, + text = value_end; + } else if (iscsi_find_key_value("MaxOutstandingR2T", text, end, &value, + &value_end)) { +- if (session->type == ISCSI_SESSION_TYPE_NORMAL) { +- if (strcmp(value, "1")) { +- log_error("Login negotiation " +- "failed, can't accept Max" +- "OutstandingR2T %s", value); +- return LOGIN_NEGOTIATION_FAILED; +- } +- } else ++ if (session->type == ISCSI_SESSION_TYPE_NORMAL) ++ session->max_r2t = strtoul(value, NULL, 0); ++ else + session->irrelevant_keys_bitmap |= + IRRELEVANT_MAXOUTSTANDINGR2T; + text = value_end; +@@ -810,8 +805,9 @@ add_params_normal_session(iscsi_session_t *session, struct iscsi_hdr *pdu, + return 0; + + /* these we must have */ ++ sprintf(value, "%d", session->max_r2t); + if (!iscsi_add_text(pdu, data, max_data_length, +- "MaxOutstandingR2T", "1")) ++ "MaxOutstandingR2T", value)) + return 0; + if (!iscsi_add_text(pdu, data, max_data_length, + "MaxConnections", "1")) +-- +2.14.4 + diff --git a/SOURCES/0184-set-iscsid.safe_logout-to-Yes-by-default.patch b/SOURCES/0184-set-iscsid.safe_logout-to-Yes-by-default.patch new file mode 100644 index 0000000..6226bbb --- /dev/null +++ b/SOURCES/0184-set-iscsid.safe_logout-to-Yes-by-default.patch @@ -0,0 +1,25 @@ +From 486110e2564cd9b677c485ec87b5df1bcb5750f2 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Wed, 29 Aug 2018 16:20:27 -0700 +Subject: [PATCH 184/184] set iscsid.safe_logout to Yes by default + +--- + etc/iscsid.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/etc/iscsid.conf b/etc/iscsid.conf +index cbf2c05aff59..1af8ed2732de 100644 +--- a/etc/iscsid.conf ++++ b/etc/iscsid.conf +@@ -25,7 +25,7 @@ iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket + + # Check for active mounts on devices reachable through a session + # and refuse to logout if there are any. Defaults to "No". +-# iscsid.safe_logout = Yes ++iscsid.safe_logout = Yes + + ############################# + # NIC/HBA and driver settings +-- +2.14.4 + diff --git a/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch b/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch index d45b83e..a5ffb65 100644 --- a/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch +++ b/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch @@ -16,7 +16,7 @@ index 20f07946be1f..baa8c00c7185 100644 * some other maintainer could merge a patch without going through us */ -#define ISCSI_VERSION_STR "2.0-874" -+#define ISCSI_VERSION_STR "6.2.0.874-7" ++#define ISCSI_VERSION_STR "6.2.0.874-10" #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" #endif diff --git a/SOURCES/be2iscsi-vlan.patch b/SOURCES/be2iscsi-vlan.patch deleted file mode 100644 index 7a48644..0000000 --- a/SOURCES/be2iscsi-vlan.patch +++ /dev/null @@ -1,191 +0,0 @@ -commit ea9c14d9ab10d1070a8d3c032e64bb946a279a02 -Author: Chris Leech -Date: Thu Nov 30 12:05:28 2017 -0800 - - vlan setting sync for be2iscsi - -diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c -index b30518a293db..f269fc406a13 100644 ---- a/usr/iscsiadm.c -+++ b/usr/iscsiadm.c -@@ -2311,6 +2311,89 @@ static int verify_iface_params(struct list_head *params, struct node_rec *rec) - return 0; - } - -+static int iface_param_update(struct iface_rec *iface, struct list_head *params) -+{ -+ struct node_rec *rec; -+ int rc = 0; -+ -+ rec = idbm_create_rec(NULL, -1, NULL, -1, iface, 1); -+ if (!rec) { -+ rc = ISCSI_ERR_INVAL; -+ goto update_fail; -+ } -+ -+ if (iscsi_check_for_running_session(rec)) -+ log_warning("Updating iface while iscsi sessions " -+ "are using it. You must logout the running " -+ "sessions then log back in for the " -+ "new settings to take affect."); -+ -+ rc = verify_iface_params(params, rec); -+ if (rc) -+ goto update_fail; -+ -+ rc = iface_conf_update(params, &rec->iface); -+ if (rc) -+ goto update_fail; -+ -+ rc = __for_each_matched_rec(0, rec, params, idbm_node_set_param); -+ if (rc == ISCSI_ERR_NO_OBJS_FOUND) -+ rc = 0; -+ else if (rc) -+ goto update_fail; -+ -+ printf("%s updated.\n", iface->name); -+ free(rec); -+ return rc; -+ -+update_fail: -+ log_error("Could not update iface %s: %s", -+ iface->name, iscsi_err_to_str(rc)); -+ free(rec); -+ return rc; -+} -+ -+struct iface_param_sync { -+ struct iface_rec *primary; -+ struct list_head *params; -+ int count; -+}; -+ -+static int update_sync_params(void *data, struct iface_rec *iface) -+{ -+ struct iface_param_sync *iface_params = data; -+ struct iface_rec *primary = iface_params->primary; -+ struct list_head *params = iface_params->params; -+ -+ if ((strcmp(primary->transport_name, iface->transport_name)) || -+ (strcmp(primary->hwaddress, iface->hwaddress)) || -+ (primary->iface_num != iface->iface_num)) -+ return 0; -+ -+ return iface_param_update(iface, params); -+} -+ -+static int split_vlan_params(struct list_head *params, struct list_head *vlan_params) -+{ -+ struct user_param *param, *tmp; -+ -+ list_for_each_entry_safe(param, tmp, params, list) { -+ if (!strncmp(param->name, "iface.vlan", 10)) { -+ list_move_tail(¶m->list, vlan_params); -+ } -+ } -+ return 0; -+} -+ -+static inline void list_splice_tail(struct list_head *list, struct list_head *head) -+{ -+ list->prev->next = head; -+ list->next->prev = head->prev; -+ head->prev->next = list->next; -+ head->prev = list->prev; -+ INIT_LIST_HEAD(list); -+} -+ - /* TODO: merge iter helpers and clean them up, so we can use them here */ - static int exec_iface_op(int op, int do_show, int info_level, - struct iface_rec *iface, uint64_t host_no, -@@ -2319,6 +2402,8 @@ static int exec_iface_op(int op, int do_show, int info_level, - struct host_info hinfo; - struct node_rec *rec = NULL; - int rc = 0; -+ LIST_HEAD(vlan_params); -+ struct iscsi_transport *t; - - switch (op) { - case OP_NEW: -@@ -2381,36 +2466,27 @@ delete_fail: - rec = idbm_create_rec(NULL, -1, NULL, -1, iface, 1); - if (!rec) { - rc = ISCSI_ERR_INVAL; -- goto update_fail; -+ break; - } -- -- if (iscsi_check_for_running_session(rec)) -- log_warning("Updating iface while iscsi sessions " -- "are using it. You must logout the running " -- "sessions then log back in for the " -- "new settings to take affect."); -- -- rc = verify_iface_params(params, rec); -- if (rc) -+ t = iscsi_sysfs_get_transport_by_name(rec->iface.transport_name); -+ if (!t) { -+ log_error("Cound not locate transport for iface %s", iface->name); -+ rc = ISCSI_ERR_INVAL; - break; -- -- /* pass rec's iface because it has the db values */ -- rc = iface_conf_update(params, &rec->iface); -- if (rc) -- goto update_fail; -- -- rc = __for_each_matched_rec(0, rec, params, -- idbm_node_set_param); -- if (rc == ISCSI_ERR_NO_OBJS_FOUND) -- rc = 0; -- else if (rc) -- goto update_fail; -- -- printf("%s updated.\n", iface->name); -- break; --update_fail: -- log_error("Could not update iface %s: %s", -- iface->name, iscsi_err_to_str(rc)); -+ } -+ if (t->template->sync_vlan_settings) { -+ /* sync shared vlan settings across ifaces */ -+ int nr_found = 0; -+ struct iface_param_sync sync_params = { -+ .primary = &rec->iface, -+ .params = &vlan_params, -+ .count = 0, -+ }; -+ split_vlan_params(params, &vlan_params); -+ iface_for_each_iface(&sync_params, 1, &nr_found, update_sync_params); -+ } -+ iface_param_update(&rec->iface, params); -+ list_splice_tail(&vlan_params, params); - break; - case OP_APPLY: - if (!iface) { -diff --git a/usr/transport.c b/usr/transport.c -index 3b7a00a2245e..35a8ccd4a400 100644 ---- a/usr/transport.c -+++ b/usr/transport.c -@@ -91,6 +91,7 @@ struct iscsi_transport_template bnx2i = { - struct iscsi_transport_template be2iscsi = { - .name = "be2iscsi", - .bind_ep_required = 1, -+ .sync_vlan_settings = 1, - .create_conn = be2iscsi_create_conn, - .ep_connect = ktransport_ep_connect, - .ep_poll = ktransport_ep_poll, -diff --git a/usr/transport.h b/usr/transport.h -index b67776b47288..07027564e46b 100644 ---- a/usr/transport.h -+++ b/usr/transport.h -@@ -40,6 +40,9 @@ struct iscsi_transport_template { - uint8_t use_boot_info; - uint8_t bind_ep_required; - uint8_t no_netdev; -+ /* be2iscsi has a single host vlan setting, -+ * but uses 2 ifaces for ipv4 and ipv6 settings; keep them in sync */ -+ uint8_t sync_vlan_settings; - int (*ep_connect) (struct iscsi_conn *conn, int non_blocking); - int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms); - void (*ep_disconnect) (struct iscsi_conn *conn); diff --git a/SOURCES/open-iscsi-2.0.874-30-iscsiuio-fix-dhcpv6-transaction-id-mismatch-error.patch b/SOURCES/open-iscsi-2.0.874-30-iscsiuio-fix-dhcpv6-transaction-id-mismatch-error.patch new file mode 100644 index 0000000..3d1cc0d --- /dev/null +++ b/SOURCES/open-iscsi-2.0.874-30-iscsiuio-fix-dhcpv6-transaction-id-mismatch-error.patch @@ -0,0 +1,50 @@ +From: Chris Leech +Subject: iscsiuio: fix dhcpv6 transaction-id mismatch error + +Bugzilla: ZZZ +Upstream Status: +Build Info: XXX +Tested: + +commit 5fd6428435f3063b4e980ead1fe0671856a20183 +Author: Nilesh Javali +Date: Thu Feb 16 08:44:19 2017 -0500 + + iscsiuio: fix dhcpv6 transaction-id mismatch error + + Initialize the transaction-id within the dhcpv6 packet with + correct byte order. + + Signed-off-by: Nilesh Javali +--- + iscsiuio/src/apps/dhcpc/dhcpv6.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/iscsiuio/src/apps/dhcpc/dhcpv6.c b/iscsiuio/src/apps/dhcpc/dhcpv6.c +index a4e25f0bdbbd..461af0ec2a11 100644 +--- a/iscsiuio/src/apps/dhcpc/dhcpv6.c ++++ b/iscsiuio/src/apps/dhcpc/dhcpv6.c +@@ -153,7 +153,7 @@ static u16_t dhcpv6_init_packet(struct dhcpv6_context *context, u8_t type) + if (dhcpv6->dhcpv6_type != type) + context->dhcpv6_transaction_id++; + +- dhcpv6->dhcpv6_trans_id = context->dhcpv6_transaction_id; ++ dhcpv6->dhcpv6_trans_id = HOST_TO_NET16(context->dhcpv6_transaction_id); + dhcpv6->dhcpv6_type = type; + + /* Keep track of length of all DHCP options. */ +@@ -265,8 +265,13 @@ void ipv6_udp_handle_dhcp(struct dhcpv6_context *context) + dhcpv6 = (union dhcpv6_hdr *)((u8_t *)context->udp + + sizeof(struct udp_hdr)); + +- if (dhcpv6->dhcpv6_trans_id != context->dhcpv6_transaction_id) ++ if (dhcpv6->dhcpv6_trans_id != ++ HOST_TO_NET16(context->dhcpv6_transaction_id)) { ++ LOG_ERR("DHCPv6 transaction-id error, sent %x, received %x", ++ HOST_TO_NET16(context->dhcpv6_transaction_id), ++ dhcpv6->dhcpv6_trans_id); + return; ++ } + + dhcpv6_len = + NET_TO_HOST16(context->udp->length) - sizeof(struct udp_hdr); diff --git a/SOURCES/open-iscsi-2.0.874-31-iscsiuio-serialize-xmit_mutex-lock-to-prevent-iscsiuio-seg-fault.patch b/SOURCES/open-iscsi-2.0.874-31-iscsiuio-serialize-xmit_mutex-lock-to-prevent-iscsiuio-seg-fault.patch new file mode 100644 index 0000000..1b92687 --- /dev/null +++ b/SOURCES/open-iscsi-2.0.874-31-iscsiuio-serialize-xmit_mutex-lock-to-prevent-iscsiuio-seg-fault.patch @@ -0,0 +1,185 @@ +From: Chris Leech +Subject: iscsiuio: serialize xmit_mutex lock to prevent iscsiuio seg fault + +Bugzilla: ZZZ +Upstream Status: +Build Info: XXX +Tested: + +commit a1be9c4ec348f87923f63ce2dbc23893a3b9e45c +Author: Nilesh Javali +Date: Thu May 18 23:04:20 2017 +0530 + + iscsiuio: serialize xmit_mutex lock to prevent iscsiuio seg fault + + Signed-off-by: Nilesh Javali +--- + iscsiuio/src/unix/libs/bnx2x.c | 24 +++++++++++------------- + iscsiuio/src/unix/libs/cnic.c | 9 +++------ + iscsiuio/src/unix/libs/qedi.c | 19 +++++++++++-------- + 3 files changed, 25 insertions(+), 27 deletions(-) + +diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c +index 19cbcecaacca..1e8f532edcdf 100644 +--- a/iscsiuio/src/unix/libs/bnx2x.c ++++ b/iscsiuio/src/unix/libs/bnx2x.c +@@ -1316,7 +1316,6 @@ void bnx2x_start_xmit(nic_t *nic, size_t len, u16_t vlan_id) + if ((rx_bd->addr_hi == 0) && (rx_bd->addr_lo == 0)) { + LOG_PACKET(PFX "%s: trying to transmit when device is closed", + nic->log_name); +- pthread_mutex_unlock(&nic->xmit_mutex); + return; + } + +@@ -1343,12 +1342,9 @@ void bnx2x_start_xmit(nic_t *nic, size_t len, u16_t vlan_id) + (bp->tx_bd_prod << 16)); + bnx2x_flush_doorbell(bp, bp->tx_doorbell); + } else { +- /* If the doorbell is not rung, the packet will not +- get sent. Hence, the xmit_mutex lock will not +- get freed. +- */ +- pthread_mutex_unlock(&nic->xmit_mutex); ++ LOG_ERR(PFX "Pkt transmission failed."); + } ++ + LOG_PACKET(PFX "%s: sent %d bytes using bp->tx_prod: %d", + nic->log_name, len, bp->tx_prod); + } +@@ -1412,6 +1408,8 @@ int bnx2x_write(nic_t *nic, nic_interface_t *nic_iface, packet_t *pkt) + nic->log_name, pkt->buf_size, + bp->tx_cons, bp->tx_prod, bp->tx_bd_prod); + ++ pthread_mutex_unlock(&nic->xmit_mutex); ++ + return 0; + } + +@@ -1560,17 +1558,16 @@ static int bnx2x_clear_tx_intr(nic_t *nic) + hw_cons = bp->get_tx_cons(bp); + + if (bp->tx_cons == hw_cons) { +- if (bp->tx_cons == bp->tx_prod) { +- /* Make sure the xmit_mutex lock is unlock */ +- if (pthread_mutex_trylock(&nic->xmit_mutex)) +- LOG_ERR(PFX "bnx2x tx lock with prod == cons"); +- +- pthread_mutex_unlock(&nic->xmit_mutex); ++ if (bp->tx_cons == bp->tx_prod) + return 0; +- } + return -EAGAIN; + } + ++ if (pthread_mutex_trylock(&nic->xmit_mutex)) { ++ LOG_ERR(PFX "%s: unable to get xmit_mutex.", nic->log_name); ++ return -EINVAL; ++ } ++ + LOG_PACKET(PFX "%s: clearing tx interrupt [%d %d]", + nic->log_name, bp->tx_cons, hw_cons); + bp->tx_cons = hw_cons; +@@ -1600,6 +1597,7 @@ static int bnx2x_clear_tx_intr(nic_t *nic) + nic->log_name, pkt->buf_size, + bp->tx_cons, bp->tx_prod, bp->tx_bd_prod); + ++ pthread_mutex_unlock(&nic->xmit_mutex); + return 0; + } + +diff --git a/iscsiuio/src/unix/libs/cnic.c b/iscsiuio/src/unix/libs/cnic.c +index 5d60f898ad57..a009f25f0814 100644 +--- a/iscsiuio/src/unix/libs/cnic.c ++++ b/iscsiuio/src/unix/libs/cnic.c +@@ -141,6 +141,7 @@ static int cnic_arp_send(nic_t *nic, nic_interface_t *nic_iface, int fd, + memcpy(&addr.s_addr, &dst_ip, sizeof(addr.s_addr)); + LOG_DEBUG(PFX "%s: Sent cnic arp request for IP: %s", + nic->log_name, addr_str); ++ pthread_mutex_unlock(&nic->xmit_mutex); + + return 0; + } +@@ -204,6 +205,8 @@ static int cnic_neigh_soliciation_send(nic_t *nic, + LOG_DEBUG(PFX "%s: Sent cnic ICMPv6 neighbor request %s", + nic->log_name, addr_str); + ++ pthread_mutex_unlock(&nic->xmit_mutex); ++ + return 0; + } + +@@ -433,9 +436,6 @@ done: + rc = -EIO; + } + +- if (status != 0 || rc != 0) +- pthread_mutex_unlock(&nic->xmit_mutex); +- + if (ev) { + cnic_nl_neigh_rsp(nic, fd, ev, path, mac_addr, + nic_iface, status, AF_INET); +@@ -632,9 +632,6 @@ done: + rc = -EIO; + } + +- if (status != 0 || rc != 0) +- pthread_mutex_unlock(&nic->xmit_mutex); +- + if (ev) { + cnic_nl_neigh_rsp(nic, fd, ev, path, mac_addr, + nic_iface, status, AF_INET6); +diff --git a/iscsiuio/src/unix/libs/qedi.c b/iscsiuio/src/unix/libs/qedi.c +index c2096e59dad1..c6ff6e7724a3 100644 +--- a/iscsiuio/src/unix/libs/qedi.c ++++ b/iscsiuio/src/unix/libs/qedi.c +@@ -887,7 +887,6 @@ void qedi_start_xmit(nic_t *nic, size_t len, u16_t vlan_id) + nic->log_name, len, bp->tx_prod); + } else { + LOG_ERR(PFX "Pkt transmission failed: %d", rc); +- pthread_mutex_unlock(&nic->xmit_mutex); + } + + free(ubuf); +@@ -950,6 +949,10 @@ int qedi_write(nic_t *nic, nic_interface_t *nic_iface, packet_t *pkt) + nic->log_name, pkt->buf_size, + bp->tx_cons, bp->tx_prod, bp->tx_bd_prod); + ++ LOG_DEBUG(PFX "%s: host:%d - releasing xmit mutex", ++ nic->log_name, nic->host_no); ++ pthread_mutex_unlock(&nic->xmit_mutex); ++ + return 0; + } + +@@ -1059,17 +1062,16 @@ static int qedi_clear_tx_intr(nic_t *nic) + hw_cons = uctrl->hw_tx_cons; + + if (bp->tx_cons == hw_cons) { +- if (bp->tx_cons == bp->tx_prod) { +- /* Make sure the xmit_mutex lock is unlock */ +- if (pthread_mutex_trylock(&nic->xmit_mutex)) +- LOG_ERR(PFX "qedi tx lock with prod == cons"); +- +- pthread_mutex_unlock(&nic->xmit_mutex); ++ if (bp->tx_cons == bp->tx_prod) + return 0; +- } + return -EAGAIN; + } + ++ if (pthread_mutex_trylock(&nic->xmit_mutex)) { ++ LOG_ERR(PFX "%s: unable to get xmit_mutex.", nic->log_name); ++ return -EINVAL; ++ } ++ + LOG_PACKET(PFX "%s: clearing tx interrupt [%d %d]", + nic->log_name, bp->tx_cons, hw_cons); + bp->tx_cons = hw_cons; +@@ -1099,6 +1101,7 @@ static int qedi_clear_tx_intr(nic_t *nic) + nic->log_name, pkt->buf_size, + bp->tx_cons, bp->tx_prod, bp->tx_bd_prod); + ++ pthread_mutex_unlock(&nic->xmit_mutex); + return 0; + } + diff --git a/SOURCES/open-iscsi-2.0.874-32-iscsiuio-allow-ARP-for-non-matching-src-and-dst-addresses.patch b/SOURCES/open-iscsi-2.0.874-32-iscsiuio-allow-ARP-for-non-matching-src-and-dst-addresses.patch new file mode 100644 index 0000000..fc92428 --- /dev/null +++ b/SOURCES/open-iscsi-2.0.874-32-iscsiuio-allow-ARP-for-non-matching-src-and-dst-addresses.patch @@ -0,0 +1,40 @@ +From: Chris Leech +Subject: iscsiuio: allow ARP for non-matching src and dst addresses + +Bugzilla: ZZZ +Upstream Status: +Build Info: XXX +Tested: + +commit e43d687dc23e66c609491f9bfa8d8f29be7ef72d +Author: Nilesh Javali +Date: Thu Feb 22 07:25:58 2018 -0500 + + iscsiuio: allow ARP for non-matching src and dst addresses + + For source and destination IP addresses in different + networks, continue with the ARP retries and further login process + instead of assuming abrupt failure. iSCSI offload adapters may not rely on + netmask information for successful iSCSI target login. + + Signed-off-by: Nilesh Javali +--- + iscsiuio/src/unix/libs/cnic.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/iscsiuio/src/unix/libs/cnic.c b/iscsiuio/src/unix/libs/cnic.c +index a009f25f0814..32166edf243f 100644 +--- a/iscsiuio/src/unix/libs/cnic.c ++++ b/iscsiuio/src/unix/libs/cnic.c +@@ -362,9 +362,8 @@ int cnic_handle_ipv4_iscsi_path_req(nic_t *nic, int fd, + &nic_iface->ustack.default_route_addr, + sizeof(dst_addr)); + } else { +- arp_retry = MAX_ARP_RETRY; +- LOG_DEBUG(PFX "%s: no default", nic->log_name); +- goto done; ++ LOG_DEBUG(PFX "%s: no default route address", ++ nic->log_name); + } + } + arp_retry = 0; diff --git a/SOURCES/open-iscsi-2.0.874-33-iscsiuio-v0.7.8.4.patch b/SOURCES/open-iscsi-2.0.874-33-iscsiuio-v0.7.8.4.patch new file mode 100644 index 0000000..46b8cb6 --- /dev/null +++ b/SOURCES/open-iscsi-2.0.874-33-iscsiuio-v0.7.8.4.patch @@ -0,0 +1,106 @@ +From: Chris Leech +Subject: iscsiuio: v0.7.8.4 + +Bugzilla: ZZZ +Upstream Status: +Build Info: XXX +Tested: + +commit 5481f86e46d1668917bbf41ed2355b6eb558de69 +Author: Nilesh Javali +Date: Thu Feb 22 08:04:13 2018 -0500 + + iscsiuio: v0.7.8.4 + + Signed-off-by: Nilesh Javali +--- + iscsiuio/README | 4 ++-- + iscsiuio/RELEASE.TXT | 39 +++++++++++++++++++++++++++++++++++++-- + iscsiuio/configure.ac | 4 ++-- + 3 files changed, 41 insertions(+), 6 deletions(-) + +diff --git a/iscsiuio/README b/iscsiuio/README +index ca2da16a7342..9cbf7ce6717a 100644 +--- a/iscsiuio/README ++++ b/iscsiuio/README +@@ -1,6 +1,6 @@ + Iscsiuio Userspace Tool +-Version 0.7.8.3 +-Sept 28, 2016 ++Version 0.7.8.4 ++Feb 22, 2018 + ------------------------------------------------------ + + This tool is to be used in conjunction with the QLogic NetXtreme II Linux +diff --git a/iscsiuio/RELEASE.TXT b/iscsiuio/RELEASE.TXT +index 69c5b5f6bd61..ca51b26338a1 100644 +--- a/iscsiuio/RELEASE.TXT ++++ b/iscsiuio/RELEASE.TXT +@@ -1,7 +1,7 @@ + Release Notes + QLogic uIP Linux Driver +- Version 0.7.8.3 +- 9/28/2016 ++ Version 0.7.8.4 ++ 2/22/2018 + + QLogic Corporation + 26650 Aliso Viejo Pkwy, +@@ -12,6 +12,41 @@ + All rights reserved + + ++ ++uIP v0.7.8.4 (Feb 22, 2018) ++======================================================= ++ Fixes: ++ ------- ++ 1. Problem: CQ95605: iSCSI BFS in DHCP config intermittently fails to boot ++ into the OS when source and destination addresses are in ++ different networks. ++ Change: Allow ARP for non-matching source and destination addresses. ++ For source and destination IP addresses in different networks, ++ continue with the ARP retries and further login process ++ instead of assuming abrupt failure. iSCSI offload adapters ++ may not rely on netmask information for successful iSCSI ++ target login. ++ Impact: All ++ ++uIP v0.7.8.3 (May 18, 2017) ++======================================================= ++ Fixes: ++ ------- ++ 1. Problem: CQ93985: iscsiuio seg faults if discovery done to not ++ reachable target ++ Change: Serialize xmit_mutex lock to prevent iscsiuio seg fault. ++ Impact: All ++ ++ 2. Problem: CQ91497 - Initiator fails to acquire IPv6 DHCP address ++ from the DHCP server ++ Change: Initialize the transaction-id within the dhcpv6 packet with ++ correct byte order, to fix the trans-id mismatch error. ++ Impact: All ++ ++ 3. Problem: Missing qedi ping transport hook ++ Change: Add qedi ping transport hook ++ Impact: 10/25/40/50GGbE Controller (iSCSI) ++ + uIP v0.7.8.3 (Sept 28, 2016) + ======================================================= + Enhancements +diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac +index 075d07d04f34..fa67ea74c47a 100644 +--- a/iscsiuio/configure.ac ++++ b/iscsiuio/configure.ac +@@ -12,9 +12,9 @@ dnl Benjamin Li (benli@broadcom.com) + dnl + + PACKAGE=iscsiuio +-VERSION=0.7.8.3 ++VERSION=0.7.8.4 + +-AC_INIT([iscsiuio], [0.7.8.3], [QLogic-Storage-Upstream@cavium.com]) ++AC_INIT([iscsiuio], [0.7.8.4], [QLogic-Storage-Upstream@cavium.com]) + + AM_INIT_AUTOMAKE + AC_CONFIG_HEADER(config.h) diff --git a/SOURCES/open-iscsi-2.0.876-3-qedi.c-Removed-unused-linux-ethtool.h.patch b/SOURCES/open-iscsi-2.0.876-3-qedi.c-Removed-unused-linux-ethtool.h.patch new file mode 100644 index 0000000..fc76864 --- /dev/null +++ b/SOURCES/open-iscsi-2.0.876-3-qedi.c-Removed-unused-linux-ethtool.h.patch @@ -0,0 +1,31 @@ +From: Chris Leech +Subject: qedi.c: Removed unused linux/ethtool.h + +Bugzilla: ZZZ +Upstream Status: +Build Info: XXX +Tested: + +commit 197713ad7e3e944102bbd792e1ab9ec4a67100c0 +Author: Khem Raj +Date: Fri Feb 2 23:25:21 2018 -0800 + + qedi.c: Removed unused linux/ethtool.h + + Signed-off-by: Khem Raj +--- + iscsiuio/src/unix/libs/qedi.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/iscsiuio/src/unix/libs/qedi.c b/iscsiuio/src/unix/libs/qedi.c +index b81fecdfe78f..24cb89ad3580 100644 +--- a/iscsiuio/src/unix/libs/qedi.c ++++ b/iscsiuio/src/unix/libs/qedi.c +@@ -49,7 +49,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/SOURCES/open-iscsi-2.0.876-31-Fix-iscsiuio-segfault-when-shutting-down.patch b/SOURCES/open-iscsi-2.0.876-31-Fix-iscsiuio-segfault-when-shutting-down.patch new file mode 100644 index 0000000..2b32cd9 --- /dev/null +++ b/SOURCES/open-iscsi-2.0.876-31-Fix-iscsiuio-segfault-when-shutting-down.patch @@ -0,0 +1,36 @@ +From: Chris Leech +Subject: Fix iscsiuio segfault when shutting down. + +Bugzilla: ZZZ +Upstream Status: +Build Info: XXX +Tested: + +commit 2bdcae8a9969295183377342cfe218d1c5d263db +Author: Lee Duncan +Date: Thu May 31 08:42:58 2018 -0700 + + Fix iscsiuio segfault when shutting down. + + If iscsiuio is stopped when first starting up, it can easily + hit a window where pthread_cancel() is called before pthread_create() + finishesx The problem was found by kiyo@jp.fujitsu.com, who also + proposed the fix. +--- + iscsiuio/src/unix/iscsid_ipc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/iscsiuio/src/unix/iscsid_ipc.c b/iscsiuio/src/unix/iscsid_ipc.c +index d4322350fcf6..2acac485af72 100644 +--- a/iscsiuio/src/unix/iscsid_ipc.c ++++ b/iscsiuio/src/unix/iscsid_ipc.c +@@ -1245,7 +1245,8 @@ void iscsid_cleanup() + { + int rc; + +- if (iscsid_opts.fd != INVALID_FD) { ++ if (iscsid_opts.fd != INVALID_FD && ++ iscsid_opts.thread != INVALID_THREAD) { + rc = pthread_cancel(iscsid_opts.thread); + if (rc != 0) { + LOG_ERR("Could not cancel iscsid listening thread: %s", diff --git a/SOURCES/open-iscsi-2.0.876-41-vlan-setting-sync-across-ipv4-ipv6-for-be2iscsi.patch b/SOURCES/open-iscsi-2.0.876-41-vlan-setting-sync-across-ipv4-ipv6-for-be2iscsi.patch new file mode 100644 index 0000000..5b82a26 --- /dev/null +++ b/SOURCES/open-iscsi-2.0.876-41-vlan-setting-sync-across-ipv4-ipv6-for-be2iscsi.patch @@ -0,0 +1,208 @@ +From 2cee7f4a011619480c83d8279fe5d15de6e37ea8 Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Fri, 22 Jun 2018 12:25:05 -0700 +Subject: [PATCH 1/1] vlan setting sync across ipv4/ipv6 for be2iscsi + +be2iscsi exports two ifaces per host port for ipv4 and ipv6 network +configurations. But, they need to have the same link level configuration +including vlan settings. If vlan setting are modified in only one iface +record, then whichever record is applied last (filesystem dependant I +think) will take effect and things may not work. + +This change to iscsiadm applies vlan updates to all records with +matching MAC addresses if a flag is set on the transport. +The new transport flag is only set for be2iscsi. +--- + usr/iscsiadm.c | 132 ++++++++++++++++++++++++++++++++++++++++++++------------ + usr/transport.c | 1 + + usr/transport.h | 3 ++ + 3 files changed, 108 insertions(+), 28 deletions(-) + +diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c +index 6245e89d46cb..9083132942e2 100644 +--- a/usr/iscsiadm.c ++++ b/usr/iscsiadm.c +@@ -2311,6 +2311,89 @@ static int verify_iface_params(struct list_head *params, struct node_rec *rec) + return 0; + } + ++static int iface_param_update(struct iface_rec *iface, struct list_head *params) ++{ ++ struct node_rec *rec; ++ int rc = 0; ++ ++ rec = idbm_create_rec(NULL, -1, NULL, -1, iface, 1); ++ if (!rec) { ++ rc = ISCSI_ERR_INVAL; ++ goto update_fail; ++ } ++ ++ if (iscsi_check_for_running_session(rec)) ++ log_warning("Updating iface while iscsi sessions " ++ "are using it. You must logout the running " ++ "sessions then log back in for the " ++ "new settings to take affect."); ++ ++ rc = verify_iface_params(params, rec); ++ if (rc) ++ goto update_fail; ++ ++ rc = iface_conf_update(params, &rec->iface); ++ if (rc) ++ goto update_fail; ++ ++ rc = __for_each_matched_rec(0, rec, params, idbm_node_set_param); ++ if (rc == ISCSI_ERR_NO_OBJS_FOUND) ++ rc = 0; ++ else if (rc) ++ goto update_fail; ++ ++ printf("%s updated.\n", iface->name); ++ free(rec); ++ return rc; ++ ++update_fail: ++ log_error("Could not update iface %s: %s", ++ iface->name, iscsi_err_to_str(rc)); ++ free(rec); ++ return rc; ++} ++ ++struct iface_param_sync { ++ struct iface_rec *primary; ++ struct list_head *params; ++ int count; ++}; ++ ++static int update_sync_params(void *data, struct iface_rec *iface) ++{ ++ struct iface_param_sync *iface_params = data; ++ struct iface_rec *primary = iface_params->primary; ++ struct list_head *params = iface_params->params; ++ ++ if ((strcmp(primary->transport_name, iface->transport_name)) || ++ (strcmp(primary->hwaddress, iface->hwaddress)) || ++ (primary->iface_num != iface->iface_num)) ++ return 0; ++ ++ return iface_param_update(iface, params); ++} ++ ++static int split_vlan_params(struct list_head *params, struct list_head *vlan_params) ++{ ++ struct user_param *param, *tmp; ++ ++ list_for_each_entry_safe(param, tmp, params, list) { ++ if (!strncmp(param->name, "iface.vlan", 10)) { ++ list_move_tail(¶m->list, vlan_params); ++ } ++ } ++ return 0; ++} ++ ++static inline void list_splice_tail(struct list_head *list, struct list_head *head) ++{ ++ list->prev->next = head; ++ list->next->prev = head->prev; ++ head->prev->next = list->next; ++ head->prev = list->prev; ++ INIT_LIST_HEAD(list); ++} ++ + /* TODO: merge iter helpers and clean them up, so we can use them here */ + static int exec_iface_op(int op, int do_show, int info_level, + struct iface_rec *iface, uint64_t host_no, +@@ -2320,6 +2403,8 @@ static int exec_iface_op(int op, int do_show, int info_level, + struct node_rec *rec = NULL; + int rc = 0; + ++ LIST_HEAD(vlan_params); ++ struct iscsi_transport *t; + switch (op) { + case OP_NEW: + if (!iface) { +@@ -2381,36 +2466,27 @@ delete_fail: + rec = idbm_create_rec(NULL, -1, NULL, -1, iface, 1); + if (!rec) { + rc = ISCSI_ERR_INVAL; +- goto update_fail; ++ break; + } +- +- if (iscsi_check_for_running_session(rec)) +- log_warning("Updating iface while iscsi sessions " +- "are using it. You must logout the running " +- "sessions then log back in for the " +- "new settings to take affect."); +- +- rc = verify_iface_params(params, rec); +- if (rc) ++ t = iscsi_sysfs_get_transport_by_name(rec->iface.transport_name); ++ if (!t) { ++ log_error("Cound not locate transport for iface %s", iface->name); ++ rc = ISCSI_ERR_INVAL; + break; +- +- /* pass rec's iface because it has the db values */ +- rc = iface_conf_update(params, &rec->iface); +- if (rc) +- goto update_fail; +- +- rc = __for_each_matched_rec(0, rec, params, +- idbm_node_set_param); +- if (rc == ISCSI_ERR_NO_OBJS_FOUND) +- rc = 0; +- else if (rc) +- goto update_fail; +- +- printf("%s updated.\n", iface->name); +- break; +-update_fail: +- log_error("Could not update iface %s: %s", +- iface->name, iscsi_err_to_str(rc)); ++ } ++ if (t->template->sync_vlan_settings) { ++ /* sync shared vlan settings across ifaces */ ++ int nr_found = 0; ++ struct iface_param_sync sync_params = { ++ .primary = &rec->iface, ++ .params = &vlan_params, ++ .count = 0, ++ }; ++ split_vlan_params(params, &vlan_params); ++ iface_for_each_iface(&sync_params, 1, &nr_found, update_sync_params); ++ } ++ iface_param_update(&rec->iface, params); ++ list_splice_tail(&vlan_params, params); + break; + case OP_APPLY: + if (!iface) { +diff --git a/usr/transport.c b/usr/transport.c +index 3b7a00a2245e..35a8ccd4a400 100644 +--- a/usr/transport.c ++++ b/usr/transport.c +@@ -91,6 +91,7 @@ struct iscsi_transport_template bnx2i = { + struct iscsi_transport_template be2iscsi = { + .name = "be2iscsi", + .bind_ep_required = 1, ++ .sync_vlan_settings = 1, + .create_conn = be2iscsi_create_conn, + .ep_connect = ktransport_ep_connect, + .ep_poll = ktransport_ep_poll, +diff --git a/usr/transport.h b/usr/transport.h +index b67776b47288..07027564e46b 100644 +--- a/usr/transport.h ++++ b/usr/transport.h +@@ -40,6 +40,9 @@ struct iscsi_transport_template { + uint8_t use_boot_info; + uint8_t bind_ep_required; + uint8_t no_netdev; ++ /* be2iscsi has a single host vlan setting, ++ * but uses 2 ifaces for ipv4 and ipv6 settings; keep them in sync */ ++ uint8_t sync_vlan_settings; + int (*ep_connect) (struct iscsi_conn *conn, int non_blocking); + int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms); + void (*ep_disconnect) (struct iscsi_conn *conn); +-- +2.14.4 + diff --git a/SOURCES/open-iscsi-2.0.876-54-iscsiuio-Add-inter-host-mutex-while-doing-xmit.patch b/SOURCES/open-iscsi-2.0.876-54-iscsiuio-Add-inter-host-mutex-while-doing-xmit.patch new file mode 100644 index 0000000..98b6f70 --- /dev/null +++ b/SOURCES/open-iscsi-2.0.876-54-iscsiuio-Add-inter-host-mutex-while-doing-xmit.patch @@ -0,0 +1,248 @@ +From d469a2e15e8558cf8ba34db376b4b777177a016b Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Fri, 22 Jun 2018 12:30:09 -0700 +Subject: [PATCH 1/1] iscsiuio: Add inter-host mutex while doing xmit + +Bugzilla: ZZZ +Upstream Status: +Build Info: XXX +Tested: + +commit 9501dcaf5be474b4cb882a5e00f875f8c57e0e8e +Author: Manish Rangankar +Date: Wed Jun 20 02:33:36 2018 -0400 + + iscsiuio: Add inter-host mutex while doing xmit + + This avoids the netlink buffer corruption when more than one host + try to xmit packet at the same time. + + Signed-off-by: Manish Rangankar +--- + iscsiuio/src/unix/libs/cnic.c | 2 ++ + iscsiuio/src/unix/libs/qedi.c | 38 +++++++++++++++++++++++++++++++++----- + iscsiuio/src/unix/nic.c | 15 ++++++++++++--- + iscsiuio/src/unix/nic_utils.c | 4 ++++ + 4 files changed, 51 insertions(+), 8 deletions(-) + +diff --git a/iscsiuio/src/unix/libs/cnic.c b/iscsiuio/src/unix/libs/cnic.c +index 32166edf243f..b953278e5eab 100644 +--- a/iscsiuio/src/unix/libs/cnic.c ++++ b/iscsiuio/src/unix/libs/cnic.c +@@ -106,6 +106,8 @@ static int cnic_arp_send(nic_t *nic, nic_interface_t *nic_iface, int fd, + static const uint8_t multicast_mac[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + ++ LOG_DEBUG(PFX "%s: host:%d - try getting xmit mutex cnic arp send", ++ nic->log_name, nic->host_no); + rc = pthread_mutex_trylock(&nic->xmit_mutex); + if (rc != 0) { + LOG_DEBUG(PFX "%s: could not get xmit_mutex", nic->log_name); +diff --git a/iscsiuio/src/unix/libs/qedi.c b/iscsiuio/src/unix/libs/qedi.c +index 5bb0682c8bed..32cab48fed17 100644 +--- a/iscsiuio/src/unix/libs/qedi.c ++++ b/iscsiuio/src/unix/libs/qedi.c +@@ -74,6 +74,8 @@ + + extern int nl_sock; + ++static pthread_mutex_t host_mutex = PTHREAD_MUTEX_INITIALIZER; ++ + /* Foward struct declarations */ + struct nic_ops qedi_op; + +@@ -812,15 +814,26 @@ static void qedi_prepare_xmit_packet(nic_t *nic, + struct uip_vlan_eth_hdr *eth_vlan = (struct uip_vlan_eth_hdr *)pkt->buf; + struct uip_eth_hdr *eth = (struct uip_eth_hdr *)bp->tx_pkt; + ++ LOG_DEBUG(PFX "%s: pkt->buf_size=%d tpid=0x%x", nic->log_name, ++ pkt->buf_size, eth_vlan->tpid); ++ + if (eth_vlan->tpid == htons(UIP_ETHTYPE_8021Q)) { + memcpy(bp->tx_pkt, pkt->buf, sizeof(struct uip_eth_hdr)); + eth->type = eth_vlan->type; + pkt->buf_size -= (sizeof(struct uip_vlan_eth_hdr) - + sizeof(struct uip_eth_hdr)); ++ ++ LOG_DEBUG(PFX "%s: pkt->buf_size=%d type=0x%x", nic->log_name, ++ pkt->buf_size, eth->type); ++ LOG_DEBUG(PFX "%s: pkt->buf_size - eth_hdr_size = %d", nic->log_name, ++ pkt->buf_size - sizeof(struct uip_eth_hdr)); ++ + memcpy(bp->tx_pkt + sizeof(struct uip_eth_hdr), + pkt->buf + sizeof(struct uip_vlan_eth_hdr), + pkt->buf_size - sizeof(struct uip_eth_hdr)); + } else { ++ LOG_DEBUG(PFX "%s: NO VLAN pkt->buf_size=%d", nic->log_name, ++ pkt->buf_size); + memcpy(bp->tx_pkt, pkt->buf, pkt->buf_size); + } + +@@ -876,11 +889,18 @@ void qedi_start_xmit(nic_t *nic, size_t len, u16_t vlan_id) + path_data->handle = QEDI_PATH_HANDLE; + path_data->vlan_id = vlan_id; + uctrl->host_tx_pkt_len = len; ++ LOG_DEBUG(PFX "%s: host_no:%d vlan_id=%d, tx_pkt_len=%d", ++ nic->log_name, ev->u.set_path.host_no, path_data->vlan_id, uctrl->host_tx_pkt_len); + ++ LOG_DEBUG(PFX "%s: ACQUIRE HOST MUTEX", nic->log_name); ++ pthread_mutex_lock(&host_mutex); + rc = __kipc_call(nl_sock, ev, buflen); + if (rc > 0) { + bp->tx_prod++; + uctrl->host_tx_prod++; ++ LOG_DEBUG(PFX "%s: bp->tx_prod: %d, uctrl->host_tx_prod=%d", ++ nic->log_name, bp->tx_prod, uctrl->host_tx_prod); ++ + msync(uctrl, sizeof(struct qedi_uio_ctrl), MS_SYNC); + LOG_PACKET(PFX "%s: sent %d bytes using bp->tx_prod: %d", + nic->log_name, len, bp->tx_prod); +@@ -888,6 +908,8 @@ void qedi_start_xmit(nic_t *nic, size_t len, u16_t vlan_id) + LOG_ERR(PFX "Pkt transmission failed: %d", rc); + } + ++ LOG_DEBUG(PFX "%s: RELEASE HOST MUTEX", nic->log_name); ++ pthread_mutex_unlock(&host_mutex); + free(ubuf); + } + +@@ -923,14 +945,18 @@ int qedi_write(nic_t *nic, nic_interface_t *nic_iface, packet_t *pkt) + struct timespec sleep_req = {.tv_sec = 0, .tv_nsec = 5000000 }, + sleep_rem; + ++ LOG_DEBUG(PFX "%s: host:%d - calling clear_tx_intr from qedi_write", ++ nic->log_name, nic->host_no); + if (qedi_clear_tx_intr(nic) == 0) + break; + + nanosleep(&sleep_req, &sleep_rem); + } + ++ LOG_DEBUG(PFX "%s: host:%d - try getting xmit mutex", ++ nic->log_name, nic->host_no); + if (pthread_mutex_trylock(&nic->xmit_mutex) != 0) { +- LOG_PACKET(PFX "%s: Dropped previous transmitted packet", ++ LOG_DEBUG(PFX "%s: Dropped previous transmitted packet", + nic->log_name); + return -EINVAL; + } +@@ -944,7 +970,7 @@ int qedi_write(nic_t *nic, nic_interface_t *nic_iface, packet_t *pkt) + nic->stats.tx.packets++; + nic->stats.tx.bytes += uip->uip_len; + +- LOG_PACKET(PFX "%s: transmitted %d bytes dev->tx_cons: %d, dev->tx_prod: %d, dev->tx_bd_prod:%d", ++ LOG_DEBUG(PFX "%s: transmitted %d bytes dev->tx_cons: %d, dev->tx_prod: %d, dev->tx_bd_prod:%d", + nic->log_name, pkt->buf_size, + bp->tx_cons, bp->tx_prod, bp->tx_bd_prod); + +@@ -1071,7 +1097,7 @@ static int qedi_clear_tx_intr(nic_t *nic) + return -EINVAL; + } + +- LOG_PACKET(PFX "%s: clearing tx interrupt [%d %d]", ++ LOG_DEBUG(PFX "%s: clearing tx interrupt [%d %d]", + nic->log_name, bp->tx_cons, hw_cons); + bp->tx_cons = hw_cons; + +@@ -1083,7 +1109,7 @@ static int qedi_clear_tx_intr(nic_t *nic) + packet_t *pkt; + int i; + +- LOG_PACKET(PFX "%s: sending queued tx packet", nic->log_name); ++ LOG_DEBUG(PFX "%s: sending queued tx packet", nic->log_name); + pkt = nic_dequeue_tx_packet(nic); + + /* Got a TX packet buffer of the TX queue and put it onto +@@ -1096,7 +1122,7 @@ static int qedi_clear_tx_intr(nic_t *nic) + (pkt->nic_iface->vlan_priority << 12) | + pkt->nic_iface->vlan_id); + +- LOG_PACKET(PFX "%s: transmitted queued packet %d bytes, dev->tx_cons: %d, dev->tx_prod: %d, dev->tx_bd_prod:%d", ++ LOG_DEBUG(PFX "%s: transmitted queued packet %d bytes, dev->tx_cons: %d, dev->tx_prod: %d, dev->tx_bd_prod:%d", + nic->log_name, pkt->buf_size, + bp->tx_cons, bp->tx_prod, bp->tx_bd_prod); + +@@ -1124,6 +1150,8 @@ static int qedi_clear_tx_intr(nic_t *nic) + } + } + ++ LOG_DEBUG(PFX "%s: host:%d - releasing xmit mutex", ++ nic->log_name, nic->host_no); + pthread_mutex_unlock(&nic->xmit_mutex); + + return 0; +diff --git a/iscsiuio/src/unix/nic.c b/iscsiuio/src/unix/nic.c +index a5f714a91923..dfc2ad0a7a7b 100644 +--- a/iscsiuio/src/unix/nic.c ++++ b/iscsiuio/src/unix/nic.c +@@ -799,6 +799,8 @@ int nic_process_intr(nic_t *nic, int discard_check) + + nic->intr_count = count; + ++ LOG_DEBUG(PFX "%s: host:%d - calling clear_tx_intr from process_intr", ++ nic->log_name, nic->host_no); + (*nic->ops->clear_tx_intr) (nic); + ret = 1; + } +@@ -1036,9 +1038,11 @@ int process_packets(nic_t *nic, + case UIP_ETHTYPE_IPv4: + case UIP_ETHTYPE_ARP: + af_type = AF_INET; ++ LOG_DEBUG(PFX "%s: ARP or IPv4 vlan:0x%x ethertype:0x%x", ++ nic->log_name, vlan_id, type); + break; + default: +- LOG_PACKET(PFX "%s: Ignoring vlan:0x%x ethertype:0x%x", ++ LOG_DEBUG(PFX "%s: Ignoring vlan:0x%x ethertype:0x%x", + nic->log_name, vlan_id, type); + goto done; + } +@@ -1064,7 +1068,7 @@ int process_packets(nic_t *nic, + if (nic_iface == NULL) { + /* Matching nic_iface not found */ + pthread_mutex_unlock(&nic->nic_mutex); +- LOG_PACKET(PFX "%s: Couldn't find interface for " ++ LOG_DEBUG(PFX "%s: Couldn't find interface for " + "VLAN: %d af_type %d", + nic->log_name, vlan_id, af_type); + rc = EINVAL; /* Return the +error code */ +@@ -1118,6 +1122,8 @@ nic_iface_present: + prepare_ipv4_packet(nic, nic_iface, + ustack, pkt); + ++ LOG_DEBUG(PFX "%s: write called after arp_ipin, uip_len=%d", ++ nic->log_name, ustack->uip_len); + (*nic->ops->write) (nic, nic_iface, pkt); + } + +@@ -1129,8 +1135,11 @@ nic_iface_present: + * in data that should be sent out on the + * network, the global variable uip_len + * is set to a value > 0. */ +- if (pkt->buf_size > 0) ++ if (pkt->buf_size > 0) { ++ LOG_DEBUG(PFX "%s: write called after arp_arpin, bufsize=%d", ++ nic->log_name, pkt->buf_size); + (*nic->ops->write) (nic, nic_iface, pkt); ++ } + break; + } + ustack->uip_len = 0; +diff --git a/iscsiuio/src/unix/nic_utils.c b/iscsiuio/src/unix/nic_utils.c +index 6e580f862eea..988905bca2a9 100644 +--- a/iscsiuio/src/unix/nic_utils.c ++++ b/iscsiuio/src/unix/nic_utils.c +@@ -1435,6 +1435,10 @@ nic_interface_t *nic_find_nic_iface(nic_t *nic, + nic_interface_t *current_vlan = NULL; + + while (current != NULL) { ++ LOG_DEBUG(PFX "%s: incoming protocol: %d, vlan_id:%d iface_num: %d, request_type: %d", ++ nic->log_name, protocol, vlan_id, iface_num, request_type); ++ LOG_DEBUG(PFX "%s: host:%d iface_num: 0x%x VLAN: %d protocol: %d", ++ nic->log_name, nic->host_no, current->iface_num, current->vlan_id, current->protocol); + if (current->protocol != protocol) + goto next; + +-- +2.14.4 + diff --git a/SPECS/iscsi-initiator-utils.spec b/SPECS/iscsi-initiator-utils.spec index a7bd696..7899527 100644 --- a/SPECS/iscsi-initiator-utils.spec +++ b/SPECS/iscsi-initiator-utils.spec @@ -4,7 +4,7 @@ Summary: iSCSI daemon and utility programs Name: iscsi-initiator-utils Version: 6.%{open_iscsi_version}.%{open_iscsi_build} -Release: 7%{?dist} +Release: 10%{?dist} Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org @@ -48,7 +48,17 @@ Patch168: 0168-update-handling-of-boot-sessions.patch Patch169: 0169-update-iscsi.service-for-boot-session-recovery.patch Patch170: 0170-fix-systemd-unit-wants.patch Patch172: 0172-move-cleanup-to-seperate-service.patch -Patch175: be2iscsi-vlan.patch +Patch175: open-iscsi-2.0.876-41-vlan-setting-sync-across-ipv4-ipv6-for-be2iscsi.patch +Patch176: 0001-enable-MaxOutstandingR2T-negotiation.patch +Patch177: open-iscsi-2.0.874-30-iscsiuio-fix-dhcpv6-transaction-id-mismatch-error.patch +Patch178: open-iscsi-2.0.874-31-iscsiuio-serialize-xmit_mutex-lock-to-prevent-iscsiuio-seg-fault.patch +Patch179: open-iscsi-2.0.874-32-iscsiuio-allow-ARP-for-non-matching-src-and-dst-addresses.patch +Patch180: open-iscsi-2.0.874-33-iscsiuio-v0.7.8.4.patch +Patch181: open-iscsi-2.0.876-3-qedi.c-Removed-unused-linux-ethtool.h.patch +Patch182: open-iscsi-2.0.876-31-Fix-iscsiuio-segfault-when-shutting-down.patch +Patch183: open-iscsi-2.0.876-54-iscsiuio-Add-inter-host-mutex-while-doing-xmit.patch +Patch184: 0184-set-iscsid.safe_logout-to-Yes-by-default.patch + # upstream removed internal open-isns, but not taking that here just yet # it requires repackaging isns-utils to provide a debug package Patch198: keep-open-isns.patch @@ -274,6 +284,15 @@ fi %{_includedir}/libiscsi.h %changelog +* Wed Aug 29 2018 Chris Leech - 6.2.0.874-10 +- 1185734 set iscsid.safe_logout to Yes by default + +* Fri Jun 22 2018 Chris Leech - 6.2.0.874-9 +- 1578984 update iscsiuio to v0.7.8.4 + +* Fri Jun 22 2018 Chris Leech - 6.2.0.874-8 +- 1278438 enable MaxOutstandingR2T negotiation during login + * Thu Nov 30 2017 Chris Leech - 6.2.0.874-7 - 1328694 keep vlan settings in sync for ipv4/ipv6 iface records with be2iscsi