From patchwork Fri Oct 20 14:00:19 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: 116501 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp16130edm; Fri, 20 Oct 2017 07:07:43 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TKX5BlTyuIGJyn8xWeF6RLhxW0ow7ugIqUCusc8N5lcNeuWYJnHUJiFhAtEZMsr311RB8J X-Received: by 10.237.42.107 with SMTP id k40mr7655555qtf.253.1508508463778; Fri, 20 Oct 2017 07:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508508463; cv=none; d=google.com; s=arc-20160816; b=yLr0Byh3Vtk+nK0Hb2TcjtxMCObx3r0GU5tFUmznrbT1YFlnua5MtO7XqIq8tyE+0r d1QbxPlq65J2P2xHhI7cw7/TjJ1rBUZzZVr0LSwx18zjw7NNbJNNI16TlK3pJbHcyuWD R3qBWFOqIL8HojT7zSpv5UcOWAOb8pb1G4ob9aMAoQawEufC7MqgU3Gs7E3bE6kuO1OC nTUShLWrMg6X3/QCuqZEQImF6AGAyObyZnh14wpiKhBk8T9SdgF0DhFa+Ju1A/cweuYk qsR4NOfvAbuk7+qrCnN/GMMkhGTTfQWK6vnhxr/m3qlLvHqIsBRYr2+Dz5seXtfGIiSH ng5A== 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=0V4fzJiUTCn2KBBBWjS3gH7icZzNQsSpWjWFn5auVG8=; b=e/rNi9R9XWXhRcwbghRRAmeViH8TjMm/iHiH0GV5xuqOjHwLHHdUCsucdGdFnkRaLY t9ZDXQDOlyezOyQ7CRCzF793OlGQB+lZAajCPTrS/vJQ3GAEFVT+rMFp9NFJ4yO4qYIR IdXDtdZwgCvDiohqgk4LdsQIz79xjPzy6r9ORUNpQFYa8Nb+w8vOC+2nSstWmL9gp3eC yVs8BBwJvAGaUPTRXL7jis+49yq5raY6p7+4sf9SaoLaRx2ATmsDcu5JrCLZM0dWvxU+ OfS5w6TnmZ+nseBqB5zk2Lr+wSo9rUYD0keBy+I49C4UnMQN/FXyn3UriT4XHVfJRgHf kNcQ== 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 n18si838670qtk.101.2017.10.20.07.07.43; Fri, 20 Oct 2017 07:07:43 -0700 (PDT) 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 6177061011; Fri, 20 Oct 2017 14:07:43 +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 0C63C6100B; Fri, 20 Oct 2017 14:01:31 +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 5A42760916; Fri, 20 Oct 2017 14:01:21 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 8E69360C8F for ; Fri, 20 Oct 2017 14:00:28 +0000 (UTC) Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 82020182DEE for ; Fri, 20 Oct 2017 17:00:25 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mWrt5cdKfJ-0PcScpup; Fri, 20 Oct 2017 17:00:25 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ngsIlp8rAg-0Os0MmAq; Fri, 20 Oct 2017 17:00:24 +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: Fri, 20 Oct 2017 17:00:19 +0300 Message-Id: <1508508019-21333-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508508019-21333-1-git-send-email-odpbot@yandex.ru> References: <1508508019-21333-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 240 Subject: [lng-odp] [PATCH v3 1/1] linux-gen: pktio: ignore num_queues parameter if classifier enabled 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: Maxim Uvarov Api defines statemet: "When classifier is enabled in odp_pktin_queue_config() this value is ignored, otherwise at least one queue is required." https://bugs.linaro.org/show_bug.cgi?id=3289 Signed-off-by: Maxim Uvarov --- /** Email created from pull request 240 (muvarov:master_bug3289) ** https://github.com/Linaro/odp/pull/240 ** Patch: https://github.com/Linaro/odp/pull/240.patch ** Base sha: 54228421977f94d9da752290540c6ec4dc5306a0 ** Merge commit sha: fc1d3e6860427cd93c3791f9230b21b87627db39 **/ platform/linux-generic/odp_packet_io.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index f972bb78f..57d23dc34 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1228,13 +1228,13 @@ int odp_pktin_queue_config(odp_pktio_t pktio, if (mode == ODP_PKTIN_MODE_DISABLED) return 0; - num_queues = param->num_queues; - - if (num_queues == 0) { - ODP_DBG("pktio %s: zero input queues\n", entry->s.name); + if (!param->classifier_enable && param->num_queues == 0) { + ODP_DBG("invalid num_queues for operation mode\n"); return -1; } + num_queues = param->classifier_enable ? 1 : param->num_queues; + rc = odp_pktio_capability(pktio, &capa); if (rc) { ODP_DBG("pktio %s: unable to read capabilities\n", @@ -1263,8 +1263,11 @@ int odp_pktin_queue_config(odp_pktio_t pktio, snprintf(name, sizeof(name), "odp-pktin-%i-%i", pktio_id, i); - memcpy(&queue_param, ¶m->queue_param, - sizeof(odp_queue_param_t)); + if (param->classifier_enable) + odp_queue_param_init(&queue_param); + else + memcpy(&queue_param, ¶m->queue_param, + sizeof(odp_queue_param_t)); queue_param.type = ODP_QUEUE_TYPE_PLAIN;