* Re: Slow speed of tcp connections in a network namespace
From: Andrew Vagin @ 2012-12-29 21:19 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, vvs, Michał Mirosław
In-Reply-To: <1356815546.21409.5277.camel@edumazet-glaptop>
On Sat, Dec 29, 2012 at 01:12:26PM -0800, Eric Dumazet wrote:
> On Sun, 2012-12-30 at 00:08 +0400, Andrew Vagin wrote:
>
> > Is it right, that a received window will be less, if packets are not sorted?
> > Looks like a bug.
>
> Not really a bug.
>
> TCP is very sensitive to packet reorders. I wont elaborate here as
> its a bit off topic.
>
> Try to reorders credits/debits on your bank account, I am pretty sure
> you'll lose some money or even get serious troubles.
>
> Of course, enabling GRO on eth0 would definitely help a bit...
>
> (once/iff veth driver features are fixed to allow GSO packets being
> forwarded without being segmented again)
>
Eric, thank you for the help.
I need time for thinking. I will ask you, if new questions will appear.
>
>
^ permalink raw reply
* Re: [patch net-next 01/15] net: introduce upper device lists
From: David Miller @ 2012-12-29 23:31 UTC (permalink / raw)
To: jiri
Cc: netdev, edumazet, bhutchings, faisal.latif, shemminger, fbl,
roland, sean.hefty, hal.rosenstock, fubar, andy, divy,
jitendra.kalsaria, sony.chacko, linux-driver, kaber, ursula.braun,
blaschka, schwidefsky, heiko.carstens, ebiederm, joe, amwang,
nhorman, john.r.fastabend, pablo
In-Reply-To: <1356777522-19652-2-git-send-email-jiri@resnulli.us>
From: Jiri Pirko <jiri@resnulli.us>
Date: Sat, 29 Dec 2012 11:38:28 +0100
> + /*
> + * To prevent loops, check if dev is not upper device to upper_dev.
> + */
Please use:
/* To prevent loops, check if dev is not upper device to upper_dev. */
> +/**
> + * netdev_upper_free_rcu - Frees a upper device list item via the RCU pointer
> + * @entry: the entry's RCU field
> + *
> + * This function is designed to be used as a callback to the call_rcu()
> + * function so that the memory allocated to the netdev upper device list item
> + * can be released safely.
> + */
> +static void netdev_upper_free_rcu(struct rcu_head *entry)
> +{
> + struct netdev_upper *upper;
> +
> + upper = container_of(entry, struct netdev_upper, rcu);
> + kfree(upper);
> +}
Please use kfree_rcu().
Also, since __netdev_has_upper_dev() modifies &search_list inside
of the list traversal loop, I think you really need to use
list_for_each_entry_safe() even though you always append to the
tail of &search_list.
^ permalink raw reply
* Re: [PATCH v2 1/1 net-next] NET: FEC: dynamtic check DMA desc buff type
From: Frank Li @ 2012-12-30 1:01 UTC (permalink / raw)
To: Lothar Waßmann
Cc: Frank Li, netdev, s.hauer, shawn.guo, davem, linux-arm-kernel
In-Reply-To: <20701.45196.361432.80622@ipc1.ka-ro>
2012/12/28 Lothar Waßmann <LW@karo-electronics.de>:
> Frank Li writes:
>> MX6 and mx28 support enhanced DMA descript buff to support 1588
>> ptp. But MX25, MX3x, MX5x can't support enhanced DMA descript buff.
>> Check fec type and choose correct DAM descript buff type.
> ^^^
> s/DAM/DMA/
> s/descript/descriptor/g
>
> [...]
>> diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
>> index 0704bca..290f91c 100644
>> --- a/drivers/net/ethernet/freescale/fec.c
>> +++ b/drivers/net/ethernet/freescale/fec.c
>> @@ -76,6 +76,8 @@
>> #define FEC_QUIRK_USE_GASKET (1 << 2)
>> /* Controller has GBIT support */
>> #define FEC_QUIRK_HAS_GBIT (1 << 3)
>> +/* Controller has extend desc buffer */
>> +#define FEC_QUICK_HAS_BUFDESC_EX (1 << 4)
> ^^^^^
> As Sascha has already pointed out, this should be 'QUIRK' rather than
> 'QUICK' (like in the preceeding lines)!
>
>> static struct platform_device_id fec_devtype[] = {
>> {
>> @@ -93,7 +95,8 @@ static struct platform_device_id fec_devtype[] = {
>> .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME,
>> }, {
>> .name = "imx6q-fec",
>> - .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT,
>> + .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
>> + FEC_QUICK_HAS_BUFDESC_EX,
> ^^^^^
> same as above.
>
> [...]
>> @@ -1574,6 +1617,8 @@ fec_probe(struct platform_device *pdev)
>> fep->pdev = pdev;
>> fep->dev_id = dev_id++;
>>
>> + fep->bufdesc_ex = 0;
>> +
>> if (!fep->hwp) {
>> ret = -ENOMEM;
>> goto failed_ioremap;
>> @@ -1628,19 +1673,19 @@ fec_probe(struct platform_device *pdev)
>> goto failed_clk;
>> }
>>
>> -#ifdef CONFIG_FEC_PTP
>> fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp");
>> + fep->bufdesc_ex =
>> + pdev->id_entry->driver_data & FEC_QUICK_HAS_BUFDESC_EX;
> ^^^^^
> same as above.
Okay, I will fix it after new year holiday.
>
>
> Lothar Waßmann
> --
> ___________________________________________________________
>
> Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
> Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
> Geschäftsführer: Matthias Kaussen
> Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
>
> www.karo-electronics.de | info@karo-electronics.de
> ___________________________________________________________
^ permalink raw reply
* [PATCH net-next] team: add ethtool support
From: Flavio Leitner @ 2012-12-30 1:19 UTC (permalink / raw)
To: netdev; +Cc: Jiri Pirko, Flavio Leitner
This patch adds few ethtool operations to team driver.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
drivers/net/team/team.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index ad86660..f711039 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -28,6 +28,7 @@
#include <net/genetlink.h>
#include <net/netlink.h>
#include <net/sch_generic.h>
+#include <generated/utsrelease.h>
#include <linux/if_team.h>
#define DRV_NAME "team"
@@ -1731,6 +1732,75 @@ static const struct net_device_ops team_netdev_ops = {
.ndo_fix_features = team_fix_features,
};
+/***********************
+ * ethtool interface
+ ***********************/
+
+static const char ethtool_stats_keys[][ETH_GSTRING_LEN] = {
+ "rx_packets",
+ "rx_bytes",
+ "rx_dropped",
+ "tx_packets",
+ "tx_bytes",
+ "tx_dropped",
+ "multicast",
+};
+
+#define TEAM_NUM_STATS ARRAY_SIZE(ethtool_stats_keys)
+
+static int team_get_sset_count(struct net_device *netdev, int sset)
+{
+ switch (sset) {
+ case ETH_SS_STATS:
+ return TEAM_NUM_STATS;
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+
+static void team_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
+{
+ switch (stringset) {
+ case ETH_SS_STATS:
+ memcpy(data, *ethtool_stats_keys, sizeof(ethtool_stats_keys));
+ break;
+ }
+}
+
+static void team_get_ethtool_stats(struct net_device *netdev,
+ struct ethtool_stats *stats,
+ u64 *data)
+{
+ struct rtnl_link_stats64 net_stats;
+ int i;
+
+ memset(&net_stats, 0, sizeof(struct rtnl_link_stats64));
+ team_get_stats64(netdev, &net_stats);
+ i = 0;
+ /* ordering based on ethtool_stats_keys */
+ data[i++] = net_stats.rx_packets;
+ data[i++] = net_stats.rx_bytes;
+ data[i++] = net_stats.rx_dropped;
+ data[i++] = net_stats.tx_packets;
+ data[i++] = net_stats.tx_bytes;
+ data[i++] = net_stats.tx_dropped;
+ data[i++] = net_stats.multicast;
+}
+
+static void team_ethtool_get_drvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *drvinfo)
+{
+ strncpy(drvinfo->driver, DRV_NAME, 32);
+ strncpy(drvinfo->version, UTS_RELEASE, 32);
+}
+
+static const struct ethtool_ops team_ethtool_ops = {
+ .get_drvinfo = team_ethtool_get_drvinfo,
+ .get_link = ethtool_op_get_link,
+ .get_strings = team_get_strings,
+ .get_ethtool_stats = team_get_ethtool_stats,
+ .get_sset_count = team_get_sset_count,
+};
/***********************
* rt netlink interface
@@ -1780,6 +1850,7 @@ static void team_setup(struct net_device *dev)
ether_setup(dev);
dev->netdev_ops = &team_netdev_ops;
+ dev->ethtool_ops = &team_ethtool_ops;
dev->destructor = team_destructor;
dev->tx_queue_len = 0;
dev->flags |= IFF_MULTICAST;
--
1.8.0.1
^ permalink raw reply related
* Re: [PATCH net-next] team: add ethtool support
From: Stephen Hemminger @ 2012-12-30 1:29 UTC (permalink / raw)
To: Flavio Leitner; +Cc: netdev, Jiri Pirko
In-Reply-To: <1356830366-991-1-git-send-email-fbl@redhat.com>
On Sat, 29 Dec 2012 23:19:26 -0200
Flavio Leitner <fbl@redhat.com> wrote:
> This patch adds few ethtool operations to team driver.
>
> Signed-off-by: Flavio Leitner <fbl@redhat.com>
What is the motivation for this? Is there an application that depends
on ethtool (versus netlink, or /proc)?
Sorry, I see no point in providing ethtool statistics for generic data that is already
reported by existing netlink and other infrastructure. The purpose of ethtool
statistics is to report device specific that is not available through the normal
generic statistics.
^ permalink raw reply
* [PATCH net-next] team: implement carrier change
From: Flavio Leitner @ 2012-12-30 1:31 UTC (permalink / raw)
To: netdev; +Cc: Jiri Pirko, Flavio Leitner
The user space teamd daemon may need to control the
master's carrier state depending on the selected mode.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
drivers/net/team/team.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index f711039..14cb843 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1708,6 +1708,15 @@ static netdev_features_t team_fix_features(struct net_device *dev,
return features;
}
+static int team_change_carrier(struct net_device *dev, bool new_carrier)
+{
+ if (new_carrier)
+ netif_carrier_on(dev);
+ else
+ netif_carrier_off(dev);
+ return 0;
+}
+
static const struct net_device_ops team_netdev_ops = {
.ndo_init = team_init,
.ndo_uninit = team_uninit,
@@ -1730,6 +1739,7 @@ static const struct net_device_ops team_netdev_ops = {
.ndo_add_slave = team_add_slave,
.ndo_del_slave = team_del_slave,
.ndo_fix_features = team_fix_features,
+ .ndo_change_carrier = team_change_carrier,
};
/***********************
--
1.8.0.1
^ permalink raw reply related
* Re: [PATCH net-next] team: add ethtool support
From: David Miller @ 2012-12-30 1:35 UTC (permalink / raw)
To: shemminger; +Cc: fbl, netdev, jiri
In-Reply-To: <20121229172945.25a09fc8@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Sat, 29 Dec 2012 17:29:45 -0800
> On Sat, 29 Dec 2012 23:19:26 -0200
> Flavio Leitner <fbl@redhat.com> wrote:
>
>> This patch adds few ethtool operations to team driver.
>>
>> Signed-off-by: Flavio Leitner <fbl@redhat.com>
>
> What is the motivation for this? Is there an application that depends
> on ethtool (versus netlink, or /proc)?
>
> Sorry, I see no point in providing ethtool statistics for generic data that is already
> reported by existing netlink and other infrastructure. The purpose of ethtool
> statistics is to report device specific that is not available through the normal
> generic statistics.
Agreed, ethtool stats should _ONLY_ report device specific
statistics.
^ permalink raw reply
* Re: [PATCH net-next] team: add ethtool support
From: Flavio Leitner @ 2012-12-30 1:44 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Jiri Pirko
In-Reply-To: <20121229172945.25a09fc8@nehalam.linuxnetplumber.net>
On Sat, Dec 29, 2012 at 05:29:45PM -0800, Stephen Hemminger wrote:
> On Sat, 29 Dec 2012 23:19:26 -0200
> Flavio Leitner <fbl@redhat.com> wrote:
>
> > This patch adds few ethtool operations to team driver.
> >
> > Signed-off-by: Flavio Leitner <fbl@redhat.com>
>
> What is the motivation for this? Is there an application that depends
> on ethtool (versus netlink, or /proc)?
Speaking as a support engineer, it's a lot easier to grab ethtool -S and
see everything than grab two or more outputs.
> Sorry, I see no point in providing ethtool statistics for generic data that is already
> reported by existing netlink and other infrastructure. The purpose of ethtool
> statistics is to report device specific that is not available through the normal
> generic statistics.
Right, but those statistics can be device specific as well. The tg3 and bnx2, for
instance, do the same reporting [rx|tx]_bytes|octets.
I see no harm, and it is helpful.
--
fbl
^ permalink raw reply
* Re: [PATCHv2 net-next] bridge: respect RFC2863 operational state
From: Flavio Leitner @ 2012-12-30 2:01 UTC (permalink / raw)
To: netdev
In-Reply-To: <20121228201522.62a48370@nehalam.linuxnetplumber.net>
On Fri, Dec 28, 2012 at 08:15:22PM -0800, Stephen Hemminger wrote:
> The bridge link detection should follow the operational state
> of the lower device, rather than the carrier bit. This allows devices
> like tunnels that are controlled by userspace control plane to work
> with bridge STP link management.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
Although I can't test this right now, it does look good to me.
Reviewed-by: Flavio Leitner <fbl@redhat.com>
^ permalink raw reply
* [PATCH net-next] veth: reduce stat overhead
From: Eric Dumazet @ 2012-12-30 2:02 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
veth stats are a bit bloated. There is no need to account transmit
and receive stats, since they are absolutely symmetric.
Also use a per device atomic64_t for the dropped counter, as it
should never be used in fast path.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/veth.c | 115 ++++++++++++++----------------------
include/linux/netdevice.h | 1
2 files changed, 48 insertions(+), 68 deletions(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 95814d9..c048f8d 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -25,18 +25,15 @@
#define MIN_MTU 68 /* Min L3 MTU */
#define MAX_MTU 65535 /* Max L3 MTU (arbitrary) */
-struct veth_net_stats {
- u64 rx_packets;
- u64 rx_bytes;
- u64 tx_packets;
- u64 tx_bytes;
- u64 rx_dropped;
+struct pcpu_vstats {
+ u64 packets;
+ u64 bytes;
struct u64_stats_sync syncp;
};
struct veth_priv {
- struct net_device *peer;
- struct veth_net_stats __percpu *stats;
+ struct net_device *peer;
+ atomic64_t dropped;
};
/*
@@ -107,50 +104,30 @@ static const struct ethtool_ops veth_ethtool_ops = {
.get_ethtool_stats = veth_get_ethtool_stats,
};
-/*
- * xmit
- */
-
static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
{
- struct net_device *rcv = NULL;
- struct veth_priv *priv, *rcv_priv;
- struct veth_net_stats *stats, *rcv_stats;
- int length;
-
- priv = netdev_priv(dev);
- rcv = priv->peer;
- rcv_priv = netdev_priv(rcv);
-
- stats = this_cpu_ptr(priv->stats);
- rcv_stats = this_cpu_ptr(rcv_priv->stats);
+ struct veth_priv *priv = netdev_priv(dev);
+ struct net_device *rcv = priv->peer;
+ int length = skb->len;
/* don't change ip_summed == CHECKSUM_PARTIAL, as that
- will cause bad checksum on forwarded packets */
+ * will cause bad checksum on forwarded packets
+ */
if (skb->ip_summed == CHECKSUM_NONE &&
rcv->features & NETIF_F_RXCSUM)
skb->ip_summed = CHECKSUM_UNNECESSARY;
- length = skb->len;
- if (dev_forward_skb(rcv, skb) != NET_RX_SUCCESS)
- goto rx_drop;
-
- u64_stats_update_begin(&stats->syncp);
- stats->tx_bytes += length;
- stats->tx_packets++;
- u64_stats_update_end(&stats->syncp);
+ if (likely(dev_forward_skb(rcv, skb) == NET_RX_SUCCESS)) {
+ struct pcpu_vstats *stats = this_cpu_ptr(dev->vstats);
- u64_stats_update_begin(&rcv_stats->syncp);
- rcv_stats->rx_bytes += length;
- rcv_stats->rx_packets++;
- u64_stats_update_end(&rcv_stats->syncp);
-
- return NETDEV_TX_OK;
+ u64_stats_update_begin(&stats->syncp);
+ stats->bytes += length;
+ stats->packets++;
+ u64_stats_update_end(&stats->syncp);
+ } else {
+ atomic64_inc(&priv->dropped);
+ }
-rx_drop:
- u64_stats_update_begin(&rcv_stats->syncp);
- rcv_stats->rx_dropped++;
- u64_stats_update_end(&rcv_stats->syncp);
return NETDEV_TX_OK;
}
@@ -158,32 +135,42 @@ rx_drop:
* general routines
*/
-static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev,
- struct rtnl_link_stats64 *tot)
+static u64 veth_stats_one(struct pcpu_vstats *result, struct net_device *dev)
{
struct veth_priv *priv = netdev_priv(dev);
int cpu;
+ result->packets = 0;
+ result->bytes = 0;
for_each_possible_cpu(cpu) {
- struct veth_net_stats *stats = per_cpu_ptr(priv->stats, cpu);
- u64 rx_packets, rx_bytes, rx_dropped;
- u64 tx_packets, tx_bytes;
+ struct pcpu_vstats *stats = per_cpu_ptr(dev->vstats, cpu);
+ u64 packets, bytes;
unsigned int start;
do {
start = u64_stats_fetch_begin_bh(&stats->syncp);
- rx_packets = stats->rx_packets;
- tx_packets = stats->tx_packets;
- rx_bytes = stats->rx_bytes;
- tx_bytes = stats->tx_bytes;
- rx_dropped = stats->rx_dropped;
+ packets = stats->packets;
+ bytes = stats->bytes;
} while (u64_stats_fetch_retry_bh(&stats->syncp, start));
- tot->rx_packets += rx_packets;
- tot->tx_packets += tx_packets;
- tot->rx_bytes += rx_bytes;
- tot->tx_bytes += tx_bytes;
- tot->rx_dropped += rx_dropped;
+ result->packets += packets;
+ result->bytes += bytes;
}
+ return atomic64_read(&priv->dropped);
+}
+
+static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev,
+ struct rtnl_link_stats64 *tot)
+{
+ struct veth_priv *priv = netdev_priv(dev);
+ struct pcpu_vstats one;
+
+ tot->tx_dropped = veth_stats_one(&one, dev);
+ tot->tx_bytes = one.bytes;
+ tot->tx_packets = one.packets;
+
+ tot->rx_dropped = veth_stats_one(&one, priv->peer);
+ tot->rx_bytes = one.bytes;
+ tot->rx_packets = one.packets;
return tot;
}
@@ -228,24 +215,16 @@ static int veth_change_mtu(struct net_device *dev, int new_mtu)
static int veth_dev_init(struct net_device *dev)
{
- struct veth_net_stats __percpu *stats;
- struct veth_priv *priv;
-
- stats = alloc_percpu(struct veth_net_stats);
- if (stats == NULL)
+ dev->vstats = alloc_percpu(struct pcpu_vstats);
+ if (!dev->vstats)
return -ENOMEM;
- priv = netdev_priv(dev);
- priv->stats = stats;
return 0;
}
static void veth_dev_free(struct net_device *dev)
{
- struct veth_priv *priv;
-
- priv = netdev_priv(dev);
- free_percpu(priv->stats);
+ free_percpu(dev->vstats);
free_netdev(dev);
}
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c599e47..e3f5755 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1274,6 +1274,7 @@ struct net_device {
struct pcpu_lstats __percpu *lstats; /* loopback stats */
struct pcpu_tstats __percpu *tstats; /* tunnel stats */
struct pcpu_dstats __percpu *dstats; /* dummy stats */
+ struct pcpu_vstats __percpu *vstats; /* veth stats */
};
/* GARP */
struct garp_port __rcu *garp_port;
^ permalink raw reply related
* Re: [PATCH net-next] team: add ethtool support
From: David Miller @ 2012-12-30 2:09 UTC (permalink / raw)
To: fbl; +Cc: shemminger, netdev, jiri
In-Reply-To: <20121230014403.GA2077@obelix.rh>
From: Flavio Leitner <fbl@redhat.com>
Date: Sat, 29 Dec 2012 23:44:03 -0200
> Right, but those statistics can be device specific as well. The tg3 and bnx2, for
> instance, do the same reporting [rx|tx]_bytes|octets.
Because those ARE PER QUEUE in multiqueue configurations, and thus
device specific.
There is no reason to report the bare single-queue generic
netdevice stats via ethtool.
^ permalink raw reply
* [PATCH] veth: extend device features
From: Eric Dumazet @ 2012-12-30 2:26 UTC (permalink / raw)
To: Michał Mirosław, David Miller
Cc: Andrew Vagin, netdev, vvs, Michał Mirosław
In-Reply-To: <CAHXqBFL+Ycw4-_LRcOCT0bjhALE3HfVMB7YfcoCruu=zW5PN-g@mail.gmail.com>
From: Eric Dumazet <edumazet@google.com>
veth is lacking most modern facilities, like SG, checksums, TSO.
It makes sense to extend dev->features to get them, or GRO aggregation
is defeated by a forced segmentation.
Reported-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
drivers/net/veth.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 95814d9..ccf211f 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -259,6 +259,10 @@ static const struct net_device_ops veth_netdev_ops = {
.ndo_set_mac_address = eth_mac_addr,
};
+#define VETH_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
+ NETIF_F_HW_CSUM | NETIF_F_RXCSUM | NETIF_F_HIGHDMA | \
+ NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX)
+
static void veth_setup(struct net_device *dev)
{
ether_setup(dev);
@@ -269,9 +273,10 @@ static void veth_setup(struct net_device *dev)
dev->netdev_ops = &veth_netdev_ops;
dev->ethtool_ops = &veth_ethtool_ops;
dev->features |= NETIF_F_LLTX;
+ dev->features |= VETH_FEATURES;
dev->destructor = veth_dev_free;
- dev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_RXCSUM;
+ dev->hw_features = VETH_FEATURES;
}
/*
^ permalink raw reply related
* Re: [PATCH net-next] team: add ethtool support
From: Flavio Leitner @ 2012-12-30 2:30 UTC (permalink / raw)
To: David Miller; +Cc: shemminger, netdev, jiri
In-Reply-To: <20121229.180930.2054437059250829691.davem@davemloft.net>
On Sat, Dec 29, 2012 at 06:09:30PM -0800, David Miller wrote:
> From: Flavio Leitner <fbl@redhat.com>
> Date: Sat, 29 Dec 2012 23:44:03 -0200
>
> > Right, but those statistics can be device specific as well. The tg3 and bnx2, for
> > instance, do the same reporting [rx|tx]_bytes|octets.
>
> Because those ARE PER QUEUE in multiqueue configurations, and thus
> device specific.
>
> There is no reason to report the bare single-queue generic
> netdevice stats via ethtool.
Alright, I will post another version without the statistics.
please, drop this one.
thanks,
--
fbl
^ permalink raw reply
* Re: [PATCH net-next] team: add ethtool support
From: Eric Dumazet @ 2012-12-30 2:31 UTC (permalink / raw)
To: Flavio Leitner; +Cc: Stephen Hemminger, netdev, Jiri Pirko
In-Reply-To: <20121230014403.GA2077@obelix.rh>
On Sat, 2012-12-29 at 23:44 -0200, Flavio Leitner wrote:
> Speaking as a support engineer, it's a lot easier to grab ethtool -S and
> see everything than grab two or more outputs.
>
I agree its very convenient.
I have a patch to add GRO statistics at the core layer, in the ethtool
-S stats.
I was about to ask netdev guys what they think of this idea ?
net-gro: Add GRO counters to ethtool -S
In order to get an idea of how effective is GRO aggregation on a machine,
we need appropriate counters. Preferably use "ethtool -S" to display them
on a per device basis, or even per RX queue.
In this implementation, I chose to not change NIC drivers.
Core network stack adds the gro counters at the end of the counters
each NIC driver provides for ethtool -S
There are 5 counters per RX queue :
gro_complete: number of time the NAPI handler did not consume its budget
(This force a flush of all GRO packets in the GRO queue)
gro_overflows: number of time a segment could not be stored in GRO queue
because current number or messages is too high
gro_nogro: number of time a segment was not stored in GRO queue.
(Because its not a TCP packet, or it includes a
SYN/FIN/RST/PSH flag)
gro_msgs: number of GRO messages (might contain 1 to 17 segments)
gro_segs: number of GRO segments
Example:
On receiver machine, with 8 RX queues :
ethtool -S eth4 | tail -n 10
gro_complete[7]: 56635
gro_overflows[7]: 0
gro_nogro[7]: 212
gro_msgs[7]: 129410
gro_segs[7]: 1434925
gro_complete: 699479
gro_overflows: 0
gro_nogro: 2455
gro_msgs: 1626470
gro_segs: 17876794
In this example, we can compute average number of segments per GRO message :
17876794/17876794 = 10.99
Or more precisely : 17876794/(17876794+2455) = 10.97
^ permalink raw reply
* [PATCH v2 net-next] team: add ethtool support
From: Flavio Leitner @ 2012-12-30 2:37 UTC (permalink / raw)
To: netdev; +Cc: Jiri Pirko, Flavio Leitner
This patch adds few ethtool operations to team driver.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
v2 - removed generic statistics from ethtool
drivers/net/team/team.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index ad86660..7665a088 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -28,6 +28,7 @@
#include <net/genetlink.h>
#include <net/netlink.h>
#include <net/sch_generic.h>
+#include <generated/utsrelease.h>
#include <linux/if_team.h>
#define DRV_NAME "team"
@@ -1731,6 +1732,21 @@ static const struct net_device_ops team_netdev_ops = {
.ndo_fix_features = team_fix_features,
};
+/***********************
+ * ethtool interface
+ ***********************/
+
+static void team_ethtool_get_drvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *drvinfo)
+{
+ strncpy(drvinfo->driver, DRV_NAME, 32);
+ strncpy(drvinfo->version, UTS_RELEASE, 32);
+}
+
+static const struct ethtool_ops team_ethtool_ops = {
+ .get_drvinfo = team_ethtool_get_drvinfo,
+ .get_link = ethtool_op_get_link,
+};
/***********************
* rt netlink interface
@@ -1780,6 +1796,7 @@ static void team_setup(struct net_device *dev)
ether_setup(dev);
dev->netdev_ops = &team_netdev_ops;
+ dev->ethtool_ops = &team_ethtool_ops;
dev->destructor = team_destructor;
dev->tx_queue_len = 0;
dev->flags |= IFF_MULTICAST;
--
1.8.0.1
^ permalink raw reply related
* [PATCH] net: fix checking boundary of valid vlan id
From: akong @ 2012-12-30 6:28 UTC (permalink / raw)
To: netdev; +Cc: davem
From: Amos Kong <akong@redhat.com>
4096 is not a valid vlan id.
Signed-off-by: Amos Kong <akong@redhat.com>
---
net/bridge/netfilter/ebt_vlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bridge/netfilter/ebt_vlan.c b/net/bridge/netfilter/ebt_vlan.c
index eae67bf..b279ec0 100644
--- a/net/bridge/netfilter/ebt_vlan.c
+++ b/net/bridge/netfilter/ebt_vlan.c
@@ -121,8 +121,8 @@ static int ebt_vlan_mt_check(const struct xt_mtchk_param *par)
* if_vlan.h: VLAN_N_VID 4096. */
if (GET_BITMASK(EBT_VLAN_ID)) {
if (!!info->id) { /* if id!=0 => check vid range */
- if (info->id > VLAN_N_VID) {
- pr_debug("id %d is out of range (1-4096)\n",
+ if (info->id >= VLAN_N_VID) {
+ pr_debug("id %d is out of range (1-4095)\n",
info->id);
return -EINVAL;
}
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH] net: fix checking boundary of valid vlan id
From: Amos Kong @ 2012-12-30 6:39 UTC (permalink / raw)
To: netdev; +Cc: davem
In-Reply-To: <1356848931-22193-1-git-send-email-akong@redhat.com>
On Sun, Dec 30, 2012 at 02:28:51PM +0800, akong@redhat.com wrote:
> From: Amos Kong <akong@redhat.com>
>
> 4096 is not a valid vlan id.
>
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
> net/bridge/netfilter/ebt_vlan.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/bridge/netfilter/ebt_vlan.c b/net/bridge/netfilter/ebt_vlan.c
> index eae67bf..b279ec0 100644
> --- a/net/bridge/netfilter/ebt_vlan.c
> +++ b/net/bridge/netfilter/ebt_vlan.c
> @@ -121,8 +121,8 @@ static int ebt_vlan_mt_check(const struct xt_mtchk_param *par)
> * if_vlan.h: VLAN_N_VID 4096. */
> if (GET_BITMASK(EBT_VLAN_ID)) {
> if (!!info->id) { /* if id!=0 => check vid range */
> - if (info->id > VLAN_N_VID) {
> - pr_debug("id %d is out of range (1-4096)\n",
> + if (info->id >= VLAN_N_VID) {
> + pr_debug("id %d is out of range (1-4095)\n",
Hi David,
4095 is reserved, treat it as invalid here?
if (info->id >= VLAN_N_VID - 1) {
pr_debug("id %d is out of range (1-4094)\n",
> info->id);
> return -EINVAL;
> }
> --
> 1.7.11.7
^ permalink raw reply
* Re: [PATCH] net: fix checking boundary of valid vlan id
From: David Miller @ 2012-12-30 7:40 UTC (permalink / raw)
To: akong; +Cc: netdev
In-Reply-To: <1356848931-22193-1-git-send-email-akong@redhat.com>
Please send netfilter patches to the netfilter developers
at netfilter-devel@vger.kernel.org
Thanks.
^ permalink raw reply
* Re: [PATCH net-next] team: implement carrier change
From: Jiri Pirko @ 2012-12-30 8:50 UTC (permalink / raw)
To: Flavio Leitner; +Cc: netdev
In-Reply-To: <1356831061-1483-1-git-send-email-fbl@redhat.com>
Sun, Dec 30, 2012 at 02:31:01AM CET, fbl@redhat.com wrote:
>The user space teamd daemon may need to control the
>master's carrier state depending on the selected mode.
>
>Signed-off-by: Flavio Leitner <fbl@redhat.com>
>---
> drivers/net/team/team.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>index f711039..14cb843 100644
>--- a/drivers/net/team/team.c
>+++ b/drivers/net/team/team.c
>@@ -1708,6 +1708,15 @@ static netdev_features_t team_fix_features(struct net_device *dev,
> return features;
> }
>
>+static int team_change_carrier(struct net_device *dev, bool new_carrier)
>+{
>+ if (new_carrier)
>+ netif_carrier_on(dev);
>+ else
>+ netif_carrier_off(dev);
>+ return 0;
>+}
>+
> static const struct net_device_ops team_netdev_ops = {
> .ndo_init = team_init,
> .ndo_uninit = team_uninit,
>@@ -1730,6 +1739,7 @@ static const struct net_device_ops team_netdev_ops = {
> .ndo_add_slave = team_add_slave,
> .ndo_del_slave = team_del_slave,
> .ndo_fix_features = team_fix_features,
>+ .ndo_change_carrier = team_change_carrier,
> };
>
> /***********************
>--
>1.8.0.1
Acked-by: Jiri Pirko <jiri@resnulli.us>
>
^ permalink raw reply
* Re: [PATCH v2 net-next] team: add ethtool support
From: Jiri Pirko @ 2012-12-30 8:51 UTC (permalink / raw)
To: Flavio Leitner; +Cc: netdev
In-Reply-To: <1356835053-25602-1-git-send-email-fbl@redhat.com>
Sun, Dec 30, 2012 at 03:37:33AM CET, fbl@redhat.com wrote:
>This patch adds few ethtool operations to team driver.
>
>Signed-off-by: Flavio Leitner <fbl@redhat.com>
>---
>v2 - removed generic statistics from ethtool
>
> drivers/net/team/team.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>index ad86660..7665a088 100644
>--- a/drivers/net/team/team.c
>+++ b/drivers/net/team/team.c
>@@ -28,6 +28,7 @@
> #include <net/genetlink.h>
> #include <net/netlink.h>
> #include <net/sch_generic.h>
>+#include <generated/utsrelease.h>
> #include <linux/if_team.h>
>
> #define DRV_NAME "team"
>@@ -1731,6 +1732,21 @@ static const struct net_device_ops team_netdev_ops = {
> .ndo_fix_features = team_fix_features,
> };
>
>+/***********************
>+ * ethtool interface
>+ ***********************/
>+
>+static void team_ethtool_get_drvinfo(struct net_device *dev,
>+ struct ethtool_drvinfo *drvinfo)
>+{
>+ strncpy(drvinfo->driver, DRV_NAME, 32);
>+ strncpy(drvinfo->version, UTS_RELEASE, 32);
>+}
>+
>+static const struct ethtool_ops team_ethtool_ops = {
>+ .get_drvinfo = team_ethtool_get_drvinfo,
>+ .get_link = ethtool_op_get_link,
>+};
>
> /***********************
> * rt netlink interface
>@@ -1780,6 +1796,7 @@ static void team_setup(struct net_device *dev)
> ether_setup(dev);
>
> dev->netdev_ops = &team_netdev_ops;
>+ dev->ethtool_ops = &team_ethtool_ops;
> dev->destructor = team_destructor;
> dev->tx_queue_len = 0;
> dev->flags |= IFF_MULTICAST;
>--
>1.8.0.1
>
Acked-by: Jiri Pirko <jiri@resnulli.us>
^ permalink raw reply
* Re: [patch net-next 01/15] net: introduce upper device lists
From: Jiri Pirko @ 2012-12-30 9:53 UTC (permalink / raw)
To: David Miller
Cc: netdev, edumazet, bhutchings, faisal.latif, shemminger, fbl,
roland, sean.hefty, hal.rosenstock, fubar, andy, divy,
jitendra.kalsaria, sony.chacko, linux-driver, kaber, ursula.braun,
blaschka, schwidefsky, heiko.carstens, ebiederm, joe, amwang,
nhorman, john.r.fastabend, pablo
In-Reply-To: <20121229.153101.676681277388952344.davem@davemloft.net>
Sun, Dec 30, 2012 at 12:31:01AM CET, davem@davemloft.net wrote:
>From: Jiri Pirko <jiri@resnulli.us>
>Date: Sat, 29 Dec 2012 11:38:28 +0100
>
>> + /*
>> + * To prevent loops, check if dev is not upper device to upper_dev.
>> + */
>
>Please use:
>
> /* To prevent loops, check if dev is not upper device to upper_dev. */
fixed
>
>> +/**
>> + * netdev_upper_free_rcu - Frees a upper device list item via the RCU pointer
>> + * @entry: the entry's RCU field
>> + *
>> + * This function is designed to be used as a callback to the call_rcu()
>> + * function so that the memory allocated to the netdev upper device list item
>> + * can be released safely.
>> + */
>> +static void netdev_upper_free_rcu(struct rcu_head *entry)
>> +{
>> + struct netdev_upper *upper;
>> +
>> + upper = container_of(entry, struct netdev_upper, rcu);
>> + kfree(upper);
>> +}
>
>Please use kfree_rcu().
fixed
>
>Also, since __netdev_has_upper_dev() modifies &search_list inside
>of the list traversal loop, I think you really need to use
>list_for_each_entry_safe() even though you always append to the
>tail of &search_list.
Hmm, I do not believe that list_for_each_entry_safe() would work correctly
here. In case that the current iterator is at the very end of
the list and now other items are added, list_for_each_entry_safe() would
remember that next is head and the newly added items would not be
processed. list_for_each_entry() works just fine in any case I can
imagine. Note that no items are removed during the iteration.
Am I missing something?
Thanks!
Jiri
^ permalink raw reply
* Re: [PATCH net-next] net: filter: return -EINVAL if BPF_S_ANC* operation is not supported
From: David Miller @ 2012-12-30 10:30 UTC (permalink / raw)
To: dborkman; +Cc: ani, netdev, eric.dumazet
In-Reply-To: <1356727817-10649-1-git-send-email-dborkman@redhat.com>
From: Daniel Borkmann <dborkman@redhat.com>
Date: Fri, 28 Dec 2012 21:50:17 +0100
> Currently, we return -EINVAL for malformed or wrong BPF filters.
> However, this is not done for BPF_S_ANC* operations, which makes it
> more difficult to detect if it's actually supported or not by the
> BPF machine. Therefore, we should also return -EINVAL if K is within
> the SKF_AD_OFF universe and the ancillary operation did not match.
...
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Reported-by: Ani Sinha <ani@aristanetworks.com>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCHv2 net-next] bridge: respect RFC2863 operational state
From: David Miller @ 2012-12-30 10:32 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20121228201522.62a48370@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 28 Dec 2012 20:15:22 -0800
> The bridge link detection should follow the operational state
> of the lower device, rather than the carrier bit. This allows devices
> like tunnels that are controlled by userspace control plane to work
> with bridge STP link management.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] team: implement carrier change
From: David Miller @ 2012-12-30 10:32 UTC (permalink / raw)
To: fbl; +Cc: netdev, jiri
In-Reply-To: <1356831061-1483-1-git-send-email-fbl@redhat.com>
From: Flavio Leitner <fbl@redhat.com>
Date: Sat, 29 Dec 2012 23:31:01 -0200
> The user space teamd daemon may need to control the
> master's carrier state depending on the selected mode.
>
> Signed-off-by: Flavio Leitner <fbl@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] veth: reduce stat overhead
From: David Miller @ 2012-12-30 10:32 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1356832963.21409.6156.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 29 Dec 2012 18:02:43 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> veth stats are a bit bloated. There is no need to account transmit
> and receive stats, since they are absolutely symmetric.
>
> Also use a per device atomic64_t for the dropped counter, as it
> should never be used in fast path.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox