From patchwork Wed Nov 22 13:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 119480 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp144614qgn; Wed, 22 Nov 2017 05:04:54 -0800 (PST) X-Google-Smtp-Source: AGs4zMZo5ovBhp2Xqwd9ou5Xfn4JwB8fxaXqco1DVBPQ0B9NckSVpJCKhmjaN/TdB7sM9b/TGaUE X-Received: by 10.55.64.68 with SMTP id n65mr1855845qka.26.1511355894344; Wed, 22 Nov 2017 05:04:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511355894; cv=none; d=google.com; s=arc-20160816; b=R+kHCiQjKFuGQWxE0KJTCZ95pIO/BcEeVDe9WnUef6pfzwrO7A0Q4ecVO2tXE7ibOS 4CdBKitb6XGWo70kgc65LaMN21jQHiuEGKfs+O1+UvWfqBrkT66DFyIi2Iis7ild4ViM XXcN1l0LpeqW2xoXSCO6b+190gcIbqgH32ZHw8ECggJsWkpnN483C7h0dYhfstpC8249 xm8HvTtp+8aOvOzfnngEMH1CBR1Y6SzLcbNILJSXtZHOZ5kMg4/sv5JaeeOw4vG5UQ6M Ex9i+qU8SlBCvsp/IasA5QNC654GDmp8dz0xiQwITE6fmnkIccEhi5iDIYbB7rtbzpdZ Ki+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=gr7nHBoLp3yyLce6UmAx+7jfZzoA+pcD98JaR8q+7Fc=; b=y1Zpl//cH/7TsYZQZ/NWavb+x6NTULWHosF68hMSOWfik5CAh7dr1bw1Vl56yrIGvy zeGU1V6AKwnNKrk8QnXbnWxdq5r2vZG/bUGUMbJPyke2tzk91jrcYUEC1QWWdYWqbi+g gfot9T0M3FKk5d5HgtUa7hbDd5bvnRAFldnda3P+kdIn1pkI6NzXPfEk2nTybxcIRswi PTzPUSipYLM2LajaKU6LDbGcHKUEcha6kfqSB2v/EPn75M7hKfVfwf+uhRz7oen+1OLN 9rSQqW2SMWWfesZQuNVOsCgimBXf9iamTdg5ehOOjHP8g0jjz6cjJou6Dxi2b0Pu4AB5 zzTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id r53si669844qtr.251.2017.11.22.05.04.53; Wed, 22 Nov 2017 05:04:54 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id D910960879; Wed, 22 Nov 2017 13:04:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C32B060749; Wed, 22 Nov 2017 13:02:46 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 469F0606E1; Wed, 22 Nov 2017 13:02:29 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id B9D8D60723 for ; Wed, 22 Nov 2017 13:00:10 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 053B821847EC for ; Wed, 22 Nov 2017 16:00:09 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id X06tLqHpqe-08aGq3Dj; Wed, 22 Nov 2017 16:00:09 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id sbSP7WoJCB-08JCJbcO; Wed, 22 Nov 2017 16:00:08 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 22 Nov 2017 16:00:05 +0300 Message-Id: <1511355605-11085-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511355605-11085-1-git-send-email-odpbot@yandex.ru> References: <1511355605-11085-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 306 Subject: [lng-odp] [PATCH API-NEXT v1 1/1] linux-gen: dpdk: check config bits not capa bits X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Application is required to set L3 offset only when it requests checksum offload. This fixes https://bugs.linaro.org/show_bug.cgi?id=3491 It caused segfault to assume that L3 offset is always when the interface supports checksumming. Signed-off-by: Petri Savolainen --- /** Email created from pull request 306 (psavol:next-tx-checksum-bugfix) ** https://github.com/Linaro/odp/pull/306 ** Patch: https://github.com/Linaro/odp/pull/306.patch ** Base sha: b95e7d08043ba45d12635c5afaa3fbf3a07ecc90 ** Merge commit sha: 3e5688323be04d904c74ba0da23e8a83673b73f4 **/ platform/linux-generic/pktio/dpdk.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 5032b8dfb..0281aace2 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -607,8 +607,6 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, char *data; uint16_t pkt_len; odp_pktout_config_opt_t *pktout_cfg = &pktio_entry->s.config.pktout; - odp_pktout_config_opt_t *pktout_capa = - &pktio_entry->s.capa.config.pktout; if (odp_unlikely((rte_pktmbuf_alloc_bulk(pkt_dpdk->pkt_pool, mbuf_table, num)))) { @@ -629,10 +627,14 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, odp_packet_copy_to_mem(pkt_table[i], 0, pkt_len, data); - if (pktout_capa->all_bits) + if (pktout_cfg->all_bits) { + odp_pktout_config_opt_t *pktout_capa = + &pktio_entry->s.capa.config.pktout; + pkt_set_ol_tx(pktout_cfg, pktout_capa, odp_packet_hdr(pkt_table[i]), mbuf_table[i], data); + } } return i; @@ -741,7 +743,7 @@ static inline int pkt_to_mbuf_zero(pktio_entry_t *pktio_entry, pkt_hdr->extra_type == PKT_EXTRA_TYPE_DPDK)) { mbuf_update(mbuf, pkt_hdr, pkt_len); - if (pktout_capa->all_bits) + if (pktout_cfg->all_bits) pkt_set_ol_tx(pktout_cfg, pktout_capa, pkt_hdr, mbuf, odp_packet_data(pkt)); } else { @@ -764,7 +766,7 @@ static inline int pkt_to_mbuf_zero(pktio_entry_t *pktio_entry, mbuf_init((struct rte_mempool *) pool_entry->ext_desc, mbuf, pkt_hdr); mbuf_update(mbuf, pkt_hdr, pkt_len); - if (pktout_capa->all_bits) + if (pktout_cfg->all_bits) pkt_set_ol_tx(pktout_cfg, pktout_capa, pkt_hdr, mbuf,