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 7DC2CA00BE; Wed, 8 Jul 2020 00:22:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ECB271DEDD; Wed, 8 Jul 2020 00:22:35 +0200 (CEST) Received: from mail-ej1-f100.google.com (mail-ej1-f100.google.com [209.85.218.100]) by dpdk.org (Postfix) with ESMTP id 9BBE71DED0 for ; Wed, 8 Jul 2020 00:22:33 +0200 (CEST) Received: by mail-ej1-f100.google.com with SMTP id dr13so48385860ejc.3 for ; Tue, 07 Jul 2020 15:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Nt36lCYvgLJhXcC9eFwGJMgKfCATT2JQ/Qcag0Bdg/E=; b=IC1DwGrdpYYWZEKod32oJfo9NuS1a3wHfer6DZtGkzYWse8Wa0XDPUVfU7lIU1ksNv YwDsUoZogboNxk5JJbZsTjiGuO7hOuTPUoI8Gl/vvlZhQlsJ2lKSg+XngYKRyBxurVVf ZM9G4s5fu3bjxiWeY4bjOmWAtPgiQtng2RZ98= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Nt36lCYvgLJhXcC9eFwGJMgKfCATT2JQ/Qcag0Bdg/E=; b=XbWSwqOqt1rHQNvUI0NlMJWGHSkBMhLQaJRYryKr5qNH6Az36vgMcPmMdeB7fI0jt+ Cxk3kh61G27gYaJURc3m49lr69PAWEewg83cnBeakUS7L0EWX7JIlkgIGwb4nkQMh9jF BBF4EjGSx7qUiPe4JnBGrccEAajcdG4VgjI9ltbU79jKDvlqncD052WqmqUVDuLERrSh meXS4+px5tNBf5hKVzWQJNq+KfxC/v3ncY6W4WWn5jUf//5KkznIgZsg2IC62aVkzyGo d31HI1OaFPX1kntZn7m23zhS/OhhmafiQqh5Sxom7x+pQ7XgRlZUvx70NUUPfrC8juV+ feRg== X-Gm-Message-State: AOAM532VOqRK4ZBhJEZXSfHFY2TM85hlL3yOTpF1Fyg45xkQM9ApOuIv f72yipzmQxDQBRnq8QZLkK637jkmVu73hEYq+gs4MkwDrv8DbH5MF4jstDtc/plvngc+oP0kwGl sidiBLA2J2fQcUWkYtXc3ZFe634O6Wj8HNUrlGomAUrfVVReo9YlH8I+gFxicILZE9OoNU33tsH 5qtw== X-Google-Smtp-Source: ABdhPJwnVKfUGbodhVOGGX0bNNvD8zgV7NUD71lEbdmsE6Q+a+X4t/MmTmUYxDu+Pdo7iVlYzcP6N2yGQN1r X-Received: by 2002:a17:906:1386:: with SMTP id f6mr49851564ejc.66.1594160553082; Tue, 07 Jul 2020 15:22:33 -0700 (PDT) Received: from C02VPB22HTD6.wifi.broadcom.net ([192.19.223.252]) by smtp-relay.gmail.com with ESMTPS id gj18sm12603ejb.18.2020.07.07.15.22.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2020 15:22:33 -0700 (PDT) X-Relaying-Domain: broadcom.com From: Ajit Khaparde To: dev@dpdk.org Cc: Lance Richardson , Thomas Monjalon Date: Tue, 7 Jul 2020 15:22:23 -0700 Message-Id: <20200707222225.33446-2-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200707222225.33446-1-ajit.khaparde@broadcom.com> References: <20200707222225.33446-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v5 1/3] net/bnxt: disable vector receive for mark action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Lance Richardson The bnxt vector mode receive handler does not support the rte_flow 'mark' action. Since we cannot know in advance whether this action will be required, add support for dynamically switching from vector to non-vector receive when the first flow create request with a mark action is processed. Fixes: 94eb699bc82e ("net/bnxt: support flow mark action") Suggested-by: Thomas Monjalon Signed-off-by: Lance Richardson Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_flow.c | 20 ++++++++------------ drivers/net/bnxt/bnxt_rxr.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index 84a21dba9..19bc66a5a 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -18,6 +18,7 @@ #include "bnxt_hwrm.h" #include "bnxt_ring.h" #include "bnxt_rxq.h" +#include "bnxt_rxr.h" #include "bnxt_vnic.h" #include "hsi_struct_def_dpdk.h" @@ -1403,18 +1404,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, bnxt_update_filter_flags_en(filter, filter1, use_ntuple); break; case RTE_FLOW_ACTION_TYPE_MARK: - if (bp->flags & BNXT_FLAG_RX_VECTOR_PKT_MODE) { - PMD_DRV_LOG(DEBUG, - "Disable vector processing for mark\n"); - rte_flow_error_set(error, - ENOTSUP, - RTE_FLOW_ERROR_TYPE_ACTION, - act, - "Disable vector processing for mark"); - rc = -rte_errno; - goto ret; - } - if (bp->mark_table == NULL) { rte_flow_error_set(error, ENOMEM, @@ -1425,6 +1414,13 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, goto ret; } + if (bp->flags & BNXT_FLAG_RX_VECTOR_PKT_MODE) { + PMD_DRV_LOG(DEBUG, + "Disabling vector processing for mark\n"); + bp->eth_dev->rx_pkt_burst = bnxt_recv_pkts; + bp->flags &= ~BNXT_FLAG_RX_VECTOR_PKT_MODE; + } + filter->valid_flags |= BNXT_FLOW_MARK_FLAG; filter->mark = ((const struct rte_flow_action_mark *) act->conf)->id; diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 64058879e..eb6f33c7b 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -782,6 +782,24 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, !rte_spinlock_trylock(&rxq->lock))) return 0; +#if defined(RTE_ARCH_X86) + /* + * Replenish buffers if needed when a transition has been made from + * vector- to non-vector- receive processing. + */ + while (unlikely(rxq->rxrearm_nb)) { + if (!bnxt_alloc_rx_data(rxq, rxr, rxq->rxrearm_start)) { + rxr->rx_prod = rxq->rxrearm_start; + bnxt_db_write(&rxr->rx_db, rxr->rx_prod); + rxq->rxrearm_start++; + rxq->rxrearm_nb--; + } else { + /* Retry allocation on next call. */ + break; + } + } +#endif + /* Handle RX burst request */ while (1) { cons = RING_CMP(cpr->cp_ring_struct, raw_cons); -- 2.21.1 (Apple Git-122.3)