[Skiboot] [PATCH] hw/phb4: Tune GPU direct performance on witherspoon in PCI mode

Frederic Barrat fbarrat at linux.ibm.com
Wed Mar 25 04:03:56 AEDT 2020



Le 24/03/2020 à 06:29, Andrew Donnellan a écrit :
> On 12/3/20 2:28 am, Frederic Barrat wrote:
>> -static void phb4_check_device_quirks(struct pci_device *dev)
>> +static void phb4_pec2_dma_engine_realloc(struct phb *phb)
>>   {
>> +    struct phb4 *p = phb_to_phb4(phb);
>> +    uint64_t reg;
>> +
>> +    /*
>> +     * Allocate 16 extra dma read engines to stack 0, to boost dma
>> +     * performance for devices on stack 0 of PEC2, i.e PHB3.  It
>> +     * comes at a price of reduced read engine allocation for
>> +     * devices on stack 1 and 2. The engine allocation becomes
>> +     * 48/8/8 instead of the default 32/16/16.
>> +     *
>> +     * The reallocation magic value should be 0xffff0000ff008000,
>> +     * but per the PCI designers, dma engine 32 (bit 0) has a
>> +     * quirk, and 0x7fff80007F008000 has the same effect (engine
>> +     * 32 goes to PHB4).
>> +     */
>> +    if (p->index != 3) /* shared slot on PEC2 */
>> +        return;
>> +
>> +    PHBINF(p, "Allocating extra dma read engines on PEC2 stack0\n");
>> +    reg = 0x7fff80007F008000ULL;
>> +    xscom_write(p->chip_id,
>> +            p->pci_xscom + XPEC_PCI_PRDSTKOVR, reg);
>> +    xscom_write(p->chip_id,
>> +            p->pe_xscom  + XPEC_NEST_READ_STACK_OVERRIDE, reg);
>> +}
> 
> Can we use this function in the CAPI enable path as well so as not to 
> duplicate?

Yes! The capi code actually becomes redundant, since the setup is now 
done at boot and we're just redoing the same thing when switching the 
PHB to capi mode. I'm going to keep the call for capi anyway, since it's 
really under control from the mlx5 driver and there's a (highly 
unexpected) possibility that mlx5 would activate it for another adapter 
type not listed in the PCI case.

   Fred




More information about the Skiboot mailing list