From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 080E0A0C47; Sun, 31 Oct 2021 21:25:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 977874068E; Sun, 31 Oct 2021 21:25:43 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id DB73140689 for ; Sun, 31 Oct 2021 21:25:41 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 19VAqYwk028212; Sun, 31 Oct 2021 13:25:41 -0700 Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3c15jkc2un-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 31 Oct 2021 13:25:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tb3EHAgVC/XyBoHCf39f3zMqFsoGOwlyDc6kLlWoPor2GCFKAgmoz1UGISPNtsf37Yv+wBThnh586FcYHJZsD+0rJGDrOQqYmyRZubW07jLvJTHRxhI54SNY0Z0U2mZWuH8LJTKpi6L+yd3wlVJXC9tnRONXLg8hGtssExRmIoKYWkOVOxQx2MHLK0yrtrI5h0pHm4FL3He3VFgbRRsoESlVcIHrhO8gMdOTVrmQmlO29G7f8cVED8ryuC4QC1XeCOvrpdj8CVgYyKS0NptjOzBUeToQjL5RUzlnYYeLd3dcS7t7YK6Z6orv0QVxdI8enzwdE84aAjKHs+L3XDx8Bg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eg8UerAzFJf6GGjA/jy2SVIjMPq4eVRSKl1aODKJmVw=; b=bUtZIuxL8l2R6RB00v6mTa13qFffqP4VoB/XxRgYjZV1WBzar8o76vi4T+RR3R/1W9cs7tKNIvARZX8SvMYGW6vYaHsnWE2GiaaUjVbR+Ht28NRkv8vRIO5yrQyZmG8UeN/pTbBNohkqnXILF/hAcbuhtik31cEuVhArpzZe4vgEckLft9M2gRMK3q9kugN/7Ej6LhQcg3r1aT3kekS7edXvJlCpViCDsMBAjnfZFPQv7wcWfUgNP9GgMtBmuF+/r5vzOu7zqnoK5TWg6LTWFt0WJu3UmObWzkA67YctPee4Ux6JXyXpuvxN/9APxCbBr+n1hQRUTMzn3D/GcfkqPA== 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=eg8UerAzFJf6GGjA/jy2SVIjMPq4eVRSKl1aODKJmVw=; b=bEcBvj7qYZUUGzLWyFdAeUGatqECZj3AWFKetoWkc2IPHKG4sUbBVEqlKWGZU25l5UZhRcjyFe5oBZ1hhg9v0B/5pUzSuIbTyJK2yCFUv35uvv/cQpV8R7/4XYLXcEN22UBJDB0605SRD1BjLQlrOPSBG5pCYqk5DxSE5/HOi8A= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4812.namprd18.prod.outlook.com (2603:10b6:303:ef::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Sun, 31 Oct 2021 20:25:39 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8%8]) with mapi id 15.20.4649.019; Sun, 31 Oct 2021 20:25:39 +0000 From: Akhil Goyal To: Radu Nicolau CC: "dev@dpdk.org" , "declan.doherty@intel.com" , "hemant.agrawal@oss.nxp.com" Thread-Topic: [EXT] [PATCH v5 6/7] examples/ipsec-secgw: add ethdev reset callback Thread-Index: AQHXyyokpBEdpcbZl0y8BPvrNgvCK6vtlDFQ Date: Sun, 31 Oct 2021 20:25:39 +0000 Message-ID: References: <20210903112257.303961-1-radu.nicolau@intel.com> <20211027114530.2244661-1-radu.nicolau@intel.com> <20211027114530.2244661-7-radu.nicolau@intel.com> In-Reply-To: <20211027114530.2244661-7-radu.nicolau@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d8dcb0a2-c360-43db-7001-08d99cac9afb x-ms-traffictypediagnostic: CO1PR18MB4812: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2887; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UrMblhrctM0+Kw+YvzF6DkhvtqLt9U6CYs1K7XZfQFxS2OK9Vf3GAtgUMeQWy95HuocQhHhbIiMqosr0EbV1wh8/FQAz+H+/H5E6Ywt4tQ90Rd1mSDnsWlBGmhxDLbHU/zKnD87mjvLhUuiHM6XVqN7Xk864u3Q4Ph9c6eVfWGf/judYNa7/tQoXAfE7d/Z9nYo9ctweYiu2auxEeyfYOjkCZ5XEZjLosKb1cOjnPdZwb422iaoQWCIFmZLrAxXsHz1IKVlmn79GjBW0VGBu6cY/J2KD2MdiMi/joYWm8tGd997ytowwa+ZkM35EoVmcDnFgbsSVIOr3rM8GFiluHXtOKICjpOHcDdAY6dbd+pA3J0/yyw833t71c3ChuAxY3CZUmghWpECnL4fYSDUeTA/slJpPUxUGhV+pAjXYpUOq8FWjwkXhJ4M/4RxlHOgzK+XwZN+2B37sZSHlc+ZYW3Phgv61RcDV20oikNIpy+A4os8vZK+r5mvjULb0cMWsXVLKe0yHGNOKH1TA38HYRZnrC7wmm1IL+Jr/hOo3dCvaFky167A7gsK+Z2zG2+0BKU78CtAqhyrPDlAz8f+l162ygVLqlfnheZBs3vYhMw5TwpN/BLCtS/34AaAsv7Vwaf5xukD3zAVunmoV+nNslKpRKt0vN1ljYhk6HSWuEK2LRKYSiI/J4KbL3F5OJ+FtdSmjMdLgw16gUULf3DIAjg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(122000001)(86362001)(5660300002)(8676002)(316002)(52536014)(2906002)(71200400001)(38070700005)(6506007)(6916009)(4326008)(54906003)(38100700002)(9686003)(508600001)(33656002)(83380400001)(7696005)(66556008)(64756008)(66446008)(55016002)(66476007)(186003)(66946007)(8936002)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ypq6N8mjM9UFZ1tQB6mtAYcghGthspQHlIA0/JMlTcvzy7dqSRj1c46BL7kS?= =?us-ascii?Q?NlVTCzLPIhtvJ+b9xr1e4ZT6JS+5Ly9jsLw5nx4x1Zljmy9mrfnPBaJhdNpl?= =?us-ascii?Q?vvW7AZZKUdtXOPVta9IwqKzMyTxJgKxKsv0jT5RB0MmxlJx5+foQpMN0PuP2?= =?us-ascii?Q?foOpMFJN3UTdJ51n7fecFfokZ5GoHaNt1l4wciUChITlL4KdruDcjSrDy3BY?= =?us-ascii?Q?TluE2Jc3q/ve2JPmUaWqbRaUkvn8wol35oep0srlDq5yK0ksjC/Gixosnxs8?= =?us-ascii?Q?a6S30vSfuhSaOYbdfS8YKyVNRstLEOmarpRRXVwFNgUhYE2Tg/um03wB1RFW?= =?us-ascii?Q?lJn4yrMlK7XsETEZnm2LksIB9WUZQM+2srfA0ChrPlWagWEazWUwdTtUBviC?= =?us-ascii?Q?TyV0xAA9rMt8muhfX7+rFTlj7pubKRqQcK0p7Oacuw7IBgsbAzn6zaGmbLtV?= =?us-ascii?Q?my8dptI0cmjn2w+Hs4OxHngDO+dnS2eC2HlswmtVQjvLTSPe05UWBUPKCk4a?= =?us-ascii?Q?HRoItvsq28ZDAUKBwonZYKhrJZzrfvhG9f88Q89hm3+x9m3bQb8tzfG2Q/UO?= =?us-ascii?Q?HQA2SrDc4tO1r14M7SO0np8Sp8O/AgkHymWr+wczbNBcquFH2lXOHx406lxs?= =?us-ascii?Q?RwrufUfIRq9ZEe1IqqYNWam1pp36fkGiOS/x/vTG9lxDklAsgtZ5XbG5IsIW?= =?us-ascii?Q?r09nR3dObyORi/zu4qN35NPt0xU3yjaczyiLsJRWDGZB+jvWpY5eAY0IVgpr?= =?us-ascii?Q?wrDCyEov7x74V6GAtBI1k8F3yjpNk/brMg4eUY+V7DfT6nSUTNFTvJKIEel1?= =?us-ascii?Q?Gtp/uuslMnbzEm/qBCemoFD4yPzrAbR/CWY5IFh6t7+I+W+UJNWZySnBlfau?= =?us-ascii?Q?AX6hzjYJofrtvGYoFst4sa3iSOhKibjJGERTBjyyRpEBKHOW6dU19vREdsXB?= =?us-ascii?Q?lq/iD9mRVPkLegq/0tVJnRRtNL7NcbN87+LHDoEY52655bOgC92MlwO5O6Cw?= =?us-ascii?Q?UfpACqlcdJEtV7PO8gm6ZilVJlSypznm4fobWmvSAO328GhBheXQq3YqDYgP?= =?us-ascii?Q?ClfZxAh8Y0TYEj0t5cLYnfDhycIhDzPdw03g5tZ3oMNVCg54W+jCI29lmxlT?= =?us-ascii?Q?AIuXhR6jYhpQYhJ3APvsKC2tjay7lza6Fy1Lga9XU7GXYegruLOpB0p1tbjw?= =?us-ascii?Q?xuFsmhZJf13cXaNZDj1gpTEUd1WjshsCpA/995Yur63YY+Q1ku5Yweyb8mHo?= =?us-ascii?Q?Ahh6A7XeFrh4xz9wLA9nmN66Z3mlU3UQtYOh8wnVMAeHUhY99JN+49gklcYe?= =?us-ascii?Q?T41+u6L4514b6Em5wxdTc/rWFnvghibQxb7EwYxd4OZK4R26HZZlFSmM7P+u?= =?us-ascii?Q?QhVEJgQTOZcigXbn5GyTkvl4mo6YX2UbBaVC4AzR3eLZHfNowBTOlrkGoWpI?= =?us-ascii?Q?d4LOgqRPgOS7hPFw0axnGJ+fVt9IbtjyXCxKjzRgjPuh3xQang/66wJQ80jf?= =?us-ascii?Q?JsupefyL+maIWUTLstZItCmhipH5/wTWX8N+tcdI/3WjFA73auaZsjJVwgCW?= =?us-ascii?Q?nAgZSP0MU/AqsYqwHUDyHKu1C5gzaR6/Pc8fXIZv65eEd5dxPaBStaQ8DJUu?= =?us-ascii?Q?UflmEYhp6AKrkZZCaJGl9IHvckZgckTxqHlTJoRXif5JjPZCXluBqjWUvZdQ?= =?us-ascii?Q?BKvfPpExqsZAHBnSKKEn/+4z6ps=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8dcb0a2-c360-43db-7001-08d99cac9afb X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Oct 2021 20:25:39.6042 (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: fe3usuxN0gVYIezpjnz5yac8dtpASag+HO2fdQ+2HtRU/HWYv6jZcl8NvqlcNaIwvmaP1Sye7kq4i0gdwTPLWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4812 X-Proofpoint-GUID: myon51uYxZ-k2u8mllnayqAxMqzua27m X-Proofpoint-ORIG-GUID: myon51uYxZ-k2u8mllnayqAxMqzua27m X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-31_06,2021-10-29_03,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [PATCH v5 6/7] examples/ipsec-secgw: add ethdev reset callback 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" > Applications should not quietly ignore an ethdev reset event. > Register an event handler for ethdev reset callback > RTE_ETH_EVENT_INTR_RESET that prints a message and > quits the application. >=20 > Signed-off-by: Declan Doherty > Signed-off-by: Radu Nicolau > --- > examples/ipsec-secgw/ipsec-secgw.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) >=20 > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec- > secgw/ipsec-secgw.c > index 1ef24b7b5c..bfa2070b8d 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -2545,6 +2545,17 @@ inline_ipsec_event_callback(uint16_t port_id, > enum rte_eth_event_type type, > return -1; > } >=20 > +static int > +ethdev_reset_event_callback(uint16_t port_id, > + enum rte_eth_event_type type __rte_unused, > + void *param __rte_unused, void *ret_param __rte_unused) > +{ > + printf("Reset Event on port id %d\n", port_id); You can also print the type of eth event that has happened. With this fixed, Acked-by: Akhil Goyal > + printf("Force quit application"); > + force_quit =3D true; > + return 0; > +} > + > static uint16_t > rx_callback(__rte_unused uint16_t port, __rte_unused uint16_t queue, > struct rte_mbuf *pkt[], uint16_t nb_pkts, > @@ -3311,6 +3322,9 @@ main(int32_t argc, char **argv) > rte_strerror(-ret), portid); > } >=20 > + rte_eth_dev_callback_register(portid, > RTE_ETH_EVENT_INTR_RESET, > + ethdev_reset_event_callback, NULL); > + > rte_eth_dev_callback_register(portid, > RTE_ETH_EVENT_IPSEC, inline_ipsec_event_callback, > NULL); > } > -- > 2.25.1