15129044dSC.J. Collier/*-
25129044dSC.J. Collier *   BSD LICENSE
35129044dSC.J. Collier *
45129044dSC.J. Collier *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
55129044dSC.J. Collier *   All rights reserved.
65129044dSC.J. Collier *
75129044dSC.J. Collier *   Redistribution and use in source and binary forms, with or without
85129044dSC.J. Collier *   modification, are permitted provided that the following conditions
95129044dSC.J. Collier *   are met:
105129044dSC.J. Collier *
115129044dSC.J. Collier *     * Redistributions of source code must retain the above copyright
125129044dSC.J. Collier *       notice, this list of conditions and the following disclaimer.
135129044dSC.J. Collier *     * Redistributions in binary form must reproduce the above copyright
145129044dSC.J. Collier *       notice, this list of conditions and the following disclaimer in
155129044dSC.J. Collier *       the documentation and/or other materials provided with the
165129044dSC.J. Collier *       distribution.
175129044dSC.J. Collier *     * Neither the name of Intel Corporation nor the names of its
185129044dSC.J. Collier *       contributors may be used to endorse or promote products derived
195129044dSC.J. Collier *       from this software without specific prior written permission.
205129044dSC.J. Collier *
215129044dSC.J. Collier *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
225129044dSC.J. Collier *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
235129044dSC.J. Collier *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
245129044dSC.J. Collier *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
255129044dSC.J. Collier *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
265129044dSC.J. Collier *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
275129044dSC.J. Collier *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
285129044dSC.J. Collier *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
295129044dSC.J. Collier *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
305129044dSC.J. Collier *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
315129044dSC.J. Collier *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
325129044dSC.J. Collier */
335129044dSC.J. Collier
345129044dSC.J. Collier#ifndef __VIRTUAL_ETHDEV_H_
355129044dSC.J. Collier#define __VIRTUAL_ETHDEV_H_
365129044dSC.J. Collier
375129044dSC.J. Collier#ifdef __cplusplus
385129044dSC.J. Collierextern "C" {
395129044dSC.J. Collier#endif
405129044dSC.J. Collier
415129044dSC.J. Collier#include <rte_ether.h>
425129044dSC.J. Collier
435129044dSC.J. Collierint
445129044dSC.J. Colliervirtual_ethdev_init(void);
455129044dSC.J. Collier
465129044dSC.J. Collierint
475129044dSC.J. Colliervirtual_ethdev_create(const char *name, struct ether_addr *mac_addr,
485129044dSC.J. Collier		uint8_t socket_id, uint8_t isr_support);
495129044dSC.J. Collier
505129044dSC.J. Colliervoid
515129044dSC.J. Colliervirtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status);
525129044dSC.J. Collier
535129044dSC.J. Colliervoid
545129044dSC.J. Colliervirtual_ethdev_simulate_link_status_interrupt(uint8_t port_id,
555129044dSC.J. Collier		uint8_t link_status);
565129044dSC.J. Collier
575129044dSC.J. Collierint
585129044dSC.J. Colliervirtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id,
595129044dSC.J. Collier		struct rte_mbuf **pkts_burst, int burst_length);
605129044dSC.J. Collier
615129044dSC.J. Collierint
625129044dSC.J. Colliervirtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id,
635129044dSC.J. Collier		struct rte_mbuf **pkt_burst, int burst_length);
645129044dSC.J. Collier
655129044dSC.J. Collier/** Control methods for the dev_ops functions pointer to control the behavior
665129044dSC.J. Collier *  of the Virtual PMD */
675129044dSC.J. Collier
685129044dSC.J. Colliervoid
695129044dSC.J. Colliervirtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success);
705129044dSC.J. Collier
715129044dSC.J. Colliervoid
725129044dSC.J. Colliervirtual_ethdev_stop_fn_set_success(uint8_t port_id, uint8_t success);
735129044dSC.J. Collier
745129044dSC.J. Colliervoid
755129044dSC.J. Colliervirtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success);
765129044dSC.J. Collier
775129044dSC.J. Colliervoid
785129044dSC.J. Colliervirtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success);
795129044dSC.J. Collier
805129044dSC.J. Colliervoid
815129044dSC.J. Colliervirtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success);
825129044dSC.J. Collier
835129044dSC.J. Colliervoid
845129044dSC.J. Colliervirtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success);
855129044dSC.J. Collier
865129044dSC.J. Colliervoid
875129044dSC.J. Colliervirtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success);
885129044dSC.J. Collier
895129044dSC.J. Colliervoid
905129044dSC.J. Colliervirtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success);
915129044dSC.J. Collier
925129044dSC.J. Collier/* if a value greater than zero is set for packet_fail_count then virtual
935129044dSC.J. Collier * device tx burst function will fail that many packet from burst or all
945129044dSC.J. Collier * packets if packet_fail_count is greater than the number of packets in the
955129044dSC.J. Collier * burst */
965129044dSC.J. Colliervoid
975129044dSC.J. Colliervirtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id,
985129044dSC.J. Collier		uint8_t packet_fail_count);
995129044dSC.J. Collier
1005129044dSC.J. Collier#ifdef __cplusplus
1015129044dSC.J. Collier}
1025129044dSC.J. Collier#endif
1035129044dSC.J. Collier
1045129044dSC.J. Collier#endif /* __VIRTUAL_ETHDEV_H_ */
105