From nobody Mon Apr 29 03:46:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1565990934; cv=none; d=zoho.com; s=zohoarc; b=Djtao0OQZAhemN04ubyRilStasBpoxHRDiOxi2OmARcvuB9XWV/MWJdHw8xmzZt1dlddmaGEkQC3KltiJDyPcSLfBq9t84ooHQ89b5GIoRUzK/i2kyobtAMtn7pDY8cjQROInFmddMXAcgSbeJOCQpT/OlybENvDLgN0/mb+Va0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565990934; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=kaoIQwDyK8bEoWe907lgLsxXKF/yKmR/QpCyb0YecPA=; b=MOPkGsVDNlHrZgAhUCGwdVwdx4tEHiwOHPGoLMqrt6kd2dpT/L0Lno9rUIZ8fOku8eRgrg6Sdc2mIMmlpEirQS3puNp0n+VSjt03zA9KBgdfNjzzGviWs5mefDUPzC1U4CX+Nyp0CuVZpt43N/qkfwJk4CUYoUrxNvoiRrwkzXg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1565990934222570.5418514764866; Fri, 16 Aug 2019 14:28:54 -0700 (PDT) Received: from localhost ([::1]:60050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyjm9-0002RH-91 for importer@patchew.org; Fri, 16 Aug 2019 17:28:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60088) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <3lxxXXQMKCh4M6QAIIAF8.6IGK8GO-78P8FHIHAHO.ILA@flex--scw.bounces.google.com>) id 1hyjXx-0007QG-7c for qemu-devel@nongnu.org; Fri, 16 Aug 2019 17:14:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <3lxxXXQMKCh4M6QAIIAF8.6IGK8GO-78P8FHIHAHO.ILA@flex--scw.bounces.google.com>) id 1hyjXv-0007xL-0s for qemu-devel@nongnu.org; Fri, 16 Aug 2019 17:14:05 -0400 Received: from mail-pf1-x44a.google.com ([2607:f8b0:4864:20::44a]:46049) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <3lxxXXQMKCh4M6QAIIAF8.6IGK8GO-78P8FHIHAHO.ILA@flex--scw.bounces.google.com>) id 1hyjXu-0007ue-8r for qemu-devel@nongnu.org; Fri, 16 Aug 2019 17:14:02 -0400 Received: by mail-pf1-x44a.google.com with SMTP id w16so4585261pfn.12 for ; Fri, 16 Aug 2019 14:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=kaoIQwDyK8bEoWe907lgLsxXKF/yKmR/QpCyb0YecPA=; b=FpkKZLw26t97kT1DqJV3wFVQC1ne4Z0vTB9JHFNdpDvaKSxbY6DKvXMlvgwnQhKn18 jsq5JRNcm+iqaaXMpeH7MPBupeb8CkZyHAhaRCbrj0sS5awt8Ttge1knv6rgQO+rgINw C7bkZjdCmcbL3p5J1pxnTDz696OgvX+uoG5WetWr7yhCrc3UOinN4iBNbdhf1jCeGTNY fhw0ah3eSTWEA4dpEIS61S/fQc6EiL8cgT2nzPBK14xqEaldPO+A2BI7ORmyjnkTqo2+ 6QaDT4b/pW7NLLaNeoP1fSkAD0DQASgHNDTTdg2vkp0twmYLkUt/zWKafka4DqAF+sUI qp5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=kaoIQwDyK8bEoWe907lgLsxXKF/yKmR/QpCyb0YecPA=; b=nntsT3a8gRD0HTdW/sSX3qZJz6Wn9MkkpUgKVh/cJzz7Q9+z31/dpLs7pMTp0z6HXK TK+e8PPYmmJLatb8MJWRLYuGDj5nfYrTYevFgXmbPpONhgoGVmQaXicoGdZBpAqBfXKw GFTJ3+E8ti5FF6Z7+7cxOjK4Ephi9e+9Qu2dz6BByGGiYL8eIdrpIeQMuuIhdRelOoOA tKAnmavnd/UHUOIH9jswDvuImFSzNEc21DCpDAooitqFgWH6g1qv0/7aatGUPBNiwR6e KEjkYVAUEgZsN2T3srUp1RbFzLWtM/++5fKzi0osS8TAW/IsCjnEKgDAFEWjtUnYfN62 9QEQ== X-Gm-Message-State: APjAAAU23ax/pK2uOeWU8q5jWceYfBQUBkYbjFVQYCS4TJzpTXqcJwvG 1RX0CAzL6jreREYK32NQst6nRRo= X-Google-Smtp-Source: APXvYqyF8tNT/uphND43ZKM+1/9v9e7K+M2fGVvadLy7zfzIcjJzFUkey9oWT/RwKDbj/1kcSQS8eBg= X-Received: by 2002:a63:ee08:: with SMTP id e8mr9606242pgi.70.1565990039302; Fri, 16 Aug 2019 14:13:59 -0700 (PDT) Date: Fri, 16 Aug 2019 14:13:56 -0700 Message-Id: <20190816211356.59244-1-scw@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog To: Riku Voipio , Laurent Vivier X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::44a X-Mailman-Approved-At: Fri, 16 Aug 2019 17:27:49 -0400 Subject: [Qemu-devel] [PATCH] Add support for ethtool via TARGET_SIOCETHTOOL ioctls. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Shu-Chun Weng via Qemu-devel Reply-To: Shu-Chun Weng Cc: arunkaly@google.com, qemu-devel@nongnu.org, Shu-Chun Weng Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The ioctl numeric values are platform-independent and determined by the file include/uapi/linux/sockios.h in Linux kernel source code: #define SIOCETHTOOL 0x8946 These ioctls get (or set) the field ifr_data of type char* in the structure ifreq. Such functionality is achieved in QEMU by using MK_STRUCT() and MK_PTR() macros with an appropriate argument, as it was done for existing similar cases. Signed-off-by: Shu-Chun Weng --- linux-user/ioctls.h | 1 + linux-user/syscall_defs.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 3281c97ca2..9d231df665 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -208,6 +208,7 @@ IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_int_ifreq))) IOCTL(SIOCSIFPFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq))) IOCTL(SIOCGIFPFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)= )) + IOCTL(SIOCETHTOOL, IOC_R | IOC_W, MK_PTR(MK_STRUCT(STRUCT_ptr_ifreq))) IOCTL(SIOCSIFLINK, 0, TYPE_NULL) IOCTL_SPECIAL(SIOCGIFCONF, IOC_W | IOC_R, do_ioctl_ifconf, MK_PTR(MK_STRUCT(STRUCT_ifconf))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 0662270300..276f96039f 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -819,6 +819,8 @@ struct target_pollfd { #define TARGET_SIOCGIFTXQLEN 0x8942 /* Get the tx queue length = */ #define TARGET_SIOCSIFTXQLEN 0x8943 /* Set the tx queue length = */ =20 +#define TARGET_SIOCETHTOOL 0x8946 /* Ethtool interface = */ + /* ARP cache control calls. */ #define TARGET_OLD_SIOCDARP 0x8950 /* old delete ARP table ent= ry */ #define TARGET_OLD_SIOCGARP 0x8951 /* old get ARP table entry = */ --=20 2.23.0.rc1.153.gdeed80330f-goog