All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Swapna Thete <swapna.thete-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
Cc: "roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Jack Morgenstein <jackm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH 2/2] IB/mad: Return unsupported for MADs as appropriate
Date: Fri, 20 Jan 2012 08:56:52 -0500	[thread overview]
Message-ID: <4F1972A4.5090303@dev.mellanox.co.il> (raw)
In-Reply-To: <4C2744E8AD2982428C5BFE523DF8CDCB5CD590F82C-amwN6d8PyQWXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>

On 1/20/2012 7:12 AM, Swapna Thete wrote:
> Thank you all for your suggestions.
> However, I just wanted to understand that given this code is for the
> case of an entire class not supported, 

There's more than just "class not supported" which gets to that point in
the MAD code flow. For example, SMInfo can and that is more appropriate
as "method/attribute not supported" rather than "class not supported".
The one example cited so far is SMInfo is part of SM class and that is
required to be supported by SMA in every node.

> isn't this error code
> IB_MGMT_MAD_STATUS_BAD_VERSION (MAD returned with Bad Status: Unsupported Class or Version) more appropriate? Also this is
> Part of IB spec error codes.

Yes, class not supported is indicated by this code.

We can either choose to discern which case it is and return the correct
error code (preferable if not too much overhead) or pick one of the two
(in the case where it's an incoming get/set). If we pick one, which one
causes less confusion when it comes to answering why that MAD status was
returned ? I don't think it would/should cause any behavioral difference
as any bad MAD status is/should be treated as an error.

-- Hal

> Also I did not make any changes to the handling of SMA Get(SmInfo
> attribute). Let me know if I am missing something.
> 
> Thanks,
> Swapna
> -----Original Message-----
> From: Hal Rosenstock [mailto:hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org]
> Sent: Thursday, January 19, 2012 6:28 PM
> To: Swapna Thete
> Cc: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Jack Morgenstein
> Subject: Re: [PATCH 2/2] IB/mad: Return unsupported for MADs as appropriate
> 
> On 1/18/2012 5:30 PM, Hal Rosenstock wrote:
>> On 1/18/2012 3:43 AM, Swapna Thete wrote:
>>> Setup a response with appropriate error status and
>>> send it for the MADs that are not supported by a
>>> specific class/version.
>>> Signed-off-by: Swapna Thete <swapna.thete-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
>>> ---
>>>  drivers/infiniband/core/mad.c |   10 ++++++++++
>>>  1 files changed, 10 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
>>> index 2fe428b..734d846 100644
>>> --- a/drivers/infiniband/core/mad.c
>>> +++ b/drivers/infiniband/core/mad.c
>>> @@ -1963,6 +1963,16 @@ local:
>>>               * or via recv_handler in ib_mad_complete_recv()
>>>               */
>>>              recv = NULL;
>>> +    } else {
>>> +            memcpy(response, recv, sizeof(*response));
>>
>> Isn't this overkill as the bad MAD status precludes looking at the MAD
>> data ?
>>
>>> +            response->header.recv_wc.wc = &response->header.wc;
>>> +            response->header.recv_wc.recv_buf.mad = &response->mad.mad;
>>> +            response->header.recv_wc.recv_buf.grh = &response->grh;
>>> +            response->mad.mad.mad_hdr.method = IB_MGMT_METHOD_GET_RESP;
>>> +            response->mad.mad.mad_hdr.status =
>>> +                            __be16_to_cpu(IB_MGMT_MAD_STATUS_BAD_VERSION);
>>
>> While this is the best status for class not supported, that's not all
>> the cases that get to here. Attribute not supported (in a supported
>> class) could also occur here for which unsupported method/attribute
>> combination is more appropriate as a MAD status. I'm not sure it's worth
>> the effort to discern that (as any invalid MAD status is treated the
>> same) but I think it could be done if we want to be more precise about
>> the error.
> 
> The other alternative is to just return method/attribute combination not
> supported (STATUS_FIELD[4:2] = 0x3 (MAD status 0xc)) for all this as
> Jack and Or have indicated. FWIW that's my preference.
> 
> -- Hal
> 
>>
>> -- Hal
>>
>>> +            agent_send_response(&response->mad.mad, &recv->grh, wc,
>>> +                    port_priv->device, port_num, qp_info->qp->qp_num);
>>>      }
>>>
>>>  out:
>>>
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>
> 
> 
> 
> This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-01-20 13:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18  8:42 [PATCH 0/2] Setup response for MADs as appropriate Swapna Thete
     [not found] ` <20120118084255.18560.40844.stgit-hIFRcJ1SNwcXGO8/Qfapyjg/wwJxntczYPYVAmT7z5s@public.gmane.org>
2012-01-18  8:43   ` [PATCH 1/2] IB/mad: Add MAD error codes per IBTA spec Swapna Thete
2012-01-18  8:43   ` [PATCH 2/2] IB/mad: Return unsupported for MADs as appropriate Swapna Thete
     [not found]     ` <20120118084311.18560.22509.stgit-hIFRcJ1SNwcXGO8/Qfapyjg/wwJxntczYPYVAmT7z5s@public.gmane.org>
2012-01-18 10:04       ` Or Gerlitz
     [not found]         ` <4F169940.5090007-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-01-18 10:14           ` Swapna Thete
     [not found]             ` <4C2744E8AD2982428C5BFE523DF8CDCB5CD590F65E-amwN6d8PyQWXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
2012-01-18 16:52               ` Roland Dreier
     [not found]                 ` <CAL1RGDUh1AEMdok69RJP1cTchvCW7C7HJFTmYm=kUNu7hWA_5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-18 17:20                   ` Hefty, Sean
     [not found]                     ` <1828884A29C6694DAF28B7E6B8A823732DC00DEE-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-18 18:56                       ` Jason Gunthorpe
     [not found]                         ` <20120118185620.GJ2892-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-01-19  8:13                           ` Jack Morgenstein
2012-01-18 18:06       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A823732DC03E16-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-18 19:02           ` Jason Gunthorpe
     [not found]             ` <20120118190214.GK2892-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-01-18 19:06               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A823732DC04EDB-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-18 19:50                   ` Jason Gunthorpe
2012-01-18 19:30               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A823732DC04EFB-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-18 21:19                   ` Jason Gunthorpe
     [not found]                     ` <20120118211916.GM2892-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-01-19 12:34                       ` Swapna Thete
2012-01-19 12:35           ` Swapna Thete
2012-01-18 22:30       ` Hal Rosenstock
     [not found]         ` <4F1747F2.3020308-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-01-19 12:58           ` Hal Rosenstock
     [not found]             ` <4F181361.4050505-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-01-20 12:12               ` Swapna Thete
     [not found]                 ` <4C2744E8AD2982428C5BFE523DF8CDCB5CD590F82C-amwN6d8PyQWXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
2012-01-20 13:56                   ` Hal Rosenstock [this message]
2012-01-20 15:27                   ` Hefty, Sean
     [not found]                     ` <1828884A29C6694DAF28B7E6B8A823732DC0E524-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-20 20:07                       ` Hal Rosenstock
2012-01-24 12:32                       ` Swapna Thete
  -- strict thread matches above, loose matches on Subject: below --
2012-01-31  8:11 [PATCH 0/2] Setup response " Swapna Thete
     [not found] ` <20120131081138.9009.33668.stgit-hIFRcJ1SNwcXGO8/Qfapyjg/wwJxntczYPYVAmT7z5s@public.gmane.org>
2012-01-31  8:11   ` [PATCH 2/2] IB/mad: Return unsupported " Swapna Thete
     [not found]     ` <20120131081153.9009.16378.stgit-hIFRcJ1SNwcXGO8/Qfapyjg/wwJxntczYPYVAmT7z5s@public.gmane.org>
2012-01-31 14:58       ` Hal Rosenstock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F1972A4.5090303@dev.mellanox.co.il \
    --to=hal-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=jackm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=swapna.thete-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.