summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelio Laranjeiro <nelio.laranjeiro@6wind.com>2016-03-03 15:27:14 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-03-16 18:52:17 +0100
commit081f7eae242eac9d3d9769d355764622cfa6c4c9 (patch)
treebefa8d33ebf0da5708b9c938faebc26557402766
parente16820236d358c84fa15acd960b82e7caaa2b2b1 (diff)
downloaddpdk-081f7eae242e.zip
dpdk-081f7eae242e.tar.gz
dpdk-081f7eae242e.tar.xz
mlx5: process offload flags only when requested
Improve performance by processing offloads only when requested by the application. Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
-rw-r--r--drivers/net/mlx5/mlx5_rxtx.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 63ddc53..c84ec8c 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -853,14 +853,16 @@ mlx5_rx_burst_sp(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
NB_SEGS(pkt_buf) = j;
PORT(pkt_buf) = rxq->port_id;
PKT_LEN(pkt_buf) = pkt_buf_len;
- pkt_buf->packet_type = rxq_cq_to_pkt_type(flags);
- pkt_buf->ol_flags = rxq_cq_to_ol_flags(rxq, flags);
+ if (rxq->csum | rxq->csum_l2tun | rxq->vlan_strip) {
+ pkt_buf->packet_type = rxq_cq_to_pkt_type(flags);
+ pkt_buf->ol_flags = rxq_cq_to_ol_flags(rxq, flags);
#ifdef HAVE_EXP_DEVICE_ATTR_VLAN_OFFLOADS
- if (flags & IBV_EXP_CQ_RX_CVLAN_STRIPPED_V1) {
- pkt_buf->ol_flags |= PKT_RX_VLAN_PKT;
- pkt_buf->vlan_tci = vlan_tci;
- }
+ if (flags & IBV_EXP_CQ_RX_CVLAN_STRIPPED_V1) {
+ pkt_buf->ol_flags |= PKT_RX_VLAN_PKT;
+ pkt_buf->vlan_tci = vlan_tci;
+ }
#endif /* HAVE_EXP_DEVICE_ATTR_VLAN_OFFLOADS */
+ }
/* Return packet. */
*(pkts++) = pkt_buf;
@@ -1006,15 +1008,16 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
NEXT(seg) = NULL;
PKT_LEN(seg) = len;
DATA_LEN(seg) = len;
- seg->packet_type = rxq_cq_to_pkt_type(flags);
- seg->ol_flags = rxq_cq_to_ol_flags(rxq, flags);
+ if (rxq->csum | rxq->csum_l2tun | rxq->vlan_strip) {
+ seg->packet_type = rxq_cq_to_pkt_type(flags);
+ seg->ol_flags = rxq_cq_to_ol_flags(rxq, flags);
#ifdef HAVE_EXP_DEVICE_ATTR_VLAN_OFFLOADS
- if (flags & IBV_EXP_CQ_RX_CVLAN_STRIPPED_V1) {
- seg->ol_flags |= PKT_RX_VLAN_PKT;
- seg->vlan_tci = vlan_tci;
- }
+ if (flags & IBV_EXP_CQ_RX_CVLAN_STRIPPED_V1) {
+ seg->ol_flags |= PKT_RX_VLAN_PKT;
+ seg->vlan_tci = vlan_tci;
+ }
#endif /* HAVE_EXP_DEVICE_ATTR_VLAN_OFFLOADS */
-
+ }
/* Return packet. */
*(pkts++) = seg;
++pkts_ret;