Send ETHTOOL_MSG_DEBUG_NTF notification message whenever debugging message mask for a device are modified using ETHTOOL_MSG_DEBUG_SET netlink message or ETHTOOL_SMSGLVL ioctl request. The notification message has the same format as reply to DEBUG_GET request. As with other ethtool notifications, netlink requests only trigger the notification if the mask is actually changed while ioctl request trigger it whenever the request results in calling the ethtool_ops handler.
Unified · Split
| @@ -199,6 +199,7 @@ Kernel to userspace: · 198 unmodified lines | |||
| 199 | ``ETHTOOL_MSG_LINKMODES_NTF`` link modes notification | 199 | ``ETHTOOL_MSG_LINKMODES_NTF`` link modes notification |
| 200 | ``ETHTOOL_MSG_LINKSTATE_GET_REPLY`` link state info | 200 | ``ETHTOOL_MSG_LINKSTATE_GET_REPLY`` link state info |
| 201 | ``ETHTOOL_MSG_DEBUG_GET_REPLY`` debugging settings | 201 | ``ETHTOOL_MSG_DEBUG_GET_REPLY`` debugging settings |
| 202 | ``ETHTOOL_MSG_DEBUG_NTF`` debugging settings notification | ||
| 202 | ===================================== ================================ | 203 | ===================================== ================================ |
| 203 | 204 | ||
| 204 | ``GET`` requests are sent by userspace applications to retrieve device | 205 | ``GET`` requests are sent by userspace applications to retrieve device |
| @@ -38,6 +38,7 @@ enum { · 37 unmodified lines | |||
| 38 | ETHTOOL_MSG_LINKMODES_NTF, | 38 | ETHTOOL_MSG_LINKMODES_NTF, |
| 39 | ETHTOOL_MSG_LINKSTATE_GET_REPLY, | 39 | ETHTOOL_MSG_LINKSTATE_GET_REPLY, |
| 40 | ETHTOOL_MSG_DEBUG_GET_REPLY, | 40 | ETHTOOL_MSG_DEBUG_GET_REPLY, |
| 41 | ETHTOOL_MSG_DEBUG_NTF, | ||
| 41 | 42 | ||
| 42 | /* add new constants above here */ | 43 | /* add new constants above here */ |
| 43 | __ETHTOOL_MSG_KERNEL_CNT, | 44 | __ETHTOOL_MSG_KERNEL_CNT, |
| @@ -123,6 +123,7 @@ int ethnl_set_debug(struct sk_buff *skb, struct genl_info *info) · 122 unmodified lines | |||
| 123 | goto out_ops; | 123 | goto out_ops; |
| 124 | 124 | ||
| 125 | dev->ethtool_ops->set_msglevel(dev, msg_mask); | 125 | dev->ethtool_ops->set_msglevel(dev, msg_mask); |
| 126 | ethtool_notify(dev, ETHTOOL_MSG_DEBUG_NTF, NULL); | ||
| 126 | 127 | ||
| 127 | out_ops: | 128 | out_ops: |
| 128 | ethnl_ops_complete(dev); | 129 | ethnl_ops_complete(dev); |
| @@ -2545,6 +2545,8 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) · 2544 unmodified lines | |||
| 2545 | case ETHTOOL_SMSGLVL: | 2545 | case ETHTOOL_SMSGLVL: |
| 2546 | rc = ethtool_set_value_void(dev, useraddr, | 2546 | rc = ethtool_set_value_void(dev, useraddr, |
| 2547 | dev->ethtool_ops->set_msglevel); | 2547 | dev->ethtool_ops->set_msglevel); |
| 2548 | if (!rc) | ||
| 2549 | ethtool_notify(dev, ETHTOOL_MSG_DEBUG_NTF, NULL); | ||
| 2548 | break; | 2550 | break; |
| 2549 | case ETHTOOL_GEEE: | 2551 | case ETHTOOL_GEEE: |
| 2550 | rc = ethtool_get_eee(dev, useraddr); | 2552 | rc = ethtool_get_eee(dev, useraddr); |
| @@ -524,6 +524,7 @@ static const struct ethnl_request_ops * · 523 unmodified lines | |||
| 524 | ethnl_default_notify_ops[ETHTOOL_MSG_KERNEL_MAX + 1] = { | 524 | ethnl_default_notify_ops[ETHTOOL_MSG_KERNEL_MAX + 1] = { |
| 525 | [ETHTOOL_MSG_LINKINFO_NTF] = ðnl_linkinfo_request_ops, | 525 | [ETHTOOL_MSG_LINKINFO_NTF] = ðnl_linkinfo_request_ops, |
| 526 | [ETHTOOL_MSG_LINKMODES_NTF] = ðnl_linkmodes_request_ops, | 526 | [ETHTOOL_MSG_LINKMODES_NTF] = ðnl_linkmodes_request_ops, |
| 527 | [ETHTOOL_MSG_DEBUG_NTF] = ðnl_debug_request_ops, | ||
| 527 | }; | 528 | }; |
| 528 | 529 | ||
| 529 | /* default notification handler */ | 530 | /* default notification handler */ |
| @@ -607,6 +608,7 @@ typedef void (*ethnl_notify_handler_t)(struct net_device *dev, unsigned int cmd, · 77 unmodified lines | |||
| 607 | static const ethnl_notify_handler_t ethnl_notify_handlers[] = { | 608 | static const ethnl_notify_handler_t ethnl_notify_handlers[] = { |
| 608 | [ETHTOOL_MSG_LINKINFO_NTF] = ethnl_default_notify, | 609 | [ETHTOOL_MSG_LINKINFO_NTF] = ethnl_default_notify, |
| 609 | [ETHTOOL_MSG_LINKMODES_NTF] = ethnl_default_notify, | 610 | [ETHTOOL_MSG_LINKMODES_NTF] = ethnl_default_notify, |
| 611 | [ETHTOOL_MSG_DEBUG_NTF] = ethnl_default_notify, | ||
| 610 | }; | 612 | }; |
| 611 | 613 | ||
| 612 | void ethtool_notify(struct net_device *dev, unsigned int cmd, const void *data) | 614 | void ethtool_notify(struct net_device *dev, unsigned int cmd, const void *data) |