* Re: [PATCH 3/5] NET: IPV4: ARP: allow to invalidate specific ARP entries
From: Eric Dumazet @ 2010-12-05 8:19 UTC (permalink / raw)
To: Maxim Levitsky
Cc: linux1394-devel, Stefan Richter, netdev, David S. Miller,
Alexey Kuznetsov, James Morris, Patrick McHardy
In-Reply-To: <1291504514.1874.92.camel@maxim-laptop>
Le dimanche 05 décembre 2010 à 01:15 +0200, Maxim Levitsky a écrit :
> On Mon, 2010-11-29 at 04:09 +0200, Maxim Levitsky wrote:
> > IPv4 over firewire needs to be able to remove ARP entries
> > from the ARP cache that belong to nodes that are removed, because
> > IPv4 over firewire uses ARP packets for private information
> > about nodes.
> >
> > This information becomes invalid as soon as node drops
> > off the bus and when it reconnects, its only possible
> > to start takling to is after it responded to an ARP packet.
> > But ARP cache prevents such packets from being sent.
> >
> > CC: netdev@vger.kernel.org
> > CC: "David S. Miller" <davem@davemloft.net>
> > CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> > CC: James Morris <jmorris@namei.org>
> > CC: Patrick McHardy <kaber@trash.net>
>
> Anybody?
>
> Best regards,
> Maxim Levitsky
> >
> >
> > Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
> > ---
> > include/net/arp.h | 1 +
> > net/ipv4/arp.c | 29 ++++++++++++++++++-----------
> > 2 files changed, 19 insertions(+), 11 deletions(-)
> >
> > diff --git a/include/net/arp.h b/include/net/arp.h
> > index f4cf6ce..91f0568 100644
> > --- a/include/net/arp.h
> > +++ b/include/net/arp.h
> > @@ -25,5 +25,6 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
> > const unsigned char *src_hw,
> > const unsigned char *target_hw);
> > extern void arp_xmit(struct sk_buff *skb);
> > +int arp_invalidate(struct net_device *dev, __be32 ip);
> >
> > #endif /* _ARP_H */
> > diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
> > index d8e540c..35b1272 100644
> > --- a/net/ipv4/arp.c
> > +++ b/net/ipv4/arp.c
> > @@ -1142,6 +1142,23 @@ static int arp_req_get(struct arpreq *r, struct net_device *dev)
> > return err;
> > }
> >
> > +int arp_invalidate(struct net_device *dev, __be32 ip)
> > +{
> > + int err = -ENXIO;
> > + struct neighbour *neigh = neigh_lookup(&arp_tbl, &ip, dev);
> > +
> > + if (neigh) {
> > + if (neigh->nud_state & ~NUD_NOARP)
> > + err = neigh_update(neigh, NULL, NUD_FAILED,
> > + NEIGH_UPDATE_F_OVERRIDE|
> > + NEIGH_UPDATE_F_ADMIN);
> > + neigh_release(neigh);
> > + }
> > +
> > + return err;
> > +}
> > +EXPORT_SYMBOL(arp_invalidate);
> > +
> > static int arp_req_delete_public(struct net *net, struct arpreq *r,
> > struct net_device *dev)
> > {
> > @@ -1162,7 +1179,6 @@ static int arp_req_delete(struct net *net, struct arpreq *r,
> > {
> > int err;
> > __be32 ip;
> > - struct neighbour *neigh;
> >
> > if (r->arp_flags & ATF_PUBL)
> > return arp_req_delete_public(net, r, dev);
> > @@ -1180,16 +1196,7 @@ static int arp_req_delete(struct net *net, struct arpreq *r,
> > if (!dev)
> > return -EINVAL;
> > }
> > - err = -ENXIO;
> > - neigh = neigh_lookup(&arp_tbl, &ip, dev);
> > - if (neigh) {
> > - if (neigh->nud_state & ~NUD_NOARP)
> > - err = neigh_update(neigh, NULL, NUD_FAILED,
> > - NEIGH_UPDATE_F_OVERRIDE|
> > - NEIGH_UPDATE_F_ADMIN);
> > - neigh_release(neigh);
> > - }
> > - return err;
> > + return arp_invalidate(dev, ip);
> > }
> >
> > /*
>
Hmm..
If somebody can explain why RTNL is held in arp_ioctl() (and therefore
in arp_req_delete()), we might first remove RTNL use in arp_ioctl() so
that your patch can be applied.
Right now it is not good, because RTNL wont be necessarly held when you
are going to call arp_invalidate() ?
^ permalink raw reply
* Re: [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Eric Dumazet @ 2010-12-05 8:03 UTC (permalink / raw)
To: Michael Leun
Cc: netdev, Jesse Gross, linux-kernel, stable, Ben Greear,
David Miller
In-Reply-To: <20101205030712.36149bc2@xenia.leun.net>
Le dimanche 05 décembre 2010 à 03:07 +0100, Michael Leun a écrit :
> On Wed, 01 Dec 2010 11:55:14 +0100
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> > Le mercredi 01 décembre 2010 à 11:17 +0100, Michael Leun a écrit :
> >
> > > Yup, from what I've tested this works (and tcpdump sees broadcast
> > > packets even for vlans not configured at the moment including vlan
> > > tag
> > > - yipee!).
> > >
>
> This was tested on machine with
> root@tp_z61m:~/src/tcpdump-4.1.1# lspci|grep Eth
> 02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5752M Gigabit Ethernet PCI Express (rev 02)
>
> There it works as I said.
>
> But on
>
> hpdl320g5:/home/ml # lspci | grep Eth
> 03:04.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5714 Gigabit Ethernet (rev a3)
> 03:04.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5714 Gigabit Ethernet (rev a3)
>
> the good message is that it also does not crash, but with tcpdump I see
> vlan tags when no vlan devices configured on the respective eth, if so
> I do not see tags anymore vlan tags on the trunk interface.
>
For all these very specific needs, you'll have to try 2.6.37 I am
afraid. Jesse did huge changes to exactly make this working, we wont
backport this to 2.6.36, but only avoid crashes.
> hpdl320g5:/home/ml # ifconfig -a
> [...]
> eth1 Link encap:Ethernet Hardware Adresse xx:xx:xx:xx:xx:xx
> UP BROADCAST MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 Sendewarteschlangenlänge:1000
> RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
> Interrupt:17
> [...]
>
> hpdl320g5:/home/ml # tcpdump -i eth1 -n -e
> tcpdump: WARNING: eth1: no IPv4 address assigned
> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
> listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
> [...]
> 02:45:57.597640 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 1505, p 0, ethertype 802.1Q, vlan 99, p 3, ethertype ARP, arp who-has 10.0.0.1 tell 10.0.0.2
> 02:45:57.622654 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 1505, p 0, ethertype 802.1Q, vlan 99, p 3, ethertype ARP, arp who-has 10.0.0.1 tell 10.0.0.2
> [...]
>
> hpdl320g5:/home/ml # vconfig add eth1 2
> WARNING: Could not open /proc/net/vlan/config. Maybe you need to load the 8021q module, or maybe you are not using PROCFS??
> Added VLAN with VID == 2 to IF -:eth1:-
> hpdl320g5:/home/ml # cat /proc/net/vlan/config
> VLAN Dev name | VLAN ID
> Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
> eth1.2 | 2 | eth1
> hpdl320g5:/home/ml # tcpdump -i eth1 -n -e
> tcpdump: WARNING: eth1: no IPv4 address assigned
> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
> listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
> [...]
> 02:50:18.095959 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 60: vlan 99, p 3, ethertype ARP, arp who-has 10.0.0.1 tell 10.0.0.2
> 02:50:18.120989 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 60: vlan 99, p 3, ethertype ARP, arp who-has 10.0.0.1 tell 10.0.0.2
> [...]
>
> The same packages we saw double vlan tagged a few minutes ago now appear single vlan tagged (and of course, other packets that were shown single vlan tagged before are now shown without vlan tag / eth type 0x0800).
>
>
> On the other machine:
>
> root@tp_z61m:~# cat /proc/net/vlan/config
> VLAN Dev name | VLAN ID
> Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
> eth0.741 | 741 | eth0
> eth0.2 | 2 | eth0
> root@tp_z61m:~/src/tcpdump-4.1.1# ./tcpdump -i eth0 -n -e not port 22
> tcpdump: WARNING: eth0: no IPv4 address assigned
> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
> listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
> 03:06:51.859016 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 1505, p 0, ethertype 802.1Q, vlan 99, p 3, ethertype ARP, Request who-has 10.0.0.1 tell 10.0.0.2, length 42
> 03:06:51.883956 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 1505, p 0, ethertype 802.1Q, vlan 99, p 3, ethertype ARP, Request who-has 10.0.0.1 tell 10.0.0.2, length 42
>
>
>
> [...]
> > Here is the revised patch again then for stable team, via David Miller
> > agreement.
> [...]
>
_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable
^ permalink raw reply
* [net-next-2.6 PATCH] enic: Add ndo_set_rx_mode support for enic vnics
From: Roopa Prabhu @ 2010-12-05 6:23 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Roopa Prabhu <roprabhu@cisco.com>
Add ndo_set_rx_mode support to register unicast and multicast address filters for enic vnics
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
drivers/net/enic/enic.h | 4 +
drivers/net/enic/enic_main.c | 121 ++++++++++++++++++++++++++++++++++--------
drivers/net/enic/enic_res.h | 1
3 files changed, 102 insertions(+), 24 deletions(-)
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index a930fb9..084190e 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -32,7 +32,7 @@
#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION "1.4.1.8"
+#define DRV_VERSION "1.4.1.9"
#define DRV_COPYRIGHT "Copyright 2008-2010 Cisco Systems, Inc"
#define ENIC_BARS_MAX 6
@@ -78,8 +78,10 @@ struct enic {
spinlock_t devcmd_lock;
u8 mac_addr[ETH_ALEN];
u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
+ u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
unsigned int flags;
unsigned int mc_count;
+ unsigned int uc_count;
int csum_rx_enabled;
u32 port_mtu;
u32 rx_coalesce_usecs;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 075ca5f..de7b25c 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1002,7 +1002,7 @@ static int enic_dev_packet_filter(struct enic *enic, int directed,
return err;
}
-static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
+static int enic_dev_add_addr(struct enic *enic, u8 *addr)
{
int err;
@@ -1013,7 +1013,7 @@ static int enic_dev_add_multicast_addr(struct enic *enic, u8 *addr)
return err;
}
-static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
+static int enic_dev_del_addr(struct enic *enic, u8 *addr)
{
int err;
@@ -1024,29 +1024,19 @@ static int enic_dev_del_multicast_addr(struct enic *enic, u8 *addr)
return err;
}
-/* netif_tx_lock held, BHs disabled */
-static void enic_set_multicast_list(struct net_device *netdev)
+static void enic_add_multicast_addr_list(struct enic *enic)
{
- struct enic *enic = netdev_priv(netdev);
+ struct net_device *netdev = enic->netdev;
struct netdev_hw_addr *ha;
- int directed = 1;
- int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
- int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
- int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
unsigned int mc_count = netdev_mc_count(netdev);
- int allmulti = (netdev->flags & IFF_ALLMULTI) ||
- mc_count > ENIC_MULTICAST_PERFECT_FILTERS;
- unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
unsigned int i, j;
- if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS)
+ if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS) {
+ netdev_warn(netdev, "Registering only %d out of %d "
+ "multicast addresses\n",
+ ENIC_MULTICAST_PERFECT_FILTERS, mc_count);
mc_count = ENIC_MULTICAST_PERFECT_FILTERS;
-
- if (enic->flags != flags) {
- enic->flags = flags;
- enic_dev_packet_filter(enic, directed,
- multicast, broadcast, promisc, allmulti);
}
/* Is there an easier way? Trying to minimize to
@@ -1068,7 +1058,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
mc_addr[j]) == 0)
break;
if (j == mc_count)
- enic_dev_del_multicast_addr(enic, enic->mc_addr[i]);
+ enic_dev_del_addr(enic, enic->mc_addr[i]);
}
for (i = 0; i < mc_count; i++) {
@@ -1077,7 +1067,7 @@ static void enic_set_multicast_list(struct net_device *netdev)
enic->mc_addr[j]) == 0)
break;
if (j == enic->mc_count)
- enic_dev_add_multicast_addr(enic, mc_addr[i]);
+ enic_dev_add_addr(enic, mc_addr[i]);
}
/* Save the list to compare against next time
@@ -1089,6 +1079,89 @@ static void enic_set_multicast_list(struct net_device *netdev)
enic->mc_count = mc_count;
}
+static void enic_add_unicast_addr_list(struct enic *enic)
+{
+ struct net_device *netdev = enic->netdev;
+ struct netdev_hw_addr *ha;
+ unsigned int uc_count = netdev_uc_count(netdev);
+ u8 uc_addr[ENIC_UNICAST_PERFECT_FILTERS][ETH_ALEN];
+ unsigned int i, j;
+
+ if (uc_count > ENIC_UNICAST_PERFECT_FILTERS) {
+ netdev_warn(netdev, "Registering only %d out of %d "
+ "unicast addresses\n",
+ ENIC_UNICAST_PERFECT_FILTERS, uc_count);
+ uc_count = ENIC_UNICAST_PERFECT_FILTERS;
+ }
+
+ /* Is there an easier way? Trying to minimize to
+ * calls to add/del unicast addrs. We keep the
+ * addrs from the last call in enic->uc_addr and
+ * look for changes to add/del.
+ */
+
+ i = 0;
+ netdev_for_each_uc_addr(ha, netdev) {
+ if (i == uc_count)
+ break;
+ memcpy(uc_addr[i++], ha->addr, ETH_ALEN);
+ }
+
+ for (i = 0; i < enic->uc_count; i++) {
+ for (j = 0; j < uc_count; j++)
+ if (compare_ether_addr(enic->uc_addr[i],
+ uc_addr[j]) == 0)
+ break;
+ if (j == uc_count)
+ enic_dev_del_addr(enic, enic->uc_addr[i]);
+ }
+
+ for (i = 0; i < uc_count; i++) {
+ for (j = 0; j < enic->uc_count; j++)
+ if (compare_ether_addr(uc_addr[i],
+ enic->uc_addr[j]) == 0)
+ break;
+ if (j == enic->uc_count)
+ enic_dev_add_addr(enic, uc_addr[i]);
+ }
+
+ /* Save the list to compare against next time
+ */
+
+ for (i = 0; i < uc_count; i++)
+ memcpy(enic->uc_addr[i], uc_addr[i], ETH_ALEN);
+
+ enic->uc_count = uc_count;
+}
+
+/* netif_tx_lock held, BHs disabled */
+static void enic_set_rx_mode(struct net_device *netdev)
+{
+ struct enic *enic = netdev_priv(netdev);
+ int directed = 1;
+ int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
+ int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
+ int promisc = (netdev->flags & IFF_PROMISC) ||
+ netdev_uc_count(netdev) > ENIC_UNICAST_PERFECT_FILTERS;
+ int allmulti = (netdev->flags & IFF_ALLMULTI) ||
+ netdev_mc_count(netdev) > ENIC_MULTICAST_PERFECT_FILTERS;
+ unsigned int flags = netdev->flags |
+ (allmulti ? IFF_ALLMULTI : 0) |
+ (promisc ? IFF_PROMISC : 0);
+
+ if (enic->flags != flags) {
+ enic->flags = flags;
+ enic_dev_packet_filter(enic, directed,
+ multicast, broadcast, promisc, allmulti);
+ }
+
+ if (!promisc) {
+ enic_add_unicast_addr_list(enic);
+ if (!allmulti)
+ enic_add_multicast_addr_list(enic);
+ }
+}
+
/* rtnl lock is held */
static void enic_vlan_rx_register(struct net_device *netdev,
struct vlan_group *vlan_group)
@@ -1852,7 +1925,7 @@ static int enic_open(struct net_device *netdev)
vnic_rq_enable(&enic->rq[i]);
enic_dev_add_station_addr(enic);
- enic_set_multicast_list(netdev);
+ enic_set_rx_mode(netdev);
netif_wake_queue(netdev);
@@ -2328,7 +2401,8 @@ static const struct net_device_ops enic_netdev_dynamic_ops = {
.ndo_start_xmit = enic_hard_start_xmit,
.ndo_get_stats = enic_get_stats,
.ndo_validate_addr = eth_validate_addr,
- .ndo_set_multicast_list = enic_set_multicast_list,
+ .ndo_set_rx_mode = enic_set_rx_mode,
+ .ndo_set_multicast_list = enic_set_rx_mode,
.ndo_set_mac_address = enic_set_mac_address_dynamic,
.ndo_change_mtu = enic_change_mtu,
.ndo_vlan_rx_register = enic_vlan_rx_register,
@@ -2349,7 +2423,8 @@ static const struct net_device_ops enic_netdev_ops = {
.ndo_get_stats = enic_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = enic_set_mac_address,
- .ndo_set_multicast_list = enic_set_multicast_list,
+ .ndo_set_rx_mode = enic_set_rx_mode,
+ .ndo_set_multicast_list = enic_set_rx_mode,
.ndo_change_mtu = enic_change_mtu,
.ndo_vlan_rx_register = enic_vlan_rx_register,
.ndo_vlan_rx_add_vid = enic_vlan_rx_add_vid,
diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h
index 9a103d9..25be273 100644
--- a/drivers/net/enic/enic_res.h
+++ b/drivers/net/enic/enic_res.h
@@ -34,6 +34,7 @@
#define ENIC_MAX_MTU 9000
#define ENIC_MULTICAST_PERFECT_FILTERS 32
+#define ENIC_UNICAST_PERFECT_FILTERS 32
#define ENIC_NON_TSO_MAX_DESC 16
^ permalink raw reply related
* Re: [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Michael Leun @ 2010-12-05 2:07 UTC (permalink / raw)
To: Eric Dumazet
Cc: David Miller, Ben Greear, linux-kernel, netdev, Jesse Gross,
stable
In-Reply-To: <1291200914.2856.546.camel@edumazet-laptop>
On Wed, 01 Dec 2010 11:55:14 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le mercredi 01 décembre 2010 à 11:17 +0100, Michael Leun a écrit :
>
> > Yup, from what I've tested this works (and tcpdump sees broadcast
> > packets even for vlans not configured at the moment including vlan
> > tag
> > - yipee!).
> >
This was tested on machine with
root@tp_z61m:~/src/tcpdump-4.1.1# lspci|grep Eth
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5752M Gigabit Ethernet PCI Express (rev 02)
There it works as I said.
But on
hpdl320g5:/home/ml # lspci | grep Eth
03:04.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5714 Gigabit Ethernet (rev a3)
03:04.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5714 Gigabit Ethernet (rev a3)
the good message is that it also does not crash, but with tcpdump I see
vlan tags when no vlan devices configured on the respective eth, if so
I do not see tags anymore vlan tags on the trunk interface.
hpdl320g5:/home/ml # ifconfig -a
[...]
eth1 Link encap:Ethernet Hardware Adresse xx:xx:xx:xx:xx:xx
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 Sendewarteschlangenlänge:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:17
[...]
hpdl320g5:/home/ml # tcpdump -i eth1 -n -e
tcpdump: WARNING: eth1: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
[...]
02:45:57.597640 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 1505, p 0, ethertype 802.1Q, vlan 99, p 3, ethertype ARP, arp who-has 10.0.0.1 tell 10.0.0.2
02:45:57.622654 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 1505, p 0, ethertype 802.1Q, vlan 99, p 3, ethertype ARP, arp who-has 10.0.0.1 tell 10.0.0.2
[...]
hpdl320g5:/home/ml # vconfig add eth1 2
WARNING: Could not open /proc/net/vlan/config. Maybe you need to load the 8021q module, or maybe you are not using PROCFS??
Added VLAN with VID == 2 to IF -:eth1:-
hpdl320g5:/home/ml # cat /proc/net/vlan/config
VLAN Dev name | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
eth1.2 | 2 | eth1
hpdl320g5:/home/ml # tcpdump -i eth1 -n -e
tcpdump: WARNING: eth1: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
[...]
02:50:18.095959 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 60: vlan 99, p 3, ethertype ARP, arp who-has 10.0.0.1 tell 10.0.0.2
02:50:18.120989 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 60: vlan 99, p 3, ethertype ARP, arp who-has 10.0.0.1 tell 10.0.0.2
[...]
The same packages we saw double vlan tagged a few minutes ago now appear single vlan tagged (and of course, other packets that were shown single vlan tagged before are now shown without vlan tag / eth type 0x0800).
On the other machine:
root@tp_z61m:~# cat /proc/net/vlan/config
VLAN Dev name | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
eth0.741 | 741 | eth0
eth0.2 | 2 | eth0
root@tp_z61m:~/src/tcpdump-4.1.1# ./tcpdump -i eth0 -n -e not port 22
tcpdump: WARNING: eth0: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
03:06:51.859016 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 1505, p 0, ethertype 802.1Q, vlan 99, p 3, ethertype ARP, Request who-has 10.0.0.1 tell 10.0.0.2, length 42
03:06:51.883956 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 1505, p 0, ethertype 802.1Q, vlan 99, p 3, ethertype ARP, Request who-has 10.0.0.1 tell 10.0.0.2, length 42
[...]
> Here is the revised patch again then for stable team, via David Miller
> agreement.
[...]
--
MfG,
Michael Leun
^ permalink raw reply
* Re: [PATCH v2] ethtool : Allow ethtool to set interface in loopback mode.
From: Bill Fink @ 2010-12-05 1:33 UTC (permalink / raw)
To: David Lamparter
Cc: Ben Hutchings, Mahesh Bandewar, linux-netdev, Tom Herbert,
David Miller
In-Reply-To: <20101203164844.GB235120@jupiter.n2.diac24.net>
On Fri, 3 Dec 2010, David Lamparter wrote:
> On Fri, Dec 03, 2010 at 04:33:34PM +0000, Ben Hutchings wrote:
> > On Fri, 2010-12-03 at 17:03 +0100, David Lamparter wrote:
> > > On Thu, Dec 02, 2010 at 02:35:51PM -0800, Mahesh Bandewar wrote:
> > > > This patch adds -L command-line option to switch loopback mode on/off
> > > > and -l option to display current loopback mode on a specified interface.
> > > [...]
> > > > +.A1 on off
> > > > +Switches loopback mode
> > > > +.B on
> > > > +or
> > > > +.B off
> > >
> > > What about devices that support different kinds of loopback, like MAC
> > > loopback & PHY loopback? (No idea if we have kernel support for this
> > > either...)
> >
> > That distinction is useful for diagnostic purposes, but drivers can
> > already cover those different loopback modes in self-test. The
> > motivation for this feature is testing data path behaviour, and Mahesh
> > has specified that loopback should be enabled as near as possible to the
> > host.
>
> Ah, good enough. Thanks.
Perhaps in the future it could be extended, if desired,
to something like:
loopback=0 disabled
loopback=1 driver loopback nearest host
loopback=2 driver loopback nearest network
Both types of loopback could be useful for different purposes.
-Bill
^ permalink raw reply
* [PATCH] net/9p/protocol.c: Remove duplicated macros.
From: Thiago Farina @ 2010-12-05 1:22 UTC (permalink / raw)
To: linux-kernel
Cc: David S. Miller, Eric Van Hensbergen, Sripathi Kodi,
Aneesh Kumar K.V, Venkateswararao Jujjuri, Andrew Morton, netdev
Use the macros already provided by kernel.h file.
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
net/9p/protocol.c | 33 +++++++++------------------------
1 files changed, 9 insertions(+), 24 deletions(-)
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 45c15f4..798beac 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -27,31 +27,16 @@
#include <linux/module.h>
#include <linux/errno.h>
+#include <linux/kernel.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
#include <linux/sched.h>
+#include <linux/stddef.h>
#include <linux/types.h>
#include <net/9p/9p.h>
#include <net/9p/client.h>
#include "protocol.h"
-#ifndef MIN
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
-#ifndef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-
-#ifndef offset_of
-#define offset_of(type, memb) \
- ((unsigned long)(&((type *)0)->memb))
-#endif
-#ifndef container_of
-#define container_of(obj, type, memb) \
- ((type *)(((char *)obj) - offset_of(type, memb)))
-#endif
-
static int
p9pdu_writef(struct p9_fcall *pdu, int proto_version, const char *fmt, ...);
@@ -104,7 +89,7 @@ EXPORT_SYMBOL(p9stat_free);
static size_t pdu_read(struct p9_fcall *pdu, void *data, size_t size)
{
- size_t len = MIN(pdu->size - pdu->offset, size);
+ size_t len = min(pdu->size - pdu->offset, size);
memcpy(data, &pdu->sdata[pdu->offset], len);
pdu->offset += len;
return size - len;
@@ -112,7 +97,7 @@ static size_t pdu_read(struct p9_fcall *pdu, void *data, size_t size)
static size_t pdu_write(struct p9_fcall *pdu, const void *data, size_t size)
{
- size_t len = MIN(pdu->capacity - pdu->size, size);
+ size_t len = min(pdu->capacity - pdu->size, size);
memcpy(&pdu->sdata[pdu->size], data, len);
pdu->size += len;
return size - len;
@@ -121,7 +106,7 @@ static size_t pdu_write(struct p9_fcall *pdu, const void *data, size_t size)
static size_t
pdu_write_u(struct p9_fcall *pdu, const char __user *udata, size_t size)
{
- size_t len = MIN(pdu->capacity - pdu->size, size);
+ size_t len = min(pdu->capacity - pdu->size, size);
if (copy_from_user(&pdu->sdata[pdu->size], udata, len))
len = 0;
@@ -201,7 +186,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
if (errcode)
break;
- size = MAX(len, 0);
+ size = max_t(int16_t, len, 0);
*sptr = kmalloc(size + 1, GFP_KERNEL);
if (*sptr == NULL) {
@@ -256,8 +241,8 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
p9pdu_readf(pdu, proto_version, "d", count);
if (!errcode) {
*count =
- MIN(*count,
- pdu->size - pdu->offset);
+ min_t(int32_t, *count,
+ pdu->size - pdu->offset);
*data = &pdu->sdata[pdu->offset];
}
}
@@ -421,7 +406,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
const char *sptr = va_arg(ap, const char *);
int16_t len = 0;
if (sptr)
- len = MIN(strlen(sptr), USHRT_MAX);
+ len = min_t(int16_t, strlen(sptr), USHRT_MAX);
errcode = p9pdu_writef(pdu, proto_version,
"w", len);
--
1.7.3.2.343.g7d43d
^ permalink raw reply related
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: Changli Gao @ 2010-12-05 1:13 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: jamal, netdev
In-Reply-To: <AANLkTimnejoONxGqusiYVWOKbcy2yqbpFH-XyzgG0=87@mail.gmail.com>
On Sun, Dec 5, 2010 at 8:22 AM, Changli Gao <xiaosuo@gmail.com> wrote:
>
> The error case handled currently is the original netdev disappears but
> the corresponding skbs are still in ifb.
>
> I do also think checking the return value of netif_rx() and
> dev_queue_xmit() can fix more 'problems'. :)
>
I have posted the V2 and split the bug fix to a separate one.
BTW: My ultimate goal is making ifb a multi-queue NIC, and the number
of queues is equal to the number of the possible CPUs.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* [PATCH 3/3 v2] ifb: use the lockless variants of skb_queue
From: Changli Gao @ 2010-12-05 1:01 UTC (permalink / raw)
To: jamal; +Cc: netdev, Jarek Poplawski, Changli Gao
rq and tq are both protected by tx queue lock, so we can simply use
the lockless variants of skb_queue.
skb_queue_splice_tail_init() is used instead of the open coded and slow
one.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
drivers/net/ifb.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index d1e362a..9825f11 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -63,9 +63,7 @@ static void ri_tasklet(unsigned long dev)
txq = netdev_get_tx_queue(_dev, 0);
if ((skb = skb_peek(&dp->tq)) == NULL) {
if (__netif_tx_trylock(txq)) {
- while ((skb = skb_dequeue(&dp->rq)) != NULL) {
- skb_queue_tail(&dp->tq, skb);
- }
+ skb_queue_splice_tail_init(&dp->rq, &dp->tq);
__netif_tx_unlock(txq);
} else {
/* reschedule */
@@ -161,7 +159,7 @@ static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
}
- skb_queue_tail(&dp->rq, skb);
+ __skb_queue_tail(&dp->rq, skb);
if (!dp->tasklet_pending) {
dp->tasklet_pending = 1;
tasklet_schedule(&dp->ifb_tasklet);
@@ -176,8 +174,8 @@ static int ifb_close(struct net_device *dev)
tasklet_kill(&dp->ifb_tasklet);
netif_stop_queue(dev);
- skb_queue_purge(&dp->rq);
- skb_queue_purge(&dp->tq);
+ __skb_queue_purge(&dp->rq);
+ __skb_queue_purge(&dp->tq);
return 0;
}
@@ -186,8 +184,8 @@ static int ifb_open(struct net_device *dev)
struct ifb_private *dp = netdev_priv(dev);
tasklet_init(&dp->ifb_tasklet, ri_tasklet, (unsigned long)dev);
- skb_queue_head_init(&dp->rq);
- skb_queue_head_init(&dp->tq);
+ __skb_queue_head_init(&dp->rq);
+ __skb_queue_head_init(&dp->tq);
netif_start_queue(dev);
return 0;
^ permalink raw reply related
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: Changli Gao @ 2010-12-05 0:22 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: jamal, netdev
In-Reply-To: <20101204165609.GB1981@del.dom.local>
On Sun, Dec 5, 2010 at 12:56 AM, Jarek Poplawski <jarkao2@gmail.com> wrote:
>
> I'm simply not convinced this kind of (fast) throttling can properly
> fix any of the problems (what about other flows in the queue), while
> Changli's patch makes this tasklet simpler and a bit faster.
>
The error case handled currently is the original netdev disappears but
the corresponding skbs are still in ifb.
I do also think checking the return value of netif_rx() and
dev_queue_xmit() can fix more 'problems'. :)
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* [PATCH net-2.6] ifb: goto resched directly if error happens and dp->tq isn't empty
From: Changli Gao @ 2010-12-05 0:09 UTC (permalink / raw)
To: David S. Miller; +Cc: Jarek Poplawski, jamal, netdev, Changli Gao
If we break the loop when there are still skbs in tq and no skb in
rq, the skbs will be left in txq until new skbs are enqueued into rq.
In rare cases, no new skb is queued, then these skbs will stay in rq
forever.
After this patch, if tq isn't empty when we break the loop, we goto
resched directly.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
drivers/net/ifb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index ab9f675..fe337bd 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -104,6 +104,8 @@ static void ri_tasklet(unsigned long dev)
rcu_read_unlock();
dev_kfree_skb(skb);
stats->tx_dropped++;
+ if (skb_queue_len(&dp->tq) != 0)
+ goto resched;
break;
}
rcu_read_unlock();
^ permalink raw reply related
* Re: [PATCH 3/5] NET: IPV4: ARP: allow to invalidate specific ARP entries
From: Maxim Levitsky @ 2010-12-04 23:15 UTC (permalink / raw)
To: linux1394-devel
Cc: Stefan Richter, netdev, David S. Miller, Alexey Kuznetsov,
James Morris, Patrick McHardy
In-Reply-To: <1290996593-32416-4-git-send-email-maximlevitsky@gmail.com>
On Mon, 2010-11-29 at 04:09 +0200, Maxim Levitsky wrote:
> IPv4 over firewire needs to be able to remove ARP entries
> from the ARP cache that belong to nodes that are removed, because
> IPv4 over firewire uses ARP packets for private information
> about nodes.
>
> This information becomes invalid as soon as node drops
> off the bus and when it reconnects, its only possible
> to start takling to is after it responded to an ARP packet.
> But ARP cache prevents such packets from being sent.
>
> CC: netdev@vger.kernel.org
> CC: "David S. Miller" <davem@davemloft.net>
> CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> CC: James Morris <jmorris@namei.org>
> CC: Patrick McHardy <kaber@trash.net>
Anybody?
Best regards,
Maxim Levitsky
>
>
> Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
> ---
> include/net/arp.h | 1 +
> net/ipv4/arp.c | 29 ++++++++++++++++++-----------
> 2 files changed, 19 insertions(+), 11 deletions(-)
>
> diff --git a/include/net/arp.h b/include/net/arp.h
> index f4cf6ce..91f0568 100644
> --- a/include/net/arp.h
> +++ b/include/net/arp.h
> @@ -25,5 +25,6 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
> const unsigned char *src_hw,
> const unsigned char *target_hw);
> extern void arp_xmit(struct sk_buff *skb);
> +int arp_invalidate(struct net_device *dev, __be32 ip);
>
> #endif /* _ARP_H */
> diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
> index d8e540c..35b1272 100644
> --- a/net/ipv4/arp.c
> +++ b/net/ipv4/arp.c
> @@ -1142,6 +1142,23 @@ static int arp_req_get(struct arpreq *r, struct net_device *dev)
> return err;
> }
>
> +int arp_invalidate(struct net_device *dev, __be32 ip)
> +{
> + int err = -ENXIO;
> + struct neighbour *neigh = neigh_lookup(&arp_tbl, &ip, dev);
> +
> + if (neigh) {
> + if (neigh->nud_state & ~NUD_NOARP)
> + err = neigh_update(neigh, NULL, NUD_FAILED,
> + NEIGH_UPDATE_F_OVERRIDE|
> + NEIGH_UPDATE_F_ADMIN);
> + neigh_release(neigh);
> + }
> +
> + return err;
> +}
> +EXPORT_SYMBOL(arp_invalidate);
> +
> static int arp_req_delete_public(struct net *net, struct arpreq *r,
> struct net_device *dev)
> {
> @@ -1162,7 +1179,6 @@ static int arp_req_delete(struct net *net, struct arpreq *r,
> {
> int err;
> __be32 ip;
> - struct neighbour *neigh;
>
> if (r->arp_flags & ATF_PUBL)
> return arp_req_delete_public(net, r, dev);
> @@ -1180,16 +1196,7 @@ static int arp_req_delete(struct net *net, struct arpreq *r,
> if (!dev)
> return -EINVAL;
> }
> - err = -ENXIO;
> - neigh = neigh_lookup(&arp_tbl, &ip, dev);
> - if (neigh) {
> - if (neigh->nud_state & ~NUD_NOARP)
> - err = neigh_update(neigh, NULL, NUD_FAILED,
> - NEIGH_UPDATE_F_OVERRIDE|
> - NEIGH_UPDATE_F_ADMIN);
> - neigh_release(neigh);
> - }
> - return err;
> + return arp_invalidate(dev, ip);
> }
>
> /*
^ permalink raw reply
* Re: [PATCH 0/5 V2] Firewire networking assorted fixes
From: Maxim Levitsky @ 2010-12-04 23:14 UTC (permalink / raw)
To: linux1394-devel; +Cc: Stefan Richter, netdev
In-Reply-To: <1290996593-32416-1-git-send-email-maximlevitsky@gmail.com>
On Mon, 2010-11-29 at 04:09 +0200, Maxim Levitsky wrote:
> Hi,
>
> This is updated version of the patches.
> I updated the changelogs, addressed comments on patch #2
>
> Best regards,
> Maxim Levitsky
>
Any update?
Best regards,
Maxim Levitsky
^ permalink raw reply
* Re: [PATCH] tcp: Replace time wait bucket msg by counter.
From: Eric Dumazet @ 2010-12-04 21:52 UTC (permalink / raw)
To: Tom Herbert; +Cc: davem, netdev
In-Reply-To: <alpine.DEB.2.00.1012041331220.6278@pokey.mtv.corp.google.com>
Le samedi 04 décembre 2010 à 13:35 -0800, Tom Herbert a écrit :
> Rather than printing the message to the log, use a mib counter to keep
> track of the count of occurences of time wait bucket overflow. Reduces
> spam in logs.
>
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
>
> diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
> index 43cf901..3052a2b 100644
> --- a/net/ipv4/tcp_minisocks.c
> +++ b/net/ipv4/tcp_minisocks.c
> @@ -347,7 +347,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
> * socket up. We've got bigger problems than
> * non-graceful socket closings.
> */
> - LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow\n");
> + NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW);
> }
>
> tcp_update_metrics(sk);
NET_INC_STATS_BH() should be more appropriate, since we are in a
softirq ?
^ permalink raw reply
* [PATCH] tcp: Replace time wait bucket msg by counter.
From: Tom Herbert @ 2010-12-04 21:35 UTC (permalink / raw)
To: davem, netdev
Rather than printing the message to the log, use a mib counter to keep
track of the count of occurences of time wait bucket overflow. Reduces
spam in logs.
Signed-off-by: Tom Herbert <therbert@google.com>
---
include/linux/snmp.h | 1 +
net/ipv4/proc.c | 1 +
net/ipv4/tcp_minisocks.c | 2 +-
3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index ebb0c80..12b2b18 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -230,6 +230,7 @@ enum
LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */
LINUX_MIB_TCPDEFERACCEPTDROP,
LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */
+ LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */
__LINUX_MIB_MAX
};
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 1b48eb1..b14ec7d 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -253,6 +253,7 @@ static const struct snmp_mib snmp4_net_list[] = {
SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP),
SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP),
SNMP_MIB_ITEM("IPReversePathFilter", LINUX_MIB_IPRPFILTER),
+ SNMP_MIB_ITEM("TCPTimeWaitOverflow", LINUX_MIB_TCPTIMEWAITOVERFLOW),
SNMP_MIB_SENTINEL
};
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 43cf901..3052a2b 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -347,7 +347,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
* socket up. We've got bigger problems than
* non-graceful socket closings.
*/
- LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow\n");
+ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW);
}
tcp_update_metrics(sk);
--
1.7.3.1
^ permalink raw reply related
* Re: kernel panic with time-stamping in phy devices (monitor mode)
From: Andrew Watts @ 2010-12-04 20:46 UTC (permalink / raw)
To: Richard Cochran, Eric Dumazet; +Cc: netdev, David Miller
In-Reply-To: <1291450622.2806.59.camel@edumazet-laptop>
--- On Sat, 12/4/10, Eric Dumazet wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Subject: Re: kernel panic with time-stamping in phy devices (monitor mode)
> To: "Richard Cochran" <richardcochran@gmail.com>
> Cc: "Andrew Watts" <akwatts@ymail.com>, netdev@vger.kernel.org, "David Miller" <davem@davemloft.net>
> Date: Saturday, December 4, 2010, 8:17 AM
> Le samedi 04 décembre 2010 à 08:57
> +0100, Richard Cochran a écrit :
> > Date: Sat, 4 Dec 2010 08:55:04 +0100
> > From: Richard Cochran <richardcochran@gmail.com>
> > To: Eric Dumazet <eric.dumazet@gmail.com>
> > Cc: Andrew Watts <akwatts@ymail.com>,
> netdev@vger.kernel.org,
> > David Miller <davem@davemloft.net>
> > Subject: Re: kernel panic with time-stamping in phy
> devices (monitor mode)
> > Message-ID: <20101204075503.GA3490@riccoc20.at.omicron.at>
> > References: <252997.92320.qm@web111013.mail.gq1.yahoo.com>
> >
> <1291307884.2871.69.camel@edumazet-laptop>
> > MIME-Version: 1.0
> > Content-Type: text/plain; charset=us-ascii
> > Content-Disposition: inline
> > In-Reply-To:
> <1291307884.2871.69.camel@edumazet-laptop>
> > User-Agent: Mutt/1.5.20 (2009-06-14)
> >
> > Ugh, new kernel code with no users is already causing
> trouble!
> >
> > On Thu, Dec 02, 2010 at 05:38:04PM +0100, Eric Dumazet
> wrote:
> > > Thanks for the report
> > >
> > > Please try following patch.
> >
> > And thank you, Eric, for the quick patch.
> >
> > Can this fix go into 2.6.37, please?
>
> Sure, I'll submit to David today, thanks !
>
Eric, I echo the thanks on the lightning patch.
Impressive turnaround!
There's an open bug report on the kernel's bugzilla
for 2.6.36 (#24102). What is the best way to tie these
together?
~ Andy
^ permalink raw reply
* Re: [PATCH 1/2] vsprintf: Add %pMbt, bluetooth mac address
From: Joe Perches @ 2010-12-04 17:48 UTC (permalink / raw)
To: Michał Mirosław
Cc: Marcel Holtmann, Gustavo F. Padovan, linux-kernel, netdev
In-Reply-To: <AANLkTi=qh0GKp3BdKO9GX1qmM3iJ6J_F3fLqZ8qNAw5v@mail.gmail.com>
On Sat, 2010-12-04 at 12:03 +0100, Michał Mirosław wrote:
> 2010/12/4 Joe Perches <joe@perches.com>:
> > Bluetooth output the MAC address in reverse order.
> > Adding %pMbt allows the batostr function to be removed.
> Just a nitpick:
> You could call it %pMR, as in 'Reverse', so it sounds better when/if
> some other subsystem uses it. It would also be a hint of what is this
> doing instead of where it came from.
I considered that but believe %pMbt is clearer as most
likely no other subsystem will be quite so far (out to
lunch? in left field? north? :) enough to do that again.
If any maintainer wants it changed, it's not any sort
of problem to me, say so and I'll resubmit it.
^ permalink raw reply
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: Jarek Poplawski @ 2010-12-04 16:56 UTC (permalink / raw)
To: jamal; +Cc: Changli Gao, netdev
In-Reply-To: <1291478881.2159.70.camel@mojatatu>
On Sat, Dec 04, 2010 at 11:08:01AM -0500, jamal wrote:
> On Sat, 2010-12-04 at 16:40 +0100, Jarek Poplawski wrote:
>
> > Hmm... But we didn't care until now... ;-)
>
> Well, if Changli didnt post - there would be no discussion ;->
> The message was lost in the translation somewhere; events such as
> patches sometimes serve as good reminders.
>
> > Btw. is it really very
> > probable (and worth bothering) that this current error of NULL dev
> > get fixed before we purge this tq queue with deferral one by one?
>
> Indeed - this is working against something buggy. But it has happened
> often in the past. And the likelihood of there being a few bad ones
> in the train of packets when this occurs is high. But there are many
> packets there that wont suffer this sympton - so the only fair scheme is
> to check all. Note: a BUG() seems unreasonable and the deferring serves
> as a throttling scheme.
> What do you have in mind?
I'm simply not convinced this kind of (fast) throttling can properly
fix any of the problems (what about other flows in the queue), while
Changli's patch makes this tasklet simpler and a bit faster.
Cheers,
Jarek P.
^ permalink raw reply
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: jamal @ 2010-12-04 16:08 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: Changli Gao, netdev
In-Reply-To: <20101204154007.GA1981@del.dom.local>
On Sat, 2010-12-04 at 16:40 +0100, Jarek Poplawski wrote:
> Hmm... But we didn't care until now... ;-)
Well, if Changli didnt post - there would be no discussion ;->
The message was lost in the translation somewhere; events such as
patches sometimes serve as good reminders.
> Btw. is it really very
> probable (and worth bothering) that this current error of NULL dev
> get fixed before we purge this tq queue with deferral one by one?
Indeed - this is working against something buggy. But it has happened
often in the past. And the likelihood of there being a few bad ones
in the train of packets when this occurs is high. But there are many
packets there that wont suffer this sympton - so the only fair scheme is
to check all. Note: a BUG() seems unreasonable and the deferring serves
as a throttling scheme.
What do you have in mind?
cheers,
jamal
^ permalink raw reply
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: Jarek Poplawski @ 2010-12-04 15:40 UTC (permalink / raw)
To: jamal; +Cc: Changli Gao, netdev
In-Reply-To: <1291474127.2159.35.camel@mojatatu>
On Sat, Dec 04, 2010 at 09:48:47AM -0500, jamal wrote:
> On Sat, 2010-12-04 at 09:28 -0500, jamal wrote:
>
> > The idea was to defer processing at the first error. Changli
> > is changing it to continue despite the error.
> > The initial goal was to yield whenever possible since we dont maintain
> > a lot of state.
>
> Changli:
> Other points we could defer processing is in case of packets
> being dropped by dev_queue_xmit and netif_rx
Hmm... But we didn't care until now... ;-) Btw. is it really very
probable (and worth bothering) that this current error of NULL dev
get fixed before we purge this tq queue with deferral one by one?
Cheers,
Jarek P.
^ permalink raw reply
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: jamal @ 2010-12-04 15:11 UTC (permalink / raw)
To: Changli Gao; +Cc: netdev
In-Reply-To: <AANLkTi=MFQc4_mYkwiKPzT_NmRRxou18P60ZZo+pYsNp@mail.gmail.com>
On Sat, 2010-12-04 at 23:07 +0800, Changli Gao wrote:
>
> I know what you concern now. Thanks. I'll keep the old behavior in v2.
Ok - thanks Changli.
cheers,
jamal
^ permalink raw reply
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: jamal @ 2010-12-04 15:09 UTC (permalink / raw)
To: Changli Gao; +Cc: Jarek Poplawski, netdev
In-Reply-To: <AANLkTi=VESSzNvq_VwkWVU5b13VwnGs_tJn-4mqB28LV@mail.gmail.com>
On Sat, 2010-12-04 at 23:01 +0800, Changli Gao wrote:
> On Sat, Dec 4, 2010 at 10:55 PM, jamal <hadi@cyberus.ca> wrote:
> > On Sat, 2010-12-04 at 22:45 +0800, Changli Gao wrote:
> >
> >>
> >> If we breaks the loop when there are still skbs in tq and no skb in
> >> rq, the skbs will be left in txq until new skbs are enqueued into rq.
> >> In rare cases, no new skb is queued, then these skbs will stay in rq
> >> forever.
> >
> > So should we goto resched?
> >
>
> Only if we can't lock the txq or rq isn't empty, we goto resched. So
> it is a bug.
And to be explicit: Yes, meant to say there is a bug if we break out
in the scenario you described above - the fix is to jump to resched.
Why do we need the lock?
cheers,
jamal
^ permalink raw reply
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: Changli Gao @ 2010-12-04 15:07 UTC (permalink / raw)
To: hadi; +Cc: netdev
In-Reply-To: <1291474793.2159.43.camel@mojatatu>
On Sat, Dec 4, 2010 at 10:59 PM, jamal <hadi@cyberus.ca> wrote:
> On Sat, 2010-12-04 at 22:50 +0800, Changli Gao wrote:
>
>> Maybe you misread my patch. tq is a stack variable in ri_tasklet, and
>> initialized all the time. ri_tasklet() won't exits until tq is
>> empty().
>
> in your patch is a variable on the stack.
> What i am saying is you should defer processing when there is an
> error (note the two other spots i mentioned).
> This means you may leave dp->tq non-empty and therefore it
> needs to be saved somewhere as it is before your patch.
>
I know what you concern now. Thanks. I'll keep the old behavior in v2.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: Changli Gao @ 2010-12-04 15:01 UTC (permalink / raw)
To: hadi; +Cc: Jarek Poplawski, netdev
In-Reply-To: <1291474504.2159.39.camel@mojatatu>
On Sat, Dec 4, 2010 at 10:55 PM, jamal <hadi@cyberus.ca> wrote:
> On Sat, 2010-12-04 at 22:45 +0800, Changli Gao wrote:
>
>>
>> If we breaks the loop when there are still skbs in tq and no skb in
>> rq, the skbs will be left in txq until new skbs are enqueued into rq.
>> In rare cases, no new skb is queued, then these skbs will stay in rq
>> forever.
>
> So should we goto resched?
>
Only if we can't lock the txq or rq isn't empty, we goto resched. So
it is a bug.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: jamal @ 2010-12-04 14:59 UTC (permalink / raw)
To: Changli Gao; +Cc: netdev
In-Reply-To: <AANLkTikeECFUf0xiug7G+nd5=Sw7p=4Msz6RQ2gdOBzs@mail.gmail.com>
On Sat, 2010-12-04 at 22:50 +0800, Changli Gao wrote:
> Maybe you misread my patch. tq is a stack variable in ri_tasklet, and
> initialized all the time. ri_tasklet() won't exits until tq is
> empty().
in your patch is a variable on the stack.
What i am saying is you should defer processing when there is an
error (note the two other spots i mentioned).
This means you may leave dp->tq non-empty and therefore it
needs to be saved somewhere as it is before your patch.
cheers,
jamal
^ permalink raw reply
* Re: [PATCH 3/3] ifb: move tq from ifb_private
From: jamal @ 2010-12-04 14:55 UTC (permalink / raw)
To: Changli Gao; +Cc: Jarek Poplawski, netdev
In-Reply-To: <AANLkTimy_dK0uDCWqo3AZBKSvod+KnE6Om-CxrbFmPj+@mail.gmail.com>
On Sat, 2010-12-04 at 22:45 +0800, Changli Gao wrote:
>
> If we breaks the loop when there are still skbs in tq and no skb in
> rq, the skbs will be left in txq until new skbs are enqueued into rq.
> In rare cases, no new skb is queued, then these skbs will stay in rq
> forever.
So should we goto resched?
cheers,
jamal
^ 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