Imported Upstream version 17.05
[deb_dpdk.git] / examples / server_node_efd / server / init.h
similarity index 57%
rename from examples/dpdk_qat/crypto.h
rename to examples/server_node_efd/server/init.h
index f68b0b6..8dc5885 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef CRYPTO_H_
-#define CRYPTO_H_
+#ifndef _INIT_H_
+#define _INIT_H_
 
-/* Pass Labels/Values to crypto units */
-enum cipher_alg {
-       /* Option to not do any cryptography */
-       NO_CIPHER,
-       CIPHER_DES,
-       CIPHER_DES_CBC,
-       CIPHER_DES3,
-       CIPHER_DES3_CBC,
-       CIPHER_AES,
-       CIPHER_AES_CBC_128,
-       CIPHER_KASUMI_F8,
-       NUM_CRYPTO,
-};
-
-enum hash_alg {
-       /* Option to not do any hash */
-       NO_HASH,
-       HASH_MD5,
-       HASH_SHA1,
-       HASH_SHA1_96,
-       HASH_SHA224,
-       HASH_SHA256,
-       HASH_SHA384,
-       HASH_SHA512,
-       HASH_AES_XCBC,
-       HASH_AES_XCBC_96,
-       HASH_KASUMI_F9,
-       NUM_HMAC,
-};
+/*
+ * #include <rte_ring.h>
+ * #include "args.h"
+ */
 
-/* Return value from crypto_{encrypt/decrypt} */
-enum crypto_result {
-       /* Packet was successfully put into crypto queue */
-       CRYPTO_RESULT_IN_PROGRESS,
-       /* Cryptography has failed in some way */
-       CRYPTO_RESULT_FAIL,
+/*
+ * Define a node structure with all needed info, including
+ * stats from the nodes.
+ */
+struct node {
+       struct rte_ring *rx_q;
+       unsigned int node_id;
+       /* these stats hold how many packets the node will actually receive,
+        * and how many packets were dropped because the node's queue was full.
+        * The port-info stats, in contrast, record how many packets were received
+        * or transmitted on an actual NIC port.
+        */
+       struct {
+               uint64_t rx;
+               uint64_t rx_drop;
+       } stats;
 };
 
-extern enum crypto_result crypto_encrypt(struct rte_mbuf *pkt, enum cipher_alg c,
-               enum hash_alg h);
-extern enum crypto_result crypto_decrypt(struct rte_mbuf *pkt, enum cipher_alg c,
-               enum hash_alg h);
-
-extern int crypto_init(void);
+extern struct rte_efd_table *efd_table;
+extern struct node *nodes;
 
-extern int per_core_crypto_init(uint32_t lcore_id);
-
-extern void crypto_exit(void);
+/*
+ * shared information between server and nodes: number of nodes,
+ * port numbers, rx and tx stats etc.
+ */
+extern struct shared_info *info;
 
-extern void *crypto_get_next_response(void);
+extern struct rte_mempool *pktmbuf_pool;
+extern uint8_t num_nodes;
+extern unsigned int num_sockets;
+extern uint32_t num_flows;
 
-extern void crypto_flush_tx_queue(uint32_t lcore_id);
+int init(int argc, char *argv[]);
 
-#endif /* CRYPTO_H_ */
+#endif /* ifndef _INIT_H_ */