Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QP create issues on asymetrically reported QP sizes #5

Open
idbar opened this issue Nov 21, 2019 · 3 comments
Open

QP create issues on asymetrically reported QP sizes #5

idbar opened this issue Nov 21, 2019 · 3 comments

Comments

@idbar
Copy link

idbar commented Nov 21, 2019

Hi,

Some of the sample applications seem to assume that the reported RQ size is always greater or equal than SQ size. This is not required. The call to create QP uses the same value for RQ and SQ.
Coming from min(maxCQ, maxRQ), which may fail if SQ turned out to be reported in adapter info as smaller than maxCQ and maxRQ.

Please find below a potential fix for ndping.
Thanks.

Fix to asymetrically reported QP sizes

  This patch incorporates the Initiator queue depth reported through
  AdapterInfo.

  When reported sizes for SQ are smaller than RQ, createQP uses
  min(CQDepth,RQDepth) for both SQ and RQ causing QP creation errors.

diff --git a/src/examples/ndping/ndping.cpp b/src/examples/ndping/ndping.cpp
index 8a08a12..deac1fb 100644
--- a/src/examples/ndping/ndping.cpp
+++ b/src/examples/ndping/ndping.cpp
@@ -62,7 +62,8 @@ public:

       ND2_ADAPTER_INFO adapterInfo = { 0 };
       NdTestBase::GetAdapterInfo(&adapterInfo);
-        m_queueDepth = min(adapterInfo.MaxCompletionQueueDepth, adapterInfo.MaxReceiveQueueDepth);
+        m_queueDepth = min(adapterInfo.MaxReceiveQueueDepth, adapterInfo.MaxInitiatorQueueDepth);
+        m_queueDepth = min(m_queueDepth, adapterInfo.MaxCompletionQueueDepth);
       m_queueDepth = (queueDepth != 0) ? min(queueDepth, m_queueDepth) : m_queueDepth;
       m_inlineSizeThreshold = adapterInfo.InlineRequestThreshold;

@@ -195,7 +196,8 @@ public:

       ND2_ADAPTER_INFO adapterInfo;
       NdTestBase::GetAdapterInfo(&adapterInfo);
-        m_queueDepth = min(adapterInfo.MaxCompletionQueueDepth, adapterInfo.MaxInitiatorQueueDepth);
+        m_queueDepth = min(adapterInfo.MaxReceiveQueueDepth, adapterInfo.MaxInitiatorQueueDepth);
+        m_queueDepth = min(m_queueDepth, adapterInfo.MaxCompletionQueueDepth);
       m_queueDepth = (queueDepth != 0) ? min(queueDepth, m_queueDepth) : m_queueDepth;
       m_inlineSizeThreshold = adapterInfo.InlineRequestThreshold;


@jithinjosepkl
Copy link
Contributor

Thanks for reporting this, @idbar . Do you mind submitting a PR with this?

@idbar
Copy link
Author

idbar commented Dec 6, 2019

Sure, @jithinjosepkl. Let me prepare a more complete patch and I'll submit it as soon as I have it. Thanks.

@MrDavid949
Copy link

This issue is fixed in my fork:
https://github.com/MrDavid949/NetworkDirect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants