From patchwork Wed Dec 11 05:25:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 181181 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp84625ile; Tue, 10 Dec 2019 21:29:38 -0800 (PST) X-Google-Smtp-Source: APXvYqxa003Whjc5mX7FHyJdw6N0E+GI+WSce+wM4N0OmJTp+zCKXHYRXrFzBddsZkg6vbi6EBCE X-Received: by 2002:a17:906:4e07:: with SMTP id z7mr1207135eju.201.1576042178669; Tue, 10 Dec 2019 21:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576042178; cv=none; d=google.com; s=arc-20160816; b=AvMzgAVC/kZsWpJPwEumZbVVWo4bj9kbombptSwrD9JK0YqHYaHGxxG6uCyrqum1Te JDr6qGS0mFbKdDd1A1dDShjWbrCneVj4IrHOmGIODL71WsYrNH7tiu7/4kudUytm6pSY /cNeIqUUDk/x8sjBVWcCs1p8XqTqIl7Me3QKrSWxxSbQyqpPuU0I/rgH0NO64l3R5h1H FSs8wSPjw/w1m6BRJ4r9X1dLcWHqZAK0tQxLucmlsGO1Q8DOSdH1B/KDJGRBYgXbYBPp tIKJSQCvWcUvbe/65/vU0xyey22z5wah7eY7Gnh/AQHhWVDfGM+RCp0tHepw6MXn9w7u Wc6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=IcqS2LzuL6E5dd8MnvFQjJJ6hRI7RsOBVGNayvoikAI=; b=yLVvfJRGI3YZbFPkvQQiT8MHUyWNBQq2+wVSMaC/9AHl8Y6MfWB4iHqtlE0mES/83s KSlhm3ujSkQqj7oC27sgJTWlmiMpxNslkb/FsjcevCWPJus4oitRJ0iXHHBulJaBlx/f IcmX1pnz3TRGM/riYZ8xDdn9BUlYIzLp7Uog2sja5hupkl6yf4/9/9zYeaLrV7EIWmDq ObsjrbxOHRppt/YqINznvMKn4JViHXADOvLjXmlIdbjlEzorIFAXS7HKjKEApBuI8wFQ f1/8lo+Vj/8BXxci6yVL9gj50Fg/TXqanYnJs9wZ62YswrGjRctOWmFt76UhPhMBU0ML t4lA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id d3si728511eds.75.2019.12.10.21.29.38; Tue, 10 Dec 2019 21:29:38 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 355381BE83; Wed, 11 Dec 2019 06:29:29 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id DC6B691; Wed, 11 Dec 2019 06:29:25 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5EC261A0033; Wed, 11 Dec 2019 06:29:25 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C81C01A0028; Wed, 11 Dec 2019 06:29:22 +0100 (CET) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3522740296; Wed, 11 Dec 2019 13:29:19 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, stable@dpdk.org, Jun Yang , Hemant Agrawal Date: Wed, 11 Dec 2019 10:55:33 +0530 Message-Id: <20191211052534.14600-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" queue_conf need to have mempool details before pair setup. Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") Cc: stable@dpdk.org Signed-off-by: Jun Yang Signed-off-by: Hemant Agrawal --- examples/ip_pipeline/cryptodev.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) -- 2.17.1 Acked-by: Fan Zhang diff --git a/examples/ip_pipeline/cryptodev.c b/examples/ip_pipeline/cryptodev.c index b0d9f3d217..ae65a90859 100644 --- a/examples/ip_pipeline/cryptodev.c +++ b/examples/ip_pipeline/cryptodev.c @@ -99,17 +99,6 @@ cryptodev_create(const char *name, struct cryptodev_params *params) if (status < 0) return NULL; - queue_conf.nb_descriptors = params->queue_size; - for (i = 0; i < params->n_queues; i++) { - status = rte_cryptodev_queue_pair_setup(dev_id, i, - &queue_conf, socket_id); - if (status < 0) - return NULL; - } - - if (rte_cryptodev_start(dev_id) < 0) - return NULL; - cryptodev = calloc(1, sizeof(struct cryptodev)); if (cryptodev == NULL) { rte_cryptodev_stop(dev_id); @@ -149,6 +138,19 @@ cryptodev_create(const char *name, struct cryptodev_params *params) TAILQ_INSERT_TAIL(&cryptodev_list, cryptodev, node); + queue_conf.nb_descriptors = params->queue_size; + queue_conf.mp_session = cryptodev->mp_create; + queue_conf.mp_session_private = cryptodev->mp_init; + for (i = 0; i < params->n_queues; i++) { + status = rte_cryptodev_queue_pair_setup(dev_id, i, + &queue_conf, socket_id); + if (status < 0) + goto error_exit; + } + + if (rte_cryptodev_start(dev_id) < 0) + goto error_exit; + return cryptodev; error_exit: From patchwork Wed Dec 11 05:25:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 181180 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp84500ile; Tue, 10 Dec 2019 21:29:30 -0800 (PST) X-Google-Smtp-Source: APXvYqylT2OXVUsKjOlFlsmuNevBLljFY09+OiUdMcVpzXIu7HPmjFxtXLXXpyRj+YK7taX2jtVF X-Received: by 2002:a17:906:6c84:: with SMTP id s4mr1221685ejr.161.1576042170274; Tue, 10 Dec 2019 21:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576042170; cv=none; d=google.com; s=arc-20160816; b=DrfY+jd+hQCvuAyg/U9Ez6HoD95u5huvN/Wb3hDii7mQEsi//xOrfY2wyTGCpgKThQ S3J9ZTfNkqMVsUgmEFuieydk3PnOBUck3H9N9uAQWgP9Rqr9LAPV9vNZQY9oVlnQzYTO E+cwIa+1v0QJG9E4FSBEoLbMXvMdy4SwIU1MoxO3g63+YzgwiTS23rciv6Q9jhwt8/ma ewenVL7T5f7rl6EnYotvz80YjVcdLTYYX6sXzEu27PBz7Nn+WiwUoTwLw8B9+Vhb6TgZ vTkWDYaCU73af4u1R3ZmrA/Wyfzedg9uH8ho9POUQpaHGOk4iOipeD4XcLe02cZP5YpA rqvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=lX43+esWJ1HoNse5D8Kawp+L2XQcSyKUxtJra+V0z5E=; b=g/qKYPCwhPe1Pl7v4RzVIGz+ciLshBe97p2f0DFC/KkJdQ8ybJH1sQJdf8I3YP5a7N NQod2Ono5F4/6Dq8mFCVnr6X3xhOtdBSJlrqUWSEH/clhn54wiX/Nf4HScaLVCQyBcfP KhDf2Mmo7LpGSecDx8d3CnSaoSZADtBZzdR4tjl4ayJrhh/OeeAp7DFquSPPe2c+5lm1 gFVsB6dO+uA48tISujVyM+B019csNZW+RKukDakeP7egvxkJ3D9dlck+kvOaTvqo4gIC s6WI0QrizMsCYs2Wiw0pd0hugTw7UfrB8Qov3RKHxhMTyG8vgxW2AvmqvKdmejWE3Wzu 6IGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id m4si523252eja.96.2019.12.10.21.29.29; Tue, 10 Dec 2019 21:29:30 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 861971B994; Wed, 11 Dec 2019 06:29:27 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id DFF4D2C6A; Wed, 11 Dec 2019 06:29:25 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4A8681A00AB; Wed, 11 Dec 2019 06:29:25 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1BC081A0033; Wed, 11 Dec 2019 06:29:23 +0100 (CET) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id EFC19402AE; Wed, 11 Dec 2019 13:29:19 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, Stable@dpdk.org, Jun Yang Date: Wed, 11 Dec 2019 10:55:34 +0530 Message-Id: <20191211052534.14600-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191211052534.14600-1-hemant.agrawal@nxp.com> References: <20191211052534.14600-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/2] examples/ip_pipeline: fix to use sock id instead of cpuid X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jun Yang rte_lcore_to_socket_id should be used to convert cpu ID to socket ID. Fixes: 6bfe74f8c93e ("examples/ip_pipeline: add mempool object") Fixes: d75c371e9b46 ("examples/ip_pipeline: add pipeline object") Cc: Stable@dpdk.org Signed-off-by: Jun Yang --- examples/ip_pipeline/mempool.c | 2 +- examples/ip_pipeline/pipeline.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/examples/ip_pipeline/mempool.c b/examples/ip_pipeline/mempool.c index f5d2a7d108..d7eea85f8f 100644 --- a/examples/ip_pipeline/mempool.c +++ b/examples/ip_pipeline/mempool.c @@ -58,7 +58,7 @@ mempool_create(const char *name, struct mempool_params *params) params->cache_size, 0, params->buffer_size - sizeof(struct rte_mbuf), - params->cpu_id); + rte_lcore_to_socket_id(params->cpu_id)); if (m == NULL) return NULL; diff --git a/examples/ip_pipeline/pipeline.c b/examples/ip_pipeline/pipeline.c index b627310a0c..d8df62d785 100644 --- a/examples/ip_pipeline/pipeline.c +++ b/examples/ip_pipeline/pipeline.c @@ -94,7 +94,7 @@ pipeline_create(const char *name, struct pipeline_params *params) msgq_req = rte_ring_create(msgq_name, PIPELINE_MSGQ_SIZE, - params->cpu_id, + rte_lcore_to_socket_id(params->cpu_id), RING_F_SP_ENQ | RING_F_SC_DEQ); if (msgq_req == NULL) return NULL; @@ -103,7 +103,7 @@ pipeline_create(const char *name, struct pipeline_params *params) msgq_rsp = rte_ring_create(msgq_name, PIPELINE_MSGQ_SIZE, - params->cpu_id, + rte_lcore_to_socket_id(params->cpu_id), RING_F_SP_ENQ | RING_F_SC_DEQ); if (msgq_rsp == NULL) { rte_ring_free(msgq_req); @@ -111,7 +111,7 @@ pipeline_create(const char *name, struct pipeline_params *params) } pp.name = name; - pp.socket_id = (int) params->cpu_id; + pp.socket_id = (int) rte_lcore_to_socket_id(params->cpu_id); pp.offset_port_id = params->offset_port_id; p = rte_pipeline_create(&pp); @@ -332,7 +332,7 @@ pipeline_port_in_create(const char *pipeline_name, if (ap) { action = rte_port_in_action_create(ap->ap, - pipeline->cpu_id); + rte_lcore_to_socket_id(pipeline->cpu_id)); if (action == NULL) return -1; @@ -1002,7 +1002,7 @@ pipeline_table_create(const char *pipeline_name, if (ap) { action = rte_table_action_create(ap->ap, - pipeline->cpu_id); + rte_lcore_to_socket_id(pipeline->cpu_id)); if (action == NULL) return -1;