DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/test: fix shared library build failure
@ 2018-04-24 22:10 Reshma Pattan
  2018-04-24 22:51 ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Reshma Pattan @ 2018-04-24 22:10 UTC (permalink / raw)
  To: david.hunt, dev; +Cc: jananeex.m.parthasarathy, Reshma Pattan

Using private api `guest_channel_host_connect()`
will cause shared library build failure.
So revert the changes done.

Fixes: d550a8cc31 ("app/test: enhance power manager unit tests")

Signed-off-by: Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 test/test/test_power_kvm_vm.c | 47 ++++++++-----------------------------------
 1 file changed, 8 insertions(+), 39 deletions(-)

diff --git a/test/test/test_power_kvm_vm.c b/test/test/test_power_kvm_vm.c
index 2ac74912d..bce706ded 100644
--- a/test/test/test_power_kvm_vm.c
+++ b/test/test/test_power_kvm_vm.c
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
+ * Copyright(c) 2010-2018 Intel Corporation
  */
 
 #include <stdio.h>
@@ -25,17 +25,12 @@ test_power_kvm_vm(void)
 #define TEST_POWER_VM_LCORE_ID            0U
 #define TEST_POWER_VM_LCORE_OUT_OF_BOUNDS (RTE_MAX_LCORE+1)
 #define TEST_POWER_VM_LCORE_INVALID       1U
-#define TEMP_POWER_MANAGER_FILE_PATH  "/tmp/testpm"
-
-int guest_channel_host_connect(const char *path, unsigned int lcore_id);
 
 static int
 test_power_kvm_vm(void)
 {
 	int ret;
 	enum power_management_env env;
-	char fPath[PATH_MAX];
-	FILE *fPtr = NULL;
 
 	ret = rte_power_set_env(PM_ENV_KVM_VM);
 	if (ret != 0) {
@@ -100,31 +95,13 @@ test_power_kvm_vm(void)
 	/* Test initialisation of a valid lcore */
 	ret = rte_power_init(TEST_POWER_VM_LCORE_ID);
 	if (ret < 0) {
-		printf("rte_power_init failed as expected in host\n");
-		/* This test would be successful when run on VM,
-		 * in order to run in Host itself, temporary file path
-		 * is created and same is used for further communication
-		 */
-
-		snprintf(fPath, PATH_MAX, "%s.%u",
-			TEMP_POWER_MANAGER_FILE_PATH, TEST_POWER_VM_LCORE_ID);
-		fPtr = fopen(fPath, "w");
-		if (fPtr == NULL) {
-			printf(" Unable to create file\n");
-			rte_power_unset_env();
-			return -1;
-		}
-		ret = guest_channel_host_connect(TEMP_POWER_MANAGER_FILE_PATH,
-			TEST_POWER_VM_LCORE_ID);
-		if (ret == 0)
-			printf("guest_channel_host_connect successful\n");
-		else {
-			printf("guest_channel_host_connect failed\n");
-			rte_power_unset_env();
-			fclose(fPtr);
-			remove(fPath);
-			return -1;
-		}
+		printf("Cannot initialise power management for lcore %u, this "
+				"may occur if environment is not configured "
+				"correctly(KVM VM) or operating in another valid "
+				"Power management environment\n",
+				TEST_POWER_VM_LCORE_ID);
+		rte_power_unset_env();
+		return -1;
 	}
 
 	/* Test initialisation of previously initialised lcore */
@@ -314,18 +291,10 @@ test_power_kvm_vm(void)
 		return -1;
 	}
 	rte_power_unset_env();
-	if (fPtr != NULL) {
-		fclose(fPtr);
-		remove(fPath);
-	}
 	return 0;
 fail_all:
 	rte_power_exit(TEST_POWER_VM_LCORE_ID);
 	rte_power_unset_env();
-	if (fPtr != NULL) {
-		fclose(fPtr);
-		remove(fPath);
-	}
 	return -1;
 }
 #endif
-- 
2.14.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/test: fix shared library build failure
  2018-04-24 22:10 [dpdk-dev] [PATCH] app/test: fix shared library build failure Reshma Pattan
@ 2018-04-24 22:51 ` Thomas Monjalon
  2018-04-25 11:59   ` Parthasarathy, JananeeX M
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2018-04-24 22:51 UTC (permalink / raw)
  To: Reshma Pattan
  Cc: dev, david.hunt, jananeex.m.parthasarathy, bruce.richardson,
	ferruh.yigit

title changed to "test/power: fix build with shared library"

25/04/2018 00:10, Reshma Pattan:
> Using private api `guest_channel_host_connect()`
> will cause shared library build failure.

Adding the log:
            test_power_kvm_vm.c:(.text+0x2cb):
            undefined reference to `guest_channel_host_connect'

> So revert the changes done.
> 
> Fixes: d550a8cc31 ("app/test: enhance power manager unit tests")

Exact line has a longer id:
Fixes: d550a8cc31f3 ("app/test: enhance power manager unit tests")

> Signed-off-by: Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>

Adding more credits:    
    Reported-by: Bruce Richardson <bruce.richardson@intel.com>
    Suggested-by: David Hunt <david.hunt@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/test: fix shared library build failure
  2018-04-24 22:51 ` Thomas Monjalon
@ 2018-04-25 11:59   ` Parthasarathy, JananeeX M
  0 siblings, 0 replies; 3+ messages in thread
From: Parthasarathy, JananeeX M @ 2018-04-25 11:59 UTC (permalink / raw)
  To: Thomas Monjalon, Pattan, Reshma
  Cc: dev, Hunt, David, Richardson, Bruce, Yigit, Ferruh



-----Original Message-----
From: Thomas Monjalon [mailto:thomas@monjalon.net] 
Sent: Wednesday, April 25, 2018 4:21 AM
To: Pattan, Reshma <reshma.pattan@intel.com>
Cc: dev@dpdk.org; Hunt, David <david.hunt@intel.com>; Parthasarathy, JananeeX M <jananeex.m.parthasarathy@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH] app/test: fix shared library build failure

title changed to "test/power: fix build with shared library"

25/04/2018 00:10, Reshma Pattan:
> Using private api `guest_channel_host_connect()` will cause shared 
> library build failure.

Adding the log:
            test_power_kvm_vm.c:(.text+0x2cb):
            undefined reference to `guest_channel_host_connect'

> So revert the changes done.
> 
> Fixes: d550a8cc31 ("app/test: enhance power manager unit tests")

Exact line has a longer id:
Fixes: d550a8cc31f3 ("app/test: enhance power manager unit tests")

> Signed-off-by: Jananee Parthasarathy 
> <jananeex.m.parthasarathy@intel.com>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>

Adding more credits:    
    Reported-by: Bruce Richardson <bruce.richardson@intel.com>
    Suggested-by: David Hunt <david.hunt@intel.com>
    Tested-by: Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com>
Applied, thanks


--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-25 11:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24 22:10 [dpdk-dev] [PATCH] app/test: fix shared library build failure Reshma Pattan
2018-04-24 22:51 ` Thomas Monjalon
2018-04-25 11:59   ` Parthasarathy, JananeeX M

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).