From: Stephen Hemminger <stephen@networkplumber.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Dave Jones <davej@codemonkey.org.uk>,
netdev@vger.kernel.org, Roopa Prabhu <roopa@nvidia.com>,
Nikolay Aleksandrov <razor@blackwall.org>,
bridge@lists.linux-foundation.org
Subject: Re: [PATCH] decouple llc/bridge
Date: Fri, 8 Apr 2022 08:41:29 -0700 [thread overview]
Message-ID: <20220408084129.26944522@hermes.local> (raw)
In-Reply-To: <20220407194859.1e897edf@kernel.org>
On Thu, 7 Apr 2022 19:48:59 -0700
Jakub Kicinski <kuba@kernel.org> wrote:
> On Thu, 7 Apr 2022 09:16:40 -0700 Stephen Hemminger wrote:
> > > I was wondering why the llc code was getting compiled and it turned out
> > > to be because I had bridging enabled. It turns out to only needs it for
> > > a single function (llc_mac_hdr_init).
>
> > > +static inline int llc_mac_hdr_init(struct sk_buff *skb,
> > > + const unsigned char *sa, const unsigned char *da)
> > > +{
> > > + int rc = -EINVAL;
> > > +
> > > + switch (skb->dev->type) {
> > > + case ARPHRD_ETHER:
> > > + case ARPHRD_LOOPBACK:
> > > + rc = dev_hard_header(skb, skb->dev, ETH_P_802_2, da, sa,
> > > + skb->len);
> > > + if (rc > 0)
> > > + rc = 0;
> > > + break;
> > > + default:
> > > + break;
> > > + }
> > > + return rc;
> > > +}
> > > +
> > >
>
> nit: extra new line
>
> > > -int llc_mac_hdr_init(struct sk_buff *skb,
> > > - const unsigned char *sa, const unsigned char *da)
> > > -{
> > > - int rc = -EINVAL;
> > > -
> > > - switch (skb->dev->type) {
> > > - case ARPHRD_ETHER:
> > > - case ARPHRD_LOOPBACK:
> > > - rc = dev_hard_header(skb, skb->dev, ETH_P_802_2, da, sa,
> > > - skb->len);
> > > - if (rc > 0)
> > > - rc = 0;
> > > - break;
> > > - default:
> > > - break;
> > > - }
> > > - return rc;
> > > -}
>
> There's also an EXPORT somewhere in this file that has to go.
>
> > > /**
> > > * llc_build_and_send_ui_pkt - unitdata request interface for upper layers
> > > * @sap: sap to use
> >
> > You may break other uses of LLC.
> >
> > Why not open code as different function. I used the llc stuff because there
> > were multiple copies of same code (DRY).
>
> I didn't quite get what you mean, Stephen, would you mind restating?
Short answer: it was idea that didn't pan out.
Suggestion: get rid of using LLC in bridge and just rewrite that one place.
prev parent reply other threads:[~2022-04-08 15:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 15:12 [PATCH] decouple llc/bridge Dave Jones
2022-04-07 16:16 ` Stephen Hemminger
2022-04-08 2:48 ` Jakub Kicinski
2022-04-08 15:41 ` Stephen Hemminger [this message]
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=20220408084129.26944522@hermes.local \
--to=stephen@networkplumber.org \
--cc=bridge@lists.linux-foundation.org \
--cc=davej@codemonkey.org.uk \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=roopa@nvidia.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).