[Bug 259152] [iscsi] OCI oracle iscsi block device problems

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 21 Oct 2021 14:32:19 UTC

--- Comment #12 from Ed Maste <emaste@freebsd.org> ---
(In reply to Dave Cottlehuber from comment #11)
Notes from an IRC debugging session with dch@ and andrew@:

The panic looks like failed error handling after a reconnect attempt so needs
to be fixed but is not the primary issue; this is:

WARNING: icl_conn_receive_pdu: received data segment length 16384 is larger
than negotiated; dropping connection


                len = icl_pdu_data_segment_length(request);
                if (len > ic->ic_max_recv_data_segment_length) {  <---
                        ICL_WARN("received data segment "
                            "length %zd is larger than negotiated; "
                            "dropping connection", len);
                        error = EINVAL;

ic_max_recv_data_segment_length ultimately gets set by iscsid handling the new
connection. In usr.sbin/iscsid/login.c in login_negotiate_key:

        } else if (strcmp(name, "MaxRecvDataSegmentLength") == 0) {
                tmp = strtoul(value, NULL, 10);
                if (tmp <= 0)
                        log_errx(1, "received invalid "
                if (tmp > isl->isl_max_send_data_segment_length) {
                        log_debugx("capping max_send_data_segment_length "
                            "from %d to %d", tmp,
                        tmp = isl->isl_max_send_data_segment_length;
                conn->conn_max_send_data_segment_length = tmp;
                /* We received target's limit, that means it accepted our's. */
                conn->conn_max_recv_data_segment_length =   <---
                    isl->isl_max_recv_data_segment_length;  <---

So it appears conn_max_recv_data_segment_length is only set once we receive
MaxRecvDataSegmentLength from the target

from proxied.pcap,

frame 15 our login command contains MaxRecvDataSegmentLength=262144
the response is in frame 17 and does not contain MaxRecvDataSegmentLength, so
we never update conn_max_recv_data_segment_length 

This handling for conn_max_recv_data_segment_length came in with

You are receiving this mail because:
You are the assignee for the bug.