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 8B1F8A0565; Tue, 17 Mar 2020 16:45:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 977DD1C1DF; Tue, 17 Mar 2020 16:40:06 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id ED6681C1D6 for ; Tue, 17 Mar 2020 16:40:02 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id a25so26308995wrd.0 for ; Tue, 17 Mar 2020 08:40:02 -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; bh=mwstgJ5xSRhrXVWeRnlWoKaychSCPMPnAd3UX/Mwy0Q=; b=PVvlDWIUJK28qk2IVN9g+J0KBjYz9DnKfBlPOssJgTHxy4h+MHUK4+r/KpoeThe5Il AAJsnKEi9K5ANNu1ruWoJfKFYLNV9J8MmXg7dvFYGGpuWt91bIX8/HXa38NX3rnZj7kj teTM2hE2LuUyEMagEODs1zaPB8QwcCItIMORk= 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=mwstgJ5xSRhrXVWeRnlWoKaychSCPMPnAd3UX/Mwy0Q=; b=hpwLrp/dcPniBi0aWL2wToG3QjyuTRC/zUj17qK75iS2LI6gzgNGA/Bip0LocvqXUs VW/7KYRBmr25IuidP5BglvEA2GNs8Y/fgophMCIUoLS61XmbF7FYYsJS/Aoi+NP06BKt mYOvmILekaCebaqQIdm0OfdytQhATAE86DaeWk+2TDv7UThQGgACOwlS9Dpe2EgqVmJ9 4jXZxDjvfhJ/TB3OA79biFSJO666+zSWxNodo+uqX88Fk3HXiJnLSgJQj7g13xadf8sc lhoItH9/3k96JBgh7CNmFmmL6dzYjO4dikjIh8cNXeDXH8VzpdFI91CZ8VzNZ/DOiPYH lJuw== X-Gm-Message-State: ANhLgQ2CSaIhAw7ICh6IiH0BmQzHskb8lQI3NqVv5qIM2WAQ5WPjyOyC JdJUjrWqR1Wvr3hx1xilhakc1WTrJojw0c1mnwsuqgIx+xJIguxXzH4pWbgvPPF1ZKIMzGXlk+q I8z5R45G2rcnrMyoxWJe4i4f2jRcYDfZnLERoQ/1JdyAwLiKqiqc/CbqZZp42GGO/qeP6 X-Google-Smtp-Source: ADFU+vs/kM5VPm9CTYeN1/z6gyT8OWNXqhkY3qb0xukBBtOdhenfp5yI/NGjyXnJ2KJkdfSP0Lg5Ww== X-Received: by 2002:a5d:69c1:: with SMTP id s1mr7036473wrw.351.1584459602368; Tue, 17 Mar 2020 08:40:02 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id q4sm5052142wro.56.2020.03.17.08.40.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Mar 2020 08:40:01 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Kishore Padmanabha , Venkat Duvvuru Date: Tue, 17 Mar 2020 21:08:26 +0530 Message-Id: <1584459511-5353-29-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584459511-5353-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1584459511-5353-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH 28/33] net/bnxt: add support for rte flow destroy driver hook 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: Kishore Padmanabha This patch does the following 1. Gets the ulp session information from eth_dev 2. Fetches the flow associated with the flow id from the flow table 3. Calls ulp_mapper_resources_free which releases the key & action tables associated with that flow Signed-off-by: Kishore Padmanabha Signed-off-by: Venkat Duvvuru Reviewed-by: Lance Richardson Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c index 490b2ba..35099a3 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c @@ -232,10 +232,40 @@ bnxt_ulp_flow_validate(struct rte_eth_dev *dev __rte_unused, return -EINVAL; } +/* Function to destroy the rte flow. */ +static int +bnxt_ulp_flow_destroy(struct rte_eth_dev *dev, + struct rte_flow *flow, + struct rte_flow_error *error) +{ + int ret = 0; + struct bnxt_ulp_context *ulp_ctx; + uint32_t fid; + + ulp_ctx = bnxt_ulp_eth_dev_ptr2_cntxt_get(dev); + if (!ulp_ctx) { + BNXT_TF_DBG(ERR, "ULP context is not initialized\n"); + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_HANDLE, NULL, + "Failed to destroy flow."); + return -EINVAL; + } + + fid = (uint32_t)(uintptr_t)flow; + + ret = ulp_mapper_flow_destroy(ulp_ctx, fid); + if (ret) + rte_flow_error_set(error, -ret, + RTE_FLOW_ERROR_TYPE_HANDLE, NULL, + "Failed to destroy flow."); + + return ret; +} + const struct rte_flow_ops bnxt_ulp_rte_flow_ops = { .validate = bnxt_ulp_flow_validate, .create = bnxt_ulp_flow_create, - .destroy = NULL, + .destroy = bnxt_ulp_flow_destroy, .flush = NULL, .query = NULL, .isolate = NULL -- 2.7.4