From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leon Romanovsky Subject: Re: [PATCH] iw_cxgb4: clean up send_connect() Date: Mon, 30 Jan 2017 22:32:20 +0200 Message-ID: <20170130203220.GO6005@mtr-leonro.local> References: <1485790962-15147-1-git-send-email-ganeshgr@chelsio.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6T2vOV0TokPza8xG" Return-path: Content-Disposition: inline In-Reply-To: <1485790962-15147-1-git-send-email-ganeshgr-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Ganesh Goudar Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org, Bharat Teja List-Id: linux-rdma@vger.kernel.org --6T2vOV0TokPza8xG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 30, 2017 at 09:12:42PM +0530, Ganesh Goudar wrote: > Clean up send_connect() and make use of t6 specific > active open request struct. > > Acked-by: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org Please add full Steve's name. Thanks > Signed-off-by: Bharat Teja > Signed-off-by: Ganesh Goudar > --- > drivers/infiniband/hw/cxgb4/cm.c | 56 ++++++++++++++++++++++++++-------------- > 1 file changed, 36 insertions(+), 20 deletions(-) > > diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c > index f1510cc..b9c2163 100644 > --- a/drivers/infiniband/hw/cxgb4/cm.c > +++ b/drivers/infiniband/hw/cxgb4/cm.c > @@ -692,6 +692,10 @@ static int send_connect(struct c4iw_ep *ep) > int ret; > enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type; > u32 isn = (prandom_u32() & ~7UL) - 1; > + struct net_device *netdev; > + u64 params; > + > + netdev = ep->com.dev->rdev.lldi.ports[0]; > > switch (CHELSIO_CHIP_VERSION(adapter_type)) { > case CHELSIO_T4: > @@ -768,6 +772,8 @@ static int send_connect(struct c4iw_ep *ep) > opt2 |= T5_ISS_F; > } > > + params = cxgb4_select_ntuple(netdev, ep->l2t); > + > if (ep->com.remote_addr.ss_family == AF_INET6) > cxgb4_clip_get(ep->com.dev->rdev.lldi.ports[0], > (const u32 *)&la6->sin6_addr.s6_addr, 1); > @@ -809,18 +815,22 @@ static int send_connect(struct c4iw_ep *ep) > req->opt0 = cpu_to_be64(opt0); > > if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { > - req->params = cpu_to_be32(cxgb4_select_ntuple( > - ep->com.dev->rdev.lldi.ports[0], > - ep->l2t)); > + req->params = cpu_to_be32(params); > req->opt2 = cpu_to_be32(opt2); > } else { > - t5req->params = cpu_to_be64(FILTER_TUPLE_V( > - cxgb4_select_ntuple( > - ep->com.dev->rdev.lldi.ports[0], > - ep->l2t))); > - t5req->rsvd = cpu_to_be32(isn); > - PDBG("%s snd_isn %u\n", __func__, t5req->rsvd); > - t5req->opt2 = cpu_to_be32(opt2); > + if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { > + t5req->params = > + cpu_to_be64(FILTER_TUPLE_V(params)); > + t5req->rsvd = cpu_to_be32(isn); > + PDBG("%s snd_isn %u\n", __func__, t5req->rsvd); > + t5req->opt2 = cpu_to_be32(opt2); > + } else { > + t6req->params = > + cpu_to_be64(FILTER_TUPLE_V(params)); > + t6req->rsvd = cpu_to_be32(isn); > + PDBG("%s snd_isn %u\n", __func__, t6req->rsvd); > + t6req->opt2 = cpu_to_be32(opt2); > + } > } > } else { > switch (CHELSIO_CHIP_VERSION(adapter_type)) { > @@ -859,18 +869,24 @@ static int send_connect(struct c4iw_ep *ep) > req6->opt0 = cpu_to_be64(opt0); > > if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { > - req6->params = cpu_to_be32(cxgb4_select_ntuple( > - ep->com.dev->rdev.lldi.ports[0], > - ep->l2t)); > + req6->params = cpu_to_be32(cxgb4_select_ntuple(netdev, > + ep->l2t)); > req6->opt2 = cpu_to_be32(opt2); > } else { > - t5req6->params = cpu_to_be64(FILTER_TUPLE_V( > - cxgb4_select_ntuple( > - ep->com.dev->rdev.lldi.ports[0], > - ep->l2t))); > - t5req6->rsvd = cpu_to_be32(isn); > - PDBG("%s snd_isn %u\n", __func__, t5req6->rsvd); > - t5req6->opt2 = cpu_to_be32(opt2); > + if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { > + t5req6->params = > + cpu_to_be64(FILTER_TUPLE_V(params)); > + t5req6->rsvd = cpu_to_be32(isn); > + PDBG("%s snd_isn %u\n", __func__, t5req6->rsvd); > + t5req6->opt2 = cpu_to_be32(opt2); > + } else { > + t6req6->params = > + cpu_to_be64(FILTER_TUPLE_V(params)); > + t6req6->rsvd = cpu_to_be32(isn); > + PDBG("%s snd_isn %u\n", __func__, t6req6->rsvd); > + t6req6->opt2 = cpu_to_be32(opt2); > + } > + > } > } > > -- > 2.1.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --6T2vOV0TokPza8xG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkhr/r4Op1/04yqaB5GN7iDZyWKcFAliPotQACgkQ5GN7iDZy WKdE2Q//YoziFho8vCxjtJZjmjhUzRsIWgyCpombzCly9GL+48hN43XuR6qfr4+W ojRV9LbKoShwY4ChjQTLZNi1ekcZntV21f5SYxfgk21vG91iy6RZffVhELCTqKgl fjtwitpKDNTPQCdcq+DouABlU+f2t9wg5BwxACSWnnam7fqQqtodAZ65nPwbu9Be h5bRrLUYCLOGMWmYyy4zwBDD9fgdjMDIengw6OIWi3j/xcs4oU0/I5yQwzhBCTpS 3t+CKNKWkAeEqmR5CYQc9gcwpBM3TG/7XdE0R+zQbDLu+joXkWhTwoS1hHFooXNt G/9RyFKaKCXIr1wm7ZGb8DCwBLaLBtV8NjQ+UbIB6ricWsSVnGdR+VIjBcwIKhLo 55q7yiuv30UXd+zPdKRBFIdMVsxgvQiwVA7oXbwSllbSBU0JYSqmSJaHzJfx/8GK XO8KmsChHUTU+VKtJPMvM5BzZUit36w8svPpUDH47QqKMdfbgNf3cnfJ01FoWmQg XG0G8xaItm2Sg2nM/36aScotAJcUewY2gSbSwMba4NssS//l9bIq/hd5SGX+EOls auyv6Ej1zd5zRy2rGbu6GS7s4gMVhf0djoaj17JjIyEMSKt6ClwCJh9fXdKDPGvt ib87F/DX5sTKMQ4PgvcwaxvE6yXZqPWxKAfBCePGDNDg14dnjWE= =oNN5 -----END PGP SIGNATURE----- --6T2vOV0TokPza8xG-- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html