net/mlx5: remove extra check on Rx

Removing this check improves performance as VLAN and CRC stripping are
enabled most of the time.

Convert MLX5_CQE_VLAN_STRIPPED to network order to speed up the check
instead of doing it on the completion queue entry field.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
This commit is contained in:
Nélio Laranjeiro 2017-04-11 14:46:17 +02:00 committed by Ferruh Yigit
parent 695cd416ce
commit 6703d83634

View File

@ -2041,23 +2041,19 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
mlx5_flow_mark_get(mark); mlx5_flow_mark_get(mark);
} }
} }
if (rxq->csum | rxq->csum_l2tun | rxq->vlan_strip | if (rxq->csum | rxq->csum_l2tun) {
rxq->crc_present) { pkt->packet_type = rxq_cq_to_pkt_type(cqe);
if (rxq->csum) { pkt->ol_flags |= rxq_cq_to_ol_flags(rxq, cqe);
pkt->packet_type =
rxq_cq_to_pkt_type(cqe);
pkt->ol_flags |=
rxq_cq_to_ol_flags(rxq, cqe);
} }
if (ntohs(cqe->hdr_type_etc) & if (rxq->vlan_strip &&
MLX5_CQE_VLAN_STRIPPED) { (cqe->hdr_type_etc &
htons(MLX5_CQE_VLAN_STRIPPED))) {
pkt->ol_flags |= PKT_RX_VLAN_PKT | pkt->ol_flags |= PKT_RX_VLAN_PKT |
PKT_RX_VLAN_STRIPPED; PKT_RX_VLAN_STRIPPED;
pkt->vlan_tci = ntohs(cqe->vlan_info); pkt->vlan_tci = ntohs(cqe->vlan_info);
} }
if (rxq->crc_present) if (rxq->crc_present)
len -= ETHER_CRC_LEN; len -= ETHER_CRC_LEN;
}
PKT_LEN(pkt) = len; PKT_LEN(pkt) = len;
} }
DATA_LEN(rep) = DATA_LEN(seg); DATA_LEN(rep) = DATA_LEN(seg);