From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50072.outbound.protection.outlook.com [40.107.5.72]) by dpdk.org (Postfix) with ESMTP id 4A3184C96 for ; Fri, 9 Nov 2018 10:02:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NQye1ASvcArPUHGCP+r+2z3O0cVP01XMRAfXE3/H+7E=; b=SPl6dR0kb5NDrqwBRc0bCQx3k5ULorWl5aetdj814Cu+TGlRRBG7/8LP45b+owmIkM3ix/i6Eb7CMmcK5vUL5irr/3nGsx5+06fOff3a7Q5GMApgCT3wAI4KAIQ0jT8pz4i14S93Fq+EcdE5PAsJL453JBowqO2BLHiPBnsFPJ0= Received: from VI1PR0502MB3743.eurprd05.prod.outlook.com (52.134.8.154) by VI1PR0502MB2926.eurprd05.prod.outlook.com (10.175.24.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Fri, 9 Nov 2018 09:02:16 +0000 Received: from VI1PR0502MB3743.eurprd05.prod.outlook.com ([fe80::84d3:8812:d45c:98e4]) by VI1PR0502MB3743.eurprd05.prod.outlook.com ([fe80::84d3:8812:d45c:98e4%4]) with mapi id 15.20.1294.034; Fri, 9 Nov 2018 09:02:16 +0000 From: Ophir Munk To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , "dev@dpdk.org" , Adrien Mazarguil CC: Asaf Penso , Shahaf Shuler , Thomas Monjalon , Olga Shern , Ophir Munk Thread-Topic: [PATCH v1] app/testpmd: revert setting default rss Thread-Index: AQHUeArpOTiENQJA7EuZJr3cgNuGcA== Date: Fri, 9 Nov 2018 09:02:16 +0000 Message-ID: <1541754129-26009-1-git-send-email-ophirmu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CWLP265CA0368.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:5e::20) To VI1PR0502MB3743.eurprd05.prod.outlook.com (2603:10a6:803:11::26) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0502MB2926; 6:xMSj4yRdDL7emlcpeEuAXj75zuIBlJ1Z2PSSUfTo1HorznA6KsSFenrFeg7aVBcqR51uEg9kBtaTUk3BP/tuteTOMGP8Pws5G1c/d0dqg2LWFG8UY2NDXmlKL8tMORXgLVQTGJez8YSzobUbVebCBeE7o6x8AH0BtNqg+Iml8D7JeJm4wZVNaXWajeUI2sFxl8rQ0J0KNdFCEJd6I6D5l5jEnBKR3E+XOI0fg2/E+O6qPLaCUvLVUbbjN7GdRxRe4WnMpGSTCT1121AcKAq7rdX/Pw8A3wCRHz9r6EFh15k1ewPTZZlx2J9fkGKsEMvZN88b3dzFgiUkCq91BWlNeqYE51odreSsHChUYAx4LCloGn/OYYs0VWzHU4s0ZjnMHCDBwlxC1BkDTbDlXfg57MV0JhNg7ptxg6N7FiHB9pEjbFrfRTxGffDqXH3leRV99JXIhayv84L77tjE4asatg==; 5:lrlNc/pYhQn+2UVoY/IDd+wLGipHtAaI0KOzcw9FZpf6JZ5Bsoa0UokQ1GZyU4Q4lH82hjYy2Da0n33Gj073UXqjIhNYPqyDjDlDxQsn78jI8G8YCK98jmFLRjNIzAYZYupUz4HU2tPbNjljhXdURCQn64g8EHGdJKYhUgzrboE=; 7:KYnsfWA5bjSSA7wPDJ+rcmUOOYflNTchY+uYP+TneNIBQmRQaVoUnlqy29SrWfyYL4gGu/h4iUNSx04eVJxdXbhMX9Pwt15gOFnt+10oeU5RoG6hnTpc2sK6m0aWWGh/IHc3ErVqCKD7ET0WCwGCUg== x-ms-office365-filtering-correlation-id: c468405a-75dc-4b32-8179-08d646220bf7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR0502MB2926; x-ms-traffictypediagnostic: VI1PR0502MB2926: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231382)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:VI1PR0502MB2926; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0502MB2926; x-forefront-prvs: 08512C5403 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(376002)(346002)(39860400002)(199004)(189003)(86362001)(36756003)(7736002)(6486002)(110136005)(316002)(14454004)(54906003)(5660300001)(102836004)(305945005)(2616005)(107886003)(476003)(486006)(386003)(6506007)(14444005)(106356001)(81156014)(8676002)(105586002)(81166006)(256004)(6436002)(99286004)(3846002)(6116002)(8936002)(52116002)(478600001)(68736007)(25786009)(97736004)(2906002)(4326008)(71190400001)(71200400001)(6512007)(186003)(53936002)(66066001)(2501003)(26005)(2900100001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0502MB2926; H:VI1PR0502MB3743.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: MCEVWaoDs+BApxpkYMphKNdECFPfvGjWQkoeQSL1qaHohVl5G+2MzMt7D1U+zaZmW7R1cu+zcNNdZNmcSeYO30f7hLvHTRXlmJ5C15wPY6Du+RTPWpUVSCtakUb+Rspj38dXtumEZu3CCM2jwQ9ZJPj/3pzKADLY4dolhqT7CnNy9ekdxeVo9KCFScmEAbJfgjnrUx+1Ctk/Urp0NUkeDXDQ+wTZY9/6mgHlJgJy2mCFleLkBP/xaiHErOIO1ECJSGy+svYxWk1mpRgsxepKb1KmXrmDrEiGJuFxDWqTLh54V1pBUUnkv3B6Jy+IAa/XcgkD6KVoP1jWpYCMRf0RNbCEwgNOBBAj4hm3x+V6yFw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c468405a-75dc-4b32-8179-08d646220bf7 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2018 09:02:16.7325 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0502MB2926 Subject: [dpdk-dev] [PATCH v1] app/testpmd: revert setting default rss 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: , X-List-Received-Date: Fri, 09 Nov 2018 09:02:19 -0000 This reverts the patch that enables default RSS action by setting key=3DNULL and key_len=3D0. In current testpmd implementation a key pointer must exist if key_len!=3D0. For example, the following flow rule will cause a segmentation fault: flow create 0 actions rss queues 0 1 end key_len 40 / end Fixes: a4391f8bae ("app/testpmd: set default RSS key as null") Signed-off-by: Ophir Munk --- app/test-pmd/cmdline_flow.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 91e2e35..23ea7cc 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -3248,15 +3248,26 @@ static int comp_vc_action_rss_queue(struct context = *, const struct token *, .func =3D RTE_ETH_HASH_FUNCTION_DEFAULT, .level =3D 0, .types =3D rss_hf, - .key_len =3D 0, + .key_len =3D sizeof(action_rss_data->key), .queue_num =3D RTE_MIN(nb_rxq, ACTION_RSS_QUEUE_NUM), - .key =3D NULL, + .key =3D action_rss_data->key, .queue =3D action_rss_data->queue, }, + .key =3D "testpmd's default RSS hash key, " + "override it for better balancing", .queue =3D { 0 }, }; for (i =3D 0; i < action_rss_data->conf.queue_num; ++i) action_rss_data->queue[i] =3D i; + if (!port_id_is_invalid(ctx->port, DISABLED_WARN) && + ctx->port !=3D (portid_t)RTE_PORT_ALL) { + struct rte_eth_dev_info info; + + rte_eth_dev_info_get(ctx->port, &info); + action_rss_data->conf.key_len =3D + RTE_MIN(sizeof(action_rss_data->key), + info.hash_key_size); + } action->conf =3D &action_rss_data->conf; return ret; } --=20 1.8.3.1