Skip to content

Commit

Permalink
ixgbe: use netif_<level> instead of netdev_<level>
Browse files Browse the repository at this point in the history
This patch restores the ability to set msglvl through ethtool.
The issue was introduced by:
commit 849c454

CC: Joe Perches <joe@perches.com>

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Emil Tantilov authored and David S. Miller committed Jul 6, 2010
1 parent 4478a9c commit 396e799
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 86 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ixgbe/ixgbe_82599.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ static s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw,

out:
if (link_up && (link_speed == IXGBE_LINK_SPEED_1GB_FULL))
e_info("Smartspeed has downgraded the link speed from "
e_info(hw, "Smartspeed has downgraded the link speed from "
"the maximum advertised\n");
return status;
}
Expand Down
19 changes: 8 additions & 11 deletions drivers/net/ixgbe/ixgbe_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,6 @@ s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index);
extern struct net_device *ixgbe_get_hw_dev(struct ixgbe_hw *hw);
#define hw_dbg(hw, format, arg...) \
netdev_dbg(ixgbe_get_hw_dev(hw), format, ##arg)
#define e_err(format, arg...) \
netdev_err(adapter->netdev, format, ## arg)
#define e_info(format, arg...) \
netdev_info(adapter->netdev, format, ## arg)
#define e_warn(format, arg...) \
netdev_warn(adapter->netdev, format, ## arg)
#define e_notice(format, arg...) \
netdev_notice(adapter->netdev, format, ## arg)
#define e_crit(format, arg...) \
netdev_crit(adapter->netdev, format, ## arg)
#define e_dev_info(format, arg...) \
dev_info(&adapter->pdev->dev, format, ## arg)
#define e_dev_warn(format, arg...) \
Expand All @@ -126,5 +116,12 @@ extern struct net_device *ixgbe_get_hw_dev(struct ixgbe_hw *hw);
dev_err(&adapter->pdev->dev, format, ## arg)
#define e_dev_notice(format, arg...) \
dev_notice(&adapter->pdev->dev, format, ## arg)

#define e_info(msglvl, format, arg...) \
netif_info(adapter, msglvl, adapter->netdev, format, ## arg)
#define e_err(msglvl, format, arg...) \
netif_err(adapter, msglvl, adapter->netdev, format, ## arg)
#define e_warn(msglvl, format, arg...) \
netif_warn(adapter, msglvl, adapter->netdev, format, ## arg)
#define e_crit(msglvl, format, arg...) \
netif_crit(adapter, msglvl, adapter->netdev, format, ## arg)
#endif /* IXGBE_COMMON */
2 changes: 1 addition & 1 deletion drivers/net/ixgbe/ixgbe_dcb_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
goto out;

if (!(adapter->flags & IXGBE_FLAG_MSIX_ENABLED)) {
e_err("Enable failed, needs MSI-X\n");
e_err(drv, "Enable failed, needs MSI-X\n");
err = 1;
goto out;
}
Expand Down
40 changes: 21 additions & 19 deletions drivers/net/ixgbe/ixgbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ static int ixgbe_set_settings(struct net_device *netdev,
hw->mac.autotry_restart = true;
err = hw->mac.ops.setup_link(hw, advertised, true, true);
if (err) {
e_info("setup link failed with code %d\n", err);
e_info(probe, "setup link failed with code %d\n", err);
hw->mac.ops.setup_link(hw, old, true, true);
}
} else {
Expand Down Expand Up @@ -1194,8 +1194,8 @@ static struct ixgbe_reg_test reg_test_82598[] = {
writel((_test[pat] & W), (adapter->hw.hw_addr + R)); \
val = readl(adapter->hw.hw_addr + R); \
if (val != (_test[pat] & W & M)) { \
e_err("pattern test reg %04X failed: got " \
"0x%08X expected 0x%08X\n", \
e_err(drv, "pattern test reg %04X failed: got " \
"0x%08X expected 0x%08X\n", \
R, val, (_test[pat] & W & M)); \
*data = R; \
writel(before, adapter->hw.hw_addr + R); \
Expand All @@ -1212,8 +1212,8 @@ static struct ixgbe_reg_test reg_test_82598[] = {
writel((W & M), (adapter->hw.hw_addr + R)); \
val = readl(adapter->hw.hw_addr + R); \
if ((W & M) != (val & M)) { \
e_err("set/check reg %04X test failed: got 0x%08X " \
"expected 0x%08X\n", R, (val & M), (W & M)); \
e_err(drv, "set/check reg %04X test failed: got 0x%08X " \
"expected 0x%08X\n", R, (val & M), (W & M)); \
*data = R; \
writel(before, (adapter->hw.hw_addr + R)); \
return 1; \
Expand Down Expand Up @@ -1246,8 +1246,8 @@ static int ixgbe_reg_test(struct ixgbe_adapter *adapter, u64 *data)
IXGBE_WRITE_REG(&adapter->hw, IXGBE_STATUS, toggle);
after = IXGBE_READ_REG(&adapter->hw, IXGBE_STATUS) & toggle;
if (value != after) {
e_err("failed STATUS register test got: 0x%08X expected: "
"0x%08X\n", after, value);
e_err(drv, "failed STATUS register test got: 0x%08X "
"expected: 0x%08X\n", after, value);
*data = 1;
return 1;
}
Expand Down Expand Up @@ -1347,8 +1347,8 @@ static int ixgbe_intr_test(struct ixgbe_adapter *adapter, u64 *data)
*data = 1;
return -1;
}
e_info("testing %s interrupt\n", shared_int ?
"shared" : "unshared");
e_info(hw, "testing %s interrupt\n", shared_int ?
"shared" : "unshared");

/* Disable all the interrupts */
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFFFFFF);
Expand Down Expand Up @@ -1853,7 +1853,7 @@ static void ixgbe_diag_test(struct net_device *netdev,
if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
/* Offline tests */

e_info("offline testing starting\n");
e_info(hw, "offline testing starting\n");

/* Link test performed before hardware reset so autoneg doesn't
* interfere with test result */
Expand Down Expand Up @@ -1886,31 +1886,32 @@ static void ixgbe_diag_test(struct net_device *netdev,
else
ixgbe_reset(adapter);

e_info("register testing starting\n");
e_info(hw, "register testing starting\n");
if (ixgbe_reg_test(adapter, &data[0]))
eth_test->flags |= ETH_TEST_FL_FAILED;

ixgbe_reset(adapter);
e_info("eeprom testing starting\n");
e_info(hw, "eeprom testing starting\n");
if (ixgbe_eeprom_test(adapter, &data[1]))
eth_test->flags |= ETH_TEST_FL_FAILED;

ixgbe_reset(adapter);
e_info("interrupt testing starting\n");
e_info(hw, "interrupt testing starting\n");
if (ixgbe_intr_test(adapter, &data[2]))
eth_test->flags |= ETH_TEST_FL_FAILED;

/* If SRIOV or VMDq is enabled then skip MAC
* loopback diagnostic. */
if (adapter->flags & (IXGBE_FLAG_SRIOV_ENABLED |
IXGBE_FLAG_VMDQ_ENABLED)) {
e_info("Skip MAC loopback diagnostic in VT mode\n");
e_info(hw, "Skip MAC loopback diagnostic in VT "
"mode\n");
data[3] = 0;
goto skip_loopback;
}

ixgbe_reset(adapter);
e_info("loopback testing starting\n");
e_info(hw, "loopback testing starting\n");
if (ixgbe_loopback_test(adapter, &data[3]))
eth_test->flags |= ETH_TEST_FL_FAILED;

Expand All @@ -1921,7 +1922,7 @@ static void ixgbe_diag_test(struct net_device *netdev,
if (if_running)
dev_open(netdev);
} else {
e_info("online testing starting\n");
e_info(hw, "online testing starting\n");
/* Online tests */
if (ixgbe_link_test(adapter, &data[4]))
eth_test->flags |= ETH_TEST_FL_FAILED;
Expand Down Expand Up @@ -2139,7 +2140,8 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
adapter->flags2 &= ~IXGBE_FLAG2_RSC_ENABLED;
if (netdev->features & NETIF_F_LRO) {
netdev->features &= ~NETIF_F_LRO;
e_info("rx-usecs set to 0, disabling RSC\n");
e_info(probe, "rx-usecs set to 0, "
"disabling RSC\n");
}
need_reset = true;
}
Expand Down Expand Up @@ -2239,8 +2241,8 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data)
} else if (!adapter->rx_itr_setting) {
netdev->features &= ~NETIF_F_LRO;
if (data & ETH_FLAG_LRO)
e_info("rx-usecs set to 0, "
"LRO/RSC cannot be enabled.\n");
e_info(probe, "rx-usecs set to 0, "
"LRO/RSC cannot be enabled.\n");
}
}

Expand Down
26 changes: 13 additions & 13 deletions drivers/net/ixgbe/ixgbe_fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,35 +164,35 @@ int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid,

adapter = netdev_priv(netdev);
if (xid >= IXGBE_FCOE_DDP_MAX) {
e_warn("xid=0x%x out-of-range\n", xid);
e_warn(drv, "xid=0x%x out-of-range\n", xid);
return 0;
}

fcoe = &adapter->fcoe;
if (!fcoe->pool) {
e_warn("xid=0x%x no ddp pool for fcoe\n", xid);
e_warn(drv, "xid=0x%x no ddp pool for fcoe\n", xid);
return 0;
}

ddp = &fcoe->ddp[xid];
if (ddp->sgl) {
e_err("xid 0x%x w/ non-null sgl=%p nents=%d\n",
xid, ddp->sgl, ddp->sgc);
e_err(drv, "xid 0x%x w/ non-null sgl=%p nents=%d\n",
xid, ddp->sgl, ddp->sgc);
return 0;
}
ixgbe_fcoe_clear_ddp(ddp);

/* setup dma from scsi command sgl */
dmacount = pci_map_sg(adapter->pdev, sgl, sgc, DMA_FROM_DEVICE);
if (dmacount == 0) {
e_err("xid 0x%x DMA map error\n", xid);
e_err(drv, "xid 0x%x DMA map error\n", xid);
return 0;
}

/* alloc the udl from our ddp pool */
ddp->udl = pci_pool_alloc(fcoe->pool, GFP_KERNEL, &ddp->udp);
if (!ddp->udl) {
e_err("failed allocated ddp context\n");
e_err(drv, "failed allocated ddp context\n");
goto out_noddp_unmap;
}
ddp->sgl = sgl;
Expand All @@ -205,7 +205,7 @@ int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid,
while (len) {
/* max number of buffers allowed in one DDP context */
if (j >= IXGBE_BUFFCNT_MAX) {
e_err("xid=%x:%d,%d,%d:addr=%llx "
e_err(drv, "xid=%x:%d,%d,%d:addr=%llx "
"not enough descriptors\n",
xid, i, j, dmacount, (u64)addr);
goto out_noddp_free;
Expand Down Expand Up @@ -385,7 +385,7 @@ int ixgbe_fso(struct ixgbe_adapter *adapter,
struct fc_frame_header *fh;

if (skb_is_gso(skb) && (skb_shinfo(skb)->gso_type != SKB_GSO_FCOE)) {
e_err("Wrong gso type %d:expecting SKB_GSO_FCOE\n",
e_err(drv, "Wrong gso type %d:expecting SKB_GSO_FCOE\n",
skb_shinfo(skb)->gso_type);
return -EINVAL;
}
Expand All @@ -412,7 +412,7 @@ int ixgbe_fso(struct ixgbe_adapter *adapter,
fcoe_sof_eof |= IXGBE_ADVTXD_FCOEF_SOF;
break;
default:
e_warn("unknown sof = 0x%x\n", sof);
e_warn(drv, "unknown sof = 0x%x\n", sof);
return -EINVAL;
}

Expand All @@ -439,7 +439,7 @@ int ixgbe_fso(struct ixgbe_adapter *adapter,
fcoe_sof_eof |= IXGBE_ADVTXD_FCOEF_EOF_A;
break;
default:
e_warn("unknown eof = 0x%x\n", eof);
e_warn(drv, "unknown eof = 0x%x\n", eof);
return -EINVAL;
}

Expand Down Expand Up @@ -515,7 +515,7 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
adapter->pdev, IXGBE_FCPTR_MAX,
IXGBE_FCPTR_ALIGN, PAGE_SIZE);
if (!fcoe->pool)
e_err("failed to allocated FCoE DDP pool\n");
e_err(drv, "failed to allocated FCoE DDP pool\n");

spin_lock_init(&fcoe->lock);
}
Expand Down Expand Up @@ -611,7 +611,7 @@ int ixgbe_fcoe_enable(struct net_device *netdev)
if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
goto out_enable;

e_info("Enabling FCoE offload features.\n");
e_info(drv, "Enabling FCoE offload features.\n");
if (netif_running(netdev))
netdev->netdev_ops->ndo_stop(netdev);

Expand Down Expand Up @@ -657,7 +657,7 @@ int ixgbe_fcoe_disable(struct net_device *netdev)
if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))
goto out_disable;

e_info("Disabling FCoE offload features.\n");
e_info(drv, "Disabling FCoE offload features.\n");
if (netif_running(netdev))
netdev->netdev_ops->ndo_stop(netdev);

Expand Down
Loading

0 comments on commit 396e799

Please sign in to comment.