From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id B792537A6 for ; Mon, 22 Feb 2016 19:18:31 +0100 (CET) Received: by mail-wm0-f41.google.com with SMTP id g62so176335509wme.0 for ; Mon, 22 Feb 2016 10:18:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jLI4gylR01gSf4uiXz4xPpbHUFkEXRgKCQ/h31Au/EU=; b=tgmX/+ozE9uFuQwkztLlExklwKIHJjlJVnny6jjNUY0qc+RLRwNiRR4EZXakTzRU3j /XAiSBOrdIR0yHuQmXqErt5wdqzfIylFsKJ9keMuCGSe+bVMmN0Ng9vZjJvb7lSy9aGT 2lrvcsw5WF+0D98/empOL3iY26/KQdsLB1j4z8ZFgMXBpPjGfHFJTAgIyiRHOuORcpxx A6bls7gGJmyTNNADbxR09q8uTIxAsT2WQiS2YU08cwP1BJ8T1nMNCfVbvmzHm0pZwhtC kw/+3AtjkmYscAxsKUuOkVORW6je4CUKzI956fCsA6XqsQvl9Mau1SFtTyn92LgAkkO6 ukZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jLI4gylR01gSf4uiXz4xPpbHUFkEXRgKCQ/h31Au/EU=; b=hJScNrr72kBGrNe0REGqexpNZLD+6XF8l3NdFzFmC1+jjnCJlgilN2hTvGV9R6if7T ZQmNlGLqyhLySBBoVdXlivzRaGJ3qFVKWMSmpJ8b+7H5sfBa1zRiZdCr1s68l79X8Fj4 bGjcaHUUSmhsvIMEVMC0KTQMgQ5eKDlRx+K2lvR5ICkjG7u8xW1OsvxjCK2CBekAvKV3 bsWF9oLkxDDd8pHCz6a0lN9swnzJQ2DlGr7kjsSqAx47tg4yuf6ltz//nP4vn9C8H2p+ iw/z2U0oAsUDgSEaWwzh/aKiuHUVoFC8WgcvauaG25t/vQiDe4VmarNwVX8vNkKmqigH Qg0g== X-Gm-Message-State: AG10YOR2fcmbhk9hhVfrdHIqV+lJhnAFSoyv996z2pDQVKpaq8F19Y2D+SUJlmtvhyrmL08L X-Received: by 10.28.223.8 with SMTP id w8mr14685603wmg.54.1456165111633; Mon, 22 Feb 2016 10:18:31 -0800 (PST) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id d9sm25733511wjf.43.2016.02.22.10.18.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Feb 2016 10:18:30 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 22 Feb 2016 19:18:00 +0100 Message-Id: <1456165083-28316-5-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456165083-28316-1-git-send-email-adrien.mazarguil@6wind.com> References: <1454063573-1993-1-git-send-email-adrien.mazarguil@6wind.com> <1456165083-28316-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v2 4/7] mlx5: process offload flags only when requested X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 18:18:32 -0000 From: Nelio Laranjeiro Improve performance by processing offloads only when requested by the application. Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxtx.c | 29 ++++++++++++++++------------- 1 file 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; -- 2.1.4