From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0084.outbound.protection.outlook.com [104.47.40.84]) by dpdk.org (Postfix) with ESMTP id 87A8E2B91 for ; Wed, 7 Jun 2017 09:42:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=uBusBtJLnjIiH2jiufdQIMmWV6CZojp9AgG6Q8uCbBU=; b=I3pM2UQId6Hhi+5J5YWjHeoVWZfQVqgJuCxixkgR9fChXvQjXT5igj7VW2RF0jv+js+wX4lDiRLalUQwZKyXa4i11O33MvtN2E3iCnCOBAvw3g1JCrwIko+sTgQp/39pTLprU7ByaCDJEihG95QxPdC9n+E/jveIk7yL4bKVvUI= Received: from BN6PR07CA0004.namprd07.prod.outlook.com (10.173.33.142) by BLUPR07MB418.namprd07.prod.outlook.com (10.141.28.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Wed, 7 Jun 2017 07:42:51 +0000 Received: from BN1AFFO11FD010.protection.gbl (2a01:111:f400:7c10::153) by BN6PR07CA0004.outlook.office365.com (2603:10b6:404:3a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12 via Frontend Transport; Wed, 7 Jun 2017 07:42:51 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD010.mail.protection.outlook.com (10.58.52.70) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1101.12 via Frontend Transport; Wed, 7 Jun 2017 07:42:50 +0000 Received: from avsmtprelay01.qlc.com (10.1.112.194) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 7 Jun 2017 00:42:50 -0700 Received: from avluser05.qlc.com (avluser05.qlc.com [10.1.113.115]) by avsmtprelay01.qlc.com (Postfix) with ESMTP id EADBF8BF7379E; Wed, 7 Jun 2017 00:42:49 -0700 (PDT) Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id v577gnhg006896; Wed, 7 Jun 2017 00:42:49 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@cavium.com using -f From: Rasesh Mody To: CC: Harish Patil , Date: Wed, 7 Jun 2017 00:42:18 -0700 Message-ID: <1496821342-6832-2-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1495960654-352-1-git-send-email-rasesh.mody@cavium.com> References: <1495960654-352-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39850400002)(39840400002)(39410400002)(39400400002)(39450400003)(2980300002)(428002)(189002)(199003)(9170700003)(50986999)(5660300001)(305945005)(38730400002)(189998001)(478600001)(87636003)(4326008)(101416001)(54906002)(42186005)(76176999)(5003940100001)(36756003)(6666003)(6916009)(2950100002)(106466001)(50226002)(105586002)(2351001)(86362001)(72206003)(47776003)(575784001)(110136004)(107886003)(356003)(33646002)(48376002)(8676002)(81166006)(2906002)(50466002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR07MB418; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD010; 1:t6GVnbhlETuObKE6nlg2xEFF82rX0StOZKJKlcg6meHDycz21yMnJBQvuXX+zezccVd3KtsrWrznJsL6VdC4YUvqNSF1c7CdOc0glOhDyrc7wqQUrLPQQ1IRnxPhm5lP/nnBeuKnQWP2MmyuVxKeJhI2Y9wDUkjqyAOE19Ou25i2sF3vLxd3VRJh74KC+dLUlEvggqkf+9b6mn0mVymExDQ2uHUxaJn1F98MuBQ9z96CWyeLjIgV++pQLQhFLSqBCFtbEMnpMTRYwVzsyHTRb9Ad0JJf+YWXGLpdGv9/QuPt3YsBOocPCGwxzKePggWdxa6wFwM/RTnXr5loq0vmw0NtsJfYhFUNUDGHRtEzXCx9ljesyR2BHH2QnNQAVNjhMN/Tx4nCc/jyjGivsQF/lNuVhzukLovqP6tpUh1vVQUNGCl5c+Qpqx0ZJ0yAXfiDZh/yKzhg76kjMYfiEL4zwJk6DQI9V7taDeNQXPugY6A= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR07MB418: X-MS-Office365-Filtering-Correlation-Id: ba7be01c-e264-4fce-ad35-08d4ad78ccf1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:BLUPR07MB418; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB418; 3:KTZGwhadr5p4ac7B26ZgGfl8Tfpk116h2y/rgnRv7fMKnlGthpGTL+jHwSX/3aUayiShZNS3kVyEQ219LpZe8/z6xIHfaOMBvFcjiYZq1KEHbuNT24Hptx5bLdF0qbdhzdNTyYNmVKCO4DjGqQdhpguUKAK2e/zCWeoIa3WmzaG7Ct4NiKvX/JcJ2m2EjA/Bl3r1I7tY+KJ4oZA37c3Kl2QuhCXUJgYdLAfLB3jlSYpVKcX7k3iWpQVPbBDT8G0XzHzCbAsufWHRKIKYHCSWOERAEEOHdNOM9qcLMeH1MJfLE46WilyS+fuVGsJP1+a0/+pU+r574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CDCxM3Ya/vefrnnnyQDyueiGq+XEdwSY3Q7AOQRNGz+aleLqKjtUAJozCNaGWcizKowGZOjbJR6EYvyo79/hk8zR1AOwlapIrKrfMlEHJItvbQ3HPR53hkcX6VGB1PjhjEtFTHvGvhRN29ApQ6sYijTEk4lq+USxOEkmiTytqkgMAAVPMKWk3GjJT3DEIpRym9+AZjMQZzpyvEbty20VnbB1yn9PKc6L1ZYJOi3sj5RndzWbOqqZlhwY9aJAOG3BtAbhmWd9n2CiKmUwU+eDa/+TZ5V4HEtH92MLeci18xyHpazuN+ZIkqfbkmdgPDLIdDx/VeDCwx5ls4x4+Pp+xAOi7npgvt68MwATbbf1EKwXulKx98ctXFe2OB53eNX16T+bAGPfm/1YpVBpPLZjmEzmOom0/ACkDtuB7rQeUxONxJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13018025)(13016025)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR07MB418; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR07MB418; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR07MB418; 4:ecg7eHsouWlm0DweNVRve1DPfFxmRbhc+P6OwM34KjO?= =?us-ascii?Q?yM03RzZWQOiU3328JmlIPP6O9HGpM8dTUsNyl44tNxOkbmTfNS+ti22xbQDn?= =?us-ascii?Q?a1NdDzcFPteIuerkcIQuJIe8NbTBddpgDSP0np5AVCdcQXrFFOqLq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rWqX637PjE8/d2fWh0mak17wGD0O+DilCDA6zpChUTAD?= =?us-ascii?Q?PnQLPe80mDJGdTkZ/bqNHkDJuavXWjuFAjX9eT0m86NwgyGOrUQ+Ke+rssqm?= =?us-ascii?Q?3C2LuldEdXAJLgVKpfCcrbgNTC+ske0/yWP5u58bmd8RKg7HEawPlSqoB5i6?= =?us-ascii?Q?rV/wKqY56t00=3D?= X-Forefront-PRVS: 03319F6FEF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR07MB418; 23:pI3+VWTs69vrWf2omGsczd7u5QTtJublXWirFpEuNR?= =?us-ascii?Q?kmasRNFnOTFCgbPjPWcJKphOcQ1K4kFvGpf7YZNFVcapm78Eb6+gabZFfLMl?= =?us-ascii?Q?6hiYzr2FI6DiU1D6TD7ZHx1kPt3Zxjqhs9Ykda51p/zod7Sk6LDJlkHcHIvK?= =?us-ascii?Q?2liySkfbLaHfU30MnvUQVl5SSHpKqN3mDDtcF06XfriSDPqFWGR4fjxMN5cp?= =?us-ascii?Q?SzWMQt9IhOAZXDel3GQyvyTTnMzxngd7Yx7Low3OBApjm7u5ioTWjQJgN6o0?= =?us-ascii?Q?PRnzudSJa8s79MaZN6hHamYBjtfrmdaGr7Gv5ceIVd2+lwiRFVgudv4gZWb8?= =?us-ascii?Q?I5yPwyocWt5Qeg9eoSbkHwqzl1jNkWGd8SrkTCyZhDPXVxmXG3EFIbxenTwY?= =?us-ascii?Q?d+82iFAd+M5XHlvsi+a0ad/kfI5D6t1DUNRhKqMLXZNarPZWosnOkPuYwbOY?= =?us-ascii?Q?KL+hE+Zjzd2FcOjrTMhJosbNiUw/ZhL4ql8ZfBqdSiHzKGIjiWLhdeDr4Eph?= =?us-ascii?Q?WViwCr1RFEAjS7f2MQJ7muTnGSMwyPGzKHb63N/oVCgK8j6JgQbBBeXXuM7F?= =?us-ascii?Q?gXX37S6syNlbGkMjxXFsW1JlIKJFI1Jyd+De5ufckjZufn/eZDj9mO9qWoX6?= =?us-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VnVaXhKc6/lnEaTrLTwnE0wVyKO+6y9liMegn19C6EaeLFTIGeZHgz0mLGKawFCLmHaGTHsdsOQYizvUovNXsEoh3N+mtMIy1J/DdjRXuOHrgLYYxTKxVrUxd3/E44fAfwGAh6riSzA== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2017 07:42:50.8097 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR07MB418 Subject: [dpdk-dev] [PATCH v2 1/5] net/qede: refactoring vport handling code 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: Wed, 07 Jun 2017 07:42:54 -0000 From: Harish Patil The refactoring is mainly for two reasons: - To remove an additional layer of internal callbacks for all vport related operations from the struct qed_eth_ops_pass. Instead, we can invoke base APIs directly. - Splitting a single large vport-update configuration into multiple and independent vport-update operations. Each configuration would touch only the required config bits that needs an update. Signed-off-by: Harish Patil --- drivers/net/qede/qede_eth_if.c | 109 --------------- drivers/net/qede/qede_eth_if.h | 35 ----- drivers/net/qede/qede_ethdev.c | 302 ++++++++++++++++++++++++++++++---------- drivers/net/qede/qede_ethdev.h | 7 + drivers/net/qede/qede_rxtx.c | 106 +++----------- 5 files changed, 259 insertions(+), 300 deletions(-) diff --git a/drivers/net/qede/qede_eth_if.c b/drivers/net/qede/qede_eth_if.c index a3c0b13..7557943 100644 --- a/drivers/net/qede/qede_eth_if.c +++ b/drivers/net/qede/qede_eth_if.c @@ -9,112 +9,6 @@ #include "qede_ethdev.h" static int -qed_start_vport(struct ecore_dev *edev, struct qed_start_vport_params *p_params) -{ - int rc, i; - - for_each_hwfn(edev, i) { - struct ecore_hwfn *p_hwfn = &edev->hwfns[i]; - u8 tx_switching = 0; - struct ecore_sp_vport_start_params start = { 0 }; - - start.tpa_mode = p_params->enable_lro ? ECORE_TPA_MODE_RSC : - ECORE_TPA_MODE_NONE; - start.remove_inner_vlan = p_params->remove_inner_vlan; - start.tx_switching = tx_switching; - start.only_untagged = false; /* untagged only */ - start.drop_ttl0 = p_params->drop_ttl0; - start.concrete_fid = p_hwfn->hw_info.concrete_fid; - start.opaque_fid = p_hwfn->hw_info.opaque_fid; - start.concrete_fid = p_hwfn->hw_info.concrete_fid; - start.handle_ptp_pkts = p_params->handle_ptp_pkts; - start.vport_id = p_params->vport_id; - start.mtu = p_params->mtu; - /* @DPDK - Disable FW placement */ - start.zero_placement_offset = 1; - - rc = ecore_sp_vport_start(p_hwfn, &start); - if (rc) { - DP_ERR(edev, "Failed to start VPORT\n"); - return rc; - } - - DP_VERBOSE(edev, ECORE_MSG_SPQ, - "Started V-PORT %d with MTU %d\n", - p_params->vport_id, p_params->mtu); - } - - ecore_reset_vport_stats(edev); - - return 0; -} - -static int qed_stop_vport(struct ecore_dev *edev, uint8_t vport_id) -{ - int rc, i; - - for_each_hwfn(edev, i) { - struct ecore_hwfn *p_hwfn = &edev->hwfns[i]; - rc = ecore_sp_vport_stop(p_hwfn, - p_hwfn->hw_info.opaque_fid, vport_id); - - if (rc) { - DP_ERR(edev, "Failed to stop VPORT\n"); - return rc; - } - } - - return 0; -} - -static int -qed_update_vport(struct ecore_dev *edev, struct qed_update_vport_params *params) -{ - struct ecore_sp_vport_update_params sp_params; - struct ecore_rss_params sp_rss_params; - int rc, i; - - memset(&sp_params, 0, sizeof(sp_params)); - memset(&sp_rss_params, 0, sizeof(sp_rss_params)); - - /* Translate protocol params into sp params */ - sp_params.vport_id = params->vport_id; - sp_params.update_vport_active_rx_flg = params->update_vport_active_flg; - sp_params.update_vport_active_tx_flg = params->update_vport_active_flg; - sp_params.vport_active_rx_flg = params->vport_active_flg; - sp_params.vport_active_tx_flg = params->vport_active_flg; - sp_params.update_inner_vlan_removal_flg = - params->update_inner_vlan_removal_flg; - sp_params.inner_vlan_removal_flg = params->inner_vlan_removal_flg; - sp_params.update_tx_switching_flg = params->update_tx_switching_flg; - sp_params.tx_switching_flg = params->tx_switching_flg; - sp_params.accept_any_vlan = params->accept_any_vlan; - sp_params.update_accept_any_vlan_flg = - params->update_accept_any_vlan_flg; - sp_params.mtu = params->mtu; - sp_params.sge_tpa_params = params->sge_tpa_params; - - for_each_hwfn(edev, i) { - struct ecore_hwfn *p_hwfn = &edev->hwfns[i]; - - sp_params.opaque_fid = p_hwfn->hw_info.opaque_fid; - rc = ecore_sp_vport_update(p_hwfn, &sp_params, - ECORE_SPQ_MODE_EBLOCK, NULL); - if (rc) { - DP_ERR(edev, "Failed to update VPORT\n"); - return rc; - } - - DP_VERBOSE(edev, ECORE_MSG_SPQ, - "Updated V-PORT %d: active_flag %d [update %d]\n", - params->vport_id, params->vport_active_flg, - params->update_vport_active_flg); - } - - return 0; -} - -static int qed_start_rxq(struct ecore_dev *edev, uint8_t rss_num, struct ecore_queue_start_common_params *p_params, @@ -299,9 +193,6 @@ int qed_configure_filter_rx_mode(struct rte_eth_dev *eth_dev, static const struct qed_eth_ops qed_eth_ops_pass = { INIT_STRUCT_FIELD(common, &qed_common_ops_pass), INIT_STRUCT_FIELD(fill_dev_info, &qed_fill_eth_dev_info), - INIT_STRUCT_FIELD(vport_start, &qed_start_vport), - INIT_STRUCT_FIELD(vport_stop, &qed_stop_vport), - INIT_STRUCT_FIELD(vport_update, &qed_update_vport), INIT_STRUCT_FIELD(q_rx_start, &qed_start_rxq), INIT_STRUCT_FIELD(q_tx_start, &qed_start_txq), INIT_STRUCT_FIELD(q_rx_stop, &qed_stop_rxq), diff --git a/drivers/net/qede/qede_eth_if.h b/drivers/net/qede/qede_eth_if.h index 097e025..be6c7c1 100644 --- a/drivers/net/qede/qede_eth_if.h +++ b/drivers/net/qede/qede_eth_if.h @@ -16,8 +16,6 @@ #define INIT_STRUCT_FIELD(field, value) .field = value -#define QED_ETH_INTERFACE_VERSION 609 - #define QEDE_MAX_MCAST_FILTERS 64 enum qed_filter_rx_mode_type { @@ -47,45 +45,12 @@ struct qed_dev_eth_info { bool is_legacy; }; -struct qed_update_vport_params { - uint8_t vport_id; - uint8_t update_vport_active_flg; - uint8_t vport_active_flg; - uint8_t update_inner_vlan_removal_flg; - uint8_t inner_vlan_removal_flg; - uint8_t update_tx_switching_flg; - uint8_t tx_switching_flg; - uint8_t update_accept_any_vlan_flg; - uint8_t accept_any_vlan; - uint8_t update_rss_flg; - uint16_t mtu; - struct ecore_sge_tpa_params *sge_tpa_params; -}; - -struct qed_start_vport_params { - bool remove_inner_vlan; - bool handle_ptp_pkts; - bool enable_lro; - bool drop_ttl0; - uint8_t vport_id; - uint16_t mtu; - bool clear_stats; -}; - struct qed_eth_ops { const struct qed_common_ops *common; int (*fill_dev_info)(struct ecore_dev *edev, struct qed_dev_eth_info *info); - int (*vport_start)(struct ecore_dev *edev, - struct qed_start_vport_params *params); - - int (*vport_stop)(struct ecore_dev *edev, uint8_t vport_id); - - int (*vport_update)(struct ecore_dev *edev, - struct qed_update_vport_params *params); - int (*q_rx_start)(struct ecore_dev *cdev, uint8_t rss_num, struct ecore_queue_start_common_params *p_params, diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index c28a2bc..f8d9f7c 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -329,6 +329,178 @@ static void qede_print_adapter_info(struct qede_dev *qdev) } #endif +static int +qede_start_vport(struct qede_dev *qdev, uint16_t mtu) +{ + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_start_params params; + struct ecore_hwfn *p_hwfn; + int rc; + int i; + + memset(¶ms, 0, sizeof(params)); + params.vport_id = 0; + params.mtu = mtu; + /* @DPDK - Disable FW placement */ + params.zero_placement_offset = 1; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.concrete_fid = p_hwfn->hw_info.concrete_fid; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_start(p_hwfn, ¶ms); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Start V-PORT failed %d\n", rc); + return rc; + } + } + ecore_reset_vport_stats(edev); + DP_INFO(edev, "VPORT started with MTU = %u\n", mtu); + + return 0; +} + +static int +qede_stop_vport(struct ecore_dev *edev) +{ + struct ecore_hwfn *p_hwfn; + uint8_t vport_id; + int rc; + int i; + + vport_id = 0; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + rc = ecore_sp_vport_stop(p_hwfn, p_hwfn->hw_info.opaque_fid, + vport_id); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Stop V-PORT failed rc = %d\n", rc); + return rc; + } + } + + return 0; +} + +/* Activate or deactivate vport via vport-update */ +int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg) +{ + struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_hwfn *p_hwfn; + uint8_t i; + int rc = -1; + + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + params.vport_id = 0; + params.update_vport_active_rx_flg = 1; + params.update_vport_active_tx_flg = 1; + params.vport_active_rx_flg = flg; + params.vport_active_tx_flg = flg; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to update vport\n"); + break; + } + } + DP_INFO(edev, "vport %s\n", flg ? "activated" : "deactivated"); + return rc; +} + +static void +qede_update_sge_tpa_params(struct ecore_sge_tpa_params *sge_tpa_params, + uint16_t mtu, bool enable) +{ + /* Enable LRO in split mode */ + sge_tpa_params->tpa_ipv4_en_flg = enable; + sge_tpa_params->tpa_ipv6_en_flg = enable; + sge_tpa_params->tpa_ipv4_tunn_en_flg = false; + sge_tpa_params->tpa_ipv6_tunn_en_flg = false; + /* set if tpa enable changes */ + sge_tpa_params->update_tpa_en_flg = 1; + /* set if tpa parameters should be handled */ + sge_tpa_params->update_tpa_param_flg = enable; + + sge_tpa_params->max_buffers_per_cqe = 20; + /* Enable TPA in split mode. In this mode each TPA segment + * starts on the new BD, so there is one BD per segment. + */ + sge_tpa_params->tpa_pkt_split_flg = 1; + sge_tpa_params->tpa_hdr_data_split_flg = 0; + sge_tpa_params->tpa_gro_consistent_flg = 0; + sge_tpa_params->tpa_max_aggs_num = ETH_TPA_MAX_AGGS_NUM; + sge_tpa_params->tpa_max_size = 0x7FFF; + sge_tpa_params->tpa_min_size_to_start = mtu / 2; + sge_tpa_params->tpa_min_size_to_cont = mtu / 2; +} + +/* Enable/disable LRO via vport-update */ +int qede_enable_tpa(struct rte_eth_dev *eth_dev, bool flg) +{ + struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_sge_tpa_params tpa_params; + struct ecore_hwfn *p_hwfn; + int rc; + int i; + + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + memset(&tpa_params, 0, sizeof(struct ecore_sge_tpa_params)); + qede_update_sge_tpa_params(&tpa_params, qdev->mtu, flg); + params.vport_id = 0; + params.sge_tpa_params = &tpa_params; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to update LRO\n"); + return -1; + } + } + + DP_INFO(edev, "LRO is %s\n", flg ? "enabled" : "disabled"); + + return 0; +} + +/* Update MTU via vport-update without doing port restart. + * The vport must be deactivated before calling this API. + */ +int qede_update_mtu(struct rte_eth_dev *eth_dev, uint16_t mtu) +{ + struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_hwfn *p_hwfn; + int rc; + int i; + + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + params.vport_id = 0; + params.mtu = mtu; + params.vport_id = 0; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to update MTU\n"); + return -1; + } + } + DP_INFO(edev, "MTU updated to %u\n", mtu); + + return 0; +} + static void qede_set_ucast_cmn_params(struct ecore_filter_ucast *ucast) { memset(ucast, 0, sizeof(struct ecore_filter_ucast)); @@ -565,49 +737,57 @@ static void qede_set_cmn_tunn_param(struct ecore_tunnel_info *p_tunn, qede_mac_addr_add(eth_dev, mac_addr, 0, 0); } -static void qede_config_accept_any_vlan(struct qede_dev *qdev, bool action) +static void qede_config_accept_any_vlan(struct qede_dev *qdev, bool flg) { - struct ecore_dev *edev = &qdev->edev; - struct qed_update_vport_params params = { - .vport_id = 0, - .accept_any_vlan = action, - .update_accept_any_vlan_flg = 1, - }; + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_hwfn *p_hwfn; + uint8_t i; int rc; - /* Proceed only if action actually needs to be performed */ - if (qdev->accept_any_vlan == action) - return; - - rc = qdev->ops->vport_update(edev, ¶ms); - if (rc) { - DP_ERR(edev, "Failed to %s accept-any-vlan\n", - action ? "enable" : "disable"); - } else { - DP_INFO(edev, "%s accept-any-vlan\n", - action ? "enabled" : "disabled"); - qdev->accept_any_vlan = action; + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + params.vport_id = 0; + params.update_accept_any_vlan_flg = 1; + params.accept_any_vlan = flg; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to configure accept-any-vlan\n"); + return; + } } + + DP_INFO(edev, "%s accept-any-vlan\n", flg ? "enabled" : "disabled"); } -static int qede_vlan_stripping(struct rte_eth_dev *eth_dev, bool set_stripping) +static int qede_vlan_stripping(struct rte_eth_dev *eth_dev, bool flg) { - struct qed_update_vport_params vport_update_params; struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct ecore_sp_vport_update_params params; + struct ecore_hwfn *p_hwfn; + uint8_t i; int rc; - memset(&vport_update_params, 0, sizeof(vport_update_params)); - vport_update_params.vport_id = 0; - vport_update_params.update_inner_vlan_removal_flg = 1; - vport_update_params.inner_vlan_removal_flg = set_stripping; - rc = qdev->ops->vport_update(edev, &vport_update_params); - if (rc) { - DP_ERR(edev, "Update V-PORT failed %d\n", rc); - return rc; + memset(¶ms, 0, sizeof(struct ecore_sp_vport_update_params)); + params.vport_id = 0; + params.update_inner_vlan_removal_flg = 1; + params.inner_vlan_removal_flg = flg; + for_each_hwfn(edev, i) { + p_hwfn = &edev->hwfns[i]; + params.opaque_fid = p_hwfn->hw_info.opaque_fid; + rc = ecore_sp_vport_update(p_hwfn, ¶ms, + ECORE_SPQ_MODE_EBLOCK, NULL); + if (rc != ECORE_SUCCESS) { + DP_ERR(edev, "Failed to update vport\n"); + return -1; + } } - qdev->vlan_strip_flg = set_stripping; + DP_INFO(edev, "VLAN stripping %s\n", flg ? "enabled" : "disabled"); return 0; } @@ -741,33 +921,6 @@ static void qede_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask) mask, rxmode->hw_vlan_strip, rxmode->hw_vlan_filter); } -static int qede_init_vport(struct qede_dev *qdev) -{ - struct ecore_dev *edev = &qdev->edev; - struct qed_start_vport_params start = {0}; - int rc; - - start.remove_inner_vlan = 1; - start.enable_lro = qdev->enable_lro; - start.mtu = ETHER_MTU + QEDE_ETH_OVERHEAD; - start.vport_id = 0; - start.drop_ttl0 = false; - start.clear_stats = 1; - start.handle_ptp_pkts = 0; - - rc = qdev->ops->vport_start(edev, &start); - if (rc) { - DP_ERR(edev, "Start V-PORT failed %d\n", rc); - return rc; - } - - DP_INFO(edev, - "Start vport ramrod passed, vport_id = %d, MTU = %u\n", - start.vport_id, ETHER_MTU); - - return 0; -} - static void qede_prandom_bytes(uint32_t *buff) { uint8_t i; @@ -863,9 +1016,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) /* Check for the port restart case */ if (qdev->state != QEDE_DEV_INIT) { - rc = qdev->ops->vport_stop(edev, 0); - if (rc != 0) - return rc; + qede_stop_vport(edev); qede_dealloc_fp_resc(eth_dev); } @@ -880,17 +1031,24 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) if (rc != 0) return rc; - /* Issue VPORT-START with default config values to allow - * other port configurations early on. + /* VF's MTU has to be set using vport-start where as + * PF's MTU can be updated via vport-update. */ - rc = qede_init_vport(qdev); - if (rc != 0) - return rc; + if (IS_VF(edev)) { + if (qede_start_vport(qdev, rxmode->max_rx_pkt_len)) + return -1; + } else { + if (qede_update_mtu(eth_dev, rxmode->max_rx_pkt_len)) + return -1; + } + + qdev->mtu = rxmode->max_rx_pkt_len; + qdev->new_mtu = qdev->mtu; if (!(rxmode->mq_mode == ETH_MQ_RX_RSS || rxmode->mq_mode == ETH_MQ_RX_NONE)) { DP_ERR(edev, "Unsupported RSS mode\n"); - qdev->ops->vport_stop(edev, 0); + qede_stop_vport(edev); qede_dealloc_fp_resc(eth_dev); return -EINVAL; } @@ -898,7 +1056,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) /* Flow director mode check */ rc = qede_check_fdir_support(eth_dev); if (rc) { - qdev->ops->vport_stop(edev, 0); + qede_stop_vport(edev); qede_dealloc_fp_resc(eth_dev); return -EINVAL; } @@ -1106,7 +1264,6 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev) struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); - int rc; PMD_INIT_FUNC_TRACE(edev); @@ -1122,9 +1279,7 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev) else DP_INFO(edev, "Device is already stopped\n"); - rc = qdev->ops->vport_stop(edev, 0); - if (rc != 0) - DP_ERR(edev, "Failed to stop VPORT\n"); + qede_stop_vport(edev); qede_dealloc_fp_resc(eth_dev); @@ -2322,6 +2477,11 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) } adapter->state = QEDE_DEV_INIT; + adapter->mtu = ETHER_MTU; + adapter->new_mtu = ETHER_MTU; + if (!is_vf) + if (qede_start_vport(adapter, adapter->mtu)) + return -1; DP_NOTICE(edev, false, "MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n", adapter->primary_mac.addr_bytes[0], diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h index e4323a0..62b1de4 100644 --- a/drivers/net/qede/qede_ethdev.h +++ b/drivers/net/qede/qede_ethdev.h @@ -190,6 +190,7 @@ struct qede_dev { struct qede_fastpath *fp_array; uint8_t num_tc; uint16_t mtu; + uint16_t new_mtu; bool rss_enable; struct rte_eth_rss_conf rss_conf; uint16_t rss_ind_table[ECORE_RSS_IND_TABLE_SIZE]; @@ -248,4 +249,10 @@ uint16_t qede_fdir_construct_pkt(struct rte_eth_dev *eth_dev, void qede_fdir_dealloc_resc(struct rte_eth_dev *eth_dev); +int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg); + +int qede_update_mtu(struct rte_eth_dev *eth_dev, uint16_t mtu); + +int qede_enable_tpa(struct rte_eth_dev *eth_dev, bool flg); + #endif /* _QEDE_ETHDEV_H_ */ diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index baea1bb..67496f3 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -506,42 +506,11 @@ void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev) PMD_RX_LOG(DEBUG, rxq, "bd_prod %u cqe_prod %u", bd_prod, cqe_prod); } -static void -qede_update_sge_tpa_params(struct ecore_sge_tpa_params *sge_tpa_params, - uint16_t mtu, bool enable) -{ - /* Enable LRO in split mode */ - sge_tpa_params->tpa_ipv4_en_flg = enable; - sge_tpa_params->tpa_ipv6_en_flg = enable; - sge_tpa_params->tpa_ipv4_tunn_en_flg = false; - sge_tpa_params->tpa_ipv6_tunn_en_flg = false; - /* set if tpa enable changes */ - sge_tpa_params->update_tpa_en_flg = 1; - /* set if tpa parameters should be handled */ - sge_tpa_params->update_tpa_param_flg = enable; - - sge_tpa_params->max_buffers_per_cqe = 20; - /* Enable TPA in split mode. In this mode each TPA segment - * starts on the new BD, so there is one BD per segment. - */ - sge_tpa_params->tpa_pkt_split_flg = 1; - sge_tpa_params->tpa_hdr_data_split_flg = 0; - sge_tpa_params->tpa_gro_consistent_flg = 0; - sge_tpa_params->tpa_max_aggs_num = ETH_TPA_MAX_AGGS_NUM; - sge_tpa_params->tpa_max_size = 0x7FFF; - sge_tpa_params->tpa_min_size_to_start = mtu / 2; - sge_tpa_params->tpa_min_size_to_cont = mtu / 2; -} - -static int qede_start_queues(struct rte_eth_dev *eth_dev, - __rte_unused bool clear_stats) +static int qede_start_queues(struct rte_eth_dev *eth_dev) { struct qede_dev *qdev = eth_dev->data->dev_private; struct ecore_dev *edev = &qdev->edev; struct ecore_queue_start_common_params q_params; - struct qed_dev_info *qed_info = &qdev->dev_info.common; - struct qed_update_vport_params vport_update_params; - struct ecore_sge_tpa_params tpa_params; struct qede_tx_queue *txq; struct qede_fastpath *fp; dma_addr_t p_phys_table; @@ -635,35 +604,6 @@ static int qede_start_queues(struct rte_eth_dev *eth_dev, } } - /* Prepare and send the vport enable */ - memset(&vport_update_params, 0, sizeof(vport_update_params)); - /* Update MTU via vport update */ - vport_update_params.mtu = qdev->mtu; - vport_update_params.vport_id = 0; - vport_update_params.update_vport_active_flg = 1; - vport_update_params.vport_active_flg = 1; - - /* @DPDK */ - if (qed_info->mf_mode == MF_NPAR && qed_info->tx_switching) { - /* TBD: Check SRIOV enabled for VF */ - vport_update_params.update_tx_switching_flg = 1; - vport_update_params.tx_switching_flg = 1; - } - - /* TPA */ - if (qdev->enable_lro) { - DP_INFO(edev, "Enabling LRO\n"); - memset(&tpa_params, 0, sizeof(struct ecore_sge_tpa_params)); - qede_update_sge_tpa_params(&tpa_params, qdev->mtu, true); - vport_update_params.sge_tpa_params = &tpa_params; - } - - rc = qdev->ops->vport_update(edev, &vport_update_params); - if (rc) { - DP_ERR(edev, "Update V-PORT failed %d\n", rc); - return rc; - } - return 0; } @@ -1703,7 +1643,18 @@ int qede_dev_start(struct rte_eth_dev *eth_dev) if (qdev->state == QEDE_DEV_CONFIG) qede_init_fp_queue(eth_dev); - rc = qede_start_queues(eth_dev, true); + /* Update MTU only if it has changed */ + if (qdev->mtu != qdev->new_mtu) { + if (qede_update_mtu(eth_dev, qdev->new_mtu)) + return -1; + qdev->mtu = qdev->new_mtu; + /* If MTU has changed then update TPA too */ + if (qdev->enable_lro) + if (qede_enable_tpa(eth_dev, true)) + return -1; + } + + rc = qede_start_queues(eth_dev); if (rc) { DP_ERR(edev, "Failed to start queues\n"); /* TBD: free */ @@ -1719,6 +1670,10 @@ int qede_dev_start(struct rte_eth_dev *eth_dev) if (qede_config_rss(eth_dev)) return -1; + /* Enable vport*/ + if (qede_activate_vport(eth_dev, true)) + return -1; + /* Bring-up the link */ qede_dev_set_link_state(eth_dev, true); @@ -1769,33 +1724,10 @@ static int qede_drain_txq(struct qede_dev *qdev, static int qede_stop_queues(struct qede_dev *qdev) { - struct qed_update_vport_params vport_update_params; struct ecore_dev *edev = &qdev->edev; - struct ecore_sge_tpa_params tpa_params; struct qede_fastpath *fp; int rc, tc, i; - /* Disable the vport */ - memset(&vport_update_params, 0, sizeof(vport_update_params)); - vport_update_params.vport_id = 0; - vport_update_params.update_vport_active_flg = 1; - vport_update_params.vport_active_flg = 0; - vport_update_params.update_rss_flg = 0; - /* Disable TPA */ - if (qdev->enable_lro) { - DP_INFO(edev, "Disabling LRO\n"); - memset(&tpa_params, 0, sizeof(struct ecore_sge_tpa_params)); - qede_update_sge_tpa_params(&tpa_params, qdev->mtu, false); - vport_update_params.sge_tpa_params = &tpa_params; - } - - DP_INFO(edev, "Deactivate vport\n"); - rc = qdev->ops->vport_update(edev, &vport_update_params); - if (rc) { - DP_ERR(edev, "Failed to update vport\n"); - return rc; - } - DP_INFO(edev, "Flushing tx queues\n"); /* Flush Tx queues. If needed, request drain from MCP */ @@ -1928,6 +1860,10 @@ void qede_dev_stop(struct rte_eth_dev *eth_dev) return; } + /* Disable vport */ + if (qede_activate_vport(eth_dev, false)) + return; + if (qede_stop_queues(qdev)) DP_ERR(edev, "Didn't succeed to close queues\n"); -- 1.7.10.3