From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 3C7DBC696 for ; Fri, 29 Jan 2016 11:33:27 +0100 (CET) Received: by mail-wm0-f45.google.com with SMTP id r129so62237746wmr.0 for ; Fri, 29 Jan 2016 02:33:27 -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=ewi7+Ycpmuuan+DT0KUPK/8uk7offwErkKWdvtOGErDK6NrPJcGLTZn2iHd5Zg3W2r 6WzUExELqlT4emZT2by5aReiF+trGsMdip3PMxxzZAnA8mU9pRf+fWlwZfBxm6IhMazP 7np+f04izRxFGpyKfogXDjJmHicvlzRf4NtBbHR5/+1d7zymbNnaylYTU2zYIu9m4PkK 5Zl9e9UD3Ytwq1TxweU7TNEwvDX+pf6PfMcIn8DsJQiIkg51pulVSW7Yh2WpYZAbyyfn P9jdOnb4cj/LIySznJckMCfU+Z+2nGOVoXd2fFcVySwhajgduDNex+VuRvuD2xRgR8UR ZYjw== 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=Qg7rKTpgP8QjHyDVmbneIf1pJSvpANbgJT04wjea53cB/1gkvF4ebYjfGJ/81tAdo7 RM2eb7iJ7ALxz0u6lhaG7PrqVDm3r/ZEbzWbibZq5kgaa+6GlWukpqIdSIShx5o+WBoC EilBxST1Nbe//YZ5u6Dr6U4zbqhKqGVSh+JC4Sp8HkdzubxnD1hhmGWKMxIhfb/hAVXg 9OYkjcGpNQtaV1XfhaPCukHVnyYVG2W+jmHTC3E1js6FmcJtdhQVDebweEm6QDqLkyj7 ujvS9RhAfMLoSy/QHnk2XAUzWONYZ9YQSvKUU7UcM5VZkKmwtrk9yjoNilwrsxBbmkc0 IYNw== X-Gm-Message-State: AG10YOTon+d2z0jyn6hUYAC18VqDCPMkvzTRibpX3T7V2JVmysWrkHnSUVPsZyGbflZ5kZfU X-Received: by 10.194.5.227 with SMTP id v3mr9488620wjv.59.1454063607147; Fri, 29 Jan 2016 02:33:27 -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 u12sm6803700wmu.10.2016.01.29.02.33.26 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 02:33:26 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 29 Jan 2016 11:32:51 +0100 Message-Id: <1454063573-1993-5-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454063573-1993-1-git-send-email-adrien.mazarguil@6wind.com> References: <1454063573-1993-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 4/6] 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: Fri, 29 Jan 2016 10:33:27 -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