From: Ido Schimmel <idosch@nvidia.com>
In CMIS, unlike SFF-8636, there is no presence indication for the CLEI
code (Common Language Equipment Identification) field. The field is
always present, but might not be supported. In which case, "a value of
all ASCII 20h (spaces) shall be entered".
Therefore, remove the erroneous check which seems to be influenced from
SFF-8636 and only print the string if it is supported and has a non-zero
length.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 8 +++++---
cmis.h | 3 +--
2 files changed, 6 insertions(+), 5 deletions(-)
From: Ido Schimmel <idosch@nvidia.com>
The file is concerned with CMIS support, not QSFP-DD which is the
physical form factor.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -64,7 +64,7 @@staticstructsff8636_aw_flags{constchar*str;/* Human-readable string, null at the end */-intoffset;/* A2-relative address offset */+intoffset;__u8value;/* Alarm is on if (offset & value) != 0. */}sff8636_aw_flags[]={{"Laser bias current high alarm (Chan 1)",
From: Ido Schimmel <idosch@nvidia.com>
The indentation is wrong and the statement can be more clearly
represented using a switch-case statement. Convert it.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
qsfp.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
From: Michal Kubecek <hidden> Date: 2021-09-30 20:21:39
On Fri, Sep 17, 2021 at 05:40:37PM +0300, Ido Schimmel wrote:
quoted hunk
From: Ido Schimmel <idosch@nvidia.com>
In CMIS, unlike SFF-8636, there is no presence indication for the CLEI
code (Common Language Equipment Identification) field. The field is
always present, but might not be supported. In which case, "a value of
all ASCII 20h (spaces) shall be entered".
Therefore, remove the erroneous check which seems to be influenced from
SFF-8636 and only print the string if it is supported and has a non-zero
length.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 8 +++++---
cmis.h | 3 +--
2 files changed, 6 insertions(+), 5 deletions(-)
Is it safe to assume that the string will be always null terminated?
Looking at the code below, CMIS_CLEI_BLANK consists of 10 spaces which
would fill the whole block at offsets 0xBE through 0xC7 with spaces and
offset 0xC8 is used as CMIS_PWR_CLASS_OFFSET. Also, sff_show_ascii()
doesn't seem to expect a null terminated string, rather a space padded
one.
Michal
On Thu, Sep 30, 2021 at 10:21:33PM +0200, Michal Kubecek wrote:
On Fri, Sep 17, 2021 at 05:40:37PM +0300, Ido Schimmel wrote:
quoted
From: Ido Schimmel <idosch@nvidia.com>
In CMIS, unlike SFF-8636, there is no presence indication for the CLEI
code (Common Language Equipment Identification) field. The field is
always present, but might not be supported. In which case, "a value of
all ASCII 20h (spaces) shall be entered".
Therefore, remove the erroneous check which seems to be influenced from
SFF-8636 and only print the string if it is supported and has a non-zero
length.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 8 +++++---
cmis.h | 3 +--
2 files changed, 6 insertions(+), 5 deletions(-)
Is it safe to assume that the string will be always null terminated?
No. You want to see strnlen() and strncmp() instead?
Looking at the code below, CMIS_CLEI_BLANK consists of 10 spaces which
would fill the whole block at offsets 0xBE through 0xC7 with spaces and
offset 0xC8 is used as CMIS_PWR_CLASS_OFFSET. Also, sff_show_ascii()
doesn't seem to expect a null terminated string, rather a space padded
one.
Michal
From: Michal Kubecek <hidden> Date: 2021-09-30 21:12:09
On Thu, Sep 30, 2021 at 11:41:02PM +0300, Ido Schimmel wrote:
On Thu, Sep 30, 2021 at 10:21:33PM +0200, Michal Kubecek wrote:
quoted
On Fri, Sep 17, 2021 at 05:40:37PM +0300, Ido Schimmel wrote:
quoted
From: Ido Schimmel <idosch@nvidia.com>
In CMIS, unlike SFF-8636, there is no presence indication for the CLEI
code (Common Language Equipment Identification) field. The field is
always present, but might not be supported. In which case, "a value of
all ASCII 20h (spaces) shall be entered".
Therefore, remove the erroneous check which seems to be influenced from
SFF-8636 and only print the string if it is supported and has a non-zero
length.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
cmis.c | 8 +++++---
cmis.h | 3 +--
2 files changed, 6 insertions(+), 5 deletions(-)
Is it safe to assume that the string will be always null terminated?
No. You want to see strnlen() and strncmp() instead?
Yes, that would solve the problem. Actually, "strlen(clei)" could be
also replaced with "*clei" or "clei[0]" as a string is empty if and only
if its first byte is null.
Michal
quoted
Looking at the code below, CMIS_CLEI_BLANK consists of 10 spaces which
would fill the whole block at offsets 0xBE through 0xC7 with spaces and
offset 0xC8 is used as CMIS_PWR_CLASS_OFFSET. Also, sff_show_ascii()
doesn't seem to expect a null terminated string, rather a space padded
one.