From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id F2ABA9614 for ; Tue, 14 Jun 2016 17:35:48 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 14 Jun 2016 08:35:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,471,1459839600"; d="scan'208";a="718926854" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 14 Jun 2016 08:35:46 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u5EFZkFU012283; Tue, 14 Jun 2016 16:35:46 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u5EFZk3f015565; Tue, 14 Jun 2016 16:35:46 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id u5EFZkOP015561; Tue, 14 Jun 2016 16:35:46 +0100 From: Bernard Iremonger To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, Bernard Iremonger Date: Tue, 14 Jun 2016 16:35:34 +0100 Message-Id: <1465918542-15512-2-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1465918542-15512-1-git-send-email-bernard.iremonger@intel.com> References: <1465907296-27117-1-git-send-email-bernard.iremonger@intel.com> <1465918542-15512-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v5 1/9] app/testpmd: add new function 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: Tue, 14 Jun 2016 15:35:49 -0000 Add function port_is_forwarding to check whether a port is forwarding or not. Signed-off-by: Bernard Iremonger --- app/test-pmd/config.c | 18 +++++++++++++++++- app/test-pmd/testpmd.h | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 1c552e4..f434999 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.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 @@ -1565,6 +1565,22 @@ set_fwd_ports_number(uint16_t nb_pt) (unsigned int) nb_fwd_ports); } +int +port_is_forwarding(portid_t port_id) +{ + unsigned int i; + + if (port_id_is_invalid(port_id, ENABLED_WARN)) + return -1; + + for (i = 0; i < nb_fwd_ports; i++) { + if (fwd_ports_ids[i] == port_id) + return 1; + } + + return 0; +} + void set_nb_pkt_per_burst(uint16_t nb) { diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 0f72ca1..aa4bdac 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.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 @@ -500,6 +500,7 @@ void set_fwd_lcores_number(uint16_t nb_lc); void set_fwd_ports_list(unsigned int *portlist, unsigned int nb_pt); void set_fwd_ports_mask(uint64_t portmask); void set_fwd_ports_number(uint16_t nb_pt); +int port_is_forwarding(portid_t port_id); void rx_vlan_strip_set(portid_t port_id, int on); void rx_vlan_strip_set_on_queue(portid_t port_id, uint16_t queue_id, int on); -- 2.6.3