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 C74BD11C5 for ; Mon, 25 Jan 2016 15:05:14 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 25 Jan 2016 06:05:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,344,1449561600"; d="scan'208";a="641083793" Received: from sie-lab-212-251.ir.intel.com (HELO silpixa00381635.ir.intel.com) ([10.237.212.251]) by FMSMGA003.fm.intel.com with ESMTP; 25 Jan 2016 06:05:12 -0800 From: Jasvinder Singh To: dev@dpdk.org Date: Mon, 25 Jan 2016 14:11:05 +0000 Message-Id: <1453731065-121625-2-git-send-email-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453731065-121625-1-git-send-email-jasvinder.singh@intel.com> References: <1453731065-121625-1-git-send-email-jasvinder.singh@intel.com> Subject: [dpdk-dev] [PATCH 2/2] modify action handlers in test_pipeline and ip_pipeline X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 14:05:15 -0000 Changes are made to the ports and table action handlers defined in app/test_pipeline and ip_pipeline sample application. Signed-off-by: Jasvinder Singh Acked-by: Cristian Dumitrescu --- app/test-pipeline/pipeline_acl.c | 3 +- app/test-pipeline/pipeline_hash.c | 3 +- app/test-pipeline/pipeline_lpm.c | 3 +- app/test-pipeline/pipeline_lpm_ipv6.c | 3 +- app/test-pipeline/pipeline_stub.c | 3 +- .../ip_pipeline/pipeline/pipeline_actions_common.h | 47 +++++++++++++--------- .../ip_pipeline/pipeline/pipeline_firewall_be.c | 3 +- .../pipeline/pipeline_flow_actions_be.c | 3 +- .../pipeline/pipeline_flow_classification_be.c | 3 +- .../ip_pipeline/pipeline/pipeline_passthrough_be.c | 3 +- .../ip_pipeline/pipeline/pipeline_routing_be.c | 3 +- 11 files changed, 37 insertions(+), 40 deletions(-) diff --git a/app/test-pipeline/pipeline_acl.c b/app/test-pipeline/pipeline_acl.c index f163e55..22d5f36 100644 --- a/app/test-pipeline/pipeline_acl.c +++ b/app/test-pipeline/pipeline_acl.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -159,7 +159,6 @@ app_main_loop_worker_pipeline_acl(void) { .ops = &rte_port_ring_writer_ops, .arg_create = (void *) &port_ring_params, .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; diff --git a/app/test-pipeline/pipeline_hash.c b/app/test-pipeline/pipeline_hash.c index 8b888d7..f8aac0d 100644 --- a/app/test-pipeline/pipeline_hash.c +++ b/app/test-pipeline/pipeline_hash.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -140,7 +140,6 @@ app_main_loop_worker_pipeline_hash(void) { .ops = &rte_port_ring_writer_ops, .arg_create = (void *) &port_ring_params, .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; diff --git a/app/test-pipeline/pipeline_lpm.c b/app/test-pipeline/pipeline_lpm.c index 2d7bc01..916abd4 100644 --- a/app/test-pipeline/pipeline_lpm.c +++ b/app/test-pipeline/pipeline_lpm.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,7 +99,6 @@ app_main_loop_worker_pipeline_lpm(void) { .ops = &rte_port_ring_writer_ops, .arg_create = (void *) &port_ring_params, .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; diff --git a/app/test-pipeline/pipeline_lpm_ipv6.c b/app/test-pipeline/pipeline_lpm_ipv6.c index c895b62..3352e89 100644 --- a/app/test-pipeline/pipeline_lpm_ipv6.c +++ b/app/test-pipeline/pipeline_lpm_ipv6.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -100,7 +100,6 @@ app_main_loop_worker_pipeline_lpm_ipv6(void) { .ops = &rte_port_ring_writer_ops, .arg_create = (void *) &port_ring_params, .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; diff --git a/app/test-pipeline/pipeline_stub.c b/app/test-pipeline/pipeline_stub.c index 0ad6f9b..ba710ca 100644 --- a/app/test-pipeline/pipeline_stub.c +++ b/app/test-pipeline/pipeline_stub.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -94,7 +94,6 @@ app_main_loop_worker_pipeline_stub(void) { .ops = &rte_port_ring_writer_ops, .arg_create = (void *) &port_ring_params, .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; diff --git a/examples/ip_pipeline/pipeline/pipeline_actions_common.h b/examples/ip_pipeline/pipeline/pipeline_actions_common.h index aa1dd59..9958758 100644 --- a/examples/ip_pipeline/pipeline/pipeline_actions_common.h +++ b/examples/ip_pipeline/pipeline/pipeline_actions_common.h @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,12 +33,19 @@ #ifndef __INCLUDE_PIPELINE_ACTIONS_COMMON_H__ #define __INCLUDE_PIPELINE_ACTIONS_COMMON_H__ +#include + +#include +#include +#include +#include + #define PIPELINE_PORT_IN_AH(f_ah, f_pkt_work, f_pkt4_work) \ static int \ f_ah( \ + __rte_unused struct rte_pipeline *p, \ struct rte_mbuf **pkts, \ uint32_t n_pkts, \ - uint64_t *pkts_mask, \ void *arg) \ { \ uint32_t i; \ @@ -49,21 +56,18 @@ f_ah( \ for ( ; i < n_pkts; i++) \ f_pkt_work(pkts[i], arg); \ \ - *pkts_mask = (~0LLU) >> (64 - n_pkts); \ - \ return 0; \ } #define PIPELINE_TABLE_AH_HIT(f_ah, f_pkt_work, f_pkt4_work) \ static int \ f_ah( \ + __rte_unused struct rte_pipeline *p, \ struct rte_mbuf **pkts, \ - uint64_t *pkts_mask, \ + uint64_t pkts_in_mask, \ struct rte_pipeline_table_entry **entries, \ void *arg) \ { \ - uint64_t pkts_in_mask = *pkts_mask; \ - \ if ((pkts_in_mask & (pkts_in_mask + 1)) == 0) { \ uint64_t n_pkts = __builtin_popcountll(pkts_in_mask); \ uint32_t i; \ @@ -88,13 +92,12 @@ f_ah( \ #define PIPELINE_TABLE_AH_MISS(f_ah, f_pkt_work, f_pkt4_work) \ static int \ f_ah( \ + __rte_unused struct rte_pipeline *p, \ struct rte_mbuf **pkts, \ - uint64_t *pkts_mask, \ + uint64_t pkts_in_mask, \ struct rte_pipeline_table_entry *entry, \ void *arg) \ { \ - uint64_t pkts_in_mask = *pkts_mask; \ - \ if ((pkts_in_mask & (pkts_in_mask + 1)) == 0) { \ uint64_t n_pkts = __builtin_popcountll(pkts_in_mask); \ uint32_t i; \ @@ -119,13 +122,14 @@ f_ah( \ #define PIPELINE_TABLE_AH_HIT_DROP_TIME(f_ah, f_pkt_work, f_pkt4_work) \ static int \ f_ah( \ + struct rte_pipeline *p, \ struct rte_mbuf **pkts, \ - uint64_t *pkts_mask, \ + uint64_t pkts_mask, \ struct rte_pipeline_table_entry **entries, \ void *arg) \ { \ - uint64_t pkts_in_mask = *pkts_mask; \ - uint64_t pkts_out_mask = *pkts_mask; \ + uint64_t pkts_in_mask = pkts_mask; \ + uint64_t pkts_out_mask = pkts_mask; \ uint64_t time = rte_rdtsc(); \ \ if ((pkts_in_mask & (pkts_in_mask + 1)) == 0) { \ @@ -134,13 +138,13 @@ f_ah( \ \ for (i = 0; i < (n_pkts & (~0x3LLU)); i += 4) { \ uint64_t mask = f_pkt4_work(&pkts[i], \ - &entries[i], arg, time); \ + &entries[i], arg, time); \ pkts_out_mask ^= mask << i; \ } \ \ for ( ; i < n_pkts; i++) { \ uint64_t mask = f_pkt_work(pkts[i], \ - entries[i], arg, time); \ + entries[i], arg, time); \ pkts_out_mask ^= mask << i; \ } \ } else \ @@ -154,20 +158,22 @@ f_ah( \ pkts_out_mask ^= mask << pos; \ } \ \ - *pkts_mask = pkts_out_mask; \ + rte_pipeline_ah_packet_drop(p, pkts_out_mask ^ pkts_mask); \ + \ return 0; \ } #define PIPELINE_TABLE_AH_MISS_DROP_TIME(f_ah, f_pkt_work, f_pkt4_work) \ static int \ f_ah( \ + struct rte_pipeline *p, \ struct rte_mbuf **pkts, \ - uint64_t *pkts_mask, \ + uint64_t pkts_mask, \ struct rte_pipeline_table_entry *entry, \ void *arg) \ { \ - uint64_t pkts_in_mask = *pkts_mask; \ - uint64_t pkts_out_mask = *pkts_mask; \ + uint64_t pkts_in_mask = pkts_mask; \ + uint64_t pkts_out_mask = pkts_mask; \ uint64_t time = rte_rdtsc(); \ \ if ((pkts_in_mask & (pkts_in_mask + 1)) == 0) { \ @@ -195,7 +201,8 @@ f_ah( \ pkts_out_mask ^= mask << pos; \ } \ \ - *pkts_mask = pkts_out_mask; \ + rte_pipeline_ah_packet_drop(p, pkts_out_mask ^ pkts_mask); \ + \ return 0; \ } diff --git a/examples/ip_pipeline/pipeline/pipeline_firewall_be.c b/examples/ip_pipeline/pipeline/pipeline_firewall_be.c index 1c376f7..0e8da94 100644 --- a/examples/ip_pipeline/pipeline/pipeline_firewall_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_firewall_be.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -439,7 +439,6 @@ pipeline_firewall_init(struct pipeline_params *params, .arg_create = pipeline_port_out_params_convert( ¶ms->port_out[i]), .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c b/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c index 73dbe7a..436c20c 100644 --- a/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_flow_actions_be.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -585,7 +585,6 @@ static void *pipeline_fa_init(struct pipeline_params *params, .arg_create = pipeline_port_out_params_convert( ¶ms->port_out[i]), .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c index e808e79..ab73192 100644 --- a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -416,7 +416,6 @@ static void *pipeline_fc_init(struct pipeline_params *params, .arg_create = pipeline_port_out_params_convert( ¶ms->port_out[i]), .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; diff --git a/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c b/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c index a898f7d..7642462 100644 --- a/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_passthrough_be.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -451,7 +451,6 @@ pipeline_passthrough_init(struct pipeline_params *params, .arg_create = pipeline_port_out_params_convert( ¶ms->port_out[i]), .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; diff --git a/examples/ip_pipeline/pipeline/pipeline_routing_be.c b/examples/ip_pipeline/pipeline/pipeline_routing_be.c index 9baabd0..a207286 100644 --- a/examples/ip_pipeline/pipeline/pipeline_routing_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_routing_be.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1192,7 +1192,6 @@ pipeline_routing_init(struct pipeline_params *params, .arg_create = pipeline_port_out_params_convert( ¶ms->port_out[i]), .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; -- 2.5.0