From: Stefan Hajnoczi <stefanha@gmail.com>
To: Scott Feldman <sfeldma@gmail.com>
Cc: "john fastabend" <john.fastabend@gmail.com>,
"Roopa Prabhu" <roopa@cumulusnetworks.com>,
"Jiří Pírko" <jiri@resnulli.us>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 07/10] rocker: add new rocker switch device
Date: Wed, 7 Jan 2015 12:55:09 +0000 [thread overview]
Message-ID: <20150107125509.GC18014@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <CAE4R7bB_7CukLZFt_Epwo9wg+RYDo+zn1JYm5BrMORReSgrJZw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2166 bytes --]
On Tue, Jan 06, 2015 at 08:45:44AM -0800, Scott Feldman wrote:
> On Tue, Jan 6, 2015 at 7:12 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > On Mon, Jan 05, 2015 at 06:24:58PM -0800, sfeldma@gmail.com wrote:
> >> From: Scott Feldman <sfeldma@gmail.com>
> >>
> >> Rocker is a simulated ethernet switch device. The device supports up to 62
> >> front-panel ports and supports L2 switching and L3 routing functions, as well
> >> as L2/L3/L4 ACLs. The device presents a single PCI device for each switch,
> >> with a memory-mapped register space for device driver access.
> >>
> >> Rocker device is invoked with -device, for example a 4-port switch:
> >>
> >> -device rocker,name=sw1,len-ports=4,ports[0]=dev0,ports[1]=dev1, \
> >> ports[2]=dev2,ports[3]=dev3
> >>
> >> Each port is a netdev and can be paired with using -netdev id=<port name>.
> >
> > This design looks good, it fits the QEMU network subsystem.
> >
> > Please follow QEMU coding style, for example, using typedefs for structs
> > instead of "struct tag". Details are in ./HACKING, ./CODING_STYLE, and
> > you can scan patches with QEMU's scripts/checkpatch.pl.
>
> The patches are already scripts/checkpatch.pl clean.
>
> And we did follow the HACKING and CODING_STYLE guidelines, with the
> exception of typedefs for structs. Did you spot anything else
> out-of-compliance?
No, just the lack of typedef struct caught my eye.
> On typedefs for structs, there are plenty of examples in Qemu of not
> following that rule. Perhaps this rule can be enforced by
> checkpatch.pl? Personally, I feel that typedef on a struct makes the
> code harder to read as it obfuscate the type. For example, typedef
> union {...} foo or typedef struct {...} foo or typedef enum {...} foo:
> there is no way to tell with foo bar what bar is, at a glance, whereas
> union foo bar or struct foo bar or enum foo bar is clear.
It seems checkpatch.pl doesn't enforce the rule.
There is old code that doesn't follow the coding standard, but new code
should.
> We can make the typedef change for v3 if it's a hard requirement for inclusion.
Thank you!
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-01-07 14:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-06 2:24 [Qemu-devel] [PATCH v2 00/10] rocker: add new rocker ethernet switch device sfeldma
2015-01-06 2:24 ` sfeldma
2015-01-06 2:24 ` [Qemu-devel] [PATCH v2 01/10] pci: move REDHAT_SDHCI device ID to make room for Rocker sfeldma
2015-01-06 9:52 ` Peter Maydell
2015-01-07 7:47 ` Paolo Bonzini
2015-01-07 10:39 ` Peter Maydell
2015-01-07 10:55 ` Paolo Bonzini
2015-01-07 20:28 ` Scott Feldman
2015-01-06 2:24 ` [Qemu-devel] [PATCH v2 02/10] net: add MAC address string printer sfeldma
2015-01-06 2:24 ` [Qemu-devel] [PATCH v2 03/10] virtio-net: use qemu_mac_strdup_printf sfeldma
2015-01-06 2:24 ` [Qemu-devel] [PATCH v2 04/10] rocker: add register programming guide sfeldma
2015-01-06 5:16 ` Jason Wang
2015-01-06 7:50 ` Scott Feldman
2015-01-06 2:24 ` [Qemu-devel] [PATCH v2 05/10] pci: add rocker device ID sfeldma
2015-01-06 2:24 ` [Qemu-devel] [PATCH v2 06/10] pci: add network device class 'other' for network switches sfeldma
2015-01-06 2:24 ` [Qemu-devel] [PATCH v2 07/10] rocker: add new rocker switch device sfeldma
2015-01-06 15:12 ` Stefan Hajnoczi
2015-01-06 16:45 ` Scott Feldman
2015-01-07 12:55 ` Stefan Hajnoczi [this message]
2015-01-06 2:24 ` [Qemu-devel] [PATCH v2 08/10] qmp: add rocker device support sfeldma
2015-01-06 15:19 ` Stefan Hajnoczi
2015-01-06 2:25 ` [Qemu-devel] [PATCH v2 09/10] rocker: add tests sfeldma
2015-01-06 2:25 ` [Qemu-devel] [PATCH v2 10/10] MAINTAINERS: add rocker sfeldma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150107125509.GC18014@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=roopa@cumulusnetworks.com \
--cc=sfeldma@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).