From patchwork Fri Oct 20 21:00:09 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: 116536 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2117788qgn; Fri, 20 Oct 2017 14:00:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SaTZu2j1tdQamJlhsq+YjDSWdfnQEfwjKb04XcU3Xg2OE02XhFi7jpuUlyIR5+jRKZ33mT X-Received: by 10.200.56.215 with SMTP id g23mr9118923qtc.251.1508533250278; Fri, 20 Oct 2017 14:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508533250; cv=none; d=google.com; s=arc-20160816; b=zC4xh6lAY/TH26wyZSmkTS7Utz/M7VuKJfcMAODrgXRaW0j4EYwmTgmFVILVEcEGCL 7/KV2gZIpvbgiH6U+UaFcmJNjjLDj+GiJe7bkHy8rTjJFLTsGq8UE8SXHUwGJw7nSqBJ vOIKd38svCD/UPlZHjb90Vd5qRH1N5scue/HuTIk569zfdEvkh54DDfiao5b/RPeWr8Y /i1Z4c5VS8NHwit/mbgw0XbLSVTPpoGeEACYkzkUstdYuVJDv0abjLHxazQMvKaBuD/0 /HB2HT7/kDVvCM/F6z8ks0lbHXT6by7Mq6S3/NnZ0RIB11txDgoPotobGYiIDj5w8Y5W lw2w== 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=iRh1DDlPaQ+ea2KjtBCoNNFxVuY40J67cCSZ0pihKAw=; b=LK1I7VC9gIpKgcoi6F9x4WlA8m2xEUpBtsPbuVc8ea0I3DVNxejpS4qw+yAj6Q+acu wEuZRMQ9qia0SQ9JSPm3n8ds62ncTDdlh4HQv7Mg8pZGqBVEfpl+Yk2J3ppIEG8DMl/6 KdwnGP57Sp0lt1lCt0DrEA8/G+9gc93IdffdrLVwVDJDB8jndJx8m4BrKVMriHJLpagN vWMSbuFldIOZ5/NkxK541nl4S03BLnES3a1+MAd4wTZu9afgee2DX5/9XXuL7Y34bNZr CSfAoQw/ayUiZO5d/FL9vZ9TBJPaReAwdHK6LpZhKVba1OIz+StUwgD5/9i8Xrs3gIFJ E0Xw== 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 y21si1103736qky.242.2017.10.20.14.00.50; Fri, 20 Oct 2017 14:00:50 -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 EA14160FFA; Fri, 20 Oct 2017 21:00:49 +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 79B1D60FFF; Fri, 20 Oct 2017 21:00:27 +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 56F8760628; Fri, 20 Oct 2017 21:00:18 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 0615260387 for ; Fri, 20 Oct 2017 21:00:17 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 6FA242A233A3 for ; Sat, 21 Oct 2017 00:00:15 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4OSrTtCBvh-0FD4H37t; Sat, 21 Oct 2017 00:00:15 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id e0OAEVJxc7-0Es0A5hx; Sat, 21 Oct 2017 00:00:14 +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: Sat, 21 Oct 2017 00:00:09 +0300 Message-Id: <1508533209-9940-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508533209-9940-1-git-send-email-odpbot@yandex.ru> References: <1508533209-9940-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 240 Subject: [lng-odp] [PATCH v4 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: a880959768abe7fc59e51fcc9520e723aeb09429 **/ 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..0473483de 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;