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 069C7A0A0A for ; Thu, 3 Jun 2021 07:06:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBD3F4067A; Thu, 3 Jun 2021 07:06:37 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 9A0604067A for ; Thu, 3 Jun 2021 07:06:36 +0200 (CEST) Received: from mail-qt1-f197.google.com ([209.85.160.197]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lofYy-0001Ia-DX for stable@dpdk.org; Thu, 03 Jun 2021 05:06:36 +0000 Received: by mail-qt1-f197.google.com with SMTP id z9-20020a05622a0609b02901f30a4fcf9bso2676144qta.4 for ; Wed, 02 Jun 2021 22:06:36 -0700 (PDT) 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=L6fvrdwdZPspLaxrCseGRGi3wcrgomq8O2NORGaiN0E=; b=VmY4vL66CLor0ZeeV+k+I5VAviS9XXPgt5LD9kgCMeDHIsfsphjdnAXW9/OF0UZZGE dnkL+WnLBitv/lLA7CVZPe2v+BmcApphGN7LZ35GoO5+Ie8KJoJj1c+VQrWYAT6SrnCt v/FXY2UN54r4o9OlEVG6+snxVngP22P+dE4CI5ul0D5UT7r9ojEQOecIEFbxgf5GhDDY B8sy5YI2DR0pjdo0eqWaJTWA0rxYzZYcFeeFm81cOIi2r/YiR/5TS8lZ5AetloixQaOp je6DgOSAE6k4j1V21o1f/0NiEs0AtinSXsujX6TmlScGvBX9X7VJ6JkAxK703iE9nEZk 2yeA== X-Gm-Message-State: AOAM532Y0+zfYaA/pKNkqTqPYls8csyaijCDxeB+1R8mTdAEq0GzuouG X1WknknEuEsvjC5aqZeM6R8IXo/CzyXCwc3g5HbzSUJ9GCfuTxdd93UU7Dv9n0JOMszIWokZBIr r0GdfZTidIfIS49A0LR0afg2SwQQ2kXZzIA62ed4/ X-Received: by 2002:ac8:7c4b:: with SMTP id o11mr28049549qtv.336.1622696795481; Wed, 02 Jun 2021 22:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyc5lpUyL7EgvxUuuUiuaRi4H01SfX8deDX2wy4Av6XJIDYpj+1xyOHwnwVq4J/DOa/3S2mQUovN1mRn6TRqJk= X-Received: by 2002:ac8:7c4b:: with SMTP id o11mr28049535qtv.336.1622696795224; Wed, 02 Jun 2021 22:06:35 -0700 (PDT) MIME-Version: 1.0 References: <20210519170811.29769-1-viacheslavo@nvidia.com> In-Reply-To: <20210519170811.29769-1-viacheslavo@nvidia.com> From: Christian Ehrhardt Date: Thu, 3 Jun 2021 07:06:09 +0200 Message-ID: To: Viacheslav Ovsiienko Cc: dpdk stable , Xueming Li Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [PATCH 19.11] net/mlx5: fix drop action for Direct Rules/Verbs X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Wed, May 19, 2021 at 7:08 PM Viacheslav Ovsiienko wrote: > > [ upstream commit da845ae9d7c1499cbf76e766604cc981ddd9eb17 ] > > There are multiple branches in rdma-core library backing > the rte flows: > - Verbs > - Direct Verbs (DV) > - Direct Rules (DR) Thanks for the backport, applied to 19.11.9 now (soon there should be an -rc2 with it) > The Verbs API always requires the specifying the queue even > if there is the drop action in the flow, though the kernel > optimizes out the actual queue usage for the flows containing > the drop action. The PMD handles the dedicated Rx queue to > provide Verbs API compatibility. > > The DV/DR API does not require explicit specifying the queue > at the flow creation, but PMD still specified the dedicated > drop queue as action. It performed the packet forwarding to > the dummy queue (that was not polled at all) causing the > steering pipeline resources usage and degrading the overall > packet processing rate. For example, with inserted flow to > drop all the ingress packets the statistics reported only > 15Mpps of 64B packets were received over 100Gbps line. > > Since the Direct Rule API for E-Switch was introduced the > rdma-core supports the dedicated drop action, that is recognized > both for DV and DR and can be used for the entire device in > unified fashion, regardless of steering domain. The similar drop > action was introduced for E-Switch, the usage of this one can be > extended for other steering domains, not for E-Switch's one only. > > This patch: > - renames esw_drop_action to dr_drop_action to emphasize > the global nature of the variable (not only E-Switch domain) > - specifies this global drop action instead of dedicated > drop queue for the DR/DV flows > > Fixes: 34fa7c0268e7 ("net/mlx5: add drop action to Direct Verbs E-Switch") > Cc: stable@dpdk.org > > Signed-off-by: Viacheslav Ovsiienko > Acked-by: Matan Azrad > --- > drivers/net/mlx5/mlx5.c | 24 +++++++++++++++++------- > drivers/net/mlx5/mlx5.h | 2 +- > drivers/net/mlx5/mlx5_flow_dv.c | 10 +++++++++- > 3 files changed, 27 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c > index 8c5e27042..e0ba60086 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -998,7 +998,17 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) > goto error; > } > sh->fdb_domain = domain; > - sh->esw_drop_action = mlx5_glue->dr_create_flow_action_drop(); > + } > + /* > + * The drop action is just some dummy placeholder in rdma-core. It > + * does not belong to domains and has no any attributes, and, can be > + * shared by the entire device. > + */ > + sh->dr_drop_action = mlx5_glue->dr_create_flow_action_drop(); > + if (!sh->dr_drop_action) { > + DRV_LOG(ERR, "FDB mlx5dv_dr_create_flow_action_drop"); > + err = errno; > + goto error; > } > #endif > sh->pop_vlan_action = mlx5_glue->dr_create_flow_action_pop_vlan(); > @@ -1018,9 +1028,9 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) > mlx5_glue->dr_destroy_domain(sh->fdb_domain); > sh->fdb_domain = NULL; > } > - if (sh->esw_drop_action) { > - mlx5_glue->destroy_flow_action(sh->esw_drop_action); > - sh->esw_drop_action = NULL; > + if (sh->dr_drop_action) { > + mlx5_glue->destroy_flow_action(sh->dr_drop_action); > + sh->dr_drop_action = NULL; > } > if (sh->pop_vlan_action) { > mlx5_glue->destroy_flow_action(sh->pop_vlan_action); > @@ -1063,9 +1073,9 @@ mlx5_free_shared_dr(struct mlx5_priv *priv) > mlx5_glue->dr_destroy_domain(sh->fdb_domain); > sh->fdb_domain = NULL; > } > - if (sh->esw_drop_action) { > - mlx5_glue->destroy_flow_action(sh->esw_drop_action); > - sh->esw_drop_action = NULL; > + if (sh->dr_drop_action) { > + mlx5_glue->destroy_flow_action(sh->dr_drop_action); > + sh->dr_drop_action = NULL; > } > #endif > if (sh->pop_vlan_action) { > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h > index f3b6ece19..70509959f 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -679,7 +679,7 @@ struct mlx5_ibv_shared { > #endif > struct mlx5_hlist *flow_tbls; > /* Direct Rules tables for FDB, NIC TX+RX */ > - void *esw_drop_action; /* Pointer to DR E-Switch drop action. */ > + void *dr_drop_action; /* Pointer to DR drop action, any domain. */ > void *pop_vlan_action; /* Pointer to DR pop VLAN action. */ > LIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) encaps_decaps; > LIST_HEAD(modify_cmd, mlx5_flow_dv_modify_hdr_resource) modify_cmds; > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c > index 6dc4e680e..cea45a6d9 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -7918,8 +7918,15 @@ __flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, > n = dv->actions_n; > if (dev_flow->actions & MLX5_FLOW_ACTION_DROP) { > if (dev_flow->transfer) { > - dv->actions[n++] = priv->sh->esw_drop_action; > + assert(priv->sh->dr_drop_action); > + dv->actions[n++] = priv->sh->dr_drop_action; > } else { > +#ifdef HAVE_MLX5DV_DR > + /* DR supports drop action placeholder. */ > + assert(priv->sh->dr_drop_action); > + dv->actions[n++] = priv->sh->dr_drop_action; > +#else > + /* For DV we use the explicit drop queue. */ > dv->hrxq = mlx5_hrxq_drop_new(dev); > if (!dv->hrxq) { > rte_flow_error_set > @@ -7930,6 +7937,7 @@ __flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, > goto error; > } > dv->actions[n++] = dv->hrxq->action; > +#endif > } > } else if (dev_flow->actions & > (MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS)) { > -- > 2.18.1 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd