automatic DPDK test reports
 help / color / mirror / Atom feed
* |WARNING| pw116808-116809 [PATCH] [v3, 10/10] test/memarea: support no MT-safe test
@ 2022-09-24  8:39 dpdklab
  0 siblings, 0 replies; only message in thread
From: dpdklab @ 2022-09-24  8:39 UTC (permalink / raw)
  To: test-report; +Cc: dpdk-test-reports

[-- Attachment #1: Type: text/plain, Size: 11705 bytes --]

Test-Label: iol-testing
Test-Status: WARNING
http://dpdk.org/patch/116808

_apply patch failure_

Submitter: Chengwen Feng <fengchengwen@huawei.com>
Date: Saturday, September 24 2022 07:49:51 
Applied on: CommitID:fa7723b5e32f0eb8c513a5c51ab131a7bf159446
Apply patch set 116808-116809 failed:

Checking patch doc/guides/prog_guide/memarea_lib.rst...
error: while searching for:
object's reference count, if the count reaches zero, the memory object will
be freed to memarea.

Reference
---------


error: patch failed: doc/guides/prog_guide/memarea_lib.rst:43
Checking patch lib/memarea/rte_memarea.c...
error: while searching for:
 * Copyright(c) 2022 HiSilicon Limited
 */

#include <stdio.h>
#include <stdlib.h>
#include <sys/queue.h>

error: patch failed: lib/memarea/rte_memarea.c:2
error: while searching for:
		memarea_free_elem(ma, elem);
	memarea_unlock(ma);
}

error: patch failed: lib/memarea/rte_memarea.c:298
Checking patch lib/memarea/rte_memarea.h...
error: while searching for:
__rte_experimental
void rte_memarea_update_refcnt(struct rte_memarea *ma, void *ptr, int16_t value);

#ifdef __cplusplus
}
#endif

error: patch failed: lib/memarea/rte_memarea.h:194
Checking patch lib/memarea/version.map...
error: while searching for:
	rte_memarea_alloc;
	rte_memarea_create;
	rte_memarea_destroy;
	rte_memarea_free;
	rte_memarea_update_refcnt;


error: patch failed: lib/memarea/version.map:4
Applying patch doc/guides/prog_guide/memarea_lib.rst with 1 reject...
Rejected hunk #1.
Applying patch lib/memarea/rte_memarea.c with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
Applying patch lib/memarea/rte_memarea.h with 1 reject...
Rejected hunk #1.
Applying patch lib/memarea/version.map with 1 reject...
Rejected hunk #1.
diff a/doc/guides/prog_guide/memarea_lib.rst b/doc/guides/prog_guide/memarea_lib.rst	(rejected hunks)
@@ -43,6 +43,9 @@ The ``rte_memarea_update_refcnt()`` function is used to update the memory
 object's reference count, if the count reaches zero, the memory object will
 be freed to memarea.
 
++The ``rte_memarea_dump()`` function is used to dump the internal information
++of a memarea.
+
 Reference
 ---------
 
diff a/lib/memarea/rte_memarea.c b/lib/memarea/rte_memarea.c	(rejected hunks)
@@ -2,6 +2,7 @@
  * Copyright(c) 2022 HiSilicon Limited
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/queue.h>
@@ -298,3 +299,87 @@ rte_memarea_update_refcnt(struct rte_memarea *ma, void *ptr, int16_t value)
 		memarea_free_elem(ma, elem);
 	memarea_unlock(ma);
 }
+
+static const char *
+memarea_source_name(enum rte_memarea_source source)
+{
+	if (source == RTE_MEMAREA_SOURCE_RTE_MEMORY)
+		return "rte-memory";
+	else if (source == RTE_MEMAREA_SOURCE_SYSTEM_API)
+		return "system-api";
+	else if (source == RTE_MEMAREA_SOURCE_USER_ADDR)
+		return "user-addr";
+	else if (source == RTE_MEMAREA_SOURCE_USER_MEMAREA)
+		return "user-memarea";
+	else
+		return "unknown";
+}
+
+static const char *
+memarea_alg_name(enum rte_memarea_alg alg)
+{
+	if (alg == RTE_MEMAREA_ALG_DEFAULT)
+		return "default";
+	else
+		return "unknown";
+}
+
+static uint32_t
+memarea_elem_list_num(struct rte_memarea *ma)
+{
+	struct memarea_elem *elem;
+	uint32_t num = 0;
+
+	TAILQ_FOREACH(elem, &ma->elem_list, elem_node)
+		num++;
+
+	return num;
+}
+
+static uint32_t
+memarea_free_list_num(struct rte_memarea *ma)
+{
+	struct memarea_elem *elem;
+	uint32_t num = 0;
+
+	TAILQ_FOREACH(elem, &ma->free_list, free_node)
+		num++;
+
+	return num;
+}
+
+static void
+memarea_dump_all(struct rte_memarea *ma, FILE *f)
+{
+	struct memarea_elem *elem;
+
+	fprintf(f, "  regions:\n");
+	TAILQ_FOREACH(elem, &ma->elem_list, elem_node)
+		fprintf(f, "    size: 0x%zx cookie: 0x%x refcnt: %d\n",
+			elem->size, elem->cookie, elem->refcnt);
+}
+
+int
+rte_memarea_dump(struct rte_memarea *ma, FILE *f, bool dump_all)
+{
+	if (ma == NULL || f == NULL)
+		return -EINVAL;
+
+	memarea_lock(ma);
+	fprintf(f, "memarea name: %s\n", ma->init.name);
+	fprintf(f, "  source: %s\n", memarea_source_name(ma->init.source));
+	if (ma->init.source == RTE_MEMAREA_SOURCE_USER_MEMAREA)
+		fprintf(f, "  source-user-memarea: %s\n", ma->init.user_memarea->init.name);
+	fprintf(f, "  algorithm: %s\n", memarea_alg_name(ma->init.alg));
+	fprintf(f, "  total-size: 0x%zx\n", ma->init.total_sz);
+	fprintf(f, "  mt-safe: %s\n", ma->init.mt_safe ? "yes" : "no");
+	fprintf(f, "  total-regions: %u\n", memarea_elem_list_num(ma));
+	fprintf(f, "  total-free-regions: %u\n", memarea_free_list_num(ma));
+	fprintf(f, "  alloc_fails: %" PRIu64 "\n", ma->alloc_fails);
+	fprintf(f, "  refcnt_check_fails: %" PRIu64 "\n", ma->refcnt_check_fails);
+	if (dump_all)
+		memarea_dump_all(ma, f);
+	memarea_unlock(ma);
+
+	return 0;
+}
diff a/lib/memarea/rte_memarea.h b/lib/memarea/rte_memarea.h	(rejected hunks)
@@ -194,6 +194,27 @@ void rte_memarea_free(struct rte_memarea *ma, void *ptr);
 __rte_experimental
 void rte_memarea_update_refcnt(struct rte_memarea *ma, void *ptr, int16_t value);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Dump memarea.
+ *
+ * Dump one memarea.
+ *
+ * @param ma
+ *   The pointer of memarea.
+ * @param f
+ *   The file to write the output to.
+ * @param dump_all
+ *   Indicate whether to dump the allocated and free memory objects information.
+ *
+ * @return
+ *   0 on success. Otherwise negative value is returned.
+ */
+__rte_experimental
+int rte_memarea_dump(struct rte_memarea *ma, FILE *f, bool dump_all);
+
 #ifdef __cplusplus
 }
 #endif
diff a/lib/memarea/version.map b/lib/memarea/version.map	(rejected hunks)
@@ -4,6 +4,7 @@ EXPERIMENTAL {
 	rte_memarea_alloc;
 	rte_memarea_create;
 	rte_memarea_destroy;
+	rte_memarea_dump;
 	rte_memarea_free;
 	rte_memarea_update_refcnt;
 
Checking patch doc/guides/prog_guide/memarea_lib.rst...
Checking patch lib/memarea/memarea_private.h...
error: while searching for:
	struct rte_memarea_param init;
	rte_spinlock_t           lock;
	void                    *area_addr;
	struct memarea_elem_list elem_list;
	struct memarea_elem_list free_list;

	uint64_t alloc_fails;
	uint64_t refcnt_check_fails;
} __rte_cache_aligned;

#endif /* MEMAREA_PRIVATE_H */

error: patch failed: lib/memarea/memarea_private.h:23
Checking patch lib/memarea/rte_memarea.c...
Hunk #1 succeeded at 128 (offset -4 lines).
error: while searching for:
	elem->size = align_size;
}

void *
rte_memarea_alloc(struct rte_memarea *ma, size_t size, uint32_t cookie)
{

error: patch failed: lib/memarea/rte_memarea.c:200
error: while searching for:
		ptr = (void *)((uintptr_t)elem + sizeof(struct memarea_elem));
		break;
	}
	if (unlikely(ptr == NULL))
		ma->alloc_fails++;
	memarea_unlock(ma);

error: patch failed: lib/memarea/rte_memarea.c:221
error: while searching for:
		return;

	memarea_lock(ma);
	if (unlikely(elem->refcnt <= 0 || elem->refcnt + value < 0)) {
		RTE_LOG(ERR, MEMAREA,
			"memarea: %s cookie: 0x%x curr refcnt: %d update refcnt: %d check fail!\n",

error: patch failed: lib/memarea/rte_memarea.c:283
error: while searching for:
	fprintf(f, "  algorithm: %s\n", memarea_alg_name(ma->init.alg));
	fprintf(f, "  total-size: 0x%zx\n", ma->init.total_sz);
	fprintf(f, "  mt-safe: %s\n", ma->init.mt_safe ? "yes" : "no");
	fprintf(f, "  total-regions: %u\n", memarea_elem_list_num(ma));
	fprintf(f, "  total-free-regions: %u\n", memarea_free_list_num(ma));
	fprintf(f, "  alloc_fails: %" PRIu64 "\n", ma->alloc_fails);
	fprintf(f, "  refcnt_check_fails: %" PRIu64 "\n", ma->refcnt_check_fails);
	if (dump_all)
		memarea_dump_all(ma, f);
	memarea_unlock(ma);

error: patch failed: lib/memarea/rte_memarea.c:373
Checking patch lib/memarea/rte_memarea.h...
Applied patch doc/guides/prog_guide/memarea_lib.rst cleanly.
Applying patch lib/memarea/memarea_private.h with 1 reject...
Rejected hunk #1.
Applying patch lib/memarea/rte_memarea.c with 4 rejects...
Hunk #1 applied cleanly.
Rejected hunk #2.
Rejected hunk #3.
Rejected hunk #4.
Rejected hunk #5.
Applied patch lib/memarea/rte_memarea.h cleanly.
diff a/lib/memarea/memarea_private.h b/lib/memarea/memarea_private.h	(rejected hunks)
@@ -23,11 +23,13 @@ struct rte_memarea {
 	struct rte_memarea_param init;
 	rte_spinlock_t           lock;
 	void                    *area_addr;
+	void                    *top_addr;
 	struct memarea_elem_list elem_list;
 	struct memarea_elem_list free_list;
 
 	uint64_t alloc_fails;
 	uint64_t refcnt_check_fails;
+	uint64_t bak_alloc_fails;
 } __rte_cache_aligned;
 
 #endif /* MEMAREA_PRIVATE_H */
diff a/lib/memarea/rte_memarea.c b/lib/memarea/rte_memarea.c	(rejected hunks)
@@ -200,6 +201,15 @@ memarea_add_node(struct rte_memarea *ma, struct memarea_elem *elem, size_t need_
 	elem->size = align_size;
 }
 
+static inline void *
+memarea_alloc_backup(struct rte_memarea *ma, size_t size, uint32_t cookie)
+{
+	void *ptr = rte_memarea_alloc(ma->init.bak_memarea, size, cookie);
+	if (unlikely(ptr == NULL))
+		ma->bak_alloc_fails++;
+	return ptr;
+}
+
 void *
 rte_memarea_alloc(struct rte_memarea *ma, size_t size, uint32_t cookie)
 {
@@ -221,6 +231,8 @@ rte_memarea_alloc(struct rte_memarea *ma, size_t size, uint32_t cookie)
 		ptr = (void *)((uintptr_t)elem + sizeof(struct memarea_elem));
 		break;
 	}
+	if (ptr == NULL && ma->init.bak_memarea != NULL)
+		ptr = memarea_alloc_backup(ma, size, cookie);
 	if (unlikely(ptr == NULL))
 		ma->alloc_fails++;
 	memarea_unlock(ma);
@@ -283,6 +295,12 @@ rte_memarea_update_refcnt(struct rte_memarea *ma, void *ptr, int16_t value)
 		return;
 
 	memarea_lock(ma);
+	if (ptr < ma->area_addr || ptr > ma->top_addr) {
+		rte_memarea_update_refcnt(ma->init.bak_memarea, ptr, value);
+		memarea_unlock(ma);
+		return;
+	}
+
 	if (unlikely(elem->refcnt <= 0 || elem->refcnt + value < 0)) {
 		RTE_LOG(ERR, MEMAREA,
 			"memarea: %s cookie: 0x%x curr refcnt: %d update refcnt: %d check fail!\n",
@@ -373,10 +391,14 @@ rte_memarea_dump(struct rte_memarea *ma, FILE *f, bool dump_all)
 	fprintf(f, "  algorithm: %s\n", memarea_alg_name(ma->init.alg));
 	fprintf(f, "  total-size: 0x%zx\n", ma->init.total_sz);
 	fprintf(f, "  mt-safe: %s\n", ma->init.mt_safe ? "yes" : "no");
+	if (ma->init.bak_memarea)
+		fprintf(f, "  backup-memarea-name: %s\n", ma->init.bak_memarea->init.name);
 	fprintf(f, "  total-regions: %u\n", memarea_elem_list_num(ma));
 	fprintf(f, "  total-free-regions: %u\n", memarea_free_list_num(ma));
 	fprintf(f, "  alloc_fails: %" PRIu64 "\n", ma->alloc_fails);
 	fprintf(f, "  refcnt_check_fails: %" PRIu64 "\n", ma->refcnt_check_fails);
+	if (ma->init.bak_memarea)
+		fprintf(f, "  backup_alloc_fails: %" PRIu64 "\n", ma->bak_alloc_fails);
 	if (dump_all)
 		memarea_dump_all(ma, f);
 	memarea_unlock(ma);
Checking patch lib/memarea/memarea_private.h...
Checking patch lib/memarea/rte_memarea.c...
error: lib/memarea/rte_memarea.c: does not match index
Applied patch lib/memarea/memarea_private.h cleanly.
Checking patch app/test/test_memarea.c...
Hunk #1 succeeded at 136 (offset -217 lines).
error: while searching for:
	MEMAREA_TEST_API_RUN(test_memarea_alloc_free);
	MEMAREA_TEST_API_RUN(test_memarea_dump);
	MEMAREA_TEST_API_RUN(test_memarea_backup);
	return 0;
}


error: patch failed: app/test/test_memarea.c:363
Applying patch app/test/test_memarea.c with 1 reject...
Hunk #1 applied cleanly.
Rejected hunk #2.
diff a/app/test/test_memarea.c b/app/test/test_memarea.c	(rejected hunks)
@@ -363,6 +392,7 @@ test_memarea(void)
 	MEMAREA_TEST_API_RUN(test_memarea_alloc_free);
 	MEMAREA_TEST_API_RUN(test_memarea_dump);
 	MEMAREA_TEST_API_RUN(test_memarea_backup);
+	MEMAREA_TEST_API_RUN(test_memarea_no_mt_safe);
 	return 0;
 }
 

https://lab.dpdk.org/results/dashboard/patchsets/23614/

UNH-IOL DPDK Community Lab

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-24  8:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-24  8:39 |WARNING| pw116808-116809 [PATCH] [v3, 10/10] test/memarea: support no MT-safe test dpdklab

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).