Author: np
Date: Sun May 31 23:47:08 2015
New Revision: 283856
URL: https://svnweb.freebsd.org/changeset/base/283856

Log:
  MFC r273480, r273750, r273753, r273797, and r274461.
  
  r273480:
  cxgbe/iw_cxgbe: wake up waiters after flushing the qp.
  
  r273750:
  Some cxgbe/iw_cxgbe fixes:
  - Free rt in c4iw_connect only if it is allocated.
  - Call soclose instead of so_shutdown if there is an abort from the peer.
  - Close socket and return failure if TOE is not enabled.
  
  r273753:
  iwcm_event status needs to be populated for close_complete_upcall
  
  r273797:
  Always request a completion for every work request for iWARP.  The
  initial MPA exchange must be tracked this way so that t4_tom's state for
  the tid is all clean at the time the tid transitions to RDMA mode.  Once
  it does, t4_tom is out of the way and iw_cxgbe uses the qp endpoints
  directly.
  
  r274461:
  iw_cxgbe: don't forget to close the socket in c4iw_connect if soconnect
  fails.

Modified:
  stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c
  stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c
  stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c
==============================================================================
--- stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c       Sun May 31 23:29:04 2015        
(r283855)
+++ stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c       Sun May 31 23:47:08 2015        
(r283856)
@@ -94,7 +94,7 @@ static void abort_socket(struct c4iw_ep 
 static void send_mpa_req(struct c4iw_ep *ep);
 static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen);
 static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen);
-static void close_complete_upcall(struct c4iw_ep *ep);
+static void close_complete_upcall(struct c4iw_ep *ep, int status);
 static int abort_connection(struct c4iw_ep *ep);
 static void peer_close_upcall(struct c4iw_ep *ep);
 static void peer_abort_upcall(struct c4iw_ep *ep);
@@ -366,7 +366,7 @@ process_peer_close(struct c4iw_ep *ep)
                                                C4IW_QP_ATTR_NEXT_STATE, 
&attrs, 1);
                        }
                        close_socket(&ep->com, 0);
-                       close_complete_upcall(ep);
+                       close_complete_upcall(ep, 0);
                        __state_set(&ep->com, DEAD);
                        release = 1;
                        disconnect = 0;
@@ -474,7 +474,7 @@ process_conn_error(struct c4iw_ep *ep)
        if (state != ABORTING) {
 
                CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep);
-               close_socket(&ep->com, 0);
+               close_socket(&ep->com, 1);
                state_set(&ep->com, DEAD);
                c4iw_put_ep(&ep->com);
        }
@@ -528,7 +528,7 @@ process_close_complete(struct c4iw_ep *e
                                CTR2(KTR_IW_CXGBE, "%s:pcc4 %p", __func__, ep);
                                close_socket(&ep->com, 0);
                        }
-                       close_complete_upcall(ep);
+                       close_complete_upcall(ep, 0);
                        __state_set(&ep->com, DEAD);
                        release = 1;
                        break;
@@ -1206,13 +1206,14 @@ static int send_mpa_reply(struct c4iw_ep
 
 
 
-static void close_complete_upcall(struct c4iw_ep *ep)
+static void close_complete_upcall(struct c4iw_ep *ep, int status)
 {
        struct iw_cm_event event;
 
        CTR2(KTR_IW_CXGBE, "%s:ccuB %p", __func__, ep);
        memset(&event, 0, sizeof(event));
        event.event = IW_CM_EVENT_CLOSE;
+       event.status = status;
 
        if (ep->com.cm_id) {
 
@@ -1231,7 +1232,7 @@ static int abort_connection(struct c4iw_
        int err;
 
        CTR2(KTR_IW_CXGBE, "%s:abB %p", __func__, ep);
-       close_complete_upcall(ep);
+       close_complete_upcall(ep, -ECONNRESET);
        state_set(&ep->com, ABORTING);
        abort_socket(ep);
        err = close_socket(&ep->com, 0);
@@ -2098,14 +2099,15 @@ int c4iw_connect(struct iw_cm_id *cm_id,
                CTR2(KTR_IW_CXGBE, "%s:cc7 %p", __func__, ep);
                printk(KERN_ERR MOD "%s - cannot find route.\n", __func__);
                err = -EHOSTUNREACH;
-               goto fail3;
+               goto fail2;
        }
 
-
-       if (!(rt->rt_ifp->if_flags & IFCAP_TOE)) {
+       if (!(rt->rt_ifp->if_capenable & IFCAP_TOE)) {
 
                CTR2(KTR_IW_CXGBE, "%s:cc8 %p", __func__, ep);
                printf("%s - interface not TOE capable.\n", __func__);
+               close_socket(&ep->com, 0);
+               err = -ENOPROTOOPT;
                goto fail3;
        }
        tdev = TOEDEV(rt->rt_ifp);
@@ -2126,9 +2128,11 @@ int c4iw_connect(struct iw_cm_id *cm_id,
                ep->com.thread);
 
        if (!err) {
-
                CTR2(KTR_IW_CXGBE, "%s:cca %p", __func__, ep);
                goto out;
+       } else {
+               close_socket(&ep->com, 0);
+               goto fail2;
        }
 
 fail3:
@@ -2225,7 +2229,7 @@ int c4iw_ep_disconnect(struct c4iw_ep *e
 
                CTR2(KTR_IW_CXGBE, "%s:ced1 %p", __func__, ep);
                fatal = 1;
-               close_complete_upcall(ep);
+               close_complete_upcall(ep, -EIO);
                ep->com.state = DEAD;
        }
        CTR3(KTR_IW_CXGBE, "%s:ced2 %p %s", __func__, ep,

Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c
==============================================================================
--- stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c       Sun May 31 23:29:04 2015        
(r283855)
+++ stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c       Sun May 31 23:47:08 2015        
(r283856)
@@ -1359,9 +1359,9 @@ err:
        qhp->ep = NULL;
        set_state(qhp, C4IW_QP_STATE_ERROR);
        free = 1;
-       wake_up(&qhp->wait);
        BUG_ON(!ep);
        flush_qp(qhp);
+       wake_up(&qhp->wait);
 out:
        mutex_unlock(&qhp->mutex);
 

Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c
==============================================================================
--- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c     Sun May 31 23:29:04 2015        
(r283855)
+++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c     Sun May 31 23:47:08 2015        
(r283856)
@@ -769,7 +769,7 @@ t4_push_frames(struct adapter *sc, struc
                    toep->tx_nocompl >= toep->tx_total / 4)
                        compl = 1;
 
-               if (compl) {
+               if (compl || toep->ulp_mode == ULP_MODE_RDMA) {
                        txwr->op_to_immdlen |= htobe32(F_FW_WR_COMPL);
                        toep->tx_nocompl = 0;
                        toep->plen_nocompl = 0;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "[email protected]"

Reply via email to