qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Add support for ethtool via TARGET_SIOCETHTOOL


From: Aleksandar Markovic
Subject: Re: [Qemu-devel] [PATCH] Add support for ethtool via TARGET_SIOCETHTOOL ioctls.
Date: Sat, 17 Aug 2019 00:37:00 +0200

16.08.2019. 23.28, "Shu-Chun Weng via Qemu-devel" <address@hidden>
је написао/ла:
>
> 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 <address@hidden>
> ---

Shu-Chun, hi, and welcome!

Just a couple of cosmetic things:

  - by convention, the title of this patch should start with "linux-user:",
since this patch affects linux user QEMU module;

  - the patch title is too long (and has some minor mistakes) -
"linux-user: Add support for SIOCETHTOOL ioctl" should be good enough;

  - the lenght of the code lines that you add or modify must not be greater
than 80.

Sincerely,
Aleksandar

>  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      */
>
> +#define TARGET_SIOCETHTOOL     0x8946          /* Ethtool interface
      */
> +
>  /* ARP cache control calls. */
>  #define TARGET_OLD_SIOCDARP    0x8950          /* old delete ARP table
entry   */
>  #define TARGET_OLD_SIOCGARP    0x8951          /* old get ARP table
entry      */
> --
> 2.23.0.rc1.153.gdeed80330f-goog
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]