The branch stable/12 has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=40a37d24a8ed2d6e81919ed3c124494cbcf5c527

commit 40a37d24a8ed2d6e81919ed3c124494cbcf5c527
Author:     Mark Johnston <[email protected]>
AuthorDate: 2021-02-04 14:43:10 +0000
Commit:     Mark Johnston <[email protected]>
CommitDate: 2021-02-04 14:44:53 +0000

    Revert "opencrypto: Fix assignment of crypto completions to worker threads"
    
    atomic_fetchadd_64 is not available on all platforms on stable/12.
    
    This reverts commit 10ed8ab4ab9bd0239f2913ac2f35af9b9f76221d.
    
    Reported by:    Mark Millard
---
 sys/opencrypto/crypto.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
index bc23056e86ad..dfd22662e87f 100644
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -94,7 +94,6 @@ struct crypto_session {
        void *softc;
        uint32_t hid;
        uint32_t capabilities;
-       uint64_t id;
 };
 
 SDT_PROVIDER_DEFINE(opencrypto);
@@ -573,7 +572,6 @@ again:
 int
 crypto_newsession(crypto_session_t *cses, struct cryptoini *cri, int crid)
 {
-       static uint64_t sessid = 0;
        crypto_session_t res;
        void *softc_mem;
        struct cryptocap *cap;
@@ -618,7 +616,6 @@ restart:
        softc_mem = malloc(softc_size, M_CRYPTO_DATA, M_WAITOK | M_ZERO);
        res = uma_zalloc(cryptoses_zone, M_WAITOK | M_ZERO);
        res->softc = softc_mem;
-       res->id = atomic_fetchadd_64(&sessid, 1);
 
        CRYPTO_DRIVER_LOCK();
        cap = crypto_checkdriver(hid);
@@ -1019,7 +1016,7 @@ crypto_dispatch(struct cryptop *crp)
                binuptime(&crp->crp_tstamp);
 #endif
 
-       crp->crp_retw_id = crp->crp_session->id % crypto_workers_num;
+       crp->crp_retw_id = ((uintptr_t)crp->crp_session) % crypto_workers_num;
 
        if (CRYPTOP_ASYNC(crp)) {
                if (crp->crp_flags & CRYPTO_F_ASYNC_KEEPORDER) {
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to