public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top
Subject: Re: [PATCH 3/8] passt.h: Include netinet/if_ether.h before struct ctx declaration
Date: Fri, 07 Oct 2022 19:40:43 +1100	[thread overview]
Message-ID: <Yz/mC8kj+Xdje5rH@yekko> (raw)
In-Reply-To: <20221007094417.44e4fbfd@elisabeth>

[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]

On Fri, Oct 07, 2022 at 09:44:17AM +0200, Stefano Brivio wrote:
> On Fri, 7 Oct 2022 17:23:30 +1100
> David Gibson <david(a)gibson.dropbear.id.au> wrote:
> 
> > On Fri, Oct 07, 2022 at 02:47:37AM +0200, Stefano Brivio wrote:
> > > This saves some hassle when including passt.h, as we need ETH_ALEN
> > > there.
> > > 
> > > Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com>  
> > 
> > Hrm.  So I had the impression that passt was using the convention that
> > it's the top level files responsibility to include all the
> > dependencies for a header before including the header, rather than
> > having headers include other headers they need.  Was I mistaken?  I'm
> > ok with either model, they each have their advantages, but I find
> > sticking to one or the other is generally better than a mix of both.
> 
> That was my original idea, but it's a bit of a disaster, because it
> turns out we need <netinet/if_ether.h> and a few others pretty much
> everywhere, even though the file at hand will never see an Ethernet
> header. :(
> 
> Does this indicate that it's time to move struct ctx out of passt.h
> (and similarly with other structs here and there)?

Well.. really we want to break struct ctx up so it's not globals by
another name, but that's not news.

> Or that we should switch to the other way around? I don't really have
> an answer.
> 
> If you have some ideas for a possible guideline/policy, I'd be happy to
> refactor includes based on that...
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-10-07  8:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-07  0:47 [PATCH 0/8] Add support for log file, version display, and tests Stefano Brivio
2022-10-07  0:47 ` [PATCH 1/8] Move logging functions to a new file, log.c Stefano Brivio
2022-10-07  6:13   ` David Gibson
2022-10-07  0:47 ` [PATCH 2/8] conf: Drop duplicate, diverging optstring assignments Stefano Brivio
2022-10-07  6:20   ` David Gibson
2022-10-07  0:47 ` [PATCH 3/8] passt.h: Include netinet/if_ether.h before struct ctx declaration Stefano Brivio
2022-10-07  6:23   ` David Gibson
2022-10-07  7:44     ` Stefano Brivio
2022-10-07  8:40       ` David Gibson [this message]
2022-10-07 11:36         ` Stefano Brivio
2022-10-07  0:47 ` [PATCH 4/8] log, conf: Add support for logging to file Stefano Brivio
2022-10-07  6:51   ` David Gibson
2022-10-07  8:11     ` Stefano Brivio
2022-10-07  8:57       ` David Gibson
2022-10-07 10:27         ` Stefano Brivio
2022-10-07  0:47 ` [PATCH 5/8] log: Add missing function comment for trace_init() Stefano Brivio
2022-10-07  6:52   ` David Gibson
2022-10-07  0:47 ` [PATCH 6/8] conf, log, Makefile: Add versioning information Stefano Brivio
2022-10-07  6:57   ` David Gibson
2022-10-07  8:15     ` Stefano Brivio
2022-10-07  9:03       ` David Gibson
2022-10-07 10:12         ` Stefano Brivio
2022-10-07  0:47 ` [PATCH 7/8] util: Check return value of lseek() while reading bound ports from procfs Stefano Brivio
2022-10-07  6:58   ` David Gibson
2022-10-07  0:47 ` [PATCH 8/8] test: Add log file tests for pasta plus corresponding layout and setup Stefano Brivio
2022-10-07  8:37   ` David Gibson
2022-10-07  9:47     ` Stefano Brivio
2022-10-24 21:00       ` Stefano Brivio
2022-10-26  7:26         ` Stefano Brivio

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=Yz/mC8kj+Xdje5rH@yekko \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).