From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) by dpdk.org (Postfix) with ESMTP id 38E591B550 for ; Fri, 29 Jun 2018 03:55:58 +0200 (CEST) Received: by mail-oi0-f49.google.com with SMTP id 21-v6so7039696oip.8 for ; Thu, 28 Jun 2018 18:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=tgYS8jjwdQq+l5ch4bOFMmfEqsoOSUE+XJwad7xwZKw=; b=Nncoq+B/eFE4XMcf551D7N7oq53gikw1Azvqr0Am0mw7GS4fZFoajGyu2D66JLftra zHqs3lFaQET0wG4Gg06ULPs8XnzAP7Qv7QQ405RV+E9xUCD7mzZwNP87CjQEX3q/I+H7 EHhMnvQFmgdzkq13f08JOoc63/+tkHusau07ZrlDXnRkeKtjy6UYldYq0WwQPw/4//yQ FcTH+YekojnqknWOq+LDUj3VPo+wq27Tng+HN4cQDW/CtnG6b3KUs1qKNz6rZvOpDf8p fvb7J4G3leX0/ewe+sR7iCa6+w87TzQZg9uv2T+CsxIhPUeueECqkMZL4FysktsXQZsL 0YVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=tgYS8jjwdQq+l5ch4bOFMmfEqsoOSUE+XJwad7xwZKw=; b=PJRzW7Na4UGRB8CUMTvYlIBJJspMqFwE0sCMLU7Xp1qnpyNHpoYTJ/zWh2egmjFDjW vrSVtpa4isLDSh/QNT5GES35dwStPVFOiTOfCYaxmKbay7TzmgQKhUoNKT5T1onJP454 oPW3mahArGzDep25fpRjPtCIWCOVsCICXZGjrwO949ex+WjviMUwt1Im+Y1IP2yUrigI Ud6wS6PTnFDIRGjVwO8daXsVDVwTp1UVzSlYC1w5ewdGFVvtDmsH/BHY4Ryxyym1xqmu dZnMeMKPfDxIkZWbMT9WkvxICZgeoDoo9nE7dU3A6+8bJ2fP3PwYmoKAk1UZpiS91E+0 PdYg== X-Gm-Message-State: APt69E0rKP5pWAu8BIQe/r/eMApt0X7JaiiGBhYgRrPnwSNc2EqEGYvz BxFyjjNwNL47/fexGbz2bjI= X-Google-Smtp-Source: AAOMgpeEfxbjEQgmyhQknMMZxAyA7axnIygfMpr2zAA1ZtjQa4UjSbwqtbRH5/vHdx4xtRmWQvr0Dg== X-Received: by 2002:aca:402:: with SMTP id 2-v6mr6826387oie.134.1530237357442; Thu, 28 Jun 2018 18:55:57 -0700 (PDT) Received: from linux.adax.com (172-11-198-60.lightspeed.sntcca.sbcglobal.net. [172.11.198.60]) by smtp.gmail.com with ESMTPSA id n3-v6sm3941288otk.38.2018.06.28.18.55.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jun 2018 18:55:56 -0700 (PDT) Sender: Dan Gora From: Dan Gora To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Dan Gora Date: Thu, 28 Jun 2018 18:55:05 -0700 Message-Id: <20180629015508.26599-8-dg@adax.com> X-Mailer: git-send-email 2.18.0.rc1.1.g6f333ff2f In-Reply-To: <20180629015508.26599-1-dg@adax.com> References: <20180628224513.18391-1-dg@adax.com> <20180629015508.26599-1-dg@adax.com> Subject: [dpdk-dev] [PATCH v2 07/10] kni: update kni test for rte_kni_free X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2018 01:55:58 -0000 Add support for testing rte_kni_free() function. Signed-off-by: Dan Gora --- test/test/test_kni.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/test/test_kni.c b/test/test/test_kni.c index 56773c8a2..ec051c07e 100644 --- a/test/test/test_kni.c +++ b/test/test/test_kni.c @@ -427,6 +427,12 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp) goto fail_kni; } + /* test of freeing an unreleased kni device */ + if (rte_kni_free(kni) == 0) { + printf("should not be able to free an unreleased kni device\n"); + return -1; + } + if (rte_kni_release(kni) < 0) { printf("fail to release kni\n"); return -1; @@ -439,6 +445,12 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp) return -1; } + /* test of freeing a released kni device */ + if (rte_kni_free(kni) != 0) { + printf("failed to free a released kni device\n"); + return -1; + } + /* test of reusing memzone */ kni = rte_kni_alloc(mp, &conf, &ops); if (!kni) { @@ -598,6 +610,14 @@ test_kni(void) goto fail; } + /* test of freeing NULL kni context */ + ret = rte_kni_free(NULL); + if (ret == 0) { + ret = -1; + printf("unexpectedly freed kni successfully\n"); + goto fail; + } + /* test of handling request on NULL device pointer */ ret = rte_kni_handle_request(NULL); if (ret == 0) { -- 2.18.0.rc1.1.g6f333ff2f