Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- support both DPDK 2.0 and 2.1 - use mbuf priv_size for vr_packet - use new packet type flags - use rte_pktmbuf_mtod_offset() - count out HW XEC counter from ierrors - use RTE_PORT_STATS_COLLECT Change-Id: I2015961e95bb02a78b7419f7098a1e48bd622356 Closes-bug: 1430629
- Loading branch information
1 parent
3dcdb0d
commit 72f6ca0
Showing
9 changed files
with
135 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* vr_dpdk_compat.h - DPDK compatibility definitions | ||
* | ||
* Copyright (c) 2015 Semihalf. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation version 2. | ||
* | ||
* This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
* kind, whether express or implied; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
|
||
#include <rte_version.h> | ||
|
||
#ifndef __VRDPDKCOMPAT_H__ | ||
#define __VRDPDKCOMPAT_H__ | ||
|
||
/* | ||
* DPDK 2.1 | ||
*/ | ||
#if (RTE_VERSION >= RTE_VERSION_NUM(2, 1, 0, 0)) | ||
|
||
/* | ||
* DPDK 2.0 | ||
*/ | ||
#elif (RTE_VERSION >= RTE_VERSION_NUM(2, 0, 0, 0)) | ||
|
||
/* Enable port statistics. */ | ||
#define RTE_PORT_STATS_COLLECT | ||
|
||
/** | ||
* A macro that points to an offset into the data in the mbuf. | ||
* | ||
* The returned pointer is cast to type t. Before using this | ||
* function, the user must ensure that the first segment is large | ||
* enough to accommodate its data. | ||
* | ||
* @param m | ||
* The packet mbuf. | ||
* @param o | ||
* The offset into the mbuf data. | ||
* @param t | ||
* The type to cast the result into. | ||
*/ | ||
#define rte_pktmbuf_mtod_offset(m, t, o) \ | ||
((t)((char *)(m)->buf_addr + (m)->data_off + (o))) | ||
|
||
#endif /* RTE_VERSION */ | ||
|
||
#endif /* __VRDPDKCOMPAT_H__ */ |