Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932722AbZKXKlf (ORCPT ); Tue, 24 Nov 2009 05:41:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932680AbZKXKlf (ORCPT ); Tue, 24 Nov 2009 05:41:35 -0500 Received: from stinky.trash.net ([213.144.137.162]:64884 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932636AbZKXKle (ORCPT ); Tue, 24 Nov 2009 05:41:34 -0500 Message-ID: <4B0BB862.6070101@trash.net> Date: Tue, 24 Nov 2009 11:41:38 +0100 From: Patrick McHardy User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: Arnd Bergmann CC: Eric Dumazet , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, David Miller , Stephen Hemminger , Herbert Xu , Patrick Mullaney , "Eric W. Biederman" , Edge Virtual Bridging , Anna Fischer , bridge@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, Jens Osterkamp , Gerhard Stenzel , Mark Smith Subject: Re: [PATCH 2/4] macvlan: cleanup rx statistics References: <1259024166-28158-1-git-send-email-arnd@arndb.de> <1259024166-28158-3-git-send-email-arnd@arndb.de> In-Reply-To: <1259024166-28158-3-git-send-email-arnd@arndb.de> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1549 Lines: 54 Arnd Bergmann wrote: > diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c > index ae2b5c7..a0dea23 100644 > --- a/drivers/net/macvlan.c > +++ b/drivers/net/macvlan.c > @@ -116,42 +116,53 @@ static int macvlan_addr_busy(const struct macvlan_port *port, > return 0; > } > > +static inline void macvlan_count_rx(const struct macvlan_dev *vlan, int length, Please use unsigned int for length values. Regarding Eric's comments, I also think it would be more readable to use if (success) { ... } else { ... } > + int success, int multicast) > +{ > + struct macvlan_rx_stats *rx_stats; > + > + rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id()); > + rx_stats->rx_packets += success != 0; > + rx_stats->rx_bytes += success ? length : 0; > + rx_stats->multicast += success && multicast; > + rx_stats->rx_errors += !success; > +} > + > +static int macvlan_broadcast_one(struct sk_buff *skb, struct net_device *dev, > + const struct ethhdr *eth) > +{ > + if (!skb) > + return NET_RX_DROP; > + > + skb->dev = dev; > + if (!compare_ether_addr_64bits(eth->h_dest, > + dev->broadcast)) This would fit on one line without reducing readability. > + skb->pkt_type = PACKET_BROADCAST; > + else > + skb->pkt_type = PACKET_MULTICAST; > + > + return netif_rx(skb); > +} -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/