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 107B1A0487 for ; Mon, 29 Jul 2019 11:37:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E21CA1BF01; Mon, 29 Jul 2019 11:37:14 +0200 (CEST) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 6E8301BF01 for ; Mon, 29 Jul 2019 11:37:14 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id u14so27752767pfn.2 for ; Mon, 29 Jul 2019 02:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=AD74WK8pLHCGzbM9olI5N2trNHW8pHOUNwPvoNtzVjM=; b=qqpqUbbuw6euyv9ivIW9/FcIVAJX1vh751yieMYr27OCzgenrLzD4CdiUTEF76/+Ci ReAieFlUFK4mO7oYk9qwx1B/tMbNs3iGCGx9iFBL9jeEg/dmFyRZzq4tzz8G+ci+pzzM 31+g5lcq5GKobqSsJ12v7JBbxziVGZgJObbg0KYlf76jPSkXZqM12dwv5DlIA7qk5qlp nNgp3hpOE69zWItZBwnQT9J6qjsJ9YyI4lwx7MBvPxNr5DuMGzC0DQ2OQQzVuF/hirh4 0gALoxq/1YJJR2cHFuG/TPH+6nKrNB6x3E6kcMZbWsMVXZ/6EoyPz0fgRO5YHEYlUxBk R3kQ== 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; bh=AD74WK8pLHCGzbM9olI5N2trNHW8pHOUNwPvoNtzVjM=; b=JFYt2J8jjekb/ejoBxJV/cPoyDNRYzAT21cOk3LrLOEroMkV+hZu5cycemsYh0Yre/ +rVxXaczQ5tIa2eCaNWPzUW6AvA0nyy8Sg3iekPd5bTlHzaho0HYbloWqdfwzbZJXYDv L2Lsx13kfJbAWQ3WJK0gYn0FD0h6QmW8mb3ZDyvcN3TGrJUjaek6aD0FrGSN2G18yNOu fbTnsavNLO2ZJ6B3Yp2Rnxy1KPxbJnU2vK9iK7sUZ/YRJzKNzvrhmWnuniBXulXLHcMQ NYCKmE/s27BWbxygkziGsoUVuo8gOht111eZVd1MXhvNjTu6IarM63FVFiNNmUlndvYw I7mQ== X-Gm-Message-State: APjAAAW+gRsPuiYa/qXA50kaisKchG1wEXldAXhD5OOkyKnOYY9QC4G6 xqZHhiE3r55cPq6jJaUSy3/T7VUU X-Google-Smtp-Source: APXvYqy9IFx9neQbN09nSWQn/5l8EZbONnrll6v5FrItknuYhMgqbQwUR54wr5TYd1DXI910UTRMzw== X-Received: by 2002:a65:4b89:: with SMTP id t9mr33977515pgq.55.1564393033448; Mon, 29 Jul 2019 02:37:13 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id q1sm70634498pfg.84.2019.07.29.02.37.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jul 2019 02:37:13 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Mon, 29 Jul 2019 18:37:09 +0900 Message-Id: <20190729093709.28621-1-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [spp] [PATCH] 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