octeontx2-af: misc RPM fixes
cover octeontx2-af: misc RPM fixes
There are few issues with the RPM driver, such as FIFO overflow and network performance problems due to wrong FIFO values. This patchset adds fixes for the same.
Patch1: Fixes the mismatch between the lmac type reported by the driver
and the actual hardware configuration.
Patch2: Addresses low network performance observed even on RPMs with
larger FIFO lengths.
Patch 3 & 4: Fix the stale FEC counters reported by the driver by
accessing the correct CSRs
Patch 5: Resolves the issue related to RPM FIFO overflow during system
reboots
Hariprasad Kelam (5):
octeontx2-af: RPM: Fix mismatch in lmac type
octeontx2-af: RPM: Fix low network performance
octeontx2-af: RPM: fix stale RSFEC counters
octeontx2-af: RPM: fix stale FCFEC counters
octeontx2-af: Quiesce traffic before NIX block reset
.../net/ethernet/marvell/octeontx2/af/cgx.c | 70 ++++++++++++++- .../net/ethernet/marvell/octeontx2/af/cgx.h | 5 ++ .../marvell/octeontx2/af/lmac_common.h | 7 +- .../net/ethernet/marvell/octeontx2/af/rpm.c | 87 ++++++++++++++----- .../net/ethernet/marvell/octeontx2/af/rpm.h | 18 ++-- .../net/ethernet/marvell/octeontx2/af/rvu.c | 1 + .../net/ethernet/marvell/octeontx2/af/rvu.h | 1 + .../ethernet/marvell/octeontx2/af/rvu_cgx.c | 45 +++++++--- 8 files changed, 194 insertions(+), 40 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/5 octeontx2-af: RPM: Fix mismatch in lmac type
Due to a bug in the previous patch, there is a mismatch between the lmac type reported by the driver and the actual hardware configuration.
--- drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/rpm.c +1 -1
@@ -467,7 +467,7 @@ u8 rpm_get_lmac_type(void *rpmd, int lmac_id)int err; req =FIELD_SET (CMDREG_ID ,CGX_CMD_GET_LINK_STS , req); - err =cgx_fwi_cmd_generic (req, &resp, rpm,0 ); + err =cgx_fwi_cmd_generic (req, &resp, rpm, lmac_id);if (!err)return FIELD_GET (RESP_LINKSTAT_LMAC_TYPE , resp);return err;
Signature · 1 line
2.34.1
PATCH 2/5 octeontx2-af: RPM: Fix low network performance
In reply to Hariprasad KelamLow network performance is observed even on RPMs with larger FIFO lengths.
The cn10kb silicon has three RPM blocks with the following FIFO sizes:
--------------------
| RPM0 | 256KB |
| RPM1 | 256KB |
| RPM2 | 128KB |
--------------------The current design stores the FIFO length in a common structure for all RPMs (mac_ops). As a result, the FIFO length of the last RPM is applied to all RPMs, leading to reduced network performance.
This patch resolved the problem by storing the fifo length in per MAC structure (cgx).
--- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 9 +++++++-- drivers/net/ethernet/marvell/octeontx2/af/cgx.h | 1 + drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h | 5 ++++- drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 6 +++--- drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 9 ++++----- 5 files changed, 19 insertions(+), 11 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/cgx.c +7 -2
@@ -112,6 +112,11 @@ struct mac_ops *get_mac_ops(void *cgxd)return ((struct cgx *)cgxd)->mac_ops; } +u32 cgx_get_fifo_len (void *cgxd) +{ +return ((struct cgx *)cgxd)->fifo_len; +} +void cgx_write (struct cgx *cgx,u64 lmac,u64 offset,u64 val) { writeq(val, cgx->reg_base + (lmac << cgx->mac_ops->lmac_offset) +
@@ -501,7 +506,7 @@ static u32 cgx_get_lmac_fifo_len(void *cgxd, int lmac_id)u8 num_lmacs;u32 fifo_len; - fifo_len = cgx->mac_ops->fifo_len; + fifo_len = cgx->fifo_len; num_lmacs = cgx->mac_ops->get_nr_lmacs (cgx);switch (num_lmacs) {
@@ -1764,7 +1769,7 @@ static void cgx_populate_features(struct cgx *cgx)u64 cfg; cfg =cgx_read (cgx,0 ,CGX_CONST ); - cgx->mac_ops->fifo_len =FIELD_GET (CGX_CONST_RXFIFO_SIZE , cfg); + cgx->fifo_len =FIELD_GET (CGX_CONST_RXFIFO_SIZE , cfg); cgx->max_lmac_per_mac =FIELD_GET (CGX_CONST_MAX_LMACS , cfg);if (is_dev_rpm (cgx))
drivers/net/ethernet/marvell/octeontx2/af/cgx.h +1 -0
@@ -185,4 +185,5 @@ int cgx_lmac_get_pfc_frm_cfg(void *cgxd, int lmac_id, u8 *tx_pause,int verify_lmac_fc_cfg (void *cgxd,int lmac_id,u8 tx_pause,u8 rx_pause,int pfvf_idx);int cgx_lmac_reset (void *cgxd,int lmac_id,u8 pf_req_flr); +u32 cgx_get_fifo_len (void *cgxd);#endif /* CGX_H */
drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h +4 -1
@@ -72,7 +72,6 @@ struct mac_ops {u8 irq_offset;u8 int_ena_bit;u8 lmac_fwi; -u32 fifo_len;bool non_contiguous_serdes_lane;/* RPM & CGX differs in number of Receive/transmit stats */ u8 rx_stats_cnt;
@@ -142,6 +141,10 @@ struct cgx {u8 lmac_count;/* number of LMACs per MAC could be 4 or 8 */ u8 max_lmac_per_mac; +/* length of fifo varies depending on the number +* of LMACS +*/ +u32 fifo_len;#define MAX_LMAC_COUNT 8struct lmac *lmac_idmap[MAX_LMAC_COUNT ];struct work_struct cgx_cmd_work;
drivers/net/ethernet/marvell/octeontx2/af/rpm.c +3 -3
@@ -480,7 +480,7 @@ u32 rpm_get_lmac_fifo_len(void *rpmd, int lmac_id)u8 num_lmacs;u32 fifo_len; - fifo_len = rpm->mac_ops->fifo_len; + fifo_len = rpm->fifo_len; num_lmacs = rpm->mac_ops->get_nr_lmacs (rpm);switch (num_lmacs) {
@@ -533,9 +533,9 @@ u32 rpm2_get_lmac_fifo_len(void *rpmd, int lmac_id)*/ max_lmac = (rpm_read (rpm,0 ,CGX_CONST ) >>24 ) &0xFF ;if (max_lmac >4 ) - fifo_len = rpm->mac_ops->fifo_len /2 ; + fifo_len = rpm->fifo_len /2 ;else - fifo_len = rpm->mac_ops->fifo_len; + fifo_len = rpm->fifo_len;if (lmac_id <4 ) { num_lmacs =hweight8 (lmac_info &0xF );
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +4 -5
@@ -923,13 +923,12 @@ int rvu_mbox_handler_cgx_features_get(struct rvu *rvu,u32 rvu_cgx_get_fifolen (struct rvu *rvu) { -struct mac_ops *mac_ops; -u32 fifo_len; +void *cgxd =rvu_first_cgx_pdata (rvu); - mac_ops =get_mac_ops (rvu_first_cgx_pdata (rvu)); - fifo_len = mac_ops ? mac_ops->fifo_len :0 ; +if (!cgxd) +return 0 ; -return fifo_len; +return cgx_get_fifo_len (cgxd); }u32 rvu_cgx_get_lmac_fifolen (struct rvu *rvu,int cgx,int lmac)
Signature · 1 line
2.34.1
PATCH 3/5 octeontx2-af: RPM: fix stale RSFEC counters
In reply to Hariprasad KelamThe earlier patch sets the 'Stats control register' for RPM receive/transmit statistics instead of RSFEC statistics, causing the driver to return stale FEC counters.
--- drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 13 +++++++++---- drivers/net/ethernet/marvell/octeontx2/af/rpm.h | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rpm.c +9 -4
@@ -699,6 +699,10 @@ int rpm_get_fec_stats(void *rpmd, int lmac_id, struct cgx_fec_stats_rsp *rsp)if (rpm->lmac_idmap[lmac_id]->link_info.fec ==OTX2_FEC_NONE )return 0 ; +/* latched registers FCFECX_CW_HI/RSFEC_STAT_FAST_DATA_HI_CDC are common +* for all counters. Acquire lock to ensure serialized reads +*/ +mutex_lock (&rpm->lock);if (rpm->lmac_idmap[lmac_id]->link_info.fec ==OTX2_FEC_BASER ) { val_lo =rpm_read (rpm, lmac_id,RPMX_MTI_FCFECX_VL0_CCW_LO ); val_hi =rpm_read (rpm, lmac_id,RPMX_MTI_FCFECX_CW_HI );
@@ -725,20 +729,21 @@ int rpm_get_fec_stats(void *rpmd, int lmac_id, struct cgx_fec_stats_rsp *rsp) } }else {/* enable RS-FEC capture */ - cfg =rpm_read (rpm,0 ,RPMX_MTI_STAT_STATN_CONTROL ); + cfg =rpm_read (rpm,0 ,RPMX_MTI_RSFEC_STAT_STATN_CONTROL ); cfg |=RPMX_RSFEC_RX_CAPTURE |BIT (lmac_id); -rpm_write (rpm,0 ,RPMX_MTI_STAT_STATN_CONTROL , cfg); +rpm_write (rpm,0 ,RPMX_MTI_RSFEC_STAT_STATN_CONTROL , cfg); val_lo =rpm_read (rpm,0 ,RPMX_MTI_RSFEC_STAT_COUNTER_CAPTURE_2 ); - val_hi =rpm_read (rpm,0 ,RPMX_MTI_STAT_DATA_HI_CDC ); + val_hi =rpm_read (rpm,0 ,RPMX_MTI_RSFEC_STAT_FAST_DATA_HI_CDC ); rsp->fec_corr_blks = (val_hi <<32 | val_lo); val_lo =rpm_read (rpm,0 ,RPMX_MTI_RSFEC_STAT_COUNTER_CAPTURE_3 ); - val_hi =rpm_read (rpm,0 ,RPMX_MTI_STAT_DATA_HI_CDC ); + val_hi =rpm_read (rpm,0 ,RPMX_MTI_RSFEC_STAT_FAST_DATA_HI_CDC ); rsp->fec_uncorr_blks = (val_hi <<32 | val_lo); } +mutex_unlock (&rpm->lock);return 0 ; }
drivers/net/ethernet/marvell/octeontx2/af/rpm.h +3 -1
@@ -84,9 +84,11 @@/* FEC stats */ #define RPMX_MTI_STAT_STATN_CONTROL 0x10018#define RPMX_MTI_STAT_DATA_HI_CDC 0x10038 -#define RPMX_RSFEC_RX_CAPTURE BIT_ULL(27) +#define RPMX_RSFEC_RX_CAPTURE BIT_ULL(28)#define RPMX_CMD_CLEAR_RX BIT_ULL(30)#define RPMX_CMD_CLEAR_TX BIT_ULL(31) +#define RPMX_MTI_RSFEC_STAT_STATN_CONTROL 0x40018 +#define RPMX_MTI_RSFEC_STAT_FAST_DATA_HI_CDC 0x40000#define RPMX_MTI_RSFEC_STAT_COUNTER_CAPTURE_2 0x40050#define RPMX_MTI_RSFEC_STAT_COUNTER_CAPTURE_3 0x40058#define RPMX_MTI_FCFECX_VL0_CCW_LO 0x38618
Signature · 1 line
2.34.1
PATCH 4/5 octeontx2-af: RPM: fix stale FCFEC counters
In reply to Hariprasad KelamThe corrected words register(FCFECX_VL0_CCW_LO)/Uncorrected words register (FCFECX_VL0_NCCW_LO) of FCFEC counter has different LMAC offset which needs to be accessed differently.
--- .../net/ethernet/marvell/octeontx2/af/rpm.c | 24 +++++++++---------- .../net/ethernet/marvell/octeontx2/af/rpm.h | 10 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rpm.c +12 -12
@@ -704,27 +704,27 @@ int rpm_get_fec_stats(void *rpmd, int lmac_id, struct cgx_fec_stats_rsp *rsp)*/ mutex_lock (&rpm->lock);if (rpm->lmac_idmap[lmac_id]->link_info.fec ==OTX2_FEC_BASER ) { - val_lo =rpm_read (rpm, lmac_id,RPMX_MTI_FCFECX_VL0_CCW_LO ); - val_hi =rpm_read (rpm, lmac_id,RPMX_MTI_FCFECX_CW_HI ); + val_lo =rpm_read (rpm,0 ,RPMX_MTI_FCFECX_VL0_CCW_LO (lmac_id)); + val_hi =rpm_read (rpm,0 ,RPMX_MTI_FCFECX_CW_HI (lmac_id)); rsp->fec_corr_blks = (val_hi <<16 | val_lo); - val_lo =rpm_read (rpm, lmac_id,RPMX_MTI_FCFECX_VL0_NCCW_LO ); - val_hi =rpm_read (rpm, lmac_id,RPMX_MTI_FCFECX_CW_HI ); + val_lo =rpm_read (rpm,0 ,RPMX_MTI_FCFECX_VL0_NCCW_LO (lmac_id)); + val_hi =rpm_read (rpm,0 ,RPMX_MTI_FCFECX_CW_HI (lmac_id)); rsp->fec_uncorr_blks = (val_hi <<16 | val_lo);/* 50G uses 2 Physical serdes lines */ if (rpm->lmac_idmap[lmac_id]->link_info.lmac_type_id ==LMAC_MODE_50G_R ) { - val_lo =rpm_read (rpm, lmac_id, -RPMX_MTI_FCFECX_VL1_CCW_LO ); - val_hi =rpm_read (rpm, lmac_id, -RPMX_MTI_FCFECX_CW_HI ); + val_lo =rpm_read (rpm,0 , +RPMX_MTI_FCFECX_VL1_CCW_LO (lmac_id)); + val_hi =rpm_read (rpm,0 , +RPMX_MTI_FCFECX_CW_HI (lmac_id)); rsp->fec_corr_blks += (val_hi <<16 | val_lo); - val_lo =rpm_read (rpm, lmac_id, -RPMX_MTI_FCFECX_VL1_NCCW_LO ); - val_hi =rpm_read (rpm, lmac_id, -RPMX_MTI_FCFECX_CW_HI ); + val_lo =rpm_read (rpm,0 , +RPMX_MTI_FCFECX_VL1_NCCW_LO (lmac_id)); + val_hi =rpm_read (rpm,0 , +RPMX_MTI_FCFECX_CW_HI (lmac_id)); rsp->fec_uncorr_blks += (val_hi <<16 | val_lo); } }else {
drivers/net/ethernet/marvell/octeontx2/af/rpm.h +5 -5
@@ -91,11 +91,11 @@#define RPMX_MTI_RSFEC_STAT_FAST_DATA_HI_CDC 0x40000#define RPMX_MTI_RSFEC_STAT_COUNTER_CAPTURE_2 0x40050#define RPMX_MTI_RSFEC_STAT_COUNTER_CAPTURE_3 0x40058 -#define RPMX_MTI_FCFECX_VL0_CCW_LO 0x38618 -#define RPMX_MTI_FCFECX_VL0_NCCW_LO 0x38620 -#define RPMX_MTI_FCFECX_VL1_CCW_LO 0x38628 -#define RPMX_MTI_FCFECX_VL1_NCCW_LO 0x38630 -#define RPMX_MTI_FCFECX_CW_HI 0x38638 +#define RPMX_MTI_FCFECX_VL0_CCW_LO (a) (0x38618 + ((a) * 0x40)) +#define RPMX_MTI_FCFECX_VL0_NCCW_LO (a) (0x38620 + ((a) * 0x40)) +#define RPMX_MTI_FCFECX_VL1_CCW_LO (a) (0x38628 + ((a) * 0x40)) +#define RPMX_MTI_FCFECX_VL1_NCCW_LO (a) (0x38630 + ((a) * 0x40)) +#define RPMX_MTI_FCFECX_CW_HI (a) (0x38638 + ((a) * 0x40))/* CN10KB CSR Declaration */ #define RPM2_CMRX_SW_INT 0x1b0
Signature · 1 line
2.34.1
PATCH 5/5 octeontx2-af: Quiesce traffic before NIX block reset
In reply to Hariprasad KelamDuring initialization, the AF driver resets all blocks. The RPM (MAC) block and NIX block operate on a credit-based model. When the NIX block resets during active traffic flow, it doesn't release credits to the RPM block. This causes the RPM FIFO to overflow, leading to receive traffic struck.
To address this issue, the patch introduces the following changes:
1. Stop receiving traffic at the MAC level during AF driver initialization.
2. Perform an X2P reset (prevents RXFIFO of all LMACS from pushing data)
3. Reset the NIX block.
4. Clear the X2P reset and re-enable receiving traffic.
--- .../net/ethernet/marvell/octeontx2/af/cgx.c | 61 +++++++++++++++++++ .../net/ethernet/marvell/octeontx2/af/cgx.h | 4 ++ .../marvell/octeontx2/af/lmac_common.h | 2 + .../net/ethernet/marvell/octeontx2/af/rpm.c | 42 +++++++++++++ .../net/ethernet/marvell/octeontx2/af/rpm.h | 4 ++ .../net/ethernet/marvell/octeontx2/af/rvu.c | 1 + .../net/ethernet/marvell/octeontx2/af/rvu.h | 1 + .../ethernet/marvell/octeontx2/af/rvu_cgx.c | 36 +++++++++-- 8 files changed, 145 insertions(+), 6 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/cgx.c +61 -0
@@ -214,6 +214,24 @@ u8 cgx_lmac_get_p2x(int cgx_id, int lmac_id)return (cfg &CMR_P2X_SEL_MASK ) >>CMR_P2X_SEL_SHIFT ; } +static u8 cgx_get_nix_resetbit (struct cgx *cgx) +{ +int first_lmac; +u8 p2x; + +/* non 98XX silicons supports only NIX0 block */ +if (cgx->pdev->subsystem_device !=PCI_SUBSYS_DEVID_98XX ) +return CGX_NIX0_RESET ; + + first_lmac =find_first_bit (&cgx->lmac_bmap, cgx->max_lmac_per_mac); + p2x =cgx_lmac_get_p2x (cgx->cgx_id, first_lmac); + +if (p2x ==CMR_P2X_SEL_NIX1 ) +return CGX_NIX1_RESET ; +else +return CGX_NIX0_RESET ; +} +/* Ensure the required lock for event queue(where asynchronous events are * posted) is acquired before calling this API. Else an asynchronous event(with * latest link status) can reach the destination before this function returns
@@ -1724,6 +1742,8 @@ static int cgx_lmac_init(struct cgx *cgx) lmac->lmac_type = cgx->mac_ops->get_lmac_type (cgx, lmac->lmac_id); } +/* Start X2P reset on given MAC block */ + cgx->mac_ops->mac_x2p_reset (cgx, true);return cgx_lmac_verify_fwi_version (cgx); err_bitmap_free:
@@ -1789,6 +1809,45 @@ static u8 cgx_get_rxid_mapoffset(struct cgx *cgx)return 0x60 ; } +static void cgx_x2p_reset (void *cgxd,bool enable) +{ +struct cgx *cgx = cgxd; +int lmac_id; +u64 cfg; + +if (enable) { +for_each_set_bit (lmac_id, &cgx->lmac_bmap, cgx->max_lmac_per_mac) + cgx->mac_ops->mac_enadis_rx (cgx, lmac_id, false); + +usleep_range (1000 ,2000 ); + + cfg =cgx_read (cgx,0 ,CGXX_CMR_GLOBAL_CONFIG ); + cfg |=cgx_get_nix_resetbit (cgx) |CGX_NSCI_DROP ; +cgx_write (cgx,0 ,CGXX_CMR_GLOBAL_CONFIG , cfg); + }else { + cfg =cgx_read (cgx,0 ,CGXX_CMR_GLOBAL_CONFIG ); + cfg &= ~(cgx_get_nix_resetbit (cgx) |CGX_NSCI_DROP ); +cgx_write (cgx,0 ,CGXX_CMR_GLOBAL_CONFIG , cfg); + } +} + +static int cgx_enadis_rx (void *cgxd,int lmac_id,bool enable) +{ +struct cgx *cgx = cgxd; +u64 cfg; + +if (!is_lmac_valid (cgx, lmac_id)) +return -ENODEV ; + + cfg =cgx_read (cgx, lmac_id,CGXX_CMRX_CFG ); +if (enable) + cfg |=DATA_PKT_RX_EN ; +else + cfg &= ~DATA_PKT_RX_EN ; +cgx_write (cgx, lmac_id,CGXX_CMRX_CFG , cfg); +return 0 ; +} +static struct mac_ops cgx_mac_ops = { .name ="cgx" , .csr_offset =0 ,
@@ -1820,6 +1879,8 @@ static struct mac_ops cgx_mac_ops = { .mac_get_pfc_frm_cfg = cgx_lmac_get_pfc_frm_cfg, .mac_reset = cgx_lmac_reset, .mac_stats_reset = cgx_stats_reset, + .mac_x2p_reset = cgx_x2p_reset, + .mac_enadis_rx = cgx_enadis_rx, };static int cgx_probe (struct pci_dev *pdev,const struct pci_device_id *id)
drivers/net/ethernet/marvell/octeontx2/af/cgx.h +4 -0
@@ -32,6 +32,10 @@#define CGX_LMAC_TYPE_MASK 0xF#define CGXX_CMRX_INT 0x040#define FW_CGX_INT BIT_ULL(1) +#define CGXX_CMR_GLOBAL_CONFIG 0x08 +#define CGX_NIX0_RESET BIT_ULL(2) +#define CGX_NIX1_RESET BIT_ULL(3) +#define CGX_NSCI_DROP BIT_ULL(9)#define CGXX_CMRX_INT_ENA_W1S 0x058#define CGXX_CMRX_RX_ID_MAP 0x060#define CGXX_CMRX_RX_STAT0 0x070
drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h +2 -0
@@ -132,6 +132,8 @@ struct mac_ops {int (*get_fec_stats)(void *cgxd,int lmac_id,struct cgx_fec_stats_rsp *rsp);int (*mac_stats_reset)(void *cgxd,int lmac_id); +void (*mac_x2p_reset)(void *cgxd,bool enable); +int (*mac_enadis_rx)(void *cgxd,int lmac_id,bool enable); };struct cgx {
drivers/net/ethernet/marvell/octeontx2/af/rpm.c +42 -0
57 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rpm.h +4 -0
@@ -17,6 +17,8 @@/* Registers */ #define RPMX_CMRX_CFG 0x00 +#define RPMX_CMR_GLOBAL_CFG 0x08 +#define RPM_NIX0_RESET BIT_ULL(3)#define RPMX_RX_TS_PREPEND BIT_ULL(22)#define RPMX_TX_PTP_1S_SUPPORT BIT_ULL(17)#define RPMX_CMRX_RX_ID_MAP 0x80
@@ -139,4 +141,6 @@ bool is_dev_rpm2(void *rpmd);int rpm_get_fec_stats (void *cgxd,int lmac_id,struct cgx_fec_stats_rsp *rsp);int rpm_lmac_reset (void *rpmd,int lmac_id,u8 pf_req_flr);int rpm_stats_reset (void *rpmd,int lmac_id); +void rpm_x2p_reset (void *rpmd,bool enable); +int rpm_enadis_rx (void *rpmd,int lmac_id,bool enable);#endif /* RPM_H */
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +1 -0
@@ -1162,6 +1162,7 @@ static int rvu_setup_hw_resources(struct rvu *rvu) }rvu_program_channels (rvu); +cgx_start_linkup (rvu); err =rvu_mcs_init (rvu);if (err) {
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +1 -0
@@ -1025,6 +1025,7 @@ int rvu_cgx_prio_flow_ctrl_cfg(struct rvu *rvu, u16 pcifunc, u8 tx_pause, u8 rx_int rvu_cgx_cfg_pause_frm (struct rvu *rvu,u16 pcifunc,u8 tx_pause,u8 rx_pause);void rvu_mac_reset (struct rvu *rvu,u16 pcifunc);u32 rvu_cgx_get_lmac_fifolen (struct rvu *rvu,int cgx,int lmac); +void cgx_start_linkup (struct rvu *rvu);int npc_get_nixlf_mcam_index (struct npc_mcam *mcam,u16 pcifunc,int nixlf,int type); bool is_mcam_entry_enabled(struct rvu *rvu, struct npc_mcam *mcam, int blkaddr,
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +30 -6
@@ -349,6 +349,7 @@ static void rvu_cgx_wq_destroy(struct rvu *rvu)int rvu_cgx_init (struct rvu *rvu) { +struct mac_ops *mac_ops;int cgx, err;void *cgxd;
@@ -375,6 +376,15 @@ int rvu_cgx_init(struct rvu *rvu)if (err)return err; +/* Clear X2P reset on all MAC blocks */ +for (cgx =0 ; cgx < rvu->cgx_cnt_max; cgx++) { + cgxd =rvu_cgx_pdata (cgx, rvu); +if (!cgxd) +continue ; + mac_ops =get_mac_ops (cgxd); + mac_ops->mac_x2p_reset (cgxd, false); + } +/* Register for CGX events */ err =cgx_lmac_event_handler_init (rvu);if (err)
@@ -382,10 +392,26 @@ int rvu_cgx_init(struct rvu *rvu)mutex_init (&rvu->cgx_cfg_lock); -/* Ensure event handler registration is completed, before -* we turn on the links -*/ -mb (); +return 0 ; +} + +void cgx_start_linkup (struct rvu *rvu) +{ +unsigned long lmac_bmap; +struct mac_ops *mac_ops; +int cgx, lmac, err; +void *cgxd; + +/* Enable receive on all LMACS */ +for (cgx =0 ; cgx <= rvu->cgx_cnt_max; cgx++) { + cgxd =rvu_cgx_pdata (cgx, rvu); +if (!cgxd) +continue ; + mac_ops =get_mac_ops (cgxd); + lmac_bmap =cgx_get_lmac_bmap (cgxd); +for_each_set_bit (lmac, &lmac_bmap, rvu->hw->lmac_per_cgx) + mac_ops->mac_enadis_rx (cgxd, lmac, true); + }/* Do link up for all CGX ports */ for (cgx =0 ; cgx <= rvu->cgx_cnt_max; cgx++) {
@@ -398,8 +424,6 @@ int rvu_cgx_init(struct rvu *rvu)"Link up process failed to start on cgx %d\n" , cgx); } - -return 0 ; }int rvu_cgx_exit (struct rvu *rvu)
Signature · 1 line
2.34.1
This series was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 9 lines · On Fri, 22 Nov 2024 21:50:30 +0530 you wrote:
There are few issues with the RPM driver, such as FIFO overflow and network performance problems due to wrong FIFO values. This patchset adds fixes for the same.
Patch1: Fixes the mismatch between the lmac type reported by the driver
and the actual hardware configuration.[...]
Here is the summary with links:
- [net,1/5] octeontx2-af: RPM: Fix mismatch in lmac type
https://git.kernel.org/netdev/net/c/7ebbbb23ea5b - [net,2/5] octeontx2-af: RPM: Fix low network performance https://git.kernel.org/netdev/net/c/d1e8884e050c - [net,3/5] octeontx2-af: RPM: fix stale RSFEC counters https://git.kernel.org/netdev/net/c/07cd1eb166a3 - [net,4/5] octeontx2-af: RPM: fix stale FCFEC counters https://git.kernel.org/netdev/net/c/6fc216410846 - [net,5/5] octeontx2-af: Quiesce traffic before NIX block reset https://git.kernel.org/netdev/net/c/762ca6eed026
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html