From patchwork Thu Jun 22 10:17:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varun Prakash X-Patchwork-Id: 9803915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F4F2600C5 for ; Thu, 22 Jun 2017 10:18:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DF021FFCA for ; Thu, 22 Jun 2017 10:18:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62B39285FB; Thu, 22 Jun 2017 10:18:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52056285EF for ; Thu, 22 Jun 2017 10:18:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752916AbdFVKSN (ORCPT ); Thu, 22 Jun 2017 06:18:13 -0400 Received: from stargate.chelsio.com ([12.32.117.8]:41310 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753135AbdFVKSJ (ORCPT ); Thu, 22 Jun 2017 06:18:09 -0400 Received: from fcoe-test11.asicdesigners.com (fcoe-test11.blr.asicdesigners.com [10.193.185.180]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id v5MAI2rL025226; Thu, 22 Jun 2017 03:18:03 -0700 From: Varun Prakash To: martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, indranil@chelsio.com, varun@chelsio.com Subject: [PATCH] scsi: cxgb4i: assign rxqs in round robin mode Date: Thu, 22 Jun 2017 15:47:49 +0530 Message-Id: <1498126669-5654-1-git-send-email-varun@chelsio.com> X-Mailer: git-send-email 2.0.2 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Assign rxq to TCP connections in round robin mode to use all available rxqs. Signed-off-by: Varun Prakash --- drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 5 ++++- drivers/scsi/cxgbi/libcxgbi.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c index 0aae094..fa99471 100644 --- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c @@ -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; diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h index 37f07aa..31a5816 100644 --- a/drivers/scsi/cxgbi/libcxgbi.h +++ b/drivers/scsi/cxgbi/libcxgbi.h @@ -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 *);