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 2774AA09FF; Tue, 5 Jan 2021 22:16:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10A111607D8; Tue, 5 Jan 2021 22:16:33 +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 828D91607A1 for ; Tue, 5 Jan 2021 22:16:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609881391; 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=md6Xr6osBubefBKWARV90YFkbdMfSkxEPm0ti6YW3bA=; b=E8D/NOV4A8soCTAbRRQyABe+bwnI3YK1AJe/HwSJChSzpI+nVBqxSpSyFQEALI4t5YHiR0 qtnaHkjn5EZCOfFQ9dVip7R61VBgGUj+xCKq4dtm7scK1flcrzPYM14JsKhNraIWG1tBY0 VRDssLUv908VNVcAnkd1Stb1GUvywKk= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-335-e4cwmn8uMWChP_IGNjUzvQ-1; Tue, 05 Jan 2021 16:16:29 -0500 X-MC-Unique: e4cwmn8uMWChP_IGNjUzvQ-1 Received: by mail-vk1-f200.google.com with SMTP id k187so514297vka.7 for ; Tue, 05 Jan 2021 13:16:29 -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=md6Xr6osBubefBKWARV90YFkbdMfSkxEPm0ti6YW3bA=; b=C1aX2KKjevnkgh8RrOb/Kwclp9trt2LJrD4o9yK7VZW6xQhqL7/8QfiN2Rjcv9N2oM EJRW3/klW/YHskUKNmrbL216ejjA6k7c/omfql2sq1Gc/KuVvtOkMh0DfHnbKMOIV/Y5 NmmCNsKomlxiboLX99ITHd8TLuBcOxDGKbNMBUdWyMnjA4J1V1gkvCvL2gM7vD0Rt557 TImEjk8wxK8DFQtqpi0Yvr2uf3hxrdrfPH2a9M/WQUcoqn7m0YNvt0Oooi/iBla7GoUl d1GcsT7Hh2XaulLLqSEQabHPxPqz9IyJ7+NOsqdmyBsORyMaNmFjTtfg8pzNxugVcp2a 1BVA== X-Gm-Message-State: AOAM532+FJgW249hOoJSlXURxjkWJmppIIEU6cSs0Kj7fbDoFwogtapz LbJkWvc0xMY3SKlyByKQnrDv8MDLyF9okSU7Wlr8JzrD/qoynX0fMhbzDP4mQKgzV3x1ZpTUKV3 bfqODE2IIDLufwwrX+sM= X-Received: by 2002:a67:2fd3:: with SMTP id v202mr1025663vsv.17.1609881388831; Tue, 05 Jan 2021 13:16:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXKLgzl6v7UB4E0s8wnndCMOg/yjYcEAPdJ/Bi64aiB1skY4N/eBPipDADEDd27U8FLf8/e+wgy3N4HL/gi6E= X-Received: by 2002:a67:2fd3:: with SMTP id v202mr1025659vsv.17.1609881388671; Tue, 05 Jan 2021 13:16:28 -0800 (PST) MIME-Version: 1.0 References: <20201220211405.313012-1-maxime.coquelin@redhat.com> <20201220211405.313012-4-maxime.coquelin@redhat.com> In-Reply-To: <20201220211405.313012-4-maxime.coquelin@redhat.com> From: David Marchand Date: Tue, 5 Jan 2021 22:16:17 +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 03/40] net/virtio: refactor virtio-user device 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:14 PM Maxime Coquelin wrote: > > This patch moves the virtio_hw structure into the virtio_user_dev > structure, with the goal of making virtio_hw bus-agnostic. > > Signed-off-by: Maxime Coquelin Just one comment, the rest lgtm. > diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c > index 516d0ee577..1f1f63a1a5 100644 > --- a/drivers/net/virtio/virtio_user_ethdev.c > +++ b/drivers/net/virtio/virtio_user_ethdev.c > @@ -26,13 +26,13 @@ > #include "virtio_user/virtio_user_dev.h" > #include "virtio_user/vhost.h" > > -#define virtio_user_get_dev(hw) \ > - ((struct virtio_user_dev *)(hw)->virtio_user_dev) > +#define virtio_user_get_dev(hw) container_of(hw, struct virtio_user_dev, hw) Since the hw parameter is expanded as both the object and the field name too, this macro prevents us from calling anything but virtio_user_get_dev(hw). -- David Marchand