From nobody Sat Feb 7 10:16:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519962578722660.1977281394279; Thu, 1 Mar 2018 19:49:38 -0800 (PST) Received: from localhost ([::1]:60491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erbhR-0001oF-JF for importer@patchew.org; Thu, 01 Mar 2018 22:49:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erbex-0000YB-EX for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erbew-0000vi-HV for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:03 -0500 Received: from mx0b-00190b01.pphosted.com ([2620:100:9005:57f::1]:55714) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erbew-0000vB-BS for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:02 -0500 Received: from pps.filterd (m0122331.ppops.net [127.0.0.1]) by mx0b-00190b01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w223g6qX014825; Fri, 2 Mar 2018 03:47:00 GMT Received: from prod-mail-ppoint2 (prod-mail-ppoint2.akamai.com [184.51.33.19]) by mx0b-00190b01.pphosted.com with ESMTP id 2gdqbyp59x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Mar 2018 03:47:00 +0000 Received: from pps.filterd (prod-mail-ppoint2.akamai.com [127.0.0.1]) by prod-mail-ppoint2.akamai.com (8.16.0.21/8.16.0.21) with SMTP id w223k5Kh016034; Thu, 1 Mar 2018 22:46:59 -0500 Received: from prod-mail-relay11.akamai.com ([172.27.118.250]) by prod-mail-ppoint2.akamai.com with ESMTP id 2gb49ed8s5-1; Thu, 01 Mar 2018 22:46:59 -0500 Received: from bos-lpjec.kendall.corp.akamai.com (bos-lpjec.kendall.corp.akamai.com [172.28.13.109]) by prod-mail-relay11.akamai.com (Postfix) with ESMTP id 73D7733559; Fri, 2 Mar 2018 03:46:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : in-reply-to : references; s=jan2016.eng; bh=TsnBhFjeoj7hM63sH6OdcJn/8g6nWzt4i8oMZ5188uA=; b=BqcBY/LBSbszfw3TLxi9SgdXV90Xcl4Tt7RLCiheGWd1+R0TODHqqE7mw1prreK7Aj+d Csdg3lJcPGWHuBZ7T9ypkOxX0k/jDn53W115z5Wbz74WSzF/B+l+fDfVVogz6hvNlzzW 9sM1mTyZFTADbP51IxgrYdA8CO6cyQjGrqyc9PNAlV7n14vpgXbeDNkxk/mNjDL+JLvb 6jaY4KobfNlEIQqaqn84eEEup3ULaUjrckWpZcsOb+7hQQ8LglMREaDZMwUBi/IYKpeE 2EjsszECq19PDxWgagUYoXWW6faJwcRHH1Z85VgtQjCB+yeNyAEQfOYUK7XwEogjlDlV vw== To: mst@redhat.com Date: Thu, 1 Mar 2018 22:46:33 -0500 Message-Id: <864430f2a613c4d3c82b591ed7bc27068ddad369.1519961667.git.jbaron@akamai.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-02_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=836 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020040 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-02_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=826 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020039 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 2620:100:9005:57f::1 Subject: [Qemu-devel] [PATCH 1/4] eth: add speed and duplex definitions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jason Baron via Qemu-devel Reply-To: Jason Baron Cc: virtio-dev@lists.oasis-open.org, jasowang@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Pull in definitions for SPEED_UNKNOWN, DUPLEX_UNKNOWN, DUPLEX_HALF, and DUPLEX_FULL. Signed-off-by: Jason Baron Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: virtio-dev@lists.oasis-open.org --- include/net/eth.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/net/eth.h b/include/net/eth.h index 09054a5..9843678 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -417,4 +417,11 @@ bool eth_parse_ipv6_hdr(const struct iovec *pkt, int pkt_frags, size_t ip6hdr_off, eth_ip6_hdr_info *info); =20 +/* ethtool defines - from linux/ethtool.h */ +#define SPEED_UNKNOWN -1 + +#define DUPLEX_HALF 0x00 +#define DUPLEX_FULL 0x01 +#define DUPLEX_UNKNOWN 0xff + #endif --=20 2.7.4 From nobody Sat Feb 7 10:16:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519962583071801.5900508076592; Thu, 1 Mar 2018 19:49:43 -0800 (PST) Received: from localhost ([::1]:60492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erbhW-0001u8-9D for importer@patchew.org; Thu, 01 Mar 2018 22:49:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erbf5-0000c9-Tr for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erbf1-0000zb-Ui for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:11 -0500 Received: from mx0a-00190b01.pphosted.com ([2620:100:9001:583::1]:47326) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erbf1-0000z2-L9 for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:07 -0500 Received: from pps.filterd (m0050095.ppops.net [127.0.0.1]) by mx0a-00190b01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w223g7Fv021636; Fri, 2 Mar 2018 03:47:05 GMT Received: from prod-mail-ppoint2 (prod-mail-ppoint2.akamai.com [184.51.33.19]) by m0050095.ppops.net-00190b01. with ESMTP id 2gdqcaf9wy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Mar 2018 03:47:05 +0000 Received: from pps.filterd (prod-mail-ppoint2.akamai.com [127.0.0.1]) by prod-mail-ppoint2.akamai.com (8.16.0.21/8.16.0.21) with SMTP id w223k5Kk016034; Thu, 1 Mar 2018 22:47:04 -0500 Received: from prod-mail-relay11.akamai.com ([172.27.118.250]) by prod-mail-ppoint2.akamai.com with ESMTP id 2gb49ed8se-1; Thu, 01 Mar 2018 22:47:04 -0500 Received: from bos-lpjec.kendall.corp.akamai.com (bos-lpjec.kendall.corp.akamai.com [172.28.13.109]) by prod-mail-relay11.akamai.com (Postfix) with ESMTP id 2EDA233624; Fri, 2 Mar 2018 03:47:04 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : in-reply-to : references; s=jan2016.eng; bh=TnEvg7XsUWmpuj4Z/KqSleQREJ6HGgP/aOHGKY0lWtM=; b=gr9SmOaFA+ijb4NecbIhClNnrxyOsSOvbGiRBsJtqWzczbaoeKlKqs8hLgjaLqDEOZKB iV7yY/9wUJyB5V79CINQf0Y6TLbS4SrSpzza2w7kovuxgJzIDQKs5birXnn9sGhd92Y4 7H6fQlWTBV3DhZrjxQVUTMjoljk6+3DwDZjOdskkR4CR3YPdrOkpNMnXhcmakWiOepvS RzODmII60HHuLDQ/c+bPYvCYsZ12IZCxrQx2oldATFonL5QLdR+6aR9Cn1B0SgqHa/M5 7mZgdadI51z0d8NnZ1187FfQ3SU5z3s2dHP4Ov07BE//t1uyb/topl3X47xl46c+a15i +A== To: mst@redhat.com Date: Thu, 1 Mar 2018 22:46:34 -0500 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-02_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=748 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020040 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-02_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=738 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020039 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 2620:100:9001:583::1 Subject: [Qemu-devel] [PATCH 2/4] rocker: drop local duplex definitions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jason Baron via Qemu-devel Reply-To: Jason Baron Cc: virtio-dev@lists.oasis-open.org, jasowang@redhat.com, Jiri Pirko , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Make use of duplex definitions from net/eth.h. Signed-off-by: Jason Baron Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Jiri Pirko Cc: virtio-dev@lists.oasis-open.org --- hw/net/rocker/rocker_fp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/net/rocker/rocker_fp.c b/hw/net/rocker/rocker_fp.c index 4b3c984..13a14a0 100644 --- a/hw/net/rocker/rocker_fp.c +++ b/hw/net/rocker/rocker_fp.c @@ -16,17 +16,13 @@ =20 #include "qemu/osdep.h" #include "net/clients.h" +#include "net/eth.h" =20 #include "rocker.h" #include "rocker_hw.h" #include "rocker_fp.h" #include "rocker_world.h" =20 -enum duplex { - DUPLEX_HALF =3D 0, - DUPLEX_FULL -}; - struct fp_port { Rocker *r; World *world; --=20 2.7.4 From nobody Sat Feb 7 10:16:03 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519962712573663.2386703439016; Thu, 1 Mar 2018 19:51:52 -0800 (PST) Received: from localhost ([::1]:60505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erbjW-0003mK-QU for importer@patchew.org; Thu, 01 Mar 2018 22:51:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erbf6-0000cm-Gs for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erbf2-0000zk-DJ for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:12 -0500 Received: from mx0b-00190b01.pphosted.com ([2620:100:9005:57f::1]:52682) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erbf2-0000zZ-7B for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:08 -0500 Received: from pps.filterd (m0050102.ppops.net [127.0.0.1]) by mx0b-00190b01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w223gZDI006623; Fri, 2 Mar 2018 03:47:06 GMT Received: from prod-mail-ppoint1 (prod-mail-ppoint1.akamai.com [184.51.33.18]) by m0050102.ppops.net-00190b01. with ESMTP id 2gdqcdxjf5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Mar 2018 03:47:06 +0000 Received: from pps.filterd (prod-mail-ppoint1.akamai.com [127.0.0.1]) by prod-mail-ppoint1.akamai.com (8.16.0.21/8.16.0.21) with SMTP id w223k5YN021454; Thu, 1 Mar 2018 22:47:05 -0500 Received: from prod-mail-relay11.akamai.com ([172.27.118.250]) by prod-mail-ppoint1.akamai.com with ESMTP id 2gb49058rb-1; Thu, 01 Mar 2018 22:47:05 -0500 Received: from bos-lpjec.kendall.corp.akamai.com (bos-lpjec.kendall.corp.akamai.com [172.28.13.109]) by prod-mail-relay11.akamai.com (Postfix) with ESMTP id 6469833635; Fri, 2 Mar 2018 03:47:05 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : in-reply-to : references; s=jan2016.eng; bh=AI47cPt9A9ewt8GTwInd6XNb9E79a9E1A6Htgmn2bXE=; b=SsMlWsXeK5i1WzENDe4QCNo1itTqU9duStt0PVEOQuYiOUgQo3TYoczC9Mq4NO/QQr/p nHLnGZDStJ+PiWKzB8FmmP8n98/zCsj8FIXlsZct3cpodVIuh7zJ0FkD+0utNlZsnR6i fdfAPaDmWtRdzTGOjjQA0j7+RY7FVOnKG06pPP+zjhWd5acut9EClYCcgVVj7nJGRcpM SwdgSerGV5067vt809NEI3v7SoeBpqYWx3gsRx6anJOEMSt0Ghq1UfGgidqWQSXzmX44 zXDz4uSReTUHQjeSIR/6b/tnNsueRTFs2WqZZYaCaH1UTKSU8dc0Eb2Bo5kA0xwjuLdx 6w== To: mst@redhat.com Date: Thu, 1 Mar 2018 22:46:35 -0500 Message-Id: <70232f5883a06879e6492e547465a3c51ed21c74.1519961667.git.jbaron@akamai.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-02_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020040 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-02_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020039 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 2620:100:9005:57f::1 Subject: [Qemu-devel] [PATCH 3/4] virtio-net: use 64-bit values for feature flags X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jason Baron via Qemu-devel Reply-To: Jason Baron Cc: virtio-dev@lists.oasis-open.org, jasowang@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In prepartion for using some of the high order feature bits, make sure that virtio-net uses 64-bit values everywhere. Signed-off-by: Jason Baron Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: virtio-dev@lists.oasis-open.org --- hw/net/virtio-net.c | 55 +++++++++++++++++++++-----------------= ---- include/hw/virtio/virtio-net.h | 2 +- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 369d40b..4feaa49 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -48,18 +48,18 @@ (offsetof(container, field) + sizeof(((container *)0)->field)) =20 typedef struct VirtIOFeature { - uint32_t flags; + uint64_t flags; size_t end; } VirtIOFeature; =20 static VirtIOFeature feature_sizes[] =3D { - {.flags =3D 1 << VIRTIO_NET_F_MAC, + {.flags =3D 1ULL << VIRTIO_NET_F_MAC, .end =3D endof(struct virtio_net_config, mac)}, - {.flags =3D 1 << VIRTIO_NET_F_STATUS, + {.flags =3D 1ULL << VIRTIO_NET_F_STATUS, .end =3D endof(struct virtio_net_config, status)}, - {.flags =3D 1 << VIRTIO_NET_F_MQ, + {.flags =3D 1ULL << VIRTIO_NET_F_MQ, .end =3D endof(struct virtio_net_config, max_virtqueue_pairs)}, - {.flags =3D 1 << VIRTIO_NET_F_MTU, + {.flags =3D 1ULL << VIRTIO_NET_F_MTU, .end =3D endof(struct virtio_net_config, mtu)}, {} }; @@ -1938,7 +1938,7 @@ static void virtio_net_device_realize(DeviceState *de= v, Error **errp) int i; =20 if (n->net_conf.mtu) { - n->host_features |=3D (0x1 << VIRTIO_NET_F_MTU); + n->host_features |=3D (1ULL << VIRTIO_NET_F_MTU); } =20 virtio_net_set_config_size(n, n->host_features); @@ -2109,45 +2109,46 @@ static const VMStateDescription vmstate_virtio_net = =3D { }; =20 static Property virtio_net_properties[] =3D { - DEFINE_PROP_BIT("csum", VirtIONet, host_features, VIRTIO_NET_F_CSUM, t= rue), - DEFINE_PROP_BIT("guest_csum", VirtIONet, host_features, + DEFINE_PROP_BIT64("csum", VirtIONet, host_features, + VIRTIO_NET_F_CSUM, true), + DEFINE_PROP_BIT64("guest_csum", VirtIONet, host_features, VIRTIO_NET_F_GUEST_CSUM, true), - DEFINE_PROP_BIT("gso", VirtIONet, host_features, VIRTIO_NET_F_GSO, tru= e), - DEFINE_PROP_BIT("guest_tso4", VirtIONet, host_features, + DEFINE_PROP_BIT64("gso", VirtIONet, host_features, VIRTIO_NET_F_GSO, t= rue), + DEFINE_PROP_BIT64("guest_tso4", VirtIONet, host_features, VIRTIO_NET_F_GUEST_TSO4, true), - DEFINE_PROP_BIT("guest_tso6", VirtIONet, host_features, + DEFINE_PROP_BIT64("guest_tso6", VirtIONet, host_features, VIRTIO_NET_F_GUEST_TSO6, true), - DEFINE_PROP_BIT("guest_ecn", VirtIONet, host_features, + DEFINE_PROP_BIT64("guest_ecn", VirtIONet, host_features, VIRTIO_NET_F_GUEST_ECN, true), - DEFINE_PROP_BIT("guest_ufo", VirtIONet, host_features, + DEFINE_PROP_BIT64("guest_ufo", VirtIONet, host_features, VIRTIO_NET_F_GUEST_UFO, true), - DEFINE_PROP_BIT("guest_announce", VirtIONet, host_features, + DEFINE_PROP_BIT64("guest_announce", VirtIONet, host_features, VIRTIO_NET_F_GUEST_ANNOUNCE, true), - DEFINE_PROP_BIT("host_tso4", VirtIONet, host_features, + DEFINE_PROP_BIT64("host_tso4", VirtIONet, host_features, VIRTIO_NET_F_HOST_TSO4, true), - DEFINE_PROP_BIT("host_tso6", VirtIONet, host_features, + DEFINE_PROP_BIT64("host_tso6", VirtIONet, host_features, VIRTIO_NET_F_HOST_TSO6, true), - DEFINE_PROP_BIT("host_ecn", VirtIONet, host_features, + DEFINE_PROP_BIT64("host_ecn", VirtIONet, host_features, VIRTIO_NET_F_HOST_ECN, true), - DEFINE_PROP_BIT("host_ufo", VirtIONet, host_features, + DEFINE_PROP_BIT64("host_ufo", VirtIONet, host_features, VIRTIO_NET_F_HOST_UFO, true), - DEFINE_PROP_BIT("mrg_rxbuf", VirtIONet, host_features, + DEFINE_PROP_BIT64("mrg_rxbuf", VirtIONet, host_features, VIRTIO_NET_F_MRG_RXBUF, true), - DEFINE_PROP_BIT("status", VirtIONet, host_features, + DEFINE_PROP_BIT64("status", VirtIONet, host_features, VIRTIO_NET_F_STATUS, true), - DEFINE_PROP_BIT("ctrl_vq", VirtIONet, host_features, + DEFINE_PROP_BIT64("ctrl_vq", VirtIONet, host_features, VIRTIO_NET_F_CTRL_VQ, true), - DEFINE_PROP_BIT("ctrl_rx", VirtIONet, host_features, + DEFINE_PROP_BIT64("ctrl_rx", VirtIONet, host_features, VIRTIO_NET_F_CTRL_RX, true), - DEFINE_PROP_BIT("ctrl_vlan", VirtIONet, host_features, + DEFINE_PROP_BIT64("ctrl_vlan", VirtIONet, host_features, VIRTIO_NET_F_CTRL_VLAN, true), - DEFINE_PROP_BIT("ctrl_rx_extra", VirtIONet, host_features, + DEFINE_PROP_BIT64("ctrl_rx_extra", VirtIONet, host_features, VIRTIO_NET_F_CTRL_RX_EXTRA, true), - DEFINE_PROP_BIT("ctrl_mac_addr", VirtIONet, host_features, + DEFINE_PROP_BIT64("ctrl_mac_addr", VirtIONet, host_features, VIRTIO_NET_F_CTRL_MAC_ADDR, true), - DEFINE_PROP_BIT("ctrl_guest_offloads", VirtIONet, host_features, + DEFINE_PROP_BIT64("ctrl_guest_offloads", VirtIONet, host_features, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true), - DEFINE_PROP_BIT("mq", VirtIONet, host_features, VIRTIO_NET_F_MQ, false= ), + DEFINE_PROP_BIT64("mq", VirtIONet, host_features, VIRTIO_NET_F_MQ, fal= se), DEFINE_NIC_PROPERTIES(VirtIONet, nic_conf), DEFINE_PROP_UINT32("x-txtimer", VirtIONet, net_conf.txtimer, TX_TIMER_INTERVAL), diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index b81b6a4..e7634c9 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -67,7 +67,7 @@ typedef struct VirtIONet { uint32_t has_vnet_hdr; size_t host_hdr_len; size_t guest_hdr_len; - uint32_t host_features; + uint64_t host_features; uint8_t has_ufo; uint32_t mergeable_rx_bufs; uint8_t promisc; --=20 2.7.4 From nobody Sat Feb 7 10:16:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519962719029248.18244477534677; Thu, 1 Mar 2018 19:51:59 -0800 (PST) Received: from localhost ([::1]:60506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erbje-0003sC-Mv for importer@patchew.org; Thu, 01 Mar 2018 22:51:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erbf7-0000cs-BB for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erbf4-00010o-7W for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:13 -0500 Received: from mx0b-00190b01.pphosted.com ([2620:100:9005:57f::1]:35108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erbf4-00010d-17 for qemu-devel@nongnu.org; Thu, 01 Mar 2018 22:47:10 -0500 Received: from pps.filterd (m0050096.ppops.net [127.0.0.1]) by mx0b-00190b01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w223g9cP004986; Fri, 2 Mar 2018 03:47:08 GMT Received: from prod-mail-ppoint1 (prod-mail-ppoint1.akamai.com [184.51.33.18]) by m0050096.ppops.net-00190b01. with ESMTP id 2gdqc0pjrs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Mar 2018 03:47:08 +0000 Received: from pps.filterd (prod-mail-ppoint1.akamai.com [127.0.0.1]) by prod-mail-ppoint1.akamai.com (8.16.0.21/8.16.0.21) with SMTP id w223k52e021451; Thu, 1 Mar 2018 22:47:07 -0500 Received: from prod-mail-relay11.akamai.com ([172.27.118.250]) by prod-mail-ppoint1.akamai.com with ESMTP id 2gb49058rf-1; Thu, 01 Mar 2018 22:47:07 -0500 Received: from bos-lpjec.kendall.corp.akamai.com (bos-lpjec.kendall.corp.akamai.com [172.28.13.109]) by prod-mail-relay11.akamai.com (Postfix) with ESMTP id 52EE3335D1; Fri, 2 Mar 2018 03:47:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : in-reply-to : references; s=jan2016.eng; bh=cO20S/qckTzrbPd+oeFVjc77QCjzQL0WrtAjHM/XJ6E=; b=jBORdHuJRSpFMb9g0yev1tssHYB4+xAn7ber8bi57zg1jQ7qlVySx7dUAVAH4Wm0kBVd R9PI6YMfNNYsPQ4CAILaNiIUGVSRZW/bXRHwRede3tdbHur/Mo1zRt4WQqMlDygPFEHy XX7qG1t1rgUESOrKLCfGP8hwPJq9V6YzQs+lFvVEP/Hua7k4FSkaEUu4hsDC5VdIwrhA 9UhIyV2IDH7oUlbtd34+D6fWjZz654hcrkPQmy6rcU8v9GOVD5XyAguX4om3leY1E28l m0DTTHIA5EyTUgSyEUPsrEqUk89KZlvd3G9CpiCqD7lWpSubLb2qE+b9BkGzvZ22p+wy lw== To: mst@redhat.com Date: Thu, 1 Mar 2018 22:46:36 -0500 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-02_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020040 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-02_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020039 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 2620:100:9005:57f::1 Subject: [Qemu-devel] [PATCH 4/4] virtio-net: add linkspeed and duplex settings to virtio-net X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jason Baron via Qemu-devel Reply-To: Jason Baron Cc: virtio-dev@lists.oasis-open.org, jasowang@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Although linkspeed and duplex can be set in a linux guest via 'ethtool -s', this requires custom ethtool commands for virtio-net by default. Introduce a new feature flag, VIRTIO_NET_F_SPEED_DUPLEX, which allows the hypervisor to export a linkspeed and duplex setting. The user can subsequently overwrite it later if desired via: 'ethtool -s'. Linkspeed and duplex settings can be set as: '-device virtio-net,speed=3D10000,duplex=3Dfull' where speed is [0...INT_MAX], and duplex is ["half"|"full"]. Signed-off-by: Jason Baron Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: virtio-dev@lists.oasis-open.org --- hw/net/virtio-net.c | 26 ++++++++++++++++++++++++++ include/hw/virtio/virtio-net.h | 3 +++ 2 files changed, 29 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 4feaa49..5df90ea 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -26,6 +26,7 @@ #include "qapi-event.h" #include "hw/virtio/virtio-access.h" #include "migration/misc.h" +#include "net/eth.h" =20 #define VIRTIO_NET_VM_VERSION 11 =20 @@ -61,6 +62,8 @@ static VirtIOFeature feature_sizes[] =3D { .end =3D endof(struct virtio_net_config, max_virtqueue_pairs)}, {.flags =3D 1ULL << VIRTIO_NET_F_MTU, .end =3D endof(struct virtio_net_config, mtu)}, + {.flags =3D 1ULL << VIRTIO_NET_F_SPEED_DUPLEX, + .end =3D endof(struct virtio_net_config, duplex)}, {} }; =20 @@ -89,6 +92,8 @@ static void virtio_net_get_config(VirtIODevice *vdev, uin= t8_t *config) virtio_stw_p(vdev, &netcfg.max_virtqueue_pairs, n->max_queues); virtio_stw_p(vdev, &netcfg.mtu, n->net_conf.mtu); memcpy(netcfg.mac, n->mac, ETH_ALEN); + virtio_stl_p(vdev, &netcfg.speed, n->net_conf.speed); + netcfg.duplex =3D n->net_conf.duplex; memcpy(config, &netcfg, n->config_size); } =20 @@ -1941,6 +1946,25 @@ static void virtio_net_device_realize(DeviceState *d= ev, Error **errp) n->host_features |=3D (1ULL << VIRTIO_NET_F_MTU); } =20 + if (n->net_conf.duplex_str) { + if (strncmp(n->net_conf.duplex_str, "half", 5) =3D=3D 0) { + n->net_conf.duplex =3D DUPLEX_HALF; + } else if (strncmp(n->net_conf.duplex_str, "full", 5) =3D=3D 0) { + n->net_conf.duplex =3D DUPLEX_FULL; + } else { + error_setg(errp, "'duplex' must be 'half' or 'full'"); + } + n->host_features |=3D (1ULL << VIRTIO_NET_F_SPEED_DUPLEX); + } else { + n->net_conf.duplex =3D DUPLEX_UNKNOWN; + } + + if (n->net_conf.speed < SPEED_UNKNOWN) { + error_setg(errp, "'speed' must be between 0 and INT_MAX"); + } else if (n->net_conf.speed >=3D 0) { + n->host_features |=3D (1ULL << VIRTIO_NET_F_SPEED_DUPLEX); + } + virtio_net_set_config_size(n, n->host_features); virtio_init(vdev, "virtio-net", VIRTIO_ID_NET, n->config_size); =20 @@ -2161,6 +2185,8 @@ static Property virtio_net_properties[] =3D { DEFINE_PROP_UINT16("host_mtu", VirtIONet, net_conf.mtu, 0), DEFINE_PROP_BOOL("x-mtu-bypass-backend", VirtIONet, mtu_bypass_backend, true), + DEFINE_PROP_INT32("speed", VirtIONet, net_conf.speed, SPEED_UNKNOWN), + DEFINE_PROP_STRING("duplex", VirtIONet, net_conf.duplex_str), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index e7634c9..02484dc 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -38,6 +38,9 @@ typedef struct virtio_net_conf uint16_t rx_queue_size; uint16_t tx_queue_size; uint16_t mtu; + int32_t speed; + char *duplex_str; + uint8_t duplex; } virtio_net_conf; =20 /* Maximum packet size we can receive from tap device: header + 64k */ --=20 2.7.4