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 E215AA327F for ; Mon, 21 Oct 2019 18:54:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2D1E71BF51; Mon, 21 Oct 2019 18:54:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id BAD771BF44 for ; Mon, 21 Oct 2019 18:53:58 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9LGoeDx010255; Mon, 21 Oct 2019 09:53:57 -0700 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-transfer-encoding : mime-version; s=pfpt0818; bh=MvXei+DeOKggLHqai5ON/ggT7hCIZVKsfmPJukaVEME=; b=F8iTXukWuhb01xX5AhgKSJ6VC3URPmkCkApO7yuPZXQDyV763wMBnmy9CelfZgujETZL 7npeWKHivmSxFkwUGjPHBulLCCen8CkEGl4JKzxuiR2jIUC9uzhC9zX/DzzddzwAvGjv nAhrnmyN75qLffO5DaHqHjxzatqhAdV+v2zBVQxsMKSUnEDsC1WTfIiRGKTvE7tSAE9M YVqc9hMHPW0Bk2gmWE2Y8cLtXxqA+Z6MlJiepG56eFBK6e/87B6n3fDwoPXUcI0Bkuab tSrvuXxJL2fMwkirgmHGtltWvqR1g6L0DqEp7TsKlhyCYK5lr69mZYrp6S80/P1hhpNE Fw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2vr20mpym6-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 21 Oct 2019 09:53:57 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 21 Oct 2019 09:53:55 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.53) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 21 Oct 2019 09:53:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IdCiWbblyHq+2FA1BUKMvpzZAW4IQggw6jxBPcpeyvwzlCip7XqQV7Jij78BaHA+v12RDCCwfDAQiNrHMIuMMKxgD7F5gyboRQ6ZJcwzNbfRHBvMuuZEg+stQ1R9wFC6WL0zwxbEoU87KNfWfJsaP8AgodXu8rYtlWg52qwU22RySw7c76Md6P7w3YdLuWmrDfXliMTuiahhCN/A2PXKVoFprrGLf/T1NsC8PN2JMLgF8Jenrt7R38ASPLC+Ipo8x8OIpLNKcvBwt/55O+PPKbr5/CXpsAZwXmLVCpdyaaEip2tXQjYKlKtK6VwJ+FwyitdRMAgDRIQAcG+LEpVb3Q== 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=MvXei+DeOKggLHqai5ON/ggT7hCIZVKsfmPJukaVEME=; b=FyfwlwtywIm2psVMZQ82/k0RV4UxL8SBb0W8PnNkks1C2tEPGmnmX/6Ja4302KVjH56nzn9U3KZ05IKeF4Q98GZp/r4QN1X1GjN8q9QbG9rG3M79oAsmz5ORz+Nf3RM4yNku2pliN9NZ511g6aP9R0YCnh26Ds8pMZ7kN5m9UwBHM3ZXrsmSNJKisCJVXGE3eN8Eq5LReSfcaQQDl6NRjQ8kA0RrW4Xa+X74y/O416lFZcxtkQkIPASULL61OAp8Z39f/qn0ejKKuJKbHGb6PbSgNHM5j5vSWyUdWNXGgKJrJeSKOnTIm5inomNwG5yl3Xpj0uS55EqHYbgoflr+qQ== 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=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MvXei+DeOKggLHqai5ON/ggT7hCIZVKsfmPJukaVEME=; b=inNZVfT+jz+SLL6gEwqJrKet+1hri3aj6rTEWKNcI9hWV2cA+VlkexXRVCg3FeqEU5UilNq3BTW84KhNGdlMN8IJvqTuPkOXKBgL2AqHl8A/Mql3qVLkHG/q2uWVB3EmLgtf6+a+6Hzv7Ie4T6N6Yja2I9HT52yQR1ylLW3Q66E= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (10.171.255.160) by CY4PR1801MB1896.namprd18.prod.outlook.com (10.171.255.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2367.24; Mon, 21 Oct 2019 16:53:53 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::15d1:f4cf:f510:8fa]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::15d1:f4cf:f510:8fa%4]) with mapi id 15.20.2347.029; Mon, 21 Oct 2019 16:53:53 +0000 From: Pavan Nikhilesh Bhagavatula To: "Varghese, Vipin" , Jerin Jacob Kollanukkaran , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Kovacevic, Marko" , Ori Kam , "Nicolau, Radu" , Akhil Goyal , "Kantecki, Tomasz" , Sunil Kumar Kori CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v6 08/10] examples/l2fwd-event: add eventdev main loop Thread-Index: AQHVh75w7xGx+BciV0m+qgvjJ1dD9qdlSjCg Date: Mon, 21 Oct 2019 16:53:53 +0000 Message-ID: References: <20191002205754.11746-1-pbhagavatula@marvell.com> <20191014182247.961-1-pbhagavatula@marvell.com> <20191014182247.961-9-pbhagavatula@marvell.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D3DCA5B@BGSMSX101.gar.corp.intel.com> In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D3DCA5B@BGSMSX101.gar.corp.intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.172.83.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a59018f7-f29f-414a-64eb-08d756474123 x-ms-traffictypediagnostic: CY4PR1801MB1896: x-ms-exchange-purlcount: 1 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 0197AFBD92 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(39860400002)(346002)(366004)(376002)(199004)(189003)(305945005)(7736002)(6116002)(3846002)(74316002)(6246003)(4326008)(71200400001)(7696005)(99286004)(76176011)(71190400001)(110136005)(316002)(6306002)(6436002)(9686003)(229853002)(55016002)(2906002)(33656002)(25786009)(81156014)(478600001)(6636002)(81166006)(8936002)(86362001)(966005)(14454004)(446003)(11346002)(52536014)(5660300002)(6506007)(102836004)(26005)(256004)(486006)(66476007)(66066001)(64756008)(66946007)(66446008)(76116006)(2501003)(476003)(66556008)(186003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB1896; H:CY4PR1801MB1863.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: qwmFZNp7U9raYy5NHOivlnrt+/rWoDbR4agcxmDeknIoKwQz8d0eWBTQUmYs4a0N4o0pw0gc7kG4+V4Uw5DhiWSzw/aFWLUGtnsVYDGTGyW0HjDHwNTy1KVDls91LDGwIR4bQi5BWv6t7fAO3MwQyT91nhxuiy7fuBjy3lEw/MxaZMPLetVreVdV1OKWsslOEwJwin5Zp6fJtVx8L/D7UsSN5Xy2vyooyJmHsFgT/jRBbsGcx9J071ZDaZ9yH1Fopg1ongN+MZNdFCw6npeUITIKUFyYdaX/a+pWg8vzS4krAir+cfpQ9QSsLNGiOcUNK4RL5Au9xtQ6yW8/UgcdQbr06VLityb28JP7XIKgb8iOVZ/aU/3qFRVgCrOX4tZbKC78Q82CoHkAEL/kBPZYdeP+2ba9p3rzRHeUJDlcqOP/oGHO5tk+DWilGEeyQ48XeRiWh+IFARvmhzqknzI/bwbee+aOc/QNh8XbaP850ms= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a59018f7-f29f-414a-64eb-08d756474123 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2019 16:53:53.0220 (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: pIbvTNCQ7uFipaLjLLZFDb9uJZbs/EHuRlxA2YJuRdjilFN7ewhI5TA9ecOI1GRC3e/ziXworXfkdobbNPg/zO836VmeXVecEPN5LJK/o6M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1896 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-21_04:2019-10-21,2019-10-21 signatures=0 Subject: Re: [dpdk-dev] [PATCH v6 08/10] examples/l2fwd-event: add eventdev main loop 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" Hi Vipin, >HI Pavan, > >snipped >> Add event dev main loop based on enabled l2fwd options and >eventdev >> capabilities. >> >> Signed-off-by: Pavan Nikhilesh >> --- >> + if (rsrc->event_mode) { >> + port_conf.rxmode.mq_mode =3D ETH_MQ_RX_RSS; >> + port_conf.rx_adv_conf.rss_conf.rss_key =3D NULL; >> + port_conf.rx_adv_conf.rss_conf.rss_hf =3D ETH_RSS_IP; >> + } >Question, is RSS hash configured for generating flow id for Eventdev? >As my understanding. RSS for single RX port-queue pair does not >require the same. >snipped In case of SW event device i.e. vdev=3Devent_sw0 the software Rx adapter re= quires mbuf::rss:hash=20 to distribute packets else it has to calculate rss. @see lib/librte_eventdev/rte_event_eth_rx_adapter.c +817 ' rss =3D do_rss ? rxa_do_softrss(m, rx_adapter->rss_key_be) : m->hash.rss; ' >> + if (is_master && timer_period > 0) { >> + cur_tsc =3D rte_rdtsc(); >> + diff_tsc =3D cur_tsc - prev_tsc; >> + >> + /* advance the timer */ >> + timer_tsc +=3D diff_tsc; >> + >> + /* if timer has reached its timeout */ >> + if (unlikely(timer_tsc >=3D timer_period)) { >> + print_stats(rsrc); >> + /* reset the timer */ >> + timer_tsc =3D 0; >> + } >> + prev_tsc =3D cur_tsc; >> + } >Is it possible to move the print_stats to service core, as 'CALL_MASTER' >is enabled in remote_launch making this a potential worker? > Since not every eventdevice requires Service core user might not pass servi= ce core mask. Instead we could do SKIP_MASTER and prints stats here. >> + >> + /* Read packet from eventdev */ >> + if (!rte_event_dequeue_burst(event_d_id, port_id, >&ev, 1, 0)) >> + continue; >Is not this unlikely `nb_burst =3D=3D 0` > Not necessarily refer https://mails.dpdk.org/archives/dev/2018-July/108610.html=20 >> + >> + l2fwd_event_fwd(rsrc, &ev, tx_q_id, timer_period, >flags); >> + >> + if (flags & L2FWD_EVENT_TX_ENQ) { >> + while (rte_event_enqueue_burst(event_d_id, >port_id, >> + &ev, 1) && >> + !rsrc->force_quit) >> + ; >Can we place a `continue` as we are not expecting ` >L2FWD_EVENT_TX_DIRECT`? >> + } > >> + >> + if (flags & L2FWD_EVENT_TX_DIRECT) { >> + while >> (!rte_event_eth_tx_adapter_enqueue(event_d_id, >> + port_id, >> + &ev, 1, >0) && >> + !rsrc->force_quit) >> + ; >> + } >> + } >snipped >> + >> + while (!rsrc->force_quit) { >> + /* if timer is enabled */ >> + if (is_master && timer_period > 0) { >> + cur_tsc =3D rte_rdtsc(); >> + diff_tsc =3D cur_tsc - prev_tsc; >> + >> + /* advance the timer */ >> + timer_tsc +=3D diff_tsc; >> + >> + /* if timer has reached its timeout */ >> + if (unlikely(timer_tsc >=3D timer_period)) { >> + print_stats(rsrc); >> + /* reset the timer */ >> + timer_tsc =3D 0; >> + } >> + prev_tsc =3D cur_tsc; >> + } >Can we move `print_stats` logic to service core? > >> + >> + /* Read packet from eventdev */ >> + nb_rx =3D rte_event_dequeue_burst(event_d_id, >port_id, ev, >> + deq_len, 0); >> + if (nb_rx =3D=3D 0) >Can we use `unlikely`? Not necessarily refer https://mails.dpdk.org/archives/dev/2018-July/108610.html >> + continue; >> + >> + for (i =3D 0; i < nb_rx; i++) { >> + l2fwd_event_fwd(rsrc, &ev[i], tx_q_id, >timer_period, >> + flags); >> + } >> + >> + if (flags & L2FWD_EVENT_TX_ENQ) { >> + nb_tx =3D >rte_event_enqueue_burst(event_d_id, port_id, >> + ev, nb_rx); >> + while (nb_tx < nb_rx && !rsrc->force_quit) >> + nb_tx +=3D >> rte_event_enqueue_burst(event_d_id, >> + port_id, ev + nb_tx, >> + nb_rx - nb_tx); >Can we use `continue` as we do not transmit from the same worker int >his case? I'm not sure I follow what you meant here. We are trying to transmit the wo= rk=20 present on the worker till we succeed, if we do a continue then we would lo= ose the untransmitted packets.=20 @see examples/eventdev_pipeline/pipeline_worker_generic.c +109 >> + } >> + >snipped