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 3F51FA0577; Tue, 14 Apr 2020 10:20:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87B4C1D157; Tue, 14 Apr 2020 10:15:04 +0200 (CEST) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 9BA7B1D156 for ; Tue, 14 Apr 2020 10:15:02 +0200 (CEST) Received: by mail-pg1-f194.google.com with SMTP id c23so5684390pgj.3 for ; Tue, 14 Apr 2020 01:15: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=f18qjAVZyUBdtu6X9QfkLHBOVbefBbiti0+hSKfw3oiotKRmNEBD33bhbVIsncORiH udptRQOxlhvxC1nby70Tfgk7pj11NMil1rGbXLXBU19KqZkf3IlgwWAEA26rhiQswua9 b8pJBME4OrzPIuzLV2VSUVLCNKckY1zYhtIy4= 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=MlEpyvQqb+XUnCj9InYzy7ccroxijuaCPMzBheuAMH+omYwtSl1HXumlhidu+03+2z NPrjGkR2pFTJP0ZVRb/GTkO5T7WVxlFWcG2XUTTiSHnv+cErNHSRRiEMVLPeRn6085KT vvCeCTPYAmpeyNReHHnyYJMLisjmRTautm/iZWJztXFI/kxSoEhu8Y13mt+IcpoPi5Pm pEhClQkPkTcJ8x60ljmWmjL2iqIQihNgaG40E710xFd+e5bg5Uxx85vBg5ochMJPmOO9 RC4eO8kQBGaMQi/LsBKfivjgyAezvoS3l4AMkwYyscmnlxmVIVcD+qr5nbvld3kb13Zt UWSA== X-Gm-Message-State: AGi0PuaWD1Pw1nNzJRC/WXHH4PTgCUujkzsEXgi/QjKp0NjwEogiTiOl lz1lVnRw1UnGmZMGET3M9DXLWacgpRaBoliyCdS42wcRuAk1qU31Xq+WYnKS/TKCwz0MMfiJjLS Uvblpm0yX9MS5LV9A2++lirf4Xw4O4Wjcs4ZLQQnbl+K7RsLAhnyU/hXV2OeYljPqVS5P X-Google-Smtp-Source: APiQypIwnUDPx+TsaKgGwIUTww/Lr6h4uf4MlLSxL8iP5cQxPFJkWwqhhFHTwO6barF/Iy7eYtObrA== X-Received: by 2002:aa7:8586:: with SMTP id w6mr20936931pfn.140.1586852101415; Tue, 14 Apr 2020 01:15:01 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id e196sm671176pfh.43.2020.04.14.01.14.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Apr 2020 01:15:00 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Kishore Padmanabha , Venkat Duvvuru Date: Tue, 14 Apr 2020 13:43:26 +0530 Message-Id: <1586852011-37536-30-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586852011-37536-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1586806811-21736-1-git-send-email-venkatkumar.duvvuru@broadcom.com> <1586852011-37536-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH v3 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