* Re: [PATCH] vlan: cleanup the usage of *vlan in vlan_dev_hard_header
From: David Miller @ 2013-08-02 0:12 UTC (permalink / raw)
To: shhuiw; +Cc: kaber, netdev
In-Reply-To: <51FAF636.1090802@gmail.com>
From: Wang Sheng-Hui <shhuiw@gmail.com>
Date: Fri, 02 Aug 2013 07:58:46 +0800
> On 2013年08月02日 04:12, David Miller wrote:
>> From: Wang Sheng-Hui <shhuiw@gmail.com>
>> Date: Thu, 01 Aug 2013 14:10:23 +0800
>>
>>> We can use vlan directly after we get the pointer at the beginning
>>> *vlan = vlan_dev_priv(dev)
>>> and do not use vlan_dev_priv(dev) to access its fields afterwards.
>>>
>>> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
>>
>> This patch was corrupted by your email client.
>>
>
> Sorry. Please recheck the patch below.
Please make a fresh patch posting, don't use a reply to this thread.
Thank you.
^ permalink raw reply
* Re: [PATCH] vlan: cleanup the usage of *vlan in vlan_dev_hard_header
From: Wang Sheng-Hui @ 2013-08-01 23:58 UTC (permalink / raw)
To: David Miller; +Cc: kaber, netdev
In-Reply-To: <20130801.131230.25199405118866430.davem@davemloft.net>
On 2013年08月02日 04:12, David Miller wrote:
> From: Wang Sheng-Hui <shhuiw@gmail.com>
> Date: Thu, 01 Aug 2013 14:10:23 +0800
>
>> We can use vlan directly after we get the pointer at the beginning
>> *vlan = vlan_dev_priv(dev)
>> and do not use vlan_dev_priv(dev) to access its fields afterwards.
>>
>> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
>
> This patch was corrupted by your email client.
>
Sorry. Please recheck the patch below.
> Please read Documentation/email-clients.txt to learn how to
> fix this, send a test patch to yourself, and only when you
> can successfully apply the patch you receive in that test email
> should you repost your patch again here.
>
> Thanks.
We can use vlan directly after we get the pointer at the beginning
*vlan = vlan_dev_priv(dev)
and do not use vlan_dev_priv(dev) to access its fields afterwords.
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
net/8021q/vlan_dev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 1cd3d2a..9ab8a7e 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -107,10 +107,10 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
u16 vlan_tci = 0;
int rc;
- if (!(vlan_dev_priv(dev)->flags & VLAN_FLAG_REORDER_HDR)) {
+ if (!(vlan->flags & VLAN_FLAG_REORDER_HDR)) {
vhdr = (struct vlan_hdr *) skb_push(skb, VLAN_HLEN);
- vlan_tci = vlan_dev_priv(dev)->vlan_id;
+ vlan_tci = vlan->vlan_id;
vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb);
vhdr->h_vlan_TCI = htons(vlan_tci);
@@ -133,7 +133,7 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
saddr = dev->dev_addr;
/* Now make the underlying real hard header */
- dev = vlan_dev_priv(dev)->real_dev;
+ dev = vlan->real_dev;
rc = dev_hard_header(skb, dev, type, daddr, saddr, len + vhdrlen);
if (rc > 0)
rc += vhdrlen;
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH net-next v3 0/5] bonding: groundwork and initial conversion to RCU
From: David Miller @ 2013-08-01 23:48 UTC (permalink / raw)
To: nikolay; +Cc: netdev, andy, fubar
In-Reply-To: <1375368891-9979-1-git-send-email-nikolay@redhat.com>
From: Nikolay Aleksandrov <nikolay@redhat.com>
Date: Thu, 1 Aug 2013 16:54:46 +0200
> This patchset aims to lay the groundwork, and do the initial conversion to
> RCUism.
Series applied, nice work.
^ permalink raw reply
* Re: [PATCH net-next] ipv6: bump genid when delete/add address
From: David Miller @ 2013-08-01 23:34 UTC (permalink / raw)
To: fan.du; +Cc: yoshfuji, jmorris, hannes, vyasevich, netdev
In-Reply-To: <1375350284-32725-1-git-send-email-fan.du@windriver.com>
From: Fan Du <fan.du@windriver.com>
Date: Thu, 1 Aug 2013 17:44:44 +0800
> Server Client
> 2001:1::803/64 <-> 2001:1::805/64
> 2001:2::804/64 <-> 2001:2::806/64
>
> Server side fib binary tree looks like this:
>
> (2001:/64)
> /
> /
> ffff88002103c380
> / \
> (2) / \
> (2001::803/128) ffff880037ac07c0
> / \
> / \ (3)
> ffff880037ac0640 (2001::806/128)
> / \
> (1) / \
> (2001::804/128) (2001::805/128)
>
> Delete 2001::804/64 won't cause prefix route deleted as well as rt in (3)
> destinate to 2001::806 with source address as 2001::804/64. That's because
> 2001::803/64 is still alive, which make onlink=1 in ipv6_del_addr, this is
> where the substantial difference between same prefix configuration and
> different prefix configuration :) So packet are still transmitted out to
> 2001::806 with source address as 2001::804/64.
>
> So bump genid will clear rt in (3), and up layer protocol will eventually
> find the right one for themselves.
>
> This problem arised from the discussion in here:
> http://marc.info/?l=linux-netdev&m=137404469219410&w=4
>
> Signed-off-by: Fan Du <fan.du@windriver.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH V3 3/3] ethernet: Convert mac address uses of 6 to ETH_ALEN
From: Olof Johansson @ 2013-08-01 23:30 UTC (permalink / raw)
To: Joe Perches
Cc: Network Development, Don Fry, Grant Grundler, Sam Creasey,
Andrew Gallatin, Wan ZongShun, Manish Chopra, Sony Chacko,
Rajesh Borundia, Shahed Shaikh, Jitendra Kalsaria, Ron Mercer,
linux-driver, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <9ab1185f349544b160632bfec566391928fa0768.1375398692.git.joe@perches.com>
On Thu, Aug 1, 2013 at 4:17 PM, Joe Perches <joe@perches.com> wrote:
> Use the normal #define to help grep find mac addresses
> and ensure that addresses are aligned.
>
> pasemi.h has an unaligned access to mac_addr, unchanged
> for now.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Olof Johansson <olof@lixom.net> # pasemi_mac pieces
-Olof
^ permalink raw reply
* [PATCH V3 3/3] ethernet: Convert mac address uses of 6 to ETH_ALEN
From: Joe Perches @ 2013-08-01 23:17 UTC (permalink / raw)
To: netdev
Cc: Don Fry, Grant Grundler, Sam Creasey, Andrew Gallatin,
Wan ZongShun, Olof Johansson, Manish Chopra, Sony Chacko,
Rajesh Borundia, Shahed Shaikh, Jitendra Kalsaria, Ron Mercer,
linux-driver, linux-kernel, linux-arm-kernel
In-Reply-To: <cover.1375398692.git.joe@perches.com>
Use the normal #define to help grep find mac addresses
and ensure that addresses are aligned.
pasemi.h has an unaligned access to mac_addr, unchanged
for now.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ethernet/8390/ax88796.c | 4 ++--
drivers/net/ethernet/amd/pcnet32.c | 6 +++---
drivers/net/ethernet/broadcom/cnic_if.h | 6 +++---
drivers/net/ethernet/dec/tulip/tulip_core.c | 8 +++++---
drivers/net/ethernet/i825xx/sun3_82586.h | 4 ++--
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +-
drivers/net/ethernet/nuvoton/w90p910_ether.c | 4 ++--
drivers/net/ethernet/pasemi/pasemi_mac.c | 13 +++++++------
drivers/net/ethernet/pasemi/pasemi_mac.h | 2 +-
drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 4 ++--
drivers/net/ethernet/qlogic/qlge/qlge.h | 2 +-
11 files changed, 29 insertions(+), 26 deletions(-)
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
index e1d2643..b7232a9 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -707,7 +707,7 @@ static int ax_init_dev(struct net_device *dev)
#ifdef CONFIG_AX88796_93CX6
if (ax->plat->flags & AXFLG_HAS_93CX6) {
- unsigned char mac_addr[6];
+ unsigned char mac_addr[ETH_ALEN];
struct eeprom_93cx6 eeprom;
eeprom.data = ei_local;
@@ -719,7 +719,7 @@ static int ax_init_dev(struct net_device *dev)
(__le16 __force *)mac_addr,
sizeof(mac_addr) >> 1);
- memcpy(dev->dev_addr, mac_addr, 6);
+ memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
}
#endif
if (ax->plat->wordlength == 2) {
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index ed21307..2d8e288 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -1521,7 +1521,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
char *chipname;
struct net_device *dev;
const struct pcnet32_access *a = NULL;
- u8 promaddr[6];
+ u8 promaddr[ETH_ALEN];
int ret = -ENODEV;
/* reset the chip */
@@ -1665,10 +1665,10 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
}
/* read PROM address and compare with CSR address */
- for (i = 0; i < 6; i++)
+ for (i = 0; i < ETH_ALEN; i++)
promaddr[i] = inb(ioaddr + i);
- if (memcmp(promaddr, dev->dev_addr, 6) ||
+ if (memcmp(promaddr, dev->dev_addr, ETH_ALEN) ||
!is_valid_ether_addr(dev->dev_addr)) {
if (is_valid_ether_addr(promaddr)) {
if (pcnet32_debug & NETIF_MSG_PROBE) {
diff --git a/drivers/net/ethernet/broadcom/cnic_if.h b/drivers/net/ethernet/broadcom/cnic_if.h
index 82a0312..95aff76 100644
--- a/drivers/net/ethernet/broadcom/cnic_if.h
+++ b/drivers/net/ethernet/broadcom/cnic_if.h
@@ -238,8 +238,8 @@ struct cnic_sock {
u16 src_port;
u16 dst_port;
u16 vlan_id;
- unsigned char old_ha[6];
- unsigned char ha[6];
+ unsigned char old_ha[ETH_ALEN];
+ unsigned char ha[ETH_ALEN];
u32 mtu;
u32 cid;
u32 l5_cid;
@@ -308,7 +308,7 @@ struct cnic_dev {
#define CNIC_F_BNX2_CLASS 3
#define CNIC_F_BNX2X_CLASS 4
atomic_t ref_count;
- u8 mac_addr[6];
+ u8 mac_addr[ETH_ALEN];
int max_iscsi_conn;
int max_fcoe_conn;
diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c
index c94152f..4e8cfa2 100644
--- a/drivers/net/ethernet/dec/tulip/tulip_core.c
+++ b/drivers/net/ethernet/dec/tulip/tulip_core.c
@@ -1304,7 +1304,9 @@ static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct tulip_private *tp;
/* See note below on the multiport cards. */
- static unsigned char last_phys_addr[6] = {0x00, 'L', 'i', 'n', 'u', 'x'};
+ static unsigned char last_phys_addr[ETH_ALEN] = {
+ 0x00, 'L', 'i', 'n', 'u', 'x'
+ };
static int last_irq;
static int multiport_cnt; /* For four-port boards w/one EEPROM */
int i, irq;
@@ -1627,8 +1629,8 @@ static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->dev_addr[i] = last_phys_addr[i] + 1;
#if defined(CONFIG_SPARC)
addr = of_get_property(dp, "local-mac-address", &len);
- if (addr && len == 6)
- memcpy(dev->dev_addr, addr, 6);
+ if (addr && len == ETH_ALEN)
+ memcpy(dev->dev_addr, addr, ETH_ALEN);
#endif
#if defined(__i386__) || defined(__x86_64__) /* Patch up x86 BIOS bug. */
if (last_irq)
diff --git a/drivers/net/ethernet/i825xx/sun3_82586.h b/drivers/net/ethernet/i825xx/sun3_82586.h
index 93346f0..79aef68 100644
--- a/drivers/net/ethernet/i825xx/sun3_82586.h
+++ b/drivers/net/ethernet/i825xx/sun3_82586.h
@@ -133,8 +133,8 @@ struct rfd_struct
unsigned char last; /* Bit15,Last Frame on List / Bit14,suspend */
unsigned short next; /* linkoffset to next RFD */
unsigned short rbd_offset; /* pointeroffset to RBD-buffer */
- unsigned char dest[6]; /* ethernet-address, destination */
- unsigned char source[6]; /* ethernet-address, source */
+ unsigned char dest[ETH_ALEN]; /* ethernet-address, destination */
+ unsigned char source[ETH_ALEN]; /* ethernet-address, source */
unsigned short length; /* 802.3 frame-length */
unsigned short zero_dummy; /* dummy */
};
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 967bae8..d4cdf4d 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -244,7 +244,7 @@ struct myri10ge_priv {
int fw_ver_minor;
int fw_ver_tiny;
int adopted_rx_filter_bug;
- u8 mac_addr[6]; /* eeprom mac address */
+ u8 mac_addr[ETH_ALEN]; /* eeprom mac address */
unsigned long serial_number;
int vendor_specific_offset;
int fw_multicast_support;
diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c
index e88bdb1..dcfe58f 100644
--- a/drivers/net/ethernet/nuvoton/w90p910_ether.c
+++ b/drivers/net/ethernet/nuvoton/w90p910_ether.c
@@ -922,7 +922,7 @@ static void __init get_mac_address(struct net_device *dev)
{
struct w90p910_ether *ether = netdev_priv(dev);
struct platform_device *pdev;
- char addr[6];
+ char addr[ETH_ALEN];
pdev = ether->pdev;
@@ -934,7 +934,7 @@ static void __init get_mac_address(struct net_device *dev)
addr[5] = 0xa8;
if (is_valid_ether_addr(addr))
- memcpy(dev->dev_addr, &addr, 0x06);
+ memcpy(dev->dev_addr, &addr, ETH_ALEN);
else
dev_err(&pdev->dev, "invalid mac address\n");
}
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c
index a5f0b5d..f21ae7b 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
@@ -191,7 +191,7 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
struct device_node *dn = pci_device_to_OF_node(pdev);
int len;
const u8 *maddr;
- u8 addr[6];
+ u8 addr[ETH_ALEN];
if (!dn) {
dev_dbg(&pdev->dev,
@@ -201,8 +201,8 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
maddr = of_get_property(dn, "local-mac-address", &len);
- if (maddr && len == 6) {
- memcpy(mac->mac_addr, maddr, 6);
+ if (maddr && len == ETH_ALEN) {
+ memcpy(mac->mac_addr, maddr, ETH_ALEN);
return 0;
}
@@ -219,14 +219,15 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
return -ENOENT;
}
- if (sscanf(maddr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &addr[0],
- &addr[1], &addr[2], &addr[3], &addr[4], &addr[5]) != 6) {
+ if (sscanf(maddr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
+ &addr[0], &addr[1], &addr[2], &addr[3], &addr[4], &addr[5])
+ != ETH_ALEN) {
dev_warn(&pdev->dev,
"can't parse mac address, not configuring\n");
return -EINVAL;
}
- memcpy(mac->mac_addr, addr, 6);
+ memcpy(mac->mac_addr, addr, ETH_ALEN);
return 0;
}
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.h b/drivers/net/ethernet/pasemi/pasemi_mac.h
index e2f4efa..f2749d4 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.h
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.h
@@ -83,7 +83,7 @@ struct pasemi_mac {
#define MAC_TYPE_GMAC 1
#define MAC_TYPE_XAUI 2
- u8 mac_addr[6];
+ u8 mac_addr[ETH_ALEN];
struct net_lro_mgr lro_mgr;
struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS];
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
index 9fbb1cd..8375cbd 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
@@ -536,10 +536,10 @@ static void netxen_p2_nic_set_multi(struct net_device *netdev)
{
struct netxen_adapter *adapter = netdev_priv(netdev);
struct netdev_hw_addr *ha;
- u8 null_addr[6];
+ u8 null_addr[ETH_ALEN];
int i;
- memset(null_addr, 0, 6);
+ memset(null_addr, 0, ETH_ALEN);
if (netdev->flags & IFF_PROMISC) {
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge.h b/drivers/net/ethernet/qlogic/qlge/qlge.h
index 7e8d682..8994337 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge.h
+++ b/drivers/net/ethernet/qlogic/qlge/qlge.h
@@ -2149,7 +2149,7 @@ struct ql_adapter {
struct timer_list timer;
atomic_t lb_count;
/* Keep local copy of current mac address. */
- char current_mac_addr[6];
+ char current_mac_addr[ETH_ALEN];
};
/*
--
1.8.1.2.459.gbcd45b4.dirty
^ permalink raw reply related
* Re: locating the 'tc actions' hook
From: John Fastabend @ 2013-08-01 23:18 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: John Fastabend, Stephen Hemminger, Eric Dumazet, Tom Herbert,
netdev
In-Reply-To: <51FA493C.8080207@mojatatu.com>
[...]
>> Am I missing something obvious here? Is there a way to link them to
>> filters? Sorry if it turns out to be a stupid question.
>>
>
> I think the second use case is what you are bumping into. I know from
> answering questions this is a very popular use case in some eastern
> European countries (where one policer with a specific rate is shared
> by many flows); i think they have a setup where you share your DSL
> connection with your neighbors. Its quiet a clever setup.
>
Great thanks I was missing part (b) above. Now I see how the index
works.
>
>> My motivation here is to use the filters/actions outside the qdisc lock
>> for mq, mqprio, and the ingress qdisc.
>>
>
> Are you trying to offload these actions into hardware?
> Is the classifier in hardware?
> Please let me know if you need further help. Example, I could send you
> a bunch of examples for either
>
I have two things in mind for this.
The first being directly related to the previous per queue rate limiter
patch. With rate limiters per queue on a multiqueue device using mq or
mqprio I need some mechanism to steer packets to queues. One way to do
this is to use mqprio and create a 'tc' with a single queue in it.
And then use iptables or netprio_cgroup to steer packets. Another way
to do this would be to use 'skbedit queue_mapping' to set the queue from
'tc' but unfortunately with the existing flows the queue has already
been selected by the time the classifiers are called. Calling into the
classifier chain before picking the qdisc would fix this. For flow based
QOS with multiqueue devices this type of functionality would be useful.
The second thought that I've been piecing together would be to populate
the rxhash (or maybe some other field) using the hardware flow
classifier in some meaningful way for the ingress qdisc. Some of the
existing Intel NICs can do this and I believe other vendors have similar
capabilities. Although currently with the qdisc lock running around the
ingress qdisc the multiqueue devices take a perf hit just by
instantiating the ingress qdisc which really is only using the lock to
guard some stats and keep the classifier/action chains sane.
If you have some good examples it would be great to see them and drop
them in my testbed. Go ahead and send them to me offlist if you can.
.John
> cheers,
> jamal
>
>
>> .John
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH V3 2/3] include: Convert ethernet mac address declarations to use ETH_ALEN
From: Joe Perches @ 2013-08-01 23:17 UTC (permalink / raw)
To: netdev
Cc: Pantelis Antoniou, Vitaly Bordug, Steve Glendinning,
Mauro Carvalho Chehab, Samuel Ortiz, David S. Miller,
linux-kernel, linuxppc-dev, linux-usb, linux-media
In-Reply-To: <cover.1375398692.git.joe@perches.com>
It's convenient to have ethernet mac addresses use
ETH_ALEN to be able to grep for them a bit easier and
also to ensure that the addresses are __aligned(2).
Add #include <linux/if_ether.h> as necessary.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
include/linux/dm9000.h | 4 ++-
include/linux/fs_enet_pd.h | 3 ++-
include/linux/ieee80211.h | 59 +++++++++++++++++++++--------------------
include/linux/mlx4/device.h | 11 ++++----
include/linux/mlx4/qp.h | 5 ++--
include/linux/mv643xx_eth.h | 3 ++-
include/linux/sh_eth.h | 3 ++-
include/linux/smsc911x.h | 3 ++-
include/linux/uwb/spec.h | 5 ++--
include/media/tveeprom.h | 4 ++-
include/net/irda/irlan_common.h | 3 ++-
11 files changed, 58 insertions(+), 45 deletions(-)
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index 96e8769..841925f 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -14,6 +14,8 @@
#ifndef __DM9000_PLATFORM_DATA
#define __DM9000_PLATFORM_DATA __FILE__
+#include <linux/if_ether.h>
+
/* IO control flags */
#define DM9000_PLATF_8BITONLY (0x0001)
@@ -27,7 +29,7 @@
struct dm9000_plat_data {
unsigned int flags;
- unsigned char dev_addr[6];
+ unsigned char dev_addr[ETH_ALEN];
/* allow replacement IO routines */
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index 51b7934..343d82a 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -18,6 +18,7 @@
#include <linux/string.h>
#include <linux/of_mdio.h>
+#include <linux/if_ether.h>
#include <asm/types.h>
#define FS_ENET_NAME "fs_enet"
@@ -135,7 +136,7 @@ struct fs_platform_info {
const struct fs_mii_bus_info *bus_info;
int rx_ring, tx_ring; /* number of buffers on rx */
- __u8 macaddr[6]; /* mac address */
+ __u8 macaddr[ETH_ALEN]; /* mac address */
int rx_copybreak; /* limit we copy small frames */
int use_napi; /* use NAPI */
int napi_weight; /* NAPI weight */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index b0dc87a..4e101af 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -16,6 +16,7 @@
#define LINUX_IEEE80211_H
#include <linux/types.h>
+#include <linux/if_ether.h>
#include <asm/byteorder.h>
/*
@@ -209,28 +210,28 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
struct ieee80211_hdr {
__le16 frame_control;
__le16 duration_id;
- u8 addr1[6];
- u8 addr2[6];
- u8 addr3[6];
+ u8 addr1[ETH_ALEN];
+ u8 addr2[ETH_ALEN];
+ u8 addr3[ETH_ALEN];
__le16 seq_ctrl;
- u8 addr4[6];
+ u8 addr4[ETH_ALEN];
} __packed __aligned(2);
struct ieee80211_hdr_3addr {
__le16 frame_control;
__le16 duration_id;
- u8 addr1[6];
- u8 addr2[6];
- u8 addr3[6];
+ u8 addr1[ETH_ALEN];
+ u8 addr2[ETH_ALEN];
+ u8 addr3[ETH_ALEN];
__le16 seq_ctrl;
} __packed __aligned(2);
struct ieee80211_qos_hdr {
__le16 frame_control;
__le16 duration_id;
- u8 addr1[6];
- u8 addr2[6];
- u8 addr3[6];
+ u8 addr1[ETH_ALEN];
+ u8 addr2[ETH_ALEN];
+ u8 addr3[ETH_ALEN];
__le16 seq_ctrl;
__le16 qos_ctrl;
} __packed __aligned(2);
@@ -608,8 +609,8 @@ struct ieee80211s_hdr {
u8 flags;
u8 ttl;
__le32 seqnum;
- u8 eaddr1[6];
- u8 eaddr2[6];
+ u8 eaddr1[ETH_ALEN];
+ u8 eaddr2[ETH_ALEN];
} __packed __aligned(2);
/* Mesh flags */
@@ -758,7 +759,7 @@ struct ieee80211_rann_ie {
u8 rann_flags;
u8 rann_hopcount;
u8 rann_ttl;
- u8 rann_addr[6];
+ u8 rann_addr[ETH_ALEN];
__le32 rann_seq;
__le32 rann_interval;
__le32 rann_metric;
@@ -802,9 +803,9 @@ enum ieee80211_vht_opmode_bits {
struct ieee80211_mgmt {
__le16 frame_control;
__le16 duration;
- u8 da[6];
- u8 sa[6];
- u8 bssid[6];
+ u8 da[ETH_ALEN];
+ u8 sa[ETH_ALEN];
+ u8 bssid[ETH_ALEN];
__le16 seq_ctrl;
union {
struct {
@@ -833,7 +834,7 @@ struct ieee80211_mgmt {
struct {
__le16 capab_info;
__le16 listen_interval;
- u8 current_ap[6];
+ u8 current_ap[ETH_ALEN];
/* followed by SSID and Supported rates */
u8 variable[0];
} __packed reassoc_req;
@@ -966,21 +967,21 @@ struct ieee80211_vendor_ie {
struct ieee80211_rts {
__le16 frame_control;
__le16 duration;
- u8 ra[6];
- u8 ta[6];
+ u8 ra[ETH_ALEN];
+ u8 ta[ETH_ALEN];
} __packed __aligned(2);
struct ieee80211_cts {
__le16 frame_control;
__le16 duration;
- u8 ra[6];
+ u8 ra[ETH_ALEN];
} __packed __aligned(2);
struct ieee80211_pspoll {
__le16 frame_control;
__le16 aid;
- u8 bssid[6];
- u8 ta[6];
+ u8 bssid[ETH_ALEN];
+ u8 ta[ETH_ALEN];
} __packed __aligned(2);
/* TDLS */
@@ -989,14 +990,14 @@ struct ieee80211_pspoll {
struct ieee80211_tdls_lnkie {
u8 ie_type; /* Link Identifier IE */
u8 ie_len;
- u8 bssid[6];
- u8 init_sta[6];
- u8 resp_sta[6];
+ u8 bssid[ETH_ALEN];
+ u8 init_sta[ETH_ALEN];
+ u8 resp_sta[ETH_ALEN];
} __packed;
struct ieee80211_tdls_data {
- u8 da[6];
- u8 sa[6];
+ u8 da[ETH_ALEN];
+ u8 sa[ETH_ALEN];
__be16 ether_type;
u8 payload_type;
u8 category;
@@ -1090,8 +1091,8 @@ struct ieee80211_p2p_noa_attr {
struct ieee80211_bar {
__le16 frame_control;
__le16 duration;
- __u8 ra[6];
- __u8 ta[6];
+ __u8 ra[ETH_ALEN];
+ __u8 ta[ETH_ALEN];
__le16 control;
__le16 start_seq_num;
} __packed;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 6aebdfe..09ef2f4 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -33,6 +33,7 @@
#ifndef MLX4_DEVICE_H
#define MLX4_DEVICE_H
+#include <linux/if_ether.h>
#include <linux/pci.h>
#include <linux/completion.h>
#include <linux/radix-tree.h>
@@ -620,7 +621,7 @@ struct mlx4_eth_av {
u8 dgid[16];
u32 reserved4[2];
__be16 vlan;
- u8 mac[6];
+ u8 mac[ETH_ALEN];
};
union mlx4_ext_av {
@@ -914,10 +915,10 @@ enum mlx4_net_trans_promisc_mode {
};
struct mlx4_spec_eth {
- u8 dst_mac[6];
- u8 dst_mac_msk[6];
- u8 src_mac[6];
- u8 src_mac_msk[6];
+ u8 dst_mac[ETH_ALEN];
+ u8 dst_mac_msk[ETH_ALEN];
+ u8 src_mac[ETH_ALEN];
+ u8 src_mac_msk[ETH_ALEN];
u8 ether_type_enable;
__be16 ether_type;
__be16 vlan_id_msk;
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 262deac..6d35147 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -34,6 +34,7 @@
#define MLX4_QP_H
#include <linux/types.h>
+#include <linux/if_ether.h>
#include <linux/mlx4/device.h>
@@ -143,7 +144,7 @@ struct mlx4_qp_path {
u8 feup;
u8 fvl_rx;
u8 reserved4[2];
- u8 dmac[6];
+ u8 dmac[ETH_ALEN];
};
enum { /* fl */
@@ -318,7 +319,7 @@ struct mlx4_wqe_datagram_seg {
__be32 dqpn;
__be32 qkey;
__be16 vlan;
- u8 mac[6];
+ u8 mac[ETH_ALEN];
};
struct mlx4_wqe_lso_seg {
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 6e8215b..61a0da3 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -6,6 +6,7 @@
#define __LINUX_MV643XX_ETH_H
#include <linux/mbus.h>
+#include <linux/if_ether.h>
#define MV643XX_ETH_SHARED_NAME "mv643xx_eth"
#define MV643XX_ETH_NAME "mv643xx_eth_port"
@@ -48,7 +49,7 @@ struct mv643xx_eth_platform_data {
* Use this MAC address if it is valid, overriding the
* address that is already in the hardware.
*/
- u8 mac_addr[6];
+ u8 mac_addr[ETH_ALEN];
/*
* If speed is 0, autonegotiation is enabled.
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index fc30571..6205eeb 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -2,6 +2,7 @@
#define __ASM_SH_ETH_H__
#include <linux/phy.h>
+#include <linux/if_ether.h>
enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
enum {
@@ -18,7 +19,7 @@ struct sh_eth_plat_data {
phy_interface_t phy_interface;
void (*set_mdio_gate)(void *addr);
- unsigned char mac_addr[6];
+ unsigned char mac_addr[ETH_ALEN];
unsigned no_ether_link:1;
unsigned ether_link_active_low:1;
unsigned needs_init:1;
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h
index 4dde70e..eec3efd 100644
--- a/include/linux/smsc911x.h
+++ b/include/linux/smsc911x.h
@@ -22,6 +22,7 @@
#define __LINUX_SMSC911X_H__
#include <linux/phy.h>
+#include <linux/if_ether.h>
/* platform_device configuration data, should be assigned to
* the platform_device's dev.platform_data */
@@ -31,7 +32,7 @@ struct smsc911x_platform_config {
unsigned int flags;
unsigned int shift;
phy_interface_t phy_interface;
- unsigned char mac[6];
+ unsigned char mac[ETH_ALEN];
};
/* Constants for platform_device irq polarity configuration */
diff --git a/include/linux/uwb/spec.h b/include/linux/uwb/spec.h
index b52e44f..0df24bf 100644
--- a/include/linux/uwb/spec.h
+++ b/include/linux/uwb/spec.h
@@ -32,6 +32,7 @@
#include <linux/types.h>
#include <linux/bitmap.h>
+#include <linux/if_ether.h>
#define i1480_FW 0x00000303
/* #define i1480_FW 0x00000302 */
@@ -130,7 +131,7 @@ enum { UWB_DRP_BACKOFF_WIN_MAX = 16 };
* it is also used to define headers sent down and up the wire/radio).
*/
struct uwb_mac_addr {
- u8 data[6];
+ u8 data[ETH_ALEN];
} __attribute__((packed));
@@ -568,7 +569,7 @@ struct uwb_rc_evt_confirm {
/* Device Address Management event. [WHCI] section 3.1.3.2. */
struct uwb_rc_evt_dev_addr_mgmt {
struct uwb_rceb rceb;
- u8 baAddr[6];
+ u8 baAddr[ETH_ALEN];
u8 bResultCode;
} __attribute__((packed));
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h
index 4a1191a..f7119ee 100644
--- a/include/media/tveeprom.h
+++ b/include/media/tveeprom.h
@@ -12,6 +12,8 @@ enum tveeprom_audio_processor {
TVEEPROM_AUDPROC_OTHER,
};
+#include <linux/if_ether.h>
+
struct tveeprom {
u32 has_radio;
/* If has_ir == 0, then it is unknown what the IR capabilities are,
@@ -40,7 +42,7 @@ struct tveeprom {
u32 revision;
u32 serial_number;
char rev_str[5];
- u8 MAC_address[6];
+ u8 MAC_address[ETH_ALEN];
};
void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 0af8b8d..550c2d6 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -32,6 +32,7 @@
#include <linux/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
+#include <linux/if_ether.h>
#include <net/irda/irttp.h>
@@ -161,7 +162,7 @@ struct irlan_provider_cb {
int access_type; /* Access type */
__u16 send_arb_val;
- __u8 mac_address[6]; /* Generated MAC address for peer device */
+ __u8 mac_address[ETH_ALEN]; /* Generated MAC address for peer device */
};
/*
--
1.8.1.2.459.gbcd45b4.dirty
^ permalink raw reply related
* [PATCH V3 1/3] uapi: Convert some uses of 6 to ETH_ALEN
From: Joe Perches @ 2013-08-01 23:17 UTC (permalink / raw)
To: netdev
Cc: wimax, Michael S. Tsirkin, linux-kernel, Inaky Perez-Gonzalez,
linux-wimax, Bart De Schuymer, netfilter-devel, virtualization
In-Reply-To: <cover.1375398692.git.joe@perches.com>
Use the #define where appropriate.
Add #include <linux/if_ether.h>
where appropriate too.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/uapi/linux/dn.h | 3 ++-
include/uapi/linux/if_bridge.h | 3 ++-
include/uapi/linux/netfilter_bridge/ebt_802_3.h | 5 +++--
include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h | 3 ++-
include/uapi/linux/virtio_net.h | 2 +-
include/uapi/linux/wimax/i2400m.h | 4 ++--
6 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/dn.h b/include/uapi/linux/dn.h
index 9c50445..5fbdd3d 100644
--- a/include/uapi/linux/dn.h
+++ b/include/uapi/linux/dn.h
@@ -2,6 +2,7 @@
#define _LINUX_DN_H
#include <linux/types.h>
+#include <linux/if_ether.h>
/*
@@ -120,7 +121,7 @@ struct linkinfo_dn {
* Ethernet address format (for DECnet)
*/
union etheraddress {
- __u8 dne_addr[6]; /* Full ethernet address */
+ __u8 dne_addr[ETH_ALEN]; /* Full ethernet address */
struct {
__u8 dne_hiord[4]; /* DECnet HIORD prefix */
__u8 dne_nodeaddr[2]; /* DECnet node address */
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index 2d70d79..39f621a 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -14,6 +14,7 @@
#define _UAPI_LINUX_IF_BRIDGE_H
#include <linux/types.h>
+#include <linux/if_ether.h>
#define SYSFS_BRIDGE_ATTR "bridge"
#define SYSFS_BRIDGE_FDB "brforward"
@@ -88,7 +89,7 @@ struct __port_info {
};
struct __fdb_entry {
- __u8 mac_addr[6];
+ __u8 mac_addr[ETH_ALEN];
__u8 port_no;
__u8 is_local;
__u32 ageing_timer_value;
diff --git a/include/uapi/linux/netfilter_bridge/ebt_802_3.h b/include/uapi/linux/netfilter_bridge/ebt_802_3.h
index 5bf8491..f37522a 100644
--- a/include/uapi/linux/netfilter_bridge/ebt_802_3.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_802_3.h
@@ -2,6 +2,7 @@
#define _UAPI__LINUX_BRIDGE_EBT_802_3_H
#include <linux/types.h>
+#include <linux/if_ether.h>
#define EBT_802_3_SAP 0x01
#define EBT_802_3_TYPE 0x02
@@ -42,8 +43,8 @@ struct hdr_ni {
};
struct ebt_802_3_hdr {
- __u8 daddr[6];
- __u8 saddr[6];
+ __u8 daddr[ETH_ALEN];
+ __u8 saddr[ETH_ALEN];
__be16 len;
union {
struct hdr_ui ui;
diff --git a/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
index c6a204c..eac0f65 100644
--- a/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
@@ -2,6 +2,7 @@
#define _IPT_CLUSTERIP_H_target
#include <linux/types.h>
+#include <linux/if_ether.h>
enum clusterip_hashmode {
CLUSTERIP_HASHMODE_SIP = 0,
@@ -22,7 +23,7 @@ struct ipt_clusterip_tgt_info {
__u32 flags;
/* only relevant for new ones */
- __u8 clustermac[6];
+ __u8 clustermac[ETH_ALEN];
__u16 num_total_nodes;
__u16 num_local_nodes;
__u16 local_nodes[CLUSTERIP_MAX_NODES];
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index 227d4ce..172a7f0 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -60,7 +60,7 @@
struct virtio_net_config {
/* The config defining mac address (if VIRTIO_NET_F_MAC) */
- __u8 mac[6];
+ __u8 mac[ETH_ALEN];
/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
__u16 status;
/* Maximum number of each of transmit and receive queues;
diff --git a/include/uapi/linux/wimax/i2400m.h b/include/uapi/linux/wimax/i2400m.h
index 62d3561..fd198bc 100644
--- a/include/uapi/linux/wimax/i2400m.h
+++ b/include/uapi/linux/wimax/i2400m.h
@@ -122,7 +122,7 @@
#define __LINUX__WIMAX__I2400M_H__
#include <linux/types.h>
-
+#include <linux/if_ether.h>
/*
* Host Device Interface (HDI) common to all busses
@@ -487,7 +487,7 @@ struct i2400m_tlv_l4_message_versions {
struct i2400m_tlv_detailed_device_info {
struct i2400m_tlv_hdr hdr;
__u8 reserved1[400];
- __u8 mac_address[6];
+ __u8 mac_address[ETH_ALEN];
__u8 reserved2[2];
} __attribute__((packed));
--
1.8.1.2.459.gbcd45b4.dirty
^ permalink raw reply related
* [PATCH V3 0/3] networking: Use ETH_ALEN where appropriate
From: Joe Perches @ 2013-08-01 23:17 UTC (permalink / raw)
To: netdev
Cc: wimax, linux-usb, linux-kernel, virtualization, netfilter-devel,
linuxppc-dev, linux-arm-kernel, linux-media
In-Reply-To: <20130801.143137.331385226409040561.davem@davemloft.net>
Convert the uses mac addresses to ETH_ALEN so
it's easier to find and verify where mac addresses
need to be __aligned(2)
Change in V2:
- Remove include/acpi/actbl2.h conversion
It's a file copied from outside ACPI sources
Changes in V3:
- Don't move the pasemi_mac.h mac address to be aligned(2)
Just note that it's unaligned.
Joe Perches (3):
uapi: Convert some uses of 6 to ETH_ALEN
include: Convert ethernet mac address declarations to use ETH_ALEN
ethernet: Convert mac address uses of 6 to ETH_ALEN
drivers/net/ethernet/8390/ax88796.c | 4 +-
drivers/net/ethernet/amd/pcnet32.c | 6 +--
drivers/net/ethernet/broadcom/cnic_if.h | 6 +--
drivers/net/ethernet/dec/tulip/tulip_core.c | 8 +--
drivers/net/ethernet/i825xx/sun3_82586.h | 4 +-
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +-
drivers/net/ethernet/nuvoton/w90p910_ether.c | 4 +-
drivers/net/ethernet/pasemi/pasemi_mac.c | 13 ++---
drivers/net/ethernet/pasemi/pasemi_mac.h | 2 +-
drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 4 +-
drivers/net/ethernet/qlogic/qlge/qlge.h | 2 +-
include/linux/dm9000.h | 4 +-
include/linux/fs_enet_pd.h | 3 +-
include/linux/ieee80211.h | 59 +++++++++++-----------
include/linux/mlx4/device.h | 11 ++--
include/linux/mlx4/qp.h | 5 +-
include/linux/mv643xx_eth.h | 3 +-
include/linux/sh_eth.h | 3 +-
include/linux/smsc911x.h | 3 +-
include/linux/uwb/spec.h | 5 +-
include/media/tveeprom.h | 4 +-
include/net/irda/irlan_common.h | 3 +-
include/uapi/linux/dn.h | 3 +-
include/uapi/linux/if_bridge.h | 3 +-
include/uapi/linux/netfilter_bridge/ebt_802_3.h | 5 +-
include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h | 3 +-
include/uapi/linux/virtio_net.h | 2 +-
include/uapi/linux/wimax/i2400m.h | 4 +-
28 files changed, 99 insertions(+), 79 deletions(-)
--
1.8.1.2.459.gbcd45b4.dirty
^ permalink raw reply
* Re: pull-request: can-next 2013-08-01
From: David Miller @ 2013-08-01 23:15 UTC (permalink / raw)
To: mkl; +Cc: netdev, linux-can, kernel
In-Reply-To: <51FA4DD8.1040903@pengutronix.de>
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Thu, 01 Aug 2013 14:00:24 +0200
> this is a pull-request for net-next/master. It consists of two patches
> by Fabio Estevam. Them first convert the flexcan driver to use
> devm_ioremap_resource(), the second adds return value checking for
> clk_prepare_enable().
Pulled, thanks Marc.
^ permalink raw reply
* Re: [PATCH net-next] bnx2x: Revising locking scheme for MAC configuration
From: David Miller @ 2013-08-01 22:56 UTC (permalink / raw)
To: yuvalmin; +Cc: netdev, ariele, eilong
In-Reply-To: <1375367459-11832-1-git-send-email-yuvalmin@broadcom.com>
From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Thu, 1 Aug 2013 17:30:59 +0300
> On very rare occasions, repeated load/unload stress test in the presence of
> our storage driver (bnx2i/bnx2fc) causes a kernel panic in bnx2x code
> (NULL pointer dereference). Stack traces indicate the issue happens during MAC
> configuration; thorough code review showed that indeed several races exist
> in which one thread can iterate over the list of configured MACs while another
> deletes entries from the same list.
>
> This patch adds a varient on the single-writer/Multiple-reader lock mechanism -
> It utilizes an already exsiting bottom-half lock, using it so that Whenever
> a writer is unable to continue due to the existence of another writer/reader,
> it pends its request for future deliverance.
> The writer / last readers will check for the existence of such requests and
> perform them instead of the original initiator.
> This prevents the writer from having to sleep while waiting for the lock
> to be accessible, which might cause deadlocks given the locks already
> held by the writer.
>
> Another result of this patch is that setting of Rx Mode is now made in
> sleepable context - Setting of Rx Mode is made under a bottom-half lock, which
> was always nontrivial for the bnx2x driver, as the HW/FW configuration requires
> wait for completions.
> Since sleep was impossible (due to the sleepless-context), various mechanisms
> were utilized to prevent the calling thread from sleep, but the truth was that
> when the caller thread (i.e, the one calling ndo_set_rx_mode()) returned, the
> Rx mode was still not set in HW/FW.
>
> bnx2x_set_rx_mode() will now overtly schedule for the Rx changes to be
> configured by the sp_rtnl_task which hold the RTNL lock and is sleepable
> context.
>
> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
> Signed-off-by: Ariel Elior <ariele@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH-net v2] tipc: fix oops when creating server socket fails
From: David Miller @ 2013-08-01 22:55 UTC (permalink / raw)
To: paul.gortmaker; +Cc: netdev, ying.xue, jon.maloy
In-Reply-To: <1375360158-24753-1-git-send-email-paul.gortmaker@windriver.com>
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Thu, 1 Aug 2013 08:29:18 -0400
> From: Ying Xue <ying.xue@windriver.com>
>
> When creation of TIPC internal server socket fails,
> we get an oops with the following dump:
...
> Signed-off-by: Ying Xue <ying.xue@windriver.com>
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next v3] bonding: fix system hang due to fast igmp timer rescheduling
From: David Miller @ 2013-08-01 22:53 UTC (permalink / raw)
To: nikolay; +Cc: netdev, andy, fubar
In-Reply-To: <1375350702-7777-1-git-send-email-nikolay@redhat.com>
From: Nikolay Aleksandrov <nikolay@redhat.com>
Date: Thu, 1 Aug 2013 11:51:42 +0200
> From: "Nikolay Aleksandrov" <nikolay@redhat.com>
>
> After commit 4aa5dee4d9 ("net: convert resend IGMP to notifier event")
> we try to acquire rtnl in bond_resend_igmp_join_requests but it can be
> scheduled with rtnl already held (e.g. when bond_change_active_slave is
> called with rtnl) causing a loop of immediate reschedules + calls because
> rtnl_trylock fails each time since it's being already held.
> For me this issue leads to system hangs very easy:
> modprobe bonding; ifconfig bond0 up; ifenslave bond0 eth0; rmmod
> bonding;
>
> The fix is to introduce a small (1 jiffy) delay which is enough for the
> sections holding rtnl to finish without putting any strain on the system.
> Also adjust the timer in bond_change_active_slave to be 1 jiffy, since
> most of the time it's called with rtnl already held.
>
> Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH v4] net: Add MOXA ART SoCs ethernet driver
From: David Miller @ 2013-08-01 22:51 UTC (permalink / raw)
To: jonas.jensen
Cc: devicetree, linux-doc, netdev, linux-kernel, arm, joe, florian,
linux-arm-kernel
In-Reply-To: <1375349968-16059-1-git-send-email-jonas.jensen@gmail.com>
From: Jonas Jensen <jonas.jensen@gmail.com>
Date: Thu, 1 Aug 2013 11:39:28 +0200
> I have since found a problem occurring on high load. Please point out
> anything the driver can do differently to eliminate it.
>
> The error only occurs during external ping, i.e. ping -s 50000 from
> 10.0.1.200 to hardware.
Looks like pure memory corruption.
^ permalink raw reply
* Re: [PATCH] xfrm: Refactor xfrm_state timer management
From: David Miller @ 2013-08-01 22:35 UTC (permalink / raw)
To: fan.du; +Cc: steffen.klassert, herbert, netdev
In-Reply-To: <1375342790-2852-1-git-send-email-fan.du@windriver.com>
From: Fan Du <fan.du@windriver.com>
Date: Thu, 1 Aug 2013 15:39:50 +0800
> Current xfrm_state timer management is vulnerable in below several ways:
>
> - Use hrtimer for timer, the timer handler use wall clock checking expire events
> commit e3c0d047 "Fix unexpected SA hard expiration after changing date" fix
> the partial problem by notify IKED with soft -> expire sequence when user
> changing system time forward. But it didn't fix the issue when use changing
> system time backwards, which is most crucial as SAs lifetime will be a *bigger*
> one when doing so, thus buy much time for cracker.
>
> In short words, changing system time forward/backward can either result in
> long long lifetime SAs or sudden SA hard expired first.
>
> It actually can be fixed this by adding more flags, and with more complicated
> checking whether system time is being turned forward or backward. I did it and
> eventually works well. But it's only for "add time expire", taking care of
> "use time expire" will add more logic into timer handler, and much more
> complicated.
>
> - When user give "use lifetime" by xfrm user configuration
> interface, current xfrm_state timer management will actually turn the timer on
> even when no IP packet hit policy, and the "use lifetime" eventually become
> "add lifetime".
>
> The culprit is: with one timer for both "add lifetime" and "use lifetime", at the
> same time using wall clock to check two expire events. This patch tries to solve
> it by:
> - Switch real time timer with monotonic timer against any system time changing
> - Use "add lifetime" to override "use lifetime" when both applied, as most popular
> IKED like Racoon2/StrongSwan use "add lifetime" only.
> - Start "add lifetime" timer only when xfrm_state is updated/added
> - Start "use lifetime" timer when actually SAs is used.
> - Start the timer with soft lifetime interval first, and then in timer handler
> rearm timer with hard lifetime to get rid of using wall clock.
>
> Signed-off-by: Fan Du <fan.du@windriver.com>
This is getting way too complicated, there must be a much better way
to handle this.
I suspect the thing to do is to have system time changes generate a
notifier when clock_was_set() is called.
The XFRM code would walk the rules and pretend that we hit the soft
timeout for every rule that we haven't hit the soft timeout yet
already.
If a rule hit the soft timeout, force a hard timeout.
When forcing a soft timeout, adjust the hard timeout to be
(hard_timeout - soft_timeout) into the future.
Because these other approaches are extremely fragile and
unmaintainable.
^ permalink raw reply
* Re: [Patch v2 net-next 2/2] net: rename CONFIG_NET_LL_RX_POLL to CONFIG_NET_RX_BUSY_POLL
From: David Miller @ 2013-08-01 22:12 UTC (permalink / raw)
To: amwang; +Cc: netdev, eliezer.tamir
In-Reply-To: <1375326625-21427-2-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Thu, 1 Aug 2013 11:10:25 +0800
> From: Cong Wang <amwang@redhat.com>
>
> Eliezer renames several *ll_poll to *busy_poll, but forgets
> CONFIG_NET_LL_RX_POLL, so in case of confusion, rename it too.
>
> Cc: Eliezer Tamir <eliezer.tamir@linux.intel.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Also applied to net, thanks.
^ permalink raw reply
* Re: [Patch net-next 1/2] net: fix a compile error when CONFIG_NET_LL_RX_POLL is not set
From: David Miller @ 2013-08-01 22:12 UTC (permalink / raw)
To: amwang; +Cc: netdev, eliezer.tamir
In-Reply-To: <1375326625-21427-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Thu, 1 Aug 2013 11:10:24 +0800
> From: Cong Wang <amwang@redhat.com>
>
> When CONFIG_NET_LL_RX_POLL is not set, I got:
>
> net/socket.c: In function ‘sock_poll’:
> net/socket.c:1165:4: error: implicit declaration of function ‘sk_busy_loop’ [-Werror=implicit-function-declaration]
>
> Fix this by adding a nop when !CONFIG_NET_LL_RX_POLL.
>
> Cc: Eliezer Tamir <eliezer.tamir@linux.intel.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied to net
^ permalink raw reply
* Re: [PATCH net 0/2] mlx4_core fixes
From: David Miller @ 2013-08-01 22:10 UTC (permalink / raw)
To: ogerlitz; +Cc: netdev, amirv
In-Reply-To: <1375376101-20435-1-git-send-email-ogerlitz@mellanox.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Thu, 1 Aug 2013 19:54:59 +0300
> Patch #1 complements commit ef96f7d46ad "net/mlx4_en: Handle unassigned VF MAC
> address correctly" which took care of the VM side of things. It follows the
> approach taken by the ixgbevf (e1941a7 "ixgbevf: Adjust to handle unassigned
> MAC address from PF") and bnx2x (e09b74d01 "bnx2x: Zero VFs starting MACs")
> drivers too, so users will experience unified approach across vendors.
>
> Would be happy to see both patches land in -stable for 3.10.y - do you
> want to handle that through the peridioc batches you send to Greg?
>
> The patches were done against the net tree, commit e44892c1b "igb:
> fix vlan filtering in promisc mode when not in VT mode"
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH v3 00/13] update tile network drivers
From: David Miller @ 2013-08-01 21:42 UTC (permalink / raw)
To: cmetcalf; +Cc: linux-kernel, netdev, richardcochran, eric.dumazet
In-Reply-To: <cover.1375385119.git.cmetcalf@tilera.com>
From: Chris Metcalf <cmetcalf@tilera.com>
Date: Thu, 1 Aug 2013 15:25:19 -0400
> This is v3 of the patch series to update the Tilera network drivers.
>
> From the v1 00/13 cover letter: "This patch series contains changes made
> to the Tilera on-chip network drivers for both the 64-bit tilegx and
> 32-bit tilepro architectures. The changes involve a number of bug fixes,
> support for the multiple mPIPEs on the new Gx72 chip, support for jumbo
> frames, TSO for IPv6, GRO, PTP support, and statistics improvements."
>
> David has already applied the v2 patch for what was patch 01/13 in the
> first series ("handle 64-bit statistics in tilepro network driver")
> so it is not included in this v3 series.
Series applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH V2 3/3] ethernet: Convert mac address uses of 6 to ETH_ALEN
From: David Miller @ 2013-08-01 21:31 UTC (permalink / raw)
To: olof
Cc: linux, joe, sammy, grundler, mcuos.com, rajesh.borundia, netdev,
sony.chacko, linux-kernel, manish.chopra, pcnet32, ron.mercer,
gallatin, linux-driver, jitendra.kalsaria, linux-arm-kernel,
shahed.shaikh
In-Reply-To: <CAOesGMhf-2KE1B8_4CGJADCG=ceDFRrDbhTnA56kXYPWoKTScg@mail.gmail.com>
From: Olof Johansson <olof@lixom.net>
Date: Thu, 1 Aug 2013 14:24:32 -0700
> So, you might as well leave the code alone for now. It's not used on
> fast path, and the system definitely handles unaligned accesses for
> this -- it has for years already.
Fair enough, Joe please respin.
^ permalink raw reply
* Re: [PATCH V2 3/3] ethernet: Convert mac address uses of 6 to ETH_ALEN
From: Olof Johansson @ 2013-08-01 21:24 UTC (permalink / raw)
To: David Miller
Cc: Russell King - ARM Linux, Joe Perches, Sam Creasey,
Grant Grundler, ZongShun Wan, Rajesh Borundia,
Network Development, Sony Chacko, linux-kernel@vger.kernel.org,
Manish Chopra, Don Fry, Ron Mercer, Andrew Gallatin, linux-driver,
Jitendra Kalsaria, linux-arm-kernel@lists.infradead.org,
Shahed Shaikh
In-Reply-To: <20130801.141016.1475274289112004539.davem@davemloft.net>
On Thu, Aug 1, 2013 at 2:10 PM, David Miller <davem@davemloft.net> wrote:
> From: Russell King - ARM Linux <linux@arm.linux.org.uk>
> Date: Thu, 1 Aug 2013 22:06:18 +0100
>
>> On Thu, Aug 01, 2013 at 02:04:47PM -0700, Joe Perches wrote:
>>> On Thu, 2013-08-01 at 21:58 +0100, Russell King - ARM Linux wrote:
>>> > This seems rather obscure - I mean, it's not obvious to driver authors
>>> > that should be the case. Would it not be better to make this a little
>>> > more obvious somehow? Maybe __aligned(2) against mac_addr? Or
>>> > maybe have a debugging check for it?
>>>
>>> That'd be for David Miller (cc'd).
>>>
>>> I believe he's argued in the past that any alignment check
>>> for mac addresses was unnecessary.
>>>
>>> For all I know it really might not matter because pasemi
>>> can successfully dereference a ushort against an odd char
>>> pointer.
>>>
>>> I just noticed it and thought it'd be better moved.
>>
>> As can ARM too for years now - either in hardware or via fixup for
>> kernel code.
>
> But probably not a good idea if it's done in a fast path.
This particular driver is for the PA Semi chips, and I very much doubt
that compatible hardware will ever show up anywhere else; they're
fairly dependent on the I/O architecture of the chip and Apple has not
brought those aspects forward in their ARM chips, as far as I know.
So, you might as well leave the code alone for now. It's not used on
fast path, and the system definitely handles unaligned accesses for
this -- it has for years already.
-Olof
^ permalink raw reply
* Re: [PATCH net v2 0/2] ipv6: prevent fib6_run_gc() contention
From: David Miller @ 2013-08-01 21:18 UTC (permalink / raw)
To: mkubecek; +Cc: eric.dumazet, netdev, kuznet, jmorris, yoshfuji, kaber
In-Reply-To: <cover.1375343204.git.mkubecek@suse.cz>
From: Michal Kubecek <mkubecek@suse.cz>
Date: Thu, 1 Aug 2013 10:04:04 +0200 (CEST)
> On a high-traffic router with many processors and many IPv6 dst entries,
> soft lockup in fib6_run_gc() can occur when number of entries reaches
> gc_thresh. Prevent this by not waiting for the lock if garbage collector
> is already running as we would only run it again as soon as it finished.
>
> v2: as suggested by Eric Dumazet, move update of ip6_rt_last_gc into
> fib6_run_gc() so that it reflects every run of garbage collector
> rather than only those via ip6_dst_gc()
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] net: check net.core.somaxconn sysctl values
From: David Miller @ 2013-08-01 21:18 UTC (permalink / raw)
To: klamm; +Cc: eric.dumazet, raise.sail, ebiederm, netdev, linux-kernel
In-Reply-To: <51FA2490.4020905@yandex-team.ru>
From: Roman Gushchin <klamm@yandex-team.ru>
Date: Thu, 01 Aug 2013 13:04:16 +0400
> On 01.08.2013 04:10, David Miller wrote:
>> From: Roman Gushchin <klamm@yandex-team.ru>
>> Date: Wed, 31 Jul 2013 17:57:35 +0400
>>
>>> ---
>>> net/core/sysctl_net_core.c | 6 +++++-
>>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
>>> index cfdb46a..2ff093b 100644
>>> --- a/net/core/sysctl_net_core.c
>>> +++ b/net/core/sysctl_net_core.c
>>> @@ -20,7 +20,9 @@
>>
>> This patch is against old sources, please respin it against the
>> current
>> tree.
>>
>> Thanks.
>>
>
> net: check net.core.somaxconn sysctl values
Still doesn't apply, and it's because your email client has corrupted
the patch.
Please read Documentation/email-clients.txt to learn how to fix this
problem, and then send a test patch to yourself.
Only when you can successfully apply the test patch you send to
yourself should you repost your patch here.
Thanks.
^ permalink raw reply
* Re: [patch net 0/2] ipv6: prevent race between address creation and removal
From: David Miller @ 2013-08-01 21:17 UTC (permalink / raw)
To: jiri; +Cc: netdev, jbenc, kuznet, jmorris, yoshfuji, kaber
In-Reply-To: <1375346488-1001-1-git-send-email-jiri@resnulli.us>
From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 1 Aug 2013 10:41:26 +0200
> Jiri Benc (1):
> ipv6: prevent race between address creation and removal
>
> Jiri Pirko (1):
> ipv6: move peer_addr init into ipv6_add_addr()
Series applied, thanks Jiri.
^ 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