powerpc/vas: Do not use default credits for receive window
authorHaren Myneni <haren@linux.ibm.com>
Thu, 16 Apr 2020 06:05:36 +0000 (23:05 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 20 Apr 2020 06:53:01 +0000 (16:53 +1000)
System checkstops if RxFIFO overruns with more requests than the
maximum possible number of CRBs allowed in FIFO at any time. So
max credits value (rxattr.wcreds_max) is set and is passed to
vas_rx_win_open() by the the driver.

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1587017136.2275.1070.camel@hbabu-laptop
arch/powerpc/platforms/powernv/vas-window.c
arch/powerpc/platforms/powernv/vas.h

index 3ef71209ff58df5171d1b1ddbee8733aad003360..4b5adf5218825ff035611c0c195a132a32bbd556 100644 (file)
@@ -772,7 +772,7 @@ static bool rx_win_args_valid(enum vas_cop_type cop,
        if (attr->rx_fifo_size > VAS_RX_FIFO_SIZE_MAX)
                return false;
 
-       if (attr->wcreds_max > VAS_RX_WCREDS_MAX)
+       if (!attr->wcreds_max)
                return false;
 
        if (attr->nx_win) {
@@ -877,7 +877,7 @@ struct vas_window *vas_rx_win_open(int vasid, enum vas_cop_type cop,
        rxwin->nx_win = rxattr->nx_win;
        rxwin->user_win = rxattr->user_win;
        rxwin->cop = cop;
-       rxwin->wcreds_max = rxattr->wcreds_max ?: VAS_WCREDS_DEFAULT;
+       rxwin->wcreds_max = rxattr->wcreds_max;
 
        init_winctx_for_rxwin(rxwin, rxattr, &winctx);
        init_winctx_regs(rxwin, &winctx);
index 60bdda663750b41938bfe511c096a3aab220ea0d..a7143b16232f4f490b28d81f9d650b8eac6f98de 100644 (file)
 /*
  * Initial per-process credits.
  * Max send window credits:    4K-1 (12-bits in VAS_TX_WCRED)
- * Max receive window credits: 64K-1 (16 bits in VAS_LRX_WCRED)
  *
  * TODO: Needs tuning for per-process credits
  */
-#define VAS_RX_WCREDS_MAX              ((64 << 10) - 1)
 #define VAS_TX_WCREDS_MAX              ((4 << 10) - 1)
 #define VAS_WCREDS_DEFAULT             (1 << 10)