aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-05-23 10:43:35 +0200
committerDavid S. Miller <davem@davemloft.net>2019-05-23 09:18:43 -0700
commit136bf27fc0e9376525b9b6d9a1aa08508a0d1ac2 (patch)
tree2b0252bae47159bb0641b855f377064b0ec7a8d8 /include
parenthv_sock: perf: loop in send() to maximize bandwidth (diff)
downloadlinux-dev-136bf27fc0e9376525b9b6d9a1aa08508a0d1ac2.tar.xz
linux-dev-136bf27fc0e9376525b9b6d9a1aa08508a0d1ac2.zip
devlink: add warning in case driver does not set port type
Prevent misbehavior of drivers who would not set port type for longer period of time. Drivers should always set port type. Do WARN if that happens. Note that it is perfectly fine to temporarily not have the type set, during initialization and port type change. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/devlink.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 1c4adfb4195a..151eb930d329 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -17,6 +17,7 @@
#include <linux/list.h>
#include <linux/netdevice.h>
#include <linux/spinlock.h>
+#include <linux/workqueue.h>
#include <net/net_namespace.h>
#include <uapi/linux/devlink.h>
@@ -64,6 +65,7 @@ struct devlink_port {
enum devlink_port_type desired_type;
void *type_dev;
struct devlink_port_attrs attrs;
+ struct delayed_work type_warn_dw;
};
struct devlink_sb_pool_info {