From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: [PATCHv3 net-next 3/3] vxlan: virtual extensible lan Date: Mon, 24 Sep 2012 13:24:41 -0700 Message-ID: <5060C189.8090803@intel.com> References: <20120924184304.727711327@vyatta.com> <20120924185050.162920909@vyatta.com> <1348515547.26828.1538.camel@edumazet-glaptop> <20120924124657.4541c186@nehalam.linuxnetplumber.net> <1348516500.26828.1570.camel@edumazet-glaptop> <20120924130239.18767146@nehalam.linuxnetplumber.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Eric Dumazet , David Miller , Chris Wright , netdev@vger.kernel.org To: Stephen Hemminger Return-path: Received: from mga09.intel.com ([134.134.136.24]:53349 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757893Ab2IXUZE (ORCPT ); Mon, 24 Sep 2012 16:25:04 -0400 In-Reply-To: <20120924130239.18767146@nehalam.linuxnetplumber.net> Sender: netdev-owner@vger.kernel.org List-ID: [...] On 9/24/2012 1:02 PM, Stephen Hemminger wrote: > + > +/* Transmit local packets over Vxlan > + * > + * Outer IP header inherits ECN and DF from inner header. > + * Outer UDP destination is the VXLAN assigned port. > + * source port is based on hash of flow if available > + * otherwise use a random value > + */ > +static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) > +{ > + struct vxlan_dev *vxlan = netdev_priv(dev); > + struct rtable *rt; > + const struct ethhdr *eth; > + const struct iphdr *old_iph; > + struct iphdr *iph; > + struct vxlanhdr *vxh; > + struct udphdr *uh; > + struct flowi4 fl4; > + struct vxlan_fdb *f; > + unsigned int pkt_len = skb->len; > + unsigned int mtu; > + u32 hash; > + __be32 dst; > + __be16 df = 0; > + __u8 tos, ttl; > + int err; > + [...] > + err = ip_local_out(skb); > + if (likely(net_xmit_eval(err) == 0)) { > + struct vxlan_stats *stats = this_cpu_ptr(vxlan->stats); > + > + u64_stats_update_begin(&stats->syncp); > + stats->tx_packets++; > + stats->tx_bytes += pkt_len; Should pkt_len include the outer headers? > + u64_stats_update_end(&stats->syncp); > + } else { > + dev->stats.tx_errors++; > + dev->stats.tx_aborted_errors++; > + } > + return NETDEV_TX_OK; > + > +drop: > + dev->stats.tx_dropped++; > + goto tx_free; > + > +tx_error: > + dev->stats.tx_errors++; > +tx_free: > + dev_kfree_skb(skb); > + return NETDEV_TX_OK; > +}