From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id BB478A046B for ; Mon, 24 Jun 2019 04:25:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B460A1BF42; Mon, 24 Jun 2019 04:25:28 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 810911BF6B for ; Mon, 24 Jun 2019 04:25:26 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id ay6so5958034plb.9 for ; Sun, 23 Jun 2019 19:25:26 -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=f1zFhm0li3K3WAXPHGSWgwlsP9sdjVn2AJgFLtNSum8=; b=Z/3fRNBE6HpOg+BcCtdRlTcvga2Rh6EyVg0JKoabEpf+FiGhNPPaf8RF4VA+ThKyns 9CPWn+ise/H0DZMYr3MgInud21z34wuPnrZLPGJqvOGzzeOpW66KNNyP1/ZXu4vjpfI0 m6mSPyAn7y5mJTmwdpw9AFO4LmYRKlrA51STlFKIAC1THGD887luBrPAuHRaTxtkEge0 5cuwUBb4RWvA1KM5W0/RG/iOjegizmvaH+weKcfrgJualVkeAH9fnlTlauy3uWn4M0tC qCS4358mwe5F2QaIIkf3Mjnk0Qs7XXF/vu9uyTU5IeqfnJ8rqZW0oxrObqXEN7zl+kWY 4dXA== 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=f1zFhm0li3K3WAXPHGSWgwlsP9sdjVn2AJgFLtNSum8=; b=iuCQ1QRaf+vH4CLCEpVpogtwsrHApAPuG1EFCYfA9Zm5EaXJq2i0efydMAsuUskJB8 MXiAdWDSSVsE3pQs500M9rOcWTMnFZrtYP57X22swefKixB22frC+GCK0G4kGiRDwCD9 qFfn7vfq3Izsz4wxZgV1RgCypMD9zjq8hFmcnGItenPgERJxSx+NcLySfCw/+e60FWyg e2/Dvp14aro5uo+BUnV3gnH6ZtuttOf/1azUMxb2zBMZEgq+wtOnQcQv7s/ZVzh/jaCd z6BktdSz3klOS87E2jpo1yVLoMNslR9+6bkfr1PvoQf3nW4ADHMBnFKHg1EWLkVeuxK9 Foww== X-Gm-Message-State: APjAAAWLp85Qz+HiE8SkVYDynJhg03Vx/933jOQXKs4C1bAm15bZAPyK /iokwHwEDhk/bPrnWx7WHkHV9W9T X-Google-Smtp-Source: APXvYqzwgF05d5sGtgy9IahsWOgkK26Zn+DV1dhN2EtKpEq7k/125liyH8h20LUW7m4VIzW9rzXGHw== X-Received: by 2002:a17:902:2aab:: with SMTP id j40mr101360989plb.76.1561343125516; Sun, 23 Jun 2019 19:25:25 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id a3sm9927461pje.3.2019.06.23.19.25.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Jun 2019 19:25:25 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Mon, 24 Jun 2019 11:24:57 +0900 Message-Id: <20190624022504.18752-5-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190624022504.18752-1-yasufum.o@gmail.com> References: <20190624022504.18752-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 04/11] shared/sec: rename struct classified_data 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 rename struct `classified_data` to `cls_port_info` because it is a set of attributes of a port and not classified data actually. Signed-off-by: Yasufumi Ogawa --- src/shared/secondary/spp_worker_th/vf_deps.h | 13 +++-- src/vf/classifier_mac.c | 50 ++++++++++---------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/src/shared/secondary/spp_worker_th/vf_deps.h b/src/shared/secondary/spp_worker_th/vf_deps.h index 3e8fc01..8085357 100644 --- a/src/shared/secondary/spp_worker_th/vf_deps.h +++ b/src/shared/secondary/spp_worker_th/vf_deps.h @@ -20,14 +20,13 @@ struct mac_classifier { int default_cls_idx; /* Default index for classification. */ }; -/* classified data (destination port, target packets, etc) */ -/* TODO(yasufum) rename `classified_data`. */ -/* TODO(yasufum) confirm what `iface_no_global` does mean? */ -struct classified_data { +/* Set of attirbutes of port for classification. */ +/* TODO(yasufum) confirm what is `iface_no_global`. */ +struct cls_port_info { enum port_type iface_type; int iface_no; /* Index of ports handled by classifier. */ int iface_no_global; /* ID for interface generated by spp_vf */ - uint16_t port; /* Ethdev port ID. */ + uint16_t ethdev_port_id; /* Ethdev port ID. */ uint16_t nof_pkts; /* Number of packets in pkts[]. */ struct rte_mbuf *pkts[MAX_PKT_BURST]; /* packets to be classified. */ }; @@ -41,9 +40,9 @@ struct component_info { struct mac_classifier *mac_classifications[NOF_VLAN]; int n_classified_data_tx; /* number of transmission ports */ - struct classified_data classified_data_rx; /* RX handled by cls */ + struct cls_port_info classified_data_rx; /* RX handled by cls */ /* transmission ports handled by classifier */ - struct classified_data classified_data_tx[RTE_MAX_ETHPORTS]; + struct cls_port_info classified_data_tx[RTE_MAX_ETHPORTS]; }; /* free mac classification instance. */ diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c index cd0c546..b2388af 100644 --- a/src/vf/classifier_mac.c +++ b/src/vf/classifier_mac.c @@ -183,7 +183,7 @@ log_classification( long clsd_idx, struct rte_mbuf *pkt, struct component_info *cmp_info, - struct classified_data *clsd_data, + struct cls_port_info *clsd_data, const char *func_name, int line_num) { @@ -203,8 +203,7 @@ log_classification( if (clsd_idx < 0) snprintf(iface_str, sizeof(iface_str), "%ld", clsd_idx); else - spp_format_port_string( - iface_str, + spp_format_port_string(iface_str, clsd_data[clsd_idx].iface_type, clsd_data[clsd_idx].iface_no_global); @@ -231,7 +230,7 @@ log_entry( uint16_t vid, const char *mac_addr_str, struct component_info *cmp_info, - struct classified_data *clsd_data, + struct cls_port_info *clsd_data, const char *func_name, int line_num) { @@ -331,8 +330,8 @@ init_component_info(struct component_info *cmp_info, struct mac_classifier *mac_cls; struct ether_addr eth_addr; char mac_addr_str[ETHER_ADDR_STR_BUF_SZ]; - struct classified_data *clsd_data_rx = &cmp_info->classified_data_rx; - struct classified_data *clsd_data_tx = cmp_info->classified_data_tx; + struct cls_port_info *clsd_data_rx = &cmp_info->classified_data_rx; + struct cls_port_info *clsd_data_tx = cmp_info->classified_data_tx; struct sppwk_port_info *tx_port = NULL; uint16_t vid; @@ -341,7 +340,7 @@ init_component_info(struct component_info *cmp_info, clsd_data_rx->iface_type = UNDEF; clsd_data_rx->iface_no = 0; clsd_data_rx->iface_no_global = 0; - clsd_data_rx->port = 0; + clsd_data_rx->ethdev_port_id = 0; clsd_data_rx->nof_pkts = 0; } else { clsd_data_rx->iface_type = @@ -349,7 +348,7 @@ init_component_info(struct component_info *cmp_info, clsd_data_rx->iface_no = 0; clsd_data_rx->iface_no_global = component_info->rx_ports[0]->iface_no; - clsd_data_rx->port = + clsd_data_rx->ethdev_port_id = component_info->rx_ports[0]->ethdev_port_id; clsd_data_rx->nof_pkts = 0; } @@ -362,10 +361,10 @@ init_component_info(struct component_info *cmp_info, vid = tx_port->cls_attrs.vlantag.vid; /* store ports information */ - clsd_data_tx[i].iface_type = tx_port->iface_type; - clsd_data_tx[i].iface_no = i; + clsd_data_tx[i].iface_type = tx_port->iface_type; + clsd_data_tx[i].iface_no = i; clsd_data_tx[i].iface_no_global = tx_port->iface_no; - clsd_data_tx[i].port = tx_port->ethdev_port_id; + clsd_data_tx[i].ethdev_port_id = tx_port->ethdev_port_id; clsd_data_tx[i].nof_pkts = 0; if (tx_port->cls_attrs.mac_addr == 0) @@ -450,13 +449,13 @@ uninit_component_info(struct component_info *cmp_info) /* transmit packet to one destination. */ static inline void -transmit_packet(struct classified_data *clsd_data) +transmit_packet(struct cls_port_info *clsd_data) { int i; uint16_t n_tx; /* transmit packets */ - n_tx = spp_eth_tx_burst(clsd_data->port, 0, + n_tx = spp_eth_tx_burst(clsd_data->ethdev_port_id, 0, clsd_data->pkts, clsd_data->nof_pkts); /* free cannot transmit packets */ @@ -466,7 +465,7 @@ transmit_packet(struct classified_data *clsd_data) RTE_LOG(DEBUG, SPP_CLASSIFIER_MAC, "drop packets(tx). num=%hu, ethdev_port_id=%hu\n", (uint16_t)(clsd_data->nof_pkts - n_tx), - clsd_data->port); + clsd_data->ethdev_port_id); } clsd_data->nof_pkts = 0; @@ -477,7 +476,7 @@ static inline void transmit_all_packet(struct component_info *cmp_info) { int i; - struct classified_data *clsd_data_tx = cmp_info->classified_data_tx; + struct cls_port_info *clsd_data_tx = cmp_info->classified_data_tx; for (i = 0; i < cmp_info->n_classified_data_tx; i++) { if (unlikely(clsd_data_tx[i].nof_pkts != 0)) { @@ -494,7 +493,7 @@ transmit_all_packet(struct component_info *cmp_info) /* set mbuf pointer to tx buffer and transmit packet, if buffer is filled */ static inline void -push_packet(struct rte_mbuf *pkt, struct classified_data *clsd_data) +push_packet(struct rte_mbuf *pkt, struct cls_port_info *clsd_data) { clsd_data->pkts[clsd_data->nof_pkts++] = pkt; @@ -507,7 +506,7 @@ push_packet(struct rte_mbuf *pkt, struct classified_data *clsd_data) clsd_data->iface_type, clsd_data->iface_no_global, clsd_data->iface_no, - clsd_data->port, + clsd_data->ethdev_port_id, clsd_data->nof_pkts); transmit_packet(clsd_data); } @@ -533,7 +532,7 @@ get_general_default_classified_index(struct component_info *cmp_info) static inline void handle_l2multicast_packet(struct rte_mbuf *pkt, struct component_info *cmp_info, - struct classified_data *clsd_data) + struct cls_port_info *clsd_data) { int i; struct mac_classifier *mac_cls; @@ -640,7 +639,7 @@ select_classified_index(const struct rte_mbuf *pkt, static inline void classify_packet(struct rte_mbuf **rx_pkts, uint16_t n_rx, struct component_info *cmp_info, - struct classified_data *clsd_data) + struct cls_port_info *clsd_data) { int i; long clsd_idx; @@ -747,8 +746,8 @@ spp_classifier_mac_do(int id) struct component_info *cmp_info = NULL; struct rte_mbuf *rx_pkts[MAX_PKT_BURST]; - struct classified_data *clsd_data_rx = NULL; - struct classified_data *clsd_data_tx = NULL; + struct cls_port_info *clsd_data_rx = NULL; + struct cls_port_info *clsd_data_tx = NULL; uint64_t cur_tsc, prev_tsc = 0; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / @@ -792,7 +791,8 @@ spp_classifier_mac_do(int id) return SPP_RET_OK; /* retrieve packets */ - n_rx = spp_eth_rx_burst(clsd_data_rx->port, 0, rx_pkts, MAX_PKT_BURST); + n_rx = spp_eth_rx_burst(clsd_data_rx->ethdev_port_id, 0, rx_pkts, + MAX_PKT_BURST); if (unlikely(n_rx == 0)) return SPP_RET_OK; @@ -812,7 +812,7 @@ spp_classifier_get_component_status( int i, nof_tx, nof_rx = 0; /* Num of RX and TX ports. */ struct management_info *mng_info; struct component_info *cmp_info; - struct classified_data *clsd_data; + struct cls_port_info *clsd_data; struct sppwk_port_idx rx_ports[RTE_MAX_ETHPORTS]; struct sppwk_port_idx tx_ports[RTE_MAX_ETHPORTS]; @@ -861,7 +861,7 @@ mac_classification_iterate_table( uint16_t vid, struct mac_classifier *mac_cls, __rte_unused struct component_info *cmp_info, - struct classified_data *clsd_data) + struct cls_port_info *clsd_data) { int ret; const void *key; @@ -918,7 +918,7 @@ spp_classifier_mac_iterate_table( int i, n; struct management_info *mng_info; struct component_info *cmp_info; - struct classified_data *clsd_data; + struct cls_port_info *clsd_data; for (i = 0; i < RTE_MAX_LCORE; i++) { mng_info = g_mng_infos + i; -- 2.17.1