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 03D2CA046B for ; Thu, 25 Jul 2019 14:12:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF31F1C33D; Thu, 25 Jul 2019 14:12:40 +0200 (CEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 9BDB51C33D for ; Thu, 25 Jul 2019 14:12:39 +0200 (CEST) Received: by mail-pg1-f193.google.com with SMTP id u17so22951264pgi.6 for ; Thu, 25 Jul 2019 05:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=AD74WK8pLHCGzbM9olI5N2trNHW8pHOUNwPvoNtzVjM=; b=hMMCXp7XwTTq81KvyX1xHfNoWw2NuKnVoMeeeLN14DiTm3a+QRwvo0nfHZhR/+xMlF oc8rkajO0eTutVSP5jaPPCRgxE4cx0CCWCs2eKnSi6zLgHVIOSpaBVcUWGsXJPtLyH8Q mvFy8RWFdldWgaMnCWqYxvA87M8zqKsTzS2lcxqyIBUWmptqXxGUbRkRm2QSNICEy1sE jU12tlW70VExap+1MJ5jn/okixxr6/IysnIyYrzIH4D8ef4OzsPsiGEuVyOcIL8Ts4Hz LKiAF6IHUv6iU0sELoDPb5k6fUxWQunXsTd/uIAv9UK1w9PKl+wHDqnC3nyDCLPo8vJf JThA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=AD74WK8pLHCGzbM9olI5N2trNHW8pHOUNwPvoNtzVjM=; b=efpuxCscMonBsBPFfljm6YJfzEJOILS/oP+yn6OKpGHrZwMsOx4JfZCT6IF0qjmcco NDPKtsW9QDhhH8XucxeZWfLbanCOhBz+3mgwg896MdIkZzhXYzUd9jdSjVFUDTroHlgH 58FeVw6KSXlgOjulAZxRaUpOmpK53sznQTs2yhcrDBu2w5pmXTSEK8p2XwM22xEAxsG7 5baMKLJ0MTLIVssnFORwyeSUNwUeAaX0MwEKmNJgSnT3x1ISOUervnMFJsjPkC+iVjTY ABlNAPOxsgWd9Lk8oZ+YqxuKrvSl2Oy55EhCfFggUYgOBQo2kf36BSVJEoDMb7pYlG1O 7tgg== X-Gm-Message-State: APjAAAXny2LH9YkP+XcHqBGSuKyo+7/ly4tJ57LUajPtvxX03l6BXVQb 2jhXVP2UH/DfFLFpzKrMyQrAIU4a X-Google-Smtp-Source: APXvYqwbhnR2PzH0/SXy9/aOB8TWbEPd6bT7faigmSnZClmcHhXnRqBoxKvbnpQDe9u+dvgIlNWiZw== X-Received: by 2002:a17:90a:b903:: with SMTP id p3mr91061955pjr.79.1564056758711; Thu, 25 Jul 2019 05:12:38 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id 65sm49449055pff.148.2019.07.25.05.12.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jul 2019 05:12:38 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Thu, 25 Jul 2019 21:12:30 +0900 Message-Id: <20190725121230.43621-3-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190725121230.43621-1-yasufum.o@gmail.com> References: <20190725121230.43621-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 2/2] spp_pcap: change to use common port types X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa This update is to change to use port types "phy" and "ring" defined in shared dir. Signed-off-by: Yasufumi Ogawa --- src/pcap/cmd_utils.c | 4 ++-- src/pcap/cmd_utils.h | 10 +--------- src/pcap/spp_pcap.c | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/pcap/cmd_utils.c b/src/pcap/cmd_utils.c index 88514c8..3c71b2e 100644 --- a/src/pcap/cmd_utils.c +++ b/src/pcap/cmd_utils.c @@ -269,10 +269,10 @@ int spp_format_port_string(char *port, enum port_type iface_type, int iface_no) switch (iface_type) { case PHY: - iface_type_str = SPP_IFTYPE_NIC_STR; + iface_type_str = SPPWK_PHY_STR; break; case RING: - iface_type_str = SPP_IFTYPE_RING_STR; + iface_type_str = SPPWK_RING_STR; break; default: return SPPWK_RET_NG; diff --git a/src/pcap/cmd_utils.h b/src/pcap/cmd_utils.h index 1fb8d14..2e78c69 100644 --- a/src/pcap/cmd_utils.h +++ b/src/pcap/cmd_utils.h @@ -22,15 +22,6 @@ #include #include "shared/common.h" -/** Identifier string for each interface */ -#define SPP_IFTYPE_NIC_STR "phy" -#define SPP_IFTYPE_RING_STR "ring" - -#define STR_LEN_SHORT 32 /* Size of short string. */ -#define STR_LEN_NAME 128 /* Size of string for names. */ - -#define PORT_ABL_MAX 4 /* Max num of port abilities. */ - /* Max number of core status check */ #define SPP_CORE_STATUS_CHECK_MAX 5 @@ -59,6 +50,7 @@ enum sppwk_lcore_status sppwk_get_lcore_status(unsigned int lcore_id); * @retval 0 If succeeded. * @retval -1 If failed. */ +/* TODO(yasufum) remove it and use in shared because it is same. */ int check_core_status_wait(enum sppwk_lcore_status status); /** diff --git a/src/pcap/spp_pcap.c b/src/pcap/spp_pcap.c index e6ae01a..58a2c52 100644 --- a/src/pcap/spp_pcap.c +++ b/src/pcap/spp_pcap.c @@ -216,16 +216,16 @@ parse_captured_port(const char *port_str, enum port_type *iface_type, char *endptr = NULL; /* Find out which type of interface from resource UID */ - if (strncmp(port_str, SPP_IFTYPE_NIC_STR ":", - strlen(SPP_IFTYPE_NIC_STR)+1) == 0) { + if (strncmp(port_str, SPPWK_PHY_STR ":", + strlen(SPPWK_PHY_STR)+1) == 0) { /* NIC */ type = PHY; - no_str = &port_str[strlen(SPP_IFTYPE_NIC_STR)+1]; - } else if (strncmp(port_str, SPP_IFTYPE_RING_STR ":", - strlen(SPP_IFTYPE_RING_STR)+1) == 0) { + no_str = &port_str[strlen(SPPWK_PHY_STR)+1]; + } else if (strncmp(port_str, SPPWK_RING_STR ":", + strlen(SPPWK_RING_STR)+1) == 0) { /* RING */ type = RING; - no_str = &port_str[strlen(SPP_IFTYPE_RING_STR)+1]; + no_str = &port_str[strlen(SPPWK_RING_STR)+1]; } else { /* OTHER */ RTE_LOG(ERR, SPP_PCAP, "The interface that does not suppor. " @@ -468,9 +468,9 @@ static int file_compression_operation(struct pcap_mng_info *info, info->file_size = 0; info->file_no = 1; if (g_pcap_option.port_cap.iface_type == PHY) - iface_type_str = SPP_IFTYPE_NIC_STR; + iface_type_str = SPPWK_PHY_STR; else - iface_type_str = SPP_IFTYPE_RING_STR; + iface_type_str = SPPWK_RING_STR; snprintf(info->compress_file_name, PCAP_FNAME_STRLEN - 1, "spp_pcap.%s.%s%d.%u.%u.pcap.lz4", @@ -523,9 +523,9 @@ static int file_compression_operation(struct pcap_mng_info *info, info->file_size = 0; info->file_no++; if (g_pcap_option.port_cap.iface_type == PHY) - iface_type_str = SPP_IFTYPE_NIC_STR; + iface_type_str = SPPWK_PHY_STR; else - iface_type_str = SPP_IFTYPE_RING_STR; + iface_type_str = SPPWK_RING_STR; snprintf(info->compress_file_name, PCAP_FNAME_STRLEN - 1, "spp_pcap.%s.%s%d.%u.%u.pcap.lz4", -- 2.17.1