From owner-svn-src-stable-11@freebsd.org Wed Mar 6 22:13:55 2019 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 D12A41529520; Wed, 6 Mar 2019 22:13:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72B98737D5; Wed, 6 Mar 2019 22:13:54 +0000 (UTC) (envelope-from jhb@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 6932C9E61; Wed, 6 Mar 2019 22:13:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x26MDsNb032815; Wed, 6 Mar 2019 22:13:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x26MDroR032813; Wed, 6 Mar 2019 22:13:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201903062213.x26MDroR032813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 6 Mar 2019 22:13:53 +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: r344856 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 344856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 72B98737D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 06 Mar 2019 22:13:55 -0000 Author: jhb Date: Wed Mar 6 22:13:53 2019 New Revision: 344856 URL: https://svnweb.freebsd.org/changeset/base/344856 Log: MFC 330882: Simplify error handling in t4_tom.ko module loading. - Change t4_ddp_mod_load() to return void instead of always returning success. This avoids having to pretend to have proper support for unloading when only part of t4_tom_mod_load() has run. - If t4_register_uld() fails, don't invoke t4_tom_mod_unload() directly. The module handling code in the kernel invokes MOD_UNLOAD on a module whose MOD_LOAD fails with an error already. Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_ddp.c Wed Mar 6 22:11:45 2019 (r344855) +++ stable/11/sys/dev/cxgbe/tom/t4_ddp.c Wed Mar 6 22:13:53 2019 (r344856) @@ -1944,7 +1944,7 @@ t4_aio_queue_ddp(struct socket *so, struct kaiocb *job return (0); } -int +void t4_ddp_mod_load(void) { @@ -1953,7 +1953,6 @@ t4_ddp_mod_load(void) TAILQ_INIT(&ddp_orphan_pagesets); mtx_init(&ddp_orphan_pagesets_lock, "ddp orphans", NULL, MTX_DEF); TASK_INIT(&ddp_orphan_task, 0, ddp_free_orphan_pagesets, NULL); - return (0); } void Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Wed Mar 6 22:11:45 2019 (r344855) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Wed Mar 6 22:13:53 2019 (r344856) @@ -1162,7 +1162,6 @@ t4_aio_queue_tom(struct socket *so, struct kaiocb *job static int t4_tom_mod_load(void) { - int rc; struct protosw *tcp_protosw, *tcp6_protosw; /* CPL handlers */ @@ -1170,9 +1169,7 @@ t4_tom_mod_load(void) t4_init_listen_cpl_handlers(); t4_init_cpl_io_handlers(); - rc = t4_ddp_mod_load(); - if (rc != 0) - return (rc); + t4_ddp_mod_load(); tcp_protosw = pffindproto(PF_INET, IPPROTO_TCP, SOCK_STREAM); if (tcp_protosw == NULL) @@ -1194,11 +1191,7 @@ t4_tom_mod_load(void) ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event, t4_tom_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY); - rc = t4_register_uld(&tom_uld_info); - if (rc != 0) - t4_tom_mod_unload(); - - return (rc); + return (t4_register_uld(&tom_uld_info)); } static void Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.h Wed Mar 6 22:11:45 2019 (r344855) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.h Wed Mar 6 22:13:53 2019 (r344856) @@ -386,7 +386,7 @@ void t4_free_page_pods(struct ppod_reservation *); int t4_soreceive_ddp(struct socket *, struct sockaddr **, struct uio *, struct mbuf **, struct mbuf **, int *); int t4_aio_queue_ddp(struct socket *, struct kaiocb *); -int t4_ddp_mod_load(void); +void t4_ddp_mod_load(void); void t4_ddp_mod_unload(void); void ddp_assert_empty(struct toepcb *); void ddp_init_toep(struct toepcb *);