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 60667A00C3; Fri, 13 May 2022 15:42:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C4C040DF7; Fri, 13 May 2022 15:42:02 +0200 (CEST) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by mails.dpdk.org (Postfix) with ESMTP id CAA4040DDE for ; Fri, 13 May 2022 15:42:00 +0200 (CEST) Received: by mail-io1-f54.google.com with SMTP id z18so8698627iob.5 for ; Fri, 13 May 2022 06:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4hs9ppfH27rQnKk5s4c9IL5MxjkIN4Ovy0s4ypxpp8s=; b=GIB2XUsraPD7s1X5Aui10vOe9Zoytr+P7QgFR6iFbDUpL1FwLq+RAB4gJ0v5L/OgHe KPphnFDiF1isOEP/MZBSdnXld0u4Q92TyKyKTwNvbKqCZu7wU6B0ObJ8lg0TmXu9krPu maUxlSPZ7+/64siRWIGeeqn5+2XiuNSNaRBDZqH30/Z1dp8kiBV1NA1FN7eqC+31ZxS6 tBjoWKpAaM1p8Pi1ipWvC/VlMna4ZzawsN08jwyKBEp/pjXPtqPm+Ie4zQ5QKjA0yr4Z Wrjw9jFHqmqpmgYSDknMRRBS77eC5YQzYUyES0t4YdqUGigoOwep6yP6x1BhGdWAOHxF w0fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4hs9ppfH27rQnKk5s4c9IL5MxjkIN4Ovy0s4ypxpp8s=; b=W/CFWvM6F+V0ihlUBZfm75ccirD27SCw+xj/WA7kVnIuXk8S46LdmnF02J1NBbT+/f bQPtjSrGanofe9suQCttsD2NJ8EyevQ99X80wMFxTo4drkwM1cYzwhf/66nIldIi0aHI yu4QGseYOBZ87zsP090/D80zrXpb3/d4MhLJjxUtn19V0kKKWgU5bSQYIRWmt3GcteTP rPBD868OKJmgkEwHRDIlLInuFIOx9O7a+RKLbQjjnmMoc9Mvs3XKGkgrOdPCvMdvLr1z 8RoGtH6BMf5MfpNoVTfvF2kzKNUa6bXRHSNbOT70XFbOZBlayOH+nxxKCde2RRlefcwo v7eg== X-Gm-Message-State: AOAM533qvHfCnvUnjQkpuP5tivImXmxHGl5LIp6rZy9R6mJjJMxa4rrr vi9PfYP/9N8/K59IKbe9CQ3DmUB8R1VQYj8mOpE= X-Google-Smtp-Source: ABdhPJyFv3SmDrTYIRqDP0mfifMo3PQoC2UfG+4JAPCvvbQbz453N8m/iT33iDwRsg/TYyXDGK7vyfgm24HRVcSUzAE= X-Received: by 2002:a02:b693:0:b0:32d:adc7:ad17 with SMTP id i19-20020a02b693000000b0032dadc7ad17mr2688640jam.266.1652449320181; Fri, 13 May 2022 06:42:00 -0700 (PDT) MIME-Version: 1.0 References: <20220426211412.6138-1-pbhagavatula@marvell.com> <20220426211412.6138-6-pbhagavatula@marvell.com> In-Reply-To: <20220426211412.6138-6-pbhagavatula@marvell.com> From: Jerin Jacob Date: Fri, 13 May 2022 19:11:34 +0530 Message-ID: Subject: Re: [PATCH 6/6] examples/ipsec-secgw: cleanup worker state before exit To: Pavan Nikhilesh Cc: Jerin Jacob , Radu Nicolau , Akhil Goyal , dpdk-dev Content-Type: text/plain; charset="UTF-8" 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 On Wed, Apr 27, 2022 at 2:45 AM Pavan Nikhilesh wrote: > > Event ports are configured to implicitly release the scheduler contexts > currently held in the next call to rte_event_dequeue_burst(). > A worker core might still hold a scheduling context during exit as the > next call to rte_event_dequeue_burst() is never made. > This might lead to deadlock based on the worker exit timing and when > there are very less number of flows. > > Add a cleanup function to release any scheduling contexts held by the > worker by using RTE_EVENT_OP_RELEASE. > > Signed-off-by: Pavan Nikhilesh Please fix following check path error in this series ### app/eventdev: simplify signal handling and teardown WARNING:SPACING: space prohibited between function name and open parenthesis '(' #163: FILE: app/test-eventdev/test_perf_common.c:1112: + RTE_ETH_FOREACH_DEV (i) { WARNING:SPACING: space prohibited between function name and open parenthesis '(' #234: FILE: app/test-eventdev/test_pipeline_common.c:515: + RTE_ETH_FOREACH_DEV (i) { > --- > examples/ipsec-secgw/ipsec_worker.c | 40 ++++++++++++++++++++--------- > 1 file changed, 28 insertions(+), 12 deletions(-) > > diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c > index 8639426c5c..3df5acf384 100644 > --- a/examples/ipsec-secgw/ipsec_worker.c > +++ b/examples/ipsec-secgw/ipsec_worker.c > @@ -749,7 +749,7 @@ ipsec_wrkr_non_burst_int_port_drv_mode(struct eh_event_link_info *links, > uint8_t nb_links) > { > struct port_drv_mode_data data[RTE_MAX_ETHPORTS]; > - unsigned int nb_rx = 0; > + unsigned int nb_rx = 0, nb_tx; > struct rte_mbuf *pkt; > struct rte_event ev; > uint32_t lcore_id; > @@ -847,11 +847,19 @@ ipsec_wrkr_non_burst_int_port_drv_mode(struct eh_event_link_info *links, > * directly enqueued to the adapter and it would be > * internally submitted to the eth device. > */ > - rte_event_eth_tx_adapter_enqueue(links[0].eventdev_id, > - links[0].event_port_id, > - &ev, /* events */ > - 1, /* nb_events */ > - 0 /* flags */); > + nb_tx = rte_event_eth_tx_adapter_enqueue(links[0].eventdev_id, > + links[0].event_port_id, > + &ev, /* events */ > + 1, /* nb_events */ > + 0 /* flags */); > + if (!nb_tx) > + rte_pktmbuf_free(ev.mbuf); > + } > + > + if (ev.u64) { > + ev.op = RTE_EVENT_OP_RELEASE; > + rte_event_enqueue_burst(links[0].eventdev_id, > + links[0].event_port_id, &ev, 1); > } > } > > @@ -864,7 +872,7 @@ ipsec_wrkr_non_burst_int_port_app_mode(struct eh_event_link_info *links, > uint8_t nb_links) > { > struct lcore_conf_ev_tx_int_port_wrkr lconf; > - unsigned int nb_rx = 0; > + unsigned int nb_rx = 0, nb_tx; > struct rte_event ev; > uint32_t lcore_id; > int32_t socket_id; > @@ -952,11 +960,19 @@ ipsec_wrkr_non_burst_int_port_app_mode(struct eh_event_link_info *links, > * directly enqueued to the adapter and it would be > * internally submitted to the eth device. > */ > - rte_event_eth_tx_adapter_enqueue(links[0].eventdev_id, > - links[0].event_port_id, > - &ev, /* events */ > - 1, /* nb_events */ > - 0 /* flags */); > + nb_tx = rte_event_eth_tx_adapter_enqueue(links[0].eventdev_id, > + links[0].event_port_id, > + &ev, /* events */ > + 1, /* nb_events */ > + 0 /* flags */); > + if (!nb_tx) > + rte_pktmbuf_free(ev.mbuf); > + } > + > + if (ev.u64) { > + ev.op = RTE_EVENT_OP_RELEASE; > + rte_event_enqueue_burst(links[0].eventdev_id, > + links[0].event_port_id, &ev, 1); > } > } > > -- > 2.25.1 >