From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id CECA42BE1 for ; Wed, 23 May 2018 14:11:11 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id a67-v6so8275702wmf.3 for ; Wed, 23 May 2018 05:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bCN0K+rqWqT/UCDZT1CSMWFQiLHKeK9OoWKYIy0wTXQ=; b=vB+ICbZFFTBEwx1O0gkT6KzadYByVLgMjmpw/7dW6+Tals/cLvtrIeUYig7EpbclmD KNyBGQN5u6NUr/Kwq292U2vKUp40ErE6ck13cRNSxFoiv9MoakyAASjGK5T1+fchvdf1 g8z2AjMTf0IjO4fD75X2EZPqk8SSfTwL+KtlVtxhgLFFnmlApN+YJraCndb7i3eF6dYg cZRW3tm2Ojy66JW02DOdaEHU/HJZwfLBuT3wkfQeymMKEM/aYqP6Wu3/JI2qO5TB59FW c3Qr4TgaPPnzYP2TcftToz8xFRI72xGEj1FfXMmFsTiYZzVsgxyFV8sK6vGJ3pNwiMHw 3KDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bCN0K+rqWqT/UCDZT1CSMWFQiLHKeK9OoWKYIy0wTXQ=; b=GvuzdDUoPGejjKFKKm2qxr/E8GQxIGW4LXfnUgf/OeKXGpqjABk+Hm+eDcO7k0lHnr o+rOcHdsFub0JeBU3mo3iDG6RSsNcmPP1Za7ovpaLjBxC6qDOVjpbXcUt+z0rjRSFBfh y4qTgShUcHKVv9Otim8KY/07RaqQi474qycxc32VEivI+TILv2KkD1SpDNrAv+Z5bf0N XIq6riTNTznvG50ba2LPgJR0FKd24BfCUWSfZdoqsmmh9cFFpRZ8ATezFtSjrns91Y2N n7Swu/0LQlYDwLTfGX0qOpPKmmpvqTo/DWOkCoHSPvV3NTdzyy618xcpQTpMPSKRUURK wjyQ== X-Gm-Message-State: ALKqPwczXyAfOgvvH7gw3vKgYuuWo2ho13J8FcaIdaFz4CzPPhmVKl1R TxrPdOO1YX+nYyrPywyjatAGnqW286M= X-Google-Smtp-Source: AB8JxZqZVGZxrsHXGgTuifTKGxvvN+OmNxAlgbI3UqQFjSWLz1JgYker6/pmRCpEWjGrgSS+ZNFovA== X-Received: by 2002:a1c:8e47:: with SMTP id q68-v6mr4421346wmd.104.1527077471521; Wed, 23 May 2018 05:11:11 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id u37-v6sm18881686wrb.53.2018.05.23.05.11.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 05:11:10 -0700 (PDT) From: luca.boccassi@gmail.com To: Kirill Rybalchenko Cc: Pablo de Lara , Fan Zhang , Reshma Pattan , dpdk stable Date: Wed, 23 May 2018 13:09:45 +0100 Message-Id: <20180523121010.8385-34-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180523121010.8385-1-luca.boccassi@gmail.com> References: <20180516101323.2234-2-luca.boccassi@gmail.com> <20180523121010.8385-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'crypto/scheduler: fix multicore rings re-use' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2018 12:11:12 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/25/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 4036400be71f6501e48286844132e89a6ee16cb1 Mon Sep 17 00:00:00 2001 From: Kirill Rybalchenko Date: Wed, 16 May 2018 15:24:31 +0100 Subject: [PATCH] crypto/scheduler: fix multicore rings re-use [ upstream commit cc32201a8d834a690d76cd281acf553182894d9f ] When scheduler mode changed from multicore to roundrobin and back to multicore, scheduler tries to create memory rings with the same name and fails. The fix allows to lookup and re-use previously allocated memory rings. Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode") Signed-off-by: Kirill Rybalchenko Acked-by: Pablo de Lara Acked-by: Fan Zhang Tested-by: Reshma Pattan --- drivers/crypto/scheduler/scheduler_multicore.c | 28 ++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c index 644426e93..555c405c1 100644 --- a/drivers/crypto/scheduler/scheduler_multicore.c +++ b/drivers/crypto/scheduler/scheduler_multicore.c @@ -348,18 +348,30 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev) char r_name[16]; snprintf(r_name, sizeof(r_name), MC_SCHED_ENQ_RING_NAME_PREFIX "%u", i); - mc_ctx->sched_enq_ring[i] = rte_ring_create(r_name, PER_SLAVE_BUFF_SIZE, - rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ); + mc_ctx->sched_enq_ring[i] = rte_ring_lookup(r_name); if (!mc_ctx->sched_enq_ring[i]) { - CS_LOG_ERR("Cannot create ring for worker %u", i); - goto exit; + mc_ctx->sched_enq_ring[i] = rte_ring_create(r_name, + PER_SLAVE_BUFF_SIZE, + rte_socket_id(), + RING_F_SC_DEQ | RING_F_SP_ENQ); + if (!mc_ctx->sched_enq_ring[i]) { + CS_LOG_ERR("Cannot create ring for worker %u", + i); + goto exit; + } } snprintf(r_name, sizeof(r_name), MC_SCHED_DEQ_RING_NAME_PREFIX "%u", i); - mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name, PER_SLAVE_BUFF_SIZE, - rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ); + mc_ctx->sched_deq_ring[i] = rte_ring_lookup(r_name); if (!mc_ctx->sched_deq_ring[i]) { - CS_LOG_ERR("Cannot create ring for worker %u", i); - goto exit; + mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name, + PER_SLAVE_BUFF_SIZE, + rte_socket_id(), + RING_F_SC_DEQ | RING_F_SP_ENQ); + if (!mc_ctx->sched_deq_ring[i]) { + CS_LOG_ERR("Cannot create ring for worker %u", + i); + goto exit; + } } } -- 2.14.2