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 88C05A0350 for ; Tue, 30 Jun 2020 07:43:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0FF7E1B9BF; Tue, 30 Jun 2020 07:43:14 +0200 (CEST) Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) by dpdk.org (Postfix) with ESMTP id D7CF21023; Tue, 30 Jun 2020 07:43:10 +0200 (CEST) Received: by mail-il1-f194.google.com with SMTP id s21so1473153ilk.5; Mon, 29 Jun 2020 22:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6Cavw7PWnVzL5euHsPQ42n5M6PL3eI8nFqcPkzxnLJs=; b=lN14b6cRp3fy8UFXeja1wMyDr9bUI51RXWZDjqVDPW7QuuFWsVNMLaIMxj1un8TVfa sTzIjiD2mcB3zE9ZqzTn1KkwohoAQA/FciRhO2N2ZdEBNcY0A60aPVhCuqfDpiM5JYlL DbjzwysYH5twTwh4yW9ZsoQcESw9aEMStMg5ogMgfM0uRh+jyUBUoOde8RTNshiB4fuF ZUp1Qxtxr9nxcbsGFNiqQ8Sqr5ozK6Cbk9o7eYqfSsXZ2goxFkZ/aQRpLqBt/YTvv6gi 7V3IwNFO5IwjuKRWYRAFbl8/ozsxr+mKF2NOUrPWuC2xDRREJcF//CTBXdK1qlYaF5S8 WP8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6Cavw7PWnVzL5euHsPQ42n5M6PL3eI8nFqcPkzxnLJs=; b=mHF40p/1OLV/iuIo8Mgpx/N7gjMghxhZZIDgLGck/hshB9QjyEGr+o47p4tntiK5ia +QceqXea1FsjzWtcJflIcTWtxWv6OFd18c6jLtyDT6yGzx7qIj1kumL+Kho7wGRvrQwG RGq5nXhrHZ6r6J8AXSsqDYD4/8IBg5rHMwuFRkicSGnaiBF3dgLwRcyxIaZi2dbFkZw3 38iA4PplH7hM+W/r1YadcsUWh2wUw7fVKhusc7KmlILIdsAY9tFHbHtpUutvZyaQi9BT eLZECaPoCZQTCwDwLROGq1oWbdFcQZv2xeLN7a5btojIZ86jwt3q3XjzWm6dnPoe9QWk I3Jg== X-Gm-Message-State: AOAM530+7EHDLZXUl57RoBt5ATNs+/R+zLbkll2RZMOugeeC3FO6s9LR yAioiNzgrwh8NAWzjN7ZQMyLJGvAp43nJoYJicZXrC9CHOM= X-Google-Smtp-Source: ABdhPJy7NUHuIDFlAIpoeROU+HRBgzbutmoY3Pu2bd95s0J5K8y7Oy6ThBpM4CHqCQtldD5tRRqmpIQHeG3/gI9rGAw= X-Received: by 2002:a92:9804:: with SMTP id l4mr1022941ili.271.1593495790035; Mon, 29 Jun 2020 22:43:10 -0700 (PDT) MIME-Version: 1.0 References: <20200629013329.5297-1-pbhagavatula@marvell.com> In-Reply-To: <20200629013329.5297-1-pbhagavatula@marvell.com> From: Jerin Jacob Date: Tue, 30 Jun 2020 11:12:54 +0530 Message-ID: To: Pavan Nikhilesh Cc: Jerin Jacob , dpdk-dev , dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH 1/3] event/octeontx2: fix device reconfigure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Mon, Jun 29, 2020 at 7:03 AM wrote: > > From: Pavan Nikhilesh > > When event device is re-configured maintain the event queue to event port > links and event port status instead of resetting them. > > Fixes: cd24e70258bd ("event/octeontx2: add device configure function") > Cc: stable@dpdk.org > > Signed-off-by: Pavan Nikhilesh Series applied to dpdk-next-eventdev/master. Thanks. > --- > drivers/event/octeontx2/otx2_evdev.c | 60 +++++++++++++++++++++++----- > 1 file changed, 50 insertions(+), 10 deletions(-) > > diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c > index 630073de5..b8b57c388 100644 > --- a/drivers/event/octeontx2/otx2_evdev.c > +++ b/drivers/event/octeontx2/otx2_evdev.c > @@ -725,6 +725,46 @@ sso_clr_links(const struct rte_eventdev *event_dev) > } > } > > +static void > +sso_restore_links(const struct rte_eventdev *event_dev) > +{ > + struct otx2_sso_evdev *dev = sso_pmd_priv(event_dev); > + uint16_t *links_map; > + int i, j; > + > + for (i = 0; i < dev->nb_event_ports; i++) { > + links_map = event_dev->data->links_map; > + /* Point links_map to this port specific area */ > + links_map += (i * RTE_EVENT_MAX_QUEUES_PER_DEV); > + if (dev->dual_ws) { > + struct otx2_ssogws_dual *ws; > + > + ws = event_dev->data->ports[i]; > + for (j = 0; j < dev->nb_event_queues; j++) { > + if (links_map[j] == 0xdead) > + continue; > + sso_port_link_modify((struct otx2_ssogws *) > + &ws->ws_state[0], j, true); > + sso_port_link_modify((struct otx2_ssogws *) > + &ws->ws_state[1], j, true); > + sso_func_trace("Restoring port %d queue %d " > + "link", i, j); > + } > + } else { > + struct otx2_ssogws *ws; > + > + ws = event_dev->data->ports[i]; > + for (j = 0; j < dev->nb_event_queues; j++) { > + if (links_map[j] == 0xdead) > + continue; > + sso_port_link_modify(ws, j, true); > + sso_func_trace("Restoring port %d queue %d " > + "link", i, j); > + } > + } > + } > +} > + > static void > sso_set_port_ops(struct otx2_ssogws *ws, uintptr_t base) > { > @@ -765,18 +805,15 @@ sso_configure_dual_ports(const struct rte_eventdev *event_dev) > struct otx2_ssogws_dual *ws; > uintptr_t base; > > - /* Free memory prior to re-allocation if needed */ > if (event_dev->data->ports[i] != NULL) { > ws = event_dev->data->ports[i]; > - rte_free(ws); > - ws = NULL; > - } > - > - /* Allocate event port memory */ > - ws = rte_zmalloc_socket("otx2_sso_ws", > + } else { > + /* Allocate event port memory */ > + ws = rte_zmalloc_socket("otx2_sso_ws", > sizeof(struct otx2_ssogws_dual), > RTE_CACHE_LINE_SIZE, > event_dev->data->socket_id); > + } > if (ws == NULL) { > otx2_err("Failed to alloc memory for port=%d", i); > rc = -ENOMEM; > @@ -1061,8 +1098,11 @@ otx2_sso_configure(const struct rte_eventdev *event_dev) > return -EINVAL; > } > > - if (dev->configured) > + if (dev->configured) { > sso_unregister_irqs(event_dev); > + /* Clear any prior port-queue mapping. */ > + sso_clr_links(event_dev); > + } > > if (dev->nb_event_queues) { > /* Finit any previous queues. */ > @@ -1097,8 +1137,8 @@ otx2_sso_configure(const struct rte_eventdev *event_dev) > goto teardown_hwggrp; > } > > - /* Clear any prior port-queue mapping. */ > - sso_clr_links(event_dev); > + /* Restore any prior port-queue mapping. */ > + sso_restore_links(event_dev); > rc = sso_ggrp_alloc_xaq(dev); > if (rc < 0) { > otx2_err("Failed to alloc xaq to ggrp %d", rc); > -- > 2.17.1 >