Commit 6e2e59ea authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'ionic-driver-updates'

Shannon Nelson says:

====================
ionic: driver updates

These are a couple of checkpatch cleanup patches, a bug fix,
and something to alleviate memory pressure in tight places.
====================

Link: https://lore.kernel.org/r/20220217220252.52293-1-snelson@pensando.ioSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 86213f80 ecea8bb4
...@@ -206,6 +206,8 @@ int ionic_heartbeat_check(struct ionic *ionic) ...@@ -206,6 +206,8 @@ int ionic_heartbeat_check(struct ionic *ionic)
if (fw_status_ready != idev->fw_status_ready) { if (fw_status_ready != idev->fw_status_ready) {
bool trigger = false; bool trigger = false;
idev->fw_status_ready = fw_status_ready;
if (!fw_status_ready && lif && if (!fw_status_ready && lif &&
!test_bit(IONIC_LIF_F_FW_RESET, lif->state) && !test_bit(IONIC_LIF_F_FW_RESET, lif->state) &&
!test_and_set_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) { !test_and_set_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) {
...@@ -222,8 +224,6 @@ int ionic_heartbeat_check(struct ionic *ionic) ...@@ -222,8 +224,6 @@ int ionic_heartbeat_check(struct ionic *ionic)
if (trigger) { if (trigger) {
struct ionic_deferred_work *work; struct ionic_deferred_work *work;
idev->fw_status_ready = fw_status_ready;
work = kzalloc(sizeof(*work), GFP_ATOMIC); work = kzalloc(sizeof(*work), GFP_ATOMIC);
if (work) { if (work) {
work->type = IONIC_DW_TYPE_LIF_RESET; work->type = IONIC_DW_TYPE_LIF_RESET;
......
...@@ -74,10 +74,10 @@ static void ionic_get_drvinfo(struct net_device *netdev, ...@@ -74,10 +74,10 @@ static void ionic_get_drvinfo(struct net_device *netdev,
struct ionic_lif *lif = netdev_priv(netdev); struct ionic_lif *lif = netdev_priv(netdev);
struct ionic *ionic = lif->ionic; struct ionic *ionic = lif->ionic;
strlcpy(drvinfo->driver, IONIC_DRV_NAME, sizeof(drvinfo->driver)); strscpy(drvinfo->driver, IONIC_DRV_NAME, sizeof(drvinfo->driver));
strlcpy(drvinfo->fw_version, ionic->idev.dev_info.fw_version, strscpy(drvinfo->fw_version, ionic->idev.dev_info.fw_version,
sizeof(drvinfo->fw_version)); sizeof(drvinfo->fw_version));
strlcpy(drvinfo->bus_info, ionic_bus_info(ionic), strscpy(drvinfo->bus_info, ionic_bus_info(ionic),
sizeof(drvinfo->bus_info)); sizeof(drvinfo->bus_info));
} }
......
...@@ -759,7 +759,7 @@ enum ionic_txq_desc_opcode { ...@@ -759,7 +759,7 @@ enum ionic_txq_desc_opcode {
* IONIC_TXQ_DESC_OPCODE_CSUM_HW: * IONIC_TXQ_DESC_OPCODE_CSUM_HW:
* Offload 16-bit checksum computation to hardware. * Offload 16-bit checksum computation to hardware.
* If @csum_l3 is set then the packet's L3 checksum is * If @csum_l3 is set then the packet's L3 checksum is
* updated. Similarly, if @csum_l4 is set the the L4 * updated. Similarly, if @csum_l4 is set the L4
* checksum is updated. If @encap is set then encap header * checksum is updated. If @encap is set then encap header
* checksums are also updated. * checksums are also updated.
* *
...@@ -1368,9 +1368,9 @@ union ionic_port_config { ...@@ -1368,9 +1368,9 @@ union ionic_port_config {
* @status: link status (enum ionic_port_oper_status) * @status: link status (enum ionic_port_oper_status)
* @id: port id * @id: port id
* @speed: link speed (in Mbps) * @speed: link speed (in Mbps)
* @link_down_count: number of times link went from from up to down * @link_down_count: number of times link went from up to down
* @fec_type: fec type (enum ionic_port_fec_type) * @fec_type: fec type (enum ionic_port_fec_type)
* @xcvr: tranceiver status * @xcvr: transceiver status
*/ */
struct ionic_port_status { struct ionic_port_status {
__le32 id; __le32 id;
......
...@@ -393,11 +393,11 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq) ...@@ -393,11 +393,11 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq)
ionic_qcq_intr_free(lif, qcq); ionic_qcq_intr_free(lif, qcq);
if (qcq->cq.info) { if (qcq->cq.info) {
devm_kfree(dev, qcq->cq.info); vfree(qcq->cq.info);
qcq->cq.info = NULL; qcq->cq.info = NULL;
} }
if (qcq->q.info) { if (qcq->q.info) {
devm_kfree(dev, qcq->q.info); vfree(qcq->q.info);
qcq->q.info = NULL; qcq->q.info = NULL;
} }
} }
...@@ -528,8 +528,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, ...@@ -528,8 +528,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
new->q.dev = dev; new->q.dev = dev;
new->flags = flags; new->flags = flags;
new->q.info = devm_kcalloc(dev, num_descs, sizeof(*new->q.info), new->q.info = vzalloc(num_descs * sizeof(*new->q.info));
GFP_KERNEL);
if (!new->q.info) { if (!new->q.info) {
netdev_err(lif->netdev, "Cannot allocate queue info\n"); netdev_err(lif->netdev, "Cannot allocate queue info\n");
err = -ENOMEM; err = -ENOMEM;
...@@ -550,8 +549,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, ...@@ -550,8 +549,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
if (err) if (err)
goto err_out; goto err_out;
new->cq.info = devm_kcalloc(dev, num_descs, sizeof(*new->cq.info), new->cq.info = vzalloc(num_descs * sizeof(*new->cq.info));
GFP_KERNEL);
if (!new->cq.info) { if (!new->cq.info) {
netdev_err(lif->netdev, "Cannot allocate completion queue info\n"); netdev_err(lif->netdev, "Cannot allocate completion queue info\n");
err = -ENOMEM; err = -ENOMEM;
...@@ -640,14 +638,14 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, ...@@ -640,14 +638,14 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
err_out_free_q: err_out_free_q:
dma_free_coherent(dev, new->q_size, new->q_base, new->q_base_pa); dma_free_coherent(dev, new->q_size, new->q_base, new->q_base_pa);
err_out_free_cq_info: err_out_free_cq_info:
devm_kfree(dev, new->cq.info); vfree(new->cq.info);
err_out_free_irq: err_out_free_irq:
if (flags & IONIC_QCQ_F_INTR) { if (flags & IONIC_QCQ_F_INTR) {
devm_free_irq(dev, new->intr.vector, &new->napi); devm_free_irq(dev, new->intr.vector, &new->napi);
ionic_intr_free(lif->ionic, new->intr.index); ionic_intr_free(lif->ionic, new->intr.index);
} }
err_out_free_q_info: err_out_free_q_info:
devm_kfree(dev, new->q.info); vfree(new->q.info);
err_out_free_qcq: err_out_free_qcq:
devm_kfree(dev, new); devm_kfree(dev, new);
err_out: err_out:
...@@ -3303,7 +3301,7 @@ static void ionic_lif_set_netdev_info(struct ionic_lif *lif) ...@@ -3303,7 +3301,7 @@ static void ionic_lif_set_netdev_info(struct ionic_lif *lif)
}, },
}; };
strlcpy(ctx.cmd.lif_setattr.name, lif->netdev->name, strscpy(ctx.cmd.lif_setattr.name, lif->netdev->name,
sizeof(ctx.cmd.lif_setattr.name)); sizeof(ctx.cmd.lif_setattr.name));
ionic_adminq_post_wait(lif, &ctx); ionic_adminq_post_wait(lif, &ctx);
......
...@@ -151,7 +151,6 @@ static const struct ionic_stat_desc ionic_rx_stats_desc[] = { ...@@ -151,7 +151,6 @@ static const struct ionic_stat_desc ionic_rx_stats_desc[] = {
IONIC_RX_STAT_DESC(vlan_stripped), IONIC_RX_STAT_DESC(vlan_stripped),
}; };
#define IONIC_NUM_LIF_STATS ARRAY_SIZE(ionic_lif_stats_desc) #define IONIC_NUM_LIF_STATS ARRAY_SIZE(ionic_lif_stats_desc)
#define IONIC_NUM_PORT_STATS ARRAY_SIZE(ionic_port_stats_desc) #define IONIC_NUM_PORT_STATS ARRAY_SIZE(ionic_port_stats_desc)
#define IONIC_NUM_TX_STATS ARRAY_SIZE(ionic_tx_stats_desc) #define IONIC_NUM_TX_STATS ARRAY_SIZE(ionic_tx_stats_desc)
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "ionic_lif.h" #include "ionic_lif.h"
#include "ionic_txrx.h" #include "ionic_txrx.h"
static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell, static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell,
ionic_desc_cb cb_func, void *cb_arg) ionic_desc_cb cb_func, void *cb_arg)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment