Project

General

Profile

Bug #6601

Various GLD drivers return EINVAL instead of ENOTSUP for unused mac_prop_id_t's

Added by Dale Ghent over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
networking
Start date:
2016-02-03
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

There are a few drivers which errantly return EINVAL instead of ENOTSUP in their *_m_getprop() and *_m_setprop() GLD callbacks. While this doesn't break anything functionally, this does have at least one visible side effect in, for example, `dladm show-linkprop` output where unused properties will feature a ? in their disposition fields rather than an expected --, and if selecting a specific property to fetch with dladm show-linkprop -p <propery> you will also receive a warning: dladm: warning: cannot get link property 'en_40gfdx_cap' for igb0: invalid argument

For example, the igb driver is one such driver which does this:

[daleg@devohat]~$ dladm show-linkprop -p en_40gfdx_cap igb0 
LINK         PROPERTY        PERM VALUE          DEFAULT        POSSIBLE
dladm: warning: cannot get link property 'en_40gfdx_cap' for igb0: invalid argument
igb0         en_40gfdx_cap   ?    ?              0              1,0

Versus the e1000g driver, which correctly returns ENOTSUP for properties it doesn't care about:

[daleg@bloody]~$ dladm show-linkprop -p en_40gfdx_cap e1000g0
LINK         PROPERTY        PERM VALUE          DEFAULT        POSSIBLE
e1000g0      en_40gfdx_cap   --   --             0              1,0

Setting link properties also befalls the same issue w.r.t. EINVAL vs. ENOTSUP:

Returning EINVAL:

root@devohat:/root# dladm set-linkprop -p en_40gfdx_cap=1 igb0   
dladm: warning: cannot set link property 'en_40gfdx_cap' on 'igb0': invalid argument

Vs. returning ENOTSUP:

[root@r151016]~# dladm set-linkprop -p en_40gfdx_cap=1 e1000g0
dladm: warning: invalid link property 'en_40gfdx_cap'

So far, I've spotted the following drivers which errantly return EINVAL instead of ENOTSUP in either _getprop, _setprop, or both:
igb
ixgbe
hxge

There may be others; as this was not an exhaustive search.

History

#2

Updated by Electric Monk over 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 238d8f47d92b5b99a374f9639e0704420d3aef77

commit  238d8f47d92b5b99a374f9639e0704420d3aef77
Author: Dale Ghent <daleg@omniti.com>
Date:   2016-02-05T20:22:06.000Z

    6601 Various GLD drivers return EINVAL instead of ENOTSUP for unused mac_prop_id_t's
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF