Commit f1f2b7c3 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-netdev_WARN_ONCE'

Gal Pressman says:

====================
Replace WARN_ONCE usages with netdev_WARN_ONCE

This series will fix an issue in netdev_WARN_ONCE, improve its formatting and
replace drivers' usage of WARN_ONCE to netdev_WARN_ONCE.

Driver specific patches were compilation tested, in addition, functional tested
on Mellanox NIC.

v1->v2:
- Addressed commit message comments in patch #1
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 9f0e896f 9d0b967f
...@@ -738,7 +738,8 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp, ...@@ -738,7 +738,8 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp,
bnx2x_gro_csum(bp, skb, bnx2x_gro_ipv6_csum); bnx2x_gro_csum(bp, skb, bnx2x_gro_ipv6_csum);
break; break;
default: default:
WARN_ONCE(1, "Error: FW GRO supports only IPv4/IPv6, not 0x%04x\n", netdev_WARN_ONCE(bp->dev,
"Error: FW GRO supports only IPv4/IPv6, not 0x%04x\n",
be16_to_cpu(skb->protocol)); be16_to_cpu(skb->protocol));
} }
} }
......
...@@ -1838,7 +1838,7 @@ static void e1000_get_ethtool_stats(struct net_device *netdev, ...@@ -1838,7 +1838,7 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
p = (char *)adapter + stat->stat_offset; p = (char *)adapter + stat->stat_offset;
break; break;
default: default:
WARN_ONCE(1, "Invalid E1000 stat type: %u index %d\n", netdev_WARN_ONCE(netdev, "Invalid E1000 stat type: %u index %d\n",
stat->type, i); stat->type, i);
continue; continue;
} }
......
...@@ -495,8 +495,8 @@ static inline void mlx5e_poll_ico_single_cqe(struct mlx5e_cq *cq, ...@@ -495,8 +495,8 @@ static inline void mlx5e_poll_ico_single_cqe(struct mlx5e_cq *cq,
mlx5_cqwq_pop(&cq->wq); mlx5_cqwq_pop(&cq->wq);
if (unlikely((cqe->op_own >> 4) != MLX5_CQE_REQ)) { if (unlikely((cqe->op_own >> 4) != MLX5_CQE_REQ)) {
WARN_ONCE(true, "mlx5e: Bad OP in ICOSQ CQE: 0x%x\n", netdev_WARN_ONCE(cq->channel->netdev,
cqe->op_own); "Bad OP in ICOSQ CQE: 0x%x\n", cqe->op_own);
return; return;
} }
...@@ -506,9 +506,8 @@ static inline void mlx5e_poll_ico_single_cqe(struct mlx5e_cq *cq, ...@@ -506,9 +506,8 @@ static inline void mlx5e_poll_ico_single_cqe(struct mlx5e_cq *cq,
} }
if (unlikely(icowi->opcode != MLX5_OPCODE_NOP)) if (unlikely(icowi->opcode != MLX5_OPCODE_NOP))
WARN_ONCE(true, netdev_WARN_ONCE(cq->channel->netdev,
"mlx5e: Bad OPCODE in ICOSQ WQE info: 0x%x\n", "Bad OPCODE in ICOSQ WQE info: 0x%x\n", icowi->opcode);
icowi->opcode);
} }
static void mlx5e_poll_ico_cq(struct mlx5e_cq *cq, struct mlx5e_rq *rq) static void mlx5e_poll_ico_cq(struct mlx5e_cq *cq, struct mlx5e_rq *rq)
......
...@@ -748,7 +748,7 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb, ...@@ -748,7 +748,7 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
mss = skb_shinfo(skb)->gso_size; mss = skb_shinfo(skb)->gso_size;
if (mss > MSSMask) { if (mss > MSSMask) {
WARN_ONCE(1, "Net bug: GSO size %d too large for 8139CP\n", netdev_WARN_ONCE(dev, "Net bug: GSO size %d too large for 8139CP\n",
mss); mss);
goto out_dma_error; goto out_dma_error;
} }
......
...@@ -4406,11 +4406,11 @@ do { \ ...@@ -4406,11 +4406,11 @@ do { \
* file/line information and a backtrace. * file/line information and a backtrace.
*/ */
#define netdev_WARN(dev, format, args...) \ #define netdev_WARN(dev, format, args...) \
WARN(1, "netdevice: %s%s\n" format, netdev_name(dev), \ WARN(1, "netdevice: %s%s: " format, netdev_name(dev), \
netdev_reg_state(dev), ##args) netdev_reg_state(dev), ##args)
#define netdev_WARN_ONCE(dev, condition, format, arg...) \ #define netdev_WARN_ONCE(dev, format, args...) \
WARN_ONCE(1, "netdevice: %s%s\n" format, netdev_name(dev) \ WARN_ONCE(1, "netdevice: %s%s: " format, netdev_name(dev), \
netdev_reg_state(dev), ##args) netdev_reg_state(dev), ##args)
/* netif printk helpers, similar to netdev_printk */ /* netif printk helpers, similar to netdev_printk */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment