Skip to content

Commit

Permalink
phb4: Disable nodal scoped DMA accesses when PB pump mode is enabled
Browse files Browse the repository at this point in the history
By default when a PCIe device issues a read request via the PHB it is first
issued with nodal scope. When accessing GPU memory the NPU does not know at the
time of response if the requested memory page is off node or not. Therefore
every read of GPU memory by a PHB is retried with larger scope which introduces
bandwidth and latency issues.

On smaller boxes which have pump mode enabled nodal and group scoped reads are
treated the same and both types of request are broadcast to one chip. Therefore
we can avoid the retry by disabling nodal scope on the PHB for these boxes. On
larger boxes nodal (single chip) and group (multiple chip) scoped reads are
treated differently. Therefore we avoid disabling nodal scope on large boxes
which have pump mode disabled to avoid all PHB requests being broadcast to
multiple chips.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
apopple authored and stewartsmith committed Jul 18, 2018
1 parent b8702e2 commit 68518e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hw/phb4.c
Original file line number Diff line number Diff line change
Expand Up @@ -3983,6 +3983,17 @@ static int64_t enable_capi_mode(struct phb4 *p, uint64_t pe_number,
XPEC_NEST_PBCQ_HW_CONFIG_PBINIT,
XPEC_NEST_PBCQ_HW_CONFIG_PBINIT);

/* If pump mode is enabled don't do nodal broadcasts.
*/
xscom_read(p->chip_id, PB_CENT_HP_MODE_CURR, &reg);
if (reg & PB_CFG_PUMP_MODE) {
reg = XPEC_NEST_PBCQ_HW_CONFIG_DIS_NODAL;
reg |= XPEC_NEST_PBCQ_HW_CONFIG_DIS_RNNN;
xscom_write_mask(p->chip_id,
p->pe_xscom + XPEC_NEST_PBCQ_HW_CONFIG,
reg, reg);
}

/* PEC Phase 4 (PHB) registers adjustment
* Inbound CAPP traffic: The CAPI can send both CAPP packets and
* I/O packets. A PCIe packet is indentified as a CAPP packet in
Expand Down
2 changes: 2 additions & 0 deletions include/phb4-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@
#define XPEC_NEST_PBCQ_HW_CONFIG 0x0
#define XPEC_NEST_PBCQ_HW_CONFIG_PBINIT PPC_BIT(12)
#define XPEC_NEST_PBCQ_HW_CONFIG_CH_STR PPC_BIT(33)
#define XPEC_NEST_PBCQ_HW_CONFIG_DIS_NODAL PPC_BIT(50)
#define XPEC_NEST_PBCQ_HW_CONFIG_DIS_RNNN PPC_BIT(52)
#define XPEC_NEST_CAPP_CNTL 0x7

/* Nest base per-stack registers */
Expand Down

0 comments on commit 68518e5

Please sign in to comment.