From patchwork Mon Jun 28 15:54:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 94906 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BDD0AA0A0C; Mon, 28 Jun 2021 17:55:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCCA741172; Mon, 28 Jun 2021 17:54:44 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id C6B1141163 for ; Mon, 28 Jun 2021 17:54:33 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10029"; a="204975524" X-IronPort-AV: E=Sophos;i="5.83,306,1616482800"; d="scan'208";a="204975524" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2021 08:54:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,306,1616482800"; d="scan'208";a="625296713" Received: from silpixa00399498.ir.intel.com (HELO silpixa00399498.ger.corp.intel.com) ([10.237.223.53]) by orsmga005.jf.intel.com with ESMTP; 28 Jun 2021 08:54:32 -0700 From: Anatoly Burakov To: dev@dpdk.org, David Hunt Cc: konstantin.ananyev@intel.com, ciara.loftus@intel.com Date: Mon, 28 Jun 2021 15:54:14 +0000 Message-Id: <514d89a9555ff38ea953662d3c8eb262bce7560f.1624895595.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 7/7] l3fwd-power: support multiqueue in PMD pmgmt modes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Currently, l3fwd-power enforces the limitation of having one queue per lcore. This is no longer necessary, so remove the limitation, and always mark the last queue in qconf as the power save queue. Signed-off-by: Anatoly Burakov --- examples/l3fwd-power/main.c | 39 +++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index f8dfed1634..3057c06936 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -2498,6 +2498,27 @@ mode_to_str(enum appmode mode) } } +static void +pmd_pmgmt_set_up(unsigned int lcore, uint16_t portid, uint16_t qid, bool last) +{ + int ret; + + ret = rte_power_ethdev_pmgmt_queue_enable(lcore, portid, + qid, pmgmt_type); + if (ret < 0) + rte_exit(EXIT_FAILURE, + "rte_power_ethdev_pmgmt_queue_enable: err=%d, port=%d\n", + ret, portid); + + if (!last) + return; + ret = rte_power_ethdev_pmgmt_queue_set_power_save(lcore, portid, qid); + if (ret < 0) + rte_exit(EXIT_FAILURE, + "rte_power_ethdev_pmgmt_queue_set_power_save: err=%d, port=%d\n", + ret, portid); +} + int main(int argc, char **argv) { @@ -2723,12 +2744,6 @@ main(int argc, char **argv) printf("\nInitializing rx queues on lcore %u ... ", lcore_id ); fflush(stdout); - /* PMD power management mode can only do 1 queue per core */ - if (app_mode == APP_MODE_PMD_MGMT && qconf->n_rx_queue > 1) { - rte_exit(EXIT_FAILURE, - "In PMD power management mode, only one queue per lcore is allowed\n"); - } - /* init RX queues */ for(queue = 0; queue < qconf->n_rx_queue; ++queue) { struct rte_eth_rxconf rxq_conf; @@ -2767,15 +2782,9 @@ main(int argc, char **argv) "Fail to add ptype cb\n"); } - if (app_mode == APP_MODE_PMD_MGMT) { - ret = rte_power_ethdev_pmgmt_queue_enable( - lcore_id, portid, queueid, - pmgmt_type); - if (ret < 0) - rte_exit(EXIT_FAILURE, - "rte_power_ethdev_pmgmt_queue_enable: err=%d, port=%d\n", - ret, portid); - } + if (app_mode == APP_MODE_PMD_MGMT) + pmd_pmgmt_set_up(lcore_id, portid, queueid, + queue == (qconf->n_rx_queue - 1)); } }