[Pkg-ofed-commits] [libfabric] 76/123: prov/psm: check more fields of the hints passed to fi_getinfo

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Sat Oct 22 12:28:32 UTC 2016


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to annotated tag v1.1.1
in repository libfabric.

commit c4256a5fb563081fe11a6cb385a4651b769518ed
Author: Jianxin Xiong <jianxin.xiong at intel.com>
Date:   Wed Sep 16 12:12:51 2015 -0700

    prov/psm: check more fields of the hints passed to fi_getinfo
    
    Check the threading, progress, ordering, iov limit, and inject
    size requirements.
    
    Signed-off-by: Jianxin Xiong <jianxin.xiong at intel.com>
---
 prov/psm/src/psmx.h      |   2 +
 prov/psm/src/psmx_init.c | 117 +++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 115 insertions(+), 4 deletions(-)

diff --git a/prov/psm/src/psmx.h b/prov/psm/src/psmx.h
index 0a298fe..b2734d2 100644
--- a/prov/psm/src/psmx.h
+++ b/prov/psm/src/psmx.h
@@ -77,6 +77,8 @@ extern struct fi_provider psmx_prov;
 
 #define PSMX_MAX_MSG_SIZE	((0x1ULL << 32) - 1)
 #define PSMX_INJECT_SIZE	(64)
+#define PSMX_MSG_ORDER	FI_ORDER_SAS
+#define PSMX_COMP_ORDER	FI_ORDER_NONE
 
 #define PSMX_MSG_BIT	(0x1ULL << 63)
 #define PSMX_RMA_BIT	(0x1ULL << 62)
diff --git a/prov/psm/src/psmx_init.c b/prov/psm/src/psmx_init.c
index 05d22c3..9746040 100644
--- a/prov/psm/src/psmx_init.c
+++ b/prov/psm/src/psmx_init.c
@@ -287,6 +287,43 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
 					FI_MR_SCALABLE);
 				goto err_out;
 			}
+
+			switch (hints->domain_attr->threading) {
+			case FI_THREAD_UNSPEC:
+			case FI_THREAD_COMPLETION:
+			case FI_THREAD_DOMAIN:
+				break;
+			default:
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->domain_attr->threading=%d, supported=%d %d %d\n",
+					hints->domain_attr->threading, FI_THREAD_UNSPEC,
+					FI_THREAD_COMPLETION, FI_THREAD_DOMAIN);
+				goto err_out;
+			}
+
+			switch (hints->domain_attr->control_progress) {
+			case FI_PROGRESS_UNSPEC:
+			case FI_PROGRESS_MANUAL:
+				break;
+			default:
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->domain_attr->control_progress=%d, supported=%d %d\n",
+					hints->domain_attr->control_progress, FI_PROGRESS_UNSPEC,
+					FI_PROGRESS_MANUAL);
+				goto err_out;
+			}
+
+			switch (hints->domain_attr->data_progress) {
+			case FI_PROGRESS_UNSPEC:
+			case FI_PROGRESS_MANUAL:
+				break;
+			default:
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->domain_attr->data_progress=%d, supported=%d %d\n",
+					hints->domain_attr->data_progress, FI_PROGRESS_UNSPEC,
+					FI_PROGRESS_MANUAL);
+				goto err_out;
+			}
 		}
 
 		if (hints->ep_attr) {
@@ -301,6 +338,77 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
 			max_tag_value = fi_tag_bits(hints->ep_attr->mem_tag_format);
 		}
 
+		if (hints->tx_attr) {
+			if ((hints->tx_attr->msg_order & PSMX_MSG_ORDER) !=
+			    hints->tx_attr->msg_order) {
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->tx_attr->msg_order=%lx,"
+					"supported=%lx.\n",
+					hints->tx_attr->msg_order,
+					PSMX_MSG_ORDER);
+				goto err_out;
+			}
+			if ((hints->tx_attr->comp_order & PSMX_COMP_ORDER) !=
+			    hints->tx_attr->comp_order) {
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->tx_attr->msg_order=%lx,"
+					"supported=%lx.\n",
+					hints->tx_attr->comp_order,
+					PSMX_COMP_ORDER);
+				goto err_out;
+			}
+			if (hints->tx_attr->inject_size > PSMX_INJECT_SIZE) {
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->tx_attr->inject_size=%ld,"
+					"supported=%d.\n",
+					hints->tx_attr->inject_size,
+					PSMX_INJECT_SIZE);
+				goto err_out;
+			}
+			if (hints->tx_attr->iov_limit > 1) {
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->tx_attr->iov_limit=%ld,"
+					"supported=1.\n",
+					hints->tx_attr->iov_limit);
+				goto err_out;
+			}
+			if (hints->tx_attr->rma_iov_limit > 1) {
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->tx_attr->rma_iov_limit=%ld,"
+					"supported=1.\n",
+					hints->tx_attr->rma_iov_limit);
+				goto err_out;
+			}
+		}
+
+		if (hints->rx_attr) {
+			if ((hints->rx_attr->msg_order & PSMX_MSG_ORDER) !=
+			    hints->rx_attr->msg_order) {
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->rx_attr->msg_order=%lx,"
+					"supported=%lx.\n",
+					hints->rx_attr->msg_order,
+					PSMX_MSG_ORDER);
+				goto err_out;
+			}
+			if ((hints->rx_attr->comp_order & PSMX_COMP_ORDER) !=
+			    hints->rx_attr->comp_order) {
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->rx_attr->msg_order=%lx,"
+					"supported=%lx.\n",
+					hints->rx_attr->comp_order,
+					PSMX_COMP_ORDER);
+				goto err_out;
+			}
+			if (hints->rx_attr->iov_limit > 1) {
+				FI_INFO(&psmx_prov, FI_LOG_CORE,
+					"hints->rx_attr->iov_limit=%ld,"
+					"supported=1.\n",
+					hints->rx_attr->iov_limit);
+				goto err_out;
+			}
+		}
+
 		caps = hints->caps;
 
 		/* TODO: check other fields of hints */
@@ -356,18 +464,19 @@ static int psmx_getinfo(uint32_t version, const char *node, const char *service,
 	psmx_info->tx_attr->mode = psmx_info->mode;
 	psmx_info->tx_attr->op_flags = (hints && hints->tx_attr && hints->tx_attr->op_flags)
 					? hints->tx_attr->op_flags : 0;
-	psmx_info->tx_attr->msg_order = FI_ORDER_SAS;
-	psmx_info->tx_attr->comp_order = FI_ORDER_NONE;
+	psmx_info->tx_attr->msg_order = PSMX_MSG_ORDER;
+	psmx_info->tx_attr->comp_order = PSMX_COMP_ORDER;
 	psmx_info->tx_attr->inject_size = PSMX_INJECT_SIZE;
 	psmx_info->tx_attr->size = UINT64_MAX;
 	psmx_info->tx_attr->iov_limit = 1;
+	psmx_info->tx_attr->rma_iov_limit = 1;
 
 	psmx_info->rx_attr->caps = psmx_info->caps;
 	psmx_info->rx_attr->mode = psmx_info->mode;
 	psmx_info->rx_attr->op_flags = (hints && hints->rx_attr && hints->rx_attr->op_flags)
 					? hints->rx_attr->op_flags : 0;
-	psmx_info->rx_attr->msg_order = FI_ORDER_SAS;
-	psmx_info->rx_attr->comp_order = FI_ORDER_NONE;
+	psmx_info->rx_attr->msg_order = PSMX_MSG_ORDER;
+	psmx_info->rx_attr->comp_order = PSMX_COMP_ORDER;
 	psmx_info->rx_attr->total_buffered_recv = ~(0ULL); /* that's how PSM handles it internally! */
 	psmx_info->rx_attr->size = UINT64_MAX;
 	psmx_info->rx_attr->iov_limit = 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/libfabric.git



More information about the Pkg-ofed-commits mailing list