From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8DE2EA034C; Thu, 1 Sep 2022 19:23:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 827554114B; Thu, 1 Sep 2022 19:23:18 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2089.outbound.protection.outlook.com [40.107.237.89]) by mails.dpdk.org (Postfix) with ESMTP id 594FD4114B for ; Thu, 1 Sep 2022 19:23:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tq5YmcZwga1BwnupMhal0CKDPZIvttGgmmGGd5WO7dO1X2+uV71demwqpSUEsvBxNT9KyKbQv77rfrclKpnKDK0n6FexOmwb5AqVh/T+jBb4EETea0kJ4G5kyqrd4Aop+Zd/2Evi6Rg3evdB/12b12UQa5YXkx1c7K0G8OqsjriGk9cPRTNNc5oNTjWrp3TYRHObV0BwbFtRKLmv0DsvuZyMMTc/g5PVy31j22+O9jy7dHgGIsHYpj5ojL/qo4bi68wvYQCoImHFMSzvJ9YbdeSn+NgD/LOzfcs1Em9Ov1Qgk8fB34vfCTom5aOvFai3MQrEW4IHZ28P/tJRAyQXnw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=17pwxPNKootY4d/MBAWOyyQmXpsy0iTWcaBSbsAB+WA=; b=KMoBnbEDMRHX+PuP/nsVvp8zjZyo8b1tZH2/Xgke9LmGf0rrAODp54u3gnGwZy/b1vhFLeMnYqPLTbvbxbwdrp3UdsbGIl6+Asyp+kxAiuu0ULTESHnRRb7jY7isnfCQYKiBvOAZRAPRxlsjz+4wuw3nS6PnKcX3ZVCXa3d9XfahiAY/5x2aLRz9QZwvy7jVFA/Be3B6ivJM1IgQdn8Ca0KzKlNHYNb9Ujyl+/ok7rIxS/yjMV//L5KT6eMpV4JJtGX31oV3m9tYFK5pS/4CIqkAxntBNB8SHOF1lM/ZCMJcCb6Pr/sJ82vdLkFJvRLdJML7P8Sbl5E7lU9Grlkv6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=intel.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=17pwxPNKootY4d/MBAWOyyQmXpsy0iTWcaBSbsAB+WA=; b=EkGMJZWco9CE3/rOdnmHbb1qaXwqi4bbPO9qPu+jcW2vMGxWqxUW/q/akQrMRbBEYZ02QBqhzdasABXf7JAOdL9gnX++Yv1Rk2UmClMw91wIiW4x/kbBS+bp6FBXuFPEMvI0R8BrfdgPVFqkaZXojjPvX7+qZl0Fg1QwSvNpxOw= Received: from DM6PR05CA0065.namprd05.prod.outlook.com (2603:10b6:5:335::34) by DM5PR0201MB3510.namprd02.prod.outlook.com (2603:10b6:4:81::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Thu, 1 Sep 2022 17:23:09 +0000 Received: from DM3NAM02FT049.eop-nam02.prod.protection.outlook.com (2603:10b6:5:335:cafe::8d) by DM6PR05CA0065.outlook.office365.com (2603:10b6:5:335::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.5 via Frontend Transport; Thu, 1 Sep 2022 17:23:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch01.xlnx.xilinx.com; pr=C Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT049.mail.protection.outlook.com (10.13.5.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5588.10 via Frontend Transport; Thu, 1 Sep 2022 17:23:09 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 1 Sep 2022 18:23:06 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Thu, 1 Sep 2022 18:23:06 +0100 Envelope-to: junfeng.guo@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com, dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com, bruce.richardson@intel.com Received: from [10.71.194.74] (port=6400) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oTnuE-0008Kh-RU; Thu, 01 Sep 2022 18:23:06 +0100 Message-ID: Date: Thu, 1 Sep 2022 18:23:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v2 04/10] net/gve: add link update support Content-Language: en-US To: Junfeng Guo , , CC: , , , References: <20220729193042.2764633-2-xiaoyun.li@intel.com> <20220829084127.934183-1-junfeng.guo@intel.com> <20220829084127.934183-5-junfeng.guo@intel.com> From: Ferruh Yigit In-Reply-To: <20220829084127.934183-5-junfeng.guo@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e3760922-8eca-451a-6af0-08da8c3ea40a X-MS-TrafficTypeDiagnostic: DM5PR0201MB3510:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wuaH9iwKNsH3noPdaSL/zx59XxplROt5AB8+9V8NdtlMfS+InjP4Q96NLoE3eE7XZC2ZzLBBBT8SStzkBeBu9pw9k8Jl9k1WGXUqZpO9E9XMkTDUFSAyQebxhFMN37kZhajhyLFzS7h78d09nXV71H0Ji1NkP6mGJcWi+4Ca0KCcov7Hie0RCyqHJYyUzprg2rjnBbNKbb5DGhcTyx1WF3/twOTT2gdoweThFzV7kffVFGK7QWXaNubGF4hWE5H4Oyiqemhy0Rp3l9GYq/5ba7E5VPHqaeHyQoN3EJXP3ExV0MhD1RF4jmlQnlwOBDOEY/X5w7OzXBHzM7yFDAVa218/3+jw3MDRud0oByemcRuaCGKPz0WhuRPrN9dT4JKds+3O3Kr0VEaa07TO3Br0YhT8cX37jeV+O80J2M7hoPQGffKPZVEsfidjfPTkp/X9+Qy7vNeaoydCWAzW4TZ6eHoKyfkwY1vdrmET0AEUjEPRjUk2JPuGU+Gr+FooxYD7urfYiBqOtRQbhZr3RguAd7p05/5rmYwd+Pr159eIQh4yhR5GL7asYui1wKLliC+Gv7+6WvEuiFkVeNpTLRnmAzIrvj3fp2LeHjhAOLwMCkSKjB25rbjqgd0R7cmr00Aap3LtuIw1NqWY6jno9zFr0XVOROy0n73EJPUoJ618uVb1xVoMUBlAOZA2pJ/whhQRitDhcbuCBpSf8YHunI5Dcako+5tznPt0EOxL5M+fUfR1fFtHqDNBoZWACkKz8HFV+nAFQMrZ8tsyuVBYpK+iXRplatEbbLXQ9LhaqrA3Ky+jBU8zWHobdRUQd3HveJ5j X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(396003)(346002)(136003)(376002)(36840700001)(40470700004)(46966006)(478600001)(41300700001)(70586007)(53546011)(83380400001)(44832011)(31696002)(4326008)(8676002)(40460700003)(2906002)(2616005)(47076005)(186003)(336012)(9786002)(426003)(70206006)(5660300002)(8936002)(54906003)(36756003)(7636003)(316002)(36860700001)(40480700001)(26005)(82740400003)(31686004)(110136005)(356005)(82310400005)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2022 17:23:09.2010 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3760922-8eca-451a-6af0-08da8c3ea40a X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT049.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3510 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 8/29/2022 9:41 AM, Junfeng Guo wrote: > > Support dev_ops link_update. > > Signed-off-by: Xiaoyun Li > Signed-off-by: Junfeng Guo > --- > drivers/net/gve/gve_ethdev.c | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c > index f10f273f7d..435115c047 100644 > --- a/drivers/net/gve/gve_ethdev.c > +++ b/drivers/net/gve/gve_ethdev.c > @@ -37,10 +37,39 @@ gve_dev_configure(__rte_unused struct rte_eth_dev *dev) > return 0; > } > > +static int > +gve_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complete) > +{ > + struct gve_priv *priv = dev->data->dev_private; > + struct rte_eth_link link; > + int err; > + > + memset(&link, 0, sizeof(link)); > + link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX; > + link.link_autoneg = RTE_ETH_LINK_AUTONEG; > + > + if (!dev->data->dev_started) { > + link.link_status = RTE_ETH_LINK_DOWN; > + link.link_speed = RTE_ETH_SPEED_NUM_NONE; > + } else { > + link.link_status = RTE_ETH_LINK_UP; > + PMD_INIT_LOG(DEBUG, "Get link status from hw"); > + err = gve_adminq_report_link_speed(priv); As far as I can see the API is calling an adminq command, is this command blocking until link is up? If so is there a non blocking version to utilize 'wait_to_complete', instead of ignoring it? Also what will happen if 'start()' dev_ops called but cable is not plugged in at all, won't this set link status still to "UP"?