scsi: cxgb4i: assign rxqs in round robin mode
authorVarun Prakash <varun@chelsio.com>
Thu, 22 Jun 2017 10:17:49 +0000 (15:47 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 26 Jun 2017 19:01:02 +0000 (15:01 -0400)
Assign rxq to TCP connections in round robin mode to use all available
rxqs.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
drivers/scsi/cxgbi/libcxgbi.h

index 0aae094ab91c8543722fe93e0d8a9c96dd7b72aa..fa994713e718000723fc3971feffb6162425defd 100644 (file)
@@ -1606,6 +1606,7 @@ static int init_act_open(struct cxgbi_sock *csk)
        struct neighbour *n = NULL;
        void *daddr;
        unsigned int step;
+       unsigned int rxq_idx;
        unsigned int size, size6;
        unsigned int linkspeed;
        unsigned int rcv_winf, snd_winf;
@@ -1684,7 +1685,9 @@ static int init_act_open(struct cxgbi_sock *csk)
        step = lldi->ntxq / lldi->nchan;
        csk->txq_idx = cxgb4_port_idx(ndev) * step;
        step = lldi->nrxq / lldi->nchan;
-       csk->rss_qid = lldi->rxq_ids[cxgb4_port_idx(ndev) * step];
+       rxq_idx = (cxgb4_port_idx(ndev) * step) + (cdev->rxq_idx_cntr % step);
+       cdev->rxq_idx_cntr++;
+       csk->rss_qid = lldi->rxq_ids[rxq_idx];
        linkspeed = ((struct port_info *)netdev_priv(ndev))->link_cfg.speed;
        csk->snd_win = cxgb4i_snd_win;
        csk->rcv_win = cxgb4i_rcv_win;
index 37f07aaab1e463bc78a46e3f363365ed814ac491..31a5816c2e8defd5cbcfc620012a09bbcc8ab4a9 100644 (file)
@@ -477,6 +477,7 @@ struct cxgbi_device {
        unsigned int skb_rx_extra;      /* for msg coalesced mode */
        unsigned int tx_max_size;
        unsigned int rx_max_size;
+       unsigned int rxq_idx_cntr;
        struct cxgbi_ports_map pmap;
 
        void (*dev_ddp_cleanup)(struct cxgbi_device *);