From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 091CC7D52 for ; Tue, 12 Dec 2017 10:40:31 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2017 01:40:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,394,1508828400"; d="scan'208";a="2059785" Received: from silpixa00381635.ir.intel.com (HELO silpixa00381635.ger.corp.intel.com) ([10.237.222.149]) by orsmga007.jf.intel.com with ESMTP; 12 Dec 2017 01:40:30 -0800 From: Jasvinder Singh To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com Date: Tue, 12 Dec 2017 09:53:24 +0000 Message-Id: <20171212095324.35420-5-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171212095324.35420-1-jasvinder.singh@intel.com> References: <1503488186-90047-2-git-send-email-cristian.dumitrescu@intel.com> <20171212095324.35420-1-jasvinder.singh@intel.com> Subject: [dpdk-dev] [PATCH v2 4/4] examples/ip_pipeline: update flow action pipeline 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: Tue, 12 Dec 2017 09:40:32 -0000 Update flow action pipeline to conform the meter api changes. Signed-off-by: Jasvinder Singh --- .../pipeline/pipeline_flow_actions_be.c | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c b/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c index 11fcbb7..8874f04 100644 --- a/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c @@ -140,6 +140,7 @@ static pipeline_msg_req_handler custom_handlers[] = { */ struct meter_policer { struct rte_meter_trtcm meter; + struct rte_meter_trtcm_profile meter_profile; struct pipeline_fa_policer_params policer; struct pipeline_fa_policer_stats stats; }; @@ -156,8 +157,15 @@ flow_table_entry_set_meter(struct flow_table_entry *entry, { struct rte_meter_trtcm *meter = &entry->mp[meter_id].meter; struct rte_meter_trtcm_params *meter_params = ¶ms->m[meter_id]; + struct rte_meter_trtcm_profile *meter_profile = + &entry->mp[meter_id].meter_profile; + int status; - return rte_meter_trtcm_config(meter, meter_params); + status = rte_meter_trtcm_profile_config(meter_profile, meter_params); + if (status) + return status; + + return rte_meter_trtcm_config(meter, meter_profile); } static void @@ -231,11 +239,14 @@ pkt_work( enum rte_meter_color color = p->dscp[dscp].color; struct rte_meter_trtcm *meter = &entry->mp[tc].meter; + struct rte_meter_trtcm_profile *meter_profile = + &entry->mp[tc].meter_profile; struct pipeline_fa_policer_params *policer = &entry->mp[tc].policer; struct pipeline_fa_policer_stats *stats = &entry->mp[tc].stats; /* Read (entry), compute */ enum rte_meter_color color2 = rte_meter_trtcm_color_aware_check(meter, + meter_profile, time, total_length, color); @@ -313,42 +324,54 @@ pkt4_work( enum rte_meter_color color3 = p->dscp[dscp3].color; struct rte_meter_trtcm *meter0 = &entry0->mp[tc0].meter; + struct rte_meter_trtcm_profile *meter0_profile = + &entry0->mp[tc0].meter_profile; struct pipeline_fa_policer_params *policer0 = &entry0->mp[tc0].policer; struct pipeline_fa_policer_stats *stats0 = &entry0->mp[tc0].stats; struct rte_meter_trtcm *meter1 = &entry1->mp[tc1].meter; + struct rte_meter_trtcm_profile *meter1_profile = + &entry1->mp[tc1].meter_profile; struct pipeline_fa_policer_params *policer1 = &entry1->mp[tc1].policer; struct pipeline_fa_policer_stats *stats1 = &entry1->mp[tc1].stats; struct rte_meter_trtcm *meter2 = &entry2->mp[tc2].meter; + struct rte_meter_trtcm_profile *meter2_profile = + &entry2->mp[tc2].meter_profile; struct pipeline_fa_policer_params *policer2 = &entry2->mp[tc2].policer; struct pipeline_fa_policer_stats *stats2 = &entry2->mp[tc2].stats; struct rte_meter_trtcm *meter3 = &entry3->mp[tc3].meter; + struct rte_meter_trtcm_profile *meter3_profile = + &entry3->mp[tc3].meter_profile; struct pipeline_fa_policer_params *policer3 = &entry3->mp[tc3].policer; struct pipeline_fa_policer_stats *stats3 = &entry3->mp[tc3].stats; /* Read (entry), compute, write (entry) */ enum rte_meter_color color2_0 = rte_meter_trtcm_color_aware_check( meter0, + meter0_profile, time, total_length0, color0); enum rte_meter_color color2_1 = rte_meter_trtcm_color_aware_check( meter1, + meter1_profile, time, total_length1, color1); enum rte_meter_color color2_2 = rte_meter_trtcm_color_aware_check( meter2, + meter2_profile, time, total_length2, color2); enum rte_meter_color color2_3 = rte_meter_trtcm_color_aware_check( meter3, + meter3_profile, time, total_length3, color3); -- 2.9.3