From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 3FC0A1B43D for ; Fri, 2 Nov 2018 12:37:11 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Nov 2018 04:37:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,455,1534834800"; d="scan'208";a="105381784" Received: from silpixa00382658.ir.intel.com ([10.237.223.29]) by orsmga002.jf.intel.com with ESMTP; 02 Nov 2018 04:37:09 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: Jasvinder Singh , Hongjun Ni Date: Fri, 2 Nov 2018 11:36:56 +0000 Message-Id: <1541158623-29742-5-git-send-email-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541158623-29742-1-git-send-email-cristian.dumitrescu@intel.com> References: <1541158623-29742-1-git-send-email-cristian.dumitrescu@intel.com> Subject: [dpdk-dev] [PATCH 05/12] examples/ip_pipeline: track table rules on delete 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: , X-List-Received-Date: Fri, 02 Nov 2018 11:37:11 -0000 Support table rule tracking on table rule delete operation. Signed-off-by: Cristian Dumitrescu Signed-off-by: Jasvinder Singh Signed-off-by: Hongjun Ni --- examples/ip_pipeline/thread.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c index d2daacc..a3cd3c0 100644 --- a/examples/ip_pipeline/thread.c +++ b/examples/ip_pipeline/thread.c @@ -1672,6 +1672,7 @@ pipeline_table_rule_delete(const char *pipeline_name, struct table_rule_match *match) { struct pipeline *p; + struct table *table; struct pipeline_msg_req *req; struct pipeline_msg_rsp *rsp; int status; @@ -1687,6 +1688,8 @@ pipeline_table_rule_delete(const char *pipeline_name, match_check(match, p, table_id)) return -1; + table = &p->table[table_id]; + if (!pipeline_is_running(p)) { union table_rule_match_low_level match_ll; int key_found; @@ -1701,6 +1704,9 @@ pipeline_table_rule_delete(const char *pipeline_name, &key_found, NULL); + if (status == 0) + table_rule_delete(table, match); + return status; } @@ -1721,6 +1727,8 @@ pipeline_table_rule_delete(const char *pipeline_name, /* Read response */ status = rsp->status; + if (status == 0) + table_rule_delete(table, match); /* Free response */ pipeline_msg_free(rsp); -- 2.7.4