From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E7B04A04B3; Mon, 16 Dec 2019 06:37:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 204721C0AA; Mon, 16 Dec 2019 06:37:46 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id EF8D41C08E for ; Mon, 16 Dec 2019 06:37:44 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBG5aaO7011541; Sun, 15 Dec 2019 21:37:44 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=j8cvbRu/N3KXWS94b3WsEh7maRyhPTX7I7vD9vOaDWk=; b=yUNOpmgoPpeyLzrATb9nIE2cds4CT5pxG1GdY0fHvmoufjnJj3seq7VGlr5Ly3E7S+z0 xo+WpDUwcjWdo7FGegm3tVTgBnLd+vniJ6stYJCwKaXDKboX17v0ixsm4OLELB4itGWu 4fW9MEGoV0k3d9STYmoJ1h3hDss/5aIsK5HzXEoGXM2Fwn1DoPBCwDvyFoHdudrCoHIQ sXRCJN1OVne3ux2UHElOHaz1PxKl0i0SVKBqTRge0PGtp3nY7ZmIDoD/mEk2HwTSAClX G+tcWDSuWm5W03oALupBkR3nDrg6OcC3WjVi2t1hj1lDcpw/dWXbBzAN/kM2WeVvezR2 cA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2wvwyv55u1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2019 21:37:43 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 15 Dec 2019 21:37:42 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 15 Dec 2019 21:37:42 -0800 Received: from localhost.localdomain (unknown [10.36.16.50]) by maili.marvell.com (Postfix) with ESMTP id 313E83F703F; Sun, 15 Dec 2019 21:37:38 -0800 (PST) From: To: , Marko Kovacevic , Ori Kam , Bruce Richardson , "Radu Nicolau" , Akhil Goyal , "Tomasz Kantecki" , Sunil Kumar Kori , Pavan Nikhilesh CC: , Satananda Burla Date: Mon, 16 Dec 2019 11:07:36 +0530 Message-ID: <20191216053736.792-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-16_01:2019-12-16,2019-12-15 signatures=0 Subject: [dpdk-dev] [PATCH] examples/l2fwd-event: set RSS based on device capabilities X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Setup RSS configuration based on underlying device capabilities. Signed-off-by: Satananda Burla Signed-off-by: Pavan Nikhilesh --- examples/l2fwd-event/l2fwd_common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/l2fwd-event/l2fwd_common.c b/examples/l2fwd-event/l2fwd_common.c index 0c069ec35..2fae6f52c 100644 --- a/examples/l2fwd-event/l2fwd_common.c +++ b/examples/l2fwd-event/l2fwd_common.c @@ -46,6 +46,17 @@ l2fwd_event_init_ports(struct l2fwd_resources *rsrc) if (ret != 0) rte_panic("Error during getting device (port %u) info: %s\n", port_id, strerror(-ret)); + local_port_conf.rx_adv_conf.rss_conf.rss_hf &= + dev_info.flow_type_rss_offloads; + if (local_port_conf.rx_adv_conf.rss_conf.rss_hf != + port_conf.rx_adv_conf.rss_conf.rss_hf) { + printf("Port %u modified RSS hash function based on hardware support," + "requested:%#"PRIx64" configured:%#"PRIx64"", + port_id, + port_conf.rx_adv_conf.rss_conf.rss_hf, + local_port_conf.rx_adv_conf.rss_conf.rss_hf); + } + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; -- 2.17.1