diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-09-26 18:35:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-02 01:49:30 -0400 |
commit | 97ea8ac360c233e6454bfe6510e7b827a57008af (patch) | |
tree | 9a36ede5e107787e8330388e6893b8ecd0d70365 | |
parent | ea43a5907f6668ca4e698f7b5c341014c9bb0be6 (diff) |
nfp: warn on experimental TLV types
Reserve two TLV types for feature development, and warn in the driver
if they ever leak into production.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c index 1f9149bb2ae6..2190836eaa1d 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c | |||
@@ -113,6 +113,13 @@ int nfp_net_tlv_caps_parse(struct device *dev, u8 __iomem *ctrl_mem, | |||
113 | caps->mbox_len = length; | 113 | caps->mbox_len = length; |
114 | } | 114 | } |
115 | break; | 115 | break; |
116 | case NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL0: | ||
117 | case NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL1: | ||
118 | dev_warn(dev, | ||
119 | "experimental TLV type:%u offset:%u len:%u\n", | ||
120 | FIELD_GET(NFP_NET_CFG_TLV_HEADER_TYPE, hdr), | ||
121 | offset, length); | ||
122 | break; | ||
116 | default: | 123 | default: |
117 | if (!FIELD_GET(NFP_NET_CFG_TLV_HEADER_REQUIRED, hdr)) | 124 | if (!FIELD_GET(NFP_NET_CFG_TLV_HEADER_REQUIRED, hdr)) |
118 | break; | 125 | break; |
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h index 44d3ea75d043..a51490747689 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h | |||
@@ -489,12 +489,20 @@ | |||
489 | * %NFP_NET_CFG_TLV_TYPE_MBOX: | 489 | * %NFP_NET_CFG_TLV_TYPE_MBOX: |
490 | * Variable, mailbox area. Overwrites the default location which is | 490 | * Variable, mailbox area. Overwrites the default location which is |
491 | * %NFP_NET_CFG_MBOX_BASE and length %NFP_NET_CFG_MBOX_VAL_MAX_SZ. | 491 | * %NFP_NET_CFG_MBOX_BASE and length %NFP_NET_CFG_MBOX_VAL_MAX_SZ. |
492 | * | ||
493 | * %NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL0: | ||
494 | * %NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL1: | ||
495 | * Variable, experimental IDs. IDs designated for internal development and | ||
496 | * experiments before a stable TLV ID has been allocated to a feature. Should | ||
497 | * never be present in production firmware. | ||
492 | */ | 498 | */ |
493 | #define NFP_NET_CFG_TLV_TYPE_UNKNOWN 0 | 499 | #define NFP_NET_CFG_TLV_TYPE_UNKNOWN 0 |
494 | #define NFP_NET_CFG_TLV_TYPE_RESERVED 1 | 500 | #define NFP_NET_CFG_TLV_TYPE_RESERVED 1 |
495 | #define NFP_NET_CFG_TLV_TYPE_END 2 | 501 | #define NFP_NET_CFG_TLV_TYPE_END 2 |
496 | #define NFP_NET_CFG_TLV_TYPE_ME_FREQ 3 | 502 | #define NFP_NET_CFG_TLV_TYPE_ME_FREQ 3 |
497 | #define NFP_NET_CFG_TLV_TYPE_MBOX 4 | 503 | #define NFP_NET_CFG_TLV_TYPE_MBOX 4 |
504 | #define NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL0 5 | ||
505 | #define NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL1 6 | ||
498 | 506 | ||
499 | struct device; | 507 | struct device; |
500 | 508 | ||