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 E4DB6A046B for ; Wed, 21 Aug 2019 18:37:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE0ED1BEE5; Wed, 21 Aug 2019 18:37:16 +0200 (CEST) Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710044.outbound.protection.outlook.com [40.107.71.44]) by dpdk.org (Postfix) with ESMTP id A1C2C1BEDF for ; Wed, 21 Aug 2019 18:37:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kUKQJwpXuPLN14th4yHXXIq84h7UTGFVf8HXu46A5dSiv3WLKDHMew08Jepigw9uVBLSFQHxBViOE+vcFUDzICKRYk/o59OBUAD5D8/Up42AR4YHwk7OA6mHf6iGuUEkrm3l1sG1pUHNa2waLm9HiVQoiah/nLwgxbQJg6EUamFYgy3lak0abZxvyT8SGwtGRRCSjrQ+VrYa8BRW01e91L4n00U5SRDE+3F3iy7fse3t347ufbGNlygdq9WhgNcdoEcIepJNoeYyg0n7iO+3iZ6Q8otkx/73Y8BHtXZihEgGK9v/Wm2LjkpksLaszTXTihZkK2lE3qqG1+xzTS6FJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SbK7QWQ0KZAuAcNl7cUqCIxn91Ig5nOPpH0L4dMiYGs=; b=MRSN2g1/KxbIGuEqR+Juqfkzmls4r/VGvRGe37clwaXpdlisGZu1M77NZvq4d/GbFk5cR1N1FOzhulCYgH2VO2sCZelsrsjOI/vFSb639KFOZ70gHaO41b7sIQYcaM5I4MD5Uq8NPIt9GrMATTPKtm2jZ7krt+HoxBHmPWsy5atPbbsfjOFMxv5gLGZe41R9/n10ufLpYzjgbyQgJ0QY3kyumYFdxwU2NbmBbr1JFvznFp15OWCJDTwd943O37COv4C5ypzBV6ATlDGP0dC1kcuUFfTEpcA/JdQ+aJqTxt9A0HJMT15K5I0JehTfM31ZSEWKq8FQmvrmtetGmo4Ogw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SbK7QWQ0KZAuAcNl7cUqCIxn91Ig5nOPpH0L4dMiYGs=; b=nQgBm8C9d2vspTthnqFAWeS+Fgl9VpU2AyZtv6HZoBiFl5yDC9MjchoxCX+SZp98RnwnXYzutN1ROlQeO7KlJ2oa8tSl5rBPPACVbOJ/1ZJuvTgoSYQHMFqY2L8CW6PNw2SSUFA+qOpUKahLAw5RDO3SKXM+smXzLVEfKGYOQbA= Received: from MWHPR05MB3472.namprd05.prod.outlook.com (10.174.248.35) by MWHPR05MB3503.namprd05.prod.outlook.com (10.174.250.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.12; Wed, 21 Aug 2019 16:37:13 +0000 Received: from MWHPR05MB3472.namprd05.prod.outlook.com ([fe80::6187:471:6550:2ad6]) by MWHPR05MB3472.namprd05.prod.outlook.com ([fe80::6187:471:6550:2ad6%7]) with mapi id 15.20.2199.011; Wed, 21 Aug 2019 16:37:13 +0000 From: Eduard Serra Miralles To: Yong Wang CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/vmxnet3: fix RSS setting on v4 Thread-Index: AQHVWD6vhhoZIBMDqEGK6fQDVaknrw== Date: Wed, 21 Aug 2019 16:37:13 +0000 Message-ID: <1566405415-89876-1-git-send-email-eserra@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0023.namprd03.prod.outlook.com (2603:10b6:a02:a8::36) To MWHPR05MB3472.namprd05.prod.outlook.com (2603:10b6:301:40::35) authentication-results: spf=none (sender IP is ) smtp.mailfrom=eserra@vmware.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [66.170.99.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b3ec9b3c-f1b1-4df1-ce36-08d72655d1b5 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:MWHPR05MB3503; x-ms-traffictypediagnostic: MWHPR05MB3503: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0136C1DDA4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(396003)(136003)(346002)(366004)(376002)(199004)(189003)(52116002)(2906002)(2616005)(37006003)(8936002)(4326008)(476003)(66066001)(25786009)(53936002)(6862004)(81156014)(81166006)(486006)(3846002)(6116002)(14444005)(256004)(8676002)(99286004)(386003)(6506007)(305945005)(5660300002)(102836004)(26005)(186003)(6436002)(6512007)(6486002)(14454004)(50226002)(66946007)(66476007)(66556008)(64756008)(316002)(36756003)(6636002)(71190400001)(71200400001)(86362001)(7736002)(66446008)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR05MB3503; H:MWHPR05MB3472.namprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Udl3sW4WF87SBim/r6/ZNu/5M4YT80HoXdIDqcXms0XQTN5A2EuDHDirkoJewyLTmYePykg0/Y1noMKmUa+18zMl15SZUEsG/6d97u0Z+Tx/+9PQ4yWanLo/V71TXkVsLKflZ1B/EK9QQ0p3Z9VYAUiAvCwtPZV8VTHD1ja85498np42Zg5eIDxCM31mhJTZ47Cy/QjRLh2YMFHUB1vEG32zi4omBih2F3inAfbmdOfYE1RgfJo2CKPK3ADGGhOhYBR/oAQH8Uab8CgyE/jE1/8Jn0e20Y3Y+mhxhVuMcn0QsUzdjw3/63wE+nStz44Ft8vM8frVGmAR5/dYsUtrnoloTmuSg+ORTT3z7XNuLYbpDxcjzKByh+kPOanuwR18NVnMWnDT7LjTaYfmV2Oy4keknNlqJ4/46VQEOxq4KdY= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3ec9b3c-f1b1-4df1-ce36-08d72655d1b5 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2019 16:37:13.1111 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gSUioHKEk8adyeULFA/Y3Y+r8VRMQxqDftZX+X8wmguj6je8IfnqrnCEWdSL1AzFaWSssPlifT+Ntna4g7mPOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR05MB3503 Subject: [dpdk-dev] [PATCH] net/vmxnet3: fix RSS setting on v4 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" When calling to setup RSS on v4 API, ESX will expect IPv4/6 TCP RSS to be set/requested mandatorily. This patch will: - Set IPv4/6 TCP RSS when these have not been set. A warning message is thrown to make sure we warn the application we are setting IPv4/6 TCP RSS when not set. - An additional check has been added to dodge RSS configuration altogether unless MQ_RSS has been requested, similar to v3. The alternative (returning error) was considered, the intent is to ease the task of setting up and running vmxnet3 in situations where it's supposted to be most strightforward (testpmd, pktgen). Signed-off-by: Eduard Serra --- drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++- drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 ++++ drivers/net/vmxnet3/vmxnet3_rxtx.c | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmx= net3_ethdev.c index 57feb37..0a7047e 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -769,7 +769,8 @@ vmxnet3_dev_start(struct rte_eth_dev *dev) PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n"); } =20 - if (VMXNET3_VERSION_GE_4(hw)) { + if (VMXNET3_VERSION_GE_4(hw) && + dev->data->dev_conf.rxmode.mq_mode =3D=3D ETH_MQ_RX_RSS) { /* Check for additional RSS */ ret =3D vmxnet3_v4_rss_configure(dev); if (ret !=3D VMXNET3_SUCCESS) { diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmx= net3_ethdev.h index 8c2b6f8..6e3ce7d 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.h +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h @@ -38,6 +38,10 @@ ETH_RSS_NONFRAG_IPV4_UDP | \ ETH_RSS_NONFRAG_IPV6_UDP) =20 +#define VMXNET3_MANDATORY_V4_RSS ( \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV6_TCP) + /* RSS configuration structure - shared with device through GPA */ typedef struct VMXNET3_RSSConf { uint16_t hashType; diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxne= t3_rxtx.c index 7794d74..dd99684 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -1311,6 +1311,14 @@ vmxnet3_v4_rss_configure(struct rte_eth_dev *dev) =20 cmdInfo->setRSSFields =3D 0; port_rss_conf =3D &dev->data->dev_conf.rx_adv_conf.rss_conf; + + if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=3D + VMXNET3_MANDATORY_V4_RSS) { + PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 v4 RSS," + "automatically setting it"); + port_rss_conf->rss_hf |=3D VMXNET3_MANDATORY_V4_RSS; + } + rss_hf =3D port_rss_conf->rss_hf & (VMXNET3_V4_RSS_MASK | VMXNET3_RSS_OFFLOAD_ALL); =20 --=20 2.7.4