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 26FA5A0543; Mon, 13 Jun 2022 07:50:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5B4F4021E; Mon, 13 Jun 2022 07:50:02 +0200 (CEST) Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) by mails.dpdk.org (Postfix) with ESMTP id 8D07540150 for ; Mon, 13 Jun 2022 07:50:01 +0200 (CEST) Received: by mail-qv1-f42.google.com with SMTP id a9so3705594qvt.6 for ; Sun, 12 Jun 2022 22:50:01 -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=1plfe2XCtMlfiHHyXb9l2HQ0WtJu18Hjkx8C32uRK2U=; b=UbDty0CnGJ83EuVb0wB0xmiKsi4Nsnbph7VLIsEJUq3vESG4lQEltvYBjolhCEa//e aM+6o84t4/+NsAbeEZnBJfGt2z+3QMHqIsSwjHsySz9rqI0cTIob5jpaCInBDWkQsH4e f08ywF9sCas5jTTl+06HSyNCGhIN1L6agolApSfsm7yks1V+9GQwmchpTnReKe3w1Nsc qFT1kNZGbw2dpKBl6pr4TWNwMJCmiNspH/LWTyzHCbIDzBvxHpLjFmTvgyBFsSrmv/fz iQwkxO9epY76DUPOI0gIlC+8YHDWgg6qhZwNBIrFoY3RT+24NuCC/BpahVqm8vad9Ons h0sg== 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=1plfe2XCtMlfiHHyXb9l2HQ0WtJu18Hjkx8C32uRK2U=; b=BeKHDvcyRYBxSoHcikq+pHS+jzK2AviC8hDphzMonFyqDhWQ6E4U4BhqvO0u8fbQaB NDLaHamHZHq/+toVtIOAjSC+cqlUW0m5bBOLLDfT8oo3Ik9gn8Rt+coaaI4PsjCR8I/J uSwsRX+cekMWsu4eTDkdvxnDRyACFGP+LchGeTIWgl3xT7IyJCn1L7MxFBiK5xZq9Nvs kF6DiuOv3TKnI+qzcLb/ZIkvZghff7RS+1frq5sm8SqfVbyd1rZMif8lHdEFR2/mm38x bAlf6kbd6zEuo00/kq446Aip0ayqwJ7fM0i9cB7iH65EpidjfgUeTs45m8+TeEs5jeo+ XowQ== X-Gm-Message-State: AOAM531IfN9IjsuSExLRSNvMeWkjKKFDjtju9Zrvd/Ss0unZDETOwnDi pjuHbrd4NQEHRGJmA06Zuw9EqmP6sWVKowpGAOPXgJ/aMUY= X-Google-Smtp-Source: ABdhPJxpqGCYS4goPXBBb8biA3GN2DJzdhRG1+CMgMnGID+Uxgm/AL+gtZoTx3Denyodcjb2XLoalQrf/5RHZSWrIX8= X-Received: by 2002:ad4:5de4:0:b0:46b:be32:797e with SMTP id jn4-20020ad45de4000000b0046bbe32797emr23165384qvb.16.1655099400793; Sun, 12 Jun 2022 22:50:00 -0700 (PDT) MIME-Version: 1.0 References: <20220530131936.1137628-1-vfialko@marvell.com> In-Reply-To: <20220530131936.1137628-1-vfialko@marvell.com> From: Jerin Jacob Date: Mon, 13 Jun 2022 11:19:35 +0530 Message-ID: Subject: Re: [PATCH] event/cnxk: add free for Tx adapter To: Volodymyr Fialko Cc: dpdk-dev , Pavan Nikhilesh , Shijith Thotton , Jerin Jacob , Anoob Joseph 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 Mon, May 30, 2022 at 6:49 PM Volodymyr Fialko wrote: > > Tx adapter allocate data during eth_tx_adapter_queue_add() call and > it's only cleaned but not freed during eth_tx_adapter_queue_del(). > Implemented eth_tx_adapter_free() callback to free adapter data. > > Signed-off-by: Volodymyr Fialko Applied to dpdk-next-net-eventdev/for-main. Thanks > --- > drivers/event/cnxk/cn10k_eventdev.c | 3 +++ > drivers/event/cnxk/cn9k_eventdev.c | 3 +++ > drivers/event/cnxk/cnxk_eventdev.h | 4 +++ > drivers/event/cnxk/cnxk_eventdev_adptr.c | 34 ++++++++++++++++++++++++ > 4 files changed, 44 insertions(+) > > diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c > index 214eca4239..110c7af439 100644 > --- a/drivers/event/cnxk/cn10k_eventdev.c > +++ b/drivers/event/cnxk/cn10k_eventdev.c > @@ -878,6 +878,9 @@ static struct eventdev_ops cn10k_sso_dev_ops = { > .eth_tx_adapter_caps_get = cn10k_sso_tx_adapter_caps_get, > .eth_tx_adapter_queue_add = cn10k_sso_tx_adapter_queue_add, > .eth_tx_adapter_queue_del = cn10k_sso_tx_adapter_queue_del, > + .eth_tx_adapter_start = cnxk_sso_tx_adapter_start, > + .eth_tx_adapter_stop = cnxk_sso_tx_adapter_stop, > + .eth_tx_adapter_free = cnxk_sso_tx_adapter_free, > > .timer_adapter_caps_get = cnxk_tim_caps_get, > > diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c > index 076847d9a4..bf7bbc2c43 100644 > --- a/drivers/event/cnxk/cn9k_eventdev.c > +++ b/drivers/event/cnxk/cn9k_eventdev.c > @@ -1110,6 +1110,9 @@ static struct eventdev_ops cn9k_sso_dev_ops = { > .eth_tx_adapter_caps_get = cn9k_sso_tx_adapter_caps_get, > .eth_tx_adapter_queue_add = cn9k_sso_tx_adapter_queue_add, > .eth_tx_adapter_queue_del = cn9k_sso_tx_adapter_queue_del, > + .eth_tx_adapter_start = cnxk_sso_tx_adapter_start, > + .eth_tx_adapter_stop = cnxk_sso_tx_adapter_stop, > + .eth_tx_adapter_free = cnxk_sso_tx_adapter_free, > > .timer_adapter_caps_get = cnxk_tim_caps_get, > > diff --git a/drivers/event/cnxk/cnxk_eventdev.h b/drivers/event/cnxk/cnxk_eventdev.h > index e7cd90095d..baee5d11f0 100644 > --- a/drivers/event/cnxk/cnxk_eventdev.h > +++ b/drivers/event/cnxk/cnxk_eventdev.h > @@ -113,6 +113,7 @@ struct cnxk_sso_evdev { > uint16_t max_port_id; > uint16_t max_queue_id[RTE_MAX_ETHPORTS]; > uint8_t tx_adptr_configured; > + uint32_t tx_adptr_active_mask; > uint16_t tim_adptr_ring_cnt; > uint16_t *timer_adptr_rings; > uint64_t *timer_adptr_sz; > @@ -310,5 +311,8 @@ int cnxk_sso_tx_adapter_queue_add(const struct rte_eventdev *event_dev, > int cnxk_sso_tx_adapter_queue_del(const struct rte_eventdev *event_dev, > const struct rte_eth_dev *eth_dev, > int32_t tx_queue_id); > +int cnxk_sso_tx_adapter_start(uint8_t id, const struct rte_eventdev *event_dev); > +int cnxk_sso_tx_adapter_stop(uint8_t id, const struct rte_eventdev *event_dev); > +int cnxk_sso_tx_adapter_free(uint8_t id, const struct rte_eventdev *event_dev); > > #endif /* __CNXK_EVENTDEV_H__ */ > diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c > index fa96090bfa..586a7751e2 100644 > --- a/drivers/event/cnxk/cnxk_eventdev_adptr.c > +++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c > @@ -589,3 +589,37 @@ cnxk_sso_tx_adapter_queue_del(const struct rte_eventdev *event_dev, > > return 0; > } > + > +int > +cnxk_sso_tx_adapter_start(uint8_t id, const struct rte_eventdev *event_dev) > +{ > + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); > + > + dev->tx_adptr_active_mask |= (1 << id); > + > + return 0; > +} > + > +int > +cnxk_sso_tx_adapter_stop(uint8_t id, const struct rte_eventdev *event_dev) > +{ > + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); > + > + dev->tx_adptr_active_mask &= ~(1 << id); > + > + return 0; > +} > + > +int > +cnxk_sso_tx_adapter_free(uint8_t id __rte_unused, > + const struct rte_eventdev *event_dev) > +{ > + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); > + > + if (dev->tx_adptr_data_sz && dev->tx_adptr_active_mask == 0) { > + dev->tx_adptr_data_sz = 0; > + free(dev->tx_adptr_data); > + } > + > + return 0; > +} > -- > 2.25.1 >