Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.io
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+15 -19
+2 -2
drivers/net/ethernet/pensando/ionic/ionic_dev.c
··· 206 206 if (fw_status_ready != idev->fw_status_ready) { 207 207 bool trigger = false; 208 208 209 + idev->fw_status_ready = fw_status_ready; 210 + 209 211 if (!fw_status_ready && lif && 210 212 !test_bit(IONIC_LIF_F_FW_RESET, lif->state) && 211 213 !test_and_set_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) { ··· 223 221 224 222 if (trigger) { 225 223 struct ionic_deferred_work *work; 226 - 227 - idev->fw_status_ready = fw_status_ready; 228 224 229 225 work = kzalloc(sizeof(*work), GFP_ATOMIC); 230 226 if (work) {
+3 -3
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
··· 74 74 struct ionic_lif *lif = netdev_priv(netdev); 75 75 struct ionic *ionic = lif->ionic; 76 76 77 - strlcpy(drvinfo->driver, IONIC_DRV_NAME, sizeof(drvinfo->driver)); 78 - strlcpy(drvinfo->fw_version, ionic->idev.dev_info.fw_version, 77 + strscpy(drvinfo->driver, IONIC_DRV_NAME, sizeof(drvinfo->driver)); 78 + strscpy(drvinfo->fw_version, ionic->idev.dev_info.fw_version, 79 79 sizeof(drvinfo->fw_version)); 80 - strlcpy(drvinfo->bus_info, ionic_bus_info(ionic), 80 + strscpy(drvinfo->bus_info, ionic_bus_info(ionic), 81 81 sizeof(drvinfo->bus_info)); 82 82 } 83 83
+3 -3
drivers/net/ethernet/pensando/ionic/ionic_if.h
··· 759 759 * IONIC_TXQ_DESC_OPCODE_CSUM_HW: 760 760 * Offload 16-bit checksum computation to hardware. 761 761 * If @csum_l3 is set then the packet's L3 checksum is 762 - * updated. Similarly, if @csum_l4 is set the the L4 762 + * updated. Similarly, if @csum_l4 is set the L4 763 763 * checksum is updated. If @encap is set then encap header 764 764 * checksums are also updated. 765 765 * ··· 1368 1368 * @status: link status (enum ionic_port_oper_status) 1369 1369 * @id: port id 1370 1370 * @speed: link speed (in Mbps) 1371 - * @link_down_count: number of times link went from from up to down 1371 + * @link_down_count: number of times link went from up to down 1372 1372 * @fec_type: fec type (enum ionic_port_fec_type) 1373 - * @xcvr: tranceiver status 1373 + * @xcvr: transceiver status 1374 1374 */ 1375 1375 struct ionic_port_status { 1376 1376 __le32 id;
+7 -9
drivers/net/ethernet/pensando/ionic/ionic_lif.c
··· 393 393 ionic_qcq_intr_free(lif, qcq); 394 394 395 395 if (qcq->cq.info) { 396 - devm_kfree(dev, qcq->cq.info); 396 + vfree(qcq->cq.info); 397 397 qcq->cq.info = NULL; 398 398 } 399 399 if (qcq->q.info) { 400 - devm_kfree(dev, qcq->q.info); 400 + vfree(qcq->q.info); 401 401 qcq->q.info = NULL; 402 402 } 403 403 } ··· 528 528 new->q.dev = dev; 529 529 new->flags = flags; 530 530 531 - new->q.info = devm_kcalloc(dev, num_descs, sizeof(*new->q.info), 532 - GFP_KERNEL); 531 + new->q.info = vzalloc(num_descs * sizeof(*new->q.info)); 533 532 if (!new->q.info) { 534 533 netdev_err(lif->netdev, "Cannot allocate queue info\n"); 535 534 err = -ENOMEM; ··· 549 550 if (err) 550 551 goto err_out; 551 552 552 - new->cq.info = devm_kcalloc(dev, num_descs, sizeof(*new->cq.info), 553 - GFP_KERNEL); 553 + new->cq.info = vzalloc(num_descs * sizeof(*new->cq.info)); 554 554 if (!new->cq.info) { 555 555 netdev_err(lif->netdev, "Cannot allocate completion queue info\n"); 556 556 err = -ENOMEM; ··· 638 640 err_out_free_q: 639 641 dma_free_coherent(dev, new->q_size, new->q_base, new->q_base_pa); 640 642 err_out_free_cq_info: 641 - devm_kfree(dev, new->cq.info); 643 + vfree(new->cq.info); 642 644 err_out_free_irq: 643 645 if (flags & IONIC_QCQ_F_INTR) { 644 646 devm_free_irq(dev, new->intr.vector, &new->napi); 645 647 ionic_intr_free(lif->ionic, new->intr.index); 646 648 } 647 649 err_out_free_q_info: 648 - devm_kfree(dev, new->q.info); 650 + vfree(new->q.info); 649 651 err_out_free_qcq: 650 652 devm_kfree(dev, new); 651 653 err_out: ··· 3301 3303 }, 3302 3304 }; 3303 3305 3304 - strlcpy(ctx.cmd.lif_setattr.name, lif->netdev->name, 3306 + strscpy(ctx.cmd.lif_setattr.name, lif->netdev->name, 3305 3307 sizeof(ctx.cmd.lif_setattr.name)); 3306 3308 3307 3309 ionic_adminq_post_wait(lif, &ctx);
-1
drivers/net/ethernet/pensando/ionic/ionic_stats.c
··· 151 151 IONIC_RX_STAT_DESC(vlan_stripped), 152 152 }; 153 153 154 - 155 154 #define IONIC_NUM_LIF_STATS ARRAY_SIZE(ionic_lif_stats_desc) 156 155 #define IONIC_NUM_PORT_STATS ARRAY_SIZE(ionic_port_stats_desc) 157 156 #define IONIC_NUM_TX_STATS ARRAY_SIZE(ionic_tx_stats_desc)
-1
drivers/net/ethernet/pensando/ionic/ionic_txrx.c
··· 10 10 #include "ionic_lif.h" 11 11 #include "ionic_txrx.h" 12 12 13 - 14 13 static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell, 15 14 ionic_desc_cb cb_func, void *cb_arg) 16 15 {