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 84CC2A0C4B; Tue, 27 Jul 2021 15:35:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C2D8410FA; Tue, 27 Jul 2021 15:35:22 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id CFA65410ED for ; Tue, 27 Jul 2021 15:35:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627392919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oLuv/eTErbOAyIdlnL6W4U6l4c8xzkDBuzDK2p7fvwM=; b=ap7VZlGaaaDRzBSEXhohufx7Qq+rFWsiidi9brkvI/rJAZWZy5Kin3lyqoNGF2whhXTF1i bOyZHc9wOHEnmG6zaJ7Nefm+ogmnwIWvHBUx0B5N2vb9BG8PG4x2bG59le8TT7DmMRo4lc hSXk7sDvClA915zqhCyN/sXVG8ysIeo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-KjFnb6fROseIyswiIO6gfw-1; Tue, 27 Jul 2021 09:35:17 -0400 X-MC-Unique: KjFnb6fROseIyswiIO6gfw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F1698799EC; Tue, 27 Jul 2021 13:35:16 +0000 (UTC) Received: from [10.36.110.10] (unknown [10.36.110.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 893CB19D7C; Tue, 27 Jul 2021 13:35:15 +0000 (UTC) To: Chenbo Xia , dev@dpdk.org Cc: stable@dpdk.org References: <20210727051441.40332-1-chenbo.xia@intel.com> From: Maxime Coquelin Message-ID: <34d59037-4e02-e123-0d30-a84242c1eef4@redhat.com> Date: Tue, 27 Jul 2021 15:35:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210727051441.40332-1-chenbo.xia@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix uninitialized duplex mode 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 Sender: "dev" On 7/27/21 7:14 AM, Chenbo Xia wrote: > When virtio front-end initializes, the duplex mode should be set > unknown before reading any duplex mode information from configuration > space. This patch fixes the issue that duplex mode is by default set > to zero, which equals ETH_LINK_HALF_DUPLEX. This will lead to duplex > mode being half duplex when fron-end does not have the feature > named VIRTIO_NET_F_SPEED_DUPLEX. > > Fixes: 1357b4b36246 ("net/virtio: support Virtio link speed feature") > Cc: stable@dpdk.org > > Signed-off-by: Chenbo Xia > --- > drivers/net/virtio/virtio_ethdev.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 72d3dda71f..9061db4e41 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1901,6 +1901,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) > if (ret < 0) > return ret; > hw->speed = speed; > + hw->duplex = DUPLEX_UNKNOWN; > > /* Allocate memory for storing MAC addresses */ > eth_dev->data->mac_addrs = rte_zmalloc("virtio", > Reviewed-by: Maxime Coquelin Thanks, Maxime