chelsio/chtls: Utilizing multiple rxq/txq to process requests
authorVinay Kumar Yadav <vinay.yadav@chelsio.com>
Mon, 2 Nov 2020 16:28:33 +0000 (21:58 +0530)
committerJakub Kicinski <kuba@kernel.org>
Wed, 4 Nov 2020 01:54:23 +0000 (17:54 -0800)
patch adds a logic to utilize multiple queues to process requests.
The queue selection logic uses a round-robin distribution technique
using a counter.

Signed-off-by: Ayush Sawal <ayush.sawal@chelsio.com>
Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
Link: https://lore.kernel.org/r/20201102162832.22344-1-vinay.yadav@chelsio.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c

index 2d3dfdd2a7163a53cd04bcee536f45a3a1d9320a..e7b78b68eaac2f5f387d59958b0f43bfd2bf54a1 100644 (file)
@@ -235,6 +235,7 @@ struct chtls_dev {
        struct list_head na_node;
        unsigned int send_page_order;
        int max_host_sndbuf;
+       u32 round_robin_cnt;
        struct key_map kmap;
        unsigned int cdev_state;
 };
index d581c4e623f8a3bd2864fdb8a4d3beae19d76e2c..24154816d1d1a63e8b64211d85d98a9f7c76cab8 100644 (file)
@@ -1217,8 +1217,9 @@ static struct sock *chtls_recv_sock(struct sock *lsk,
        csk->sndbuf = csk->snd_win;
        csk->ulp_mode = ULP_MODE_TLS;
        step = cdev->lldi->nrxq / cdev->lldi->nchan;
-       csk->rss_qid = cdev->lldi->rxq_ids[port_id * step];
        rxq_idx = port_id * step;
+       rxq_idx += cdev->round_robin_cnt++ % step;
+       csk->rss_qid = cdev->lldi->rxq_ids[rxq_idx];
        csk->txq_idx = (rxq_idx < cdev->lldi->ntxq) ? rxq_idx :
                        port_id * step;
        csk->sndbuf = newsk->sk_sndbuf;