From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4DDCFA0530; Wed, 22 Jan 2020 14:30:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CA642BF1; Wed, 22 Jan 2020 14:30:32 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 67AA32B98; Wed, 22 Jan 2020 14:30:31 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00MDUGhG031220; Wed, 22 Jan 2020 05:30:30 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=pfpt0818; bh=x6Z8EqdIxXzBI9lBLFBFYaj7ElYFlmlZCkg5g33ZZN0=; b=Aj4nD60+pwhHrdFG0n1ar8pJePij9p6WA8Dq54OnF+A48hNZYc3+YxnfwqDgCLvi3J+M nVHwivwOfePqGvHzcGn5AnIQ19Agj+dmdPCWaedfey6/utUp3xe0jLNeJ7OHC4z+IApm tCIQbXf4elYG18Vsg9BjGbfbkjYiMA2SSrUWzbY4TuvIvrGogB+tT5Lkjd/Uy72Fuo8B CWsmo+3aTrrqYCxpjfnr5qFRc0sDo5TO0ToZc6cVZGglnOiKCZNkPF/TZrlyFKoEfUSD RmtmA1Sjr5fr4DTuftPA3ReOYucxpgbMtEVAxoMMtxAzR/98gQmzeNY/221nv4qszH2d PA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2xpm900p6p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 22 Jan 2020 05:30:30 -0800 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Jan 2020 05:30:28 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 22 Jan 2020 05:30:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V/OG3aygheUpVlfpvb1xBAYmQY2ZHjsyVMIFdlPGUPND7DvTOTOebItEu5/HqcAlF1b7qsMnmpOQu6DSsuuDRyUN8Y7lbctBofu8OfLvuRVa9IexzDFY4BQMVL1Xrk1hc80BhNKMOZmRp3D+awKjrJNb8yMjFKcy8vbo3z31W6Vgkk/kijW7PHaLcSIAV5AePU8FHgtvR3wiUtZEWw+R20E+hcrRorAO+8n6/Z/WT+tl47774j27uJCtcyNsxQXpJr3hRFFX8HzqfSKYZkOfoljd7j5fq/otdE/pfyLX5kH9FimvvIYADOITng7YSFj0t67CRy3q6NrOn41OlFfLEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x6Z8EqdIxXzBI9lBLFBFYaj7ElYFlmlZCkg5g33ZZN0=; b=f8u/uqcY+/M8z5OSIclgPzYalm4Kpln1DJWhC4A4qYolElwzhAG6okv6iPtnimkmIvWBrdY63Veb/xMyYpomDPIWnpRhhUFNmgz0JkZAhO0HPwuHcyysDPYt4trCyt0y6KYqeVxqj46LPuhdhxxg5m1ep8wScdxFaEm4SDzE3aSIhY2T4gy0GP9oBx4SWtLSwNgMiSZ0hzH8S80AfyVeKxwiQLk+NQQxi1FFtvv0IxcFs9FocPjGlKFbCCIPD+40BMWNkHZyQeSe1R8RCGzfa/EbPLevthzS2d4jCwcXG2xCVLd3AvaRpfInj7FfA5jJWnMxO8aabZmt8DX6MjLGyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x6Z8EqdIxXzBI9lBLFBFYaj7ElYFlmlZCkg5g33ZZN0=; b=EReuFjnIlb7bSGiNmFb/Y+99KGx7MmD9yhNQYYTi2DKgO9D42GG6AlSGdaItrsCWVRHJ+gxOUc5vwTCdjp55A35UqxweGMxjoE+7TJ2eTqcSDu8r+3UcR1/Il63iUsalqWxXu3CDFUmGmkh8HbFdzQsH3YSlv1B233RsGtQNuHo= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.20.19) by MN2PR18MB2400.namprd18.prod.outlook.com (20.179.80.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 22 Jan 2020 13:30:26 +0000 Received: from MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::6de0:6ead:9fc:5beb]) by MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::6de0:6ead:9fc:5beb%3]) with mapi id 15.20.2644.028; Wed, 22 Jan 2020 13:30:26 +0000 Received: from outlook.office365.com (115.113.156.2) by PN1PR0101CA0005.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19 via Frontend Transport; Wed, 22 Jan 2020 13:30:25 +0000 From: Harman Kalra To: Xiao Wang CC: "david.hunt@intel.com" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 2/2] l3fwd-power: fix interrupt disable Thread-Index: AQHVz6QkOqWwHDQUfEysjS++jyKrYaf2sNoA Date: Wed, 22 Jan 2020 13:30:26 +0000 Message-ID: <20200122133004.GA45794@outlook.office365.com> References: <20200121030657.39048-1-xiao.w.wang@intel.com> <20200121030657.39048-3-xiao.w.wang@intel.com> In-Reply-To: <20200121030657.39048-3-xiao.w.wang@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PN1PR0101CA0005.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::15) To MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:38::19) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1c926314-94b2-4486-28f5-08d79f3f3db8 x-ms-traffictypediagnostic: MN2PR18MB2400: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 029097202E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(346002)(396003)(366004)(39860400002)(199004)(189003)(33656002)(4326008)(86362001)(52116002)(54906003)(7696005)(8676002)(478600001)(316002)(956004)(81156014)(81166006)(1076003)(71200400001)(16526019)(66476007)(66946007)(26005)(8936002)(66556008)(66446008)(64756008)(186003)(5660300002)(55016002)(2906002)(55236004)(9686003)(6916009)(6506007)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2400; H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uvicNLGxi2lYqkBIw1yc4kZgKwI0gBzgt6V4H40tL8CHtu2mVrC11TZ4V+x7N1W8uSP7GQRpSYeW5RmJH3grcufxFnn38BHTM+H7BrfXkbn/6xZbnSrpe4n79pOG/OZ3lofdCYeK9gqKlkZcq6HApqiJTJ8SRO5G0Fti4tMsyfC9gpqHi4iocL9D+u534ITPkGH1jt+VJOS53HTCeS1ievM8mBn9xcj9RIveen1QtcpiM53EdhvZJm3UCWU2c4SE3+NonWkYtbpXLxd3kMAneoedHw+82Wcs1qGViac7G3SpsMj6zdwF5bZO5HulZZisYB9CmJk5aHPGWDEPPvkRBTsyFGKQiyEE0WebJna3m4FPLgxOcC3GqWzbNnoQLI9eopb4LstfFMMMqZnzD6yvg8O98rIcOnKHpdaNfH+jZ/aRpXBHgEI5lYhbWacE/fnbqXn2bwYfzl3oBxWpoPtgjbvQ5IzM4A91DlJFJZQDohVLGdXoKs9ng5rQDSG6EMGM x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: <2A1E5CFA578202468567D3D8B8432899@namprd18.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1c926314-94b2-4486-28f5-08d79f3f3db8 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2020 13:30:26.6088 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0NjS2lAbKwDNLHcEuhNjziuslriuoSEF6++fbO3cOyc+dCMMWgXfqZ3DyU2U+ZG7PsSDhwd9TIQ7NmuOcs1e+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2400 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-17_05:2020-01-16, 2020-01-17 signatures=0 Subject: Re: [dpdk-dev] [PATCH 2/2] l3fwd-power: fix interrupt disable 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" On Mon, Jan 20, 2020 at 10:06:57PM -0500, Xiao Wang wrote: > Since all related queues' interrupts are turned on before epoll, we need > to turn off all the interrupts after wakeup. This patch fixes the issue > of only turning off the interrupted queues. >=20 > Fixes: b736d64787fc ("examples/l3fwd-power: disable Rx interrupt when wak= ing up") > Cc: stable@dpdk.org >=20 > Signed-off-by: Xiao Wang > --- > examples/l3fwd-power/main.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) >=20 > diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c > index ffcc7ecf4..e9b2cb5b3 100644 > --- a/examples/l3fwd-power/main.c > +++ b/examples/l3fwd-power/main.c > @@ -880,9 +880,6 @@ sleep_until_rx_interrupt(int num) > port_id =3D ((uintptr_t)data) >> CHAR_BIT; > queue_id =3D ((uintptr_t)data) & > RTE_LEN2MASK(CHAR_BIT, uint8_t); > - rte_spinlock_lock(&(locks[port_id])); > - rte_eth_dev_rx_intr_disable(port_id, queue_id); > - rte_spinlock_unlock(&(locks[port_id])); > RTE_LOG(INFO, L3FWD_POWER, > "lcore %u is waked up from rx interrupt on" > " port %d queue %d\n", > @@ -892,7 +889,7 @@ sleep_until_rx_interrupt(int num) > return 0; > } > =20 > -static void turn_on_intr(struct lcore_conf *qconf) > +static void turn_on_off_intr(struct lcore_conf *qconf, bool on) > { > int i; > struct lcore_rx_queue *rx_queue; > @@ -905,7 +902,10 @@ static void turn_on_intr(struct lcore_conf *qconf) > queue_id =3D rx_queue->queue_id; > =20 > rte_spinlock_lock(&(locks[port_id])); > - rte_eth_dev_rx_intr_enable(port_id, queue_id); > + if (on) > + rte_eth_dev_rx_intr_enable(port_id, queue_id); > + else > + rte_eth_dev_rx_intr_disable(port_id, queue_id); Hi Wang I tested this patch on octeontx2 platform and have some queries regarding the same: Difference what I observed with this patch is, you are disabling interrupts for all the queues handled by the core which woke up but what is the advantage of doing so?=20 I dont see any difference wrt octeontx2, with and without this patch in term of power saving. Can you please explain what I am missing. Thanks Harman > rte_spinlock_unlock(&(locks[port_id])); > } > } > @@ -1340,9 +1340,10 @@ main_loop(__attribute__((unused)) void *dummy) > else { > /* suspend until rx interrupt triggers */ > if (intr_en) { > - turn_on_intr(qconf); > + turn_on_off_intr(qconf, 1); > sleep_until_rx_interrupt( > qconf->n_rx_queue); > + turn_on_off_intr(qconf, 0); > /** > * start receiving packets immediately > */ > --=20 > 2.15.1 >=20