From patchwork Wed Nov 22 16:00:06 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: 119495 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp350575qgn; Wed, 22 Nov 2017 08:01:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMbQ08nUgo89tHyfw898TdrGiM7IVMYO0SG5/nBzRxcpxmEt4bg0Tye/EA4lqPTaIxPTtbCH X-Received: by 10.37.181.10 with SMTP id p10mr12911385ybj.10.1511366476790; Wed, 22 Nov 2017 08:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511366476; cv=none; d=google.com; s=arc-20160816; b=N9J0JdqDxS4ExUuQbujQ8HxNnysYZ62tUx1irXG8jylfvOMurQ7kBuA6+J9T5/9wXu DyI569NNwB3dOkv7ovwocP7nZr/Ho/uM7Zkc6p3rE1s5bnVXuu1f46lc24HnBfp/ZfnX BswIDcIU9HX64k8w7OgRRlAgCbUdkPrIvd14xrCZRGv+E2JyjAemWL93NovbZoBltcwo EZWR2aRN+GpgSOeNiZ1BgpLa7cwQQoouAtx9YXzRN0UkqQIaG6F8KEuDbcD5mOQ9Uuh4 wIYyRVRkcifJ/gc+4i47RnqtpFBSym26RD3z6alFqBHGqeWxr27Nvmqiz6/l6TPQ3bJf ffRQ== 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=ObXf8nxzsnq249eDCtA+0Vfk3Obue/kaezuovkQFkFE=; b=X5BClrlsXiIE9fg2jiTiBEMkMR32EECJJ0cIGTaZpa4qLEW0Auix6U6MWHUpPPbwop y4mJJ90n7X+YO0UquxiyNp66FDQIqtcV7tov9WF3jZwYvIuaybeD63F2Y2r2kMtACbaY SIAvSsm828uwRvV9ZOUy5nwLL9Ewp/MJ3KPVKXl7xWJErbAHyj9mvX/8zkOmzAuVnWmO XfOimHm1V2u1znx18xvktod9Gblivz3fI6F3/kvaHIpWfSLNhcJh4I8CbG6ez2iNGCQK mYtpyRUM2K1CLF3XZnmFFAFtQABhQFOOVvfhLuaT4Q75NKiO3nAcKGvVctlbaKgUd+L5 UtLg== 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 b30si7842397qtc.248.2017.11.22.08.01.16; Wed, 22 Nov 2017 08:01:16 -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 58738606E1; Wed, 22 Nov 2017 16:01:16 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 C619960455; Wed, 22 Nov 2017 16:00:24 +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 9CFEB606F3; Wed, 22 Nov 2017 16:00:15 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id EFB966069E for ; Wed, 22 Nov 2017 16:00:09 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward101p.mail.yandex.net (Yandex) with ESMTP id D4A5A6A81CEA for ; Wed, 22 Nov 2017 19:00:07 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id oWIfcSIby6-07AupUHt; Wed, 22 Nov 2017 19:00:07 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Y6WyXq9M9y-07DCn6Y0; Wed, 22 Nov 2017 19:00:07 +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 19:00:06 +0300 Message-Id: <1511366406-22668-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511366406-22668-1-git-send-email-odpbot@yandex.ru> References: <1511366406-22668-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 308 Subject: [lng-odp] [PATCH API-NEXT v1 1/1] linux-gen: pktio: dpdk: skip TX csum calculation if L3/L4 offsets are invalid 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: Bogdan Pricope L3/L4 offsets may be invalid (ODP_PACKET_OFFSET_INVALID) for a TX packet. This will prevent form providing the arguments needed by dpdk for csum calculation. Signed-off-by: Bogdan Pricope --- /** Email created from pull request 308 (bogdanPricope:api_next_tx_csum_crash) ** https://github.com/Linaro/odp/pull/308 ** Patch: https://github.com/Linaro/odp/pull/308.patch ** Base sha: b95e7d08043ba45d12635c5afaa3fbf3a07ecc90 ** Merge commit sha: a391a6f5609755883e71d89b00e5a589ec486744 **/ platform/linux-generic/pktio/dpdk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 5032b8dfb..9c211b4d7 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -545,6 +545,10 @@ static inline void pkt_set_ol_tx(odp_pktout_config_opt_t *pktout_cfg, odp_bool_t ipv4_chksum_pkt, udp_chksum_pkt, tcp_chksum_pkt; packet_parser_t *pkt_p = &pkt_hdr->p; + if (pkt_p->l3_offset == ODP_PACKET_OFFSET_INVALID || + pkt_p->l4_offset == ODP_PACKET_OFFSET_INVALID) + return; + l3_hdr = (void *)(mbuf_data + pkt_p->l3_offset); if (check_proto(l3_hdr, &l3_proto_v4, &l4_proto))