Here is fresh results;
a bit performance gain achieved. But strangely QAT is better now.

- with CCR - 2.14 Gbps
  PID USERNAME    PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
   15 root        -16    -     0B    16K CPU7     7   0:11 100.00% [crypto
returns 9]
   11 root        -92    -     0B  1120K CPU4     4   0:10  98.74%
[intr{irq295: t6nex0:0a0}]
   14 root        -16    -     0B    16K CPU11   11   0:09  95.32% [crypto
returns 8]
   11 root        -92    -     0B  1120K CPU8     8   0:07  63.49%
[intr{irq297: t6nex0:0a2}]
   11 root        -92    -     0B  1120K WAIT    12   0:05  42.73%
[intr{irq307: t6nex0:1a2}]
   16 root        -16    -     0B    16K CPU15   15   0:04  33.82% [crypto
returns 10]
   13 root        -16    -     0B    16K RUN      3   0:02  21.78% [crypto
returns 7]
 4317 root         22    0    23M  4348K sbwait  14   0:01   7.24% iperf -B
172.16.70.6 -c 172.16.68.1 -P 2 -t 20{iperf}
 4329 root         23    0    23M  4348K sbwait  14   0:01   7.18% iperf -B
172.16.70.10 -c 172.16.68.1 -P 2 -t 20{iperf}
...
   11 root        -92    -     0B  1120K WAIT     3   0:00   0.31%
[intr{irq294: t6nex0:evt}]
    0 root        -92    -     0B  2144K -       14   0:00   0.30%
[kernel{t6nex0 tq0}]
...


- with QAT - 2.63 Gbps
 PID USERNAME    PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
    8 root        -16    -     0B    16K CPU7     7   0:31  92.05% [crypto
returns 5]
    7 root        -16    -     0B    16K CPU0     0   0:29  86.03% [crypto
returns 4]
    9 root        -16    -     0B    16K RUN     15   0:15  43.32% [crypto
returns 6]
   11 root        -92    -     0B  1664K RUN      4   0:15  43.03%
[intr{irq297: t6nex0:0a2}]
    6 root        -16    -     0B    16K crypto   4   0:09  26.01% [crypto
returns 3]
   11 root        -92    -     0B  1664K WAIT    12   0:07  19.88%
[intr{irq307: t6nex0:1a2}]
   11 root        -92    -     0B  1664K WAIT     8   0:02   7.22%
[intr{irq368: qat1}]
 4313 root         22    0    23M  4348K sbwait   2   0:01   6.51% iperf -B
172.16.70.8 -c 172.16.68.1 -P 2 -t 20{iperf}
 4316 root         22    0    23M  4348K sbwait   3   0:01   6.18% iperf -B
172.16.70.9 -c 172.16.68.1 -P 2 -t 20{iperf}
...
   11 root        -92    -     0B  1664K WAIT    12   0:02   4.52%
[intr{irq355: qat0}]
...
   11 root        -92    -     0B  1664K WAIT    12   0:01   1.89%
[intr{irq372: qat1}]
   11 root        -92    -     0B  1664K WAIT     0   0:00   1.12%
[intr{irq360: qat1}]
   11 root        -92    -     0B  1664K WAIT     2   0:00   1.11%
[intr{irq362: qat1}]
   11 root        -92    -     0B  1664K WAIT    14   0:00   1.10%
[intr{irq374: qat1}]
   11 root        -92    -     0B  1664K WAIT     4   0:00   1.10%
[intr{irq364: qat1}]
   11 root        -92    -     0B  1664K WAIT    10   0:00   1.10%
[intr{irq370: qat1}]
   11 root        -92    -     0B  1664K WAIT     7   0:00   1.09%
[intr{irq367: qat1}]
   11 root        -92    -     0B  1664K WAIT    11   0:00   1.07%
[intr{irq371: qat1}]
   11 root        -92    -     0B  1664K WAIT     5   0:00   1.04%
[intr{irq365: qat1}]
   11 root        -92    -     0B  1664K WAIT    15   0:00   1.04%
[intr{irq375: qat1}]
   11 root        -92    -     0B  1664K WAIT     1   0:00   1.04%
[intr{irq361: qat1}]
   11 root        -92    -     0B  1664K WAIT     6   0:00   1.03%
[intr{irq366: qat1}]

On Sat, May 1, 2021 at 12:45 AM Mark Johnston <ma...@freebsd.org> wrote:

> On Sat, May 01, 2021 at 12:31:57AM +0300, Özkan KIRIK wrote:
> > Hello again,
> >
> > patch is applied, now netisr is not eating CPU. but performance drops
> > around 0.2Gbps according to previous kernel.
> >
> > I tried also both net.isr.maxthreads=1 and net.isr.maxthreads=4 . results
> > are same
> >
> > Results are:
> >
> > - with CCR - 1.8Gbps
> > top:
> >   PID USERNAME    PRI NICE   SIZE    RES STATE    C   TIME    WCPU
> COMMAND
> >    14 root        -16    -     0B    16K CPU5     5   1:38 100.00%
> [crypto
> > returns 8]
> >     3 root        -16    -     0B    16K CPU1     1   0:58  77.83%
> [crypto
> > returns 0]
>
> Could you also try this patch?  It won't help with aesni.
>
> diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
> index dfd22662e87f..bc23056e86ad 100644
> --- a/sys/opencrypto/crypto.c
> +++ b/sys/opencrypto/crypto.c
> @@ -94,6 +94,7 @@ struct crypto_session {
>         void *softc;
>         uint32_t hid;
>         uint32_t capabilities;
> +       uint64_t id;
>  };
>
>  SDT_PROVIDER_DEFINE(opencrypto);
> @@ -572,6 +573,7 @@ crypto_select_driver(const struct cryptoini *cri, int
> flags)
>  int
>  crypto_newsession(crypto_session_t *cses, struct cryptoini *cri, int crid)
>  {
> +       static uint64_t sessid = 0;
>         crypto_session_t res;
>         void *softc_mem;
>         struct cryptocap *cap;
> @@ -616,6 +618,7 @@ crypto_newsession(crypto_session_t *cses, struct
> cryptoini *cri, int crid)
>         softc_mem = malloc(softc_size, M_CRYPTO_DATA, M_WAITOK | M_ZERO);
>         res = uma_zalloc(cryptoses_zone, M_WAITOK | M_ZERO);
>         res->softc = softc_mem;
> +       res->id = atomic_fetchadd_64(&sessid, 1);
>
>         CRYPTO_DRIVER_LOCK();
>         cap = crypto_checkdriver(hid);
> @@ -1016,7 +1019,7 @@ crypto_dispatch(struct cryptop *crp)
>                 binuptime(&crp->crp_tstamp);
>  #endif
>
> -       crp->crp_retw_id = ((uintptr_t)crp->crp_session) %
> crypto_workers_num;
> +       crp->crp_retw_id = crp->crp_session->id % crypto_workers_num;
>
>         if (CRYPTOP_ASYNC(crp)) {
>                 if (crp->crp_flags & CRYPTO_F_ASYNC_KEEPORDER) {
>
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to