From owner-svn-src-all@freebsd.org Mon Jul 8 21:33:16 2019 Return-Path: Delivered-To: svn-src-all@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 E5E5415EA498; Mon, 8 Jul 2019 21:33:15 +0000 (UTC) (envelope-from hselasky@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 8921A8D543; Mon, 8 Jul 2019 21:33:15 +0000 (UTC) (envelope-from hselasky@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 6507E1E346; Mon, 8 Jul 2019 21:33:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x68LXFFO041172; Mon, 8 Jul 2019 21:33:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x68LXEfB041170; Mon, 8 Jul 2019 21:33:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907082133.x68LXEfB041170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 8 Jul 2019 21:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349852 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 349852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8921A8D543 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jul 2019 21:33:16 -0000 Author: hselasky Date: Mon Jul 8 21:33:14 2019 New Revision: 349852 URL: https://svnweb.freebsd.org/changeset/base/349852 Log: Restore binary compatibility for epoch(9) API. This is a direct commit. Discussed with: jhb@ Sponsored by: Mellanox Technologies Modified: stable/12/sys/kern/subr_epoch.c stable/12/sys/sys/epoch.h Modified: stable/12/sys/kern/subr_epoch.c ============================================================================== --- stable/12/sys/kern/subr_epoch.c Mon Jul 8 20:53:25 2019 (r349851) +++ stable/12/sys/kern/subr_epoch.c Mon Jul 8 21:33:14 2019 (r349852) @@ -65,11 +65,12 @@ static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based re TAILQ_HEAD (epoch_tdlist, epoch_tracker); typedef struct epoch_record { ck_epoch_record_t er_record; - struct epoch_context er_drain_ctx; - struct epoch *er_parent; volatile struct epoch_tdlist er_tdlist; volatile uint32_t er_gen; uint32_t er_cpuid; + /* fields above are part of KBI and cannot be modified */ + struct epoch_context er_drain_ctx; + struct epoch *er_parent; } __aligned(EPOCH_ALIGN) *epoch_record_t; struct epoch { @@ -77,6 +78,7 @@ struct epoch { epoch_record_t e_pcpu_record; int e_idx; int e_flags; + /* fields above are part of KBI and cannot be modified */ struct sx e_drain_sx; struct mtx e_drain_mtx; volatile int e_drain_count; @@ -736,4 +738,41 @@ epoch_drain_callbacks(epoch_t epoch) sx_xunlock(&epoch->e_drain_sx); PICKUP_GIANT(); +} + +/* for binary compatibility */ + +struct epoch_tracker_KBI { + void *datap[3]; +#ifdef EPOCH_TRACKER_DEBUG + int datai[5]; +#else + int datai[1]; +#endif +} __aligned(sizeof(void *)); + +CTASSERT(sizeof(struct epoch_tracker_KBI) >= sizeof(struct epoch_tracker)); + +void +epoch_enter_preempt_KBI(epoch_t epoch, epoch_tracker_t et) +{ + epoch_enter_preempt(epoch, et); +} + +void +epoch_exit_preempt_KBI(epoch_t epoch, epoch_tracker_t et) +{ + epoch_exit_preempt(epoch, et); +} + +void +epoch_enter_KBI(epoch_t epoch) +{ + epoch_enter(epoch); +} + +void +epoch_exit_KBI(epoch_t epoch) +{ + epoch_exit(epoch); } Modified: stable/12/sys/sys/epoch.h ============================================================================== --- stable/12/sys/sys/epoch.h Mon Jul 8 20:53:25 2019 (r349851) +++ stable/12/sys/sys/epoch.h Mon Jul 8 21:33:14 2019 (r349852) @@ -83,5 +83,11 @@ void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t void epoch_enter(epoch_t epoch); void epoch_exit(epoch_t epoch); +/* for binary compatibility - do not use */ +void epoch_enter_preempt_KBI(epoch_t epoch, epoch_tracker_t et); +void epoch_exit_preempt_KBI(epoch_t epoch, epoch_tracker_t et); +void epoch_enter_KBI(epoch_t epoch); +void epoch_exit_KBI(epoch_t epoch); + #endif /* _KERNEL */ #endif /* _SYS_EPOCH_H_ */