From owner-svn-src-stable-11@freebsd.org Tue Oct 16 19:26:05 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B347210DEE2E; Tue, 16 Oct 2018 19:26:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF8C7B6F2; Tue, 16 Oct 2018 19:26:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59E2520E84; Tue, 16 Oct 2018 19:26:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GJQ516089093; Tue, 16 Oct 2018 19:26:05 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GJQ4f1089091; Tue, 16 Oct 2018 19:26:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810161926.w9GJQ4f1089091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 16 Oct 2018 19:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339389 - stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 339389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 19:26:06 -0000 Author: np Date: Tue Oct 16 19:26:04 2018 New Revision: 339389 URL: https://svnweb.freebsd.org/changeset/base/339389 Log: MFC r327254, r327904, and r328994. r327254: cxgbe/iw_cxgbe: Fix iWARP over VLANs (catch up with r326169). r327904: cxgbe/iw_cxgbe: Remove duplicates to fix compilation with recent gcc. r328994: iw_cxgbe: Remove declaration of a function that no longer exists. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Oct 16 18:47:13 2018 (r339388) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Oct 16 19:26:04 2018 (r339389) @@ -337,24 +337,28 @@ find_real_listen_ep(struct c4iw_listen_ep *master_lep, { struct adapter *adap = NULL; struct c4iw_listen_ep *lep = NULL; - struct sockaddr_storage remote = { 0 }; - struct ifnet *new_conn_ifp = NULL; + struct ifnet *ifp = NULL, *hw_ifp = NULL; struct listen_port_info *port_info = NULL; - int err = 0, i = 0, - found_portinfo = 0, found_lep = 0; + int i = 0, found_portinfo = 0, found_lep = 0; uint16_t port; - /* STEP 1: get 'ifnet' based on socket's remote address */ - GET_REMOTE_ADDR(&remote, so); + /* + * STEP 1: Figure out 'ifp' of the physical interface, not pseudo + * interfaces like vlan, lagg, etc.. + * TBD: lagg support, lagg + vlan support. + */ + ifp = TOEPCB(so)->l2te->ifp; + if (ifp->if_type == IFT_L2VLAN) { + hw_ifp = VLAN_TRUNKDEV(ifp); + if (hw_ifp == NULL) { + CTR4(KTR_IW_CXGBE, "%s: Failed to get parent ifnet of " + "vlan ifnet %p, sock %p, master_lep %p", + __func__, ifp, so, master_lep); + return (NULL); + } + } else + hw_ifp = ifp; - err = get_ifnet_from_raddr(&remote, &new_conn_ifp); - if (err) { - CTR4(KTR_IW_CXGBE, "%s: Failed to get ifnet, sock %p, " - "master_lep %p err %d", - __func__, so, master_lep, err); - return (NULL); - } - /* STEP 2: Find 'port_info' with listener local port address. */ port = (master_lep->com.local_addr.ss_family == AF_INET) ? ((struct sockaddr_in *)&master_lep->com.local_addr)->sin_port : @@ -377,7 +381,7 @@ find_real_listen_ep(struct c4iw_listen_ep *master_lep, list_for_each_entry(lep, &port_info->lep_list, listen_ep_list) { adap = lep->com.dev->rdev.adap; for_each_port(adap, i) { - if (new_conn_ifp == adap->port[i]->vi[0].ifp) { + if (hw_ifp == adap->port[i]->vi[0].ifp) { found_lep =1; goto out; } Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Tue Oct 16 18:47:13 2018 (r339388) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Tue Oct 16 19:26:04 2018 (r339389) @@ -897,8 +897,6 @@ typedef int (*c4iw_handler_func)(struct c4iw_dev *dev, int c4iw_ep_redirect(void *ctx, struct dst_entry *old, struct dst_entry *new, struct l2t_entry *l2t); -void c4iw_put_qpid(struct c4iw_rdev *rdev, u32 qpid, - struct c4iw_dev_ucontext *uctx); u32 c4iw_get_resource(struct c4iw_id_table *id_table); void c4iw_put_resource(struct c4iw_id_table *id_table, u32 entry); int c4iw_init_resource(struct c4iw_rdev *rdev, u32 nr_tpt, u32 nr_pdid); @@ -964,7 +962,6 @@ void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 add int c4iw_ofld_send(struct c4iw_rdev *rdev, struct mbuf *m); void c4iw_flush_hw_cq(struct c4iw_cq *cq); void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count); -void c4iw_count_scqes(struct t4_cq *cq, struct t4_wq *wq, int *count); int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); int __c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count); @@ -984,7 +981,6 @@ void __iomem *c4iw_bar2_addrs(struct c4iw_rdev *rdev, unsigned int *pbar2_qid, u64 *pbar2_pa); extern struct cxgb4_client t4c_client; extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS]; -extern int c4iw_max_read_depth; #if defined(__i386__) || defined(__amd64__) #define L1_CACHE_BYTES 128