1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2016 Cavium, Inc 3 */ 4 5 #ifndef __THUNDERX_NICVF_BSVF_H__ 6 #define __THUNDERX_NICVF_BSVF_H__ 7 8 #include <sys/queue.h> 9 10 struct nicvf; 11 12 /** 13 * The base queue structure to hold secondary qsets. 14 */ 15 struct svf_entry { 16 STAILQ_ENTRY(svf_entry) next; /**< Next element's pointer */ 17 struct nicvf *vf; /**< Holder of a secondary qset */ 18 }; 19 20 /** 21 * Enqueue new entry to secondary qsets. 22 * 23 * @param entry 24 * Entry to be enqueued. 25 */ 26 void 27 nicvf_bsvf_push(struct svf_entry *entry); 28 29 /** 30 * Dequeue an entry from secondary qsets. 31 * 32 * @return 33 * Dequeued entry. 34 */ 35 struct svf_entry * 36 nicvf_bsvf_pop(void); 37 38 /** 39 * Check if the queue of secondary qsets is empty. 40 * 41 * @return 42 * 0 on non-empty 43 * otherwise empty 44 */ 45 int 46 nicvf_bsvf_empty(void); 47 48 #endif /* __THUNDERX_NICVF_BSVF_H__ */ 49