Skip to contentSkip to conversation

fm10k: improvement for vPMD compiling

PATCH Applied Chen Jing D(Mark) 2 participants 2 messages Nov 24, 2015 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fm10k: improvement for vPMD compiling

From: "Chen Jing D(Mark)" <[email protected]>

fm10k driver will meet compile error on non-x86 platforms due to SSE instructions. Original implementation didn't have switch to turn off vPMD.
The improvement introduces a macro to turn on/off vPMD functions, it's on by default. On non-x86 platforms, it can simply be turned off to fix compile issue.

---
 config/common_linuxapp             |    1 +
 drivers/net/fm10k/Makefile         |    2 +-
 drivers/net/fm10k/fm10k.h          |    5 +++
 drivers/net/fm10k/fm10k_ethdev.c   |   66 +++++++++++++++++++++++++++++++++---
 drivers/net/fm10k/fm10k_rxtx_vec.c |   10 +++++
 5 files changed, 78 insertions(+), 6 deletions(-)
config/common_linuxapp +1 -0
index f72c46d..a565153 100644
@@ -206,6 +206,7 @@ CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_FM10K_DEBUG_TX_FREE=n
 CONFIG_RTE_LIBRTE_FM10K_DEBUG_DRIVER=n
 CONFIG_RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE=y
+CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR=y
 
 #
 # Compile burst-oriented Mellanox ConnectX-3 (MLX4) PMD
drivers/net/fm10k/Makefile +1 -1
index 06ebf83..602a2d2 100644
@@ -93,7 +93,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_common.c
 SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_mbx.c
 SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_vf.c
 SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_api.c
-SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_rxtx_vec.c
+SRCS-$(CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR) += fm10k_rxtx_vec.c
 
 # this lib depends upon:
 DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_eal lib/librte_ether
drivers/net/fm10k/fm10k.h +5 -0
index 38d5489..cd38af2 100644
@@ -129,6 +129,9 @@
 #define RTE_FM10K_TX_MAX_FREE_BUF_SZ    64
 #define RTE_FM10K_DESCS_PER_LOOP    4
 
+#define FM10K_SIMPLE_TX_FLAG ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \
+				ETH_TXQ_FLAGS_NOOFFLOADS)
+
 struct fm10k_macvlan_filter_info {
 	uint16_t vlan_num;       /* Total VLAN number */
 	uint16_t mac_num;        /* Total mac number */
@@ -354,4 +357,6 @@ uint16_t fm10k_recv_scattered_pkts_vec(void *, struct rte_mbuf **,
 uint16_t fm10k_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts);
 void fm10k_txq_vec_setup(struct fm10k_tx_queue *txq);
+int fm10k_tx_vec_condition_check(struct fm10k_tx_queue *txq);
+
 #endif
drivers/net/fm10k/fm10k_ethdev.c +61 -5

84 lines not on this page · raw message

drivers/net/fm10k/fm10k_rxtx_vec.c +10 -0
index 6042568..2a57eef 100644
@@ -641,6 +641,16 @@ fm10k_txq_vec_setup(struct fm10k_tx_queue *txq)
 	txq->ops = &vec_txq_ops;
 }
 
+int __attribute__((cold))
+fm10k_tx_vec_condition_check(struct fm10k_tx_queue *txq)
+{
+	/* Vector TX can't offload any features yet */
+	if ((txq->txq_flags & FM10K_SIMPLE_TX_FLAG) != FM10K_SIMPLE_TX_FLAG)
+		return -1;
+
+	return 0;
+}
+
 static inline void
 vtx1(volatile struct fm10k_tx_desc *txdp,
 		struct rte_mbuf *pkt, uint64_t flags)
Signature · 1 line
1.7.7.6
#1 lore raw

2015-11-24 14:15, Chen Jing D:

Quoted 8 lines

fm10k driver will meet compile error on non-x86 platforms due to SSE instructions. Original implementation didn't have switch to turn off vPMD.
The improvement introduces a macro to turn on/off vPMD functions, it's on by default. On non-x86 platforms, it can simply be turned off to fix compile issue.

The non-x86 platforms may have a specific implementation.
That's why we should name fm10k_rxtx_vec.c with _sse suffix instead of _vec.

Applied, thanks