From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016ce01.pphosted.com (mx0a-0016ce01.pphosted.com [67.231.148.157]) by dpdk.org (Postfix) with ESMTP id C5D045A31 for ; Sat, 7 May 2016 06:30:39 +0200 (CEST) Received: from pps.filterd (m0095336.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u474T2Hj018008 for ; Fri, 6 May 2016 21:30:39 -0700 Received: from avcashub1.qlogic.com ([198.186.0.117]) by mx0a-0016ce01.pphosted.com with ESMTP id 22s2eqgh85-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT) for ; Fri, 06 May 2016 21:30:38 -0700 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.192) with Microsoft SMTP Server id 14.3.235.1; Fri, 6 May 2016 21:30:38 -0700 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id u474UcKt022568; Fri, 6 May 2016 21:30:38 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@qlogic.com using -f From: Rasesh Mody To: CC: , Sony Chacko Date: Fri, 6 May 2016 21:30:15 -0700 Message-ID: <1462595421-22505-4-git-send-email-rasesh.mody@qlogic.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1462595421-22505-1-git-send-email-rasesh.mody@qlogic.com> References: <1462595421-22505-1-git-send-email-rasesh.mody@qlogic.com> MIME-Version: 1.0 Content-Type: text/plain disclaimer: bypass X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8157 signatures=670715 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1605070067 Subject: [dpdk-dev] [PATCH 3/9] qede: rss redirection table update X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 04:30:40 -0000 From: Sony Chacko Add support for reta_update. Signed-off-by: Sony Chacko --- doc/guides/nics/overview.rst | 2 +- drivers/net/qede/qede_ethdev.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst index e62d27b..41ab760 100644 --- a/doc/guides/nics/overview.rst +++ b/doc/guides/nics/overview.rst @@ -103,7 +103,7 @@ Most of these differences are summarized below. Multicast MAC filter Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y RSS hash Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y RSS key update Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y - RSS reta update Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y + RSS reta update Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y VMDq Y Y Y Y Y Y Y SR-IOV Y Y Y Y Y Y Y Y Y Y DCB Y Y Y Y Y diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 6614632..2b91e09 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -826,6 +826,40 @@ int qede_rss_hash_conf_get(struct rte_eth_dev *eth_dev, return 0; } +int qede_rss_reta_update(struct rte_eth_dev *eth_dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size) +{ + struct qed_update_vport_params vport_update_params; + struct qede_dev *qdev = eth_dev->data->dev_private; + struct ecore_dev *edev = &qdev->edev; + uint16_t i, idx, shift; + + if (reta_size > ETH_RSS_RETA_SIZE_128) { + DP_ERR(edev, "reta_size %d is not supported by hardware\n", + reta_size); + return -EINVAL; + } + + memset(&vport_update_params, 0, sizeof(vport_update_params)); + memcpy(&vport_update_params.rss_params, &qdev->rss_params, + sizeof(vport_update_params.rss_params)); + + for (i = 0; i < reta_size; i++) { + idx = i / RTE_RETA_GROUP_SIZE; + shift = i % RTE_RETA_GROUP_SIZE; + if (reta_conf[idx].mask & (1ULL << shift)) { + uint8_t entry = reta_conf[idx].reta[shift]; + qdev->rss_params.rss_ind_table[i] = entry; + } + } + + vport_update_params.update_rss_flg = 1; + vport_update_params.vport_id = 0; + + return qdev->ops->vport_update(edev, &vport_update_params); +} + static const struct eth_dev_ops qede_eth_dev_ops = { .dev_configure = qede_dev_configure, .dev_infos_get = qede_dev_info_get, @@ -855,6 +889,7 @@ static const struct eth_dev_ops qede_eth_dev_ops = { .dev_supported_ptypes_get = qede_dev_supported_ptypes_get, .rss_hash_update = qede_rss_hash_update, .rss_hash_conf_get = qede_rss_hash_conf_get, + .reta_update = qede_rss_reta_update, }; static const struct eth_dev_ops qede_eth_vf_dev_ops = { @@ -881,6 +916,7 @@ static const struct eth_dev_ops qede_eth_vf_dev_ops = { .dev_supported_ptypes_get = qede_dev_supported_ptypes_get, .rss_hash_update = qede_rss_hash_update, .rss_hash_conf_get = qede_rss_hash_conf_get, + .reta_update = qede_rss_reta_update, }; static void qede_update_pf_params(struct ecore_dev *edev) -- 1.7.10.3