X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmemif%2Frte_eth_memif.h;h=2038bda742b4c051283f4d805ae439f6daa89161;hb=b3880af2ce3183c5cdb55760ef47036dc1585965;hp=24e8a0914184d5caa8bda1e984eaa74770066706;hpb=c41a04958b09535ffc97e993233aec874cc42b1d;p=dpdk.git diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h index 24e8a09141..2038bda742 100644 --- a/drivers/net/memif/rte_eth_memif.h +++ b/drivers/net/memif/rte_eth_memif.h @@ -5,13 +5,9 @@ #ifndef _RTE_ETH_MEMIF_H_ #define _RTE_ETH_MEMIF_H_ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif /* GNU_SOURCE */ - #include -#include +#include #include #include @@ -36,8 +32,8 @@ extern int memif_logtype; "%s(): " fmt "\n", __func__, ##args) enum memif_role_t { - MEMIF_ROLE_MASTER, - MEMIF_ROLE_SLAVE, + MEMIF_ROLE_SERVER, + MEMIF_ROLE_CLIENT, }; struct memif_region { @@ -63,12 +59,14 @@ struct memif_queue { uint16_t last_head; /**< last ring head */ uint16_t last_tail; /**< last ring tail */ + struct rte_mbuf **buffers; + /**< Stored mbufs. Used in zero-copy tx. Client stores transmitted + * mbufs to free them once server has received them. + */ + /* rx/tx info */ uint64_t n_pkts; /**< number of rx/tx packets */ uint64_t n_bytes; /**< number of rx/tx bytes */ - uint64_t n_err; /**< number of tx errors */ - - memif_ring_t *ring; /**< pointer to ring */ struct rte_intr_handle intr_handle; /**< interrupt handle */ @@ -79,19 +77,22 @@ struct pmd_internals { memif_interface_id_t id; /**< unique id */ enum memif_role_t role; /**< device role */ uint32_t flags; /**< device status flags */ -#define ETH_MEMIF_FLAG_CONNECTING (1 << 0) +#define ETH_MEMIF_FLAG_CONNECTING (1 << 0) /**< device is connecting */ -#define ETH_MEMIF_FLAG_CONNECTED (1 << 1) +#define ETH_MEMIF_FLAG_CONNECTED (1 << 1) /**< device is connected */ -#define ETH_MEMIF_FLAG_ZERO_COPY (1 << 2) +#define ETH_MEMIF_FLAG_ZERO_COPY (1 << 2) /**< device is zero-copy enabled */ -#define ETH_MEMIF_FLAG_DISABLED (1 << 3) +#define ETH_MEMIF_FLAG_DISABLED (1 << 3) /**< device has not been configured and can not accept connection requests */ +#define ETH_MEMIF_FLAG_SOCKET_ABSTRACT (1 << 4) +/**< use abstract socket address */ char *socket_filename; /**< pointer to socket filename */ char secret[ETH_MEMIF_SECRET_SIZE]; /**< secret (optional security parameter) */ struct memif_control_channel *cc; /**< control channel */ + rte_spinlock_t cc_lock; /**< control channel lock */ /* remote info */ char remote_name[RTE_DEV_NAME_MAX_LEN]; /**< remote app name */ @@ -99,15 +100,15 @@ struct pmd_internals { struct { memif_log2_ring_size_t log2_ring_size; /**< log2 of ring size */ - uint8_t num_s2m_rings; /**< number of slave to master rings */ - uint8_t num_m2s_rings; /**< number of master to slave rings */ + uint8_t num_c2s_rings; /**< number of client to server rings */ + uint8_t num_s2c_rings; /**< number of server to client rings */ uint16_t pkt_buffer_size; /**< buffer size */ } cfg; /**< Configured parameters (max values) */ struct { memif_log2_ring_size_t log2_ring_size; /**< log2 of ring size */ - uint8_t num_s2m_rings; /**< number of slave to master rings */ - uint8_t num_m2s_rings; /**< number of master to slave rings */ + uint8_t num_c2s_rings; /**< number of client to server rings */ + uint8_t num_s2c_rings; /**< number of server to client rings */ uint16_t pkt_buffer_size; /**< buffer size */ } run; /**< Parameters used in active connection */ @@ -116,8 +117,6 @@ struct pmd_internals { /**< local disconnect reason */ char remote_disc_string[ETH_MEMIF_DISC_STRING_SIZE]; /**< remote disconnect reason */ - - struct rte_vdev_device *vdev; /**< vdev handle */ }; struct pmd_process_private { @@ -132,11 +131,11 @@ struct pmd_process_private { * @param proc_private * device process private data */ -void memif_free_regions(struct pmd_process_private *proc_private); +void memif_free_regions(struct rte_eth_dev *dev); /** * Finalize connection establishment process. Map shared memory file - * (master role), initialize ring queue, set link status up. + * (server role), initialize ring queue, set link status up. * * @param dev * memif device @@ -148,7 +147,7 @@ int memif_connect(struct rte_eth_dev *dev); /** * Create shared memory file and initialize ring queue. - * Only called by slave when establishing connection + * Only called by client when establishing connection * * @param dev * memif device