From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id D61F82C03 for ; Thu, 3 Mar 2016 15:27:41 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id l68so37407897wml.0 for ; Thu, 03 Mar 2016 06:27:41 -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=gPILG/h+aNkyerMs3Fb4Fj0nzVBxlPuqzUzbLt3ykf/hnJCJ19YChlbgvDg4hVTIqc bUh5e4PbNdz458H3WwztL06uyfMX4zsfsn48CdGhHNPuVc1urg4UmD62/j+XDTULr9qo n73EHyk8NOAsdMwRXrJrmEG8N9uKvS1Zi7SXbD1fSjXWGd7852KsKk0EY6KKhtoFdmXl WjepxwWhSt3dDg9y8+7SKPDG2IM478skSl+1lRNYg9wgdNH/v4xCsg0kFOeA2zBoQYd6 UplxAI0e9qpaOaw/pim+osCufNq3xT0X8Aq0sSzijEloEtWOi6yEw1BmnTiN8Csu9TP4 jCCg== 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=PdeCCaUg5xcpT/q+4jrlacgy99+ZkVxEhaM9ALvVceHrOCz3J/HJget5zpMLoqtwqB GBi0fyyO2gYazCtX7cJ5siEf3WSCOQhUhwOvnM76j8bYWk8JnaBRpwrRap6PF9EU5n6f 7aW8/I5dHOR3Hf/mfM/Aj4ppBiytP1XD+V99fjdlmsx2JDKHf8WEHfc3G3cW/E+6iShg cgA2dvaE+kcuVGDM+xKJ+wgijk5E70asJWmR9aCB2v0mJHchalKqVfoCoXBmvj/CpWsc lgVhEYmC0kxacSg9JjxLluFqlFMncGMv56Tq/I5d+BqPfYTogAEuBE0EntVk8+/kYFw8 nKwQ== X-Gm-Message-State: AD7BkJK05KRhYDF6M+ZCLi5S4T3/udKvBrjtiTWi1AnnrHPDMfFBxs+EwHtf79uVwt7Jourm X-Received: by 10.28.184.78 with SMTP id i75mr4003523wmf.22.1457015261762; Thu, 03 Mar 2016 06:27:41 -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 av3sm41066977wjc.44.2016.03.03.06.27.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2016 06:27:41 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Thu, 3 Mar 2016 15:27:14 +0100 Message-Id: <1457015237-2993-5-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1457015237-2993-1-git-send-email-adrien.mazarguil@6wind.com> References: <1456165083-28316-1-git-send-email-adrien.mazarguil@6wind.com> <1457015237-2993-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v3 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: Thu, 03 Mar 2016 14:27:42 -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