Skip to content

Commit 73e6ffa

Browse files
Vimlesh KumarPaolo Abeni
authored andcommitted
octeon_ep: disable per ring interrupts
Disable the MSI-X per ring interrupt for every PF ring when PF netdev goes down. Fixes: 1f2c2d0 ("octeon_ep: add hardware configuration APIs") Signed-off-by: Sathesh Edara <sedara@marvell.com> Signed-off-by: Shinas Rasheed <srasheed@marvell.com> Signed-off-by: Vimlesh Kumar <vimleshk@marvell.com> Link: https://patch.msgid.link/20260206111510.1045092-2-vimleshk@marvell.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 36bd7d5 commit 73e6ffa

4 files changed

Lines changed: 32 additions & 6 deletions

File tree

drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,14 +696,26 @@ static void octep_enable_interrupts_cn93_pf(struct octep_device *oct)
696696
/* Disable all interrupts */
697697
static void octep_disable_interrupts_cn93_pf(struct octep_device *oct)
698698
{
699-
u64 intr_mask = 0ULL;
699+
u64 reg_val, intr_mask = 0ULL;
700700
int srn, num_rings, i;
701701

702702
srn = CFG_GET_PORTS_PF_SRN(oct->conf);
703703
num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
704704

705-
for (i = 0; i < num_rings; i++)
706-
intr_mask |= (0x1ULL << (srn + i));
705+
for (i = 0; i < num_rings; i++) {
706+
intr_mask |= BIT_ULL(srn + i);
707+
reg_val = octep_read_csr64(oct,
708+
CN93_SDP_R_IN_INT_LEVELS(srn + i));
709+
reg_val &= ~CN93_INT_ENA_BIT;
710+
octep_write_csr64(oct,
711+
CN93_SDP_R_IN_INT_LEVELS(srn + i), reg_val);
712+
713+
reg_val = octep_read_csr64(oct,
714+
CN93_SDP_R_OUT_INT_LEVELS(srn + i));
715+
reg_val &= ~CN93_INT_ENA_BIT;
716+
octep_write_csr64(oct,
717+
CN93_SDP_R_OUT_INT_LEVELS(srn + i), reg_val);
718+
}
707719

708720
octep_write_csr64(oct, CN93_SDP_EPF_IRERR_RINT_ENA_W1C, intr_mask);
709721
octep_write_csr64(oct, CN93_SDP_EPF_ORERR_RINT_ENA_W1C, intr_mask);

drivers/net/ethernet/marvell/octeon_ep/octep_cnxk_pf.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,14 +720,26 @@ static void octep_enable_interrupts_cnxk_pf(struct octep_device *oct)
720720
/* Disable all interrupts */
721721
static void octep_disable_interrupts_cnxk_pf(struct octep_device *oct)
722722
{
723-
u64 intr_mask = 0ULL;
723+
u64 reg_val, intr_mask = 0ULL;
724724
int srn, num_rings, i;
725725

726726
srn = CFG_GET_PORTS_PF_SRN(oct->conf);
727727
num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
728728

729-
for (i = 0; i < num_rings; i++)
730-
intr_mask |= (0x1ULL << (srn + i));
729+
for (i = 0; i < num_rings; i++) {
730+
intr_mask |= BIT_ULL(srn + i);
731+
reg_val = octep_read_csr64(oct,
732+
CNXK_SDP_R_IN_INT_LEVELS(srn + i));
733+
reg_val &= ~CNXK_INT_ENA_BIT;
734+
octep_write_csr64(oct,
735+
CNXK_SDP_R_IN_INT_LEVELS(srn + i), reg_val);
736+
737+
reg_val = octep_read_csr64(oct,
738+
CNXK_SDP_R_OUT_INT_LEVELS(srn + i));
739+
reg_val &= ~CNXK_INT_ENA_BIT;
740+
octep_write_csr64(oct,
741+
CNXK_SDP_R_OUT_INT_LEVELS(srn + i), reg_val);
742+
}
731743

732744
octep_write_csr64(oct, CNXK_SDP_EPF_IRERR_RINT_ENA_W1C, intr_mask);
733745
octep_write_csr64(oct, CNXK_SDP_EPF_ORERR_RINT_ENA_W1C, intr_mask);

drivers/net/ethernet/marvell/octeon_ep/octep_regs_cn9k_pf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,5 +386,6 @@
386386
#define CN93_PEM_BAR4_INDEX 7
387387
#define CN93_PEM_BAR4_INDEX_SIZE 0x400000ULL
388388
#define CN93_PEM_BAR4_INDEX_OFFSET (CN93_PEM_BAR4_INDEX * CN93_PEM_BAR4_INDEX_SIZE)
389+
#define CN93_INT_ENA_BIT BIT_ULL(62)
389390

390391
#endif /* _OCTEP_REGS_CN9K_PF_H_ */

drivers/net/ethernet/marvell/octeon_ep/octep_regs_cnxk_pf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,5 +412,6 @@
412412
#define CNXK_PEM_BAR4_INDEX 7
413413
#define CNXK_PEM_BAR4_INDEX_SIZE 0x400000ULL
414414
#define CNXK_PEM_BAR4_INDEX_OFFSET (CNXK_PEM_BAR4_INDEX * CNXK_PEM_BAR4_INDEX_SIZE)
415+
#define CNXK_INT_ENA_BIT BIT_ULL(62)
415416

416417
#endif /* _OCTEP_REGS_CNXK_PF_H_ */

0 commit comments

Comments
 (0)