patches for DPDK stable branches
 help / color / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Pavan Nikhilesh <pbhagavatula@marvell.com>
Cc: Jerin Jacob <jerinj@marvell.com>, dpdk-dev <dev@dpdk.org>,
	dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH 1/3] event/octeontx2: fix device reconfigure
Date: Tue, 30 Jun 2020 11:12:54 +0530
Message-ID: <CALBAE1OszL85=3zXu+d1PZJSt8Ze0aztn3WTztdA7exZq_=MtA@mail.gmail.com> (raw)
In-Reply-To: <20200629013329.5297-1-pbhagavatula@marvell.com>

On Mon, Jun 29, 2020 at 7:03 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> 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 <pbhagavatula@marvell.com>


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
>

      parent reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29  1:33 pbhagavatula
2020-06-29  1:33 ` [dpdk-stable] [dpdk-dev] [PATCH 2/3] event/octeontx2: fix sub event type violation pbhagavatula
2020-06-29  1:33 ` [dpdk-stable] [dpdk-dev] [PATCH 3/3] event/octeontx2: improve datapath memory locality pbhagavatula
2020-06-30  5:42 ` Jerin Jacob [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALBAE1OszL85=3zXu+d1PZJSt8Ze0aztn3WTztdA7exZq_=MtA@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=pbhagavatula@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox