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 AF619A0577; Mon, 13 Apr 2020 21:47:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7D4FA1C1F7; Mon, 13 Apr 2020 21:43:00 +0200 (CEST) Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by dpdk.org (Postfix) with ESMTP id 763851C1F1 for ; Mon, 13 Apr 2020 21:42:57 +0200 (CEST) Received: by mail-pj1-f65.google.com with SMTP id mn19so4237247pjb.0 for ; Mon, 13 Apr 2020 12:42:57 -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=TGhq5t5XDiksPqbpFPQfw6kR0VqSB+UM57MC/5JUZvYCPeVB76Xy3+aB1GgzdtdwPu ygIbFYc7HYRNuzEObjzeyNb6B75tql28Uj/YvL9ovifofYvckUfgAh1XUK8Vz7b52DOC 6Tfyyw931FXmsHF+GPUP02zjU/6Hn5Uj2yZ2U= 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=d3f8z+8VGKrAVosDlRfODeHDSCR5mtW4ZOrF9YD+2D6dF9mis8Z0KueVYCTNvmwnkW KTPsOR1zEq9Qw84vXXBi0sNzLWo1XPZ3QHgmt2znPHlMpVLgI3NarATn+ppTAJ6FsVHZ 59Iq3YKL1C4GLuCZZcIK8cdMWPgSwVHn6k8np5LtEFm9jzgrUfjZmMNKzNuyL2Fj4qIG 7QxtAmHn5K+TW2uG9Hhc0E/VNg1n528Bw3D8WoTJarG5pTLPdOzsjDHuC6YRBKHPqiF2 HSzvChvJ85JTuXmrMNqS/RtxIrQwNFWFd4d3QxjJDFcrCuUWCuYEOGL/3PMYi0NWgVAr PjiQ== X-Gm-Message-State: AGi0PuYsuotPaYHhfZHV7+h3NhA5U94O8kibCLJcyqxByCB1StMcGJDF QZ5wNdTG39bvly3GHSpngoHUWBFTPupY54ln23Q40cNkaxvh+QUv5+kj8guXdTw0GsXtY2PRt4a Fo+SgNgkcSlKEACmOxmrS3DuCMRka2G1H4TOX1zvICtAbHaoecqknLiO7RlzPmtHG1rpq X-Google-Smtp-Source: APiQypJ9QbT24X2712BhK4kEKL3cXMTWAZQrgSX338FPYuyEkbZbZq38s3yTuJ/hpu8zov9GSjjVKg== X-Received: by 2002:a17:90b:4c8f:: with SMTP id my15mr23642222pjb.63.1586806976226; Mon, 13 Apr 2020 12:42:56 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 9sm1381663pfn.204.2020.04.13.12.42.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2020 12:42:55 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Kishore Padmanabha , Venkat Duvvuru Date: Tue, 14 Apr 2020 01:10:06 +0530 Message-Id: <1586806811-21736-30-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586806811-21736-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1584459511-5353-1-git-send-email-venkatkumar.duvvuru@broadcom.com> <1586806811-21736-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH v2 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