Skip to content

Commit 6ece701

Browse files
committed
Merge: BNX2X driver updates for 9.7
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6951 JIRA: https://issues.redhat.com/browse/RHEL-94578 JIRA: https://issues.redhat.com/browse/RHEL-93390 Bn2x* drivers updates for RHEL-9.7 Signed-off-by: John Meneghini <[email protected]> Approved-by: Ewan D. Milne <[email protected]> Approved-by: Chris Leech <[email protected]> Approved-by: José Ignacio Tornos Martínez <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Augusto Caringi <[email protected]>
2 parents 0d2bdf3 + 3845cdb commit 6ece701

File tree

21 files changed

+300
-356
lines changed

21 files changed

+300
-356
lines changed

drivers/net/ethernet/broadcom/bnx2.c

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ static const struct flash_spec flash_table[] =
175175
{0x19000002, 0x5b808201, 0x000500db, 0x03840253, 0xaf020406,
176176
NONBUFFERED_FLAGS, ST_MICRO_FLASH_PAGE_BITS, ST_MICRO_FLASH_PAGE_SIZE,
177177
ST_MICRO_FLASH_BYTE_ADDR_MASK, ST_MICRO_FLASH_BASE_TOTAL_SIZE*2,
178-
"Entry 0101: ST M45PE10 (128kB non-bufferred)"},
178+
"Entry 0101: ST M45PE10 (128kB non-buffered)"},
179179
/* Entry 0110: ST M45PE20 (non-buffered flash)*/
180180
{0x15000001, 0x57808201, 0x000500db, 0x03840253, 0xaf020406,
181181
NONBUFFERED_FLAGS, ST_MICRO_FLASH_PAGE_BITS, ST_MICRO_FLASH_PAGE_SIZE,
182182
ST_MICRO_FLASH_BYTE_ADDR_MASK, ST_MICRO_FLASH_BASE_TOTAL_SIZE*4,
183-
"Entry 0110: ST M45PE20 (256kB non-bufferred)"},
183+
"Entry 0110: ST M45PE20 (256kB non-buffered)"},
184184
/* Saifun SA25F005 (non-buffered flash) */
185185
/* strap, cfg1, & write1 need updates */
186186
{0x1d000003, 0x5f808201, 0x00050081, 0x03840253, 0xaf020406,
@@ -3829,7 +3829,7 @@ load_rv2p_fw(struct bnx2 *bp, u32 rv2p_proc,
38293829
return 0;
38303830
}
38313831

3832-
static int
3832+
static void
38333833
load_cpu_fw(struct bnx2 *bp, const struct cpu_reg *cpu_reg,
38343834
const struct bnx2_mips_fw_file_entry *fw_entry)
38353835
{
@@ -3897,48 +3897,34 @@ load_cpu_fw(struct bnx2 *bp, const struct cpu_reg *cpu_reg,
38973897
val &= ~cpu_reg->mode_value_halt;
38983898
bnx2_reg_wr_ind(bp, cpu_reg->state, cpu_reg->state_value_clear);
38993899
bnx2_reg_wr_ind(bp, cpu_reg->mode, val);
3900-
3901-
return 0;
39023900
}
39033901

3904-
static int
3902+
static void
39053903
bnx2_init_cpus(struct bnx2 *bp)
39063904
{
39073905
const struct bnx2_mips_fw_file *mips_fw =
39083906
(const struct bnx2_mips_fw_file *) bp->mips_firmware->data;
39093907
const struct bnx2_rv2p_fw_file *rv2p_fw =
39103908
(const struct bnx2_rv2p_fw_file *) bp->rv2p_firmware->data;
3911-
int rc;
39123909

39133910
/* Initialize the RV2P processor. */
39143911
load_rv2p_fw(bp, RV2P_PROC1, &rv2p_fw->proc1);
39153912
load_rv2p_fw(bp, RV2P_PROC2, &rv2p_fw->proc2);
39163913

39173914
/* Initialize the RX Processor. */
3918-
rc = load_cpu_fw(bp, &cpu_reg_rxp, &mips_fw->rxp);
3919-
if (rc)
3920-
goto init_cpu_err;
3915+
load_cpu_fw(bp, &cpu_reg_rxp, &mips_fw->rxp);
39213916

39223917
/* Initialize the TX Processor. */
3923-
rc = load_cpu_fw(bp, &cpu_reg_txp, &mips_fw->txp);
3924-
if (rc)
3925-
goto init_cpu_err;
3918+
load_cpu_fw(bp, &cpu_reg_txp, &mips_fw->txp);
39263919

39273920
/* Initialize the TX Patch-up Processor. */
3928-
rc = load_cpu_fw(bp, &cpu_reg_tpat, &mips_fw->tpat);
3929-
if (rc)
3930-
goto init_cpu_err;
3921+
load_cpu_fw(bp, &cpu_reg_tpat, &mips_fw->tpat);
39313922

39323923
/* Initialize the Completion Processor. */
3933-
rc = load_cpu_fw(bp, &cpu_reg_com, &mips_fw->com);
3934-
if (rc)
3935-
goto init_cpu_err;
3924+
load_cpu_fw(bp, &cpu_reg_com, &mips_fw->com);
39363925

39373926
/* Initialize the Command Processor. */
3938-
rc = load_cpu_fw(bp, &cpu_reg_cp, &mips_fw->cp);
3939-
3940-
init_cpu_err:
3941-
return rc;
3927+
load_cpu_fw(bp, &cpu_reg_cp, &mips_fw->cp);
39423928
}
39433929

39443930
static void
@@ -4951,8 +4937,7 @@ bnx2_init_chip(struct bnx2 *bp)
49514937
} else
49524938
bnx2_init_context(bp);
49534939

4954-
if ((rc = bnx2_init_cpus(bp)) != 0)
4955-
return rc;
4940+
bnx2_init_cpus(bp);
49564941

49574942
bnx2_init_nvram(bp);
49584943

@@ -5415,8 +5400,9 @@ bnx2_set_rx_ring_size(struct bnx2 *bp, u32 size)
54155400

54165401
bp->rx_buf_use_size = rx_size;
54175402
/* hw alignment + build_skb() overhead*/
5418-
bp->rx_buf_size = SKB_DATA_ALIGN(bp->rx_buf_use_size + BNX2_RX_ALIGN) +
5419-
NET_SKB_PAD + SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
5403+
bp->rx_buf_size = kmalloc_size_roundup(
5404+
SKB_DATA_ALIGN(bp->rx_buf_use_size + BNX2_RX_ALIGN) +
5405+
NET_SKB_PAD + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)));
54205406
bp->rx_jumbo_thresh = rx_size - BNX2_RX_OFFSET;
54215407
bp->rx_ring_size = size;
54225408
bp->rx_max_ring = bnx2_find_max_ring(size, BNX2_MAX_RX_RINGS);
@@ -8208,7 +8194,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
82088194
rc = pci_set_consistent_dma_mask(pdev, persist_dma_mask);
82098195
if (rc) {
82108196
dev_err(&pdev->dev,
8211-
"pci_set_consistent_dma_mask failed, aborting\n");
8197+
"dma_set_coherent_mask failed, aborting\n");
82128198
goto err_out_unmap;
82138199
}
82148200
} else if ((rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) != 0) {

drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,34 @@ static const struct {
3939
int size;
4040
char string[ETH_GSTRING_LEN];
4141
} bnx2x_q_stats_arr[] = {
42-
/* 1 */ { Q_STATS_OFFSET32(total_bytes_received_hi), 8, "[%s]: rx_bytes" },
42+
/* 1 */ { Q_STATS_OFFSET32(total_bytes_received_hi), 8, "[%d]: rx_bytes" },
4343
{ Q_STATS_OFFSET32(total_unicast_packets_received_hi),
44-
8, "[%s]: rx_ucast_packets" },
44+
8, "[%d]: rx_ucast_packets" },
4545
{ Q_STATS_OFFSET32(total_multicast_packets_received_hi),
46-
8, "[%s]: rx_mcast_packets" },
46+
8, "[%d]: rx_mcast_packets" },
4747
{ Q_STATS_OFFSET32(total_broadcast_packets_received_hi),
48-
8, "[%s]: rx_bcast_packets" },
49-
{ Q_STATS_OFFSET32(no_buff_discard_hi), 8, "[%s]: rx_discards" },
48+
8, "[%d]: rx_bcast_packets" },
49+
{ Q_STATS_OFFSET32(no_buff_discard_hi), 8, "[%d]: rx_discards" },
5050
{ Q_STATS_OFFSET32(rx_err_discard_pkt),
51-
4, "[%s]: rx_phy_ip_err_discards"},
51+
4, "[%d]: rx_phy_ip_err_discards"},
5252
{ Q_STATS_OFFSET32(rx_skb_alloc_failed),
53-
4, "[%s]: rx_skb_alloc_discard" },
54-
{ Q_STATS_OFFSET32(hw_csum_err), 4, "[%s]: rx_csum_offload_errors" },
55-
{ Q_STATS_OFFSET32(driver_xoff), 4, "[%s]: tx_exhaustion_events" },
56-
{ Q_STATS_OFFSET32(total_bytes_transmitted_hi), 8, "[%s]: tx_bytes" },
53+
4, "[%d]: rx_skb_alloc_discard" },
54+
{ Q_STATS_OFFSET32(hw_csum_err), 4, "[%d]: rx_csum_offload_errors" },
55+
{ Q_STATS_OFFSET32(driver_xoff), 4, "[%d]: tx_exhaustion_events" },
56+
{ Q_STATS_OFFSET32(total_bytes_transmitted_hi), 8, "[%d]: tx_bytes" },
5757
/* 10 */{ Q_STATS_OFFSET32(total_unicast_packets_transmitted_hi),
58-
8, "[%s]: tx_ucast_packets" },
58+
8, "[%d]: tx_ucast_packets" },
5959
{ Q_STATS_OFFSET32(total_multicast_packets_transmitted_hi),
60-
8, "[%s]: tx_mcast_packets" },
60+
8, "[%d]: tx_mcast_packets" },
6161
{ Q_STATS_OFFSET32(total_broadcast_packets_transmitted_hi),
62-
8, "[%s]: tx_bcast_packets" },
62+
8, "[%d]: tx_bcast_packets" },
6363
{ Q_STATS_OFFSET32(total_tpa_aggregations_hi),
64-
8, "[%s]: tpa_aggregations" },
64+
8, "[%d]: tpa_aggregations" },
6565
{ Q_STATS_OFFSET32(total_tpa_aggregated_frames_hi),
66-
8, "[%s]: tpa_aggregated_frames"},
67-
{ Q_STATS_OFFSET32(total_tpa_bytes_hi), 8, "[%s]: tpa_bytes"},
66+
8, "[%d]: tpa_aggregated_frames"},
67+
{ Q_STATS_OFFSET32(total_tpa_bytes_hi), 8, "[%d]: tpa_bytes"},
6868
{ Q_STATS_OFFSET32(driver_filtered_tx_pkt),
69-
4, "[%s]: driver_filtered_tx_pkt" }
69+
4, "[%d]: driver_filtered_tx_pkt" }
7070
};
7171

7272
#define BNX2X_NUM_Q_STATS ARRAY_SIZE(bnx2x_q_stats_arr)
@@ -3184,49 +3184,43 @@ static u32 bnx2x_get_private_flags(struct net_device *dev)
31843184
static void bnx2x_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
31853185
{
31863186
struct bnx2x *bp = netdev_priv(dev);
3187-
int i, j, k, start;
3188-
char queue_name[MAX_QUEUE_NAME_LEN+1];
3187+
const char *str;
3188+
int i, j, start;
31893189

31903190
switch (stringset) {
31913191
case ETH_SS_STATS:
3192-
k = 0;
31933192
if (is_multi(bp)) {
31943193
for_each_eth_queue(bp, i) {
3195-
memset(queue_name, 0, sizeof(queue_name));
3196-
snprintf(queue_name, sizeof(queue_name),
3197-
"%d", i);
3198-
for (j = 0; j < BNX2X_NUM_Q_STATS; j++)
3199-
snprintf(buf + (k + j)*ETH_GSTRING_LEN,
3200-
ETH_GSTRING_LEN,
3201-
bnx2x_q_stats_arr[j].string,
3202-
queue_name);
3203-
k += BNX2X_NUM_Q_STATS;
3194+
for (j = 0; j < BNX2X_NUM_Q_STATS; j++) {
3195+
str = bnx2x_q_stats_arr[j].string;
3196+
ethtool_sprintf(&buf, str, i);
3197+
}
32043198
}
32053199
}
32063200

3207-
for (i = 0, j = 0; i < BNX2X_NUM_STATS; i++) {
3201+
for (i = 0; i < BNX2X_NUM_STATS; i++) {
32083202
if (HIDE_PORT_STAT(bp) && IS_PORT_STAT(i))
32093203
continue;
3210-
strcpy(buf + (k + j)*ETH_GSTRING_LEN,
3211-
bnx2x_stats_arr[i].string);
3212-
j++;
3204+
ethtool_puts(&buf, bnx2x_stats_arr[i].string);
32133205
}
32143206

32153207
break;
32163208

32173209
case ETH_SS_TEST:
3210+
if (IS_VF(bp))
3211+
break;
32183212
/* First 4 tests cannot be done in MF mode */
32193213
if (!IS_MF(bp))
32203214
start = 0;
32213215
else
32223216
start = 4;
3223-
memcpy(buf, bnx2x_tests_str_arr + start,
3224-
ETH_GSTRING_LEN * BNX2X_NUM_TESTS(bp));
3217+
for (i = start; i < BNX2X_NUM_TESTS_SF; i++)
3218+
ethtool_puts(&buf, bnx2x_tests_str_arr[i]);
32253219
break;
32263220

32273221
case ETH_SS_PRIV_FLAGS:
3228-
memcpy(buf, bnx2x_private_arr,
3229-
ETH_GSTRING_LEN * BNX2X_PRI_FLAG_LEN);
3222+
for (i = 0; i < BNX2X_PRI_FLAG_LEN; i++)
3223+
ethtool_puts(&buf, bnx2x_private_arr[i]);
32303224
break;
32313225
}
32323226
}

drivers/net/ethernet/broadcom/cnic.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <linux/if_vlan.h>
3232
#include <linux/prefetch.h>
3333
#include <linux/random.h>
34+
#include <linux/workqueue.h>
3435
#if IS_ENABLED(CONFIG_VLAN_8021Q)
3536
#define BCM_VLAN 1
3637
#endif
@@ -3015,9 +3016,9 @@ static int cnic_service_bnx2(void *data, void *status_blk)
30153016
return cnic_service_bnx2_queues(dev);
30163017
}
30173018

3018-
static void cnic_service_bnx2_msix(struct tasklet_struct *t)
3019+
static void cnic_service_bnx2_msix(struct work_struct *work)
30193020
{
3020-
struct cnic_local *cp = from_tasklet(cp, t, cnic_irq_task);
3021+
struct cnic_local *cp = from_work(cp, work, cnic_irq_bh_work);
30213022
struct cnic_dev *dev = cp->dev;
30223023

30233024
cp->last_status_idx = cnic_service_bnx2_queues(dev);
@@ -3036,7 +3037,7 @@ static void cnic_doirq(struct cnic_dev *dev)
30363037
prefetch(cp->status_blk.gen);
30373038
prefetch(&cp->kcq1.kcq[KCQ_PG(prod)][KCQ_IDX(prod)]);
30383039

3039-
tasklet_schedule(&cp->cnic_irq_task);
3040+
queue_work(system_bh_wq, &cp->cnic_irq_bh_work);
30403041
}
30413042
}
30423043

@@ -3140,9 +3141,9 @@ static u32 cnic_service_bnx2x_kcq(struct cnic_dev *dev, struct kcq_info *info)
31403141
return last_status;
31413142
}
31423143

3143-
static void cnic_service_bnx2x_bh(struct tasklet_struct *t)
3144+
static void cnic_service_bnx2x_bh_work(struct work_struct *work)
31443145
{
3145-
struct cnic_local *cp = from_tasklet(cp, t, cnic_irq_task);
3146+
struct cnic_local *cp = from_work(cp, work, cnic_irq_bh_work);
31463147
struct cnic_dev *dev = cp->dev;
31473148
struct bnx2x *bp = netdev_priv(dev->netdev);
31483149
u32 status_idx, new_status_idx;
@@ -4429,7 +4430,7 @@ static void cnic_free_irq(struct cnic_dev *dev)
44294430

44304431
if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) {
44314432
cp->disable_int_sync(dev);
4432-
tasklet_kill(&cp->cnic_irq_task);
4433+
cancel_work_sync(&cp->cnic_irq_bh_work);
44334434
free_irq(ethdev->irq_arr[0].vector, dev);
44344435
}
44354436
}
@@ -4442,7 +4443,7 @@ static int cnic_request_irq(struct cnic_dev *dev)
44424443

44434444
err = request_irq(ethdev->irq_arr[0].vector, cnic_irq, 0, "cnic", dev);
44444445
if (err)
4445-
tasklet_disable(&cp->cnic_irq_task);
4446+
disable_work_sync(&cp->cnic_irq_bh_work);
44464447

44474448
return err;
44484449
}
@@ -4465,7 +4466,7 @@ static int cnic_init_bnx2_irq(struct cnic_dev *dev)
44654466
CNIC_WR(dev, base + BNX2_HC_CMD_TICKS_OFF, (64 << 16) | 220);
44664467

44674468
cp->last_status_idx = cp->status_blk.bnx2->status_idx;
4468-
tasklet_setup(&cp->cnic_irq_task, cnic_service_bnx2_msix);
4469+
INIT_WORK(&cp->cnic_irq_bh_work, cnic_service_bnx2_msix);
44694470
err = cnic_request_irq(dev);
44704471
if (err)
44714472
return err;
@@ -4874,7 +4875,7 @@ static int cnic_init_bnx2x_irq(struct cnic_dev *dev)
48744875
struct cnic_eth_dev *ethdev = cp->ethdev;
48754876
int err = 0;
48764877

4877-
tasklet_setup(&cp->cnic_irq_task, cnic_service_bnx2x_bh);
4878+
INIT_WORK(&cp->cnic_irq_bh_work, cnic_service_bnx2x_bh_work);
48784879
if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX)
48794880
err = cnic_request_irq(dev);
48804881

drivers/net/ethernet/broadcom/cnic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ struct cnic_local {
268268
u32 bnx2x_igu_sb_id;
269269
u32 int_num;
270270
u32 last_status_idx;
271-
struct tasklet_struct cnic_irq_task;
271+
struct work_struct cnic_irq_bh_work;
272272

273273
struct kcqe *completed_kcq[MAX_COMPLETED_KCQE];
274274

drivers/scsi/bnx2fc/bnx2fc.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@
137137
#define BNX2FC_FW_TIMEOUT (3 * HZ)
138138
#define PORT_MAX 2
139139

140-
#define CMD_SCSI_STATUS(Cmnd) ((Cmnd)->SCp.Status)
141-
142140
/* FC FCP Status */
143141
#define FC_GOOD 0
144142

@@ -360,18 +358,12 @@ struct bnx2fc_rport {
360358
dma_addr_t lcq_dma;
361359
u32 lcq_mem_size;
362360

363-
void *ofld_req[4];
364-
dma_addr_t ofld_req_dma[4];
365-
void *enbl_req;
366-
dma_addr_t enbl_req_dma;
367-
368361
spinlock_t tgt_lock;
369362
spinlock_t cq_lock;
370363
atomic_t num_active_ios;
371364
u32 flush_in_prog;
372365
unsigned long timestamp;
373366
unsigned long retry_delay_timestamp;
374-
struct list_head free_task_list;
375367
struct bnx2fc_cmd *pending_queue[BNX2FC_SQ_WQES_MAX+1];
376368
struct list_head active_cmd_queue;
377369
struct list_head els_queue;
@@ -386,6 +378,7 @@ struct bnx2fc_rport {
386378
};
387379

388380
struct bnx2fc_mp_req {
381+
u64 tm_lun;
389382
u8 tm_flags;
390383

391384
u32 req_len;
@@ -493,7 +486,14 @@ struct bnx2fc_unsol_els {
493486
struct work_struct unsol_els_work;
494487
};
495488

489+
struct bnx2fc_priv {
490+
struct bnx2fc_cmd *io_req;
491+
};
496492

493+
static inline struct bnx2fc_priv *bnx2fc_priv(struct scsi_cmnd *cmd)
494+
{
495+
return scsi_cmd_priv(cmd);
496+
}
497497

498498
struct bnx2fc_cmd *bnx2fc_cmd_alloc(struct bnx2fc_rport *tgt);
499499
struct bnx2fc_cmd *bnx2fc_elstm_alloc(struct bnx2fc_rport *tgt, int type);

0 commit comments

Comments
 (0)