From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id BC4E71C01 for ; Mon, 30 Apr 2018 16:08:15 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id f6so13404137wmc.4 for ; Mon, 30 Apr 2018 07:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lCmhtamn/IyRCWV28Hs6WS0ycPDnBbT5FGnUS2dbayM=; b=PsXGJ13GDy2Vk0pdc2oXQxwwF7NQwaRV3xnpwqHuKYS7Qsrw2MUbFbjt6as18Tjprq coW8z5F+dQLihG0oQvQsK8d93zFUzQKZxVjZaci4QXDLj46V6uihHPwz+rllPbwIUXUg 3FyJiRQxX55ONpIZN+ooHjyTCcNPBfKefT8Z5Kmaw9AL/YCokq86WS4W5LK+W89VHJW4 oUWfj3NmcFSY8VI9oieQvb/b/uYi72RcSgPmWUOyYiXNm4d4iMIYomBe+BxavIshIglO 72ZXYqiTMFCMoKuukTghg2SFlyLNI4l1hUKu6zwxAIvU1Eby17kEvh3xF1+kbKBdZqZ0 qs2A== 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; bh=lCmhtamn/IyRCWV28Hs6WS0ycPDnBbT5FGnUS2dbayM=; b=MzCcOMgvmjwV6tz8ODyiO16xer9BvEYF51vBvYxvABscDRsySLN9SoHOUxfNooixhN MIKd83zZqNc0pt6ae33/+svTUGuTKw4Fiyk894Tj8XzzPXjX7HH7B4G81145c0UFzQKo OfckWgEOO6+VT/3SkD9kWYYY4IKTrBD+PlV+mquke1DLBnuERQXn/Wu2rZjQ2WkcYcEW MhGySf2jWOTcBjhDpRFO0RYRqt7pd5JoW57tFwlZryayW4dRfSzP1yY8ili/n58hG6st 7q1MRNssdhZm62CJLuAB2zJjZnB33Oqxgimp5XJJlW1bFiXsLuP7BEB+9yA5O20pd9OH gJBQ== X-Gm-Message-State: ALQs6tCe/vrhMAxKyuX+ophm5/Ba0vGiBZle4hFmuOuUzHOPzWl8JWZw YTHMuJcOC8E8FTp6AJEQbkgn7KjVt84= X-Google-Smtp-Source: AB8JxZpktver3SnTy8gZKkY6cwcKAuJvp0VNvjHeaA0PvogK1GcGPfsGdloQH3InYKJVNeZgztCcRg== X-Received: by 10.28.218.19 with SMTP id r19mr8220050wmg.2.1525097295486; Mon, 30 Apr 2018 07:08:15 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id e131sm7759080wmg.1.2018.04.30.07.08.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:08:14 -0700 (PDT) From: luca.boccassi@gmail.com To: Somnath Kotur Cc: dpdk stable Date: Mon, 30 Apr 2018 15:03:48 +0100 Message-Id: <20180430140606.4615-70-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430140606.4615-1-luca.boccassi@gmail.com> References: <20180430140606.4615-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/bnxt: fix flow director with same cmd different queue' has been queued to stable release 18.02.2 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: , X-List-Received-Date: Mon, 30 Apr 2018 14:08:15 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 771acad7dfab34ffe1730d50965c139266f774d6 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Mon, 26 Mar 2018 08:52:06 +0530 Subject: [PATCH] net/bnxt: fix flow director with same cmd different queue [ upstream commit 3f8a7537f05d96970c6e74aa77b3c7f6a634bf51 ] When user reissues same flow director cmd with a different queue update the existing filter to redirect flow to the new desired queue as destination just like the other filters like 5 tuple and generic flow. Fixes: 2d64da097aa0 ("net/bnxt: support FDIR") Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 46 ++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 21c46f833..0b2165326 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -2358,7 +2358,8 @@ bnxt_parse_fdir_filter(struct bnxt *bp, } static struct bnxt_filter_info * -bnxt_match_fdir(struct bnxt *bp, struct bnxt_filter_info *nf) +bnxt_match_fdir(struct bnxt *bp, struct bnxt_filter_info *nf, + struct bnxt_vnic_info **mvnic) { struct bnxt_filter_info *mf = NULL; int i; @@ -2396,8 +2397,11 @@ bnxt_match_fdir(struct bnxt *bp, struct bnxt_filter_info *nf) !memcmp(mf->dst_ipaddr, nf->dst_ipaddr, sizeof(nf->dst_ipaddr)) && !memcmp(mf->dst_ipaddr_mask, nf->dst_ipaddr_mask, - sizeof(nf->dst_ipaddr_mask))) + sizeof(nf->dst_ipaddr_mask))) { + if (mvnic) + *mvnic = vnic; return mf; + } } } return NULL; @@ -2411,7 +2415,7 @@ bnxt_fdir_filter(struct rte_eth_dev *dev, struct bnxt *bp = (struct bnxt *)dev->data->dev_private; struct rte_eth_fdir_filter *fdir = (struct rte_eth_fdir_filter *)arg; struct bnxt_filter_info *filter, *match; - struct bnxt_vnic_info *vnic; + struct bnxt_vnic_info *vnic, *mvnic; int ret = 0, i; if (filter_op == RTE_ETH_FILTER_NOP) @@ -2423,7 +2427,6 @@ bnxt_fdir_filter(struct rte_eth_dev *dev, switch (filter_op) { case RTE_ETH_FILTER_ADD: case RTE_ETH_FILTER_DELETE: - /* FALLTHROUGH */ filter = bnxt_get_unused_filter(bp); if (filter == NULL) { PMD_DRV_LOG(ERR, @@ -2436,11 +2439,31 @@ bnxt_fdir_filter(struct rte_eth_dev *dev, goto free_filter; filter->filter_type = HWRM_CFA_NTUPLE_FILTER; - match = bnxt_match_fdir(bp, filter); + if (fdir->action.behavior == RTE_ETH_FDIR_REJECT) + vnic = STAILQ_FIRST(&bp->ff_pool[0]); + else + vnic = STAILQ_FIRST(&bp->ff_pool[fdir->action.rx_queue]); + + match = bnxt_match_fdir(bp, filter, &mvnic); if (match != NULL && filter_op == RTE_ETH_FILTER_ADD) { - PMD_DRV_LOG(ERR, "Flow already exists.\n"); - ret = -EEXIST; - goto free_filter; + if (match->dst_id == vnic->fw_vnic_id) { + PMD_DRV_LOG(ERR, "Flow already exists.\n"); + ret = -EEXIST; + goto free_filter; + } else { + match->dst_id = vnic->fw_vnic_id; + ret = bnxt_hwrm_set_ntuple_filter(bp, + match->dst_id, + match); + STAILQ_REMOVE(&mvnic->filter, match, + bnxt_filter_info, next); + STAILQ_INSERT_TAIL(&vnic->filter, match, next); + PMD_DRV_LOG(ERR, + "Filter with matching pattern exist\n"); + PMD_DRV_LOG(ERR, + "Updated it to new destination q\n"); + goto free_filter; + } } if (match == NULL && filter_op == RTE_ETH_FILTER_DELETE) { PMD_DRV_LOG(ERR, "Flow does not exist.\n"); @@ -2448,12 +2471,6 @@ bnxt_fdir_filter(struct rte_eth_dev *dev, goto free_filter; } - if (fdir->action.behavior == RTE_ETH_FDIR_REJECT) - vnic = STAILQ_FIRST(&bp->ff_pool[0]); - else - vnic = - STAILQ_FIRST(&bp->ff_pool[fdir->action.rx_queue]); - if (filter_op == RTE_ETH_FILTER_ADD) { ret = bnxt_hwrm_set_ntuple_filter(bp, filter->dst_id, @@ -2489,7 +2506,6 @@ bnxt_fdir_filter(struct rte_eth_dev *dev, case RTE_ETH_FILTER_UPDATE: case RTE_ETH_FILTER_STATS: case RTE_ETH_FILTER_INFO: - /* FALLTHROUGH */ PMD_DRV_LOG(ERR, "operation %u not implemented", filter_op); break; default: -- 2.14.2