Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932379AbbBPEMO (ORCPT ); Sun, 15 Feb 2015 23:12:14 -0500 Received: from ozlabs.org ([103.22.144.67]:57057 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754817AbbBPEKs (ORCPT ); Sun, 15 Feb 2015 23:10:48 -0500 From: Rusty Russell To: "Michael S. Tsirkin" Cc: lkml , "netdev\@vger.kernel.org" Subject: Re: [PATCH 3/5] virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined. In-Reply-To: <20150214204326.GA31803@redhat.com> References: <1423199216-2094-1-git-send-email-rusty@rustcorp.com.au> <1423199216-2094-4-git-send-email-rusty@rustcorp.com.au> <20150208105908.GI3185@redhat.com> <20150214204326.GA31803@redhat.com> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Mon, 16 Feb 2015 13:59:17 +1030 Message-ID: <87y4ny8rg2.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1382 Lines: 38 "Michael S. Tsirkin" writes: > On Sun, Feb 08, 2015 at 11:59:08AM +0100, Michael S. Tsirkin wrote: >> On Fri, Feb 06, 2015 at 03:36:54PM +1030, Rusty Russell wrote: >> > In particular, the virtio header always has the u16 num_buffers field. >> > We define a new 'struct virtio_net_modern_hdr' for this (rather than >> > simply calling it 'struct virtio_net_hdr', to avoid nasty type errors >> > if some parts of a project define VIRTIO_NET_NO_LEGACY and some don't. >> >> This kind of masks the fact that it's the same as >> virtio_net_hdr_mrg_rxbuf. So it's forcing people to duplicate >> code for transitional devices. >> >> How about >> struct virtio_net_modern_hdr { >> struct virtio_net_hdr_mrg_rxbuf hdr; >> } >> >> >> This will also make it look nicer when we start >> adding stuff in the header, the main header >> is separated in a struct by its own, so it's >> easy to apply operations such as sizeof. > > Ping. > Would you like a patch on top that does this? Hmm, I thought I replied... Indeed, I did. I disagreed, and simply renamed struct virtio_net_modern_hdr to virtio_net_hdr_v1. Cheers, Rusty. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/