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 DFB04A056C; Tue, 3 Mar 2020 21:44:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 84E9B1BFF0; Tue, 3 Mar 2020 21:44:16 +0100 (CET) Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690085.outbound.protection.outlook.com [40.107.69.85]) by dpdk.org (Postfix) with ESMTP id 5739E1BFE9 for ; Tue, 3 Mar 2020 21:44:13 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cNeNRODhhmstqwQvjKY3xk5Ls4blctu3lefGuG9JXavXm6PTtZal301S566unNLefd2qbRsGQW5Vzz0DEXmRFFKmVNC7/j0xFrQ20YAjqfGsF2sw8SO+fiTQKOVlit11XmT6Zght66bl5vGWFQCgx3QPyDCFgiaUOKl/OKpj0qM3OBuA3QNkMtd+e4IJa+fpMKqLYygW5RZtbbXjZjUckSzaeRHSpTI+hjpJ6e/ESC2IVcWtM4sydUxnIRfpop99Qbihok5kfK7El+VsBtZh+VXFVeTjETAN0KyLqXVc7lXkAXWwp0/aq2J9uiVAyToeuh84r15L+3Z2x7uvOcpZDQ== 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=ZCCsLDyp/9IC7rG7xY4KnP4bK02GUjCqBDiIOCpQFKE=; b=Gp0Yg2L0Aer+sDuJSRpAzu9PkYEIotfllaqHGu8entsiWmVit5zyABwXrnNfMbZJGHvpxEfKKyk8lJ6f0Az33QrsKfMvHOPZEEYrnzQypkl63WbWvLzrgz8BQLqY1KZ5qCeW3G49JYrNXc+wAB9AgicXIZGzn01DRxG1klonvzKTfm3MgcCo8+z9Bi8mD7qw5YqLbFTWCknv7d9Hi6N+mSrKRM9m8wKyzZ8DQ1ahAqUgFAtzdy4Rhlg4q1JP+niQvQx8fGRTB8hGKg1mwZBc/xEdBWgvxg9J+BzFg6GAfdFd8a1Rdv3earVLW0lAXJT8wJ5kJWWnkXHCb4JNIul2BA== 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=ZCCsLDyp/9IC7rG7xY4KnP4bK02GUjCqBDiIOCpQFKE=; b=ER7Qu6AqyYg28Dhx2D8HwjNhIimkcdfof3SvwAV6a9wISkQ0oEnrVMVcWt8ZBKl6VGU24B1z6C6EMmLONiIUDWWiyAUz2m/lcE2fRQ4JmuCg88fFUoWscd4UmCTxli9LTjTrNuB6Sg/OCFUTSCWO4rkekFuMtwo+UltReBtFqAc= Received: from BYAPR05MB3989.namprd05.prod.outlook.com (2603:10b6:a02:86::31) by BYAPR05MB5560.namprd05.prod.outlook.com (2603:10b6:a03:1b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.11; Tue, 3 Mar 2020 20:44:10 +0000 Received: from BYAPR05MB3989.namprd05.prod.outlook.com ([fe80::f1be:e437:3f14:2f1a]) by BYAPR05MB3989.namprd05.prod.outlook.com ([fe80::f1be:e437:3f14:2f1a%7]) with mapi id 15.20.2793.011; Tue, 3 Mar 2020 20:44:10 +0000 Received: from dev.localdomain (76.14.29.240) by BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2772.14 via Frontend Transport; Tue, 3 Mar 2020 20:44:09 +0000 From: Eduard Serra Miralles To: "dev@dpdk.org" CC: Yong Wang Thread-Topic: [PATCH v2] net/vmxnet3: fix RSS setting on v4 Thread-Index: AQHV8Zx925TyIE/21EmJ7wW/H0S3LA== Date: Tue, 3 Mar 2020 20:44:10 +0000 Message-ID: <1583268235-61346-1-git-send-email-eserra@vmware.com> References: <1566405415-89876-1-git-send-email-eserra@vmware.com> In-Reply-To: <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: BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) To BYAPR05MB3989.namprd05.prod.outlook.com (2603:10b6:a02:86::31) x-originating-ip: [76.14.29.240] 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-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cda11238-1530-42d3-26cf-08d7bfb39fda x-ms-traffictypediagnostic: BYAPR05MB5560:|BYAPR05MB5560: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 03319F6FEF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(396003)(39860400002)(366004)(346002)(189003)(199004)(52116002)(66446008)(66946007)(66556008)(64756008)(316002)(6666004)(86362001)(66476007)(71200400001)(5660300002)(8676002)(81156014)(81166006)(8936002)(107886003)(36756003)(956004)(186003)(16526019)(26005)(4326008)(6916009)(6512007)(6506007)(2906002)(478600001)(6486002)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR05MB5560; H:BYAPR05MB3989.namprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ec/lNkhw6OYP2LabMMGtK0Rve6V2z9jkdrBqRslHCKqoHK+FfbmGh+hILfQvHXa90vLWhnVgAIY48L/TT7wKFLRH0tkPSiDBmhaZIv1zR50CriRrAsuhDENp5Nf0BrRK4HMWewwJqqSnZ7ZmviMyJMcEmNeJAFs28NQvtAxmxH9GGJLYjYEP0Uovv9pxoEFp7IKJ5DwYkpQ5gThQCrzYUtGJnbyVjB2wTgON9cgiQJW8VdCiDLoeuck5LINioZap+eWZ8ylb+xRv2h4WSGPw/L99waD2AVk9eeRabs/2dkRBcrKTLBeSSXvWArMnhZNUHJp6pJ4G0yZdjzD27rUIbLrWeFVlya7vyksy/HZuTzTJg2tSHzDDsiULTU95EeFxNqfi6trhCDRyCIwgSEP18OO/CvGYG5O8M+5pHka0ro+sOff46dblcxqFSXNpGHih/6VmnAhMKhzViB/UGh/HcIoyE+uVjx64c7zj/c8Oo9fhPd+Xpl15QQOEmbtYV+esBnwuiOTzzKvR/JCrmUZnCg== x-ms-exchange-antispam-messagedata: RLJ1JtPT3VLMFfJ+mag+PZiK6tu/RVNwXSlWqRfv8H5RwCYzreH/PuMTMqx6iJ/nQu2jWxBMm5k3Jlisk81Nhh8Bro6QzuVVZNcbzLuLO/06V/jNp2n6CCnNM6LvCQm0sGzpVjS/WVuvPD/vyqPRgw== 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: cda11238-1530-42d3-26cf-08d7bfb39fda X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2020 20:44:10.2277 (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: aV83+qdbjda5uMoSYjT8viCzuoUHHrvNCAFNq5sBcNL1Czcw3iH7OddwDBsf8eaqVJaJ9epqy12GsWhCt4tOyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB5560 Subject: [dpdk-dev] [PATCH v2] 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 Fixes: #400 (https://bugs.dpdk.org/show_bug.cgi?id=3D400) --- 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 6e6efa9..705e976 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -771,7 +771,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..dd685b0 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