From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Tue, 24 Nov 2009 13:45:46 +0100 References: <1259024166-28158-1-git-send-email-arnd@arndb.de> <1259024166-28158-4-git-send-email-arnd@arndb.de> <4B0BB89F.7030605@trash.net> In-Reply-To: <4B0BB89F.7030605@trash.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200911241345.46475.arnd@arndb.de> Subject: Re: [Bridge] [PATCH 3/4] macvlan: implement bridge, VEPA and private mode List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Patrick McHardy Cc: Herbert Xu , Eric Dumazet , Anna Fischer , netdev@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Mark Smith , Gerhard Stenzel , "Eric W. Biederman" , Jens Osterkamp , Patrick Mullaney , Stephen Hemminger , Edge Virtual Bridging , David Miller On Tuesday 24 November 2009, Patrick McHardy wrote: > Arnd Bergmann wrote: > > @@ -29,9 +29,16 @@ > > #include > > #include > > #include > > +#include > > Do we really need this? Not any more. I originally did secpath_reset here, but that is now moved to dev_forward_skb() in net/core/dev.c so I'll remove the include here. > > @@ -129,11 +137,14 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, int length, > > } > > > > static int macvlan_broadcast_one(struct sk_buff *skb, struct net_device *dev, > > - const struct ethhdr *eth) > > + const struct ethhdr *eth, int local) > > bool local? Already changed as a reply to Eric's comments > > @@ -159,8 +172,12 @@ static void macvlan_broadcast(struct sk_buff *skb, > > > > for (i = 0; i < MACVLAN_HASH_SIZE; i++) { > > hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[i], hlist) { > > + if ((vlan->dev == src) || !(vlan->mode & mode)) > > Please remove those unnecessary parentheses around the > device comparison. Ok. I usually prefer to have some extra parentheses in places that not everyone finds obvious but these are pretty clear. > > The '|' should go on the first line. > > Multi-line comments should begin every line with '*'. > > Please align the mode values (in all cases above) to the arguments > on the line above. ok > > +static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) > > +{ > > + const struct macvlan_dev *vlan = netdev_priv(dev); > > + const struct macvlan_port *port = vlan->port; > > + const struct macvlan_dev *dest; > > + > > + if (vlan->mode == MACVLAN_MODE_BRIDGE) { > > + const struct ethhdr *eth = (void *)skb->data; > > eth_hdr()? This is done before calling eth_type_trans and skb->mac_header appears to be uninitialized then, which gave me an instant kernel panic here. > > + dest = macvlan_hash_lookup(port, eth->h_dest); > > + if (dest && dest->mode == MACVLAN_MODE_BRIDGE) { > > + int length = skb->len + ETH_HLEN; > > unsigned int for length values please. ok Thanks for the detailed review, Arnd <><