* [PATCH 2/4] i40e: Add and use pf_<level>
From: Joe Perches @ 2013-08-30 23:06 UTC (permalink / raw)
To: Jeff Kirsher
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
John Ronciak, netdev
In-Reply-To: <cover.1377903831.git.joe@perches.com>
Convert dev_<level>(&pf->pdev->dev to a macro to
simplify and possibly reduce the size of logging messages.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/intel/i40e/i40e.h | 9 +
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 1510 +++++++++-----------
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 40 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 585 ++++----
drivers/net/ethernet/intel/i40e/i40e_sysfs.c | 13 +-
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 215 ++-
6 files changed, 998 insertions(+), 1374 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 6de5e63..f1fe336 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -563,4 +563,13 @@ struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
bool is_vf, bool is_netdev);
void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);
+/* i40e_pf message logging */
+
+#define pf_err(pf, fmt, ...) \
+ dev_err(&(pf)->pdev->dev, fmt, ##__VA_ARGS__)
+#define pf_warn(pf, fmt, ...) \
+ dev_warn(&(pf)->pdev->dev, fmt, ##__VA_ARGS__)
+#define pf_info(pf, fmt, ...) \
+ dev_info(&(pf)->pdev->dev, fmt, ##__VA_ARGS__)
+
#endif /* _I40E_H_ */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index e61ed67..d8b1963 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -45,7 +45,7 @@ static struct i40e_vsi *i40e_dbg_find_vsi(struct i40e_pf *pf, int seid)
int i;
if (seid < 0)
- dev_info(&pf->pdev->dev, "%s: %d: bad seid\n", __func__, seid);
+ pf_info(pf, "%s: %d: bad seid\n", __func__, seid);
else
for (i = 0; i < pf->hw.func_caps.num_vsis; i++)
if (pf->vsi[i] && (pf->vsi[i]->seid == seid))
@@ -65,7 +65,7 @@ static struct i40e_veb *i40e_dbg_find_veb(struct i40e_pf *pf, int seid)
if ((seid < I40E_BASE_VEB_SEID) ||
(seid > (I40E_BASE_VEB_SEID + I40E_MAX_VEB)))
- dev_info(&pf->pdev->dev, "%s: %d: bad seid\n", __func__, seid);
+ pf_info(pf, "%s: %d: bad seid\n", __func__, seid);
else
for (i = 0; i < I40E_MAX_VEB; i++)
if (pf->veb[i] && pf->veb[i]->seid == seid)
@@ -133,9 +133,8 @@ static int i40e_dbg_prep_dump_buf(struct i40e_pf *pf, int buflen)
i40e_dbg_dump_buf = kzalloc(buflen, GFP_KERNEL);
if (i40e_dbg_dump_buf != NULL) {
i40e_dbg_dump_buffer_len = buflen;
- dev_info(&pf->pdev->dev,
- "%s: i40e_dbg_dump_buffer_len = %d\n",
- __func__, (int)i40e_dbg_dump_buffer_len);
+ pf_info(pf, "%s: i40e_dbg_dump_buffer_len = %d\n",
+ __func__, (int)i40e_dbg_dump_buffer_len);
}
}
@@ -181,8 +180,8 @@ static ssize_t i40e_dbg_dump_write(struct file *filp,
/* decode the SEID given to be dumped */
ret = kstrtol(dump_request_buf, 0, &seid);
if (ret < 0) {
- dev_info(&pf->pdev->dev, "%s: bad seid value '%s'\n",
- __func__, dump_request_buf);
+ pf_info(pf, "%s: bad seid value '%s'\n",
+ __func__, dump_request_buf);
} else if (seid == 0) {
seid_found = true;
@@ -190,7 +189,7 @@ static ssize_t i40e_dbg_dump_write(struct file *filp,
i40e_dbg_dump_buffer_len = 0;
i40e_dbg_dump_data_len = 0;
i40e_dbg_dump_buf = NULL;
- dev_info(&pf->pdev->dev, "%s: debug buffer freed\n", __func__);
+ pf_info(pf, "%s: debug buffer freed\n", __func__);
} else if (seid == pf->pf_seid || seid == 1) {
seid_found = true;
@@ -217,9 +216,8 @@ static ssize_t i40e_dbg_dump_write(struct file *filp,
p += len;
i40e_dbg_dump_data_len = buflen;
- dev_info(&pf->pdev->dev,
- "%s: PF seid %ld dumped %d bytes\n",
- __func__, seid, (int)i40e_dbg_dump_data_len);
+ pf_info(pf, "%s: PF seid %ld dumped %d bytes\n",
+ __func__, seid, (int)i40e_dbg_dump_data_len);
}
} else if (seid >= I40E_BASE_VSI_SEID) {
struct i40e_vsi *vsi = NULL;
@@ -280,9 +278,8 @@ static ssize_t i40e_dbg_dump_write(struct file *filp,
}
i40e_dbg_dump_data_len = buflen;
- dev_info(&pf->pdev->dev,
- "%s: VSI seid %ld dumped %d bytes\n",
- __func__, seid, (int)i40e_dbg_dump_data_len);
+ pf_info(pf, "%s: VSI seid %ld dumped %d bytes\n",
+ __func__, seid, (int)i40e_dbg_dump_data_len);
}
mutex_unlock(&pf->switch_mutex);
} else if (seid >= I40E_BASE_VEB_SEID) {
@@ -300,17 +297,15 @@ static ssize_t i40e_dbg_dump_write(struct file *filp,
seid_found = true;
memcpy(i40e_dbg_dump_buf, veb, buflen);
i40e_dbg_dump_data_len = buflen;
- dev_info(&pf->pdev->dev,
- "%s: VEB seid %ld dumped %d bytes\n",
- __func__, seid, (int)i40e_dbg_dump_data_len);
+ pf_info(pf, "%s: VEB seid %ld dumped %d bytes\n",
+ __func__, seid, (int)i40e_dbg_dump_data_len);
}
mutex_unlock(&pf->switch_mutex);
}
write_exit:
if (!seid_found)
- dev_info(&pf->pdev->dev, "%s: unknown seid %ld\n",
- __func__, seid);
+ pf_info(pf, "%s: unknown seid %ld\n", __func__, seid);
return count;
}
@@ -385,336 +380,262 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
vsi = i40e_dbg_find_vsi(pf, seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: dump %d: seid not found\n", __func__, seid);
+ pf_info(pf, "%s: dump %d: seid not found\n", __func__, seid);
return;
}
- dev_info(&pf->pdev->dev,
- "%s: vsi seid %d\n", __func__, seid);
+ pf_info(pf, "%s: vsi seid %d\n", __func__, seid);
if (vsi->netdev)
- dev_info(&pf->pdev->dev,
- " netdev: name = %s\n",
- vsi->netdev->name);
+ pf_info(pf, " netdev: name = %s\n", vsi->netdev->name);
if (vsi->active_vlans)
- dev_info(&pf->pdev->dev,
- " vlgrp: & = %p\n", vsi->active_vlans);
- dev_info(&pf->pdev->dev,
- " netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n",
- vsi->netdev_registered,
- vsi->current_netdev_flags, vsi->state, vsi->flags);
+ pf_info(pf, " vlgrp: & = %p\n", vsi->active_vlans);
+ pf_info(pf, " netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n",
+ vsi->netdev_registered,
+ vsi->current_netdev_flags, vsi->state, vsi->flags);
list_for_each_entry(f, &vsi->mac_filter_list, list) {
- dev_info(&pf->pdev->dev,
- " mac_filter_list: %pM vid=%d, is_netdev=%d is_vf=%d counter=%d\n",
- f->macaddr, f->vlan, f->is_netdev, f->is_vf,
- f->counter);
+ pf_info(pf, " mac_filter_list: %pM vid=%d, is_netdev=%d is_vf=%d counter=%d\n",
+ f->macaddr, f->vlan, f->is_netdev, f->is_vf,
+ f->counter);
}
nstat = i40e_get_vsi_stats_struct(vsi);
- dev_info(&pf->pdev->dev,
- " net_stats: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n",
- (long unsigned int)nstat->rx_packets,
- (long unsigned int)nstat->rx_bytes,
- (long unsigned int)nstat->rx_errors,
- (long unsigned int)nstat->rx_dropped);
- dev_info(&pf->pdev->dev,
- " net_stats: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n",
- (long unsigned int)nstat->tx_packets,
- (long unsigned int)nstat->tx_bytes,
- (long unsigned int)nstat->tx_errors,
- (long unsigned int)nstat->tx_dropped);
- dev_info(&pf->pdev->dev,
- " net_stats: multicast = %lu, collisions = %lu\n",
- (long unsigned int)nstat->multicast,
- (long unsigned int)nstat->collisions);
- dev_info(&pf->pdev->dev,
- " net_stats: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n",
- (long unsigned int)nstat->rx_length_errors,
- (long unsigned int)nstat->rx_over_errors,
- (long unsigned int)nstat->rx_crc_errors);
- dev_info(&pf->pdev->dev,
- " net_stats: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n",
- (long unsigned int)nstat->rx_frame_errors,
- (long unsigned int)nstat->rx_fifo_errors,
- (long unsigned int)nstat->rx_missed_errors);
- dev_info(&pf->pdev->dev,
- " net_stats: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n",
- (long unsigned int)nstat->tx_aborted_errors,
- (long unsigned int)nstat->tx_carrier_errors,
- (long unsigned int)nstat->tx_fifo_errors);
- dev_info(&pf->pdev->dev,
- " net_stats: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n",
- (long unsigned int)nstat->tx_heartbeat_errors,
- (long unsigned int)nstat->tx_window_errors);
- dev_info(&pf->pdev->dev,
- " net_stats: rx_compressed = %lu, tx_compressed = %lu\n",
- (long unsigned int)nstat->rx_compressed,
- (long unsigned int)nstat->tx_compressed);
- dev_info(&pf->pdev->dev,
- " net_stats_offsets: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.rx_packets,
- (long unsigned int)vsi->net_stats_offsets.rx_bytes,
- (long unsigned int)vsi->net_stats_offsets.rx_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_dropped);
- dev_info(&pf->pdev->dev,
- " net_stats_offsets: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.tx_packets,
- (long unsigned int)vsi->net_stats_offsets.tx_bytes,
- (long unsigned int)vsi->net_stats_offsets.tx_errors,
- (long unsigned int)vsi->net_stats_offsets.tx_dropped);
- dev_info(&pf->pdev->dev,
- " net_stats_offsets: multicast = %lu, collisions = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.multicast,
- (long unsigned int)vsi->net_stats_offsets.collisions);
- dev_info(&pf->pdev->dev,
- " net_stats_offsets: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.rx_length_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_over_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_crc_errors);
- dev_info(&pf->pdev->dev,
- " net_stats_offsets: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.rx_frame_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_fifo_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_missed_errors);
- dev_info(&pf->pdev->dev,
- " net_stats_offsets: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.tx_aborted_errors,
- (long unsigned int)vsi->net_stats_offsets.tx_carrier_errors,
- (long unsigned int)vsi->net_stats_offsets.tx_fifo_errors);
- dev_info(&pf->pdev->dev,
- " net_stats_offsets: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.tx_heartbeat_errors,
- (long unsigned int)vsi->net_stats_offsets.tx_window_errors);
- dev_info(&pf->pdev->dev,
- " net_stats_offsets: rx_compressed = %lu, tx_compressed = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.rx_compressed,
- (long unsigned int)vsi->net_stats_offsets.tx_compressed);
- dev_info(&pf->pdev->dev,
- " tx_restart = %d, tx_busy = %d, rx_buf_failed = %d, rx_page_failed = %d\n",
- vsi->tx_restart, vsi->tx_busy,
- vsi->rx_buf_failed, vsi->rx_page_failed);
+ pf_info(pf, " net_stats: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n",
+ (long unsigned int)nstat->rx_packets,
+ (long unsigned int)nstat->rx_bytes,
+ (long unsigned int)nstat->rx_errors,
+ (long unsigned int)nstat->rx_dropped);
+ pf_info(pf, " net_stats: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n",
+ (long unsigned int)nstat->tx_packets,
+ (long unsigned int)nstat->tx_bytes,
+ (long unsigned int)nstat->tx_errors,
+ (long unsigned int)nstat->tx_dropped);
+ pf_info(pf, " net_stats: multicast = %lu, collisions = %lu\n",
+ (long unsigned int)nstat->multicast,
+ (long unsigned int)nstat->collisions);
+ pf_info(pf, " net_stats: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n",
+ (long unsigned int)nstat->rx_length_errors,
+ (long unsigned int)nstat->rx_over_errors,
+ (long unsigned int)nstat->rx_crc_errors);
+ pf_info(pf, " net_stats: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n",
+ (long unsigned int)nstat->rx_frame_errors,
+ (long unsigned int)nstat->rx_fifo_errors,
+ (long unsigned int)nstat->rx_missed_errors);
+ pf_info(pf, " net_stats: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n",
+ (long unsigned int)nstat->tx_aborted_errors,
+ (long unsigned int)nstat->tx_carrier_errors,
+ (long unsigned int)nstat->tx_fifo_errors);
+ pf_info(pf, " net_stats: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n",
+ (long unsigned int)nstat->tx_heartbeat_errors,
+ (long unsigned int)nstat->tx_window_errors);
+ pf_info(pf, " net_stats: rx_compressed = %lu, tx_compressed = %lu\n",
+ (long unsigned int)nstat->rx_compressed,
+ (long unsigned int)nstat->tx_compressed);
+ pf_info(pf, " net_stats_offsets: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.rx_packets,
+ (long unsigned int)vsi->net_stats_offsets.rx_bytes,
+ (long unsigned int)vsi->net_stats_offsets.rx_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_dropped);
+ pf_info(pf, " net_stats_offsets: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.tx_packets,
+ (long unsigned int)vsi->net_stats_offsets.tx_bytes,
+ (long unsigned int)vsi->net_stats_offsets.tx_errors,
+ (long unsigned int)vsi->net_stats_offsets.tx_dropped);
+ pf_info(pf, " net_stats_offsets: multicast = %lu, collisions = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.multicast,
+ (long unsigned int)vsi->net_stats_offsets.collisions);
+ pf_info(pf, " net_stats_offsets: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.rx_length_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_over_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_crc_errors);
+ pf_info(pf, " net_stats_offsets: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.rx_frame_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_fifo_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_missed_errors);
+ pf_info(pf, " net_stats_offsets: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.tx_aborted_errors,
+ (long unsigned int)vsi->net_stats_offsets.tx_carrier_errors,
+ (long unsigned int)vsi->net_stats_offsets.tx_fifo_errors);
+ pf_info(pf, " net_stats_offsets: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.tx_heartbeat_errors,
+ (long unsigned int)vsi->net_stats_offsets.tx_window_errors);
+ pf_info(pf, " net_stats_offsets: rx_compressed = %lu, tx_compressed = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.rx_compressed,
+ (long unsigned int)vsi->net_stats_offsets.tx_compressed);
+ pf_info(pf, " tx_restart = %d, tx_busy = %d, rx_buf_failed = %d, rx_page_failed = %d\n",
+ vsi->tx_restart, vsi->tx_busy,
+ vsi->rx_buf_failed, vsi->rx_page_failed);
if (vsi->rx_rings) {
for (i = 0; i < vsi->num_queue_pairs; i++) {
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: desc = %p\n",
- i, vsi->rx_rings[i].desc);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: dev = %p, netdev = %p, rx_bi = %p\n",
- i, vsi->rx_rings[i].dev,
- vsi->rx_rings[i].netdev,
- vsi->rx_rings[i].rx_bi);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
- i, vsi->rx_rings[i].state,
- vsi->rx_rings[i].queue_index,
- vsi->rx_rings[i].reg_idx);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: rx_hdr_len = %d, rx_buf_len = %d, dtype = %d\n",
- i, vsi->rx_rings[i].rx_hdr_len,
- vsi->rx_rings[i].rx_buf_len,
- vsi->rx_rings[i].dtype);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n",
- i, vsi->rx_rings[i].hsplit,
- vsi->rx_rings[i].next_to_use,
- vsi->rx_rings[i].next_to_clean,
- vsi->rx_rings[i].ring_active);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: rx_stats: packets = %lld, bytes = %lld, non_eop_descs = %lld\n",
- i, vsi->rx_rings[i].rx_stats.packets,
- vsi->rx_rings[i].rx_stats.bytes,
- vsi->rx_rings[i].rx_stats.non_eop_descs);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: rx_stats: alloc_rx_page_failed = %lld, alloc_rx_buff_failed = %lld\n",
- i,
- vsi->rx_rings[i].rx_stats.alloc_rx_page_failed,
- vsi->rx_rings[i].rx_stats.alloc_rx_buff_failed);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: size = %i, dma = 0x%08lx\n",
- i, vsi->rx_rings[i].size,
- (long unsigned int)vsi->rx_rings[i].dma);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: vsi = %p, q_vector = %p\n",
- i, vsi->rx_rings[i].vsi,
- vsi->rx_rings[i].q_vector);
+ pf_info(pf, " rx_rings[%i]: desc = %p\n",
+ i, vsi->rx_rings[i].desc);
+ pf_info(pf, " rx_rings[%i]: dev = %p, netdev = %p, rx_bi = %p\n",
+ i, vsi->rx_rings[i].dev,
+ vsi->rx_rings[i].netdev,
+ vsi->rx_rings[i].rx_bi);
+ pf_info(pf, " rx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
+ i, vsi->rx_rings[i].state,
+ vsi->rx_rings[i].queue_index,
+ vsi->rx_rings[i].reg_idx);
+ pf_info(pf, " rx_rings[%i]: rx_hdr_len = %d, rx_buf_len = %d, dtype = %d\n",
+ i, vsi->rx_rings[i].rx_hdr_len,
+ vsi->rx_rings[i].rx_buf_len,
+ vsi->rx_rings[i].dtype);
+ pf_info(pf, " rx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n",
+ i, vsi->rx_rings[i].hsplit,
+ vsi->rx_rings[i].next_to_use,
+ vsi->rx_rings[i].next_to_clean,
+ vsi->rx_rings[i].ring_active);
+ pf_info(pf, " rx_rings[%i]: rx_stats: packets = %lld, bytes = %lld, non_eop_descs = %lld\n",
+ i, vsi->rx_rings[i].rx_stats.packets,
+ vsi->rx_rings[i].rx_stats.bytes,
+ vsi->rx_rings[i].rx_stats.non_eop_descs);
+ pf_info(pf, " rx_rings[%i]: rx_stats: alloc_rx_page_failed = %lld, alloc_rx_buff_failed = %lld\n",
+ i,
+ vsi->rx_rings[i].rx_stats.alloc_rx_page_failed,
+ vsi->rx_rings[i].rx_stats.alloc_rx_buff_failed);
+ pf_info(pf, " rx_rings[%i]: size = %i, dma = 0x%08lx\n",
+ i, vsi->rx_rings[i].size,
+ (long unsigned int)vsi->rx_rings[i].dma);
+ pf_info(pf, " rx_rings[%i]: vsi = %p, q_vector = %p\n",
+ i, vsi->rx_rings[i].vsi,
+ vsi->rx_rings[i].q_vector);
}
}
if (vsi->tx_rings) {
for (i = 0; i < vsi->num_queue_pairs; i++) {
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: desc = %p\n",
- i, vsi->tx_rings[i].desc);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: dev = %p, netdev = %p, tx_bi = %p\n",
- i, vsi->tx_rings[i].dev,
- vsi->tx_rings[i].netdev,
- vsi->tx_rings[i].tx_bi);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
- i, vsi->tx_rings[i].state,
- vsi->tx_rings[i].queue_index,
- vsi->tx_rings[i].reg_idx);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: dtype = %d\n",
- i, vsi->tx_rings[i].dtype);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n",
- i, vsi->tx_rings[i].hsplit,
- vsi->tx_rings[i].next_to_use,
- vsi->tx_rings[i].next_to_clean,
- vsi->tx_rings[i].ring_active);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: tx_stats: packets = %lld, bytes = %lld, restart_queue = %lld\n",
- i, vsi->tx_rings[i].tx_stats.packets,
- vsi->tx_rings[i].tx_stats.bytes,
- vsi->tx_rings[i].tx_stats.restart_queue);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: tx_stats: tx_busy = %lld, completed = %lld, tx_done_old = %lld\n",
- i,
- vsi->tx_rings[i].tx_stats.tx_busy,
- vsi->tx_rings[i].tx_stats.completed,
- vsi->tx_rings[i].tx_stats.tx_done_old);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: size = %i, dma = 0x%08lx\n",
- i, vsi->tx_rings[i].size,
- (long unsigned int)vsi->tx_rings[i].dma);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: vsi = %p, q_vector = %p\n",
- i, vsi->tx_rings[i].vsi,
- vsi->tx_rings[i].q_vector);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: DCB tc = %d\n",
- i, vsi->tx_rings[i].dcb_tc);
+ pf_info(pf, " tx_rings[%i]: desc = %p\n",
+ i, vsi->tx_rings[i].desc);
+ pf_info(pf, " tx_rings[%i]: dev = %p, netdev = %p, tx_bi = %p\n",
+ i, vsi->tx_rings[i].dev,
+ vsi->tx_rings[i].netdev,
+ vsi->tx_rings[i].tx_bi);
+ pf_info(pf, " tx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
+ i, vsi->tx_rings[i].state,
+ vsi->tx_rings[i].queue_index,
+ vsi->tx_rings[i].reg_idx);
+ pf_info(pf, " tx_rings[%i]: dtype = %d\n",
+ i, vsi->tx_rings[i].dtype);
+ pf_info(pf, " tx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n",
+ i, vsi->tx_rings[i].hsplit,
+ vsi->tx_rings[i].next_to_use,
+ vsi->tx_rings[i].next_to_clean,
+ vsi->tx_rings[i].ring_active);
+ pf_info(pf, " tx_rings[%i]: tx_stats: packets = %lld, bytes = %lld, restart_queue = %lld\n",
+ i, vsi->tx_rings[i].tx_stats.packets,
+ vsi->tx_rings[i].tx_stats.bytes,
+ vsi->tx_rings[i].tx_stats.restart_queue);
+ pf_info(pf, " tx_rings[%i]: tx_stats: tx_busy = %lld, completed = %lld, tx_done_old = %lld\n",
+ i,
+ vsi->tx_rings[i].tx_stats.tx_busy,
+ vsi->tx_rings[i].tx_stats.completed,
+ vsi->tx_rings[i].tx_stats.tx_done_old);
+ pf_info(pf, " tx_rings[%i]: size = %i, dma = 0x%08lx\n",
+ i, vsi->tx_rings[i].size,
+ (long unsigned int)vsi->tx_rings[i].dma);
+ pf_info(pf, " tx_rings[%i]: vsi = %p, q_vector = %p\n",
+ i, vsi->tx_rings[i].vsi,
+ vsi->tx_rings[i].q_vector);
+ pf_info(pf, " tx_rings[%i]: DCB tc = %d\n",
+ i, vsi->tx_rings[i].dcb_tc);
}
}
- dev_info(&pf->pdev->dev,
- " work_limit = %d, rx_itr_setting = %d (%s), tx_itr_setting = %d (%s)\n",
- vsi->work_limit, vsi->rx_itr_setting,
- ITR_IS_DYNAMIC(vsi->rx_itr_setting) ? "dynamic" : "fixed",
- vsi->tx_itr_setting,
- ITR_IS_DYNAMIC(vsi->tx_itr_setting) ? "dynamic" : "fixed");
- dev_info(&pf->pdev->dev,
- " max_frame = %d, rx_hdr_len = %d, rx_buf_len = %d dtype = %d\n",
- vsi->max_frame, vsi->rx_hdr_len, vsi->rx_buf_len, vsi->dtype);
+ pf_info(pf, " work_limit = %d, rx_itr_setting = %d (%s), tx_itr_setting = %d (%s)\n",
+ vsi->work_limit, vsi->rx_itr_setting,
+ ITR_IS_DYNAMIC(vsi->rx_itr_setting) ? "dynamic" : "fixed",
+ vsi->tx_itr_setting,
+ ITR_IS_DYNAMIC(vsi->tx_itr_setting) ? "dynamic" : "fixed");
+ pf_info(pf, " max_frame = %d, rx_hdr_len = %d, rx_buf_len = %d dtype = %d\n",
+ vsi->max_frame, vsi->rx_hdr_len, vsi->rx_buf_len, vsi->dtype);
if (vsi->q_vectors) {
for (i = 0; i < vsi->num_q_vectors; i++) {
- dev_info(&pf->pdev->dev,
- " q_vectors[%i]: base index = %ld\n",
- i, ((long int)*vsi->q_vectors[i].rx.ring-
- (long int)*vsi->q_vectors[0].rx.ring)/
- sizeof(struct i40e_ring));
+ pf_info(pf, " q_vectors[%i]: base index = %ld\n",
+ i, ((long int)*vsi->q_vectors[i].rx.ring-
+ (long int)*vsi->q_vectors[0].rx.ring)/
+ sizeof(struct i40e_ring));
}
}
- dev_info(&pf->pdev->dev,
- " num_q_vectors = %i, base_vector = %i\n",
- vsi->num_q_vectors, vsi->base_vector);
- dev_info(&pf->pdev->dev,
- " seid = %d, id = %d, uplink_seid = %d\n",
- vsi->seid, vsi->id, vsi->uplink_seid);
- dev_info(&pf->pdev->dev,
- " base_queue = %d, num_queue_pairs = %d, num_desc = %d\n",
- vsi->base_queue, vsi->num_queue_pairs, vsi->num_desc);
- dev_info(&pf->pdev->dev,
- " type = %i\n",
- vsi->type);
- dev_info(&pf->pdev->dev,
- " info: valid_sections = 0x%04x, switch_id = 0x%04x\n",
- vsi->info.valid_sections, vsi->info.switch_id);
- dev_info(&pf->pdev->dev,
- " info: sw_reserved[] = 0x%02x 0x%02x\n",
- vsi->info.sw_reserved[0], vsi->info.sw_reserved[1]);
- dev_info(&pf->pdev->dev,
- " info: sec_flags = 0x%02x, sec_reserved = 0x%02x\n",
- vsi->info.sec_flags, vsi->info.sec_reserved);
- dev_info(&pf->pdev->dev,
- " info: pvid = 0x%04x, fcoe_pvid = 0x%04x, port_vlan_flags = 0x%02x\n",
- vsi->info.pvid, vsi->info.fcoe_pvid, vsi->info.port_vlan_flags);
- dev_info(&pf->pdev->dev,
- " info: pvlan_reserved[] = 0x%02x 0x%02x 0x%02x\n",
- vsi->info.pvlan_reserved[0], vsi->info.pvlan_reserved[1],
- vsi->info.pvlan_reserved[2]);
- dev_info(&pf->pdev->dev,
- " info: ingress_table = 0x%08x, egress_table = 0x%08x\n",
- vsi->info.ingress_table, vsi->info.egress_table);
- dev_info(&pf->pdev->dev,
- " info: cas_pv_stag = 0x%04x, cas_pv_flags= 0x%02x, cas_pv_reserved = 0x%02x\n",
- vsi->info.cas_pv_tag, vsi->info.cas_pv_flags,
- vsi->info.cas_pv_reserved);
- dev_info(&pf->pdev->dev,
- " info: queue_mapping[0..7 ] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
- vsi->info.queue_mapping[0], vsi->info.queue_mapping[1],
- vsi->info.queue_mapping[2], vsi->info.queue_mapping[3],
- vsi->info.queue_mapping[4], vsi->info.queue_mapping[5],
- vsi->info.queue_mapping[6], vsi->info.queue_mapping[7]);
- dev_info(&pf->pdev->dev,
- " info: queue_mapping[8..15] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
- vsi->info.queue_mapping[8], vsi->info.queue_mapping[9],
- vsi->info.queue_mapping[10], vsi->info.queue_mapping[11],
- vsi->info.queue_mapping[12], vsi->info.queue_mapping[13],
- vsi->info.queue_mapping[14], vsi->info.queue_mapping[15]);
- dev_info(&pf->pdev->dev,
- " info: tc_mapping[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
- vsi->info.tc_mapping[0], vsi->info.tc_mapping[1],
- vsi->info.tc_mapping[2], vsi->info.tc_mapping[3],
- vsi->info.tc_mapping[4], vsi->info.tc_mapping[5],
- vsi->info.tc_mapping[6], vsi->info.tc_mapping[7]);
- dev_info(&pf->pdev->dev,
- " info: queueing_opt_flags = 0x%02x queueing_opt_reserved[0..2] = 0x%02x 0x%02x 0x%02x\n",
- vsi->info.queueing_opt_flags,
- vsi->info.queueing_opt_reserved[0],
- vsi->info.queueing_opt_reserved[1],
- vsi->info.queueing_opt_reserved[2]);
- dev_info(&pf->pdev->dev,
- " info: up_enable_bits = 0x%02x\n",
- vsi->info.up_enable_bits);
- dev_info(&pf->pdev->dev,
- " info: sched_reserved = 0x%02x, outer_up_table = 0x%04x\n",
- vsi->info.sched_reserved, vsi->info.outer_up_table);
- dev_info(&pf->pdev->dev,
- " info: cmd_reserved[] = 0x%02x 0x%02x 0x%02x 0x0%02x 0x%02x 0x%02x 0x%02x 0x0%02x\n",
- vsi->info.cmd_reserved[0], vsi->info.cmd_reserved[1],
- vsi->info.cmd_reserved[2], vsi->info.cmd_reserved[3],
- vsi->info.cmd_reserved[4], vsi->info.cmd_reserved[5],
- vsi->info.cmd_reserved[6], vsi->info.cmd_reserved[7]);
- dev_info(&pf->pdev->dev,
- " info: qs_handle[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
- vsi->info.qs_handle[0], vsi->info.qs_handle[1],
- vsi->info.qs_handle[2], vsi->info.qs_handle[3],
- vsi->info.qs_handle[4], vsi->info.qs_handle[5],
- vsi->info.qs_handle[6], vsi->info.qs_handle[7]);
- dev_info(&pf->pdev->dev,
- " info: stat_counter_idx = 0x%04x, sched_id = 0x%04x\n",
- vsi->info.stat_counter_idx, vsi->info.sched_id);
- dev_info(&pf->pdev->dev,
- " info: resp_reserved[] = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
- vsi->info.resp_reserved[0], vsi->info.resp_reserved[1],
- vsi->info.resp_reserved[2], vsi->info.resp_reserved[3],
- vsi->info.resp_reserved[4], vsi->info.resp_reserved[5],
- vsi->info.resp_reserved[6], vsi->info.resp_reserved[7],
- vsi->info.resp_reserved[8], vsi->info.resp_reserved[9],
- vsi->info.resp_reserved[10], vsi->info.resp_reserved[11]);
+ pf_info(pf, " num_q_vectors = %i, base_vector = %i\n",
+ vsi->num_q_vectors, vsi->base_vector);
+ pf_info(pf, " seid = %d, id = %d, uplink_seid = %d\n",
+ vsi->seid, vsi->id, vsi->uplink_seid);
+ pf_info(pf, " base_queue = %d, num_queue_pairs = %d, num_desc = %d\n",
+ vsi->base_queue, vsi->num_queue_pairs, vsi->num_desc);
+ pf_info(pf, " type = %i\n", vsi->type);
+ pf_info(pf, " info: valid_sections = 0x%04x, switch_id = 0x%04x\n",
+ vsi->info.valid_sections, vsi->info.switch_id);
+ pf_info(pf, " info: sw_reserved[] = 0x%02x 0x%02x\n",
+ vsi->info.sw_reserved[0], vsi->info.sw_reserved[1]);
+ pf_info(pf, " info: sec_flags = 0x%02x, sec_reserved = 0x%02x\n",
+ vsi->info.sec_flags, vsi->info.sec_reserved);
+ pf_info(pf, " info: pvid = 0x%04x, fcoe_pvid = 0x%04x, port_vlan_flags = 0x%02x\n",
+ vsi->info.pvid, vsi->info.fcoe_pvid, vsi->info.port_vlan_flags);
+ pf_info(pf, " info: pvlan_reserved[] = 0x%02x 0x%02x 0x%02x\n",
+ vsi->info.pvlan_reserved[0], vsi->info.pvlan_reserved[1],
+ vsi->info.pvlan_reserved[2]);
+ pf_info(pf, " info: ingress_table = 0x%08x, egress_table = 0x%08x\n",
+ vsi->info.ingress_table, vsi->info.egress_table);
+ pf_info(pf, " info: cas_pv_stag = 0x%04x, cas_pv_flags= 0x%02x, cas_pv_reserved = 0x%02x\n",
+ vsi->info.cas_pv_tag, vsi->info.cas_pv_flags,
+ vsi->info.cas_pv_reserved);
+ pf_info(pf, " info: queue_mapping[0..7 ] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+ vsi->info.queue_mapping[0], vsi->info.queue_mapping[1],
+ vsi->info.queue_mapping[2], vsi->info.queue_mapping[3],
+ vsi->info.queue_mapping[4], vsi->info.queue_mapping[5],
+ vsi->info.queue_mapping[6], vsi->info.queue_mapping[7]);
+ pf_info(pf, " info: queue_mapping[8..15] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+ vsi->info.queue_mapping[8], vsi->info.queue_mapping[9],
+ vsi->info.queue_mapping[10], vsi->info.queue_mapping[11],
+ vsi->info.queue_mapping[12], vsi->info.queue_mapping[13],
+ vsi->info.queue_mapping[14], vsi->info.queue_mapping[15]);
+ pf_info(pf, " info: tc_mapping[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+ vsi->info.tc_mapping[0], vsi->info.tc_mapping[1],
+ vsi->info.tc_mapping[2], vsi->info.tc_mapping[3],
+ vsi->info.tc_mapping[4], vsi->info.tc_mapping[5],
+ vsi->info.tc_mapping[6], vsi->info.tc_mapping[7]);
+ pf_info(pf, " info: queueing_opt_flags = 0x%02x queueing_opt_reserved[0..2] = 0x%02x 0x%02x 0x%02x\n",
+ vsi->info.queueing_opt_flags,
+ vsi->info.queueing_opt_reserved[0],
+ vsi->info.queueing_opt_reserved[1],
+ vsi->info.queueing_opt_reserved[2]);
+ pf_info(pf, " info: up_enable_bits = 0x%02x\n",
+ vsi->info.up_enable_bits);
+ pf_info(pf, " info: sched_reserved = 0x%02x, outer_up_table = 0x%04x\n",
+ vsi->info.sched_reserved, vsi->info.outer_up_table);
+ pf_info(pf, " info: cmd_reserved[] = 0x%02x 0x%02x 0x%02x 0x0%02x 0x%02x 0x%02x 0x%02x 0x0%02x\n",
+ vsi->info.cmd_reserved[0], vsi->info.cmd_reserved[1],
+ vsi->info.cmd_reserved[2], vsi->info.cmd_reserved[3],
+ vsi->info.cmd_reserved[4], vsi->info.cmd_reserved[5],
+ vsi->info.cmd_reserved[6], vsi->info.cmd_reserved[7]);
+ pf_info(pf, " info: qs_handle[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+ vsi->info.qs_handle[0], vsi->info.qs_handle[1],
+ vsi->info.qs_handle[2], vsi->info.qs_handle[3],
+ vsi->info.qs_handle[4], vsi->info.qs_handle[5],
+ vsi->info.qs_handle[6], vsi->info.qs_handle[7]);
+ pf_info(pf, " info: stat_counter_idx = 0x%04x, sched_id = 0x%04x\n",
+ vsi->info.stat_counter_idx, vsi->info.sched_id);
+ pf_info(pf, " info: resp_reserved[] = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
+ vsi->info.resp_reserved[0], vsi->info.resp_reserved[1],
+ vsi->info.resp_reserved[2], vsi->info.resp_reserved[3],
+ vsi->info.resp_reserved[4], vsi->info.resp_reserved[5],
+ vsi->info.resp_reserved[6], vsi->info.resp_reserved[7],
+ vsi->info.resp_reserved[8], vsi->info.resp_reserved[9],
+ vsi->info.resp_reserved[10], vsi->info.resp_reserved[11]);
if (vsi->back)
- dev_info(&pf->pdev->dev,
- " pf = %p\n", vsi->back);
- dev_info(&pf->pdev->dev,
- " idx = %d\n", vsi->idx);
- dev_info(&pf->pdev->dev,
- " tc_config: numtc = %d, enabled_tc = 0x%x\n",
- vsi->tc_config.numtc, vsi->tc_config.enabled_tc);
+ pf_info(pf, " pf = %p\n", vsi->back);
+ pf_info(pf, " idx = %d\n", vsi->idx);
+ pf_info(pf, " tc_config: numtc = %d, enabled_tc = 0x%x\n",
+ vsi->tc_config.numtc, vsi->tc_config.enabled_tc);
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
- dev_info(&pf->pdev->dev,
- " tc_config: tc = %d, qoffset = %d, qcount = %d, netdev_tc = %d\n",
- i, vsi->tc_config.tc_info[i].qoffset,
- vsi->tc_config.tc_info[i].qcount,
- vsi->tc_config.tc_info[i].netdev_tc);
+ pf_info(pf, " tc_config: tc = %d, qoffset = %d, qcount = %d, netdev_tc = %d\n",
+ i, vsi->tc_config.tc_info[i].qoffset,
+ vsi->tc_config.tc_info[i].qcount,
+ vsi->tc_config.tc_info[i].netdev_tc);
}
- dev_info(&pf->pdev->dev,
- " bw: bw_limit = %d, bw_max_quanta = %d\n",
- vsi->bw_limit, vsi->bw_max_quanta);
+ pf_info(pf, " bw: bw_limit = %d, bw_max_quanta = %d\n",
+ vsi->bw_limit, vsi->bw_max_quanta);
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
- dev_info(&pf->pdev->dev,
- " bw[%d]: ets_share_credits = %d, ets_limit_credits = %d, max_quanta = %d\n",
- i, vsi->bw_ets_share_credits[i],
- vsi->bw_ets_limit_credits[i],
- vsi->bw_ets_max_quanta[i]);
+ pf_info(pf, " bw[%d]: ets_share_credits = %d, ets_limit_credits = %d, max_quanta = %d\n",
+ i, vsi->bw_ets_share_credits[i],
+ vsi->bw_ets_limit_credits[i],
+ vsi->bw_ets_max_quanta[i]);
}
}
@@ -729,40 +650,36 @@ static void i40e_dbg_dump_aq_desc(struct i40e_pf *pf)
int i;
/* first the send (command) ring, then the receive (event) ring */
- dev_info(&pf->pdev->dev, "%s: AdminQ Tx Ring\n", __func__);
+ pf_info(pf, "%s: AdminQ Tx Ring\n", __func__);
ring = &(hw->aq.asq);
for (i = 0; i < ring->count; i++) {
struct i40e_aq_desc *d = I40E_ADMINQ_DESC(*ring, i);
- dev_info(&pf->pdev->dev,
- " at[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n",
- i, d->flags, d->opcode, d->datalen, d->retval,
- d->cookie_high, d->cookie_low);
- dev_info(&pf->pdev->dev,
- " %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
- d->params.raw[0], d->params.raw[1], d->params.raw[2],
- d->params.raw[3], d->params.raw[4], d->params.raw[5],
- d->params.raw[6], d->params.raw[7], d->params.raw[8],
- d->params.raw[9], d->params.raw[10], d->params.raw[11],
- d->params.raw[12], d->params.raw[13], d->params.raw[14],
- d->params.raw[15]);
+ pf_info(pf, " at[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n",
+ i, d->flags, d->opcode, d->datalen, d->retval,
+ d->cookie_high, d->cookie_low);
+ pf_info(pf, " %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ d->params.raw[0], d->params.raw[1], d->params.raw[2],
+ d->params.raw[3], d->params.raw[4], d->params.raw[5],
+ d->params.raw[6], d->params.raw[7], d->params.raw[8],
+ d->params.raw[9], d->params.raw[10], d->params.raw[11],
+ d->params.raw[12], d->params.raw[13], d->params.raw[14],
+ d->params.raw[15]);
}
- dev_info(&pf->pdev->dev, "%s: AdminQ Rx Ring\n", __func__);
+ pf_info(pf, "%s: AdminQ Rx Ring\n", __func__);
ring = &(hw->aq.arq);
for (i = 0; i < ring->count; i++) {
struct i40e_aq_desc *d = I40E_ADMINQ_DESC(*ring, i);
- dev_info(&pf->pdev->dev,
- " ar[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n",
- i, d->flags, d->opcode, d->datalen, d->retval,
- d->cookie_high, d->cookie_low);
- dev_info(&pf->pdev->dev,
- " %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
- d->params.raw[0], d->params.raw[1], d->params.raw[2],
- d->params.raw[3], d->params.raw[4], d->params.raw[5],
- d->params.raw[6], d->params.raw[7], d->params.raw[8],
- d->params.raw[9], d->params.raw[10], d->params.raw[11],
- d->params.raw[12], d->params.raw[13], d->params.raw[14],
- d->params.raw[15]);
+ pf_info(pf, " ar[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n",
+ i, d->flags, d->opcode, d->datalen, d->retval,
+ d->cookie_high, d->cookie_low);
+ pf_info(pf, " %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ d->params.raw[0], d->params.raw[1], d->params.raw[2],
+ d->params.raw[3], d->params.raw[4], d->params.raw[5],
+ d->params.raw[6], d->params.raw[7], d->params.raw[8],
+ d->params.raw[9], d->params.raw[10], d->params.raw[11],
+ d->params.raw[12], d->params.raw[13], d->params.raw[14],
+ d->params.raw[15]);
}
}
@@ -785,29 +702,23 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: vsi %d not found\n", __func__, vsi_seid);
+ pf_info(pf, "%s: vsi %d not found\n", __func__, vsi_seid);
if (is_rx_ring)
- dev_info(&pf->pdev->dev,
- "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
+ pf_info(pf, "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
else
- dev_info(&pf->pdev->dev,
- "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
+ pf_info(pf, "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
return;
}
if (ring_id >= vsi->num_queue_pairs || ring_id < 0) {
- dev_info(&pf->pdev->dev,
- "%s: ring %d not found\n", __func__, ring_id);
+ pf_info(pf, "%s: ring %d not found\n", __func__, ring_id);
if (is_rx_ring)
- dev_info(&pf->pdev->dev,
- "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
+ pf_info(pf, "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
else
- dev_info(&pf->pdev->dev,
- "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
+ pf_info(pf, "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
return;
}
if (is_rx_ring)
@@ -815,8 +726,8 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
else
ring = vsi->tx_rings[ring_id];
if (cnt == 2) {
- dev_info(&pf->pdev->dev, "%s: vsi = %02i %s ring = %02i\n",
- __func__, vsi_seid, is_rx_ring ? "rx" : "tx", ring_id);
+ pf_info(pf, "%s: vsi = %02i %s ring = %02i\n",
+ __func__, vsi_seid, is_rx_ring ? "rx" : "tx", ring_id);
for (i = 0; i < ring.count; i++) {
if (is_rx_ring)
ds = I40E_RX_DESC(&ring, i);
@@ -825,21 +736,19 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
I40E_TX_DESC(&ring, i);
if ((sizeof(union i40e_rx_desc) ==
sizeof(union i40e_16byte_rx_desc)) || (!is_rx_ring))
- dev_info(&pf->pdev->dev,
- " d[%03i] = 0x%016llx 0x%016llx\n", i,
- ds->read.pkt_addr, ds->read.hdr_addr);
+ pf_info(pf, " d[%03i] = 0x%016llx 0x%016llx\n",
+ i, ds->read.pkt_addr,
+ ds->read.hdr_addr);
else
- dev_info(&pf->pdev->dev,
- " d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n",
- i, ds->read.pkt_addr,
- ds->read.hdr_addr,
- ds->read.rsvd1, ds->read.rsvd2);
+ pf_info(pf, " d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n",
+ i, ds->read.pkt_addr,
+ ds->read.hdr_addr,
+ ds->read.rsvd1, ds->read.rsvd2);
}
} else if (cnt == 3) {
if (desc_n >= ring.count || desc_n < 0) {
- dev_info(&pf->pdev->dev,
- "%s: descriptor %d not found\n",
- __func__, desc_n);
+ pf_info(pf, "%s: descriptor %d not found\n",
+ __func__, desc_n);
return;
}
if (is_rx_ring)
@@ -848,26 +757,22 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
ds = (union i40e_rx_desc *)I40E_TX_DESC(&ring, desc_n);
if ((sizeof(union i40e_rx_desc) ==
sizeof(union i40e_16byte_rx_desc)) || (!is_rx_ring))
- dev_info(&pf->pdev->dev,
- "%s: vsi = %02i %s ring = %02i d[%03i] = 0x%016llx 0x%016llx\n",
- __func__, vsi_seid,
- is_rx_ring ? "rx" : "tx", ring_id,
- desc_n, ds->read.pkt_addr, ds->read.hdr_addr);
+ pf_info(pf, "%s: vsi = %02i %s ring = %02i d[%03i] = 0x%016llx 0x%016llx\n",
+ __func__, vsi_seid,
+ is_rx_ring ? "rx" : "tx", ring_id,
+ desc_n, ds->read.pkt_addr, ds->read.hdr_addr);
else
- dev_info(&pf->pdev->dev,
- "%s: vsi = %02i rx ring = %02i d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n",
- __func__, vsi_seid, ring_id,
- desc_n, ds->read.pkt_addr, ds->read.hdr_addr,
- ds->read.rsvd1, ds->read.rsvd2);
+ pf_info(pf, "%s: vsi = %02i rx ring = %02i d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n",
+ __func__, vsi_seid, ring_id,
+ desc_n, ds->read.pkt_addr, ds->read.hdr_addr,
+ ds->read.rsvd1, ds->read.rsvd2);
} else {
if (is_rx_ring)
- dev_info(&pf->pdev->dev,
- "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
+ pf_info(pf, "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
else
- dev_info(&pf->pdev->dev,
- "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
+ pf_info(pf, "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
}
}
@@ -881,8 +786,8 @@ static void i40e_dbg_dump_vsi_no_seid(struct i40e_pf *pf)
for (i = 0; i < pf->hw.func_caps.num_vsis; i++)
if (pf->vsi[i])
- dev_info(&pf->pdev->dev, "%s: dump vsi[%d]: %d\n",
- __func__, i, pf->vsi[i]->seid);
+ pf_info(pf, "%s: dump vsi[%d]: %d\n",
+ __func__, i, pf->vsi[i]->seid);
}
/**
@@ -893,23 +798,18 @@ static void i40e_dbg_dump_vsi_no_seid(struct i40e_pf *pf)
static void i40e_dbg_dump_eth_stats(struct i40e_pf *pf,
struct i40e_eth_stats *estats)
{
- dev_info(&pf->pdev->dev, " ethstats:\n");
- dev_info(&pf->pdev->dev,
- " rx_bytes = \t%lld \trx_unicast = \t\t%lld \trx_multicast = \t%lld\n",
+ pf_info(pf, " ethstats:\n");
+ pf_info(pf, " rx_bytes = \t%lld \trx_unicast = \t\t%lld \trx_multicast = \t%lld\n",
estats->rx_bytes, estats->rx_unicast, estats->rx_multicast);
- dev_info(&pf->pdev->dev,
- " rx_broadcast = \t%lld \trx_discards = \t\t%lld \trx_errors = \t%lld\n",
- estats->rx_broadcast, estats->rx_discards, estats->rx_errors);
- dev_info(&pf->pdev->dev,
- " rx_missed = \t%lld \trx_unknown_protocol = \t%lld \ttx_bytes = \t%lld\n",
- estats->rx_missed, estats->rx_unknown_protocol,
- estats->tx_bytes);
- dev_info(&pf->pdev->dev,
- " tx_unicast = \t%lld \ttx_multicast = \t\t%lld \ttx_broadcast = \t%lld\n",
- estats->tx_unicast, estats->tx_multicast, estats->tx_broadcast);
- dev_info(&pf->pdev->dev,
- " tx_discards = \t%lld \ttx_errors = \t\t%lld\n",
- estats->tx_discards, estats->tx_errors);
+ pf_info(pf, " rx_broadcast = \t%lld \trx_discards = \t\t%lld \trx_errors = \t%lld\n",
+ estats->rx_broadcast, estats->rx_discards, estats->rx_errors);
+ pf_info(pf, " rx_missed = \t%lld \trx_unknown_protocol = \t%lld \ttx_bytes = \t%lld\n",
+ estats->rx_missed, estats->rx_unknown_protocol,
+ estats->tx_bytes);
+ pf_info(pf, " tx_unicast = \t%lld \ttx_multicast = \t\t%lld \ttx_broadcast = \t%lld\n",
+ estats->tx_unicast, estats->tx_multicast, estats->tx_broadcast);
+ pf_info(pf, " tx_discards = \t%lld \ttx_errors = \t\t%lld\n",
+ estats->tx_discards, estats->tx_errors);
}
/**
@@ -922,75 +822,61 @@ static void i40e_dbg_dump_stats(struct i40e_pf *pf,
{
int i;
- dev_info(&pf->pdev->dev, " stats:\n");
- dev_info(&pf->pdev->dev,
- " crc_errors = \t\t%lld \tillegal_bytes = \t%lld \terror_bytes = \t\t%lld\n",
- stats->crc_errors, stats->illegal_bytes, stats->error_bytes);
- dev_info(&pf->pdev->dev,
- " mac_local_faults = \t%lld \tmac_remote_faults = \t%lld \trx_length_errors = \t%lld\n",
- stats->mac_local_faults, stats->mac_remote_faults,
- stats->rx_length_errors);
- dev_info(&pf->pdev->dev,
- " link_xon_rx = \t\t%lld \tlink_xoff_rx = \t\t%lld \tlink_xon_tx = \t\t%lld\n",
- stats->link_xon_rx, stats->link_xoff_rx, stats->link_xon_tx);
- dev_info(&pf->pdev->dev,
- " link_xoff_tx = \t\t%lld \trx_size_64 = \t\t%lld \trx_size_127 = \t\t%lld\n",
- stats->link_xoff_tx, stats->rx_size_64, stats->rx_size_127);
- dev_info(&pf->pdev->dev,
- " rx_size_255 = \t\t%lld \trx_size_511 = \t\t%lld \trx_size_1023 = \t\t%lld\n",
- stats->rx_size_255, stats->rx_size_511, stats->rx_size_1023);
- dev_info(&pf->pdev->dev,
- " rx_size_big = \t\t%lld \trx_undersize = \t\t%lld \trx_jabber = \t\t%lld\n",
- stats->rx_size_big, stats->rx_undersize, stats->rx_jabber);
- dev_info(&pf->pdev->dev,
- " rx_fragments = \t\t%lld \trx_oversize = \t\t%lld \ttx_size_64 = \t\t%lld\n",
- stats->rx_fragments, stats->rx_oversize, stats->tx_size_64);
- dev_info(&pf->pdev->dev,
- " tx_size_127 = \t\t%lld \ttx_size_255 = \t\t%lld \ttx_size_511 = \t\t%lld\n",
- stats->tx_size_127, stats->tx_size_255, stats->tx_size_511);
- dev_info(&pf->pdev->dev,
- " tx_size_1023 = \t\t%lld \ttx_size_big = \t\t%lld \tmac_short_packet_dropped = \t%lld\n",
- stats->tx_size_1023, stats->tx_size_big,
- stats->mac_short_packet_dropped);
+ pf_info(pf, " stats:\n");
+ pf_info(pf, " crc_errors = \t\t%lld \tillegal_bytes = \t%lld \terror_bytes = \t\t%lld\n",
+ stats->crc_errors, stats->illegal_bytes, stats->error_bytes);
+ pf_info(pf, " mac_local_faults = \t%lld \tmac_remote_faults = \t%lld \trx_length_errors = \t%lld\n",
+ stats->mac_local_faults, stats->mac_remote_faults,
+ stats->rx_length_errors);
+ pf_info(pf, " link_xon_rx = \t\t%lld \tlink_xoff_rx = \t\t%lld \tlink_xon_tx = \t\t%lld\n",
+ stats->link_xon_rx, stats->link_xoff_rx, stats->link_xon_tx);
+ pf_info(pf, " link_xoff_tx = \t\t%lld \trx_size_64 = \t\t%lld \trx_size_127 = \t\t%lld\n",
+ stats->link_xoff_tx, stats->rx_size_64, stats->rx_size_127);
+ pf_info(pf, " rx_size_255 = \t\t%lld \trx_size_511 = \t\t%lld \trx_size_1023 = \t\t%lld\n",
+ stats->rx_size_255, stats->rx_size_511, stats->rx_size_1023);
+ pf_info(pf, " rx_size_big = \t\t%lld \trx_undersize = \t\t%lld \trx_jabber = \t\t%lld\n",
+ stats->rx_size_big, stats->rx_undersize, stats->rx_jabber);
+ pf_info(pf, " rx_fragments = \t\t%lld \trx_oversize = \t\t%lld \ttx_size_64 = \t\t%lld\n",
+ stats->rx_fragments, stats->rx_oversize, stats->tx_size_64);
+ pf_info(pf, " tx_size_127 = \t\t%lld \ttx_size_255 = \t\t%lld \ttx_size_511 = \t\t%lld\n",
+ stats->tx_size_127, stats->tx_size_255, stats->tx_size_511);
+ pf_info(pf, " tx_size_1023 = \t\t%lld \ttx_size_big = \t\t%lld \tmac_short_packet_dropped = \t%lld\n",
+ stats->tx_size_1023, stats->tx_size_big,
+ stats->mac_short_packet_dropped);
for (i = 0; i < 8; i += 4) {
- dev_info(&pf->pdev->dev,
- " priority_xon_rx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
- i, stats->priority_xon_rx[i],
- i+1, stats->priority_xon_rx[i+1],
- i+2, stats->priority_xon_rx[i+2],
- i+3, stats->priority_xon_rx[i+3]);
+ pf_info(pf, " priority_xon_rx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
+ i, stats->priority_xon_rx[i],
+ i+1, stats->priority_xon_rx[i+1],
+ i+2, stats->priority_xon_rx[i+2],
+ i+3, stats->priority_xon_rx[i+3]);
}
for (i = 0; i < 8; i += 4) {
- dev_info(&pf->pdev->dev,
- " priority_xoff_rx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
- i, stats->priority_xoff_rx[i],
- i+1, stats->priority_xoff_rx[i+1],
- i+2, stats->priority_xoff_rx[i+2],
- i+3, stats->priority_xoff_rx[i+3]);
+ pf_info(pf, " priority_xoff_rx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
+ i, stats->priority_xoff_rx[i],
+ i+1, stats->priority_xoff_rx[i+1],
+ i+2, stats->priority_xoff_rx[i+2],
+ i+3, stats->priority_xoff_rx[i+3]);
}
for (i = 0; i < 8; i += 4) {
- dev_info(&pf->pdev->dev,
- " priority_xon_tx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
- i, stats->priority_xon_tx[i],
- i+1, stats->priority_xon_tx[i+1],
- i+2, stats->priority_xon_tx[i+2],
- i+3, stats->priority_xon_rx[i+3]);
+ pf_info(pf, " priority_xon_tx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
+ i, stats->priority_xon_tx[i],
+ i+1, stats->priority_xon_tx[i+1],
+ i+2, stats->priority_xon_tx[i+2],
+ i+3, stats->priority_xon_rx[i+3]);
}
for (i = 0; i < 8; i += 4) {
- dev_info(&pf->pdev->dev,
- " priority_xoff_tx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
- i, stats->priority_xoff_tx[i],
- i+1, stats->priority_xoff_tx[i+1],
- i+2, stats->priority_xoff_tx[i+2],
- i+3, stats->priority_xoff_tx[i+3]);
+ pf_info(pf, " priority_xoff_tx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
+ i, stats->priority_xoff_tx[i],
+ i+1, stats->priority_xoff_tx[i+1],
+ i+2, stats->priority_xoff_tx[i+2],
+ i+3, stats->priority_xoff_tx[i+3]);
}
for (i = 0; i < 8; i += 4) {
- dev_info(&pf->pdev->dev,
- " priority_xon_2_xoff[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
- i, stats->priority_xon_2_xoff[i],
- i+1, stats->priority_xon_2_xoff[i+1],
- i+2, stats->priority_xon_2_xoff[i+2],
- i+3, stats->priority_xon_2_xoff[i+3]);
+ pf_info(pf, " priority_xon_2_xoff[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n",
+ i, stats->priority_xon_2_xoff[i],
+ i+1, stats->priority_xon_2_xoff[i+1],
+ i+2, stats->priority_xon_2_xoff[i+2],
+ i+3, stats->priority_xon_2_xoff[i+3]);
}
i40e_dbg_dump_eth_stats(pf, &stats->eth);
@@ -1007,20 +893,18 @@ static void i40e_dbg_dump_veb_seid(struct i40e_pf *pf, int seid)
if ((seid < I40E_BASE_VEB_SEID) ||
(seid >= (I40E_MAX_VEB + I40E_BASE_VEB_SEID))) {
- dev_info(&pf->pdev->dev, "%s: %d: bad seid\n", __func__, seid);
+ pf_info(pf, "%s: %d: bad seid\n", __func__, seid);
return;
}
veb = i40e_dbg_find_veb(pf, seid);
if (!veb) {
- dev_info(&pf->pdev->dev,
- "%s: %d: can't find veb\n", __func__, seid);
+ pf_info(pf, "%s: %d: can't find veb\n", __func__, seid);
return;
}
- dev_info(&pf->pdev->dev,
- "veb idx=%d,%d stats_ic=%d seid=%d uplink=%d\n",
- veb->idx, veb->veb_idx, veb->stats_idx, veb->seid,
- veb->uplink_seid);
+ pf_info(pf, "veb idx=%d,%d stats_ic=%d seid=%d uplink=%d\n",
+ veb->idx, veb->veb_idx, veb->stats_idx, veb->seid,
+ veb->uplink_seid);
i40e_dbg_dump_eth_stats(pf, &veb->stats);
}
@@ -1088,32 +972,28 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
/* default to PF VSI */
vsi_seid = pf->vsi[pf->lan_vsi]->seid;
} else if (vsi_seid < 0) {
- dev_info(&pf->pdev->dev,
- "%s: add VSI %d: bad vsi seid\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: add VSI %d: bad vsi seid\n",
+ __func__, vsi_seid);
goto command_write_done;
}
vsi = i40e_vsi_setup(pf, I40E_VSI_VMDQ2, vsi_seid, 0);
if (vsi)
- dev_info(&pf->pdev->dev, "%s: added VSI %d to relay %d\n",
- __func__, vsi->seid, vsi->uplink_seid);
+ pf_info(pf, "%s: added VSI %d to relay %d\n",
+ __func__, vsi->seid, vsi->uplink_seid);
else
- dev_info(&pf->pdev->dev, "%s: '%s' failed\n",
- __func__, cmd_buf);
+ pf_info(pf, "%s: '%s' failed\n", __func__, cmd_buf);
} else if (strncmp(cmd_buf, "del vsi", 7) == 0) {
sscanf(&cmd_buf[7], "%i", &vsi_seid);
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: del VSI %d: seid not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: del VSI %d: seid not found\n",
+ __func__, vsi_seid);
goto command_write_done;
}
- dev_info(&pf->pdev->dev, "%s: deleting VSI %d\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: deleting VSI %d\n", __func__, vsi_seid);
i40e_vsi_release(vsi);
} else if (strncmp(cmd_buf, "add relay", 9) == 0) {
@@ -1122,22 +1002,19 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
cnt = sscanf(&cmd_buf[9], "%i %i", &uplink_seid, &vsi_seid);
if (cnt != 2) {
- dev_info(&pf->pdev->dev,
- "%s: add relay: bad command string, cnt=%d\n",
- __func__, cnt);
+ pf_info(pf, "%s: add relay: bad command string, cnt=%d\n",
+ __func__, cnt);
goto command_write_done;
} else if (uplink_seid < 0) {
- dev_info(&pf->pdev->dev,
- "%s: add relay %d: bad uplink seid\n",
- __func__, uplink_seid);
+ pf_info(pf, "%s: add relay %d: bad uplink seid\n",
+ __func__, uplink_seid);
goto command_write_done;
}
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: add relay: vsi VSI %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: add relay: vsi VSI %d not found\n",
+ __func__, vsi_seid);
goto command_write_done;
}
@@ -1146,33 +1023,29 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
break;
if (i >= I40E_MAX_VEB && uplink_seid != 0 &&
uplink_seid != pf->mac_seid) {
- dev_info(&pf->pdev->dev,
- "%s: add relay: relay uplink %d not found\n",
- __func__, uplink_seid);
+ pf_info(pf, "%s: add relay: relay uplink %d not found\n",
+ __func__, uplink_seid);
goto command_write_done;
}
veb = i40e_veb_setup(pf, 0, uplink_seid, vsi_seid,
vsi->tc_config.enabled_tc);
if (veb)
- dev_info(&pf->pdev->dev, "%s: added relay %d\n",
- __func__, veb->seid);
+ pf_info(pf, "%s: added relay %d\n",
+ __func__, veb->seid);
else
- dev_info(&pf->pdev->dev, "%s: add relay failed\n",
- __func__);
+ pf_info(pf, "%s: add relay failed\n", __func__);
} else if (strncmp(cmd_buf, "del relay", 9) == 0) {
int i;
cnt = sscanf(&cmd_buf[9], "%i", &veb_seid);
if (cnt != 1) {
- dev_info(&pf->pdev->dev,
- "%s: del relay: bad command string, cnt=%d\n",
- __func__, cnt);
+ pf_info(pf, "%s: del relay: bad command string, cnt=%d\n",
+ __func__, cnt);
goto command_write_done;
} else if (veb_seid < 0) {
- dev_info(&pf->pdev->dev,
- "%s: del relay %d: bad relay seid\n",
- __func__, veb_seid);
+ pf_info(pf, "%s: del relay %d: bad relay seid\n",
+ __func__, veb_seid);
goto command_write_done;
}
@@ -1181,14 +1054,12 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
if (pf->veb[i] && pf->veb[i]->seid == veb_seid)
break;
if (i >= I40E_MAX_VEB) {
- dev_info(&pf->pdev->dev,
- "%s: del relay: relay %d not found\n",
- __func__, veb_seid);
+ pf_info(pf, "%s: del relay: relay %d not found\n",
+ __func__, veb_seid);
goto command_write_done;
}
- dev_info(&pf->pdev->dev, "%s: deleting relay %d\n",
- __func__, veb_seid);
+ pf_info(pf, "%s: deleting relay %d\n", __func__, veb_seid);
i40e_veb_release(pf->veb[i]);
} else if (strncmp(cmd_buf, "add macaddr", 11) == 0) {
@@ -1205,30 +1076,26 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
if (cnt == 7) {
vlan = 0;
} else if (cnt != 8) {
- dev_info(&pf->pdev->dev,
- "%s: add macaddr: bad command string, cnt=%d\n",
- __func__, cnt);
+ pf_info(pf, "%s: add macaddr: bad command string, cnt=%d\n",
+ __func__, cnt);
goto command_write_done;
}
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: add macaddr: VSI %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: add macaddr: VSI %d not found\n",
+ __func__, vsi_seid);
goto command_write_done;
}
f = i40e_add_filter(vsi, ma, vlan, false, false);
ret = i40e_sync_vsi_filters(vsi);
if (f && !ret)
- dev_info(&pf->pdev->dev,
- "%s: add macaddr: %pM vlan=%d added to VSI %d\n",
- __func__, ma, vlan, vsi_seid);
+ pf_info(pf, "%s: add macaddr: %pM vlan=%d added to VSI %d\n",
+ __func__, ma, vlan, vsi_seid);
else
- dev_info(&pf->pdev->dev,
- "%s: add macaddr: %pM vlan=%d to VSI %d failed, f=%p ret=%d\n",
- __func__, ma, vlan, vsi_seid, f, ret);
+ pf_info(pf, "%s: add macaddr: %pM vlan=%d to VSI %d failed, f=%p ret=%d\n",
+ __func__, ma, vlan, vsi_seid, f, ret);
} else if (strncmp(cmd_buf, "del macaddr", 11) == 0) {
u8 ma[6];
@@ -1243,30 +1110,26 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
if (cnt == 7) {
vlan = 0;
} else if (cnt != 8) {
- dev_info(&pf->pdev->dev,
- "%s: del macaddr: bad command string, cnt=%d\n",
- __func__, cnt);
+ pf_info(pf, "%s: del macaddr: bad command string, cnt=%d\n",
+ __func__, cnt);
goto command_write_done;
}
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: del macaddr: VSI %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: del macaddr: VSI %d not found\n",
+ __func__, vsi_seid);
goto command_write_done;
}
i40e_del_filter(vsi, ma, vlan, false, false);
ret = i40e_sync_vsi_filters(vsi);
if (!ret)
- dev_info(&pf->pdev->dev,
- "%s: del macaddr: %pM vlan=%d removed from VSI %d\n",
- __func__, ma, vlan, vsi_seid);
+ pf_info(pf, "%s: del macaddr: %pM vlan=%d removed from VSI %d\n",
+ __func__, ma, vlan, vsi_seid);
else
- dev_info(&pf->pdev->dev,
- "%s: del macaddr: %pM vlan=%d from VSI %d failed, ret=%d\n",
- __func__, ma, vlan, vsi_seid, ret);
+ pf_info(pf, "%s: del macaddr: %pM vlan=%d from VSI %d failed, ret=%d\n",
+ __func__, ma, vlan, vsi_seid, ret);
} else if (strncmp(cmd_buf, "add pvid", 8) == 0) {
int v;
@@ -1275,59 +1138,51 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
cnt = sscanf(&cmd_buf[8], "%i %u", &vsi_seid, &v);
if (cnt != 2) {
- dev_info(&pf->pdev->dev,
- "%s: add pvid: bad command string, cnt=%d\n",
- __func__, cnt);
+ pf_info(pf, "%s: add pvid: bad command string, cnt=%d\n",
+ __func__, cnt);
goto command_write_done;
}
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: add pvid: VSI %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: add pvid: VSI %d not found\n",
+ __func__, vsi_seid);
goto command_write_done;
}
vid = (unsigned)v;
ret = i40e_vsi_add_pvid(vsi, vid);
if (!ret)
- dev_info(&pf->pdev->dev,
- "%s: add pvid: %d added to VSI %d\n",
- __func__, vid, vsi_seid);
+ pf_info(pf, "%s: add pvid: %d added to VSI %d\n",
+ __func__, vid, vsi_seid);
else
- dev_info(&pf->pdev->dev,
- "%s: add pvid: %d to VSI %d failed, ret=%d\n",
- __func__, vid, vsi_seid, ret);
+ pf_info(pf, "%s: add pvid: %d to VSI %d failed, ret=%d\n",
+ __func__, vid, vsi_seid, ret);
} else if (strncmp(cmd_buf, "del pvid", 8) == 0) {
i40e_status ret;
cnt = sscanf(&cmd_buf[8], "%i", &vsi_seid);
if (cnt != 1) {
- dev_info(&pf->pdev->dev,
- "%s: del pvid: bad command string, cnt=%d\n",
- __func__, cnt);
+ pf_info(pf, "%s: del pvid: bad command string, cnt=%d\n",
+ __func__, cnt);
goto command_write_done;
}
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: del pvid: VSI %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: del pvid: VSI %d not found\n",
+ __func__, vsi_seid);
goto command_write_done;
}
ret = i40e_vsi_remove_pvid(vsi);
if (!ret)
- dev_info(&pf->pdev->dev,
- "%s: del pvid: removed from VSI %d\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: del pvid: removed from VSI %d\n",
+ __func__, vsi_seid);
else
- dev_info(&pf->pdev->dev,
- "%s: del pvid: VSI %d failed, ret=%d\n",
- __func__, vsi_seid, ret);
+ pf_info(pf, "%s: del pvid: VSI %d failed, ret=%d\n",
+ __func__, vsi_seid, ret);
} else if (strncmp(cmd_buf, "dump", 4) == 0) {
if (strncmp(&cmd_buf[5], "switch", 6) == 0) {
@@ -1360,29 +1215,23 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
} else if (strncmp(&cmd_buf[10], "aq", 2) == 0) {
i40e_dbg_dump_aq_desc(pf);
} else {
- dev_info(&pf->pdev->dev,
- "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: dump desc aq\n", __func__);
+ pf_info(pf, "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
+ pf_info(pf, "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
+ pf_info(pf, "%s: dump desc aq\n", __func__);
}
} else if (strncmp(&cmd_buf[5], "stats", 5) == 0) {
- dev_info(&pf->pdev->dev, "pf stats:\n");
+ pf_info(pf, "pf stats:\n");
i40e_dbg_dump_stats(pf, &pf->stats);
- dev_info(&pf->pdev->dev, "pf stats_offsets:\n");
+ pf_info(pf, "pf stats_offsets:\n");
i40e_dbg_dump_stats(pf, &pf->stats_offsets);
} else if (strncmp(&cmd_buf[5], "reset stats", 11) == 0) {
- dev_info(&pf->pdev->dev,
- "core reset count: %d\n", pf->corer_count);
- dev_info(&pf->pdev->dev,
- "global reset count: %d\n", pf->globr_count);
- dev_info(&pf->pdev->dev,
- "emp reset count: %d\n", pf->empr_count);
- dev_info(&pf->pdev->dev,
- "pf reset count: %d\n", pf->pfr_count);
+ pf_info(pf, "core reset count: %d\n", pf->corer_count);
+ pf_info(pf, "global reset count: %d\n",
+ pf->globr_count);
+ pf_info(pf, "emp reset count: %d\n", pf->empr_count);
+ pf_info(pf, "pf reset count: %d\n", pf->pfr_count);
} else if (strncmp(&cmd_buf[5], "port", 4) == 0) {
struct i40e_aqc_query_port_ets_config_resp *bw_data;
struct i40e_dcbx_config *cfg =
@@ -1403,114 +1252,97 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
pf->mac_seid,
bw_data, NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: Query Port ETS Config AQ command failed =0x%x\n",
- __func__, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: Query Port ETS Config AQ command failed =0x%x\n",
+ __func__, pf->hw.aq.asq_last_status);
kfree(bw_data);
bw_data = NULL;
goto command_write_done;
}
- dev_info(&pf->pdev->dev,
- "%s: port bw: tc_valid=0x%x tc_strict_prio=0x%x, tc_bw_max=0x%04x,0x%04x\n",
- __func__, bw_data->tc_valid_bits,
- bw_data->tc_strict_priority_bits,
- le16_to_cpu(bw_data->tc_bw_max[0]),
- le16_to_cpu(bw_data->tc_bw_max[1]));
+ pf_info(pf, "%s: port bw: tc_valid=0x%x tc_strict_prio=0x%x, tc_bw_max=0x%04x,0x%04x\n",
+ __func__, bw_data->tc_valid_bits,
+ bw_data->tc_strict_priority_bits,
+ le16_to_cpu(bw_data->tc_bw_max[0]),
+ le16_to_cpu(bw_data->tc_bw_max[1]));
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
- dev_info(&pf->pdev->dev, "%s: port bw: tc_bw_share=%d tc_bw_limit=%d\n",
- __func__,
- bw_data->tc_bw_share_credits[i],
- le16_to_cpu(bw_data->tc_bw_limits[i]));
+ pf_info(pf, "%s: port bw: tc_bw_share=%d tc_bw_limit=%d\n",
+ __func__,
+ bw_data->tc_bw_share_credits[i],
+ le16_to_cpu(bw_data->tc_bw_limits[i]));
}
kfree(bw_data);
bw_data = NULL;
- dev_info(&pf->pdev->dev,
- "%s: port ets_cfg: willing=%d cbs=%d, maxtcs=%d\n",
- __func__, cfg->etscfg.willing, cfg->etscfg.cbs,
- cfg->etscfg.maxtcs);
+ pf_info(pf, "%s: port ets_cfg: willing=%d cbs=%d, maxtcs=%d\n",
+ __func__, cfg->etscfg.willing, cfg->etscfg.cbs,
+ cfg->etscfg.maxtcs);
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
- dev_info(&pf->pdev->dev, "%s: port ets_cfg: %d prio_tc=%d tcbw=%d tctsa=%d\n",
- __func__, i,
- cfg->etscfg.prioritytable[i],
- cfg->etscfg.tcbwtable[i],
- cfg->etscfg.tsatable[i]);
+ pf_info(pf, "%s: port ets_cfg: %d prio_tc=%d tcbw=%d tctsa=%d\n",
+ __func__, i,
+ cfg->etscfg.prioritytable[i],
+ cfg->etscfg.tcbwtable[i],
+ cfg->etscfg.tsatable[i]);
}
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
- dev_info(&pf->pdev->dev, "%s: port ets_rec: %d prio_tc=%d tcbw=%d tctsa=%d\n",
- __func__, i,
- cfg->etsrec.prioritytable[i],
- cfg->etsrec.tcbwtable[i],
- cfg->etsrec.tsatable[i]);
+ pf_info(pf, "%s: port ets_rec: %d prio_tc=%d tcbw=%d tctsa=%d\n",
+ __func__, i,
+ cfg->etsrec.prioritytable[i],
+ cfg->etsrec.tcbwtable[i],
+ cfg->etsrec.tsatable[i]);
}
- dev_info(&pf->pdev->dev,
- "%s: port pfc_cfg: willing=%d mbc=%d, pfccap=%d pfcenable=0x%x\n",
- __func__, cfg->pfc.willing, cfg->pfc.mbc,
- cfg->pfc.pfccap, cfg->pfc.pfcenable);
- dev_info(&pf->pdev->dev,
- "%s: port app_table: num_apps=%d\n",
- __func__, cfg->numapps);
+ pf_info(pf, "%s: port pfc_cfg: willing=%d mbc=%d, pfccap=%d pfcenable=0x%x\n",
+ __func__, cfg->pfc.willing, cfg->pfc.mbc,
+ cfg->pfc.pfccap, cfg->pfc.pfcenable);
+ pf_info(pf, "%s: port app_table: num_apps=%d\n",
+ __func__, cfg->numapps);
for (i = 0; i < cfg->numapps; i++) {
- dev_info(&pf->pdev->dev, "%s: port app_table: %d prio=%d selector=%d protocol=0x%x\n",
- __func__, i, cfg->app[i].priority,
- cfg->app[i].selector,
- cfg->app[i].protocolid);
+ pf_info(pf, "%s: port app_table: %d prio=%d selector=%d protocol=0x%x\n",
+ __func__, i, cfg->app[i].priority,
+ cfg->app[i].selector,
+ cfg->app[i].protocolid);
}
/* Peer TLV DCBX data */
- dev_info(&pf->pdev->dev,
- "%s: remote port ets_cfg: willing=%d cbs=%d, maxtcs=%d\n",
- __func__, r_cfg->etscfg.willing,
- r_cfg->etscfg.cbs, r_cfg->etscfg.maxtcs);
+ pf_info(pf, "%s: remote port ets_cfg: willing=%d cbs=%d, maxtcs=%d\n",
+ __func__, r_cfg->etscfg.willing,
+ r_cfg->etscfg.cbs, r_cfg->etscfg.maxtcs);
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
- dev_info(&pf->pdev->dev, "%s: remote port ets_cfg: %d prio_tc=%d tcbw=%d tctsa=%d\n",
- __func__, i,
- r_cfg->etscfg.prioritytable[i],
- r_cfg->etscfg.tcbwtable[i],
- r_cfg->etscfg.tsatable[i]);
+ pf_info(pf, "%s: remote port ets_cfg: %d prio_tc=%d tcbw=%d tctsa=%d\n",
+ __func__, i,
+ r_cfg->etscfg.prioritytable[i],
+ r_cfg->etscfg.tcbwtable[i],
+ r_cfg->etscfg.tsatable[i]);
}
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
- dev_info(&pf->pdev->dev, "%s: remote port ets_rec: %d prio_tc=%d tcbw=%d tctsa=%d\n",
- __func__, i,
- r_cfg->etsrec.prioritytable[i],
- r_cfg->etsrec.tcbwtable[i],
- r_cfg->etsrec.tsatable[i]);
+ pf_info(pf, "%s: remote port ets_rec: %d prio_tc=%d tcbw=%d tctsa=%d\n",
+ __func__, i,
+ r_cfg->etsrec.prioritytable[i],
+ r_cfg->etsrec.tcbwtable[i],
+ r_cfg->etsrec.tsatable[i]);
}
- dev_info(&pf->pdev->dev,
- "%s: remote port pfc_cfg: willing=%d mbc=%d, pfccap=%d pfcenable=0x%x\n",
- __func__, r_cfg->pfc.willing,
- r_cfg->pfc.mbc,
- r_cfg->pfc.pfccap,
- r_cfg->pfc.pfcenable);
- dev_info(&pf->pdev->dev,
- "%s: remote port app_table: num_apps=%d\n",
- __func__, r_cfg->numapps);
+ pf_info(pf, "%s: remote port pfc_cfg: willing=%d mbc=%d, pfccap=%d pfcenable=0x%x\n",
+ __func__, r_cfg->pfc.willing,
+ r_cfg->pfc.mbc,
+ r_cfg->pfc.pfccap,
+ r_cfg->pfc.pfcenable);
+ pf_info(pf, "%s: remote port app_table: num_apps=%d\n",
+ __func__, r_cfg->numapps);
for (i = 0; i < r_cfg->numapps; i++) {
- dev_info(&pf->pdev->dev, "%s: remote port app_table: %d prio=%d selector=%d protocol=0x%x\n",
- __func__, i,
- r_cfg->app[i].priority,
- r_cfg->app[i].selector,
- r_cfg->app[i].protocolid);
+ pf_info(pf, "%s: remote port app_table: %d prio=%d selector=%d protocol=0x%x\n",
+ __func__, i,
+ r_cfg->app[i].priority,
+ r_cfg->app[i].selector,
+ r_cfg->app[i].protocolid);
}
} else {
- dev_info(&pf->pdev->dev,
- "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>],\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: dump switch, dump vsi [seid] or\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: dump stats\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: dump reset stats\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: dump port\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: dump debug fwdata <cluster_id> <table_id> <index>\n",
- __func__);
+ pf_info(pf, "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>],\n",
+ __func__);
+ pf_info(pf, "%s: dump switch, dump vsi [seid] or\n",
+ __func__);
+ pf_info(pf, "%s: dump stats\n", __func__);
+ pf_info(pf, "%s: dump reset stats\n", __func__);
+ pf_info(pf, "%s: dump port\n", __func__);
+ pf_info(pf, "%s: dump debug fwdata <cluster_id> <table_id> <index>\n",
+ __func__);
}
} else if (strncmp(cmd_buf, "msg_enable", 10) == 0) {
@@ -1519,29 +1351,26 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
if (cnt) {
if (I40E_DEBUG_USER & level) {
pf->hw.debug_mask = level;
- dev_info(&pf->pdev->dev,
- "%s: set hw.debug_mask = 0x%08x\n",
- __func__, pf->hw.debug_mask);
+ pf_info(pf, "%s: set hw.debug_mask = 0x%08x\n",
+ __func__, pf->hw.debug_mask);
}
pf->msg_enable = level;
- dev_info(&pf->pdev->dev,
- "%s: set msg_enable = 0x%08x\n",
- __func__, pf->msg_enable);
+ pf_info(pf, "%s: set msg_enable = 0x%08x\n",
+ __func__, pf->msg_enable);
} else {
- dev_info(&pf->pdev->dev,
- "%s: msg_enable = 0x%08x\n",
- __func__, pf->msg_enable);
+ pf_info(pf, "%s: msg_enable = 0x%08x\n",
+ __func__, pf->msg_enable);
}
} else if (strncmp(cmd_buf, "pfr", 3) == 0) {
- dev_info(&pf->pdev->dev, "%s: forcing PFR\n", __func__);
+ pf_info(pf, "%s: forcing PFR\n", __func__);
i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED));
} else if (strncmp(cmd_buf, "corer", 5) == 0) {
- dev_info(&pf->pdev->dev, "%s: forcing CoreR\n", __func__);
+ pf_info(pf, "%s: forcing CoreR\n", __func__);
i40e_do_reset(pf, (1 << __I40E_CORE_RESET_REQUESTED));
} else if (strncmp(cmd_buf, "globr", 5) == 0) {
- dev_info(&pf->pdev->dev, "%s: forcing GlobR\n", __func__);
+ pf_info(pf, "%s: forcing GlobR\n", __func__);
i40e_do_reset(pf, (1 << __I40E_GLOBAL_RESET_REQUESTED));
} else if (strncmp(cmd_buf, "read", 4) == 0) {
@@ -1549,40 +1378,39 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
u32 value;
cnt = sscanf(&cmd_buf[4], "%x", &address);
if (cnt != 1) {
- dev_info(&pf->pdev->dev, "%s: read <reg>\n", __func__);
+ pf_info(pf, "%s: read <reg>\n", __func__);
goto command_write_done;
}
/* check the range on address */
if (address >= I40E_MAX_REGISTER) {
- dev_info(&pf->pdev->dev, "%s: read reg address 0x%08x too large\n",
- __func__, address);
+ pf_info(pf, "%s: read reg address 0x%08x too large\n",
+ __func__, address);
goto command_write_done;
}
value = rd32(&pf->hw, address);
- dev_info(&pf->pdev->dev, "%s: read: 0x%08x = 0x%08x\n",
- __func__, address, value);
+ pf_info(pf, "%s: read: 0x%08x = 0x%08x\n",
+ __func__, address, value);
} else if (strncmp(cmd_buf, "write", 5) == 0) {
u32 address, value;
cnt = sscanf(&cmd_buf[5], "%x %x", &address, &value);
if (cnt != 2) {
- dev_info(&pf->pdev->dev, "%s: write <reg> <value>\n",
- __func__);
+ pf_info(pf, "%s: write <reg> <value>\n", __func__);
goto command_write_done;
}
/* check the range on address */
if (address >= I40E_MAX_REGISTER) {
- dev_info(&pf->pdev->dev, "%s: write reg address 0x%08x too large\n",
- __func__, address);
+ pf_info(pf, "%s: write reg address 0x%08x too large\n",
+ __func__, address);
goto command_write_done;
}
wr32(&pf->hw, address, value);
value = rd32(&pf->hw, address);
- dev_info(&pf->pdev->dev, "%s: write: 0x%08x = 0x%08x\n",
- __func__, address, value);
+ pf_info(pf, "%s: write: 0x%08x = 0x%08x\n",
+ __func__, address, value);
} else if (strncmp(cmd_buf, "clear_stats", 11) == 0) {
if (strncmp(&cmd_buf[12], "vsi", 3) == 0) {
cnt = sscanf(&cmd_buf[15], "%d", &vsi_seid);
@@ -1590,34 +1418,28 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
int i;
for (i = 0; i < pf->hw.func_caps.num_vsis; i++)
i40e_vsi_reset_stats(pf->vsi[i]);
- dev_info(&pf->pdev->dev,
- "%s: vsi clear stats called for all vsi's\n",
- __func__);
+ pf_info(pf, "%s: vsi clear stats called for all vsi's\n",
+ __func__);
} else if (cnt == 1) {
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: clear_stats vsi: bad vsi %d\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: clear_stats vsi: bad vsi %d\n",
+ __func__, vsi_seid);
goto command_write_done;
}
i40e_vsi_reset_stats(vsi);
- dev_info(&pf->pdev->dev,
- "%s: vsi clear stats called for vsi %d\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: vsi clear stats called for vsi %d\n",
+ __func__, vsi_seid);
} else {
- dev_info(&pf->pdev->dev,
- "%s: clear_stats vsi [seid]\n",
- __func__);
+ pf_info(pf, "%s: clear_stats vsi [seid]\n",
+ __func__);
}
} else if (strncmp(&cmd_buf[12], "pf", 2) == 0) {
i40e_pf_reset_stats(pf);
- dev_info(&pf->pdev->dev,
- "%s: pf clear stats called\n", __func__);
+ pf_info(pf, "%s: pf clear stats called\n", __func__);
} else {
- dev_info(&pf->pdev->dev,
- "%s: clear_stats vsi [seid] or clear_stats pf\n",
- __func__);
+ pf_info(pf, "%s: clear_stats vsi [seid] or clear_stats pf\n",
+ __func__);
}
} else if ((strncmp(cmd_buf, "add fd_filter", 13) == 0) ||
(strncmp(cmd_buf, "rem fd_filter", 13) == 0)) {
@@ -1651,9 +1473,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
&fd_data.fd_status, &fd_data.cnt_index,
&fd_data.fd_id, &packet_len, asc_packet);
if (cnt != 10) {
- dev_info(&pf->pdev->dev,
- "%s: program fd_filter: bad command string, cnt=%d\n",
- __func__, cnt);
+ pf_info(pf, "%s: program fd_filter: bad command string, cnt=%d\n",
+ __func__, cnt);
kfree(asc_packet);
asc_packet = NULL;
kfree(fd_data.raw_packet);
@@ -1668,8 +1489,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
packet_len = min_t(u16,
packet_len, I40E_FDIR_MAX_RAW_PACKET_LOOKUP);
- dev_info(&pf->pdev->dev,
- "%s: FD raw packet:\n", __func__);
+ pf_info(pf, "%s: FD raw packet:\n", __func__);
for (i = 0; i < packet_len; i++) {
sscanf(&asc_packet[j], "%2hhx ",
&fd_data.raw_packet[i]);
@@ -1681,16 +1501,14 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
print_buf++;
}
}
- dev_info(&pf->pdev->dev, "%s\n", print_buf_start);
+ pf_info(pf, "%s\n", print_buf_start);
ret = i40e_program_fdir_filter(&fd_data, pf, add);
if (!ret) {
- dev_info(&pf->pdev->dev,
- "%s: Filter command send Status : Success\n",
- __func__);
+ pf_info(pf, "%s: Filter command send Status : Success\n",
+ __func__);
} else {
- dev_info(&pf->pdev->dev,
- "%s: Filter command send failed %d\n",
- __func__, ret);
+ pf_info(pf, "%s: Filter command send failed %d\n",
+ __func__, ret);
}
kfree(fd_data.raw_packet);
fd_data.raw_packet = NULL;
@@ -1701,18 +1519,16 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
int ret;
ret = i40e_aq_stop_lldp(&pf->hw, false, NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: Stop LLDP AQ command failed =0x%x\n",
- __func__, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: Stop LLDP AQ command failed =0x%x\n",
+ __func__, pf->hw.aq.asq_last_status);
goto command_write_done;
}
} else if (strncmp(&cmd_buf[5], "start", 5) == 0) {
int ret;
ret = i40e_aq_start_lldp(&pf->hw, NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: Start LLDP AQ command failed =0x%x\n",
- __func__, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: Start LLDP AQ command failed =0x%x\n",
+ __func__, pf->hw.aq.asq_last_status);
goto command_write_done;
}
} else if (strncmp(&cmd_buf[5],
@@ -1729,16 +1545,14 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
buff, I40E_LLDPDU_SIZE,
&llen, &rlen, NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: Get LLDP MIB (local) AQ command failed =0x%x\n",
- __func__, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: Get LLDP MIB (local) AQ command failed =0x%x\n",
+ __func__, pf->hw.aq.asq_last_status);
kfree(buff);
buff = NULL;
goto command_write_done;
}
- dev_info(&pf->pdev->dev,
- "%s: Get LLDP MIB (local) AQ buffer written back:\n",
- __func__);
+ pf_info(pf, "%s: Get LLDP MIB (local) AQ buffer written back:\n",
+ __func__);
for (i = 0; i < I40E_LLDPDU_SIZE; i++) {
snprintf(print_buf, 3, "%02x ", buff[i]);
print_buf += 3;
@@ -1747,7 +1561,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
print_buf++;
}
}
- dev_info(&pf->pdev->dev, "%s\n", print_buf_start);
+ pf_info(pf, "%s\n", print_buf_start);
kfree(buff);
buff = NULL;
} else if (strncmp(&cmd_buf[5], "get remote", 10) == 0) {
@@ -1764,16 +1578,14 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
buff, I40E_LLDPDU_SIZE,
&llen, &rlen, NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: Get LLDP MIB (remote) AQ command failed =0x%x\n",
- __func__, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: Get LLDP MIB (remote) AQ command failed =0x%x\n",
+ __func__, pf->hw.aq.asq_last_status);
kfree(buff);
buff = NULL;
goto command_write_done;
}
- dev_info(&pf->pdev->dev,
- "%s: Get LLDP MIB (remote) AQ buffer written back:\n",
- __func__);
+ pf_info(pf, "%s: Get LLDP MIB (remote) AQ buffer written back:\n",
+ __func__);
for (i = 0; i < I40E_LLDPDU_SIZE; i++) {
snprintf(print_buf, 3, "%02x ", buff[i]);
print_buf += 3;
@@ -1782,7 +1594,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
print_buf++;
}
}
- dev_info(&pf->pdev->dev, "%s\n", print_buf_start);
+ pf_info(pf, "%s\n", print_buf_start);
kfree(buff);
buff = NULL;
} else if (strncmp(&cmd_buf[5], "event on", 8) == 0) {
@@ -1790,9 +1602,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
ret = i40e_aq_cfg_lldp_mib_change_event(&pf->hw,
true, NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: Config LLDP MIB Change Event (on) AQ command failed =0x%x\n",
- __func__, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: Config LLDP MIB Change Event (on) AQ command failed =0x%x\n",
+ __func__, pf->hw.aq.asq_last_status);
goto command_write_done;
}
} else if (strncmp(&cmd_buf[5], "event off", 9) == 0) {
@@ -1800,9 +1611,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
ret = i40e_aq_cfg_lldp_mib_change_event(&pf->hw,
false, NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: Config LLDP MIB Change Event (off) AQ command failed =0x%x\n",
- __func__, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: Config LLDP MIB Change Event (off) AQ command failed =0x%x\n",
+ __func__, pf->hw.aq.asq_last_status);
goto command_write_done;
}
}
@@ -1825,9 +1635,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
} else if (cnt == 2) {
buffer_len = 0;
} else if (cnt > 3) {
- dev_info(&pf->pdev->dev,
- "%s: nvm read: bad command string, cnt=%d\n",
- __func__, cnt);
+ pf_info(pf, "%s: nvm read: bad command string, cnt=%d\n",
+ __func__, cnt);
goto command_write_done;
}
@@ -1842,9 +1651,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
ret = i40e_acquire_nvm(&pf->hw, I40E_RESOURCE_READ);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: Failed Acquiring NVM resource for read err=%d status=0x%x\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: Failed Acquiring NVM resource for read err=%d status=0x%x\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
kfree(buff);
goto command_write_done;
}
@@ -1853,13 +1661,11 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
bytes, (u8 *)buff, true, NULL);
i40e_release_nvm(&pf->hw);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: Read NVM AQ failed err=%d status=0x%x\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: Read NVM AQ failed err=%d status=0x%x\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
} else {
- dev_info(&pf->pdev->dev,
- "%s: Read NVM module=0x%x offset=0x%x words=%d\n",
- __func__, module, offset, buffer_len);
+ pf_info(pf, "%s: Read NVM module=0x%x offset=0x%x words=%d\n",
+ __func__, module, offset, buffer_len);
for (i = 0; i < buffer_len; i++) {
if ((i % 16) == 0) {
snprintf(print_buf, 11, "\n0x%08x: ",
@@ -1869,71 +1675,53 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
snprintf(print_buf, 5, "%04x ", buff[i]);
print_buf += 5;
}
- dev_info(&pf->pdev->dev, "%s\n", print_buf_start);
+ pf_info(pf, "%s\n", print_buf_start);
}
kfree(buff);
buff = NULL;
} else {
- dev_info(&pf->pdev->dev, "%s: unknown command '%s'\n",
- __func__, cmd_buf);
- dev_info(&pf->pdev->dev,
- "%s: available commands\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: add vsi [relay_seid]\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: del vsi [vsi_seid]\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: add relay <uplink_seid> <vsi_seid>\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: del relay <relay_seid>\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: add macaddr <vsi_seid> <aa:bb:cc:dd:ee:ff> [vlan]\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: del macaddr <vsi_seid> <aa:bb:cc:dd:ee:ff> [vlan]\n",
- __func__);
- dev_info(&pf->pdev->dev, "%s: add pvid <vsi_seid> <vid>\n",
- __func__);
- dev_info(&pf->pdev->dev, "%s: del pvid <vsi_seid>\n",
- __func__);
- dev_info(&pf->pdev->dev, "%s: dump switch\n", __func__);
- dev_info(&pf->pdev->dev, "%s: dump vsi [seid]\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
- __func__);
- dev_info(&pf->pdev->dev, "%s: dump desc aq\n", __func__);
- dev_info(&pf->pdev->dev, "%s: dump stats\n", __func__);
- dev_info(&pf->pdev->dev, "%s: dump reset stats\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: msg_enable [level]\n", __func__);
- dev_info(&pf->pdev->dev, "%s: read <reg>\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: write <reg> <value>\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: clear_stats vsi [seid]\n", __func__);
- dev_info(&pf->pdev->dev, "%s: clear_stats pf\n", __func__);
- dev_info(&pf->pdev->dev, "%s: pfr\n", __func__);
- dev_info(&pf->pdev->dev, "%s: corer\n", __func__);
- dev_info(&pf->pdev->dev, "%s: globr\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: add fd_filter <dest q_index> <flex_off> <pctype> <dest_vsi> <dest_ctl> <fd_status> <cnt_index> <fd_id> <packet_len> <packet>\n",
- __func__);
- dev_info(&pf->pdev->dev,
- "%s: rem fd_filter <dest q_index> <flex_off> <pctype> <dest_vsi> <dest_ctl> <fd_status> <cnt_index> <fd_id> <packet_len> <packet>\n",
- __func__);
- dev_info(&pf->pdev->dev, "%s: lldp start\n", __func__);
- dev_info(&pf->pdev->dev, "%s: lldp stop\n", __func__);
- dev_info(&pf->pdev->dev, "%s: lldp get local\n", __func__);
- dev_info(&pf->pdev->dev, "%s: lldp get remote\n", __func__);
- dev_info(&pf->pdev->dev, "%s: lldp event on\n", __func__);
- dev_info(&pf->pdev->dev, "%s: lldp event off\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: nvm read [module] [word_offset] [word_count]\n",
- __func__);
+ pf_info(pf, "%s: unknown command '%s'\n", __func__, cmd_buf);
+ pf_info(pf, "%s: available commands\n", __func__);
+ pf_info(pf, "%s: add vsi [relay_seid]\n", __func__);
+ pf_info(pf, "%s: del vsi [vsi_seid]\n", __func__);
+ pf_info(pf, "%s: add relay <uplink_seid> <vsi_seid>\n",
+ __func__);
+ pf_info(pf, "%s: del relay <relay_seid>\n", __func__);
+ pf_info(pf, "%s: add macaddr <vsi_seid> <aa:bb:cc:dd:ee:ff> [vlan]\n",
+ __func__);
+ pf_info(pf, "%s: del macaddr <vsi_seid> <aa:bb:cc:dd:ee:ff> [vlan]\n",
+ __func__);
+ pf_info(pf, "%s: add pvid <vsi_seid> <vid>\n", __func__);
+ pf_info(pf, "%s: del pvid <vsi_seid>\n", __func__);
+ pf_info(pf, "%s: dump switch\n", __func__);
+ pf_info(pf, "%s: dump vsi [seid]\n", __func__);
+ pf_info(pf, "%s: dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
+ pf_info(pf, "%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
+ __func__);
+ pf_info(pf, "%s: dump desc aq\n", __func__);
+ pf_info(pf, "%s: dump stats\n", __func__);
+ pf_info(pf, "%s: dump reset stats\n", __func__);
+ pf_info(pf, "%s: msg_enable [level]\n", __func__);
+ pf_info(pf, "%s: read <reg>\n", __func__);
+ pf_info(pf, "%s: write <reg> <value>\n", __func__);
+ pf_info(pf, "%s: clear_stats vsi [seid]\n", __func__);
+ pf_info(pf, "%s: clear_stats pf\n", __func__);
+ pf_info(pf, "%s: pfr\n", __func__);
+ pf_info(pf, "%s: corer\n", __func__);
+ pf_info(pf, "%s: globr\n", __func__);
+ pf_info(pf, "%s: add fd_filter <dest q_index> <flex_off> <pctype> <dest_vsi> <dest_ctl> <fd_status> <cnt_index> <fd_id> <packet_len> <packet>\n",
+ __func__);
+ pf_info(pf, "%s: rem fd_filter <dest q_index> <flex_off> <pctype> <dest_vsi> <dest_ctl> <fd_status> <cnt_index> <fd_id> <packet_len> <packet>\n",
+ __func__);
+ pf_info(pf, "%s: lldp start\n", __func__);
+ pf_info(pf, "%s: lldp stop\n", __func__);
+ pf_info(pf, "%s: lldp get local\n", __func__);
+ pf_info(pf, "%s: lldp get remote\n", __func__);
+ pf_info(pf, "%s: lldp event on\n", __func__);
+ pf_info(pf, "%s: lldp event off\n", __func__);
+ pf_info(pf, "%s: nvm read [module] [word_offset] [word_count]\n",
+ __func__);
}
command_write_done:
@@ -2034,106 +1822,92 @@ static ssize_t i40e_dbg_netdev_ops_write(struct file *filp,
if (strncmp(i40e_dbg_netdev_ops_buf, "tx_timeout", 10) == 0) {
cnt = sscanf(&i40e_dbg_netdev_ops_buf[11], "%i", &vsi_seid);
if (cnt != 1) {
- dev_info(&pf->pdev->dev,
- "%s: tx_timeout <vsi_seid>\n", __func__);
+ pf_info(pf, "%s: tx_timeout <vsi_seid>\n", __func__);
goto netdev_ops_write_done;
}
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: tx_timeout: VSI %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: tx_timeout: VSI %d not found\n",
+ __func__, vsi_seid);
goto netdev_ops_write_done;
}
if (rtnl_trylock()) {
vsi->netdev->netdev_ops->ndo_tx_timeout(vsi->netdev);
rtnl_unlock();
- dev_info(&pf->pdev->dev, "%s: tx_timeout called\n",
- __func__);
+ pf_info(pf, "%s: tx_timeout called\n", __func__);
} else {
- dev_info(&pf->pdev->dev, "%s: Could not acquire RTNL - please try again\n",
- __func__);
+ pf_info(pf, "%s: Could not acquire RTNL - please try again\n",
+ __func__);
}
} else if (strncmp(i40e_dbg_netdev_ops_buf, "change_mtu", 10) == 0) {
int mtu;
cnt = sscanf(&i40e_dbg_netdev_ops_buf[11], "%i %i",
&vsi_seid, &mtu);
if (cnt != 2) {
- dev_info(&pf->pdev->dev,
- "%s: change_mtu <vsi_seid> <mtu>\n", __func__);
+ pf_info(pf, "%s: change_mtu <vsi_seid> <mtu>\n",
+ __func__);
goto netdev_ops_write_done;
}
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: change_mtu: VSI %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: change_mtu: VSI %d not found\n",
+ __func__, vsi_seid);
goto netdev_ops_write_done;
}
if (rtnl_trylock()) {
vsi->netdev->netdev_ops->ndo_change_mtu(vsi->netdev,
mtu);
rtnl_unlock();
- dev_info(&pf->pdev->dev, "%s: change_mtu called\n",
- __func__);
+ pf_info(pf, "%s: change_mtu called\n", __func__);
} else {
- dev_info(&pf->pdev->dev, "%s: Could not acquire RTNL - please try again\n",
- __func__);
+ pf_info(pf, "%s: Could not acquire RTNL - please try again\n",
+ __func__);
}
} else if (strncmp(i40e_dbg_netdev_ops_buf, "set_rx_mode", 11) == 0) {
cnt = sscanf(&i40e_dbg_netdev_ops_buf[11], "%i", &vsi_seid);
if (cnt != 1) {
- dev_info(&pf->pdev->dev,
- "%s: set_rx_mode <vsi_seid>\n", __func__);
+ pf_info(pf, "%s: set_rx_mode <vsi_seid>\n", __func__);
goto netdev_ops_write_done;
}
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: set_rx_mode: VSI %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: set_rx_mode: VSI %d not found\n",
+ __func__, vsi_seid);
goto netdev_ops_write_done;
}
if (rtnl_trylock()) {
vsi->netdev->netdev_ops->ndo_set_rx_mode(vsi->netdev);
rtnl_unlock();
- dev_info(&pf->pdev->dev, "%s: set_rx_mode called\n",
- __func__);
+ pf_info(pf, "%s: set_rx_mode called\n", __func__);
} else {
- dev_info(&pf->pdev->dev, "%s: Could not acquire RTNL - please try again\n",
- __func__);
+ pf_info(pf, "%s: Could not acquire RTNL - please try again\n",
+ __func__);
}
} else if (strncmp(i40e_dbg_netdev_ops_buf, "napi", 4) == 0) {
cnt = sscanf(&i40e_dbg_netdev_ops_buf[4], "%i", &vsi_seid);
if (cnt != 1) {
- dev_info(&pf->pdev->dev,
- "%s: napi <vsi_seid>\n", __func__);
+ pf_info(pf, "%s: napi <vsi_seid>\n", __func__);
goto netdev_ops_write_done;
}
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
- dev_info(&pf->pdev->dev, "%s: napi: VSI %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: napi: VSI %d not found\n",
+ __func__, vsi_seid);
goto netdev_ops_write_done;
}
for (i = 0; i < vsi->num_q_vectors; i++)
napi_schedule(&vsi->q_vectors[i].napi);
- dev_info(&pf->pdev->dev, "%s: napi called\n", __func__);
+ pf_info(pf, "%s: napi called\n", __func__);
} else {
- dev_info(&pf->pdev->dev, "%s: unknown command '%s'\n",
- __func__, i40e_dbg_netdev_ops_buf);
- dev_info(&pf->pdev->dev,
- "%s: available commands\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: tx_timeout <vsi_seid>\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: change_mtu <vsi_seid> <mtu>\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: set_rx_mode <vsi_seid>\n", __func__);
- dev_info(&pf->pdev->dev,
- "%s: napi <vsi_seid>\n", __func__);
+ pf_info(pf, "%s: unknown command '%s'\n",
+ __func__, i40e_dbg_netdev_ops_buf);
+ pf_info(pf, "%s: available commands\n", __func__);
+ pf_info(pf, "%s: tx_timeout <vsi_seid>\n", __func__);
+ pf_info(pf, "%s: change_mtu <vsi_seid> <mtu>\n", __func__);
+ pf_info(pf, "%s: set_rx_mode <vsi_seid>\n", __func__);
+ pf_info(pf, "%s: napi <vsi_seid>\n", __func__);
}
netdev_ops_write_done:
return count;
@@ -2164,8 +1938,8 @@ void i40e_dbg_pf_init(struct i40e_pf *pf)
pfile = debugfs_create_file("netdev_ops", 0600, pf->i40e_dbg_pf,
pf, &i40e_dbg_netdev_ops_fops);
} else {
- dev_info(&pf->pdev->dev,
- "%s: debugfs entry for %s failed\n", __func__, name);
+ pf_info(pf, "%s: debugfs entry for %s failed\n",
+ __func__, name);
}
}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index f66bc46..87093da 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1164,15 +1164,12 @@ static i40e_status i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi,
ret = i40e_program_fdir_filter(fd_data, pf, add);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
+ pf_info(pf, "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
__func__, fd_data->pctype, ret);
err = true;
} else {
- dev_info(&pf->pdev->dev,
- "%s: Filter OK for PCTYPE %d (ret = %d)\n",
- __func__,
- fd_data->pctype, ret);
+ pf_info(pf, "%s: Filter OK for PCTYPE %d (ret = %d)\n",
+ __func__, fd_data->pctype, ret);
}
}
@@ -1210,13 +1207,12 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,
ret = i40e_program_fdir_filter(fd_data, pf, add);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
- __func__, fd_data->pctype, ret);
+ pf_info(pf, "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
+ __func__, fd_data->pctype, ret);
err = true;
} else {
- dev_info(&pf->pdev->dev, "%s: Filter OK for PCTYPE %d (ret = %d)\n",
- __func__, fd_data->pctype, ret);
+ pf_info(pf, "%s: Filter OK for PCTYPE %d (ret = %d)\n",
+ __func__, fd_data->pctype, ret);
}
ip->saddr = fsp->h_u.tcp_ip4_spec.ip4src;
@@ -1225,14 +1221,12 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,
fd_data->pctype = I40E_FILTER_PCTYPE_NONF_IPV4_TCP;
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
+ pf_info(pf, "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
__func__, fd_data->pctype, ret);
err = true;
} else {
- dev_info(&pf->pdev->dev,
- "%s: Filter OK for PCTYPE %d (ret = %d)\n",
- __func__, fd_data->pctype, ret);
+ pf_info(pf, "%s: Filter OK for PCTYPE %d (ret = %d)\n",
+ __func__, fd_data->pctype, ret);
}
return err ? -EOPNOTSUPP : I40E_SUCCESS;
@@ -1288,14 +1282,12 @@ static i40e_status i40e_add_del_fdir_ipv4(struct i40e_vsi *vsi,
ret = i40e_program_fdir_filter(fd_data, pf, add);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
+ pf_info(pf, "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
__func__, fd_data->pctype, ret);
err = true;
} else {
- dev_info(&pf->pdev->dev,
- "%s: Filter OK for PCTYPE %d (ret = %d)\n",
- __func__, fd_data->pctype, ret);
+ pf_info(pf, "%s: Filter OK for PCTYPE %d (ret = %d)\n",
+ __func__, fd_data->pctype, ret);
}
}
@@ -1336,8 +1328,7 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi,
GFP_KERNEL);
if (!fd_data.raw_packet) {
- dev_info(&pf->pdev->dev,
- "%s: Could not allocate memory\n", __func__);
+ pf_info(pf, "%s: Could not allocate memory\n", __func__);
return -ENOMEM;
}
@@ -1380,8 +1371,7 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi,
}
break;
default:
- dev_info(&pf->pdev->dev, "%s: Could not specify spec type\n",
- __func__);
+ pf_info(pf, "%s: Could not specify spec type\n", __func__);
ret = -EINVAL;
}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index b0f92f4..f3139f6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -188,9 +188,8 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,
int j = 0;
if (pile == NULL || needed == 0 || id >= I40E_PILE_VALID_BIT) {
- dev_info(&pf->pdev->dev,
- "%s: param err: pile=%p needed=%d id=0x%04x\n",
- __func__, pile, needed, id);
+ pf_info(pf, "%s: param err: pile=%p needed=%d id=0x%04x\n",
+ __func__, pile, needed, id);
return I40E_ERR_PARAM;
}
@@ -1013,8 +1012,8 @@ i40e_status i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr,
is_vf, is_netdev);
if (NULL == add_f) {
- dev_info(&vsi->back->pdev->dev, "%s: Could not add filter %d for %pM\n",
- __func__, f->vlan, f->macaddr);
+ pf_info(vsi->back, "%s: Could not add filter %d for %pM\n",
+ __func__, f->vlan, f->macaddr);
return -ENOMEM;
}
}
@@ -1219,9 +1218,8 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
numtc++;
}
if (!numtc) {
- dev_warn(&pf->pdev->dev,
- "%s: DCB is enabled but no TC enabled, forcing TC0\n",
- __func__);
+ pf_warn(pf, "%s: DCB is enabled but no TC enabled, forcing TC0\n",
+ __func__);
numtc = 1;
}
} else {
@@ -1471,10 +1469,9 @@ i40e_status i40e_sync_vsi_filters(struct i40e_vsi *vsi)
memset(del_list, 0, sizeof(*del_list));
if (ret != I40E_SUCCESS)
- dev_info(&pf->pdev->dev,
- "%s: ignoring delete macvlan error, err %d, aq_err %d while flashing a full buffer\n",
- __func__, ret,
- pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: ignoring delete macvlan error, err %d, aq_err %d while flashing a full buffer\n",
+ __func__, ret,
+ pf->hw.aq.asq_last_status);
}
}
if (num_del) {
@@ -1483,10 +1480,9 @@ i40e_status i40e_sync_vsi_filters(struct i40e_vsi *vsi)
num_del = 0;
if (ret != I40E_SUCCESS)
- dev_info(&pf->pdev->dev,
- "%s: ignoring delete macvlan error, err %d, aq_err %d\n",
- __func__, ret,
- pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: ignoring delete macvlan error, err %d, aq_err %d\n",
+ __func__, ret,
+ pf->hw.aq.asq_last_status);
}
kfree(del_list);
@@ -1554,18 +1550,16 @@ i40e_status i40e_sync_vsi_filters(struct i40e_vsi *vsi)
if (add_happened && (ret == I40E_SUCCESS)) {
/* do nothing */;
} else if (add_happened && (ret != I40E_SUCCESS)) {
- dev_info(&pf->pdev->dev,
- "%s: add filter failed, err %d, aq_err %d\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: add filter failed, err %d, aq_err %d\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
if ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOSPC) &&
!test_bit(__I40E_FILTER_OVERFLOW_PROMISC,
&vsi->state)) {
promisc_forced_on = true;
set_bit(__I40E_FILTER_OVERFLOW_PROMISC,
&vsi->state);
- dev_info(&pf->pdev->dev,
- "%s: promiscuous mode forced on\n",
- __func__);
+ pf_info(pf, "%s: promiscuous mode forced on\n",
+ __func__);
}
}
}
@@ -1579,9 +1573,8 @@ i40e_status i40e_sync_vsi_filters(struct i40e_vsi *vsi)
cur_multipromisc,
NULL);
if (ret != I40E_SUCCESS)
- dev_info(&pf->pdev->dev,
- "%s: set multi promisc failed, err %d, aq_err %d\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: set multi promisc failed, err %d, aq_err %d\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
}
if ((changed_flags & IFF_PROMISC) || promisc_forced_on) {
bool cur_promisc;
@@ -1593,9 +1586,8 @@ i40e_status i40e_sync_vsi_filters(struct i40e_vsi *vsi)
cur_promisc,
NULL);
if (ret != I40E_SUCCESS)
- dev_info(&pf->pdev->dev,
- "%s: set uni promisc failed, err %d, aq_err %d\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: set uni promisc failed, err %d, aq_err %d\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
}
clear_bit(__I40E_CONFIG_BUSY, &vsi->state);
@@ -1669,9 +1661,8 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi)
memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: update vsi failed, aq_err=%d\n",
- __func__, vsi->back->hw.aq.asq_last_status);
+ pf_info(vsi->back, "%s: update vsi failed, aq_err=%d\n",
+ __func__, vsi->back->hw.aq.asq_last_status);
}
}
@@ -1698,9 +1689,8 @@ void i40e_vlan_stripping_disable(struct i40e_vsi *vsi)
memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: update vsi failed, aq_err=%d\n",
- __func__, vsi->back->hw.aq.asq_last_status);
+ pf_info(vsi->back, "%s: update vsi failed, aq_err=%d\n",
+ __func__, vsi->back->hw.aq.asq_last_status);
}
}
@@ -1738,8 +1728,8 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
add_f = i40e_add_filter(vsi, vsi->netdev->dev_addr, vid,
is_vf, is_netdev);
if (add_f == NULL) {
- dev_info(&vsi->back->pdev->dev, "%s: Could not add vlan filter %d for %pM\n",
- __func__, vid, vsi->netdev->dev_addr);
+ pf_info(vsi->back, "%s: Could not add vlan filter %d for %pM\n",
+ __func__, vid, vsi->netdev->dev_addr);
return -ENOMEM;
}
}
@@ -1748,16 +1738,16 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
add_f = i40e_add_filter(vsi, f->macaddr, vid,
is_vf, is_netdev);
if (add_f == NULL) {
- dev_info(&vsi->back->pdev->dev, "%s: Could not add vlan filter %d for %pM\n",
- __func__, vid, f->macaddr);
+ pf_info(vsi->back, "%s: Could not add vlan filter %d for %pM\n",
+ __func__, vid, f->macaddr);
return -ENOMEM;
}
}
ret = i40e_sync_vsi_filters(vsi);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev, "%s: Could not sync filters for vid %d\n",
- __func__, vid);
+ pf_info(vsi->back, "%s: Could not sync filters for vid %d\n",
+ __func__, vid);
return ret;
}
@@ -1776,8 +1766,8 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
add_f = i40e_add_filter(vsi, vsi->netdev->dev_addr, 0,
is_vf, is_netdev);
if (add_f == NULL) {
- dev_info(&vsi->back->pdev->dev, "%s: Could not add filter 0 for %pM\n",
- __func__, vsi->netdev->dev_addr);
+ pf_info(vsi->back, "%s: Could not add filter 0 for %pM\n",
+ __func__, vsi->netdev->dev_addr);
return -ENOMEM;
}
}
@@ -1790,9 +1780,8 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
add_f = i40e_add_filter(vsi, f->macaddr,
0, is_vf, is_netdev);
if (add_f == NULL) {
- dev_info(&vsi->back->pdev->dev,
- "%s: Could not add filter 0 for %pM\n",
- __func__, f->macaddr);
+ pf_info(vsi->back, "%s: Could not add filter 0 for %pM\n",
+ __func__, f->macaddr);
return -ENOMEM;
}
}
@@ -1827,8 +1816,7 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
ret = i40e_sync_vsi_filters(vsi);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev, "%s: Could not sync filters\n",
- __func__);
+ pf_info(vsi->back, "%s: Could not sync filters\n", __func__);
return ret;
}
@@ -1854,9 +1842,8 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
f = i40e_add_filter(vsi, netdev->dev_addr, I40E_VLAN_ANY,
is_vf, is_netdev);
if (f == NULL) {
- dev_info(&vsi->back->pdev->dev, "%s: Could not add filter %d for %pM\n",
- __func__, I40E_VLAN_ANY,
- netdev->dev_addr);
+ pf_info(vsi->back, "%s: Could not add filter %d for %pM\n",
+ __func__, I40E_VLAN_ANY, netdev->dev_addr);
return -ENOMEM;
}
}
@@ -1867,8 +1854,8 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
add_f = i40e_add_filter(vsi, f->macaddr, I40E_VLAN_ANY,
is_vf, is_netdev);
if (add_f == NULL) {
- dev_info(&vsi->back->pdev->dev, "%s: Could not add filter %d for %pM\n",
- __func__, I40E_VLAN_ANY, f->macaddr);
+ pf_info(vsi->back, "%s: Could not add filter %d for %pM\n",
+ __func__, I40E_VLAN_ANY, f->macaddr);
return -ENOMEM;
}
}
@@ -1968,9 +1955,8 @@ i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid)
memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: update vsi failed, aq_err=%d\n",
- __func__, vsi->back->hw.aq.asq_last_status);
+ pf_info(vsi->back, "%s: update vsi failed, aq_err=%d\n",
+ __func__, vsi->back->hw.aq.asq_last_status);
}
return ret;
@@ -2107,18 +2093,16 @@ static s32 i40e_configure_tx_ring(struct i40e_ring *ring)
/* clear the context in the HMC */
err = i40e_clear_lan_tx_queue_context(hw, pf_q);
if (err != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: Failed to clear LAN Tx queue context on Tx ring %d (pf_q %d), error: %d\n",
- __func__, ring->queue_index, pf_q, err);
+ pf_info(vsi->back, "%s: Failed to clear LAN Tx queue context on Tx ring %d (pf_q %d), error: %d\n",
+ __func__, ring->queue_index, pf_q, err);
return err;
}
/* set the context in the HMC */
err = i40e_set_lan_tx_queue_context(hw, pf_q, &tx_ctx);
if (err != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: Failed to set LAN Tx queue context on Tx ring %d (pf_q %d, error: %d\n",
- __func__, ring->queue_index, pf_q, err);
+ pf_info(vsi->back, "%s: Failed to set LAN Tx queue context on Tx ring %d (pf_q %d, error: %d\n",
+ __func__, ring->queue_index, pf_q, err);
return err;
}
@@ -2198,18 +2182,16 @@ static s32 i40e_configure_rx_ring(struct i40e_ring *ring)
/* clear the context in the HMC */
err = i40e_clear_lan_rx_queue_context(hw, pf_q);
if (err != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: Failed to clear LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n",
- __func__, ring->queue_index, pf_q, err);
+ pf_info(vsi->back, "%s: Failed to clear LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n",
+ __func__, ring->queue_index, pf_q, err);
return err;
}
/* set the context in the HMC */
err = i40e_set_lan_rx_queue_context(hw, pf_q, &rx_ctx);
if (err != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: Failed to set LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n",
- __func__, ring->queue_index, pf_q, err);
+ pf_info(vsi->back, "%s: Failed to set LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n",
+ __func__, ring->queue_index, pf_q, err);
return err;
}
@@ -2586,9 +2568,8 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
q_vector->name,
q_vector);
if (err) {
- dev_info(&pf->pdev->dev,
- "%s: request_irq failed, error: %d\n",
- __func__, err);
+ pf_info(pf, "%s: request_irq failed, error: %d\n",
+ __func__, err);
goto free_queue_irqs;
}
/* assign the mask for this irq */
@@ -2774,17 +2755,15 @@ static irqreturn_t i40e_intr(int irq, void *data)
*/
icr0_remaining = icr0 & ena_mask;
if (icr0_remaining) {
- dev_info(&pf->pdev->dev,
- "%s: unhandled interrupt icr0=0x%08x\n",
- __func__, icr0_remaining);
+ pf_info(pf, "%s: unhandled interrupt icr0=0x%08x\n",
+ __func__, icr0_remaining);
if ((icr0_remaining & I40E_PFINT_ICR0_HMC_ERR_MASK) ||
(icr0_remaining & I40E_PFINT_ICR0_PE_CRITERR_MASK) ||
(icr0_remaining & I40E_PFINT_ICR0_PCI_EXCEPTION_MASK) ||
(icr0_remaining & I40E_PFINT_ICR0_ECC_ERR_MASK) ||
(icr0_remaining & I40E_PFINT_ICR0_MAL_DETECT_MASK)) {
- dev_info(&pf->pdev->dev,
- "%s: error: device will be reset\n",
- __func__);
+ pf_info(pf, "%s: error: device will be reset\n",
+ __func__);
set_bit(__I40E_PF_RESET_REQUESTED, &pf->state);
i40e_service_event_schedule(pf);
}
@@ -2892,8 +2871,8 @@ static int i40e_vsi_request_irq(struct i40e_vsi *vsi, char *basename)
basename, pf);
if (err) {
- dev_info(&pf->pdev->dev, "%s: request_irq failed, Error %d\n",
- __func__, err);
+ pf_info(pf, "%s: request_irq failed, Error %d\n",
+ __func__, err);
/* place q_vectors and rings back into a known good state */
i40e_vsi_unmap_rings_to_vectors(vsi);
@@ -2956,17 +2935,15 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable)
if (enable) {
/* is STAT set ? */
if ((tx_reg & I40E_QTX_ENA_QENA_STAT_MASK)) {
- dev_info(&pf->pdev->dev,
- "%s: Tx %d already enabled\n",
- __func__, i);
+ pf_info(pf, "%s: Tx %d already enabled\n",
+ __func__, i);
continue;
}
} else {
/* is !STAT set ? */
if (!(tx_reg & I40E_QTX_ENA_QENA_STAT_MASK)) {
- dev_info(&pf->pdev->dev,
- "%s: Tx %d already disabled\n",
- __func__, i);
+ pf_info(pf, "%s: Tx %d already disabled\n",
+ __func__, i);
continue;
}
}
@@ -2994,9 +2971,8 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable)
udelay(10);
}
if (j >= 10) {
- dev_info(&pf->pdev->dev,
- "%s: Tx ring %d %sable timeout\n",
- __func__, pf_q, (enable ? "en" : "dis"));
+ pf_info(pf, "%s: Tx ring %d %sable timeout\n",
+ __func__, pf_q, (enable ? "en" : "dis"));
}
}
@@ -3058,9 +3034,8 @@ static int i40e_vsi_control_rx(struct i40e_vsi *vsi, bool enable)
udelay(10);
}
if (j >= 10) {
- dev_info(&pf->pdev->dev,
- "%s: Rx ring %d %sable timeout\n",
- __func__, pf_q, (enable ? "en" : "dis"));
+ pf_info(pf, "%s: Rx ring %d %sable timeout\n",
+ __func__, pf_q, (enable ? "en" : "dis"));
return I40E_ERR_TIMEOUT;
}
}
@@ -3499,9 +3474,8 @@ static s32 i40e_vsi_get_bw_info(struct i40e_vsi *vsi)
/* Get the VSI level BW configuration */
ret = i40e_aq_query_vsi_bw_config(hw, vsi->seid, &bw_config, NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: couldn't get pf vsi bw config, err %d, aq_err %d\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: couldn't get pf vsi bw config, err %d, aq_err %d\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
return ret;
}
@@ -3510,17 +3484,15 @@ static s32 i40e_vsi_get_bw_info(struct i40e_vsi *vsi)
&bw_ets_config,
NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: couldn't get pf vsi ets bw config, err %d, aq_err %d\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: couldn't get pf vsi ets bw config, err %d, aq_err %d\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
return ret;
}
if (bw_config.tc_valid_bits != bw_ets_config.tc_valid_bits) {
- dev_info(&pf->pdev->dev,
- "%s: Enabled TCs mismatch from querying VSI BW info 0x%08x 0x%08x\n",
- __func__, bw_config.tc_valid_bits,
- bw_ets_config.tc_valid_bits);
+ pf_info(pf, "%s: Enabled TCs mismatch from querying VSI BW info 0x%08x 0x%08x\n",
+ __func__, bw_config.tc_valid_bits,
+ bw_ets_config.tc_valid_bits);
/* Still continuing */
}
@@ -3560,9 +3532,8 @@ static s32 i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi,
ret = i40e_aq_config_vsi_tc_bw(&vsi->back->hw, vsi->seid,
&bw_data, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: AQ command Config VSI BW allocation per TC failed = %d\n",
- __func__, vsi->back->hw.aq.asq_last_status);
+ pf_info(vsi->back, "%s: AQ command Config VSI BW allocation per TC failed = %d\n",
+ __func__, vsi->back->hw.aq.asq_last_status);
return ret;
}
@@ -3676,9 +3647,8 @@ static s32 i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
ret = i40e_vsi_configure_bw_alloc(vsi, enabled_tc, bw_share);
if (ret) {
- dev_info(&vsi->back->pdev->dev,
- "%s: Failed configuring TC map %d for VSI %d\n",
- __func__, enabled_tc, vsi->seid);
+ pf_info(vsi->back, "%s: Failed configuring TC map %d for VSI %d\n",
+ __func__, enabled_tc, vsi->seid);
goto out;
}
@@ -3693,9 +3663,8 @@ static s32 i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
/* Update the VSI after updating the VSI queue-mapping information */
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: update vsi failed, aq_err=%d\n",
- __func__, vsi->back->hw.aq.asq_last_status);
+ pf_info(vsi->back, "%s: update vsi failed, aq_err=%d\n",
+ __func__, vsi->back->hw.aq.asq_last_status);
goto out;
}
/* update the local VSI info with updated queue map */
@@ -3705,9 +3674,8 @@ static s32 i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
/* Update current VSI BW information */
ret = i40e_vsi_get_bw_info(vsi);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: Failed updating vsi bw info, aq_err=%d\n",
- __func__, vsi->back->hw.aq.asq_last_status);
+ pf_info(vsi->back, "%s: Failed updating vsi bw info, aq_err=%d\n",
+ __func__, vsi->back->hw.aq.asq_last_status);
goto out;
}
@@ -4003,7 +3971,7 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
* for the warning interrupt will deal with the shutdown
* and recovery of the switch setup.
*/
- dev_info(&pf->pdev->dev, "%s: GlobalR requested\n", __func__);
+ pf_info(pf, "%s: GlobalR requested\n", __func__);
val = rd32(&pf->hw, I40E_GLGEN_RTRIG);
val |= I40E_GLGEN_RTRIG_GLOBR_MASK;
wr32(&pf->hw, I40E_GLGEN_RTRIG, val);
@@ -4013,7 +3981,7 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
*
* Same as Global Reset, except does *not* include the MAC/PHY
*/
- dev_info(&pf->pdev->dev, "%s: CoreR requested\n", __func__);
+ pf_info(pf, "%s: CoreR requested\n", __func__);
val = rd32(&pf->hw, I40E_GLGEN_RTRIG);
val |= I40E_GLGEN_RTRIG_CORER_MASK;
wr32(&pf->hw, I40E_GLGEN_RTRIG, val);
@@ -4028,15 +3996,14 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
* the switch, since we need to do all the recovery as
* for the Core Reset.
*/
- dev_info(&pf->pdev->dev, "%s: PFR requested\n", __func__);
+ pf_info(pf, "%s: PFR requested\n", __func__);
i40e_handle_reset_warning(pf);
} else if (reset_flags & (1 << __I40E_REINIT_REQUESTED)) {
int v;
/* Find the VSI(s) that requested a re-init */
- dev_info(&pf->pdev->dev,
- "%s: VSI reinit requested\n", __func__);
+ pf_info(pf, "%s: VSI reinit requested\n", __func__);
for (v = 0; v < pf->hw.func_caps.num_vsis; v++) {
struct i40e_vsi *vsi = pf->vsi[v];
if (vsi != NULL &&
@@ -4049,9 +4016,8 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
/* no further action needed, so return now */
return;
} else {
- dev_info(&pf->pdev->dev,
- "%s: bad reset request 0x%08x\n",
- __func__, reset_flags);
+ pf_info(pf, "%s: bad reset request 0x%08x\n",
+ __func__, reset_flags);
return;
}
}
@@ -4075,9 +4041,8 @@ static void i40e_handle_lan_overflow_event(struct i40e_pf *pf,
struct i40e_vf *vf;
u16 vf_id;
- dev_info(&pf->pdev->dev,
- "%s: Rx Queue Number = %d QTX_CTL=0x%08x\n",
- __func__, queue, qtx_ctl);
+ pf_info(pf, "%s: Rx Queue Number = %d QTX_CTL=0x%08x\n",
+ __func__, queue, qtx_ctl);
/* Queue belongs to VF, find the VF and issue VF reset */
if (((qtx_ctl & I40E_QTX_CTL_PFVF_Q_MASK)
@@ -4396,12 +4361,10 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
do {
ret = i40e_clean_arq_element(hw, &event, &pending);
if (ret == I40E_ERR_ADMIN_QUEUE_NO_WORK) {
- dev_info(&pf->pdev->dev,
- "%s: No ARQ event found\n", __func__);
+ pf_info(pf, "%s: No ARQ event found\n", __func__);
break;
} else if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: ARQ event error %d\n", __func__, ret);
+ pf_info(pf, "%s: ARQ event error %d\n", __func__, ret);
break;
}
@@ -4419,26 +4382,22 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
event.msg_size);
break;
case i40e_aqc_opc_lldp_update_mib:
- dev_info(&pf->pdev->dev,
- "%s: ARQ: Update LLDP MIB event received\n",
- __func__);
+ pf_info(pf, "%s: ARQ: Update LLDP MIB event received\n",
+ __func__);
break;
case i40e_aqc_opc_event_lan_overflow:
- dev_info(&pf->pdev->dev,
- "%s: ARQ LAN queue overflow event received\n",
- __func__);
+ pf_info(pf, "%s: ARQ LAN queue overflow event received\n",
+ __func__);
i40e_handle_lan_overflow_event(pf, &event);
break;
default:
- dev_info(&pf->pdev->dev,
- "%s: ARQ Error: Unknown event %d received\n",
- __func__, event.desc.opcode);
+ pf_info(pf, "%s: ARQ Error: Unknown event %d received\n",
+ __func__, event.desc.opcode);
break;
}
if (pending != 0)
- dev_info(&pf->pdev->dev,
- "%s: ARQ: Pending events %d\n",
- __func__, pending);
+ pf_info(pf, "%s: ARQ: Pending events %d\n",
+ __func__, pending);
} while (pending && (i++ < pf->adminq_work_limit));
clear_bit(__I40E_ADMINQ_EVENT_PENDING, &pf->state);
@@ -4477,9 +4436,8 @@ static s32 i40e_reconstitute_veb(struct i40e_veb *veb)
}
}
if (ctl_vsi == NULL) {
- dev_info(&pf->pdev->dev,
- "%s: missing owner VSI for veb_idx %d\n",
- __func__, veb->idx);
+ pf_info(pf, "%s: missing owner VSI for veb_idx %d\n",
+ __func__, veb->idx);
ret = I40E_ERR_NO_AVAILABLE_VSI;
goto end_reconstitute;
}
@@ -4487,9 +4445,8 @@ static s32 i40e_reconstitute_veb(struct i40e_veb *veb)
ctl_vsi->uplink_seid = pf->vsi[pf->lan_vsi]->uplink_seid;
ret = i40e_add_vsi(ctl_vsi);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: rebuild of owner VSI failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: rebuild of owner VSI failed: %d\n",
+ __func__, ret);
goto end_reconstitute;
}
i40e_sys_add_vsi(ctl_vsi);
@@ -4510,9 +4467,8 @@ static s32 i40e_reconstitute_veb(struct i40e_veb *veb)
vsi->uplink_seid = veb->seid;
ret = i40e_add_vsi(vsi);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: rebuild of vsi_idx %d failed: %d\n",
- __func__, v, ret);
+ pf_info(pf, "%s: rebuild of vsi_idx %d failed: %d\n",
+ __func__, v, ret);
goto end_reconstitute;
}
i40e_sys_add_vsi(vsi);
@@ -4563,23 +4519,21 @@ static i40e_status i40e_get_capabilities(struct i40e_pf *pf)
/* retry with a larger buffer */
buf_len = data_size;
} else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK) {
- dev_info(&pf->pdev->dev,
- "%s: capability discovery failed: aq=%d\n",
- __func__, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: capability discovery failed: aq=%d\n",
+ __func__, pf->hw.aq.asq_last_status);
return err;
}
} while (err != I40E_SUCCESS);
if (pf->hw.debug_mask & I40E_DEBUG_USER)
- dev_info(&pf->pdev->dev,
- "%s: pf=%d, num_vfs=%d, msix_pf=%d, msix_vf=%d, fd_g=%d, fd_b=%d, pf_max_q=%d num_vsi=%d\n",
- __func__, pf->hw.pf_id, pf->hw.func_caps.num_vfs,
- pf->hw.func_caps.num_msix_vectors,
- pf->hw.func_caps.num_msix_vectors_vf,
- pf->hw.func_caps.fd_filters_guaranteed,
- pf->hw.func_caps.fd_filters_best_effort,
- pf->hw.func_caps.num_tx_qp,
- pf->hw.func_caps.num_vsis);
+ pf_info(pf, "%s: pf=%d, num_vfs=%d, msix_pf=%d, msix_vf=%d, fd_g=%d, fd_b=%d, pf_max_q=%d num_vsi=%d\n",
+ __func__, pf->hw.pf_id, pf->hw.func_caps.num_vfs,
+ pf->hw.func_caps.num_msix_vectors,
+ pf->hw.func_caps.num_msix_vectors_vf,
+ pf->hw.func_caps.fd_filters_guaranteed,
+ pf->hw.func_caps.fd_filters_best_effort,
+ pf->hw.func_caps.num_tx_qp,
+ pf->hw.func_caps.num_vsis);
return I40E_SUCCESS;
}
@@ -4607,8 +4561,7 @@ static void i40e_fdir_setup(struct i40e_pf *pf)
if (!vsi) {
vsi = i40e_vsi_setup(pf, I40E_VSI_FDIR, pf->mac_seid, 0);
if (!vsi) {
- dev_info(&pf->pdev->dev,
- "%s: Couldn't create FDir VSI\n", __func__);
+ pf_info(pf, "%s: Couldn't create FDir VSI\n", __func__);
pf->flags &= ~I40E_FLAG_FDIR_ENABLED;
return;
}
@@ -4668,8 +4621,7 @@ static void i40e_handle_reset_warning(struct i40e_pf *pf)
if (test_and_set_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state))
return;
- dev_info(&pf->pdev->dev,
- "%s: Tearing down internal switch for reset\n", __func__);
+ pf_info(pf, "%s: Tearing down internal switch for reset\n", __func__);
i40e_vc_notify_reset(pf);
@@ -4693,36 +4645,32 @@ static void i40e_handle_reset_warning(struct i40e_pf *pf)
*/
ret = i40e_pf_reset(hw);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev, "%s: PF reset failed, %d\n",
- __func__, ret);
+ pf_info(pf, "%s: PF reset failed, %d\n", __func__, ret);
}
pf->pfr_count++;
if (test_bit(__I40E_DOWN, &pf->state))
goto end_core_reset;
- dev_info(&pf->pdev->dev, "%s: Rebuilding internal switch\n", __func__);
+ pf_info(pf, "%s: Rebuilding internal switch\n", __func__);
/* rebuild the basics for the AdminQ, HMC, and initial HW switch */
ret = i40e_init_adminq(&pf->hw);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev, "%s: Rebuild AdminQ failed, %d\n",
- __func__, ret);
+ pf_info(pf, "%s: Rebuild AdminQ failed, %d\n", __func__, ret);
goto end_core_reset;
}
ret = i40e_get_capabilities(pf);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: i40e_get_capabilities failed, %d\n",
- __func__, ret);
+ pf_info(pf, "%s: i40e_get_capabilities failed, %d\n",
+ __func__, ret);
goto end_core_reset;
}
/* call shutdown HMC */
ret = i40e_shutdown_lan_hmc(hw);
if (ret) {
- dev_info(&pf->pdev->dev, "%s: shutdown_lan_hmc failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: shutdown_lan_hmc failed: %d\n", __func__, ret);
goto end_core_reset;
}
@@ -4730,14 +4678,13 @@ static void i40e_handle_reset_warning(struct i40e_pf *pf)
hw->func_caps.num_rx_qp,
pf->fcoe_hmc_cntx_num, pf->fcoe_hmc_filt_num);
if (ret) {
- dev_info(&pf->pdev->dev, "%s: init_lan_hmc failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: init_lan_hmc failed: %d\n", __func__, ret);
goto end_core_reset;
}
ret = i40e_configure_lan_hmc(hw, I40E_HMC_MODEL_DIRECT_ONLY);
if (ret) {
- dev_info(&pf->pdev->dev, "%s: configure_lan_hmc failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: configure_lan_hmc failed: %d\n",
+ __func__, ret);
goto end_core_reset;
}
@@ -4754,8 +4701,7 @@ static void i40e_handle_reset_warning(struct i40e_pf *pf)
* try to recover minimal use by getting the basic PF VSI working.
*/
if (pf->vsi[pf->lan_vsi]->uplink_seid != pf->mac_seid) {
- dev_info(&pf->pdev->dev,
- "%s: attempting to rebuild switch\n", __func__);
+ pf_info(pf, "%s: attempting to rebuild switch\n", __func__);
/* find the one VEB connected to the MAC, and find orphans */
for (v = 0; v < I40E_MAX_VEB; v++) {
if (!pf->veb[v])
@@ -4775,30 +4721,26 @@ static void i40e_handle_reset_warning(struct i40e_pf *pf)
* but try to keep going.
*/
if (pf->veb[v]->uplink_seid == pf->mac_seid) {
- dev_info(&pf->pdev->dev,
- "%s: rebuild of switch failed: %d, will try to set up simple PF connection\n",
- __func__, ret);
+ pf_info(pf, "%s: rebuild of switch failed: %d, will try to set up simple PF connection\n",
+ __func__, ret);
pf->vsi[pf->lan_vsi]->uplink_seid
= pf->mac_seid;
break;
} else if (pf->veb[v]->uplink_seid == 0) {
- dev_info(&pf->pdev->dev,
- "%s: rebuild of orphan VEB failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: rebuild of orphan VEB failed: %d\n",
+ __func__, ret);
}
}
}
}
if (pf->vsi[pf->lan_vsi]->uplink_seid == pf->mac_seid) {
- dev_info(&pf->pdev->dev,
- "%s: attempting to rebuild PF VSI\n", __func__);
+ pf_info(pf, "%s: attempting to rebuild PF VSI\n", __func__);
/* no VEB, so rebuild only the Main VSI */
ret = i40e_add_vsi(pf->vsi[pf->lan_vsi]);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: rebuild of Main VSI failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: rebuild of Main VSI failed: %d\n",
+ __func__, ret);
goto end_core_reset;
}
i40e_sys_add_vsi(pf->vsi[pf->lan_vsi]);
@@ -4818,7 +4760,7 @@ static void i40e_handle_reset_warning(struct i40e_pf *pf)
dv.subbuild_version = 0;
i40e_aq_send_driver_version(&pf->hw, &dv, NULL);
- dev_info(&pf->pdev->dev, "%s: PF reset done\n", __func__);
+ pf_info(pf, "%s: PF reset done\n", __func__);
end_core_reset:
clear_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state);
@@ -4850,9 +4792,8 @@ static i40e_status i40e_handle_mdd_event(struct i40e_pf *pf)
>> I40E_GL_MDET_TX_EVENT_SHIFT;
u8 queue = (reg & I40E_GL_MDET_TX_QUEUE_MASK)
>> I40E_GL_MDET_TX_QUEUE_SHIFT;
- dev_info(&pf->pdev->dev,
- "%s: Malicious Driver Detection TX event 0x%02x on q %d of function 0x%02x\n",
- __func__, event, queue, func);
+ pf_info(pf, "%s: Malicious Driver Detection TX event 0x%02x on q %d of function 0x%02x\n",
+ __func__, event, queue, func);
wr32(hw, I40E_GL_MDET_TX, 0xffffffff);
mdd_detected = true;
}
@@ -4864,9 +4805,8 @@ static i40e_status i40e_handle_mdd_event(struct i40e_pf *pf)
>> I40E_GL_MDET_RX_EVENT_SHIFT;
u8 queue = (reg & I40E_GL_MDET_RX_QUEUE_MASK)
>> I40E_GL_MDET_RX_QUEUE_SHIFT;
- dev_info(&pf->pdev->dev,
- "%s: Malicious Driver Detection RX event 0x%02x on q %d of function 0x%02x\n",
- __func__, event, queue, func);
+ pf_info(pf, "%s: Malicious Driver Detection RX event 0x%02x on q %d of function 0x%02x\n",
+ __func__, event, queue, func);
wr32(hw, I40E_GL_MDET_RX, 0xffffffff);
mdd_detected = true;
}
@@ -4878,25 +4818,21 @@ static i40e_status i40e_handle_mdd_event(struct i40e_pf *pf)
if (reg & I40E_VP_MDET_TX_VALID_MASK) {
wr32(hw, I40E_VP_MDET_TX(i), 0xFFFF);
vf->num_mdd_events++;
- dev_info(&pf->pdev->dev, "%s: MDD TX event on VF %d\n",
- __func__, i);
+ pf_info(pf, "%s: MDD TX event on VF %d\n", __func__, i);
}
reg = rd32(hw, I40E_VP_MDET_RX(i));
if (reg & I40E_VP_MDET_RX_VALID_MASK) {
wr32(hw, I40E_VP_MDET_RX(i), 0xFFFF);
vf->num_mdd_events++;
- dev_info(&pf->pdev->dev, "%s: MDD RX event on VF %d\n",
- __func__, i);
+ pf_info(pf, "%s: MDD RX event on VF %d\n", __func__, i);
}
if (vf->num_mdd_events > I40E_DEFAULT_NUM_MDD_EVENTS_ALLOWED) {
- dev_info(&pf->pdev->dev,
- "%s: Too many MDD events on VF %d, disabled\n",
- __func__, i);
- dev_info(&pf->pdev->dev,
- "%s: Use PF Control I/F to re-enable the VF\n",
- __func__);
+ pf_info(pf, "%s: Too many MDD events on VF %d, disabled\n",
+ __func__, i);
+ pf_info(pf, "%s: Use PF Control I/F to re-enable the VF\n",
+ __func__);
set_bit(I40E_VF_STAT_DISABLED, &vf->vf_states);
}
}
@@ -5089,19 +5025,18 @@ static s32 i40e_vsi_clear(struct i40e_vsi *vsi)
mutex_lock(&pf->switch_mutex);
if (!pf->vsi[vsi->idx]) {
- dev_err(&pf->pdev->dev, "%s: pf->vsi[%d] is NULL, just free vsi[%d](%p,type %d)\n",
- __func__, vsi->idx, vsi->idx, vsi, vsi->type);
+ pf_err(pf, "%s: pf->vsi[%d] is NULL, just free vsi[%d](%p,type %d)\n",
+ __func__, vsi->idx, vsi->idx, vsi, vsi->type);
goto unlock_vsi;
}
if (pf->vsi[vsi->idx] != vsi) {
- dev_err(&pf->pdev->dev,
- "%s: pf->vsi[%d](%p, type %d) != vsi[%d](%p,type %d): no free!\n",
- __func__,
- pf->vsi[vsi->idx]->idx,
- pf->vsi[vsi->idx],
- pf->vsi[vsi->idx]->type,
- vsi->idx, vsi, vsi->type);
+ pf_err(pf, "%s: pf->vsi[%d](%p, type %d) != vsi[%d](%p,type %d): no free!\n",
+ __func__,
+ pf->vsi[vsi->idx]->idx,
+ pf->vsi[vsi->idx],
+ pf->vsi[vsi->idx]->type,
+ vsi->idx, vsi, vsi->type);
goto unlock_vsi;
}
@@ -5214,24 +5149,21 @@ static int i40e_reserve_msix_vectors(struct i40e_pf *pf, int vectors)
break;
} else if (err < 0) {
/* total failure */
- dev_info(&pf->pdev->dev,
- "%s: MSI-X vector reservation failed: %d\n",
- __func__, err);
+ pf_info(pf, "%s: MSI-X vector reservation failed: %d\n",
+ __func__, err);
vectors = 0;
break;
} else {
/* err > 0 is the hint for retry */
- dev_info(&pf->pdev->dev,
- "%s: MSI-X vectors wanted %d, retrying with %d\n",
- __func__, vectors, err);
+ pf_info(pf, "%s: MSI-X vectors wanted %d, retrying with %d\n",
+ __func__, vectors, err);
vectors = err;
}
}
if (vectors > 0 && vectors < I40E_MIN_MSIX) {
- dev_info(&pf->pdev->dev,
- "%s: Couldn't get enough vectors, only %d available\n",
- __func__, vectors);
+ pf_info(pf, "%s: Couldn't get enough vectors, only %d available\n",
+ __func__, vectors);
vectors = 0;
}
@@ -5293,9 +5225,8 @@ static i40e_status i40e_init_msix(struct i40e_pf *pf)
} else if (vec == I40E_MIN_MSIX) {
/* Adjust for minimal MSIX use */
- dev_info(&pf->pdev->dev,
- "%s: Features disabled, not enough MSIX vectors\n",
- __func__);
+ pf_info(pf, "%s: Features disabled, not enough MSIX vectors\n",
+ __func__);
pf->flags &= ~I40E_FLAG_VMDQ_ENABLED;
pf->num_vmdq_vsis = 0;
pf->num_vmdq_qps = 0;
@@ -5403,9 +5334,8 @@ static void i40e_init_interrupt_scheme(struct i40e_pf *pf)
(pf->flags & I40E_FLAG_MSI_ENABLED)) {
err = pci_enable_msi(pf->pdev);
if (err) {
- dev_info(&pf->pdev->dev,
- "%s: MSI init failed (%d), trying legacy.\n",
- __func__, err);
+ pf_info(pf, "%s: MSI init failed (%d), trying legacy.\n",
+ __func__, err);
pf->flags &= ~I40E_FLAG_MSI_ENABLED;
}
}
@@ -5437,9 +5367,8 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf)
err = request_irq(pf->msix_entries[0].vector,
i40e_intr, 0, pf->misc_int_name, pf);
if (err) {
- dev_info(&pf->pdev->dev,
- "%s, request_irq for msix_misc failed: %d\n",
- __func__, err);
+ pf_info(pf, "%s, request_irq for msix_misc failed: %d\n",
+ __func__, err);
return I40E_ERR_CONFIG;
}
}
@@ -5565,11 +5494,9 @@ static int i40e_sw_init(struct i40e_pf *pf)
if ((pf->hw.func_caps.fd_filters_guaranteed > 0) ||
(pf->hw.func_caps.fd_filters_best_effort > 0)) {
pf->flags |= I40E_FLAG_FDIR_ATR_ENABLED;
- dev_info(&pf->pdev->dev,
- "Flow Director ATR mode Enabled\n");
+ pf_info(pf, "Flow Director ATR mode Enabled\n");
pf->flags |= I40E_FLAG_FDIR_ENABLED;
- dev_info(&pf->pdev->dev,
- "Flow Director Side Band mode Enabled\n");
+ pf_info(pf, "Flow Director Side Band mode Enabled\n");
pf->fdir_pf_filter_count =
pf->hw.func_caps.fd_filters_guaranteed;
}
@@ -5586,7 +5513,7 @@ static int i40e_sw_init(struct i40e_pf *pf)
/* MFP mode enabled */
if (pf->hw.func_caps.npar_enable || pf->hw.func_caps.mfp_mode_1) {
pf->flags |= I40E_FLAG_MFP_ENABLED;
- dev_info(&pf->pdev->dev, "%s: MFP mode Enabled\n", __func__);
+ pf_info(pf, "%s: MFP mode Enabled\n", __func__);
}
#ifdef CONFIG_PCI_IOV
@@ -5804,9 +5731,8 @@ static s32 i40e_add_vsi(struct i40e_vsi *vsi)
ret = i40e_aq_get_vsi_params(&pf->hw, &ctxt, NULL);
ctxt.flags = I40E_AQ_VSI_TYPE_PF;
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: couldn't get pf vsi config, err %d, aq_err %d\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: couldn't get pf vsi config, err %d, aq_err %d\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
return ret;
}
memcpy(&vsi->info, &ctxt.info, sizeof(ctxt.info));
@@ -5826,9 +5752,8 @@ static s32 i40e_add_vsi(struct i40e_vsi *vsi)
i40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, false);
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: update vsi failed, aq_err=%d\n",
- __func__, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: update vsi failed, aq_err=%d\n",
+ __func__, pf->hw.aq.asq_last_status);
goto err;
}
/* update the local VSI info queue map */
@@ -5841,10 +5766,9 @@ static s32 i40e_add_vsi(struct i40e_vsi *vsi)
*/
ret = i40e_vsi_config_tc(vsi, enabled_tc);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: failed to configure TCs for main VSI tc_map 0x%08x, err %d, aq_err %d\n",
- __func__, enabled_tc, ret,
- pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: failed to configure TCs for main VSI tc_map 0x%08x, err %d, aq_err %d\n",
+ __func__, enabled_tc, ret,
+ pf->hw.aq.asq_last_status);
}
}
break;
@@ -5905,9 +5829,8 @@ static s32 i40e_add_vsi(struct i40e_vsi *vsi)
if (vsi->type != I40E_VSI_MAIN) {
ret = i40e_aq_add_vsi(hw, &ctxt, NULL);
if (ret) {
- dev_info(&vsi->back->pdev->dev,
- "%s: add vsi failed, aq_err=%d\n",
- __func__, vsi->back->hw.aq.asq_last_status);
+ pf_info(vsi->back, "%s: add vsi failed, aq_err=%d\n",
+ __func__, vsi->back->hw.aq.asq_last_status);
goto err;
}
memcpy(&vsi->info, &ctxt.info, sizeof(ctxt.info));
@@ -5929,9 +5852,8 @@ static s32 i40e_add_vsi(struct i40e_vsi *vsi)
/* Update VSI BW information */
ret = i40e_vsi_get_bw_info(vsi);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: couldn't get vsi bw info, err %d, aq_err %d\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: couldn't get vsi bw info, err %d, aq_err %d\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
/* VSI is already added so not tearing that up */
ret = I40E_SUCCESS;
}
@@ -5961,13 +5883,13 @@ s32 i40e_vsi_release(struct i40e_vsi *vsi)
/* release of a VEB-owner or last VSI is not allowed */
if (vsi->flags & I40E_VSI_FLAG_VEB_OWNER) {
- dev_info(&pf->pdev->dev, "%s: VSI %d has existing VEB %d\n",
- __func__, vsi->seid, vsi->uplink_seid);
+ pf_info(pf, "%s: VSI %d has existing VEB %d\n",
+ __func__, vsi->seid, vsi->uplink_seid);
return I40E_ERR_DEVICE_NOT_SUPPORTED;
}
if (vsi == pf->vsi[pf->lan_vsi] &&
!test_bit(__I40E_DOWN, &pf->state)) {
- dev_info(&pf->pdev->dev, "%s: Can't remove PF VSI\n", __func__);
+ pf_info(pf, "%s: Can't remove PF VSI\n", __func__);
return I40E_ERR_DEVICE_NOT_SUPPORTED;
}
@@ -6046,23 +5968,21 @@ static s32 i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
struct i40e_pf *pf = vsi->back;
if (vsi->q_vectors) {
- dev_info(&pf->pdev->dev, "%s: VSI %d has existing q_vectors\n",
- __func__, vsi->seid);
+ pf_info(pf, "%s: VSI %d has existing q_vectors\n",
+ __func__, vsi->seid);
return I40E_ERR_CONFIG;
}
if (vsi->base_vector) {
- dev_info(&pf->pdev->dev,
- "%s: VSI %d has non-zero base vector %d\n",
- __func__, vsi->seid, vsi->base_vector);
+ pf_info(pf, "%s: VSI %d has non-zero base vector %d\n",
+ __func__, vsi->seid, vsi->base_vector);
return I40E_ERR_CONFIG;
}
ret = i40e_alloc_q_vectors(vsi);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: failed to allocate %d q_vector for VSI %d, ret=%d\n",
- __func__, vsi->num_q_vectors, vsi->seid, ret);
+ pf_info(pf, "%s: failed to allocate %d q_vector for VSI %d, ret=%d\n",
+ __func__, vsi->num_q_vectors, vsi->seid, ret);
vsi->num_q_vectors = 0;
goto vector_setup_out;
}
@@ -6070,9 +5990,8 @@ static s32 i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
vsi->base_vector = i40e_get_lump(pf, pf->irq_pile,
vsi->num_q_vectors, vsi->idx);
if (vsi->base_vector < 0) {
- dev_info(&pf->pdev->dev,
- "%s: failed to get q tracking for VSI %d, err=%d\n",
- __func__, vsi->seid, vsi->base_vector);
+ pf_info(pf, "%s: failed to get q tracking for VSI %d, err=%d\n",
+ __func__, vsi->seid, vsi->base_vector);
i40e_vsi_free_q_vectors(vsi);
ret = I40E_ERR_CONFIG;
goto vector_setup_out;
@@ -6131,8 +6050,8 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
}
}
if (!vsi) {
- dev_info(&pf->pdev->dev, "%s: no such uplink_seid %d\n",
- __func__, uplink_seid);
+ pf_info(pf, "%s: no such uplink_seid %d\n",
+ __func__, uplink_seid);
return NULL;
}
@@ -6148,8 +6067,7 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
veb = pf->veb[i];
}
if (!veb) {
- dev_info(&pf->pdev->dev, "%s: couldn't add VEB\n",
- __func__);
+ pf_info(pf, "%s: couldn't add VEB\n", __func__);
return NULL;
}
@@ -6172,8 +6090,8 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
/* assign it some queues */
ret = i40e_get_lump(pf, pf->qp_pile, vsi->alloc_queue_pairs, vsi->idx);
if (ret < 0) {
- dev_info(&pf->pdev->dev, "%s: VSI %d get_lump failed %d\n",
- __func__, vsi->seid, ret);
+ pf_info(pf, "%s: VSI %d get_lump failed %d\n",
+ __func__, vsi->seid, ret);
goto err_vsi;
}
vsi->base_queue = ret;
@@ -6255,18 +6173,16 @@ static s32 i40e_veb_get_bw_info(struct i40e_veb *veb)
ret = i40e_aq_query_switch_comp_bw_config(hw, veb->seid,
&bw_data, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: query veb bw config failed, aq_err=%d\n",
- __func__, hw->aq.asq_last_status);
+ pf_info(pf, "%s: query veb bw config failed, aq_err=%d\n",
+ __func__, hw->aq.asq_last_status);
goto out;
}
ret = i40e_aq_query_switch_comp_ets_config(hw, veb->seid,
&ets_data, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&pf->pdev->dev,
- "%s: query veb bw ets config failed, aq_err=%d\n",
- __func__, hw->aq.asq_last_status);
+ pf_info(pf, "%s: query veb bw ets config failed, aq_err=%d\n",
+ __func__, hw->aq.asq_last_status);
goto out;
}
@@ -6421,9 +6337,8 @@ s32 i40e_veb_release(struct i40e_veb *veb)
}
}
if (n != 1) {
- dev_info(&pf->pdev->dev,
- "%s: can't remove VEB %d with %d VSIs left\n",
- __func__, veb->seid, n);
+ pf_info(pf, "%s: can't remove VEB %d with %d VSIs left\n",
+ __func__, veb->seid, n);
return I40E_ERR_NOT_READY;
}
@@ -6464,9 +6379,8 @@ static s32 i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi)
ret = i40e_aq_add_veb(&veb->pf->hw, veb->uplink_seid, vsi->seid,
veb->enabled_tc, is_default, &veb->seid, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&veb->pf->pdev->dev,
- "%s: couldn't add VEB, err %d, aq_err %d\n",
- __func__, ret, veb->pf->hw.aq.asq_last_status);
+ pf_info(veb->pf, "%s: couldn't add VEB, err %d, aq_err %d\n",
+ __func__, ret, veb->pf->hw.aq.asq_last_status);
return ret;
}
@@ -6474,16 +6388,14 @@ static s32 i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi)
ret = i40e_aq_get_veb_parameters(&veb->pf->hw, veb->seid, NULL, NULL,
&veb->stats_idx, NULL, NULL, NULL);
if (ret != I40E_SUCCESS) {
- dev_info(&veb->pf->pdev->dev,
- "%s: couldn't get VEB statistics idx, err %d, aq_err %d\n",
- __func__, ret, veb->pf->hw.aq.asq_last_status);
+ pf_info(veb->pf, "%s: couldn't get VEB statistics idx, err %d, aq_err %d\n",
+ __func__, ret, veb->pf->hw.aq.asq_last_status);
return ret;
}
ret = i40e_veb_get_bw_info(veb);
if (ret != I40E_SUCCESS) {
- dev_info(&veb->pf->pdev->dev,
- "%s: couldn't get VEB bw info, err %d, aq_err %d\n",
- __func__, ret, veb->pf->hw.aq.asq_last_status);
+ pf_info(veb->pf, "%s: couldn't get VEB bw info, err %d, aq_err %d\n",
+ __func__, ret, veb->pf->hw.aq.asq_last_status);
i40e_aq_delete_element(&veb->pf->hw, veb->seid, NULL);
return ret;
}
@@ -6527,9 +6439,8 @@ struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags,
/* if one seid is 0, the other must be 0 to create a floating relay */
if ((uplink_seid == 0 || vsi_seid == 0) &&
(uplink_seid + vsi_seid != 0)) {
- dev_info(&pf->pdev->dev,
- "%s: one, not both seid's are 0: uplink=%d vsi=%d\n",
- __func__, uplink_seid, vsi_seid);
+ pf_info(pf, "%s: one, not both seid's are 0: uplink=%d vsi=%d\n",
+ __func__, uplink_seid, vsi_seid);
return NULL;
}
@@ -6538,8 +6449,7 @@ struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags,
if (pf->vsi[vsi_idx] && pf->vsi[vsi_idx]->seid == vsi_seid)
break;
if (vsi_idx >= pf->hw.func_caps.num_vsis && vsi_seid != 0) {
- dev_info(&pf->pdev->dev, "%s: vsi seid %d not found\n",
- __func__, vsi_seid);
+ pf_info(pf, "%s: vsi seid %d not found\n", __func__, vsi_seid);
return NULL;
}
@@ -6552,9 +6462,8 @@ struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags,
}
}
if (!uplink_veb) {
- dev_info(&pf->pdev->dev,
- "%s: uplink seid %d not found\n",
- __func__, uplink_seid);
+ pf_info(pf, "%s: uplink seid %d not found\n",
+ __func__, uplink_seid);
return NULL;
}
}
@@ -6611,17 +6520,15 @@ s32 i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig)
I40E_AQ_LARGE_BUF,
&next_seid, NULL);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: get switch config failed %d aq_err=%x\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: get switch config failed %d aq_err=%x\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
kfree(aq_buf);
return ret;
}
if (printconfig)
- dev_info(&pf->pdev->dev,
- "%s: header: %d reported %d total\n",
- __func__, sw_config->header.num_reported,
- sw_config->header.num_total);
+ pf_info(pf, "%s: header: %d reported %d total\n",
+ __func__, sw_config->header.num_reported,
+ sw_config->header.num_total);
if (sw_config->header.num_reported) {
int sz = sizeof(struct i40e_aqc_get_switch_config_resp)
@@ -6634,13 +6541,12 @@ s32 i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig)
for (i = 0; i < sw_config->header.num_reported; i++) {
if (printconfig)
- dev_info(&pf->pdev->dev,
- "%s: type=%d seid=%d uplink=%d downlink=%d\n",
- __func__,
- sw_config->element[i].element_type,
- sw_config->element[i].seid,
- sw_config->element[i].uplink_seid,
- sw_config->element[i].downlink_seid);
+ pf_info(pf, "%s: type=%d seid=%d uplink=%d downlink=%d\n",
+ __func__,
+ sw_config->element[i].element_type,
+ sw_config->element[i].seid,
+ sw_config->element[i].uplink_seid,
+ sw_config->element[i].downlink_seid);
switch (sw_config->element[i].element_type) {
case I40E_SWITCH_ELEMENT_TYPE_MAC:
@@ -6686,10 +6592,9 @@ s32 i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig)
pf->pf_seid = sw_config->element[i].downlink_seid;
pf->main_vsi_seid = sw_config->element[i].seid;
if (printconfig)
- dev_info(&pf->pdev->dev,
- "%s: pf_seid=%d main_vsi_seid=%d\n",
- __func__,
- pf->pf_seid, pf->main_vsi_seid);
+ pf_info(pf, "%s: pf_seid=%d main_vsi_seid=%d\n",
+ __func__,
+ pf->pf_seid, pf->main_vsi_seid);
break;
case I40E_SWITCH_ELEMENT_TYPE_PF:
case I40E_SWITCH_ELEMENT_TYPE_VF:
@@ -6700,11 +6605,10 @@ s32 i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig)
/* ignore these for now */
break;
default:
- dev_info(&pf->pdev->dev,
- "%s: unknown element type=%d seid=%d\n",
- __func__,
- sw_config->element[i].element_type,
- sw_config->element[i].seid);
+ pf_info(pf, "%s: unknown element type=%d seid=%d\n",
+ __func__,
+ sw_config->element[i].element_type,
+ sw_config->element[i].seid);
break;
}
}
@@ -6727,9 +6631,8 @@ static s32 i40e_setup_pf_switch(struct i40e_pf *pf)
/* find out what's out there already */
ret = i40e_fetch_switch_configuration(pf, false);
if (ret) {
- dev_info(&pf->pdev->dev,
- "%s: couldn't fetch switch config, err %d, aq_err %d\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(pf, "%s: couldn't fetch switch config, err %d, aq_err %d\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
return ret;
}
i40e_pf_reset_stats(pf);
@@ -6755,8 +6658,7 @@ static s32 i40e_setup_pf_switch(struct i40e_pf *pf)
vsi = i40e_vsi_setup(pf, I40E_VSI_MAIN, uplink_seid, 0);
if (vsi == NULL) {
- dev_info(&pf->pdev->dev,
- "%s: setup of MAIN VSI failed\n", __func__);
+ pf_info(pf, "%s: setup of MAIN VSI failed\n", __func__);
i40e_fdir_teardown(pf);
return I40E_ERR_NOT_READY;
}
@@ -6778,8 +6680,8 @@ static s32 i40e_setup_pf_switch(struct i40e_pf *pf)
/* Setup static PF queue filter control settings */
ret = i40e_setup_pf_filter_control(pf);
if (ret) {
- dev_info(&pf->pdev->dev, "%s: setup_pf_filter_control failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: setup_pf_filter_control failed: %d\n",
+ __func__, ret);
/* Failure here should not stop continuing other steps */
}
@@ -6876,8 +6778,8 @@ pf->rss_size = num_tc0; \
queues_left -= pf->rss_size;
if (queues_left < 0) {
- dev_info(&pf->pdev->dev,
- "%s: not enough queues for DCB\n", __func__);
+ pf_info(pf, "%s: not enough queues for DCB\n",
+ __func__);
return I40E_ERR_CONFIG;
}
@@ -6892,9 +6794,8 @@ pf->rss_size = num_tc0; \
queues_left -= pf->rss_size;
if (queues_left < 0) {
- dev_info(&pf->pdev->dev,
- "%s: not enough queues for Flow Director\n",
- __func__);
+ pf_info(pf, "%s: not enough queues for Flow Director\n",
+ __func__);
return I40E_ERR_CONFIG;
}
@@ -6913,18 +6814,16 @@ pf->rss_size = num_tc0; \
SET_RSS_SIZE;
queues_left -= pf->rss_size;
if (queues_left < 0) {
- dev_info(&pf->pdev->dev,
- "%s: not enough queues for DCB and Flow Director\n",
- __func__);
+ pf_info(pf, "%s: not enough queues for DCB and Flow Director\n",
+ __func__);
return I40E_ERR_CONFIG;
}
pf->num_lan_qps = pf->rss_size + accum_tc_size;
} else {
- dev_info(&pf->pdev->dev,
- "%s: Invalid configuration, flags=0x%08llx\n",
- __func__, pf->flags);
+ pf_info(pf, "%s: Invalid configuration, flags=0x%08llx\n",
+ __func__, pf->flags);
return I40E_ERR_CONFIG;
}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_sysfs.c b/drivers/net/ethernet/intel/i40e/i40e_sysfs.c
index fe83333..0a672c0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_sysfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_sysfs.c
@@ -455,14 +455,13 @@ i40e_status i40e_sys_add_vsi(struct i40e_vsi *vsi)
ret = sysfs_create_group(vsi->kobj, &i40e_sys_vsi_attr_group);
if (ret < 0)
- dev_info(&pf->pdev->dev, "%s: create_group failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: create_group failed: %d\n", __func__, ret);
if (vsi->netdev) {
ret = sysfs_create_link(vsi->kobj,
&vsi->netdev->dev.kobj, "net");
if (ret < 0)
- dev_info(&pf->pdev->dev, "%s: create_link failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: create_link failed: %d\n",
+ __func__, ret);
}
return I40E_SUCCESS;
@@ -536,8 +535,7 @@ i40e_status i40e_sys_add_veb(struct i40e_veb *veb)
ret = sysfs_create_group(veb->kobj, &i40e_sys_veb_attr_group);
if (ret < 0)
- dev_info(&pf->pdev->dev, "%s: create_group failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: create_group failed: %d\n", __func__, ret);
return I40E_SUCCESS;
}
@@ -579,8 +577,7 @@ static i40e_status i40e_sys_add_switch(struct i40e_pf *pf)
ret = sysfs_create_group(pf->switch_kobj,
&i40e_sys_hw_switch_attr_group);
if (ret < 0)
- dev_info(&pf->pdev->dev, "%s: create_group failed: %d\n",
- __func__, ret);
+ pf_info(pf, "%s: create_group failed: %d\n", __func__, ret);
i40e_sys_add_vsi(pf->vsi[pf->lan_vsi]);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 441ae12..9580f00 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -371,18 +371,16 @@ static i40e_status i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_idx,
/* clear the context in the HMC */
ret = i40e_clear_lan_tx_queue_context(hw, pf_queue_id);
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev,
- "%s: Failed to clear LAN Tx queue context %d, error: %d\n",
- __func__, pf_queue_id, ret);
+ pf_err(pf, "%s: Failed to clear LAN Tx queue context %d, error: %d\n",
+ __func__, pf_queue_id, ret);
goto error_context;
}
/* set the context in the HMC */
ret = i40e_set_lan_tx_queue_context(hw, pf_queue_id, &tx_ctx);
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev,
- "%s: Failed to set LAN Tx queue context %d error: %d\n",
- __func__, pf_queue_id, ret);
+ pf_err(pf, "%s: Failed to set LAN Tx queue context %d error: %d\n",
+ __func__, pf_queue_id, ret);
goto error_context;
}
@@ -473,18 +471,16 @@ static i40e_status i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_idx,
/* clear the context in the HMC */
ret = i40e_clear_lan_rx_queue_context(hw, pf_queue_id);
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev,
- "%s: Failed to clear LAN Rx queue context %d, error: %d\n",
- __func__, pf_queue_id, ret);
+ pf_err(pf, "%s: Failed to clear LAN Rx queue context %d, error: %d\n",
+ __func__, pf_queue_id, ret);
goto error_context;
}
/* set the context in the HMC */
ret = i40e_set_lan_rx_queue_context(hw, pf_queue_id, &rx_ctx);
if (ret != I40E_SUCCESS)
- dev_err(&pf->pdev->dev,
- "%s: Failed to set LAN Rx queue context %d error: %d\n",
- __func__, pf_queue_id, ret);
+ pf_err(pf, "%s: Failed to set LAN Rx queue context %d error: %d\n",
+ __func__, pf_queue_id, ret);
error_param:
error_context:
@@ -510,31 +506,27 @@ static i40e_status i40e_alloc_vsi_res(struct i40e_vf *vf,
vsi = i40e_vsi_setup(pf, type, pf->vsi[pf->lan_vsi]->seid, vf->vf_id);
if (!vsi) {
- dev_err(&pf->pdev->dev,
- "%s: add vsi failed for vf %d, aq_err %d\n",
- __func__, vf->vf_id, pf->hw.aq.asq_last_status);
+ pf_err(pf, "%s: add vsi failed for vf %d, aq_err %d\n",
+ __func__, vf->vf_id, pf->hw.aq.asq_last_status);
goto error_alloc_vsi_res;
}
if (type == I40E_VSI_SRIOV) {
vf->lan_vsi_index = vsi->idx;
vf->lan_vsi_id = vsi->id;
- dev_info(&pf->pdev->dev,
- "%s: LAN VSI index %d, VSI id %d\n",
- __func__, vsi->idx, vsi->id);
+ pf_info(pf, "%s: LAN VSI index %d, VSI id %d\n",
+ __func__, vsi->idx, vsi->id);
f = i40e_add_filter(vsi, vf->default_lan_addr.addr,
0, true, false);
}
if (NULL == f) {
- dev_err(&pf->pdev->dev,
- "%s: Unable to add ucast filter\n", __func__);
+ pf_err(pf, "%s: Unable to add ucast filter\n", __func__);
ret = I40E_ERR_NO_MEMORY;
goto error_alloc_vsi_res;
}
/* program mac filter */
if (I40E_SUCCESS != i40e_sync_vsi_filters(vsi)) {
- dev_err(&pf->pdev->dev,
- "%s: Unable to program ucast filters\n", __func__);
+ pf_err(pf, "%s: Unable to program ucast filters\n", __func__);
ret = I40E_ERR_CONFIG;
goto error_alloc_vsi_res;
}
@@ -542,10 +534,9 @@ static i40e_status i40e_alloc_vsi_res(struct i40e_vf *vf,
/* accept bcast pkts. by default */
ret = i40e_aq_set_vsi_broadcast(hw, vsi->seid, true, NULL);
if (I40E_SUCCESS != ret)
- dev_err(&pf->pdev->dev,
- "%s: set vsi bcast failed for vf %d, vsi %d, aq_err %d\n",
- __func__, vf->vf_id, vsi->idx,
- pf->hw.aq.asq_last_status);
+ pf_err(pf, "%s: set vsi bcast failed for vf %d, vsi %d, aq_err %d\n",
+ __func__, vf->vf_id, vsi->idx,
+ pf->hw.aq.asq_last_status);
error_alloc_vsi_res:
return ret;
@@ -601,8 +592,8 @@ i40e_status i40e_reset_vf(struct i40e_vf *vf, bool flr)
}
if (!rsd)
- dev_err(&pf->pdev->dev, "%s: VF reset check timeout %d\n",
- __func__, vf->vf_id);
+ pf_err(pf, "%s: VF reset check timeout %d\n",
+ __func__, vf->vf_id);
/* fast disable qps */
for (j = 0; j < pf->vsi[vf->lan_vsi_index]->num_queue_pairs; j++) {
@@ -622,15 +613,13 @@ i40e_status i40e_reset_vf(struct i40e_vf *vf, bool flr)
ret = i40e_ctrl_vsi_tx_queue(vf, vf->lan_vsi_index, j,
I40E_QUEUE_CTRL_FASTDISABLECHECK);
if (ret != I40E_SUCCESS)
- dev_info(&pf->pdev->dev,
- "%s: Queue control check failed on Tx queue %d of VSI %d VF %d\n",
- __func__, vf->lan_vsi_index, j, vf->vf_id);
+ pf_info(pf, "%s: Queue control check failed on Tx queue %d of VSI %d VF %d\n",
+ __func__, vf->lan_vsi_index, j, vf->vf_id);
ret = i40e_ctrl_vsi_rx_queue(vf, vf->lan_vsi_index, j,
I40E_QUEUE_CTRL_FASTDISABLECHECK);
if (ret != I40E_SUCCESS)
- dev_info(&pf->pdev->dev,
- "%s: Queue control check failed on Rx queue %d of VSI %d VF %d\n",
- __func__, vf->lan_vsi_index, j, vf->vf_id);
+ pf_info(pf, "%s: Queue control check failed on Rx queue %d of VSI %d VF %d\n",
+ __func__, vf->lan_vsi_index, j, vf->vf_id);
}
/* clear the irq settings */
@@ -878,9 +867,8 @@ i40e_status i40e_free_vfs(struct i40e_pf *pf)
if (!i40e_vfs_are_assigned(pf))
pci_disable_sriov(pf->pdev);
else
- dev_warn(&pf->pdev->dev,
- "%s: unable to disable SR-IOV because VFs are assigned.\n",
- __func__);
+ pf_warn(pf, "%s: unable to disable SR-IOV because VFs are assigned.\n",
+ __func__);
/* Re-enable interrupt 0. */
wr32(hw, I40E_PFINT_DYN_CTL0,
@@ -907,8 +895,8 @@ static i40e_status i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)
err = pci_enable_sriov(pf->pdev, num_alloc_vfs);
if (err) {
- dev_err(&pf->pdev->dev, "%s: pci_enable_sriov failed with error %d!\n",
- __func__, err);
+ pf_err(pf, "%s: pci_enable_sriov failed with error %d!\n",
+ __func__, err);
pf->num_alloc_vfs = 0;
ret = I40E_ERR_CONFIG;
goto err_iov;
@@ -963,7 +951,7 @@ static int i40e_pci_sriov_enable(struct pci_dev *pdev, int num_vfs)
int pre_existing_vfs = pci_num_vf(pdev);
int err = 0;
- dev_info(&pdev->dev, "%s: Allocating %d VFs.\n", __func__, num_vfs);
+ dev_info(&pdev->dev, "%s: Allocating %d VFs\n", __func__, num_vfs);
if (pre_existing_vfs && pre_existing_vfs != num_vfs)
err = i40e_free_vfs(pf);
else if (pre_existing_vfs && pre_existing_vfs == num_vfs)
@@ -1033,16 +1021,14 @@ static i40e_status i40e_vc_send_msg_to_vf(struct i40e_vf *vf,
/* single place to detect unsuccessful return values */
if (v_retval != I40E_SUCCESS) {
vf->num_invalid_msgs++;
- dev_err(&pf->pdev->dev, "%s: Failed opcode %d Error: %d\n",
- __func__, v_opcode, v_retval);
+ pf_err(pf, "%s: Failed opcode %d Error: %d\n",
+ __func__, v_opcode, v_retval);
if (vf->num_invalid_msgs >
I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED) {
- dev_err(&pf->pdev->dev,
- "%s: Number of invalid messages exceeded for VF %d\n",
- __func__, vf->vf_id);
- dev_err(&pf->pdev->dev,
- "%s: Use PF Control I/F to enable the VF\n",
- __func__);
+ pf_err(pf, "%s: Number of invalid messages exceeded for VF %d\n",
+ __func__, vf->vf_id);
+ pf_err(pf, "%s: Use PF Control I/F to enable the VF\n",
+ __func__);
set_bit(I40E_VF_STAT_DISABLED, &vf->vf_states);
}
} else {
@@ -1052,9 +1038,8 @@ static i40e_status i40e_vc_send_msg_to_vf(struct i40e_vf *vf,
ret = i40e_aq_send_msg_to_vf(hw, vf->vf_id, v_opcode, v_retval,
msg, msglen, NULL);
if (I40E_SUCCESS != ret)
- dev_err(&pf->pdev->dev,
- "%s: Unable to send the message to VF %d aq_err %d\n",
- __func__, vf->vf_id, pf->hw.aq.asq_last_status);
+ pf_err(pf, "%s: Unable to send the message to VF %d aq_err %d\n",
+ __func__, vf->vf_id, pf->hw.aq.asq_last_status);
return ret;
}
@@ -1433,9 +1418,8 @@ static i40e_status i40e_vc_enable_queues_msg(struct i40e_vf *vf,
ret = i40e_ctrl_vsi_rx_queue(vf, vsi_id, queue_id,
I40E_QUEUE_CTRL_ENABLECHECK);
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev,
- "%s: Queue control check failed on RX queue %d of VSI %d VF %d\n",
- __func__, queue_id, vsi_id, vf->vf_id);
+ pf_err(pf, "%s: Queue control check failed on RX queue %d of VSI %d VF %d\n",
+ __func__, queue_id, vsi_id, vf->vf_id);
}
queue_id = find_next_bit(&tempmap, I40E_MAX_VSI_QP,
queue_id + 1);
@@ -1447,9 +1431,8 @@ static i40e_status i40e_vc_enable_queues_msg(struct i40e_vf *vf,
ret = i40e_ctrl_vsi_tx_queue(vf, vsi_id, queue_id,
I40E_QUEUE_CTRL_ENABLECHECK);
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev,
- "%s: Queue control check failed on TX queue %d of VSI %d VF %d\n",
- __func__, queue_id, vsi_id, vf->vf_id);
+ pf_err(pf, "%s: Queue control check failed on TX queue %d of VSI %d VF %d\n",
+ __func__, queue_id, vsi_id, vf->vf_id);
}
queue_id = find_next_bit(&tempmap, I40E_MAX_VSI_QP,
queue_id + 1);
@@ -1536,9 +1519,8 @@ static i40e_status i40e_vc_disable_queues_msg(struct i40e_vf *vf,
ret = i40e_ctrl_vsi_rx_queue(vf, vsi_id, queue_id,
I40E_QUEUE_CTRL_DISABLECHECK);
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev,
- "%s: Queue control check failed on RX queue %d of VSI %d VF %d\n",
- __func__, queue_id, vsi_id, vf->vf_id);
+ pf_err(pf, "%s: Queue control check failed on RX queue %d of VSI %d VF %d\n",
+ __func__, queue_id, vsi_id, vf->vf_id);
}
queue_id = find_next_bit(&tempmap, I40E_MAX_VSI_QP,
queue_id + 1);
@@ -1550,9 +1532,8 @@ static i40e_status i40e_vc_disable_queues_msg(struct i40e_vf *vf,
ret = i40e_ctrl_vsi_tx_queue(vf, vsi_id, queue_id,
I40E_QUEUE_CTRL_DISABLECHECK);
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev,
- "%s: Queue control check failed on TX queue %d of VSI %d VF %d\n",
- __func__, queue_id, vsi_id, vf->vf_id);
+ pf_err(pf, "%s: Queue control check failed on TX queue %d of VSI %d VF %d\n",
+ __func__, queue_id, vsi_id, vf->vf_id);
}
queue_id = find_next_bit(&tempmap, I40E_MAX_VSI_QP,
queue_id + 1);
@@ -1640,8 +1621,8 @@ static i40e_status i40e_vc_add_mac_addr_msg(struct i40e_vf *vf,
for (i = 0; i < al->num_elements; i++) {
if (is_broadcast_ether_addr(al->list[i].addr) ||
is_zero_ether_addr(al->list[i].addr)) {
- dev_err(&pf->pdev->dev, "%s: invalid MAC addr %pMAC\n",
- __func__, al->list[i].addr);
+ pf_err(pf, "%s: invalid MAC addr %pMAC\n",
+ __func__, al->list[i].addr);
ret = I40E_ERR_PARAM;
goto error_param;
}
@@ -1662,8 +1643,7 @@ static i40e_status i40e_vc_add_mac_addr_msg(struct i40e_vf *vf,
}
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev,
- "%s: Unable to add MAC filter\n", __func__);
+ pf_err(pf, "%s: Unable to add MAC filter\n", __func__);
ret = I40E_ERR_PARAM;
goto error_param;
}
@@ -1672,8 +1652,7 @@ static i40e_status i40e_vc_add_mac_addr_msg(struct i40e_vf *vf,
/* program the updated filter list */
ret = i40e_sync_vsi_filters(vsi);
if (I40E_SUCCESS != ret)
- dev_err(&pf->pdev->dev,
- "%s: Unable to program MAC filters\n", __func__);
+ pf_err(pf, "%s: Unable to program MAC filters\n", __func__);
error_param:
/* send the response to the vf */
@@ -1718,8 +1697,7 @@ static i40e_status i40e_vc_del_mac_addr_msg(struct i40e_vf *vf,
/* program the updated filter list */
ret = i40e_sync_vsi_filters(vsi);
if (I40E_SUCCESS != ret)
- dev_err(&pf->pdev->dev,
- "%s: Unable to program MAC filters\n", __func__);
+ pf_err(pf, "%s: Unable to program MAC filters\n", __func__);
error_param:
/* send the response to the vf */
@@ -1758,9 +1736,8 @@ static i40e_status i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg,
for (i = 0; i < vfl->num_elements; i++) {
if (vfl->vlan_id[i] > I40E_MAX_VLANID) {
ret = I40E_ERR_PARAM;
- dev_err(&pf->pdev->dev,
- "%s: invalid VLAN id %d\n",
- __func__, vfl->vlan_id[i]);
+ pf_err(pf, "%s: invalid VLAN id %d\n",
+ __func__, vfl->vlan_id[i]);
goto error_param;
}
}
@@ -1775,9 +1752,8 @@ static i40e_status i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg,
/* add new VLAN filter */
ret = i40e_vsi_add_vlan(vsi, vfl->vlan_id[i]);
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev,
- "%s: Unable to add vlan filter %d, error %d\n",
- __func__, vfl->vlan_id[i], ret);
+ pf_err(pf, "%s: Unable to add vlan filter %d, error %d\n",
+ __func__, vfl->vlan_id[i], ret);
goto error_param;
}
}
@@ -1831,9 +1807,8 @@ static i40e_status i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg,
for (i = 0; i < vfl->num_elements; i++) {
ret = i40e_vsi_kill_vlan(vsi, vfl->vlan_id[i]);
if (I40E_SUCCESS != ret)
- dev_err(&pf->pdev->dev,
- "%s: Unable to delete vlan filter %d, error %d\n",
- __func__, vfl->vlan_id[i], ret);
+ pf_err(pf, "%s: Unable to delete vlan filter %d, error %d\n",
+ __func__, vfl->vlan_id[i], ret);
}
error_param:
@@ -1997,8 +1972,7 @@ i40e_status i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id,
ret = i40e_vc_validate_vf_msg(vf, v_opcode, v_retval, msg, msglen);
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev, "%s: invalid message from vf %d\n",
- __func__, vf_id);
+ pf_err(pf, "%s: invalid message from vf %d\n", __func__, vf_id);
return ret;
}
wr32(hw, I40E_VFGEN_RSTAT1(vf_id), I40E_VFR_VFACTIVE);
@@ -2048,9 +2022,8 @@ i40e_status i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id,
break;
case I40E_VIRTCHNL_OP_UNKNOWN:
default:
- dev_err(&pf->pdev->dev,
- "%s: Unsupported opcode %d from vf %d\n",
- __func__, v_opcode, vf_id);
+ pf_err(pf, "%s: Unsupported opcode %d from vf %d\n",
+ __func__, v_opcode, vf_id);
ret = i40e_vc_send_resp_to_vf(vf, v_opcode,
I40E_ERR_NOT_IMPLEMENTED);
break;
@@ -2089,22 +2062,19 @@ i40e_status i40e_vc_process_vflr_event(struct i40e_pf *pf)
ret = i40e_reset_vf(vf, true);
if (ret != I40E_SUCCESS)
- dev_err(&pf->pdev->dev,
- "%s: Unable to reset the VF %d\n",
- __func__, vf_id);
+ pf_err(pf, "%s: Unable to reset the VF %d\n",
+ __func__, vf_id);
/* free up vf resources to destroy vsi state */
ret = i40e_free_vf_res(vf);
if (ret != I40E_SUCCESS)
- dev_err(&pf->pdev->dev,
- "%s: Failed to free VF resources %d\n",
- __func__, vf_id);
+ pf_err(pf, "%s: Failed to free VF resources %d\n",
+ __func__, vf_id);
/* allocate new vf resources with the default state */
ret = i40e_alloc_vf_res(vf);
if (ret != I40E_SUCCESS)
- dev_err(&pf->pdev->dev,
- "%s: Unable to allocate VF resources %d\n",
- __func__, vf_id);
+ pf_err(pf, "%s: Unable to allocate VF resources %d\n",
+ __func__, vf_id);
ret = i40e_enable_vf_mappings(vf);
}
@@ -2220,8 +2190,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
/* validate the request */
if (vf_id >= pf->num_alloc_vfs) {
- dev_err(&pf->pdev->dev,
- "%s: Invalid VF Identifier %d\n", __func__, vf_id);
+ pf_err(pf, "%s: Invalid VF Identifier %d\n", __func__, vf_id);
ret = -EINVAL;
goto error_param;
}
@@ -2229,15 +2198,13 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
vf = &(pf->vf[vf_id]);
vsi = pf->vsi[vf->lan_vsi_index];
if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) {
- dev_err(&pf->pdev->dev,
- "%s: Uninitialized VF %d\n", __func__, vf_id);
+ pf_err(pf, "%s: Uninitialized VF %d\n", __func__, vf_id);
ret = -EINVAL;
goto error_param;
}
if (!is_valid_ether_addr(mac)) {
- dev_err(&pf->pdev->dev,
- "%s: Invalid ethernet address\n", __func__);
+ pf_err(pf, "%s: Invalid ethernet address\n", __func__);
ret = -EINVAL;
goto error_param;
}
@@ -2248,25 +2215,21 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
/* add the new mac address */
f = i40e_add_filter(vsi, mac, 0, true, false);
if (NULL == f) {
- dev_err(&pf->pdev->dev,
- "%s: Unable to add ucast filter\n", __func__);
+ pf_err(pf, "%s: Unable to add ucast filter\n", __func__);
ret = -ENOMEM;
goto error_param;
}
- dev_info(&pf->pdev->dev, "%s: Setting MAC %pM on VF %d\n",
- __func__, mac, vf_id);
+ pf_info(pf, "%s: Setting MAC %pM on VF %d\n", __func__, mac, vf_id);
/* program mac filter */
if (I40E_SUCCESS != i40e_sync_vsi_filters(vsi)) {
- dev_err(&pf->pdev->dev,
- "%s: Unable to program ucast filters\n", __func__);
+ pf_err(pf, "%s: Unable to program ucast filters\n", __func__);
ret = -EIO;
goto error_param;
}
memcpy(vf->default_lan_addr.addr, mac, ETH_ALEN);
- dev_info(&pf->pdev->dev,
- "%s: Reload the VF driver to make this change effective.\n",
- __func__);
+ pf_info(pf, "%s: Reload the VF driver to make this change effective\n",
+ __func__);
ret = 0;
error_param:
@@ -2293,14 +2256,13 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
/* validate the request */
if (vf_id >= pf->num_alloc_vfs) {
- dev_err(&pf->pdev->dev, "%s: Invalid VF Identifier %d\n",
- __func__, vf_id);
+ pf_err(pf, "%s: Invalid VF Identifier %d\n", __func__, vf_id);
ret = -EINVAL;
goto error_pvid;
}
if ((vlan_id > I40E_MAX_VLANID) || (qos > 7)) {
- dev_err(&pf->pdev->dev, "%s: Invalid Parameters\n", __func__);
+ pf_err(pf, "%s: Invalid Parameters\n", __func__);
ret = -EINVAL;
goto error_pvid;
}
@@ -2308,8 +2270,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
vf = &(pf->vf[vf_id]);
vsi = pf->vsi[vf->lan_vsi_index];
if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) {
- dev_err(&pf->pdev->dev,
- "%s: Uninitialized VF %d\n", __func__, vf_id);
+ pf_err(pf, "%s: Uninitialized VF %d\n", __func__, vf_id);
ret = -EINVAL;
goto error_pvid;
}
@@ -2318,9 +2279,8 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
/* kill old VLAN */
ret = i40e_vsi_kill_vlan(vsi, vsi->info.pvid & VLAN_VID_MASK);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: remove VLAN failed, ret=%d, aq_err=%d\n",
- __func__, ret, pf->hw.aq.asq_last_status);
+ pf_info(vsi->back, "%s: remove VLAN failed, ret=%d, aq_err=%d\n",
+ __func__, ret, pf->hw.aq.asq_last_status);
}
}
if (vlan_id || qos)
@@ -2330,24 +2290,21 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
i40e_vlan_stripping_disable(vsi);
if (vlan_id) {
- dev_info(&pf->pdev->dev,
- "%s: Setting VLAN %d, QOS 0x%x on VF %d\n",
- __func__, vlan_id, qos, vf_id);
+ pf_info(pf, "%s: Setting VLAN %d, QOS 0x%x on VF %d\n",
+ __func__, vlan_id, qos, vf_id);
/* add new VLAN filter */
ret = i40e_vsi_add_vlan(vsi, vlan_id);
if (ret != I40E_SUCCESS) {
- dev_info(&vsi->back->pdev->dev,
- "%s: add VLAN failed, ret=%d aq_err=%d\n",
- __func__, ret,
- vsi->back->hw.aq.asq_last_status);
+ pf_info(vsi->back, "%s: add VLAN failed, ret=%d aq_err=%d\n",
+ __func__, ret,
+ vsi->back->hw.aq.asq_last_status);
goto error_pvid;
}
}
if (ret != I40E_SUCCESS) {
- dev_err(&pf->pdev->dev, "%s: Unable to update vsi context\n",
- __func__);
+ pf_err(pf, "%s: Unable to update vsi context\n", __func__);
ret = -EIO;
goto error_pvid;
}
@@ -2390,8 +2347,7 @@ int i40e_ndo_get_vf_config(struct net_device *netdev,
/* validate the request */
if (vf_id >= pf->num_alloc_vfs) {
- dev_err(&pf->pdev->dev,
- "%s: Invalid VF Identifier %d\n", __func__, vf_id);
+ pf_err(pf, "%s: Invalid VF Identifier %d\n", __func__, vf_id);
ret = -EINVAL;
goto error_param;
}
@@ -2400,8 +2356,7 @@ int i40e_ndo_get_vf_config(struct net_device *netdev,
/* first vsi is always the LAN vsi */
vsi = pf->vsi[vf->lan_vsi_index];
if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states)) {
- dev_err(&pf->pdev->dev,
- "%s: Uninitialized VF %d\n", __func__, vf_id);
+ pf_err(pf, "%s: Uninitialized VF %d\n", __func__, vf_id);
ret = -EINVAL;
goto error_param;
}
--
1.8.1.2.459.gbcd45b4.dirty
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 1/4] i40e: Whitespace cleaning
From: Joe Perches @ 2013-08-30 23:06 UTC (permalink / raw)
To: Jeff Kirsher
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, Tushar Dave, e1000-devel, netdev, linux-kernel
In-Reply-To: <cover.1377903831.git.joe@perches.com>
Mostly done via:
$ checkpatch --strict --fix -f drivers/net/ethernet/intel/i40e/*.[ch]
Removed externs from .h function prototypes
Aligned multiline statements to open parenthesis
Removed some blank lines before and after braces
Added a set of braces
Used sizeof(*foo)
Moved logical continuations from start to end of line
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/intel/i40e/i40e.h | 140 +++---
drivers/net/ethernet/intel/i40e/i40e_common.c | 20 +-
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 533 ++++++++++-----------
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 19 +-
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c | 24 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 128 +++--
drivers/net/ethernet/intel/i40e/i40e_nvm.c | 4 +-
drivers/net/ethernet/intel/i40e/i40e_sysfs.c | 12 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.h | 15 +-
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 13 +-
11 files changed, 448 insertions(+), 469 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 8cd94b0..6de5e63 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -95,16 +95,16 @@
#define prefetch(X)
#endif
-#define I40E_RX_DESC(R, i) \
- ((ring_is_16byte_desc_enabled(R)) \
- ? (union i40e_32byte_rx_desc *) \
- (&(((union i40e_16byte_rx_desc *)((R)->desc))[i])) \
- : (&(((union i40e_32byte_rx_desc *)((R)->desc))[i])))
-#define I40E_TX_DESC(R, i) \
+#define I40E_RX_DESC(R, i) \
+ (((ring_is_16byte_desc_enabled(R)) \
+ ? (union i40e_32byte_rx_desc *) \
+ (&(((union i40e_16byte_rx_desc *)((R)->desc))[i])) \
+ : (&(((union i40e_32byte_rx_desc *)((R)->desc))[i]))))
+#define I40E_TX_DESC(R, i) \
(&(((struct i40e_tx_desc *)((R)->desc))[i]))
-#define I40E_TX_CTXTDESC(R, i) \
+#define I40E_TX_CTXTDESC(R, i) \
(&(((struct i40e_tx_context_desc *)((R)->desc))[i]))
-#define I40E_TX_FDIRDESC(R, i) \
+#define I40E_TX_FDIRDESC(R, i) \
(&(((struct i40e_filter_program_desc *)((R)->desc))[i]))
/* default to trying for four seconds */
@@ -491,80 +491,76 @@ static inline bool i40e_rx_is_programming_status(u64 qw)
}
/* needed by i40e_ethtool.c */
-extern int i40e_up(struct i40e_vsi *vsi);
-extern void i40e_down(struct i40e_vsi *vsi);
+int i40e_up(struct i40e_vsi *vsi);
+void i40e_down(struct i40e_vsi *vsi);
extern const char i40e_driver_name[];
extern const char i40e_driver_version_str[];
-extern void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags);
-extern void i40e_update_stats(struct i40e_vsi *vsi);
-extern void i40e_update_eth_stats(struct i40e_vsi *vsi);
-extern struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi);
-extern s32 i40e_fetch_switch_configuration(struct i40e_pf *pf,
- bool printconfig);
+void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags);
+void i40e_update_stats(struct i40e_vsi *vsi);
+void i40e_update_eth_stats(struct i40e_vsi *vsi);
+struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi);
+s32 i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig);
/* needed by i40e_main.c */
-extern void i40e_add_fdir_filter(struct i40e_fdir_data fdir_data,
- struct i40e_ring *tx_ring);
-extern void i40e_add_remove_filter(struct i40e_fdir_data fdir_data,
- struct i40e_ring *tx_ring);
-extern void i40e_update_fdir_filter(struct i40e_fdir_data fdir_data,
- struct i40e_ring *tx_ring);
-extern i40e_status i40e_program_fdir_filter(struct i40e_fdir_data *fdir_data,
- struct i40e_pf *pf, bool add);
-
-extern void i40e_set_ethtool_ops(struct net_device *netdev);
-extern struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,
- u8 *macaddr, s16 vlan,
- bool is_vf, bool is_netdev);
-extern void i40e_del_filter(struct i40e_vsi *vsi,
- u8 *macaddr, s16 vlan,
- bool is_vf, bool is_netdev);
-extern i40e_status i40e_sync_vsi_filters(struct i40e_vsi *vsi);
-extern i40e_status __i40e_sync_vsi_filters_locked(struct i40e_vsi *);
-extern struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
- u16 uplink, u32 param1);
-extern s32 i40e_vsi_release(struct i40e_vsi *vsi);
-extern struct i40e_vsi *i40e_vsi_lookup(struct i40e_pf *pf,
- enum i40e_vsi_type type,
- struct i40e_vsi *start_vsi);
-extern struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags,
- u16 uplink_seid, u16 downlink_seid,
- u8 enabled_tc);
-extern s32 i40e_veb_release(struct i40e_veb *veb);
-
-extern i40e_status i40e_sys_add_vsi(struct i40e_vsi *vsi);
-extern void i40e_sys_del_vsi(struct i40e_vsi *vsi);
-extern i40e_status i40e_sys_add_veb(struct i40e_veb *veb);
-extern void i40e_sys_del_veb(struct i40e_veb *veb);
-extern i40e_status i40e_sys_init(struct i40e_pf *pf);
-extern void i40e_sys_exit(struct i40e_pf *pf);
-extern i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid);
-extern i40e_status i40e_vsi_remove_pvid(struct i40e_vsi *vsi);
-extern void i40e_vsi_reset_stats(struct i40e_vsi *vsi);
-extern void i40e_pf_reset_stats(struct i40e_pf *pf);
+void i40e_add_fdir_filter(struct i40e_fdir_data fdir_data,
+ struct i40e_ring *tx_ring);
+void i40e_add_remove_filter(struct i40e_fdir_data fdir_data,
+ struct i40e_ring *tx_ring);
+void i40e_update_fdir_filter(struct i40e_fdir_data fdir_data,
+ struct i40e_ring *tx_ring);
+i40e_status i40e_program_fdir_filter(struct i40e_fdir_data *fdir_data,
+ struct i40e_pf *pf, bool add);
+
+void i40e_set_ethtool_ops(struct net_device *netdev);
+struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,
+ u8 *macaddr, s16 vlan,
+ bool is_vf, bool is_netdev);
+void i40e_del_filter(struct i40e_vsi *vsi, u8 *macaddr, s16 vlan,
+ bool is_vf, bool is_netdev);
+i40e_status i40e_sync_vsi_filters(struct i40e_vsi *vsi);
+i40e_status __i40e_sync_vsi_filters_locked(struct i40e_vsi *);
+struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
+ u16 uplink, u32 param1);
+s32 i40e_vsi_release(struct i40e_vsi *vsi);
+struct i40e_vsi *i40e_vsi_lookup(struct i40e_pf *pf,
+ enum i40e_vsi_type type,
+ struct i40e_vsi *start_vsi);
+struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags,
+ u16 uplink_seid, u16 downlink_seid,
+ u8 enabled_tc);
+s32 i40e_veb_release(struct i40e_veb *veb);
+
+i40e_status i40e_sys_add_vsi(struct i40e_vsi *vsi);
+void i40e_sys_del_vsi(struct i40e_vsi *vsi);
+i40e_status i40e_sys_add_veb(struct i40e_veb *veb);
+void i40e_sys_del_veb(struct i40e_veb *veb);
+i40e_status i40e_sys_init(struct i40e_pf *pf);
+void i40e_sys_exit(struct i40e_pf *pf);
+i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid);
+i40e_status i40e_vsi_remove_pvid(struct i40e_vsi *vsi);
+void i40e_vsi_reset_stats(struct i40e_vsi *vsi);
+void i40e_pf_reset_stats(struct i40e_pf *pf);
#ifdef CONFIG_DEBUG_FS
-extern void i40e_dbg_pf_init(struct i40e_pf *pf);
-extern void i40e_dbg_pf_exit(struct i40e_pf *pf);
-extern void i40e_dbg_init(void);
-extern void i40e_dbg_exit(void);
+void i40e_dbg_pf_init(struct i40e_pf *pf);
+void i40e_dbg_pf_exit(struct i40e_pf *pf);
+void i40e_dbg_init(void);
+void i40e_dbg_exit(void);
#else
static inline void i40e_dbg_pf_init(struct i40e_pf *pf) {}
static inline void i40e_dbg_pf_exit(struct i40e_pf *pf) {}
static inline void i40e_dbg_init(void) {}
static inline void i40e_dbg_exit(void) {}
#endif /* CONFIG_DEBUG_FS*/
-extern void i40e_irq_dynamic_enable(struct i40e_vsi *vsi, int vector);
-extern int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
-extern void i40e_vlan_stripping_disable(struct i40e_vsi *vsi);
-extern int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);
-extern int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);
-extern i40e_status i40e_put_mac_in_vlan(struct i40e_vsi *vsi,
- u8 *macaddr,
- bool is_vf, bool is_netdev);
-extern bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi);
-extern struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi,
- u8 *macaddr,
- bool is_vf, bool is_netdev);
-extern void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);
+void i40e_irq_dynamic_enable(struct i40e_vsi *vsi, int vector);
+int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
+void i40e_vlan_stripping_disable(struct i40e_vsi *vsi);
+int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);
+int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);
+i40e_status i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr,
+ bool is_vf, bool is_netdev);
+bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi);
+struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
+ bool is_vf, bool is_netdev);
+void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);
#endif /* _I40E_H_ */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 0d7759e..25dc629 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -68,7 +68,7 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
}
hw_dbg(hw, "i40e_set_mac_type found mac: %d, returns: %d\n",
- hw->mac.type, status);
+ hw->mac.type, status);
return status;
}
@@ -564,7 +564,8 @@ aq_add_vsi_exit:
* @cmd_details: pointer to command details structure or NULL
**/
i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
- u16 seid, bool set, struct i40e_asq_cmd_details *cmd_details)
+ u16 seid, bool set,
+ struct i40e_asq_cmd_details *cmd_details)
{
struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
@@ -573,7 +574,7 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
u16 flags = 0;
i40e_fill_default_direct_cmd_desc(&desc,
- i40e_aqc_opc_set_vsi_promiscuous_modes);
+ i40e_aqc_opc_set_vsi_promiscuous_modes);
if (set)
flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
@@ -596,7 +597,8 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
* @cmd_details: pointer to command details structure or NULL
**/
i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
- u16 seid, bool set, struct i40e_asq_cmd_details *cmd_details)
+ u16 seid, bool set,
+ struct i40e_asq_cmd_details *cmd_details)
{
struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
@@ -605,7 +607,7 @@ i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
u16 flags = 0;
i40e_fill_default_direct_cmd_desc(&desc,
- i40e_aqc_opc_set_vsi_promiscuous_modes);
+ i40e_aqc_opc_set_vsi_promiscuous_modes);
if (set)
flags |= I40E_AQC_SET_VSI_PROMISC_MULTICAST;
@@ -639,7 +641,7 @@ i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
i40e_status status;
i40e_fill_default_direct_cmd_desc(&desc,
- i40e_aqc_opc_set_vsi_promiscuous_modes);
+ i40e_aqc_opc_set_vsi_promiscuous_modes);
if (set_filter)
cmd->promiscuous_flags
@@ -1191,7 +1193,7 @@ i40e_status i40e_aq_set_hmc_resource_profile(struct i40e_hw *hw,
i40e_status status;
i40e_fill_default_direct_cmd_desc(&desc,
- i40e_aqc_opc_set_hmc_resource_profile);
+ i40e_aqc_opc_set_hmc_resource_profile);
cmd->pm_profile = (u8)profile;
cmd->pe_vf_enabled = pe_vf_enabled_count;
@@ -1366,7 +1368,7 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
u32 i = 0;
u16 id;
- cap = (struct i40e_aqc_list_capabilities_element_resp *) buff;
+ cap = (struct i40e_aqc_list_capabilities_element_resp *)buff;
if (list_type_opc == i40e_aqc_opc_list_dev_capabilities)
p = (struct i40e_hw_capabilities *)&hw->dev_caps;
@@ -1522,7 +1524,7 @@ i40e_status i40e_aq_discover_capabilities(struct i40e_hw *hw,
i40e_status status = I40E_SUCCESS;
if (list_type_opc != i40e_aqc_opc_list_func_capabilities &&
- list_type_opc != i40e_aqc_opc_list_dev_capabilities) {
+ list_type_opc != i40e_aqc_opc_list_dev_capabilities) {
status = I40E_ERR_PARAM;
goto exit;
}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index 0b2e9f7..e61ed67 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -243,7 +243,6 @@ static ssize_t i40e_dbg_dump_write(struct file *filp,
buflen += sizeof(struct i40e_mac_filter) * filter_count;
if (i40e_dbg_prep_dump_buf(pf, buflen)) {
-
p = i40e_dbg_dump_buf;
seid_found = true;
@@ -387,319 +386,319 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
vsi = i40e_dbg_find_vsi(pf, seid);
if (!vsi) {
dev_info(&pf->pdev->dev,
- "%s: dump %d: seid not found\n", __func__, seid);
+ "%s: dump %d: seid not found\n", __func__, seid);
return;
}
dev_info(&pf->pdev->dev,
- "%s: vsi seid %d\n", __func__, seid);
+ "%s: vsi seid %d\n", __func__, seid);
if (vsi->netdev)
dev_info(&pf->pdev->dev,
- " netdev: name = %s\n",
+ " netdev: name = %s\n",
vsi->netdev->name);
if (vsi->active_vlans)
dev_info(&pf->pdev->dev,
- " vlgrp: & = %p\n", vsi->active_vlans);
+ " vlgrp: & = %p\n", vsi->active_vlans);
dev_info(&pf->pdev->dev,
- " netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n",
- vsi->netdev_registered,
- vsi->current_netdev_flags, vsi->state, vsi->flags);
+ " netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n",
+ vsi->netdev_registered,
+ vsi->current_netdev_flags, vsi->state, vsi->flags);
list_for_each_entry(f, &vsi->mac_filter_list, list) {
dev_info(&pf->pdev->dev,
- " mac_filter_list: %pM vid=%d, is_netdev=%d is_vf=%d counter=%d\n",
- f->macaddr, f->vlan, f->is_netdev, f->is_vf,
- f->counter);
+ " mac_filter_list: %pM vid=%d, is_netdev=%d is_vf=%d counter=%d\n",
+ f->macaddr, f->vlan, f->is_netdev, f->is_vf,
+ f->counter);
}
nstat = i40e_get_vsi_stats_struct(vsi);
dev_info(&pf->pdev->dev,
- " net_stats: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n",
- (long unsigned int)nstat->rx_packets,
- (long unsigned int)nstat->rx_bytes,
- (long unsigned int)nstat->rx_errors,
- (long unsigned int)nstat->rx_dropped);
+ " net_stats: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n",
+ (long unsigned int)nstat->rx_packets,
+ (long unsigned int)nstat->rx_bytes,
+ (long unsigned int)nstat->rx_errors,
+ (long unsigned int)nstat->rx_dropped);
dev_info(&pf->pdev->dev,
- " net_stats: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n",
- (long unsigned int)nstat->tx_packets,
- (long unsigned int)nstat->tx_bytes,
- (long unsigned int)nstat->tx_errors,
- (long unsigned int)nstat->tx_dropped);
+ " net_stats: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n",
+ (long unsigned int)nstat->tx_packets,
+ (long unsigned int)nstat->tx_bytes,
+ (long unsigned int)nstat->tx_errors,
+ (long unsigned int)nstat->tx_dropped);
dev_info(&pf->pdev->dev,
- " net_stats: multicast = %lu, collisions = %lu\n",
- (long unsigned int)nstat->multicast,
- (long unsigned int)nstat->collisions);
+ " net_stats: multicast = %lu, collisions = %lu\n",
+ (long unsigned int)nstat->multicast,
+ (long unsigned int)nstat->collisions);
dev_info(&pf->pdev->dev,
- " net_stats: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n",
- (long unsigned int)nstat->rx_length_errors,
- (long unsigned int)nstat->rx_over_errors,
- (long unsigned int)nstat->rx_crc_errors);
+ " net_stats: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n",
+ (long unsigned int)nstat->rx_length_errors,
+ (long unsigned int)nstat->rx_over_errors,
+ (long unsigned int)nstat->rx_crc_errors);
dev_info(&pf->pdev->dev,
- " net_stats: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n",
- (long unsigned int)nstat->rx_frame_errors,
- (long unsigned int)nstat->rx_fifo_errors,
- (long unsigned int)nstat->rx_missed_errors);
+ " net_stats: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n",
+ (long unsigned int)nstat->rx_frame_errors,
+ (long unsigned int)nstat->rx_fifo_errors,
+ (long unsigned int)nstat->rx_missed_errors);
dev_info(&pf->pdev->dev,
- " net_stats: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n",
- (long unsigned int)nstat->tx_aborted_errors,
- (long unsigned int)nstat->tx_carrier_errors,
- (long unsigned int)nstat->tx_fifo_errors);
+ " net_stats: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n",
+ (long unsigned int)nstat->tx_aborted_errors,
+ (long unsigned int)nstat->tx_carrier_errors,
+ (long unsigned int)nstat->tx_fifo_errors);
dev_info(&pf->pdev->dev,
- " net_stats: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n",
- (long unsigned int)nstat->tx_heartbeat_errors,
- (long unsigned int)nstat->tx_window_errors);
+ " net_stats: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n",
+ (long unsigned int)nstat->tx_heartbeat_errors,
+ (long unsigned int)nstat->tx_window_errors);
dev_info(&pf->pdev->dev,
- " net_stats: rx_compressed = %lu, tx_compressed = %lu\n",
- (long unsigned int)nstat->rx_compressed,
- (long unsigned int)nstat->tx_compressed);
+ " net_stats: rx_compressed = %lu, tx_compressed = %lu\n",
+ (long unsigned int)nstat->rx_compressed,
+ (long unsigned int)nstat->tx_compressed);
dev_info(&pf->pdev->dev,
- " net_stats_offsets: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.rx_packets,
- (long unsigned int)vsi->net_stats_offsets.rx_bytes,
- (long unsigned int)vsi->net_stats_offsets.rx_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_dropped);
+ " net_stats_offsets: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.rx_packets,
+ (long unsigned int)vsi->net_stats_offsets.rx_bytes,
+ (long unsigned int)vsi->net_stats_offsets.rx_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_dropped);
dev_info(&pf->pdev->dev,
- " net_stats_offsets: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.tx_packets,
- (long unsigned int)vsi->net_stats_offsets.tx_bytes,
- (long unsigned int)vsi->net_stats_offsets.tx_errors,
- (long unsigned int)vsi->net_stats_offsets.tx_dropped);
+ " net_stats_offsets: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.tx_packets,
+ (long unsigned int)vsi->net_stats_offsets.tx_bytes,
+ (long unsigned int)vsi->net_stats_offsets.tx_errors,
+ (long unsigned int)vsi->net_stats_offsets.tx_dropped);
dev_info(&pf->pdev->dev,
- " net_stats_offsets: multicast = %lu, collisions = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.multicast,
- (long unsigned int)vsi->net_stats_offsets.collisions);
+ " net_stats_offsets: multicast = %lu, collisions = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.multicast,
+ (long unsigned int)vsi->net_stats_offsets.collisions);
dev_info(&pf->pdev->dev,
- " net_stats_offsets: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.rx_length_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_over_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_crc_errors);
+ " net_stats_offsets: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.rx_length_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_over_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_crc_errors);
dev_info(&pf->pdev->dev,
- " net_stats_offsets: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.rx_frame_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_fifo_errors,
- (long unsigned int)vsi->net_stats_offsets.rx_missed_errors);
+ " net_stats_offsets: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.rx_frame_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_fifo_errors,
+ (long unsigned int)vsi->net_stats_offsets.rx_missed_errors);
dev_info(&pf->pdev->dev,
- " net_stats_offsets: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.tx_aborted_errors,
- (long unsigned int)vsi->net_stats_offsets.tx_carrier_errors,
- (long unsigned int)vsi->net_stats_offsets.tx_fifo_errors);
+ " net_stats_offsets: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.tx_aborted_errors,
+ (long unsigned int)vsi->net_stats_offsets.tx_carrier_errors,
+ (long unsigned int)vsi->net_stats_offsets.tx_fifo_errors);
dev_info(&pf->pdev->dev,
- " net_stats_offsets: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.tx_heartbeat_errors,
- (long unsigned int)vsi->net_stats_offsets.tx_window_errors);
+ " net_stats_offsets: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.tx_heartbeat_errors,
+ (long unsigned int)vsi->net_stats_offsets.tx_window_errors);
dev_info(&pf->pdev->dev,
- " net_stats_offsets: rx_compressed = %lu, tx_compressed = %lu\n",
- (long unsigned int)vsi->net_stats_offsets.rx_compressed,
- (long unsigned int)vsi->net_stats_offsets.tx_compressed);
+ " net_stats_offsets: rx_compressed = %lu, tx_compressed = %lu\n",
+ (long unsigned int)vsi->net_stats_offsets.rx_compressed,
+ (long unsigned int)vsi->net_stats_offsets.tx_compressed);
dev_info(&pf->pdev->dev,
- " tx_restart = %d, tx_busy = %d, rx_buf_failed = %d, rx_page_failed = %d\n",
- vsi->tx_restart, vsi->tx_busy,
- vsi->rx_buf_failed, vsi->rx_page_failed);
+ " tx_restart = %d, tx_busy = %d, rx_buf_failed = %d, rx_page_failed = %d\n",
+ vsi->tx_restart, vsi->tx_busy,
+ vsi->rx_buf_failed, vsi->rx_page_failed);
if (vsi->rx_rings) {
for (i = 0; i < vsi->num_queue_pairs; i++) {
dev_info(&pf->pdev->dev,
- " rx_rings[%i]: desc = %p\n",
- i, vsi->rx_rings[i].desc);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: dev = %p, netdev = %p, rx_bi = %p\n",
- i, vsi->rx_rings[i].dev,
- vsi->rx_rings[i].netdev,
- vsi->rx_rings[i].rx_bi);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
- i, vsi->rx_rings[i].state,
- vsi->rx_rings[i].queue_index,
- vsi->rx_rings[i].reg_idx);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: rx_hdr_len = %d, rx_buf_len = %d, dtype = %d\n",
- i, vsi->rx_rings[i].rx_hdr_len,
- vsi->rx_rings[i].rx_buf_len,
- vsi->rx_rings[i].dtype);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n",
- i, vsi->rx_rings[i].hsplit,
- vsi->rx_rings[i].next_to_use,
- vsi->rx_rings[i].next_to_clean,
- vsi->rx_rings[i].ring_active);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: rx_stats: packets = %lld, bytes = %lld, non_eop_descs = %lld\n",
- i, vsi->rx_rings[i].rx_stats.packets,
- vsi->rx_rings[i].rx_stats.bytes,
- vsi->rx_rings[i].rx_stats.non_eop_descs);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: rx_stats: alloc_rx_page_failed = %lld, alloc_rx_buff_failed = %lld\n",
- i,
- vsi->rx_rings[i].rx_stats.alloc_rx_page_failed,
- vsi->rx_rings[i].rx_stats.alloc_rx_buff_failed);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: size = %i, dma = 0x%08lx\n",
- i, vsi->rx_rings[i].size,
- (long unsigned int)vsi->rx_rings[i].dma);
- dev_info(&pf->pdev->dev,
- " rx_rings[%i]: vsi = %p, q_vector = %p\n",
- i, vsi->rx_rings[i].vsi,
- vsi->rx_rings[i].q_vector);
+ " rx_rings[%i]: desc = %p\n",
+ i, vsi->rx_rings[i].desc);
+ dev_info(&pf->pdev->dev,
+ " rx_rings[%i]: dev = %p, netdev = %p, rx_bi = %p\n",
+ i, vsi->rx_rings[i].dev,
+ vsi->rx_rings[i].netdev,
+ vsi->rx_rings[i].rx_bi);
+ dev_info(&pf->pdev->dev,
+ " rx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
+ i, vsi->rx_rings[i].state,
+ vsi->rx_rings[i].queue_index,
+ vsi->rx_rings[i].reg_idx);
+ dev_info(&pf->pdev->dev,
+ " rx_rings[%i]: rx_hdr_len = %d, rx_buf_len = %d, dtype = %d\n",
+ i, vsi->rx_rings[i].rx_hdr_len,
+ vsi->rx_rings[i].rx_buf_len,
+ vsi->rx_rings[i].dtype);
+ dev_info(&pf->pdev->dev,
+ " rx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n",
+ i, vsi->rx_rings[i].hsplit,
+ vsi->rx_rings[i].next_to_use,
+ vsi->rx_rings[i].next_to_clean,
+ vsi->rx_rings[i].ring_active);
+ dev_info(&pf->pdev->dev,
+ " rx_rings[%i]: rx_stats: packets = %lld, bytes = %lld, non_eop_descs = %lld\n",
+ i, vsi->rx_rings[i].rx_stats.packets,
+ vsi->rx_rings[i].rx_stats.bytes,
+ vsi->rx_rings[i].rx_stats.non_eop_descs);
+ dev_info(&pf->pdev->dev,
+ " rx_rings[%i]: rx_stats: alloc_rx_page_failed = %lld, alloc_rx_buff_failed = %lld\n",
+ i,
+ vsi->rx_rings[i].rx_stats.alloc_rx_page_failed,
+ vsi->rx_rings[i].rx_stats.alloc_rx_buff_failed);
+ dev_info(&pf->pdev->dev,
+ " rx_rings[%i]: size = %i, dma = 0x%08lx\n",
+ i, vsi->rx_rings[i].size,
+ (long unsigned int)vsi->rx_rings[i].dma);
+ dev_info(&pf->pdev->dev,
+ " rx_rings[%i]: vsi = %p, q_vector = %p\n",
+ i, vsi->rx_rings[i].vsi,
+ vsi->rx_rings[i].q_vector);
}
}
if (vsi->tx_rings) {
for (i = 0; i < vsi->num_queue_pairs; i++) {
dev_info(&pf->pdev->dev,
- " tx_rings[%i]: desc = %p\n",
- i, vsi->tx_rings[i].desc);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: dev = %p, netdev = %p, tx_bi = %p\n",
- i, vsi->tx_rings[i].dev,
- vsi->tx_rings[i].netdev,
- vsi->tx_rings[i].tx_bi);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
- i, vsi->tx_rings[i].state,
- vsi->tx_rings[i].queue_index,
- vsi->tx_rings[i].reg_idx);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: dtype = %d\n",
- i, vsi->tx_rings[i].dtype);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n",
- i, vsi->tx_rings[i].hsplit,
- vsi->tx_rings[i].next_to_use,
- vsi->tx_rings[i].next_to_clean,
- vsi->tx_rings[i].ring_active);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: tx_stats: packets = %lld, bytes = %lld, restart_queue = %lld\n",
- i, vsi->tx_rings[i].tx_stats.packets,
- vsi->tx_rings[i].tx_stats.bytes,
- vsi->tx_rings[i].tx_stats.restart_queue);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: tx_stats: tx_busy = %lld, completed = %lld, tx_done_old = %lld\n",
- i,
- vsi->tx_rings[i].tx_stats.tx_busy,
- vsi->tx_rings[i].tx_stats.completed,
- vsi->tx_rings[i].tx_stats.tx_done_old);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: size = %i, dma = 0x%08lx\n",
- i, vsi->tx_rings[i].size,
- (long unsigned int)vsi->tx_rings[i].dma);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: vsi = %p, q_vector = %p\n",
- i, vsi->tx_rings[i].vsi,
- vsi->tx_rings[i].q_vector);
- dev_info(&pf->pdev->dev,
- " tx_rings[%i]: DCB tc = %d\n",
- i, vsi->tx_rings[i].dcb_tc);
+ " tx_rings[%i]: desc = %p\n",
+ i, vsi->tx_rings[i].desc);
+ dev_info(&pf->pdev->dev,
+ " tx_rings[%i]: dev = %p, netdev = %p, tx_bi = %p\n",
+ i, vsi->tx_rings[i].dev,
+ vsi->tx_rings[i].netdev,
+ vsi->tx_rings[i].tx_bi);
+ dev_info(&pf->pdev->dev,
+ " tx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
+ i, vsi->tx_rings[i].state,
+ vsi->tx_rings[i].queue_index,
+ vsi->tx_rings[i].reg_idx);
+ dev_info(&pf->pdev->dev,
+ " tx_rings[%i]: dtype = %d\n",
+ i, vsi->tx_rings[i].dtype);
+ dev_info(&pf->pdev->dev,
+ " tx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n",
+ i, vsi->tx_rings[i].hsplit,
+ vsi->tx_rings[i].next_to_use,
+ vsi->tx_rings[i].next_to_clean,
+ vsi->tx_rings[i].ring_active);
+ dev_info(&pf->pdev->dev,
+ " tx_rings[%i]: tx_stats: packets = %lld, bytes = %lld, restart_queue = %lld\n",
+ i, vsi->tx_rings[i].tx_stats.packets,
+ vsi->tx_rings[i].tx_stats.bytes,
+ vsi->tx_rings[i].tx_stats.restart_queue);
+ dev_info(&pf->pdev->dev,
+ " tx_rings[%i]: tx_stats: tx_busy = %lld, completed = %lld, tx_done_old = %lld\n",
+ i,
+ vsi->tx_rings[i].tx_stats.tx_busy,
+ vsi->tx_rings[i].tx_stats.completed,
+ vsi->tx_rings[i].tx_stats.tx_done_old);
+ dev_info(&pf->pdev->dev,
+ " tx_rings[%i]: size = %i, dma = 0x%08lx\n",
+ i, vsi->tx_rings[i].size,
+ (long unsigned int)vsi->tx_rings[i].dma);
+ dev_info(&pf->pdev->dev,
+ " tx_rings[%i]: vsi = %p, q_vector = %p\n",
+ i, vsi->tx_rings[i].vsi,
+ vsi->tx_rings[i].q_vector);
+ dev_info(&pf->pdev->dev,
+ " tx_rings[%i]: DCB tc = %d\n",
+ i, vsi->tx_rings[i].dcb_tc);
}
}
dev_info(&pf->pdev->dev,
- " work_limit = %d, rx_itr_setting = %d (%s), tx_itr_setting = %d (%s)\n",
- vsi->work_limit, vsi->rx_itr_setting,
- ITR_IS_DYNAMIC(vsi->rx_itr_setting) ? "dynamic" : "fixed",
- vsi->tx_itr_setting,
- ITR_IS_DYNAMIC(vsi->tx_itr_setting) ? "dynamic" : "fixed");
+ " work_limit = %d, rx_itr_setting = %d (%s), tx_itr_setting = %d (%s)\n",
+ vsi->work_limit, vsi->rx_itr_setting,
+ ITR_IS_DYNAMIC(vsi->rx_itr_setting) ? "dynamic" : "fixed",
+ vsi->tx_itr_setting,
+ ITR_IS_DYNAMIC(vsi->tx_itr_setting) ? "dynamic" : "fixed");
dev_info(&pf->pdev->dev,
- " max_frame = %d, rx_hdr_len = %d, rx_buf_len = %d dtype = %d\n",
- vsi->max_frame, vsi->rx_hdr_len, vsi->rx_buf_len, vsi->dtype);
+ " max_frame = %d, rx_hdr_len = %d, rx_buf_len = %d dtype = %d\n",
+ vsi->max_frame, vsi->rx_hdr_len, vsi->rx_buf_len, vsi->dtype);
if (vsi->q_vectors) {
for (i = 0; i < vsi->num_q_vectors; i++) {
dev_info(&pf->pdev->dev,
- " q_vectors[%i]: base index = %ld\n",
- i, ((long int)*vsi->q_vectors[i].rx.ring-
- (long int)*vsi->q_vectors[0].rx.ring)/
- sizeof(struct i40e_ring));
+ " q_vectors[%i]: base index = %ld\n",
+ i, ((long int)*vsi->q_vectors[i].rx.ring-
+ (long int)*vsi->q_vectors[0].rx.ring)/
+ sizeof(struct i40e_ring));
}
}
dev_info(&pf->pdev->dev,
- " num_q_vectors = %i, base_vector = %i\n",
- vsi->num_q_vectors, vsi->base_vector);
+ " num_q_vectors = %i, base_vector = %i\n",
+ vsi->num_q_vectors, vsi->base_vector);
dev_info(&pf->pdev->dev,
- " seid = %d, id = %d, uplink_seid = %d\n",
- vsi->seid, vsi->id, vsi->uplink_seid);
+ " seid = %d, id = %d, uplink_seid = %d\n",
+ vsi->seid, vsi->id, vsi->uplink_seid);
dev_info(&pf->pdev->dev,
- " base_queue = %d, num_queue_pairs = %d, num_desc = %d\n",
- vsi->base_queue, vsi->num_queue_pairs, vsi->num_desc);
+ " base_queue = %d, num_queue_pairs = %d, num_desc = %d\n",
+ vsi->base_queue, vsi->num_queue_pairs, vsi->num_desc);
dev_info(&pf->pdev->dev,
- " type = %i\n",
- vsi->type);
+ " type = %i\n",
+ vsi->type);
dev_info(&pf->pdev->dev,
- " info: valid_sections = 0x%04x, switch_id = 0x%04x\n",
- vsi->info.valid_sections, vsi->info.switch_id);
+ " info: valid_sections = 0x%04x, switch_id = 0x%04x\n",
+ vsi->info.valid_sections, vsi->info.switch_id);
dev_info(&pf->pdev->dev,
- " info: sw_reserved[] = 0x%02x 0x%02x\n",
- vsi->info.sw_reserved[0], vsi->info.sw_reserved[1]);
+ " info: sw_reserved[] = 0x%02x 0x%02x\n",
+ vsi->info.sw_reserved[0], vsi->info.sw_reserved[1]);
dev_info(&pf->pdev->dev,
- " info: sec_flags = 0x%02x, sec_reserved = 0x%02x\n",
- vsi->info.sec_flags, vsi->info.sec_reserved);
+ " info: sec_flags = 0x%02x, sec_reserved = 0x%02x\n",
+ vsi->info.sec_flags, vsi->info.sec_reserved);
dev_info(&pf->pdev->dev,
- " info: pvid = 0x%04x, fcoe_pvid = 0x%04x, port_vlan_flags = 0x%02x\n",
- vsi->info.pvid, vsi->info.fcoe_pvid, vsi->info.port_vlan_flags);
+ " info: pvid = 0x%04x, fcoe_pvid = 0x%04x, port_vlan_flags = 0x%02x\n",
+ vsi->info.pvid, vsi->info.fcoe_pvid, vsi->info.port_vlan_flags);
dev_info(&pf->pdev->dev,
- " info: pvlan_reserved[] = 0x%02x 0x%02x 0x%02x\n",
- vsi->info.pvlan_reserved[0], vsi->info.pvlan_reserved[1],
- vsi->info.pvlan_reserved[2]);
+ " info: pvlan_reserved[] = 0x%02x 0x%02x 0x%02x\n",
+ vsi->info.pvlan_reserved[0], vsi->info.pvlan_reserved[1],
+ vsi->info.pvlan_reserved[2]);
dev_info(&pf->pdev->dev,
- " info: ingress_table = 0x%08x, egress_table = 0x%08x\n",
- vsi->info.ingress_table, vsi->info.egress_table);
+ " info: ingress_table = 0x%08x, egress_table = 0x%08x\n",
+ vsi->info.ingress_table, vsi->info.egress_table);
dev_info(&pf->pdev->dev,
- " info: cas_pv_stag = 0x%04x, cas_pv_flags= 0x%02x, cas_pv_reserved = 0x%02x\n",
- vsi->info.cas_pv_tag, vsi->info.cas_pv_flags,
- vsi->info.cas_pv_reserved);
+ " info: cas_pv_stag = 0x%04x, cas_pv_flags= 0x%02x, cas_pv_reserved = 0x%02x\n",
+ vsi->info.cas_pv_tag, vsi->info.cas_pv_flags,
+ vsi->info.cas_pv_reserved);
dev_info(&pf->pdev->dev,
- " info: queue_mapping[0..7 ] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
- vsi->info.queue_mapping[0], vsi->info.queue_mapping[1],
- vsi->info.queue_mapping[2], vsi->info.queue_mapping[3],
- vsi->info.queue_mapping[4], vsi->info.queue_mapping[5],
- vsi->info.queue_mapping[6], vsi->info.queue_mapping[7]);
+ " info: queue_mapping[0..7 ] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+ vsi->info.queue_mapping[0], vsi->info.queue_mapping[1],
+ vsi->info.queue_mapping[2], vsi->info.queue_mapping[3],
+ vsi->info.queue_mapping[4], vsi->info.queue_mapping[5],
+ vsi->info.queue_mapping[6], vsi->info.queue_mapping[7]);
dev_info(&pf->pdev->dev,
- " info: queue_mapping[8..15] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
- vsi->info.queue_mapping[8], vsi->info.queue_mapping[9],
- vsi->info.queue_mapping[10], vsi->info.queue_mapping[11],
- vsi->info.queue_mapping[12], vsi->info.queue_mapping[13],
- vsi->info.queue_mapping[14], vsi->info.queue_mapping[15]);
+ " info: queue_mapping[8..15] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+ vsi->info.queue_mapping[8], vsi->info.queue_mapping[9],
+ vsi->info.queue_mapping[10], vsi->info.queue_mapping[11],
+ vsi->info.queue_mapping[12], vsi->info.queue_mapping[13],
+ vsi->info.queue_mapping[14], vsi->info.queue_mapping[15]);
dev_info(&pf->pdev->dev,
- " info: tc_mapping[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
- vsi->info.tc_mapping[0], vsi->info.tc_mapping[1],
- vsi->info.tc_mapping[2], vsi->info.tc_mapping[3],
- vsi->info.tc_mapping[4], vsi->info.tc_mapping[5],
- vsi->info.tc_mapping[6], vsi->info.tc_mapping[7]);
+ " info: tc_mapping[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+ vsi->info.tc_mapping[0], vsi->info.tc_mapping[1],
+ vsi->info.tc_mapping[2], vsi->info.tc_mapping[3],
+ vsi->info.tc_mapping[4], vsi->info.tc_mapping[5],
+ vsi->info.tc_mapping[6], vsi->info.tc_mapping[7]);
dev_info(&pf->pdev->dev,
- " info: queueing_opt_flags = 0x%02x queueing_opt_reserved[0..2] = 0x%02x 0x%02x 0x%02x\n",
- vsi->info.queueing_opt_flags,
- vsi->info.queueing_opt_reserved[0],
- vsi->info.queueing_opt_reserved[1],
- vsi->info.queueing_opt_reserved[2]);
+ " info: queueing_opt_flags = 0x%02x queueing_opt_reserved[0..2] = 0x%02x 0x%02x 0x%02x\n",
+ vsi->info.queueing_opt_flags,
+ vsi->info.queueing_opt_reserved[0],
+ vsi->info.queueing_opt_reserved[1],
+ vsi->info.queueing_opt_reserved[2]);
dev_info(&pf->pdev->dev,
- " info: up_enable_bits = 0x%02x\n",
- vsi->info.up_enable_bits);
+ " info: up_enable_bits = 0x%02x\n",
+ vsi->info.up_enable_bits);
dev_info(&pf->pdev->dev,
- " info: sched_reserved = 0x%02x, outer_up_table = 0x%04x\n",
- vsi->info.sched_reserved, vsi->info.outer_up_table);
+ " info: sched_reserved = 0x%02x, outer_up_table = 0x%04x\n",
+ vsi->info.sched_reserved, vsi->info.outer_up_table);
dev_info(&pf->pdev->dev,
- " info: cmd_reserved[] = 0x%02x 0x%02x 0x%02x 0x0%02x 0x%02x 0x%02x 0x%02x 0x0%02x\n",
- vsi->info.cmd_reserved[0], vsi->info.cmd_reserved[1],
- vsi->info.cmd_reserved[2], vsi->info.cmd_reserved[3],
- vsi->info.cmd_reserved[4], vsi->info.cmd_reserved[5],
- vsi->info.cmd_reserved[6], vsi->info.cmd_reserved[7]);
+ " info: cmd_reserved[] = 0x%02x 0x%02x 0x%02x 0x0%02x 0x%02x 0x%02x 0x%02x 0x0%02x\n",
+ vsi->info.cmd_reserved[0], vsi->info.cmd_reserved[1],
+ vsi->info.cmd_reserved[2], vsi->info.cmd_reserved[3],
+ vsi->info.cmd_reserved[4], vsi->info.cmd_reserved[5],
+ vsi->info.cmd_reserved[6], vsi->info.cmd_reserved[7]);
dev_info(&pf->pdev->dev,
- " info: qs_handle[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
- vsi->info.qs_handle[0], vsi->info.qs_handle[1],
- vsi->info.qs_handle[2], vsi->info.qs_handle[3],
- vsi->info.qs_handle[4], vsi->info.qs_handle[5],
- vsi->info.qs_handle[6], vsi->info.qs_handle[7]);
+ " info: qs_handle[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+ vsi->info.qs_handle[0], vsi->info.qs_handle[1],
+ vsi->info.qs_handle[2], vsi->info.qs_handle[3],
+ vsi->info.qs_handle[4], vsi->info.qs_handle[5],
+ vsi->info.qs_handle[6], vsi->info.qs_handle[7]);
dev_info(&pf->pdev->dev,
- " info: stat_counter_idx = 0x%04x, sched_id = 0x%04x\n",
- vsi->info.stat_counter_idx, vsi->info.sched_id);
+ " info: stat_counter_idx = 0x%04x, sched_id = 0x%04x\n",
+ vsi->info.stat_counter_idx, vsi->info.sched_id);
dev_info(&pf->pdev->dev,
- " info: resp_reserved[] = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
- vsi->info.resp_reserved[0], vsi->info.resp_reserved[1],
- vsi->info.resp_reserved[2], vsi->info.resp_reserved[3],
- vsi->info.resp_reserved[4], vsi->info.resp_reserved[5],
- vsi->info.resp_reserved[6], vsi->info.resp_reserved[7],
- vsi->info.resp_reserved[8], vsi->info.resp_reserved[9],
- vsi->info.resp_reserved[10], vsi->info.resp_reserved[11]);
+ " info: resp_reserved[] = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
+ vsi->info.resp_reserved[0], vsi->info.resp_reserved[1],
+ vsi->info.resp_reserved[2], vsi->info.resp_reserved[3],
+ vsi->info.resp_reserved[4], vsi->info.resp_reserved[5],
+ vsi->info.resp_reserved[6], vsi->info.resp_reserved[7],
+ vsi->info.resp_reserved[8], vsi->info.resp_reserved[9],
+ vsi->info.resp_reserved[10], vsi->info.resp_reserved[11]);
if (vsi->back)
dev_info(&pf->pdev->dev,
- " pf = %p\n", vsi->back);
+ " pf = %p\n", vsi->back);
dev_info(&pf->pdev->dev,
- " idx = %d\n", vsi->idx);
+ " idx = %d\n", vsi->idx);
dev_info(&pf->pdev->dev,
- " tc_config: numtc = %d, enabled_tc = 0x%x\n",
- vsi->tc_config.numtc, vsi->tc_config.enabled_tc);
+ " tc_config: numtc = %d, enabled_tc = 0x%x\n",
+ vsi->tc_config.numtc, vsi->tc_config.enabled_tc);
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
dev_info(&pf->pdev->dev,
" tc_config: tc = %d, qoffset = %d, qcount = %d, netdev_tc = %d\n",
@@ -708,8 +707,8 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
vsi->tc_config.tc_info[i].netdev_tc);
}
dev_info(&pf->pdev->dev,
- " bw: bw_limit = %d, bw_max_quanta = %d\n",
- vsi->bw_limit, vsi->bw_max_quanta);
+ " bw: bw_limit = %d, bw_max_quanta = %d\n",
+ vsi->bw_limit, vsi->bw_max_quanta);
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
dev_info(&pf->pdev->dev,
" bw[%d]: ets_share_credits = %d, ets_limit_credits = %d, max_quanta = %d\n",
@@ -735,17 +734,17 @@ static void i40e_dbg_dump_aq_desc(struct i40e_pf *pf)
for (i = 0; i < ring->count; i++) {
struct i40e_aq_desc *d = I40E_ADMINQ_DESC(*ring, i);
dev_info(&pf->pdev->dev,
- " at[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n",
- i, d->flags, d->opcode, d->datalen, d->retval,
- d->cookie_high, d->cookie_low);
+ " at[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n",
+ i, d->flags, d->opcode, d->datalen, d->retval,
+ d->cookie_high, d->cookie_low);
dev_info(&pf->pdev->dev,
- " %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
- d->params.raw[0], d->params.raw[1], d->params.raw[2],
- d->params.raw[3], d->params.raw[4], d->params.raw[5],
- d->params.raw[6], d->params.raw[7], d->params.raw[8],
- d->params.raw[9], d->params.raw[10], d->params.raw[11],
- d->params.raw[12], d->params.raw[13], d->params.raw[14],
- d->params.raw[15]);
+ " %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ d->params.raw[0], d->params.raw[1], d->params.raw[2],
+ d->params.raw[3], d->params.raw[4], d->params.raw[5],
+ d->params.raw[6], d->params.raw[7], d->params.raw[8],
+ d->params.raw[9], d->params.raw[10], d->params.raw[11],
+ d->params.raw[12], d->params.raw[13], d->params.raw[14],
+ d->params.raw[15]);
}
dev_info(&pf->pdev->dev, "%s: AdminQ Rx Ring\n", __func__);
@@ -753,17 +752,17 @@ static void i40e_dbg_dump_aq_desc(struct i40e_pf *pf)
for (i = 0; i < ring->count; i++) {
struct i40e_aq_desc *d = I40E_ADMINQ_DESC(*ring, i);
dev_info(&pf->pdev->dev,
- " ar[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n",
- i, d->flags, d->opcode, d->datalen, d->retval,
- d->cookie_high, d->cookie_low);
+ " ar[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n",
+ i, d->flags, d->opcode, d->datalen, d->retval,
+ d->cookie_high, d->cookie_low);
dev_info(&pf->pdev->dev,
- " %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
- d->params.raw[0], d->params.raw[1], d->params.raw[2],
- d->params.raw[3], d->params.raw[4], d->params.raw[5],
- d->params.raw[6], d->params.raw[7], d->params.raw[8],
- d->params.raw[9], d->params.raw[10], d->params.raw[11],
- d->params.raw[12], d->params.raw[13], d->params.raw[14],
- d->params.raw[15]);
+ " %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
+ d->params.raw[0], d->params.raw[1], d->params.raw[2],
+ d->params.raw[3], d->params.raw[4], d->params.raw[5],
+ d->params.raw[6], d->params.raw[7], d->params.raw[8],
+ d->params.raw[9], d->params.raw[10], d->params.raw[11],
+ d->params.raw[12], d->params.raw[13], d->params.raw[14],
+ d->params.raw[15]);
}
}
@@ -787,7 +786,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
vsi = i40e_dbg_find_vsi(pf, vsi_seid);
if (!vsi) {
dev_info(&pf->pdev->dev,
- "%s: vsi %d not found\n", __func__, vsi_seid);
+ "%s: vsi %d not found\n", __func__, vsi_seid);
if (is_rx_ring)
dev_info(&pf->pdev->dev,
"%s: dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n",
@@ -846,7 +845,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
if (is_rx_ring)
ds = I40E_RX_DESC(&ring, desc_n);
else
- ds = (union i40e_rx_desc *) I40E_TX_DESC(&ring, desc_n);
+ ds = (union i40e_rx_desc *)I40E_TX_DESC(&ring, desc_n);
if ((sizeof(union i40e_rx_desc) ==
sizeof(union i40e_16byte_rx_desc)) || (!is_rx_ring))
dev_info(&pf->pdev->dev,
@@ -1864,7 +1863,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
for (i = 0; i < buffer_len; i++) {
if ((i % 16) == 0) {
snprintf(print_buf, 11, "\n0x%08x: ",
- offset + i);
+ offset + i);
print_buf += 11;
}
snprintf(print_buf, 5, "%04x ", buff[i]);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index db2871e..f66bc46 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -322,7 +322,6 @@ static void i40e_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
reg_buf[ri++] = rd32(hw, reg);
}
}
-
}
static int i40e_get_eeprom(struct net_device *netdev,
@@ -652,7 +651,7 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
if (vsi == pf->vsi[pf->lan_vsi]) {
for (i = 0; i < I40E_GLOBAL_STATS_LEN; i++) {
snprintf(p, ETH_GSTRING_LEN, "port.%s",
- i40e_gstrings_stats[i].stat_string);
+ i40e_gstrings_stats[i].stat_string);
p += ETH_GSTRING_LEN;
}
for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
@@ -1166,12 +1165,12 @@ static i40e_status i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi,
if (ret != I40E_SUCCESS) {
dev_info(&pf->pdev->dev,
- "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
+ "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
__func__, fd_data->pctype, ret);
err = true;
} else {
dev_info(&pf->pdev->dev,
- "%s: Filter OK for PCTYPE %d (ret = %d)\n",
+ "%s: Filter OK for PCTYPE %d (ret = %d)\n",
__func__,
fd_data->pctype, ret);
}
@@ -1212,7 +1211,7 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,
if (ret != I40E_SUCCESS) {
dev_info(&pf->pdev->dev,
- "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
+ "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
__func__, fd_data->pctype, ret);
err = true;
} else {
@@ -1227,12 +1226,12 @@ static i40e_status i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,
if (ret != I40E_SUCCESS) {
dev_info(&pf->pdev->dev,
- "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
+ "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
__func__, fd_data->pctype, ret);
err = true;
} else {
dev_info(&pf->pdev->dev,
- "%s: Filter OK for PCTYPE %d (ret = %d)\n",
+ "%s: Filter OK for PCTYPE %d (ret = %d)\n",
__func__, fd_data->pctype, ret);
}
@@ -1290,12 +1289,12 @@ static i40e_status i40e_add_del_fdir_ipv4(struct i40e_vsi *vsi,
if (ret != I40E_SUCCESS) {
dev_info(&pf->pdev->dev,
- "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
+ "%s: Filter command send failed for PCTYPE %d (ret = %d)\n",
__func__, fd_data->pctype, ret);
err = true;
} else {
dev_info(&pf->pdev->dev,
- "%s: Filter OK for PCTYPE %d (ret = %d)\n",
+ "%s: Filter OK for PCTYPE %d (ret = %d)\n",
__func__, fd_data->pctype, ret);
}
}
@@ -1338,7 +1337,7 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi,
if (!fd_data.raw_packet) {
dev_info(&pf->pdev->dev,
- "%s: Could not allocate memory\n", __func__);
+ "%s: Could not allocate memory\n", __func__);
return -ENOMEM;
}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
index 695ed3c..84c8f93 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
@@ -136,7 +136,7 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
if (txq_num > obj->max_cnt) {
ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
hw_dbg(hw, "i40e_init_lan_hmc: Tx context: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
- txq_num, obj->max_cnt, ret_code);
+ txq_num, obj->max_cnt, ret_code);
goto init_lan_hmc_out;
}
@@ -159,7 +159,7 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
if (rxq_num > obj->max_cnt) {
ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
hw_dbg(hw, "i40e_init_lan_hmc: Rx context: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
- rxq_num, obj->max_cnt, ret_code);
+ rxq_num, obj->max_cnt, ret_code);
goto init_lan_hmc_out;
}
@@ -182,7 +182,7 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
if (fcoe_cntx_num > obj->max_cnt) {
ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
hw_dbg(hw, "i40e_init_lan_hmc: FCoE context: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
- fcoe_cntx_num, obj->max_cnt, ret_code);
+ fcoe_cntx_num, obj->max_cnt, ret_code);
goto init_lan_hmc_out;
}
@@ -205,7 +205,7 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
if (fcoe_filt_num > obj->max_cnt) {
ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
hw_dbg(hw, "i40e_init_lan_hmc: FCoE filter: asks for 0x%x but max allowed is 0x%x, returns error %d\n",
- fcoe_filt_num, obj->max_cnt, ret_code);
+ fcoe_filt_num, obj->max_cnt, ret_code);
goto init_lan_hmc_out;
}
@@ -330,14 +330,14 @@ static i40e_status i40e_create_lan_hmc_object(struct i40e_hw *hw,
if (info->start_idx >= info->hmc_info->hmc_obj[info->rsrc_type].cnt) {
ret_code = I40E_ERR_INVALID_HMC_OBJ_INDEX;
hw_dbg(hw, "i40e_create_lan_hmc_object: returns error %d\n",
- ret_code);
+ ret_code);
goto exit;
}
if ((info->start_idx + info->count) >
info->hmc_info->hmc_obj[info->rsrc_type].cnt) {
ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
hw_dbg(hw, "i40e_create_lan_hmc_object: returns error %d\n",
- ret_code);
+ ret_code);
goto exit;
}
@@ -408,7 +408,7 @@ static i40e_status i40e_create_lan_hmc_object(struct i40e_hw *hw,
switch (sd_entry->entry_type) {
case I40E_SD_TYPE_PAGED:
I40E_SET_PF_SD_ENTRY(hw,
- sd_entry->u.pd_table.pd_page_addr.pa,
+ sd_entry->u.pd_table.pd_page_addr.pa,
j, sd_entry->entry_type);
break;
case I40E_SD_TYPE_DIRECT:
@@ -506,7 +506,7 @@ try_type_paged:
/* unsupported type */
ret_code = I40E_ERR_INVALID_SD_TYPE;
hw_dbg(hw, "i40e_configure_lan_hmc: Unknown SD type: %d\n",
- ret_code);
+ ret_code);
goto configure_lan_hmc_out;
break;
}
@@ -528,7 +528,7 @@ try_type_paged:
/* FCoE contexts */
obj = &hw->hmc.hmc_obj[I40E_HMC_FCOE_CTX];
wr32(hw, I40E_GLHMC_FCOEDDPBASE(hmc_fn_id),
- (u32)((obj->base & I40E_GLHMC_FCOEDDPBASE_FPMFCOEDDPBASE_MASK) / 512));
+ (u32)((obj->base & I40E_GLHMC_FCOEDDPBASE_FPMFCOEDDPBASE_MASK) / 512));
wr32(hw, I40E_GLHMC_FCOEDDPCNT(hmc_fn_id), obj->cnt);
/* FCoE filters */
@@ -590,7 +590,7 @@ static i40e_status i40e_delete_lan_hmc_object(struct i40e_hw *hw,
if (info->start_idx >= info->hmc_info->hmc_obj[info->rsrc_type].cnt) {
ret_code = I40E_ERR_INVALID_HMC_OBJ_INDEX;
hw_dbg(hw, "i40e_delete_hmc_object: returns error %d\n",
- ret_code);
+ ret_code);
goto exit;
}
@@ -598,7 +598,7 @@ static i40e_status i40e_delete_lan_hmc_object(struct i40e_hw *hw,
info->hmc_info->hmc_obj[info->rsrc_type].cnt) {
ret_code = I40E_ERR_INVALID_HMC_OBJ_COUNT;
hw_dbg(hw, "i40e_delete_hmc_object: returns error %d\n",
- ret_code);
+ ret_code);
goto exit;
}
@@ -895,7 +895,7 @@ i40e_status i40e_hmc_get_object_va(struct i40e_hmc_info *hmc_info,
}
if (obj_idx >= hmc_info->hmc_obj[rsrc_type].cnt) {
hw_dbg(hw, "i40e_hmc_get_object_va: returns error %d\n",
- ret_code);
+ ret_code);
ret_code = I40E_ERR_INVALID_HMC_OBJ_INDEX;
goto exit;
}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 95617e6..b0f92f4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -387,9 +387,9 @@ void i40e_vsi_reset_stats(struct i40e_vsi *vsi)
if (vsi->rx_rings)
for (i = 0; i < vsi->num_queue_pairs; i++) {
memset(&vsi->rx_rings[i].rx_stats, 0 ,
- sizeof(struct i40e_rx_queue_stats));
+ sizeof(struct i40e_rx_queue_stats));
memset(&vsi->tx_rings[i].tx_stats, 0,
- sizeof(struct i40e_tx_queue_stats));
+ sizeof(struct i40e_tx_queue_stats));
}
vsi->stat_offsets_loaded = false;
}
@@ -961,7 +961,7 @@ struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
list_for_each_entry(f, &vsi->mac_filter_list, list) {
if ((0 == memcmp(macaddr, f->macaddr, ETH_ALEN)) &&
- (!is_vf || f->is_vf) &&
+ (!is_vf || f->is_vf) &&
(!is_netdev || f->is_netdev))
return f;
}
@@ -1523,7 +1523,7 @@ i40e_status i40e_sync_vsi_filters(struct i40e_vsi *vsi)
/* vlan0 as wild card to allow packets from all vlans */
if (f->vlan == I40E_VLAN_ANY || (vsi->netdev &&
- !(vsi->netdev->features &
+ !(vsi->netdev->features &
NETIF_F_HW_VLAN_CTAG_FILTER)))
cmd_flags |= I40E_AQC_MACVLAN_ADD_IGNORE_VLAN;
add_list[num_add].flags = cpu_to_le16(cmd_flags);
@@ -1551,9 +1551,9 @@ i40e_status i40e_sync_vsi_filters(struct i40e_vsi *vsi)
kfree(add_list);
add_list = NULL;
- if (add_happened && (ret == I40E_SUCCESS))
+ if (add_happened && (ret == I40E_SUCCESS)) {
/* do nothing */;
- else if (add_happened && (ret != I40E_SUCCESS)) {
+ } else if (add_happened && (ret != I40E_SUCCESS)) {
dev_info(&pf->pdev->dev,
"%s: add filter failed, err %d, aq_err %d\n",
__func__, ret, pf->hw.aq.asq_last_status);
@@ -1739,7 +1739,7 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
is_vf, is_netdev);
if (add_f == NULL) {
dev_info(&vsi->back->pdev->dev, "%s: Could not add vlan filter %d for %pM\n",
- __func__, vid, vsi->netdev->dev_addr);
+ __func__, vid, vsi->netdev->dev_addr);
return -ENOMEM;
}
}
@@ -1791,8 +1791,8 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
0, is_vf, is_netdev);
if (add_f == NULL) {
dev_info(&vsi->back->pdev->dev,
- "%s: Could not add filter 0 for %pM\n",
- __func__, f->macaddr);
+ "%s: Could not add filter 0 for %pM\n",
+ __func__, f->macaddr);
return -ENOMEM;
}
}
@@ -1828,7 +1828,7 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
ret = i40e_sync_vsi_filters(vsi);
if (ret != I40E_SUCCESS) {
dev_info(&vsi->back->pdev->dev, "%s: Could not sync filters\n",
- __func__);
+ __func__);
return ret;
}
@@ -1855,8 +1855,8 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
is_vf, is_netdev);
if (f == NULL) {
dev_info(&vsi->back->pdev->dev, "%s: Could not add filter %d for %pM\n",
- __func__, I40E_VLAN_ANY,
- netdev->dev_addr);
+ __func__, I40E_VLAN_ANY,
+ netdev->dev_addr);
return -ENOMEM;
}
}
@@ -1868,7 +1868,7 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
is_vf, is_netdev);
if (add_f == NULL) {
dev_info(&vsi->back->pdev->dev, "%s: Could not add filter %d for %pM\n",
- __func__, I40E_VLAN_ANY, f->macaddr);
+ __func__, I40E_VLAN_ANY, f->macaddr);
return -ENOMEM;
}
}
@@ -2209,7 +2209,7 @@ static s32 i40e_configure_rx_ring(struct i40e_ring *ring)
if (err != I40E_SUCCESS) {
dev_info(&vsi->back->pdev->dev,
"%s: Failed to set LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n",
- __func__, ring->queue_index, pf_q, err);
+ __func__, ring->queue_index, pf_q, err);
return err;
}
@@ -2568,14 +2568,14 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
if (q_vector->tx.ring[0] && q_vector->rx.ring[0]) {
snprintf(q_vector->name, sizeof(q_vector->name) - 1,
- "%s-%s-%d", basename, "TxRx", rx_int_idx++);
+ "%s-%s-%d", basename, "TxRx", rx_int_idx++);
tx_int_idx++;
} else if (q_vector->rx.ring[0]) {
snprintf(q_vector->name, sizeof(q_vector->name) - 1,
- "%s-%s-%d", basename, "rx", rx_int_idx++);
+ "%s-%s-%d", basename, "rx", rx_int_idx++);
} else if (q_vector->tx.ring[0]) {
snprintf(q_vector->name, sizeof(q_vector->name) - 1,
- "%s-%s-%d", basename, "tx", tx_int_idx++);
+ "%s-%s-%d", basename, "tx", tx_int_idx++);
} else {
/* skip this unused q_vector */
continue;
@@ -2587,8 +2587,8 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
q_vector);
if (err) {
dev_info(&pf->pdev->dev,
- "%s: request_irq failed, error: %d\n",
- __func__, err);
+ "%s: request_irq failed, error: %d\n",
+ __func__, err);
goto free_queue_irqs;
}
/* assign the mask for this irq */
@@ -2724,7 +2724,6 @@ static irqreturn_t i40e_intr(int irq, void *data)
/* only q0 is used in MSI/Legacy mode, and none are used in MSIX */
if (icr0 & I40E_PFINT_ICR0_QUEUE_0_MASK) {
-
/* temporarily disable queue cause for NAPI processing */
u32 qval = rd32(hw, I40E_QINT_RQCTL(0));
qval &= ~I40E_QINT_RQCTL_CAUSE_ENA_MASK;
@@ -3119,7 +3118,7 @@ static void i40e_vsi_free_irq(struct i40e_vsi *vsi)
/* clear the affinity_mask in the IRQ descriptor */
irq_set_affinity_hint(pf->msix_entries[vector].vector,
- NULL);
+ NULL);
free_irq(pf->msix_entries[vector].vector,
&vsi->q_vectors[i]);
@@ -3563,7 +3562,7 @@ static s32 i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi,
if (ret != I40E_SUCCESS) {
dev_info(&vsi->back->pdev->dev,
"%s: AQ command Config VSI BW allocation per TC failed = %d\n",
- __func__, vsi->back->hw.aq.asq_last_status);
+ __func__, vsi->back->hw.aq.asq_last_status);
return ret;
}
@@ -3611,7 +3610,7 @@ static void i40e_vsi_config_netdev_tc(struct i40e_vsi *vsi, u8 enabled_tc)
*/
if (vsi->tc_config.enabled_tc & (1 << i))
netdev_set_tc_queue(netdev,
- vsi->tc_config.tc_info[i].netdev_tc,
+ vsi->tc_config.tc_info[i].netdev_tc,
vsi->tc_config.tc_info[i].qcount,
vsi->tc_config.tc_info[i].qoffset);
}
@@ -3996,7 +3995,6 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
/* do the biggest reset indicated */
if (reset_flags & (1 << __I40E_GLOBAL_RESET_REQUESTED)) {
-
/* Request a Global Reset
*
* This will start the chip's countdown to the actual full
@@ -4011,7 +4009,6 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
wr32(&pf->hw, I40E_GLGEN_RTRIG, val);
} else if (reset_flags & (1 << __I40E_CORE_RESET_REQUESTED)) {
-
/* Request a Core Reset
*
* Same as Global Reset, except does *not* include the MAC/PHY
@@ -4023,7 +4020,6 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
i40e_flush(&pf->hw);
} else if (reset_flags & (1 << __I40E_PF_RESET_REQUESTED)) {
-
/* Request a PF Reset
*
* Resets only the PF-specific registers
@@ -4411,7 +4407,6 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
opcode = le16_to_cpu(event.desc.opcode);
switch (opcode) {
-
case i40e_aqc_opc_get_link_status:
i40e_handle_link_event(pf, &event);
break;
@@ -4426,7 +4421,7 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
case i40e_aqc_opc_lldp_update_mib:
dev_info(&pf->pdev->dev,
"%s: ARQ: Update LLDP MIB event received\n",
- __func__);
+ __func__);
break;
case i40e_aqc_opc_event_lan_overflow:
dev_info(&pf->pdev->dev,
@@ -5049,7 +5044,7 @@ static s32 i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type)
}
pf->next_vsi = ++i;
- vsi = kzalloc(sizeof(struct i40e_vsi), GFP_KERNEL);
+ vsi = kzalloc(sizeof(*vsi), GFP_KERNEL);
if (!vsi) {
ret = -ENOMEM;
goto err_alloc_vsi;
@@ -5220,8 +5215,8 @@ static int i40e_reserve_msix_vectors(struct i40e_pf *pf, int vectors)
} else if (err < 0) {
/* total failure */
dev_info(&pf->pdev->dev,
- "%s: MSI-X vector reservation failed: %d\n",
- __func__, err);
+ "%s: MSI-X vector reservation failed: %d\n",
+ __func__, err);
vectors = 0;
break;
} else {
@@ -5235,8 +5230,8 @@ static int i40e_reserve_msix_vectors(struct i40e_pf *pf, int vectors)
if (vectors > 0 && vectors < I40E_MIN_MSIX) {
dev_info(&pf->pdev->dev,
- "%s: Couldn't get enough vectors, only %d available\n",
- __func__, vectors);
+ "%s: Couldn't get enough vectors, only %d available\n",
+ __func__, vectors);
vectors = 0;
}
@@ -5299,8 +5294,8 @@ static i40e_status i40e_init_msix(struct i40e_pf *pf)
} else if (vec == I40E_MIN_MSIX) {
/* Adjust for minimal MSIX use */
dev_info(&pf->pdev->dev,
- "%s: Features disabled, not enough MSIX vectors\n",
- __func__);
+ "%s: Features disabled, not enough MSIX vectors\n",
+ __func__);
pf->flags &= ~I40E_FLAG_VMDQ_ENABLED;
pf->num_vmdq_vsis = 0;
pf->num_vmdq_qps = 0;
@@ -5366,7 +5361,7 @@ static int i40e_alloc_q_vectors(struct i40e_vsi *vsi)
vsi->q_vectors[v_idx].v_idx = v_idx;
/* Allocate the affinity_hint cpumask, configure the mask */
if (!alloc_cpumask_var(&vsi->q_vectors[v_idx].affinity_mask,
- GFP_KERNEL))
+ GFP_KERNEL))
goto err_out;
cpumask_set_cpu(v_idx, vsi->q_vectors[v_idx].affinity_mask);
if (vsi->netdev)
@@ -5404,8 +5399,8 @@ static void i40e_init_interrupt_scheme(struct i40e_pf *pf)
}
}
- if (!(pf->flags & I40E_FLAG_MSIX_ENABLED)
- && (pf->flags & I40E_FLAG_MSI_ENABLED)) {
+ if (!(pf->flags & I40E_FLAG_MSIX_ENABLED) &&
+ (pf->flags & I40E_FLAG_MSI_ENABLED)) {
err = pci_enable_msi(pf->pdev);
if (err) {
dev_info(&pf->pdev->dev,
@@ -5443,8 +5438,8 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf)
i40e_intr, 0, pf->misc_int_name, pf);
if (err) {
dev_info(&pf->pdev->dev,
- "%s, request_irq for msix_misc failed: %d\n",
- __func__, err);
+ "%s, request_irq for msix_misc failed: %d\n",
+ __func__, err);
return I40E_ERR_CONFIG;
}
}
@@ -5500,7 +5495,6 @@ static s32 i40e_config_rss(struct i40e_pf *pf)
/* Populate the LUT with max no. of queues in round robin fashion */
for (i = 0, j = 0; i < pf->hw.func_caps.rss_table_size; i++, j++) {
-
/* The assumption is that lan qp count will be the highest
* qp count for any PF VSI that needs RSS.
* If multiple VSIs need RSS support, all the qp counts
@@ -5569,13 +5563,13 @@ static int i40e_sw_init(struct i40e_pf *pf)
if (pf->hw.func_caps.fd) {
/* FW/NVM is not yet fixed in this regard */
if ((pf->hw.func_caps.fd_filters_guaranteed > 0) ||
- (pf->hw.func_caps.fd_filters_best_effort > 0)) {
+ (pf->hw.func_caps.fd_filters_best_effort > 0)) {
pf->flags |= I40E_FLAG_FDIR_ATR_ENABLED;
dev_info(&pf->pdev->dev,
- "Flow Director ATR mode Enabled\n");
+ "Flow Director ATR mode Enabled\n");
pf->flags |= I40E_FLAG_FDIR_ENABLED;
dev_info(&pf->pdev->dev,
- "Flow Director Side Band mode Enabled\n");
+ "Flow Director Side Band mode Enabled\n");
pf->fdir_pf_filter_count =
pf->hw.func_caps.fd_filters_guaranteed;
}
@@ -5733,7 +5727,7 @@ static s32 i40e_config_netdev(struct i40e_vsi *vsi)
} else {
random_ether_addr(mac_addr);
snprintf(netdev->name, IFNAMSIZ, "%sv%%d",
- pf->vsi[pf->lan_vsi]->netdev->name);
+ pf->vsi[pf->lan_vsi]->netdev->name);
i40e_add_filter(vsi, mac_addr, I40E_VLAN_ANY, false, false);
}
@@ -6130,7 +6124,6 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
}
if (!veb && uplink_seid != pf->mac_seid) {
-
for (i = 0; i < pf->hw.func_caps.num_vsis; i++) {
if (pf->vsi[i] && pf->vsi[i]->seid == uplink_seid) {
vsi = pf->vsi[i];
@@ -6323,7 +6316,7 @@ static s32 i40e_veb_mem_alloc(struct i40e_pf *pf)
goto err_alloc_veb; /* out of VEB slots! */
}
- veb = kzalloc(sizeof(struct i40e_veb), GFP_KERNEL);
+ veb = kzalloc(sizeof(*veb), GFP_KERNEL);
if (!veb) {
ret = -ENOMEM;
goto err_alloc_veb;
@@ -6370,7 +6363,7 @@ static void i40e_switch_branch_release(struct i40e_veb *branch)
if (!pf->vsi[i])
continue;
if (pf->vsi[i]->uplink_seid == branch_seid &&
- (pf->vsi[i]->flags & I40E_VSI_FLAG_VEB_OWNER) == 0) {
+ (pf->vsi[i]->flags & I40E_VSI_FLAG_VEB_OWNER) == 0) {
i40e_vsi_release(pf->vsi[i]);
}
}
@@ -6532,8 +6525,8 @@ struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags,
int ret;
/* if one seid is 0, the other must be 0 to create a floating relay */
- if ((uplink_seid == 0 || vsi_seid == 0)
- && (uplink_seid + vsi_seid != 0)) {
+ if ((uplink_seid == 0 || vsi_seid == 0) &&
+ (uplink_seid + vsi_seid != 0)) {
dev_info(&pf->pdev->dev,
"%s: one, not both seid's are 0: uplink=%d vsi=%d\n",
__func__, uplink_seid, vsi_seid);
@@ -6644,10 +6637,10 @@ s32 i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig)
dev_info(&pf->pdev->dev,
"%s: type=%d seid=%d uplink=%d downlink=%d\n",
__func__,
- sw_config->element[i].element_type,
- sw_config->element[i].seid,
- sw_config->element[i].uplink_seid,
- sw_config->element[i].downlink_seid);
+ sw_config->element[i].element_type,
+ sw_config->element[i].seid,
+ sw_config->element[i].uplink_seid,
+ sw_config->element[i].downlink_seid);
switch (sw_config->element[i].element_type) {
case I40E_SWITCH_ELEMENT_TYPE_MAC:
@@ -6708,10 +6701,10 @@ s32 i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig)
break;
default:
dev_info(&pf->pdev->dev,
- "%s: unknown element type=%d seid=%d\n",
- __func__,
- sw_config->element[i].element_type,
- sw_config->element[i].seid);
+ "%s: unknown element type=%d seid=%d\n",
+ __func__,
+ sw_config->element[i].element_type,
+ sw_config->element[i].seid);
break;
}
}
@@ -6850,7 +6843,6 @@ pf->rss_size = num_tc0; \
!(pf->flags & (I40E_FLAG_RSS_ENABLED |
I40E_FLAG_FDIR_ENABLED | I40E_FLAG_DCB_ENABLED)) ||
(queues_left == 1)) {
-
/* one qp for PF, no queues for anything else */
queues_left = 0;
pf->rss_size = pf->num_lan_qps = 1;
@@ -6867,7 +6859,6 @@ pf->rss_size = num_tc0; \
} else if (pf->flags & I40E_FLAG_RSS_ENABLED &&
!(pf->flags & I40E_FLAG_FDIR_ENABLED) &&
!(pf->flags & I40E_FLAG_DCB_ENABLED)) {
-
SET_RSS_SIZE;
queues_left -= pf->rss_size;
@@ -6876,7 +6867,6 @@ pf->rss_size = num_tc0; \
} else if (pf->flags & I40E_FLAG_RSS_ENABLED &&
!(pf->flags & I40E_FLAG_FDIR_ENABLED) &&
(pf->flags & I40E_FLAG_DCB_ENABLED)) {
-
/* save num_tc_qps queues for TCs 1 thru 7 and the rest
* are set up for RSS in TC0
*/
@@ -6896,7 +6886,6 @@ pf->rss_size = num_tc0; \
} else if (pf->flags & I40E_FLAG_RSS_ENABLED &&
(pf->flags & I40E_FLAG_FDIR_ENABLED) &&
!(pf->flags & I40E_FLAG_DCB_ENABLED)) {
-
queues_left -= 1; /* save 1 queue for FD */
SET_RSS_SIZE;
@@ -6914,7 +6903,6 @@ pf->rss_size = num_tc0; \
} else if (pf->flags & I40E_FLAG_RSS_ENABLED &&
(pf->flags & I40E_FLAG_FDIR_ENABLED) &&
(pf->flags & I40E_FLAG_DCB_ENABLED)) {
-
/* save 1 queue for TCs 1 thru 7,
* 1 queue for flow director,
* and the rest are set up for RSS in TC0
@@ -6941,14 +6929,14 @@ pf->rss_size = num_tc0; \
}
if ((pf->flags & I40E_FLAG_SRIOV_ENABLED) &&
- pf->num_vf_qps && pf->num_req_vfs && queues_left) {
+ pf->num_vf_qps && pf->num_req_vfs && queues_left) {
pf->num_req_vfs = min_t(int, pf->num_req_vfs, (queues_left /
pf->num_vf_qps));
queues_left -= (pf->num_req_vfs * pf->num_vf_qps);
}
if ((pf->flags & I40E_FLAG_VMDQ_ENABLED) &&
- pf->num_vmdq_vsis && pf->num_vmdq_qps && queues_left) {
+ pf->num_vmdq_vsis && pf->num_vmdq_qps && queues_left) {
pf->num_vmdq_vsis = min_t(int, pf->num_vmdq_vsis,
(queues_left / pf->num_vmdq_qps));
queues_left -= (pf->num_vmdq_vsis * pf->num_vmdq_qps);
@@ -7018,7 +7006,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
} else {
dev_err(&pdev->dev, "%s: DMA configuration failed: %d\n",
- __func__, err);
+ __func__, err);
err = -EIO;
goto err_dma;
}
@@ -7041,7 +7029,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
* the Admin Queue structures and then querying for the
* device's current profile information.
*/
- pf = kzalloc(sizeof(struct i40e_pf), GFP_KERNEL);
+ pf = kzalloc(sizeof(*pf), GFP_KERNEL);
if (!pf) {
err = -ENOMEM;
goto err_pf_alloc;
@@ -7101,7 +7089,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
"%s: init_adminq failed: %d expecting API %02x.%02x\n",
__func__, err,
I40E_FW_API_VERSION_MAJOR, I40E_FW_API_VERSION_MINOR
- );
+ );
goto err_pf_reset;
}
@@ -7318,8 +7306,8 @@ static void i40e_remove(struct pci_dev *pdev)
ret_code = i40e_shutdown_adminq(&pf->hw);
if (ret_code != I40E_SUCCESS)
dev_warn(&pdev->dev,
- "%s: Failed to destroy the Admin Queue resources: %d\n",
- __func__, ret_code);
+ "%s: Failed to destroy the Admin Queue resources: %d\n",
+ __func__, ret_code);
/* Clear all dynamic memory lists of rings, q_vectors, and VSIs */
i40e_clear_interrupt_scheme(pf);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
index 64f829b..41d4904 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@ -120,7 +120,7 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw,
hw->nvm.hw_semaphore_wait =
I40E_MS_TO_GTIME(time) + gtime;
hw_dbg(hw, "NVM acquire timed out, wait %llu ms before trying again.\n",
- time);
+ time);
}
}
@@ -204,7 +204,7 @@ static i40e_status i40e_read_nvm_srctl(struct i40e_hw *hw, u16 offset,
}
if (ret_code != I40E_SUCCESS)
hw_dbg(hw, "NVM read error: Couldn't access Shadow RAM address: 0x%x\n",
- offset);
+ offset);
read_nvm_exit:
return ret_code;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_sysfs.c b/drivers/net/ethernet/intel/i40e/i40e_sysfs.c
index 5f4e937..fe83333 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_sysfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_sysfs.c
@@ -396,10 +396,10 @@ static struct attribute_group i40e_sys_veb_attr_group = {
/* hw-switch attributes */
static struct kobj_attribute i40e_sys_hw_switch_hash_ptypes_attr =
__ATTR(hash_ptypes, 0644, i40e_sys_hw_switch_hash_ptypes_read,
- i40e_sys_hw_switch_hash_ptypes_write);
+ i40e_sys_hw_switch_hash_ptypes_write);
static struct kobj_attribute i40e_sys_hw_switch_hash_type_attr =
__ATTR(hash_type, S_IWUSR | S_IRUGO, i40e_sys_hw_switch_hash_type_read,
- i40e_sys_hw_switch_hash_type_write);
+ i40e_sys_hw_switch_hash_type_write);
static struct attribute *i40e_sys_hw_switch_attrs[] = {
&i40e_sys_hw_switch_hash_ptypes_attr.attr,
@@ -440,8 +440,8 @@ i40e_status i40e_sys_add_vsi(struct i40e_vsi *vsi)
} else {
/* find the parent kobj */
for (parent_veb = 0; parent_veb < I40E_MAX_VEB; parent_veb++) {
- if (pf->veb[parent_veb]
- && pf->veb[parent_veb]->seid == vsi->uplink_seid)
+ if (pf->veb[parent_veb] &&
+ pf->veb[parent_veb]->seid == vsi->uplink_seid)
break;
}
if ((parent_veb == I40E_MAX_VEB) ||
@@ -512,8 +512,8 @@ i40e_status i40e_sys_add_veb(struct i40e_veb *veb)
kobj = pf->switch_kobj;
} else {
for (parent_veb = 0; parent_veb < I40E_MAX_VEB; parent_veb++) {
- if (pf->veb[parent_veb]
- && pf->veb[parent_veb]->seid == veb->uplink_seid)
+ if (pf->veb[parent_veb] &&
+ pf->veb[parent_veb]->seid == veb->uplink_seid)
break;
}
if ((parent_veb != I40E_MAX_VEB) &&
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 7584c05..b6689d0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -301,7 +301,7 @@ static bool i40e_check_tx_hang(struct i40e_ring *tx_ring)
* pending but without time to complete it yet.
*/
if ((tx_ring->tx_stats.tx_done_old == tx_ring->tx_stats.packets) &&
- tx_pending) {
+ tx_pending) {
/* make sure it is true for two checks in a row */
ret = test_and_set_bit(__I40E_HANG_CHECK_ARMED,
&tx_ring->state);
@@ -406,7 +406,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index);
dev_info(tx_ring->dev,
- "tx hang detected on queue %d, resetting adapter\n",
+ "tx hang detected on queue %d, resetting adapter\n",
tx_ring->queue_index);
tx_ring->netdev->netdev_ops->ndo_tx_timeout(tx_ring->netdev);
@@ -962,7 +962,6 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
/* Get the rest of the data if this was a header split */
if (ring_is_ps_enabled(rx_ring) && rx_packet_len) {
-
skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
rx_bi->page,
rx_bi->page_offset,
@@ -1103,7 +1102,7 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
if (!test_bit(__I40E_DOWN, &vsi->state)) {
if (vsi->back->flags & I40E_FLAG_MSIX_ENABLED) {
i40e_irq_dynamic_enable(vsi,
- q_vector->v_idx + vsi->base_vector);
+ q_vector->v_idx + vsi->base_vector);
} else {
struct i40e_hw *hw = &vsi->back->hw;
/* We re-enable the queue 0 cause, but
@@ -1337,7 +1336,6 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,
tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr,
0, IPPROTO_TCP, 0);
} else if (skb_is_gso_v6(skb)) {
-
ipv6h = skb->encapsulation ? inner_ipv6_hdr(skb)
: ipv6_hdr(skb);
tcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb);
@@ -1388,7 +1386,6 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 tx_flags,
this_tcp_hdrlen = inner_tcp_hdrlen(skb);
if (tx_flags & I40E_TX_FLAGS_IPV4) {
-
if (tx_flags & I40E_TX_FLAGS_TSO) {
*cd_tunneling |= I40E_TX_CTX_EXT_IP_IPV4;
ip_hdr(skb)->check = 0;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
index 5baa99b..0125c96 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
@@ -247,13 +247,12 @@ struct i40e_ring_container {
u16 itr;
};
-extern void i40e_alloc_rx_buffers(struct i40e_ring *rxr, u16 cleaned_count);
-extern netdev_tx_t i40e_lan_xmit_frame(struct sk_buff *skb,
- struct net_device *netdev);
+void i40e_alloc_rx_buffers(struct i40e_ring *rxr, u16 cleaned_count);
+netdev_tx_t i40e_lan_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
void i40e_clean_tx_ring(struct i40e_ring *tx_ring);
void i40e_clean_rx_ring(struct i40e_ring *rx_ring);
-extern int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring);
-extern int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring);
-extern void i40e_free_tx_resources(struct i40e_ring *tx_ring);
-extern void i40e_free_rx_resources(struct i40e_ring *rx_ring);
-extern int i40e_napi_poll(struct napi_struct *napi, int budget);
+int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring);
+int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring);
+void i40e_free_tx_resources(struct i40e_ring *tx_ring);
+void i40e_free_rx_resources(struct i40e_ring *rx_ring);
+int i40e_napi_poll(struct napi_struct *napi, int budget);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index cdc7fad..441ae12 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -884,9 +884,9 @@ i40e_status i40e_free_vfs(struct i40e_pf *pf)
/* Re-enable interrupt 0. */
wr32(hw, I40E_PFINT_DYN_CTL0,
- I40E_PFINT_DYN_CTL0_INTENA_MASK |
- I40E_PFINT_DYN_CTL0_CLEARPBA_MASK |
- (I40E_ITR_NONE << I40E_PFINT_DYN_CTL0_ITR_INDX_SHIFT));
+ I40E_PFINT_DYN_CTL0_INTENA_MASK |
+ I40E_PFINT_DYN_CTL0_CLEARPBA_MASK |
+ (I40E_ITR_NONE << I40E_PFINT_DYN_CTL0_ITR_INDX_SHIFT));
i40e_flush(hw);
return ret;
}
@@ -1150,7 +1150,7 @@ static i40e_status i40e_vc_get_vf_resources_msg(struct i40e_vf *vf)
err:
/* send the response back to the vf */
ret = i40e_vc_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_GET_VF_RESOURCES,
- ret, (u8 *) vfres, len);
+ ret, (u8 *)vfres, len);
kfree(vfres);
return ret;
@@ -1832,8 +1832,8 @@ static i40e_status i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg,
ret = i40e_vsi_kill_vlan(vsi, vfl->vlan_id[i]);
if (I40E_SUCCESS != ret)
dev_err(&pf->pdev->dev,
- "%s: Unable to delete vlan filter %d, error %d\n",
- __func__, vfl->vlan_id[i], ret);
+ "%s: Unable to delete vlan filter %d, error %d\n",
+ __func__, vfl->vlan_id[i], ret);
}
error_param:
@@ -2108,7 +2108,6 @@ i40e_status i40e_vc_process_vflr_event(struct i40e_pf *pf)
ret = i40e_enable_vf_mappings(vf);
}
-
}
/* re-enable vflr interrupt cause */
--
1.8.1.2.459.gbcd45b4.dirty
^ permalink raw reply related
* [PATCH 0/4] i40e: Neatening and object size reductions
From: Joe Perches @ 2013-08-30 23:06 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: e1000-devel, netdev, linux-kernel
Just some potential cleanings...
Joe Perches (4):
i40e: Whitespace cleaning
i40e: Add and use pf_<level>
i40e: pf_<level> remove "%s: " ... __func__
i40e: Convert pf_<level> macros to functions
drivers/net/ethernet/intel/i40e/i40e.h | 149 +--
drivers/net/ethernet/intel/i40e/i40e_common.c | 20 +-
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 1133 ++++++++------------
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 47 +-
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c | 24 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 652 +++++------
drivers/net/ethernet/intel/i40e/i40e_nvm.c | 4 +-
drivers/net/ethernet/intel/i40e/i40e_sysfs.c | 24 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.h | 15 +-
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 217 ++--
11 files changed, 928 insertions(+), 1366 deletions(-)
--
1.8.1.2.459.gbcd45b4.dirty
^ permalink raw reply
* Re: [PATCH 1/7] Drop support for Renesys H8/300 (h8300) architecture
From: Sergei Shtylyov @ 2013-08-30 23:01 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-kernel, linux-ide, netdev, linux-watchdog, Wim Van Sebroeck,
David S. Miller, Al Viro, Eric Paris, Greg Kroah-Hartman,
Jiang Liu, David Howells, Thomas Gleixner, Stephen Rothwell,
Linus Torvalds
In-Reply-To: <1377880842-6835-2-git-send-email-linux@roeck-us.net>
Hello.
On 08/30/2013 08:40 PM, Guenter Roeck wrote:
Subject typo: it's Renesas, not Renesys, according to the MAINTAINERS entry.
> H8/300 has been dead for several years, and the kernel for it
> has not compiled for ages. Drop support for it.
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
WBR, Sergei
^ permalink raw reply
* Re: [PATCH v3 06/11] net: calxedaxgmac: fix race with tx queue stop/wake
From: Ben Hutchings @ 2013-08-30 22:57 UTC (permalink / raw)
To: Rob Herring; +Cc: netdev, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-6-git-send-email-robherring2@gmail.com>
On Fri, 2013-08-30 at 16:49 -0500, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
>
> Since the xgmac transmit start and completion work locklessly, it is
> possible for xgmac_xmit to stop the tx queue after the xgmac_tx_complete
> has run resulting in the tx queue never being woken up. Fix this by
> ensuring that ring buffer index updates are visible and recheck the ring
> space after stopping the queue. Also fix an off-by-one bug where we need
> to stop the queue when the ring buffer space is equal to MAX_SKB_FRAGS.
>
> The implementation used here was copied from
> drivers/net/ethernet/broadcom/tg3.c.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> v3:
> - Fix off-by-one bug in queue stopping
>
> v2:
> - drop netif_tx_lock
> - use netif_start_queue instead of netif_wake_queue
>
> drivers/net/ethernet/calxeda/xgmac.c | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
> index f630855..5d0b61a 100644
> --- a/drivers/net/ethernet/calxeda/xgmac.c
> +++ b/drivers/net/ethernet/calxeda/xgmac.c
> @@ -410,6 +410,9 @@ struct xgmac_priv {
> #define dma_ring_space(h, t, s) CIRC_SPACE(h, t, s)
> #define dma_ring_cnt(h, t, s) CIRC_CNT(h, t, s)
>
> +#define tx_dma_ring_space(p) \
> + dma_ring_space((p)->tx_head, (p)->tx_tail, DMA_TX_RING_SZ)
> +
> /* XGMAC Descriptor Access Helpers */
> static inline void desc_set_buf_len(struct xgmac_dma_desc *p, u32 buf_sz)
> {
> @@ -886,8 +889,10 @@ static void xgmac_tx_complete(struct xgmac_priv *priv)
> priv->tx_tail = dma_ring_incr(entry, DMA_TX_RING_SZ);
> }
>
> - if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) >
> - MAX_SKB_FRAGS)
> + /* Ensure tx_tail is visible to xgmac_xmit */
> + smp_mb();
> + if (unlikely(netif_queue_stopped(priv->dev) &&
> + (tx_dma_ring_space(priv) > MAX_SKB_FRAGS)))
> netif_wake_queue(priv->dev);
> }
>
> @@ -1125,10 +1130,15 @@ static netdev_tx_t xgmac_xmit(struct sk_buff *skb, struct net_device *dev)
>
> priv->tx_head = dma_ring_incr(entry, DMA_TX_RING_SZ);
>
> - if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) <
> - MAX_SKB_FRAGS)
> + /* Ensure tx_head update is visible to tx completion */
> + smp_mb();
> + if (unlikely(tx_dma_ring_space(priv) <= MAX_SKB_FRAGS)) {
> netif_stop_queue(dev);
> -
> + /* Ensure netif_stop_queue is visible to tx completion */
> + smp_mb();
> + if (tx_dma_ring_space(priv) > MAX_SKB_FRAGS)
> + netif_start_queue(dev);
> + }
> return NETDEV_TX_OK;
> }
>
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2013-08-30 22:14 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) There was a simplification in the ipv6 ndisc packet sending
attempted here, which avoided using memory accounting on the
per-netns ndisc socket for sending NDISC packets. It did fix some
important issues, but it causes regressions so it gets reverted
here too. Specifically, the problem with this change is that the
IPV6 output path really depends upon there being a valid skb->sk
attached.
The reason we want to do this change in some form when we figure
out how to do it right, is that if a device goes down the ndisc_sk
socket send queue will fill up and block NDISC packets that we want
to send to other devices too. That's really bad behavior.
Hopefully Thomas can come up with a better version of this change.
2) Fix a severe TCP performance regression by reverting a change made to
dev_pick_tx() quite some time ago. From Eric Dumazet.
3) TIPC returns wrongly signed error codes, fix from Erik Hugne.
4) Fix OOPS when doing IPSEC over ipv4 tunnels due to orphaning the skb->sk
too early. Fix from Li Hongjun.
5) RAW ipv4 sockets can use the wrong routing key during lookup, from
Chris Clark.
6) Similar to #1 revert an older change that tried to use plain alloc_skb()
for SYN/ACK TCP packets, this broke the netfilter owner mark which needs
to see the skb->sk for such frames. From Phil Oester.
7) BNX2x driver bug fixes from Ariel Elior and Yuval Mintz, specifically in
the handling of virtual functions.
8) IPSEC path error propagations to sockets is not done properly when we
have v4 in v6, and v6 in v4 type rules. Fix from Hannes Frederic Sowa.
9) Fix missing channel context release in mac80211, from Johannes Berg.
10) Fix network namespace handing wrt. SCM_RIGHTS, from Andy Lutomirski.
11) Fix usage of bogus NAPI weight in jme, netxen, and ps3_gelic drivers.
From Michal Schmidt.
12) Hopefully a complete and correct fix for the genetlink dump locking
and module reference counting. From Pravin B Shelar.
13) sk_busy_loop() must do a cpu_relax(), from Eliezer Tamir.
14) Fix handling of timestamp offset when restoring a snapshotted TCP socket.
From Andrew Vagin.
Please pull, thanks a lot!
The following changes since commit 41a00f7950a6bc0aa956f6d6b423f0fbf34d431a:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2013-08-23 09:54:21 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
for you to fetch changes up to 0affdf347ffc0c3a4595661c091e8cc5f1346e92:
net: fec: fix time stamping logic after napi conversion (2013-08-30 18:01:19 -0400)
----------------------------------------------------------------
Andrew Vagin (2):
tcp: initialize rcv_tstamp for restored sockets
tcp: don't apply tsoffset if rcv_tsecr is zero
Andy Lutomirski (2):
net: Check the correct namespace when spoofing pid over SCM_RIGHTS
Rename nsproxy.pid_ns to nsproxy.pid_ns_for_children
Ariel Elior (4):
bnx2x: vf mark stats started
bnx2x: Fix functionality of configuring vlan list
bnx2x: Fix VF memory leak unload
bnx2x: Fix VF stats sync
Byungho An (1):
net: stmmac: fixed the pbl setting with DT
Chris Clark (1):
ipv4: sendto/hdrincl: don't use destination address found in header
Dan Carpenter (1):
mISDN: return -EINVAL on error in dsp_control_req()
Daniel Borkmann (1):
net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay
David S. Miller (3):
Merge branch 'for-davem' of git://git.kernel.org/.../linville/wireless
Merge branch 'master' of git://git.kernel.org/.../klassert/ipsec
Revert "ipv6: Don't depend on per socket memory for neighbour discovery messages"
Eliezer Tamir (1):
net: add cpu_relax to busy poll loop
Eric Dumazet (1):
net: revert 8728c544a9c ("net: dev_pick_tx() fix")
Erik Hugne (1):
tipc: set sk_err correctly when connection fails
Felix Fietkau (1):
mac80211: add a flag to indicate CCK support for HT clients
Hannes Frederic Sowa (7):
xfrm: make local error reporting more robust
xfrm: introduce helper for safe determination of mtu
ipv6: wire up skb->encapsulation
ipv6: xfrm: dereference inner ipv6 header if encapsulated
xfrm: choose protocol family by skb protocol
xfrm: revert ipv4 mtu determination to dst_mtu
ipv6: set skb->protocol on tcp, raw and ip6_append_data genereated skbs
Helmut Schaa (1):
ath9k_htc: Restore skb headroom when returning skb to mac80211
Johannes Berg (1):
mac80211: add missing channel context release
John W. Linville (2):
Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem
Li Hongjun (1):
ipv4 tunnels: fix an oops when using ipip/sit with IPsec
Libo Chen (1):
net: xilinx: fix memleak
Linus Lüssing (1):
bridge: separate querier and query timer into IGMP/IPv4 and MLD/IPv6 ones
Michal Schmidt (3):
jme: lower NAPI weight
netxen: lower NAPI weight
ps3_gelic: lower NAPI weight
Phil Oester (1):
tcp: tcp_make_synack() should use sock_wmalloc
Pravin B Shelar (2):
genl: Fix genl dumpit() locking.
genl: Hold reference on correct module while netlink-dump.
Richard Cochran (1):
net: fec: fix time stamping logic after napi conversion
Rob Gardner (1):
net: usb: Add HP hs2434 device to ZLP exception table
Sarveshwar Bandi (1):
be2net: Check for POST state in suspend-resume sequence
Simon Wunderlich (1):
mac80211: ibss: fix ignored channel parameter
Stanislaw Gruszka (1):
iwl4965: fix rfkill set state regression
Steffen Klassert (1):
xfrm: Fix potential null pointer dereference in xdst_queue_output
Sujith Manoharan (1):
ath9k: Enable PLL fix only for AR9340/AR9330
Thomas Graf (1):
ipv6: Don't depend on per socket memory for neighbour discovery messages
Yuval Mintz (1):
bnx2x: Fix move FP memory deallocations
drivers/isdn/mISDN/dsp_core.c | 4 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 9 ++-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 9 ++-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 63 ++++++++-----------
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 31 ++++++----
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h | 3 +
drivers/net/ethernet/emulex/benet/be_main.c | 4 ++
drivers/net/ethernet/freescale/fec_main.c | 3 +-
drivers/net/ethernet/jme.c | 2 +-
drivers/net/ethernet/qlogic/netxen/netxen_nic.h | 1 -
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 20 +++---
drivers/net/ethernet/toshiba/ps3_gelic_net.c | 3 +-
drivers/net/ethernet/toshiba/ps3_gelic_net.h | 1 -
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | 1 +
drivers/net/usb/cdc_mbim.c | 4 ++
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 10 +++
drivers/net/wireless/ath/ath9k/init.c | 3 +-
drivers/net/wireless/ath/ath9k/main.c | 3 +-
drivers/net/wireless/ath/carl9170/main.c | 3 +-
drivers/net/wireless/iwlegacy/4965-mac.c | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 3 +-
include/linux/nsproxy.h | 6 +-
include/net/busy_poll.h | 1 +
include/net/genetlink.h | 20 +++++-
include/net/mac80211.h | 1 +
include/net/route.h | 8 +++
include/net/xfrm.h | 6 ++
kernel/fork.c | 5 +-
kernel/nsproxy.c | 27 ++++----
kernel/pid_namespace.c | 4 +-
net/bridge/br_device.c | 2 +-
net/bridge/br_input.c | 2 +-
net/bridge/br_mdb.c | 14 +++--
net/bridge/br_multicast.c | 261 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------
net/bridge/br_private.h | 57 +++++++++++++----
net/core/flow_dissector.c | 11 +---
net/core/scm.c | 2 +-
net/ipv4/ip_output.c | 8 ---
net/ipv4/ipip.c | 5 +-
net/ipv4/raw.c | 3 +-
net/ipv4/tcp_input.c | 9 ++-
net/ipv4/tcp_output.c | 4 +-
net/ipv4/xfrm4_output.c | 16 +++--
net/ipv4/xfrm4_state.c | 1 +
net/ipv6/ip6_gre.c | 5 ++
net/ipv6/ip6_output.c | 3 +
net/ipv6/ip6_tunnel.c | 6 ++
net/ipv6/raw.c | 1 +
net/ipv6/sit.c | 11 ++--
net/ipv6/xfrm6_output.c | 21 +++++--
net/ipv6/xfrm6_state.c | 1 +
net/mac80211/ibss.c | 34 +++++++++--
net/mac80211/rc80211_minstrel_ht.c | 3 +
net/netlink/genetlink.c | 67 ++++++++++++++++----
net/tipc/socket.c | 4 +-
net/xfrm/xfrm_output.c | 21 +++++++
net/xfrm/xfrm_policy.c | 9 +--
net/xfrm/xfrm_state.c | 7 +--
59 files changed, 590 insertions(+), 260 deletions(-)
^ permalink raw reply
* Re: [PATCH net] net: fec: fix time stamping logic after napi conversion
From: David Miller @ 2013-08-30 22:02 UTC (permalink / raw)
To: richardcochran; +Cc: netdev, Frank.Li
In-Reply-To: <22741489040b99d0c1025dcbf993fd5cfd859123.1377887138.git.richardcochran@gmail.com>
From: Richard Cochran <richardcochran@gmail.com>
Date: Fri, 30 Aug 2013 20:28:10 +0200
> Commit dc975382 "net: fec: add napi support to improve proformance"
> converted the fec driver to the napi model. However, that commit
> forgot to remove the call to skb_defer_rx_timestamp which is only
> needed in non-napi drivers.
>
> (The function napi_gro_receive eventually calls netif_receive_skb,
> which in turn calls skb_defer_rx_timestamp.)
>
> This patch should also be applied to the 3.9 and 3.10 kernels.
>
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Applied and queued up for -stable, thanks!
^ permalink raw reply
* Re: [PATCH] net: fec: fix the error to get the previous BD entry
From: David Miller @ 2013-08-30 21:59 UTC (permalink / raw)
To: B38611; +Cc: b20596, netdev, bhutchings, l.stach
In-Reply-To: <1377837325-5232-1-git-send-email-B38611@freescale.com>
From: Fugang Duan <B38611@freescale.com>
Date: Fri, 30 Aug 2013 12:35:25 +0800
> When the current BD is the first BD, the previous BD entry
> must be the last BD, not "bdp - 1".
>
> Add BD entry check to get the previous BD entry correctly.
>
> Signed-off-by: Fugang Duan <B38611@freescale.com>
The correct fix is to put this logic into fec_enet_get_prevdesc().
With this current limitation, the function is completely useless.
^ permalink raw reply
* Re: [PATCH net] net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay
From: David Miller @ 2013-08-30 21:57 UTC (permalink / raw)
To: dborkman; +Cc: netdev, linus.luessing, hannes
In-Reply-To: <1377813305-11058-1-git-send-email-dborkman@redhat.com>
From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 29 Aug 2013 23:55:05 +0200
> While looking into MLDv1/v2 code, I noticed that bridging code does
> not convert it's max delay into jiffies for MLDv2 messages as we do
> in core IPv6' multicast code.
>
> RFC3810, 5.1.3. Maximum Response Code says:
>
> The Maximum Response Code field specifies the maximum time allowed
> before sending a responding Report. The actual time allowed, called
> the Maximum Response Delay, is represented in units of milliseconds,
> and is derived from the Maximum Response Code as follows: [...]
>
> As we update timers that work with jiffies, we need to convert it.
>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [patch v2] net/fec: cleanup types in fec_get_mac()
From: David Miller @ 2013-08-30 21:54 UTC (permalink / raw)
To: dan.carpenter
Cc: grant.likely, rob.herring, fabio.estevam, Frank.Li, jim_baxter,
B38611, netdev, bhutchings, devicetree, kernel-janitors
In-Reply-To: <20130829082514.GB14334@elgon.mountain>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 29 Aug 2013 11:25:14 +0300
> My static checker complains that on some arches unsigned longs can be 8
> characters which is larger than the buffer is only 6 chars.
> Additionally, Ben Hutchings points out that the buffer actually holds
> big endian data and the buffer we are reading from is CPU endian.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: fix endian annotations and reverse the beXX_to_cpu() calls so that
> they say cpu_to_beXX().
Applied, thanks.
^ permalink raw reply
* Re: [patch] mISDN: return -EINVAL on error in dsp_control_req()
From: David Miller @ 2013-08-30 21:53 UTC (permalink / raw)
To: dan.carpenter; +Cc: isdn, khlebnikov, netdev, kernel-janitors
In-Reply-To: <20130829084700.GF14334@elgon.mountain>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 29 Aug 2013 11:47:00 +0300
> If skb->len is too short then we should return an error. Otherwise we
> read beyond the end of skb->data for several bytes.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks.
^ permalink raw reply
* [PATCH v3 11/11] net: calxedaxgmac: fix xgmac_xmit DMA mapping error handling
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
On a DMA mapping error in xgmac_xmit, we should simply free the skb and
return NETDEV_TX_OK rather than -EIO. In the case of errors in mapping
frags, we need to undo everything that has been setup.
Reported-by: Andreas Herrmann <andreas.herrmann@calxeda.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index cd5010b..78d6d6b 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -466,6 +466,13 @@ static inline void desc_set_tx_owner(struct xgmac_dma_desc *p, u32 flags)
p->flags = cpu_to_le32(tmpflags);
}
+static inline void desc_clear_tx_owner(struct xgmac_dma_desc *p)
+{
+ u32 tmpflags = le32_to_cpu(p->flags);
+ tmpflags &= TXDESC_END_RING;
+ p->flags = cpu_to_le32(tmpflags);
+}
+
static inline int desc_get_tx_ls(struct xgmac_dma_desc *p)
{
return le32_to_cpu(p->flags) & TXDESC_LAST_SEG;
@@ -1100,7 +1107,7 @@ static netdev_tx_t xgmac_xmit(struct sk_buff *skb, struct net_device *dev)
paddr = dma_map_single(priv->device, skb->data, len, DMA_TO_DEVICE);
if (dma_mapping_error(priv->device, paddr)) {
dev_kfree_skb(skb);
- return -EIO;
+ return NETDEV_TX_OK;
}
priv->tx_skbuff[entry] = skb;
desc_set_buf_addr_and_size(desc, paddr, len);
@@ -1112,10 +1119,8 @@ static netdev_tx_t xgmac_xmit(struct sk_buff *skb, struct net_device *dev)
paddr = skb_frag_dma_map(priv->device, frag, 0, len,
DMA_TO_DEVICE);
- if (dma_mapping_error(priv->device, paddr)) {
- dev_kfree_skb(skb);
- return -EIO;
- }
+ if (dma_mapping_error(priv->device, paddr))
+ goto dma_err;
entry = dma_ring_incr(entry, DMA_TX_RING_SZ);
desc = priv->dma_tx + entry;
@@ -1151,6 +1156,22 @@ static netdev_tx_t xgmac_xmit(struct sk_buff *skb, struct net_device *dev)
netif_start_queue(dev);
}
return NETDEV_TX_OK;
+
+dma_err:
+ entry = priv->tx_head;
+ for ( ; i > 0; i--) {
+ entry = dma_ring_incr(entry, DMA_TX_RING_SZ);
+ desc = priv->dma_tx + entry;
+ priv->tx_skbuff[entry] = NULL;
+ dma_unmap_page(priv->device, desc_get_buf_addr(desc),
+ desc_get_buf_len(desc), DMA_TO_DEVICE);
+ desc_clear_tx_owner(desc);
+ }
+ desc = first;
+ dma_unmap_single(priv->device, desc_get_buf_addr(desc),
+ desc_get_buf_len(desc), DMA_TO_DEVICE);
+ dev_kfree_skb(skb);
+ return NETDEV_TX_OK;
}
static int xgmac_rx(struct xgmac_priv *priv, int limit)
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 08/11] net: calxedaxgmac: fix various errors in xgmac_set_rx_mode
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Fix xgmac_set_rx_mode to handle several conditions that were not handled
correctly as Lennert Buytenhek describes:
If we have, say, 100 unicast addresses, and 5 multicast addresses, the
unicast address count check will evaluate to true, and set use_hash to
true. The multicast address check will however evaluate to false, and
use_hash won't be set to true again, and XGMAC_FRAME_FILTER_HMC won't
be OR'd into XGMAC_FRAME_FILTER, but since use_hash was still true
from the unicast check, netdev_for_each_mc_addr() will program the
multicast addresses into the hash table instead of using the MAC
address registers, but since the HMC bit wasn't set, the hash table
won't be checked for multicast addresses on receive, and we'll stop
receiving multicast packets entirely.
Also, there is no code that zeroes out MAC address registers reg..31
at the end of this function, meaning that under the right conditions,
unicast/multicast addresses that were previously in the filter but
were then deleted won't be cleared out.
Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 73d3f83..0cff9e3 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -618,10 +618,15 @@ static void xgmac_set_mac_addr(void __iomem *ioaddr, unsigned char *addr,
{
u32 data;
- data = (addr[5] << 8) | addr[4] | (num ? XGMAC_ADDR_AE : 0);
- writel(data, ioaddr + XGMAC_ADDR_HIGH(num));
- data = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0];
- writel(data, ioaddr + XGMAC_ADDR_LOW(num));
+ if (addr) {
+ data = (addr[5] << 8) | addr[4] | (num ? XGMAC_ADDR_AE : 0);
+ writel(data, ioaddr + XGMAC_ADDR_HIGH(num));
+ data = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0];
+ writel(data, ioaddr + XGMAC_ADDR_LOW(num));
+ } else {
+ writel(0, ioaddr + XGMAC_ADDR_HIGH(num));
+ writel(0, ioaddr + XGMAC_ADDR_LOW(num));
+ }
}
static void xgmac_get_mac_addr(void __iomem *ioaddr, unsigned char *addr,
@@ -1294,6 +1299,8 @@ static void xgmac_set_rx_mode(struct net_device *dev)
if ((netdev_mc_count(dev) + reg - 1) > XGMAC_MAX_FILTER_ADDR) {
use_hash = true;
value |= XGMAC_FRAME_FILTER_HMC | XGMAC_FRAME_FILTER_HPF;
+ } else {
+ use_hash = false;
}
netdev_for_each_mc_addr(ha, dev) {
if (use_hash) {
@@ -1310,6 +1317,8 @@ static void xgmac_set_rx_mode(struct net_device *dev)
}
out:
+ for (i = reg; i < XGMAC_MAX_FILTER_ADDR; i++)
+ xgmac_set_mac_addr(ioaddr, NULL, reg);
for (i = 0; i < XGMAC_NUM_HASH; i++)
writel(hash_filter[i], ioaddr + XGMAC_HASH(i));
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 10/11] net: calxedaxgmac: fix rx DMA mapping API size mismatches
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Fix the mismatch in the DMA mapping and unmapping sizes for receive. The
unmap size must be equal to the map size and should not be the actual
received frame length. The map size should also be adjusted by the
NET_IP_ALIGN size since the h/w buffer size (dma_buf_sz) includes this
offset.
Also, add a missing dma_mapping_error check in xgmac_rx_refill.
Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 04c585c..cd5010b 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -695,9 +695,14 @@ static void xgmac_rx_refill(struct xgmac_priv *priv)
if (unlikely(skb == NULL))
break;
- priv->rx_skbuff[entry] = skb;
paddr = dma_map_single(priv->device, skb->data,
- bufsz, DMA_FROM_DEVICE);
+ priv->dma_buf_sz - NET_IP_ALIGN,
+ DMA_FROM_DEVICE);
+ if (dma_mapping_error(priv->device, paddr)) {
+ dev_kfree_skb_any(skb);
+ break;
+ }
+ priv->rx_skbuff[entry] = skb;
desc_set_buf_addr(p, paddr, priv->dma_buf_sz);
}
@@ -794,13 +799,14 @@ static void xgmac_free_rx_skbufs(struct xgmac_priv *priv)
return;
for (i = 0; i < DMA_RX_RING_SZ; i++) {
- if (priv->rx_skbuff[i] == NULL)
+ struct sk_buff *skb = priv->rx_skbuff[i];
+ if (skb == NULL)
continue;
p = priv->dma_rx + i;
dma_unmap_single(priv->device, desc_get_buf_addr(p),
- priv->dma_buf_sz, DMA_FROM_DEVICE);
- dev_kfree_skb_any(priv->rx_skbuff[i]);
+ priv->dma_buf_sz - NET_IP_ALIGN, DMA_FROM_DEVICE);
+ dev_kfree_skb_any(skb);
priv->rx_skbuff[i] = NULL;
}
}
@@ -1187,7 +1193,7 @@ static int xgmac_rx(struct xgmac_priv *priv, int limit)
skb_put(skb, frame_len);
dma_unmap_single(priv->device, desc_get_buf_addr(p),
- frame_len, DMA_FROM_DEVICE);
+ priv->dma_buf_sz - NET_IP_ALIGN, DMA_FROM_DEVICE);
skb->protocol = eth_type_trans(skb, priv->dev);
skb->ip_summed = ip_checksum;
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 09/11] net: calxedaxgmac: remove some unused statistic counters
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
rx_sa_filter_fail and tx_undeflow events are unused and impossible
to occur based on how the h/w is used. We never filter on source MAC
address and TX store and forward mode prevents underflow events.
Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 0cff9e3..04c585c 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -353,11 +353,9 @@ struct xgmac_extra_stats {
/* Receive errors */
unsigned long rx_watchdog;
unsigned long rx_da_filter_fail;
- unsigned long rx_sa_filter_fail;
unsigned long rx_payload_error;
unsigned long rx_ip_header_error;
/* Tx/Rx IRQ errors */
- unsigned long tx_undeflow;
unsigned long tx_process_stopped;
unsigned long rx_buf_unav;
unsigned long rx_process_stopped;
@@ -1581,7 +1579,6 @@ static const struct xgmac_stats xgmac_gstrings_stats[] = {
XGMAC_STAT(rx_payload_error),
XGMAC_STAT(rx_ip_header_error),
XGMAC_STAT(rx_da_filter_fail),
- XGMAC_STAT(rx_sa_filter_fail),
XGMAC_STAT(fatal_bus_error),
XGMAC_HW_STAT(rx_watchdog, XGMAC_MMC_RXWATCHDOG),
XGMAC_HW_STAT(tx_vlan, XGMAC_MMC_TXVLANFRAME),
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 07/11] net: calxedaxgmac: enable interrupts after napi_enable
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Fix a race condition where the interrupt handler may have called
napi_schedule before napi_enable is called. This would disable interrupts
and never actually schedule napi to run.
Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 5d0b61a..73d3f83 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -959,9 +959,7 @@ static int xgmac_hw_init(struct net_device *dev)
DMA_BUS_MODE_FB | DMA_BUS_MODE_ATDS | DMA_BUS_MODE_AAL;
writel(value, ioaddr + XGMAC_DMA_BUS_MODE);
- /* Enable interrupts */
- writel(DMA_INTR_DEFAULT_MASK, ioaddr + XGMAC_DMA_STATUS);
- writel(DMA_INTR_DEFAULT_MASK, ioaddr + XGMAC_DMA_INTR_ENA);
+ writel(0, ioaddr + XGMAC_DMA_INTR_ENA);
/* Mask power mgt interrupt */
writel(XGMAC_INT_STAT_PMTIM, ioaddr + XGMAC_INT_STAT);
@@ -1029,6 +1027,10 @@ static int xgmac_open(struct net_device *dev)
napi_enable(&priv->napi);
netif_start_queue(dev);
+ /* Enable interrupts */
+ writel(DMA_INTR_DEFAULT_MASK, ioaddr + XGMAC_DMA_STATUS);
+ writel(DMA_INTR_DEFAULT_MASK, ioaddr + XGMAC_DMA_INTR_ENA);
+
return 0;
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 05/11] net: calxedaxgmac: update ring buffer tx_head after barriers
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Ensure that the descriptor writes are visible before the ring buffer head
is updated. Since writel is a barrier, we can simply update the head after
the writel.
Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 64854ad..f630855 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -1121,9 +1121,10 @@ static netdev_tx_t xgmac_xmit(struct sk_buff *skb, struct net_device *dev)
wmb();
desc_set_tx_owner(first, desc_flags | TXDESC_FIRST_SEG);
+ writel(1, priv->base + XGMAC_DMA_TX_POLL);
+
priv->tx_head = dma_ring_incr(entry, DMA_TX_RING_SZ);
- writel(1, priv->base + XGMAC_DMA_TX_POLL);
if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) <
MAX_SKB_FRAGS)
netif_stop_queue(dev);
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 06/11] net: calxedaxgmac: fix race with tx queue stop/wake
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Since the xgmac transmit start and completion work locklessly, it is
possible for xgmac_xmit to stop the tx queue after the xgmac_tx_complete
has run resulting in the tx queue never being woken up. Fix this by
ensuring that ring buffer index updates are visible and recheck the ring
space after stopping the queue. Also fix an off-by-one bug where we need
to stop the queue when the ring buffer space is equal to MAX_SKB_FRAGS.
The implementation used here was copied from
drivers/net/ethernet/broadcom/tg3.c.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
v3:
- Fix off-by-one bug in queue stopping
v2:
- drop netif_tx_lock
- use netif_start_queue instead of netif_wake_queue
drivers/net/ethernet/calxeda/xgmac.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index f630855..5d0b61a 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -410,6 +410,9 @@ struct xgmac_priv {
#define dma_ring_space(h, t, s) CIRC_SPACE(h, t, s)
#define dma_ring_cnt(h, t, s) CIRC_CNT(h, t, s)
+#define tx_dma_ring_space(p) \
+ dma_ring_space((p)->tx_head, (p)->tx_tail, DMA_TX_RING_SZ)
+
/* XGMAC Descriptor Access Helpers */
static inline void desc_set_buf_len(struct xgmac_dma_desc *p, u32 buf_sz)
{
@@ -886,8 +889,10 @@ static void xgmac_tx_complete(struct xgmac_priv *priv)
priv->tx_tail = dma_ring_incr(entry, DMA_TX_RING_SZ);
}
- if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) >
- MAX_SKB_FRAGS)
+ /* Ensure tx_tail is visible to xgmac_xmit */
+ smp_mb();
+ if (unlikely(netif_queue_stopped(priv->dev) &&
+ (tx_dma_ring_space(priv) > MAX_SKB_FRAGS)))
netif_wake_queue(priv->dev);
}
@@ -1125,10 +1130,15 @@ static netdev_tx_t xgmac_xmit(struct sk_buff *skb, struct net_device *dev)
priv->tx_head = dma_ring_incr(entry, DMA_TX_RING_SZ);
- if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) <
- MAX_SKB_FRAGS)
+ /* Ensure tx_head update is visible to tx completion */
+ smp_mb();
+ if (unlikely(tx_dma_ring_space(priv) <= MAX_SKB_FRAGS)) {
netif_stop_queue(dev);
-
+ /* Ensure netif_stop_queue is visible to tx completion */
+ smp_mb();
+ if (tx_dma_ring_space(priv) > MAX_SKB_FRAGS)
+ netif_start_queue(dev);
+ }
return NETDEV_TX_OK;
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 04/11] net: calxedaxgmac: fix possible skb free before tx complete
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
The TX completion code may have freed an skb before the entire sg list
was transmitted. The DMA unmap calls for the fragments could also get
skipped. Now set the skb pointer on every entry in the ring, not just
the head of the sg list. We then use the FS (first segment) bit in the
descriptors to determine skb head vs. fragment.
This also fixes similar bug in xgmac_free_tx_skbufs where clean-up of
a sg list that wraps at the end of the ring buffer would not get
unmapped.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 55 ++++++++++++++++--------------------
1 file changed, 24 insertions(+), 31 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index df7e3e2..64854ad 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -470,6 +470,11 @@ static inline int desc_get_tx_ls(struct xgmac_dma_desc *p)
return le32_to_cpu(p->flags) & TXDESC_LAST_SEG;
}
+static inline int desc_get_tx_fs(struct xgmac_dma_desc *p)
+{
+ return le32_to_cpu(p->flags) & TXDESC_FIRST_SEG;
+}
+
static inline u32 desc_get_buf_addr(struct xgmac_dma_desc *p)
{
return le32_to_cpu(p->buf1_addr);
@@ -796,7 +801,7 @@ static void xgmac_free_rx_skbufs(struct xgmac_priv *priv)
static void xgmac_free_tx_skbufs(struct xgmac_priv *priv)
{
- int i, f;
+ int i;
struct xgmac_dma_desc *p;
if (!priv->tx_skbuff)
@@ -807,16 +812,15 @@ static void xgmac_free_tx_skbufs(struct xgmac_priv *priv)
continue;
p = priv->dma_tx + i;
- dma_unmap_single(priv->device, desc_get_buf_addr(p),
- desc_get_buf_len(p), DMA_TO_DEVICE);
-
- for (f = 0; f < skb_shinfo(priv->tx_skbuff[i])->nr_frags; f++) {
- p = priv->dma_tx + i++;
+ if (desc_get_tx_fs(p))
+ dma_unmap_single(priv->device, desc_get_buf_addr(p),
+ desc_get_buf_len(p), DMA_TO_DEVICE);
+ else
dma_unmap_page(priv->device, desc_get_buf_addr(p),
desc_get_buf_len(p), DMA_TO_DEVICE);
- }
- dev_kfree_skb_any(priv->tx_skbuff[i]);
+ if (desc_get_tx_ls(p))
+ dev_kfree_skb_any(priv->tx_skbuff[i]);
priv->tx_skbuff[i] = NULL;
}
}
@@ -853,8 +857,6 @@ static void xgmac_free_dma_desc_rings(struct xgmac_priv *priv)
*/
static void xgmac_tx_complete(struct xgmac_priv *priv)
{
- int i;
-
while (dma_ring_cnt(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ)) {
unsigned int entry = priv->tx_tail;
struct sk_buff *skb = priv->tx_skbuff[entry];
@@ -864,33 +866,24 @@ static void xgmac_tx_complete(struct xgmac_priv *priv)
if (desc_get_owner(p))
break;
- /* Verify tx error by looking at the last segment */
- if (desc_get_tx_ls(p))
- desc_get_tx_status(priv, p);
-
netdev_dbg(priv->dev, "tx ring: curr %d, dirty %d\n",
priv->tx_head, priv->tx_tail);
- dma_unmap_single(priv->device, desc_get_buf_addr(p),
- desc_get_buf_len(p), DMA_TO_DEVICE);
-
- priv->tx_skbuff[entry] = NULL;
- priv->tx_tail = dma_ring_incr(entry, DMA_TX_RING_SZ);
-
- if (!skb) {
- continue;
- }
-
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
- entry = priv->tx_tail = dma_ring_incr(priv->tx_tail,
- DMA_TX_RING_SZ);
- p = priv->dma_tx + priv->tx_tail;
-
+ if (desc_get_tx_fs(p))
+ dma_unmap_single(priv->device, desc_get_buf_addr(p),
+ desc_get_buf_len(p), DMA_TO_DEVICE);
+ else
dma_unmap_page(priv->device, desc_get_buf_addr(p),
desc_get_buf_len(p), DMA_TO_DEVICE);
+
+ /* Check tx error on the last segment */
+ if (desc_get_tx_ls(p)) {
+ desc_get_tx_status(priv, p);
+ dev_kfree_skb(skb);
}
- dev_kfree_skb(skb);
+ priv->tx_skbuff[entry] = NULL;
+ priv->tx_tail = dma_ring_incr(entry, DMA_TX_RING_SZ);
}
if (dma_ring_space(priv->tx_head, priv->tx_tail, DMA_TX_RING_SZ) >
@@ -1110,7 +1103,7 @@ static netdev_tx_t xgmac_xmit(struct sk_buff *skb, struct net_device *dev)
entry = dma_ring_incr(entry, DMA_TX_RING_SZ);
desc = priv->dma_tx + entry;
- priv->tx_skbuff[entry] = NULL;
+ priv->tx_skbuff[entry] = skb;
desc_set_buf_addr_and_size(desc, paddr, len);
if (i < (nfrags - 1))
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 03/11] net: calxedaxgmac: fix race between xgmac_tx_complete and xgmac_tx_err
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
It is possible for the xgmac_tx_complete to run concurrently with
xgmac_tx_err since there are no locks. Fix this by moving the tx
error handling to a workqueue so we can disable napi while we reset
the transmitter.
Reported-by: Andreas Herrmann <andreas.herrmann@calxeda.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 38 +++++++++++++++++-------------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index d41af68..df7e3e2 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -393,6 +393,7 @@ struct xgmac_priv {
char rx_pause;
char tx_pause;
int wolopts;
+ struct work_struct tx_timeout_work;
};
/* XGMAC Configuration Settings */
@@ -897,21 +898,18 @@ static void xgmac_tx_complete(struct xgmac_priv *priv)
netif_wake_queue(priv->dev);
}
-/**
- * xgmac_tx_err:
- * @priv: pointer to the private device structure
- * Description: it cleans the descriptors and restarts the transmission
- * in case of errors.
- */
-static void xgmac_tx_err(struct xgmac_priv *priv)
+static void xgmac_tx_timeout_work(struct work_struct *work)
{
- u32 reg, value, inten;
+ u32 reg, value;
+ struct xgmac_priv *priv =
+ container_of(work, struct xgmac_priv, tx_timeout_work);
- netif_stop_queue(priv->dev);
+ napi_disable(&priv->napi);
- inten = readl(priv->base + XGMAC_DMA_INTR_ENA);
writel(0, priv->base + XGMAC_DMA_INTR_ENA);
+ netif_tx_lock(priv->dev);
+
reg = readl(priv->base + XGMAC_DMA_CONTROL);
writel(reg & ~DMA_CONTROL_ST, priv->base + XGMAC_DMA_CONTROL);
do {
@@ -927,9 +925,15 @@ static void xgmac_tx_err(struct xgmac_priv *priv)
writel(DMA_STATUS_TU | DMA_STATUS_TPS | DMA_STATUS_NIS | DMA_STATUS_AIS,
priv->base + XGMAC_DMA_STATUS);
- writel(inten, priv->base + XGMAC_DMA_INTR_ENA);
+ netif_tx_unlock(priv->dev);
netif_wake_queue(priv->dev);
+
+ napi_enable(&priv->napi);
+
+ /* Enable interrupts */
+ writel(DMA_INTR_DEFAULT_MASK, priv->base + XGMAC_DMA_STATUS);
+ writel(DMA_INTR_DEFAULT_MASK, priv->base + XGMAC_DMA_INTR_ENA);
}
static int xgmac_hw_init(struct net_device *dev)
@@ -1225,9 +1229,7 @@ static int xgmac_poll(struct napi_struct *napi, int budget)
static void xgmac_tx_timeout(struct net_device *dev)
{
struct xgmac_priv *priv = netdev_priv(dev);
-
- /* Clear Tx resources and restart transmitting again */
- xgmac_tx_err(priv);
+ schedule_work(&priv->tx_timeout_work);
}
/**
@@ -1366,7 +1368,6 @@ static irqreturn_t xgmac_pmt_interrupt(int irq, void *dev_id)
static irqreturn_t xgmac_interrupt(int irq, void *dev_id)
{
u32 intr_status;
- bool tx_err = false;
struct net_device *dev = (struct net_device *)dev_id;
struct xgmac_priv *priv = netdev_priv(dev);
struct xgmac_extra_stats *x = &priv->xstats;
@@ -1396,16 +1397,12 @@ static irqreturn_t xgmac_interrupt(int irq, void *dev_id)
if (intr_status & DMA_STATUS_TPS) {
netdev_err(priv->dev, "transmit process stopped\n");
x->tx_process_stopped++;
- tx_err = true;
+ schedule_work(&priv->tx_timeout_work);
}
if (intr_status & DMA_STATUS_FBI) {
netdev_err(priv->dev, "fatal bus error\n");
x->fatal_bus_error++;
- tx_err = true;
}
-
- if (tx_err)
- xgmac_tx_err(priv);
}
/* TX/RX NORMAL interrupts */
@@ -1708,6 +1705,7 @@ static int xgmac_probe(struct platform_device *pdev)
ndev->netdev_ops = &xgmac_netdev_ops;
SET_ETHTOOL_OPS(ndev, &xgmac_ethtool_ops);
spin_lock_init(&priv->stats_lock);
+ INIT_WORK(&priv->tx_timeout_work, xgmac_tx_timeout_work);
priv->device = &pdev->dev;
priv->dev = ndev;
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 02/11] net: calxedaxgmac: read correct field in xgmac_desc_get_buf_len
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
In-Reply-To: <1377899369-23252-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
xgmac_desc_get_buf_len appears to have a copy/paste error. flags is the
wrong field to read. We should be reading buf_size field. cpu_to_le32
should also be le32_to_cpu. This never really mattered as this function
is only used for DMA mapping calls which happen to be nops with coherent
DMA.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 71f6720..d41af68 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -421,7 +421,7 @@ static inline void desc_set_buf_len(struct xgmac_dma_desc *p, u32 buf_sz)
static inline int desc_get_buf_len(struct xgmac_dma_desc *p)
{
- u32 len = cpu_to_le32(p->flags);
+ u32 len = le32_to_cpu(p->buf_size);
return (len & DESC_BUFFER1_SZ_MASK) +
((len & DESC_BUFFER2_SZ_MASK) >> DESC_BUFFER2_SZ_OFFSET);
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH v3 01/11] net: calxedaxgmac: remove NETIF_F_FRAGLIST setting
From: Rob Herring @ 2013-08-30 21:49 UTC (permalink / raw)
To: netdev; +Cc: Ben Hutchings, Lennert Buytenhek, Rob Herring
From: Rob Herring <rob.herring@calxeda.com>
The xgmac does not actually handle frag lists, so this option should not
be set. It does not appear to have had any impact though.
Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/xgmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 7cb148c..71f6720 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -1759,7 +1759,7 @@ static int xgmac_probe(struct platform_device *pdev)
if (device_can_wakeup(priv->device))
priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */
- ndev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
+ ndev->hw_features = NETIF_F_SG | NETIF_F_HIGHDMA;
if (readl(priv->base + XGMAC_DMA_HW_FEATURE) & DMA_HW_FEAT_TXCOESEL)
ndev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_RXCSUM;
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH] net: revert 8728c544a9c ("net: dev_pick_tx() fix")
From: David Miller @ 2013-08-30 21:48 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, alexander.h.duyck, xii, therbert, nuclearcat
In-Reply-To: <1377738643.8277.25.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 28 Aug 2013 18:10:43 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> commit 8728c544a9cbdc ("net: dev_pick_tx() fix") and commit
> b6fe83e9525a ("bonding: refine IFF_XMIT_DST_RELEASE capability")
> are quite incompatible : Queue selection is disabled because skb
> dst was dropped before entering bonding device.
>
> This causes major performance regression, mainly because TCP packets
> for a given flow can be sent to multiple queues.
>
> This is particularly visible when using the new FQ packet scheduler
> with MQ + FQ setup on the slaves.
>
> We can safely revert the first commit now that 416186fbf8c5b
> ("net: Split core bits of netdev_pick_tx into __netdev_pick_tx")
> properly caps the queue_index.
>
> Reported-by: Xi Wang <xii@google.com>
> Diagnosed-by: Xi Wang <xii@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: [PATCH 01/31] net: ax88796: use dev_get_platdata()
From: David Miller @ 2013-08-30 21:45 UTC (permalink / raw)
To: jg1.han; +Cc: netdev
In-Reply-To: <003101cea53b$9fc95b30$df5c1190$%han@samsung.com>
I've applied all of the networking patchs of this series to net-next,
thanks.
^ permalink raw reply
* Re: [PATCH v3 06/11] net: calxedaxgmac: fix race with tx queue stop/wake
From: David Miller @ 2013-08-30 21:41 UTC (permalink / raw)
To: robherring2; +Cc: netdev, bhutchings, buytenh, rob.herring
In-Reply-To: <1377898533-12999-1-git-send-email-robherring2@gmail.com>
When you post a new version of a patch, you must repost the entire series,
not just the patch which is changing.
Thank you.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox