You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kmod-redhat-atlantic/SOURCES/0042-netdrv-net-atlantic-ad...

115 lines
4.3 KiB

From 5e0c058784627f9285b4b45062bfe15a7a381c12 Mon Sep 17 00:00:00 2001
From: Igor Russkikh <irusskik@redhat.com>
Date: Fri, 6 Nov 2020 18:36:59 -0500
Subject: [PATCH 042/139] [netdrv] net: atlantic: add msglevel configuration
Message-id: <1604687916-15087-43-git-send-email-irusskik@redhat.com>
Patchwork-id: 338470
Patchwork-instance: patchwork
O-Subject: [RHEL8.4 BZ 1857861 042/139] net: atlantic: add msglevel configuration
Bugzilla: 1857861
RH-Acked-by: David Arcari <darcari@redhat.com>
RH-Acked-by: John Linville <linville@redhat.com>
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
Bugzilla: http://bugzilla.redhat.com/1857861
commit 58128fa0265b75be21ec244680426da50ca72850
Author: Nikita Danilov <ndanilov@marvell.com>
Date: Thu Nov 7 22:41:54 2019 +0000
net: atlantic: add msglevel configuration
We add ethtool msglevel configuration and change some
printouts to use netdev_info set of functions.
Signed-off-by: Nikita Danilov <ndanilov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Igor Russkikh <irusskik@redhat.com>
Cc: David Arcari <darcari@redhat.com>
Cc: Igor Russkikh <irusskik@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c | 16 ++++++++++++++++
drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 7 ++++---
drivers/net/ethernet/aquantia/atlantic/aq_nic.h | 1 +
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
index 3c55cf13cf14..5be273892430 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
@@ -607,6 +607,20 @@ static int aq_set_ringparam(struct net_device *ndev,
return err;
}
+static u32 aq_get_msg_level(struct net_device *ndev)
+{
+ struct aq_nic_s *aq_nic = netdev_priv(ndev);
+
+ return aq_nic->msg_enable;
+}
+
+static void aq_set_msg_level(struct net_device *ndev, u32 data)
+{
+ struct aq_nic_s *aq_nic = netdev_priv(ndev);
+
+ aq_nic->msg_enable = data;
+}
+
const struct ethtool_ops aq_ethtool_ops = {
.get_link = aq_ethtool_get_link,
.get_regs_len = aq_ethtool_get_regs_len,
@@ -628,6 +642,8 @@ const struct ethtool_ops aq_ethtool_ops = {
.set_rxfh = aq_ethtool_set_rss,
.get_rxnfc = aq_ethtool_get_rxnfc,
.set_rxnfc = aq_ethtool_set_rxnfc,
+ .get_msglevel = aq_get_msg_level,
+ .set_msglevel = aq_set_msg_level,
.get_sset_count = aq_ethtool_get_sset_count,
.get_ethtool_stats = aq_ethtool_stats,
.get_link_ksettings = aq_ethtool_get_link_ksettings,
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index d5764228cea5..8f83e91f8146 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -144,9 +144,9 @@ static int aq_nic_update_link_status(struct aq_nic_s *self)
return err;
if (self->link_status.mbps != self->aq_hw->aq_link_status.mbps) {
- pr_info("%s: link change old %d new %d\n",
- AQ_CFG_DRV_NAME, self->link_status.mbps,
- self->aq_hw->aq_link_status.mbps);
+ netdev_info(self->ndev, "%s: link change old %d new %d\n",
+ AQ_CFG_DRV_NAME, self->link_status.mbps,
+ self->aq_hw->aq_link_status.mbps);
aq_nic_update_interrupt_moderation_settings(self);
if (self->aq_ptp) {
@@ -306,6 +306,7 @@ void aq_nic_ndev_init(struct aq_nic_s *self)
self->ndev->priv_flags = aq_hw_caps->hw_priv_flags;
self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ self->msg_enable = NETIF_MSG_DRV | NETIF_MSG_LINK;
self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN;
self->ndev->max_mtu = aq_hw_caps->mtu - ETH_FCS_LEN - ETH_HLEN;
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
index ab3176dfc209..527273502d54 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
@@ -88,6 +88,7 @@ struct aq_hw_rx_fltrs_s {
struct aq_nic_s {
atomic_t flags;
+ u32 msg_enable;
struct aq_vec_s *aq_vec[AQ_CFG_VECS_MAX];
struct aq_ring_s *aq_ring_tx[AQ_CFG_VECS_MAX * AQ_CFG_TCS_MAX];
struct aq_hw_s *aq_hw;
--
2.13.6