1809f0800SChristian Ehrhardt/*-
2809f0800SChristian Ehrhardt *   BSD LICENSE
3809f0800SChristian Ehrhardt *
4809f0800SChristian Ehrhardt *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
5809f0800SChristian Ehrhardt *   All rights reserved.
6809f0800SChristian Ehrhardt *
7809f0800SChristian Ehrhardt *   Redistribution and use in source and binary forms, with or without
8809f0800SChristian Ehrhardt *   modification, are permitted provided that the following conditions
9809f0800SChristian Ehrhardt *   are met:
10809f0800SChristian Ehrhardt *
11809f0800SChristian Ehrhardt *     * Redistributions of source code must retain the above copyright
12809f0800SChristian Ehrhardt *       notice, this list of conditions and the following disclaimer.
13809f0800SChristian Ehrhardt *     * Redistributions in binary form must reproduce the above copyright
14809f0800SChristian Ehrhardt *       notice, this list of conditions and the following disclaimer in
15809f0800SChristian Ehrhardt *       the documentation and/or other materials provided with the
16809f0800SChristian Ehrhardt *       distribution.
17809f0800SChristian Ehrhardt *     * Neither the name of Intel Corporation nor the names of its
18809f0800SChristian Ehrhardt *       contributors may be used to endorse or promote products derived
19809f0800SChristian Ehrhardt *       from this software without specific prior written permission.
20809f0800SChristian Ehrhardt *
21809f0800SChristian Ehrhardt *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22809f0800SChristian Ehrhardt *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23809f0800SChristian Ehrhardt *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24809f0800SChristian Ehrhardt *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25809f0800SChristian Ehrhardt *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26809f0800SChristian Ehrhardt *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27809f0800SChristian Ehrhardt *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28809f0800SChristian Ehrhardt *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29809f0800SChristian Ehrhardt *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30809f0800SChristian Ehrhardt *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31809f0800SChristian Ehrhardt *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32809f0800SChristian Ehrhardt */
33809f0800SChristian Ehrhardt
34809f0800SChristian Ehrhardt#ifndef _IXGBE_RXTX_VEC_COMMON_H_
35809f0800SChristian Ehrhardt#define _IXGBE_RXTX_VEC_COMMON_H_
36809f0800SChristian Ehrhardt#include <stdint.h>
37809f0800SChristian Ehrhardt#include <rte_ethdev.h>
38809f0800SChristian Ehrhardt
39809f0800SChristian Ehrhardt#include "ixgbe_ethdev.h"
40809f0800SChristian Ehrhardt#include "ixgbe_rxtx.h"
41809f0800SChristian Ehrhardt
42809f0800SChristian Ehrhardtstatic inline uint16_t
43809f0800SChristian Ehrhardtreassemble_packets(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_bufs,
44809f0800SChristian Ehrhardt		   uint16_t nb_bufs, uint8_t *split_flags)
45809f0800SChristian Ehrhardt{
46809f0800SChristian Ehrhardt	struct rte_mbuf *pkts[nb_bufs]; /*finished pkts*/
47809f0800SChristian Ehrhardt	struct rte_mbuf *start = rxq->pkt_first_seg;
48809f0800SChristian Ehrhardt	struct rte_mbuf *end =  rxq->pkt_last_seg;
49809f0800SChristian Ehrhardt	unsigned int pkt_idx, buf_idx;
50809f0800SChristian Ehrhardt
51809f0800SChristian Ehrhardt	for (buf_idx = 0, pkt_idx = 0; buf_idx < nb_bufs; buf_idx++) {
52809f0800SChristian Ehrhardt		if (end != NULL) {
53809f0800SChristian Ehrhardt			/* processing a split packet */
54809f0800SChristian Ehrhardt			end->next = rx_bufs[buf_idx];
55809f0800SChristian Ehrhardt			rx_bufs[buf_idx]->data_len += rxq->crc_len;
56809f0800SChristian Ehrhardt
57809f0800SChristian Ehrhardt			start->nb_segs++;
58809f0800SChristian Ehrhardt			start->pkt_len += rx_bufs[buf_idx]->data_len;
59809f0800SChristian Ehrhardt			end = end->next;
60809f0800SChristian Ehrhardt
61809f0800SChristian Ehrhardt			if (!split_flags[buf_idx]) {
62809f0800SChristian Ehrhardt				/* it's the last packet of the set */
63809f0800SChristian Ehrhardt				start->hash = end->hash;
64809f0800SChristian Ehrhardt				start->ol_flags = end->ol_flags;
65809f0800SChristian Ehrhardt				/* we need to strip crc for the whole packet */
66809f0800SChristian Ehrhardt				start->pkt_len -= rxq->crc_len;
67809f0800SChristian Ehrhardt				if (end->data_len > rxq->crc_len)
68809f0800SChristian Ehrhardt					end->data_len -= rxq->crc_len;
69809f0800SChristian Ehrhardt				else {
70809f0800SChristian Ehrhardt					/* free up last mbuf */
71809f0800SChristian Ehrhardt					struct rte_mbuf *secondlast = start;
72809f0800SChristian Ehrhardt
73809f0800SChristian Ehrhardt					start->nb_segs--;
74809f0800SChristian Ehrhardt					while (secondlast->next != end)
75809f0800SChristian Ehrhardt						secondlast = secondlast->next;
76809f0800SChristian Ehrhardt					secondlast->data_len -= (rxq->crc_len -
77809f0800SChristian Ehrhardt							end->data_len);
78809f0800SChristian Ehrhardt					secondlast->next = NULL;
79809f0800SChristian Ehrhardt					rte_pktmbuf_free_seg(end);
80809f0800SChristian Ehrhardt				}
81809f0800SChristian Ehrhardt				pkts[pkt_idx++] = start;
82809f0800SChristian Ehrhardt				start = end = NULL;
83809f0800SChristian Ehrhardt			}
84809f0800SChristian Ehrhardt		} else {
85809f0800SChristian Ehrhardt			/* not processing a split packet */
86809f0800SChristian Ehrhardt			if (!split_flags[buf_idx]) {
87809f0800SChristian Ehrhardt				/* not a split packet, save and skip */
88809f0800SChristian Ehrhardt				pkts[pkt_idx++] = rx_bufs[buf_idx];
89809f0800SChristian Ehrhardt				continue;
90809f0800SChristian Ehrhardt			}
91809f0800SChristian Ehrhardt			end = start = rx_bufs[buf_idx];
92809f0800SChristian Ehrhardt			rx_bufs[buf_idx]->data_len += rxq->crc_len;
93809f0800SChristian Ehrhardt			rx_bufs[buf_idx]->pkt_len += rxq->crc_len;
94809f0800SChristian Ehrhardt		}
95809f0800SChristian Ehrhardt	}
96809f0800SChristian Ehrhardt
97809f0800SChristian Ehrhardt	/* save the partial packet for next time */
98809f0800SChristian Ehrhardt	rxq->pkt_first_seg = start;
99809f0800SChristian Ehrhardt	rxq->pkt_last_seg = end;
100809f0800SChristian Ehrhardt	memcpy(rx_bufs, pkts, pkt_idx * (sizeof(*pkts)));
101809f0800SChristian Ehrhardt	return pkt_idx;
102809f0800SChristian Ehrhardt}
103809f0800SChristian Ehrhardt
104809f0800SChristian Ehrhardtstatic inline int __attribute__((always_inline))
105809f0800SChristian Ehrhardtixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq)
106809f0800SChristian Ehrhardt{
107809f0800SChristian Ehrhardt	struct ixgbe_tx_entry_v *txep;
108809f0800SChristian Ehrhardt	uint32_t status;
109809f0800SChristian Ehrhardt	uint32_t n;
110809f0800SChristian Ehrhardt	uint32_t i;
111809f0800SChristian Ehrhardt	int nb_free = 0;
112809f0800SChristian Ehrhardt	struct rte_mbuf *m, *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ];
113809f0800SChristian Ehrhardt
114809f0800SChristian Ehrhardt	/* check DD bit on threshold descriptor */
115809f0800SChristian Ehrhardt	status = txq->tx_ring[txq->tx_next_dd].wb.status;
116809f0800SChristian Ehrhardt	if (!(status & IXGBE_ADVTXD_STAT_DD))
117809f0800SChristian Ehrhardt		return 0;
118809f0800SChristian Ehrhardt
119809f0800SChristian Ehrhardt	n = txq->tx_rs_thresh;
120809f0800SChristian Ehrhardt
121809f0800SChristian Ehrhardt	/*
122809f0800SChristian Ehrhardt	 * first buffer to free from S/W ring is at index
123809f0800SChristian Ehrhardt	 * tx_next_dd - (tx_rs_thresh-1)
124809f0800SChristian Ehrhardt	 */
125809f0800SChristian Ehrhardt	txep = &txq->sw_ring_v[txq->tx_next_dd - (n - 1)];
126809f0800SChristian Ehrhardt	m = __rte_pktmbuf_prefree_seg(txep[0].mbuf);
127809f0800SChristian Ehrhardt	if (likely(m != NULL)) {
128809f0800SChristian Ehrhardt		free[0] = m;
129809f0800SChristian Ehrhardt		nb_free = 1;
130809f0800SChristian Ehrhardt		for (i = 1; i < n; i++) {
131809f0800SChristian Ehrhardt			m = __rte_pktmbuf_prefree_seg(txep[i].mbuf);
132809f0800SChristian Ehrhardt			if (likely(m != NULL)) {
133809f0800SChristian Ehrhardt				if (likely(m->pool == free[0]->pool))
134809f0800SChristian Ehrhardt					free[nb_free++] = m;
135809f0800SChristian Ehrhardt				else {
136809f0800SChristian Ehrhardt					rte_mempool_put_bulk(free[0]->pool,
137809f0800SChristian Ehrhardt							(void *)free, nb_free);
138809f0800SChristian Ehrhardt					free[0] = m;
139809f0800SChristian Ehrhardt					nb_free = 1;
140809f0800SChristian Ehrhardt				}
141809f0800SChristian Ehrhardt			}
142809f0800SChristian Ehrhardt		}
143809f0800SChristian Ehrhardt		rte_mempool_put_bulk(free[0]->pool, (void **)free, nb_free);
144809f0800SChristian Ehrhardt	} else {
145809f0800SChristian Ehrhardt		for (i = 1; i < n; i++) {
146809f0800SChristian Ehrhardt			m = __rte_pktmbuf_prefree_seg(txep[i].mbuf);
147809f0800SChristian Ehrhardt			if (m != NULL)
148809f0800SChristian Ehrhardt				rte_mempool_put(m->pool, m);
149809f0800SChristian Ehrhardt		}
150809f0800SChristian Ehrhardt	}
151809f0800SChristian Ehrhardt
152809f0800SChristian Ehrhardt	/* buffers were freed, update counters */
153809f0800SChristian Ehrhardt	txq->nb_tx_free = (uint16_t)(txq->nb_tx_free + txq->tx_rs_thresh);
154809f0800SChristian Ehrhardt	txq->tx_next_dd = (uint16_t)(txq->tx_next_dd + txq->tx_rs_thresh);
155809f0800SChristian Ehrhardt	if (txq->tx_next_dd >= txq->nb_tx_desc)
156809f0800SChristian Ehrhardt		txq->tx_next_dd = (uint16_t)(txq->tx_rs_thresh - 1);
157809f0800SChristian Ehrhardt
158809f0800SChristian Ehrhardt	return txq->tx_rs_thresh;
159809f0800SChristian Ehrhardt}
160809f0800SChristian Ehrhardt
161809f0800SChristian Ehrhardtstatic inline void __attribute__((always_inline))
162809f0800SChristian Ehrhardttx_backlog_entry(struct ixgbe_tx_entry_v *txep,
163809f0800SChristian Ehrhardt		 struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
164809f0800SChristian Ehrhardt{
165809f0800SChristian Ehrhardt	int i;
166809f0800SChristian Ehrhardt
167809f0800SChristian Ehrhardt	for (i = 0; i < (int)nb_pkts; ++i)
168809f0800SChristian Ehrhardt		txep[i].mbuf = tx_pkts[i];
169809f0800SChristian Ehrhardt}
170809f0800SChristian Ehrhardt
171809f0800SChristian Ehrhardtstatic inline void
172809f0800SChristian Ehrhardt_ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq)
173809f0800SChristian Ehrhardt{
174809f0800SChristian Ehrhardt	unsigned int i;
175809f0800SChristian Ehrhardt	struct ixgbe_tx_entry_v *txe;
176809f0800SChristian Ehrhardt	const uint16_t max_desc = (uint16_t)(txq->nb_tx_desc - 1);
177809f0800SChristian Ehrhardt
178809f0800SChristian Ehrhardt	if (txq->sw_ring == NULL || txq->nb_tx_free == max_desc)
179809f0800SChristian Ehrhardt		return;
180809f0800SChristian Ehrhardt
181809f0800SChristian Ehrhardt	/* release the used mbufs in sw_ring */
182809f0800SChristian Ehrhardt	for (i = txq->tx_next_dd - (txq->tx_rs_thresh - 1);
183809f0800SChristian Ehrhardt	     i != txq->tx_tail;
184809f0800SChristian Ehrhardt	     i = (i + 1) & max_desc) {
185809f0800SChristian Ehrhardt		txe = &txq->sw_ring_v[i];
186809f0800SChristian Ehrhardt		rte_pktmbuf_free_seg(txe->mbuf);
187809f0800SChristian Ehrhardt	}
188809f0800SChristian Ehrhardt	txq->nb_tx_free = max_desc;
189809f0800SChristian Ehrhardt
190809f0800SChristian Ehrhardt	/* reset tx_entry */
191809f0800SChristian Ehrhardt	for (i = 0; i < txq->nb_tx_desc; i++) {
192809f0800SChristian Ehrhardt		txe = &txq->sw_ring_v[i];
193809f0800SChristian Ehrhardt		txe->mbuf = NULL;
194809f0800SChristian Ehrhardt	}
195809f0800SChristian Ehrhardt}
196809f0800SChristian Ehrhardt
197809f0800SChristian Ehrhardtstatic inline void
198809f0800SChristian Ehrhardt_ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq)
199809f0800SChristian Ehrhardt{
200809f0800SChristian Ehrhardt	const unsigned int mask = rxq->nb_rx_desc - 1;
201809f0800SChristian Ehrhardt	unsigned int i;
202809f0800SChristian Ehrhardt
203809f0800SChristian Ehrhardt	if (rxq->sw_ring == NULL || rxq->rxrearm_nb >= rxq->nb_rx_desc)
204809f0800SChristian Ehrhardt		return;
205809f0800SChristian Ehrhardt
206809f0800SChristian Ehrhardt	/* free all mbufs that are valid in the ring */
207c300e355SChristian Ehrhardt	if (rxq->rxrearm_nb == 0) {
208c300e355SChristian Ehrhardt		for (i = 0; i < rxq->nb_rx_desc; i++) {
209c300e355SChristian Ehrhardt			if (rxq->sw_ring[i].mbuf != NULL)
210c300e355SChristian Ehrhardt				rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
211c300e355SChristian Ehrhardt		}
212c300e355SChristian Ehrhardt	} else {
213c300e355SChristian Ehrhardt		for (i = rxq->rx_tail;
214c300e355SChristian Ehrhardt		     i != rxq->rxrearm_start;
215c300e355SChristian Ehrhardt		     i = (i + 1) & mask) {
216c300e355SChristian Ehrhardt			if (rxq->sw_ring[i].mbuf != NULL)
217c300e355SChristian Ehrhardt				rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
218c300e355SChristian Ehrhardt		}
219c300e355SChristian Ehrhardt	}
220c300e355SChristian Ehrhardt
221809f0800SChristian Ehrhardt	rxq->rxrearm_nb = rxq->nb_rx_desc;
222809f0800SChristian Ehrhardt
223809f0800SChristian Ehrhardt	/* set all entries to NULL */
224809f0800SChristian Ehrhardt	memset(rxq->sw_ring, 0, sizeof(rxq->sw_ring[0]) * rxq->nb_rx_desc);
225809f0800SChristian Ehrhardt}
226809f0800SChristian Ehrhardt
227809f0800SChristian Ehrhardtstatic inline void
228809f0800SChristian Ehrhardt_ixgbe_tx_free_swring_vec(struct ixgbe_tx_queue *txq)
229809f0800SChristian Ehrhardt{
230809f0800SChristian Ehrhardt	if (txq == NULL)
231809f0800SChristian Ehrhardt		return;
232809f0800SChristian Ehrhardt
233809f0800SChristian Ehrhardt	if (txq->sw_ring != NULL) {
234809f0800SChristian Ehrhardt		rte_free(txq->sw_ring_v - 1);
235809f0800SChristian Ehrhardt		txq->sw_ring_v = NULL;
236809f0800SChristian Ehrhardt	}
237809f0800SChristian Ehrhardt}
238809f0800SChristian Ehrhardt
239809f0800SChristian Ehrhardtstatic inline void
240809f0800SChristian Ehrhardt_ixgbe_reset_tx_queue_vec(struct ixgbe_tx_queue *txq)
241809f0800SChristian Ehrhardt{
242809f0800SChristian Ehrhardt	static const union ixgbe_adv_tx_desc zeroed_desc = { { 0 } };
243809f0800SChristian Ehrhardt	struct ixgbe_tx_entry_v *txe = txq->sw_ring_v;
244809f0800SChristian Ehrhardt	uint16_t i;
245809f0800SChristian Ehrhardt
246809f0800SChristian Ehrhardt	/* Zero out HW ring memory */
247809f0800SChristian Ehrhardt	for (i = 0; i < txq->nb_tx_desc; i++)
248809f0800SChristian Ehrhardt		txq->tx_ring[i] = zeroed_desc;
249809f0800SChristian Ehrhardt
250809f0800SChristian Ehrhardt	/* Initialize SW ring entries */
251809f0800SChristian Ehrhardt	for (i = 0; i < txq->nb_tx_desc; i++) {
252809f0800SChristian Ehrhardt		volatile union ixgbe_adv_tx_desc *txd = &txq->tx_ring[i];
253809f0800SChristian Ehrhardt
254809f0800SChristian Ehrhardt		txd->wb.status = IXGBE_TXD_STAT_DD;
255809f0800SChristian Ehrhardt		txe[i].mbuf = NULL;
256809f0800SChristian Ehrhardt	}
257809f0800SChristian Ehrhardt
258809f0800SChristian Ehrhardt	txq->tx_next_dd = (uint16_t)(txq->tx_rs_thresh - 1);
259809f0800SChristian Ehrhardt	txq->tx_next_rs = (uint16_t)(txq->tx_rs_thresh - 1);
260809f0800SChristian Ehrhardt
261809f0800SChristian Ehrhardt	txq->tx_tail = 0;
262809f0800SChristian Ehrhardt	txq->nb_tx_used = 0;
263809f0800SChristian Ehrhardt	/*
264809f0800SChristian Ehrhardt	 * Always allow 1 descriptor to be un-allocated to avoid
265809f0800SChristian Ehrhardt	 * a H/W race condition
266809f0800SChristian Ehrhardt	 */
267809f0800SChristian Ehrhardt	txq->last_desc_cleaned = (uint16_t)(txq->nb_tx_desc - 1);
268809f0800SChristian Ehrhardt	txq->nb_tx_free = (uint16_t)(txq->nb_tx_desc - 1);
269809f0800SChristian Ehrhardt	txq->ctx_curr = 0;
270809f0800SChristian Ehrhardt	memset((void *)&txq->ctx_cache, 0,
271809f0800SChristian Ehrhardt		IXGBE_CTX_NUM * sizeof(struct ixgbe_advctx_info));
272809f0800SChristian Ehrhardt}
273809f0800SChristian Ehrhardt
274809f0800SChristian Ehrhardtstatic inline int
275809f0800SChristian Ehrhardtixgbe_rxq_vec_setup_default(struct ixgbe_rx_queue *rxq)
276809f0800SChristian Ehrhardt{
277809f0800SChristian Ehrhardt	uintptr_t p;
278809f0800SChristian Ehrhardt	struct rte_mbuf mb_def = { .buf_addr = 0 }; /* zeroed mbuf */
279809f0800SChristian Ehrhardt
280809f0800SChristian Ehrhardt	mb_def.nb_segs = 1;
281809f0800SChristian Ehrhardt	mb_def.data_off = RTE_PKTMBUF_HEADROOM;
282809f0800SChristian Ehrhardt	mb_def.port = rxq->port_id;
283809f0800SChristian Ehrhardt	rte_mbuf_refcnt_set(&mb_def, 1);
284809f0800SChristian Ehrhardt
285809f0800SChristian Ehrhardt	/* prevent compiler reordering: rearm_data covers previous fields */
286809f0800SChristian Ehrhardt	rte_compiler_barrier();
287809f0800SChristian Ehrhardt	p = (uintptr_t)&mb_def.rearm_data;
288809f0800SChristian Ehrhardt	rxq->mbuf_initializer = *(uint64_t *)p;
289809f0800SChristian Ehrhardt	return 0;
290809f0800SChristian Ehrhardt}
291809f0800SChristian Ehrhardt
292809f0800SChristian Ehrhardtstatic inline int
293809f0800SChristian Ehrhardtixgbe_txq_vec_setup_default(struct ixgbe_tx_queue *txq,
294809f0800SChristian Ehrhardt			    const struct ixgbe_txq_ops *txq_ops)
295809f0800SChristian Ehrhardt{
296809f0800SChristian Ehrhardt	if (txq->sw_ring_v == NULL)
297809f0800SChristian Ehrhardt		return -1;
298809f0800SChristian Ehrhardt
299809f0800SChristian Ehrhardt	/* leave the first one for overflow */
300809f0800SChristian Ehrhardt	txq->sw_ring_v = txq->sw_ring_v + 1;
301809f0800SChristian Ehrhardt	txq->ops = txq_ops;
302809f0800SChristian Ehrhardt
303809f0800SChristian Ehrhardt	return 0;
304809f0800SChristian Ehrhardt}
305809f0800SChristian Ehrhardt
306809f0800SChristian Ehrhardtstatic inline int
307809f0800SChristian Ehrhardtixgbe_rx_vec_dev_conf_condition_check_default(struct rte_eth_dev *dev)
308809f0800SChristian Ehrhardt{
309809f0800SChristian Ehrhardt#ifndef RTE_LIBRTE_IEEE1588
310809f0800SChristian Ehrhardt	struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
311809f0800SChristian Ehrhardt	struct rte_fdir_conf *fconf = &dev->data->dev_conf.fdir_conf;
312809f0800SChristian Ehrhardt
313809f0800SChristian Ehrhardt#ifndef RTE_IXGBE_RX_OLFLAGS_ENABLE
314809f0800SChristian Ehrhardt	/* whithout rx ol_flags, no VP flag report */
315809f0800SChristian Ehrhardt	if (rxmode->hw_vlan_strip != 0 ||
316809f0800SChristian Ehrhardt	    rxmode->hw_vlan_extend != 0)
317809f0800SChristian Ehrhardt		return -1;
318809f0800SChristian Ehrhardt#endif
319809f0800SChristian Ehrhardt
320809f0800SChristian Ehrhardt	/* no fdir support */
321809f0800SChristian Ehrhardt	if (fconf->mode != RTE_FDIR_MODE_NONE)
322809f0800SChristian Ehrhardt		return -1;
323809f0800SChristian Ehrhardt
3243d9b7210SChristian Ehrhardt	/* no header split support */
3253d9b7210SChristian Ehrhardt	if (rxmode->header_split == 1)
326809f0800SChristian Ehrhardt		return -1;
327809f0800SChristian Ehrhardt
328809f0800SChristian Ehrhardt	return 0;
329809f0800SChristian Ehrhardt#else
330809f0800SChristian Ehrhardt	RTE_SET_USED(dev);
331809f0800SChristian Ehrhardt	return -1;
332809f0800SChristian Ehrhardt#endif
333809f0800SChristian Ehrhardt}
334809f0800SChristian Ehrhardt#endif
335