From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6240DA09FF; Wed, 6 Jan 2021 17:01:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2843F1609D8; Wed, 6 Jan 2021 17:01:56 +0100 (CET) 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 74C2F1609D2 for ; Wed, 6 Jan 2021 17:01:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609948913; 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: in-reply-to:in-reply-to:references:references; bh=AB2XHLszCVtTe+7b0xwJb3g+5uD/0r8qDAVMS1E4fwQ=; b=FqrZgLq4RUj6Nk/wo3aBYQzJ0TMvJCYe5jaDkTHAs24ZDv+Uai8k6/fhVgLazH5R4UK3Wm 0bWQK48ZnHFysWo0sBwl+RmhbWIaWP/WvUk+X+BToFiI6ebzeVG+l/7piuk4o9gPPTTZMc uwhMgDQ/5RUy6/lwDvuQt2gNdjJXSGk= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-4-izjcZQNDaVnJaWJvSc_Q-1; Wed, 06 Jan 2021 11:01:43 -0500 X-MC-Unique: 4-izjcZQNDaVnJaWJvSc_Q-1 Received: by mail-vk1-f198.google.com with SMTP id s127so1750330vka.11 for ; Wed, 06 Jan 2021 08:01:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AB2XHLszCVtTe+7b0xwJb3g+5uD/0r8qDAVMS1E4fwQ=; b=uc1/RfccquMieOQ59XZEXyD1mkg993LNBPxy+ThqrLszZhKO0djPTs4LTGIhnBwzmy jIArYzDCJqNExdpZiWXi1KEup2xhQNh5by/chegWLyS2nBqswbUrli7nMW5s1ZGQIAxW Cip5VCwmh1x4Go9uwBrXnIrPImqn5oyG1QRi2CosABj693I3YsOnnfY1zT4b1yDS3Yqn pXuB3M2DDJU+r5zoxrpzdgrBhXdGsyj7ONvUjlUjTOAwlAT801iyqUqCSGz+lu3mkmqW Rs3E8nRxiuSb2rbQRuKx0rAC1kaONA0N6kuIft9CW/YgZz3Hkl+MqNsAjXohZoVJa4r8 lW7A== X-Gm-Message-State: AOAM531kYvxebi8bEby9rhCYdFASgWGgp3AaLIyRzvtNYh1x8PV4dGof pO4vCMpxB16L0pZgVHMJqyIZLlsllrQk9m6UUdA3Vuv0hMdkhrlZvjLd1dvtXeriwP96S7ppKa7 6K2yaP6cphkmGpdNuMxw= X-Received: by 2002:ab0:43a1:: with SMTP id l30mr4026393ual.126.1609948902664; Wed, 06 Jan 2021 08:01:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeHb5TPs9pgF4PQShLgsl5C6gI/p+pA9DiIDTU6wsfTgZocq9nf4lANWtWi4AsskhSvYLz3ALmsHyJz5asd2M= X-Received: by 2002:ab0:43a1:: with SMTP id l30mr4026357ual.126.1609948902440; Wed, 06 Jan 2021 08:01:42 -0800 (PST) MIME-Version: 1.0 References: <20201220211405.313012-1-maxime.coquelin@redhat.com> <20201220211405.313012-20-maxime.coquelin@redhat.com> In-Reply-To: <20201220211405.313012-20-maxime.coquelin@redhat.com> From: David Marchand Date: Wed, 6 Jan 2021 17:01:31 +0100 Message-ID: To: Maxime Coquelin Cc: dev , "Xia, Chenbo" , Olivier Matz , Adrian Moreno Zapata Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 19/40] net/virtio: move config definitions to generic header 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 Sun, Dec 20, 2020 at 10:15 PM Maxime Coquelin wrote: > diff --git a/drivers/net/virtio/virtio.h b/drivers/net/virtio/virtio.h > index eeeb5dba4f..5169436c9f 100644 > --- a/drivers/net/virtio/virtio.h > +++ b/drivers/net/virtio/virtio.h > @@ -106,6 +106,50 @@ > #define VIRTIO_MAX_VIRTQUEUE_PAIRS 8 > #define VIRTIO_MAX_VIRTQUEUES (VIRTIO_MAX_VIRTQUEUE_PAIRS * 2 + 1) > > +/* VirtIO device IDs. */ > +#define VIRTIO_ID_NETWORK 0x01 > +#define VIRTIO_ID_BLOCK 0x02 > +#define VIRTIO_ID_CONSOLE 0x03 > +#define VIRTIO_ID_ENTROPY 0x04 > +#define VIRTIO_ID_BALLOON 0x05 > +#define VIRTIO_ID_IOMEMORY 0x06 > +#define VIRTIO_ID_9P 0x09 > + > +/* Status byte for guest to report progress. */ > +#define VIRTIO_CONFIG_STATUS_RESET 0x00 > +#define VIRTIO_CONFIG_STATUS_ACK 0x01 > +#define VIRTIO_CONFIG_STATUS_DRIVER 0x02 > +#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04 > +#define VIRTIO_CONFIG_STATUS_FEATURES_OK 0x08 > +#define VIRTIO_CONFIG_STATUS_DEV_NEED_RESET 0x40 > +#define VIRTIO_CONFIG_STATUS_FAILED 0x80 > + > +/* > + * This structure is just a reference to read > + * net device specific config space; it just a chodu structure chodu ? :-) > + * > + */ > +struct virtio_net_config { > + /* The config defining mac address (if VIRTIO_NET_F_MAC) */ > + uint8_t mac[RTE_ETHER_ADDR_LEN]; > + /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ > + uint16_t status; > + uint16_t max_virtqueue_pairs; > + uint16_t mtu; > + /* > + * speed, in units of 1Mb. All values 0 to INT_MAX are legal. > + * Any other value stands for unknown. > + */ > + uint32_t speed; > + /* > + * 0x00 - half duplex > + * 0x01 - full duplex > + * Any other value stands for unknown. > + */ > + uint8_t duplex; > + > +} __rte_packed; > + > struct virtio_hw { > struct virtqueue **vqs; > uint64_t guest_features; > @@ -159,7 +203,7 @@ struct virtio_ops { > /* > * While virtio_hw is stored in shared memory, this structure stores > * some infos that may vary in the multiple process model locally. > - * For example, the vtpci_ops pointer. > + * For example, the virtio_ops pointer. It should be in a previous patch (I suggested removing this comment earlier). -- David Marchand