All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, robh@kernel.org, stephen@networkplumber.org,
	ecree.xilinx@gmail.com, sdf@google.com, f.fainelli@gmail.com,
	fw@strlen.de, linux-doc@vger.kernel.org, razor@blackwall.org,
	nicolas.dichtel@6wind.com
Subject: Re: [PATCH net-next v3 3/8] net: add basic C code generators for Netlink
Date: Thu, 19 Jan 2023 17:53:02 -0800	[thread overview]
Message-ID: <20230119175302.3a592798@kernel.org> (raw)
In-Reply-To: <ddcea8b3cb8c2d218a2747a1e2f566dbaaee8f01.camel@sipsolutions.net>

On Thu, 19 Jan 2023 21:53:12 +0100 Johannes Berg wrote:
> > +    def _attr_policy(self, policy):
> > +        mem = '{ '
> > +        if len(self.checks) == 1 and 'min-len' in self.checks:
> > +            mem += '.len = ' + str(self.checks['min-len'])  
> 
> Why does the len(self.checks) matter?

Trying to throw an exception if someone starts using checks I haven't
gotten to implementing yet.

> > +    def free_needs_iter(self):
> > +        return 'type' not in self.attr or self.attr['type'] == 'nest'
> > +
> > +    def free(self, ri, var, ref):
> > +        if 'type' not in self.attr or self.attr['type'] == 'nest':  
> 
> two more places that could use the .get trick
> 
> but it's really up to you. Just that the line like that seems rather
> long to me :-)

Better question is why attr would not have a type :S
Let me leave it be for now, I'll revisit when exercising this code 
in the future.

> > +            if has_ntf:
> > +                cw.p('// --------------- Common notification parsing --------------- //')  
>
> You said you were using /* */ comments now but this is still there.

Ugh, now I'm worried I lost something in a rebase :S

> > +                print_ntf_parse_prototype(parsed, cw)
> > +            cw.nl()
> > +        else:
> > +            cw.p('// Policies')  
>
> and here too, etc.
> 
> Whew. I think I skipped some bits ;-)

Thanks for looking!! :)

> Doesn't look that bad overall, IMHO. :)

I hope we can avoid over-focusing on the python tools :P
I'm no python expert and the code would use a lot of refactoring.
But there's only so many hours in the day and the alternative
seems that it will bit rot in my tree forever :(

  reply	other threads:[~2023-01-20  1:53 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19  0:36 [PATCH net-next v3 0/8] Netlink protocol specs Jakub Kicinski
2023-01-19  0:36 ` [PATCH net-next v3 1/8] docs: add more netlink docs (incl. spec docs) Jakub Kicinski
2023-01-19 15:48   ` Vladimir Oltean
2023-01-19 20:29   ` Johannes Berg
2023-01-20  0:23     ` Jacob Keller
2023-01-20  9:10       ` Johannes Berg
2023-01-20 18:35         ` Keller, Jacob E
2023-01-20  2:13     ` Jakub Kicinski
2023-01-20  9:15       ` Johannes Berg
2023-01-20 17:23         ` Jakub Kicinski
2023-01-19  0:36 ` [PATCH net-next v3 2/8] netlink: add schemas for YAML specs Jakub Kicinski
2023-01-19 14:07   ` Rob Herring
2023-01-19 21:49     ` Jakub Kicinski
2023-01-19 22:24       ` Jakub Kicinski
2023-01-19 23:02       ` Rob Herring
2023-01-20  0:08     ` Jakub Kicinski
2023-01-20 14:43       ` Rob Herring
2023-01-19  0:36 ` [PATCH net-next v3 3/8] net: add basic C code generators for Netlink Jakub Kicinski
2023-01-19 20:53   ` Johannes Berg
2023-01-20  1:53     ` Jakub Kicinski [this message]
2023-01-20  9:17       ` Johannes Berg
2023-01-19  0:36 ` [PATCH net-next v3 4/8] netlink: add a proto specification for FOU Jakub Kicinski
2023-01-19  0:36 ` [PATCH net-next v3 5/8] net: fou: regenerate the uAPI from the spec Jakub Kicinski
2023-01-19  0:36 ` [PATCH net-next v3 6/8] net: fou: rename the source for linking Jakub Kicinski
2023-01-19  0:36 ` [PATCH net-next v3 7/8] net: fou: use policy and operation tables generated from the spec Jakub Kicinski
2023-01-19 20:56   ` Johannes Berg
2023-01-20  0:18     ` Jacob Keller
2023-01-20  1:04       ` Jakub Kicinski
2023-01-19  0:36 ` [PATCH net-next v3 8/8] tools: ynl: add a completely generic client Jakub Kicinski
2023-01-20  0:50   ` Jacob Keller
2023-01-19 17:07 ` [PATCH net-next v3 0/8] Netlink protocol specs Stanislav Fomichev

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=20230119175302.3a592798@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=fw@strlen.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=robh@kernel.org \
    --cc=sdf@google.com \
    --cc=stephen@networkplumber.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.