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 4829EA0563; Wed, 15 Apr 2020 10:26:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A8251D610; Wed, 15 Apr 2020 10:20:45 +0200 (CEST) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 508951D5E7 for ; Wed, 15 Apr 2020 10:20:41 +0200 (CEST) Received: by mail-pl1-f194.google.com with SMTP id m16so988091pls.4 for ; Wed, 15 Apr 2020 01:20:41 -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=PSrJyV1u+vfVNvvIWD+uAUF5yjNxikLQTW8vY3aSnvi5hLrVdyjRsC1J3hj+/RyP1S Yo4ToGSY902tPYBC8vWle18s2qL8wXmefxa8bmPv0r48SLPVHcouQ1DzOyKv2Lg1YumS iaURdSX70O+CD2X67UO1cHHlvCEDUVAGZ92J8= 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=GUt56irZrFYURSBBTqKHI6CXw33Sf+KQl8cVfo4mMJO9gg4T+EZ8pEfP8AyClSQl3W BTTAG747yCQUqTDrzbv1Ra7at8gvbcvEwfF1chDkxXL4gXYKfPMNulJSykT7+YAq6TWn m1Dzod7XfV+l6LHap65llbrh+UEE96gagALE8RFQfMHWUVXYoTmpv58eP33N+0h3Veza a13RAVFCLKZwSpL3uW51RGewpk3SNy/lXvLtypSeebU7aydoD36CLadtXlX2e7hcsqsF bzW8Ic8BmxolRDFbEF20Yp0AKQa/KYT7KpswJdk/4gpj+K8muyHUULddTx7AvMmqxtEW qoVw== X-Gm-Message-State: AGi0PuZr6pIhxsDy/lNLXao7dtGqMJV2iweMIKxOlW6qKWqHtE05CCQO juSJLRgSzOZywufDlH9i50oQG6RxmszhUzqiY6Gk/hdCpNoRMFyYgUyBBZ2uQeCYFApjR8ZQuiw gI/iopM+lGBySD1fQPlxgifI2WlwJEjpKNatQnxU/Tp2Z8afAjK2svkpsgAbfDdRh8mSa X-Google-Smtp-Source: APiQypISA/oDUxkwrl6ovpI21q/3AxmPh+7p2DtTyZ2uZpvZSRFIAfu3WiDgqYEJdqMDyTbOek58fw== X-Received: by 2002:a17:902:7689:: with SMTP id m9mr3615626pll.187.1586938840074; Wed, 15 Apr 2020 01:20:40 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id fy21sm3819019pjb.25.2020.04.15.01.20.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2020 01:20:39 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Kishore Padmanabha , Venkat Duvvuru Date: Wed, 15 Apr 2020 13:49:06 +0530 Message-Id: <1586938751-32808-30-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586938751-32808-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1586852011-37536-1-git-send-email-venkatkumar.duvvuru@broadcom.com> <1586938751-32808-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH v4 29/34] 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