metron-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickal...@apache.org
Subject [1/2] incubator-metron git commit: METRON-822 Improve Fastcapa Performance (nickwallen) closes apache/incubator-metron#509
Date Thu, 06 Apr 2017 12:35:18 GMT
Repository: incubator-metron
Updated Branches:
  refs/heads/master 58775bc48 -> 81677fd90


http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/81677fd9/metron-sensors/fastcapa/src/types.h
----------------------------------------------------------------------
diff --git a/metron-sensors/fastcapa/src/types.h b/metron-sensors/fastcapa/src/types.h
new file mode 100644
index 0000000..0210eda
--- /dev/null
+++ b/metron-sensors/fastcapa/src/types.h
@@ -0,0 +1,78 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef METRON_TYPES_H
+#define METRON_TYPES_H
+
+/**
+ * Tracks packet processing stats.
+ */
+struct app_stats {
+    uint64_t in;
+    uint64_t out;
+    uint64_t depth;
+    uint64_t drops;
+} __rte_cache_aligned;
+
+/**
+ * The parameters required by a receive worker.
+ */
+struct rx_worker_params {
+
+    /* worker identifier */
+    uint16_t worker_id;
+
+    /* queue identifier from which packets are fetched */
+    uint16_t queue_id;
+
+    /* how many packets are pulled off the queue at a time */
+    uint16_t burst_size;
+
+    /* the ring onto which the packets are enqueued */
+    struct rte_ring *output_ring;
+
+    /* metrics */
+    struct app_stats stats;
+
+} __rte_cache_aligned;
+
+/**
+ * The parameters required by a transmit worker.
+ */
+struct tx_worker_params {
+
+    /* worker identifier */
+    uint16_t worker_id;
+
+    /* how many packets are pulled off the ring at a time */
+    uint16_t burst_size;
+
+    /* the ring from which packets are dequeued */
+    struct rte_ring *input_ring;
+
+    /* identifies the kafka client connection used by the worker */
+    int kafka_id;
+ 
+    /* worker metrics */
+    struct app_stats stats;
+
+} __rte_cache_aligned;
+
+
+#endif
+


Mime
View raw message