* Re: [PATCH 5/9] net: Have xmit_list() signal more==true when appropriate.
From: Jesper Dangaard Brouer @ 2014-09-02 7:25 UTC (permalink / raw)
To: David Miller; +Cc: brouer, netdev
In-Reply-To: <20140901.152459.592105486574617399.davem@davemloft.net>
On Mon, 01 Sep 2014 15:24:59 -0700 (PDT) David Miller <davem@davemloft.net> wrote:
> diff --git a/net/core/dev.c b/net/core/dev.c
> index f0ed5a6..6d82194 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2600,7 +2600,7 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
> EXPORT_SYMBOL(netif_skb_features);
>
> static int xmit_one(struct sk_buff *skb, struct net_device *dev,
> - struct netdev_queue *txq)
> + struct netdev_queue *txq, bool more)
> {
> unsigned int len;
> int rc;
> @@ -2610,7 +2610,7 @@ static int xmit_one(struct sk_buff *skb, struct net_device *dev,
>
> len = skb->len;
> trace_net_dev_start_xmit(skb, dev);
> - rc = netdev_start_xmit(skb, dev, txq, false);
> + rc = netdev_start_xmit(skb, dev, txq, more);
>
> trace_net_dev_xmit(skb, rc, dev, len);
>
> return rc;
> @@ -2626,7 +2626,7 @@ static struct sk_buff *xmit_list(struct sk_buff *first, struct net_device *dev,
> struct sk_buff *next = skb->next;
>
> skb->next = NULL;
> - rc = xmit_one(skb, dev, txq);
> + rc = xmit_one(skb, dev, txq, next != NULL);
Guess, the caller constructing the skb list to xmit_list() must make
sure all SKBs have the same TXQ.
> if (unlikely(!dev_xmit_complete(rc))) {
> skb->next = next;
> goto out;
In the exit case (!dev_xmit_complete(rc)) is it,
1. the responsibility of the driver to "flush" the tail, or
2. do we depend on qdisc or softirq to be reactivated soonish?
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH net-next 2/2] net: exit busy loop when another process is runnable
From: Jason Wang @ 2014-09-02 7:37 UTC (permalink / raw)
To: Eliezer Tamir, Ingo Molnar
Cc: Mike Galbraith, davem, netdev, linux-kernel, mst, Peter Zijlstra,
Ingo Molnar
In-Reply-To: <54056076.2030603@linux.intel.com>
On 09/02/2014 02:15 PM, Eliezer Tamir wrote:
> On 02/09/2014 06:29, Jason Wang wrote:
>> On 09/01/2014 02:39 PM, Eliezer Tamir wrote:
>>> On 29/08/2014 06:08, Jason Wang wrote:
>>>>> Yes, but rx busy polling only works in process context and does not
>>>>> disable bh, so it may be not an issue.
>>> sk_busy_loop() uses rcu_read_lock_bh(), so it does run with bh disabled.
>> True, so we need probably also exit the loop when there are pending bhs.
> I'm not so sure, in the typical busy poll scenario, the incoming
> traffic is the most time-critical thing in the system.
> It's so important that you are willing to trade lots of CPU power
> for better latency. The user has decided that he wants to dedicate
> this CPU mostly for that.
But user should increase the process priority or cgroup in this case.
> This is not something that plays nice with
> other apps, but this is what the user wants.
So the busy polling looks have a higher priority somehow than other
processes.
> So, you definitely don't want to starve any bh, and you should
> regularly re-enable bh's, but you also don't want to stop everything
> at any time a bh is scheduled.
If I get your meaning, you may want call to rcu_read_lock_bh() and get
socket napi id inside the do{} loop? This seems can prevent bhs from
being starved and can also handle the case that the packets were from
different NAPIs.
>
> You also want network processing on the queues that are busy polled
> to come through busy polling and not through NAPI, which is run in bh
> context.
>
> -Eliezer
> --
> 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
* Re: [PATCH 0/9] Make dev_hard_start_xmit() work fundamentall on lists
From: Jesper Dangaard Brouer @ 2014-09-02 7:51 UTC (permalink / raw)
To: David Miller; +Cc: brouer, netdev
In-Reply-To: <20140901.152430.1711925724234542172.davem@davemloft.net>
On Mon, 01 Sep 2014 15:24:30 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> After this patch set, dev_hard_start_xmit() will work fundemantally
> on any and all SKB lists.
This is really excellent work, thank you!
dev_hard_start_xmit() looks so clean now :-)
> This opens the path for a clean implementation of pulling multiple
> packets out during qdisc_restart(), and then passing that blob
> in one shot to dev_hard_start_xmit().
Sounds perfect. I'll start to experiment with qdisc stuff.
> And with those two issues out of the way, it should now be trivial to
> build experiments on top of this patch set, all of the framework
> should be there now. You could do something as simple as:
As xmit_list()/dev_hard_start_xmit() depend on all SKBs belonging to
the same TXQ, below code should also take this into account.
Thus, bulk dequeue will only see the benefit (of taking the qdisc lock
less) when packets are for the same TXQ. But I guess this is a good
design choice, as this makes the rest of the code simpler to work with.
> skb = q->dequeue(q);
> if (skb)
> skb = validate_xmit_skb(skb, qdisc_dev(q));
> if (skb) {
> struct sk_buff *new, *head = skb;
> int limit = 5;
>
> do {
> new = q->dequeue(q);
> if (new)
> new = validate_xmit_skb(new, qdisc_dev(q));
> if (new) {
> skb->next = new;
> skb = new;
> }
> } while (new && --limit);
> skb = head;
> }
>
> inside of the else branch of dequeue_skb().
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* [PATCH net v2] ipv6: fix rtnl locking in setsockopt for anycast and multicast
From: Sabrina Dubroca @ 2014-09-02 8:29 UTC (permalink / raw)
To: Hannes Frederic Sowa
Cc: Cong Wang, Tommi Rantala, David S. Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy, netdev, LKML,
trinity, Dave Jones
In-Reply-To: <1409610378.21965.52.camel@localhost>
Calling setsockopt with IPV6_JOIN_ANYCAST or IPV6_LEAVE_ANYCAST
triggers the assertion in addrconf_join_solict()/addrconf_leave_solict()
ipv6_sock_ac_join(), ipv6_sock_ac_drop(), ipv6_sock_ac_close() need to
take RTNL before calling ipv6_dev_ac_inc/dec. Same thing with
ipv6_sock_mc_join(), ipv6_sock_mc_drop(), ipv6_sock_mc_close() before
calling ipv6_dev_mc_inc/dec.
This patch moves ASSERT_RTNL() up a level in the call stack.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reported-by: Tommi Rantala <tt.rantala@gmail.com>
---
As was said earlier, this should go in stable.
v2:
- based on net
- keep dev_get_by_flags_rcu and RCU in ipv6_sock_ac_*
- remove two ASSERT_RTNL() that are not necessary
Thank you for your help, Hannes!
net/ipv6/addrconf.c | 15 +++++----------
net/ipv6/anycast.c | 12 ++++++++++++
net/ipv6/mcast.c | 14 ++++++++++++++
3 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0b239fc1816e..aa0e135b808c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1690,14 +1690,12 @@ void addrconf_dad_failure(struct inet6_ifaddr *ifp)
addrconf_mod_dad_work(ifp, 0);
}
-/* Join to solicited addr multicast group. */
-
+/* Join to solicited addr multicast group.
+ * caller must hold RTNL */
void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr)
{
struct in6_addr maddr;
- ASSERT_RTNL();
-
if (dev->flags&(IFF_LOOPBACK|IFF_NOARP))
return;
@@ -1705,12 +1703,11 @@ void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr)
ipv6_dev_mc_inc(dev, &maddr);
}
+/* caller must hold RTNL */
void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr)
{
struct in6_addr maddr;
- ASSERT_RTNL();
-
if (idev->dev->flags&(IFF_LOOPBACK|IFF_NOARP))
return;
@@ -1718,12 +1715,11 @@ void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr)
__ipv6_dev_mc_dec(idev, &maddr);
}
+/* caller must hold RTNL */
static void addrconf_join_anycast(struct inet6_ifaddr *ifp)
{
struct in6_addr addr;
- ASSERT_RTNL();
-
if (ifp->prefix_len >= 127) /* RFC 6164 */
return;
ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
@@ -1732,12 +1728,11 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp)
ipv6_dev_ac_inc(ifp->idev->dev, &addr);
}
+/* caller must hold RTNL */
static void addrconf_leave_anycast(struct inet6_ifaddr *ifp)
{
struct in6_addr addr;
- ASSERT_RTNL();
-
if (ifp->prefix_len >= 127) /* RFC 6164 */
return;
ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 210183244689..45b9d81d91e8 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -77,6 +77,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
pac->acl_next = NULL;
pac->acl_addr = *addr;
+ rtnl_lock();
rcu_read_lock();
if (ifindex == 0) {
struct rt6_info *rt;
@@ -137,6 +138,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
error:
rcu_read_unlock();
+ rtnl_unlock();
if (pac)
sock_kfree_s(sk, pac, sizeof(*pac));
return err;
@@ -171,13 +173,17 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
spin_unlock_bh(&ipv6_sk_ac_lock);
+ rtnl_lock();
rcu_read_lock();
dev = dev_get_by_index_rcu(net, pac->acl_ifindex);
if (dev)
ipv6_dev_ac_dec(dev, &pac->acl_addr);
rcu_read_unlock();
+ rtnl_unlock();
sock_kfree_s(sk, pac, sizeof(*pac));
+ if (!dev)
+ return -ENODEV;
return 0;
}
@@ -198,6 +204,7 @@ void ipv6_sock_ac_close(struct sock *sk)
spin_unlock_bh(&ipv6_sk_ac_lock);
prev_index = 0;
+ rtnl_lock();
rcu_read_lock();
while (pac) {
struct ipv6_ac_socklist *next = pac->acl_next;
@@ -212,6 +219,7 @@ void ipv6_sock_ac_close(struct sock *sk)
pac = next;
}
rcu_read_unlock();
+ rtnl_unlock();
}
static void aca_put(struct ifacaddr6 *ac)
@@ -233,6 +241,8 @@ int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr)
struct rt6_info *rt;
int err;
+ ASSERT_RTNL();
+
idev = in6_dev_get(dev);
if (idev == NULL)
@@ -302,6 +312,8 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr)
{
struct ifacaddr6 *aca, *prev_aca;
+ ASSERT_RTNL();
+
write_lock_bh(&idev->lock);
prev_aca = NULL;
for (aca = idev->ac_list; aca; aca = aca->aca_next) {
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 617f0958e164..a23b655a7627 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -172,6 +172,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
mc_lst->next = NULL;
mc_lst->addr = *addr;
+ rtnl_lock();
rcu_read_lock();
if (ifindex == 0) {
struct rt6_info *rt;
@@ -185,6 +186,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
if (dev == NULL) {
rcu_read_unlock();
+ rtnl_unlock();
sock_kfree_s(sk, mc_lst, sizeof(*mc_lst));
return -ENODEV;
}
@@ -202,6 +204,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
if (err) {
rcu_read_unlock();
+ rtnl_unlock();
sock_kfree_s(sk, mc_lst, sizeof(*mc_lst));
return err;
}
@@ -212,6 +215,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
spin_unlock(&ipv6_sk_mc_lock);
rcu_read_unlock();
+ rtnl_unlock();
return 0;
}
@@ -229,6 +233,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
if (!ipv6_addr_is_multicast(addr))
return -EINVAL;
+ rtnl_lock();
spin_lock(&ipv6_sk_mc_lock);
for (lnk = &np->ipv6_mc_list;
(mc_lst = rcu_dereference_protected(*lnk,
@@ -252,12 +257,15 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
} else
(void) ip6_mc_leave_src(sk, mc_lst, NULL);
rcu_read_unlock();
+ rtnl_unlock();
+
atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc);
kfree_rcu(mc_lst, rcu);
return 0;
}
}
spin_unlock(&ipv6_sk_mc_lock);
+ rtnl_unlock();
return -EADDRNOTAVAIL;
}
@@ -302,6 +310,7 @@ void ipv6_sock_mc_close(struct sock *sk)
if (!rcu_access_pointer(np->ipv6_mc_list))
return;
+ rtnl_lock();
spin_lock(&ipv6_sk_mc_lock);
while ((mc_lst = rcu_dereference_protected(np->ipv6_mc_list,
lockdep_is_held(&ipv6_sk_mc_lock))) != NULL) {
@@ -328,6 +337,7 @@ void ipv6_sock_mc_close(struct sock *sk)
spin_lock(&ipv6_sk_mc_lock);
}
spin_unlock(&ipv6_sk_mc_lock);
+ rtnl_unlock();
}
int ip6_mc_source(int add, int omode, struct sock *sk,
@@ -845,6 +855,8 @@ int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr)
struct ifmcaddr6 *mc;
struct inet6_dev *idev;
+ ASSERT_RTNL();
+
/* we need to take a reference on idev */
idev = in6_dev_get(dev);
@@ -916,6 +928,8 @@ int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr)
{
struct ifmcaddr6 *ma, **map;
+ ASSERT_RTNL();
+
write_lock_bh(&idev->lock);
for (map = &idev->mc_list; (ma=*map) != NULL; map = &ma->next) {
if (ipv6_addr_equal(&ma->mca_addr, addr)) {
--
2.1.0
^ permalink raw reply related
* Re: [RFC PATCH] netlink: Safer deletion of sk_bind_node
From: Harish Jenny Kandiga Nagaraj @ 2014-09-02 8:44 UTC (permalink / raw)
To: David Miller
Cc: dborkman, tgraf, ebiederm, darkjames-ws, rgb, eric.dumazet,
stephen, netdev, linux-kernel
In-Reply-To: <20140901.220325.955861172520355423.davem@davemloft.net>
In one of our random test runs we observed the crash mentioned in the previous mail.
After debugging we found out that the call flow of the inline and static functions were
netlink_release
-----netlink_remove
---------__sk_del_bind_node
--------------__hlist_del
*pprev was NULL in __hlist_del function while deleting &sk->sk_bind_node hlist_node. Hence the patch was given.
In netlink_remove function , first the sk_del_node_init function will be called. This internally calls __sk_del_node_init function. While deleting &sk->sk_node hlist_node using __sk_del_node function there is a NULL check with sk_hashed function.
Why there is no NULL check for *pprev while deleting &sk->sk_bind_node ?
On Tuesday 02 September 2014 10:33 AM, David Miller wrote:
> From: Harish Jenny K N
> Date: Mon, 1 Sep 2014 12:38:29 +0530
>
> Firstly, you really need to fix your outgoing email so that your email
> address appears in your From: header properly.
>
>> From: Harish Jenny K N <harish_kandiga@mentor.com>
>>
>> Unable to handle kernel NULL pointer dereference at virtual address 00000000
>> (netlink_release+0x0/0x2a0) from [<8034e78c>] (sock_release+0x28/0xa4)
>> (sock_release+0x0/0xa4) from [<8034e830>] (sock_close+0x28/0x34)
>> (sock_close+0x0/0x34) from [<800f3490>] (__fput+0xf0/0x1ec)
>> (__fput+0x0/0x1ec) from [<800f3634>] (____fput+0x10/0x14)
>> (____fput+0x0/0x14) from [<80040a64>] (task_work_run+0xb8/0xd8)
>> (task_work_run+0x0/0xd8) from [<800113a0>] (do_work_pending+0xb0/0xc4)
>> (do_work_pending+0x0/0xc4) from [<8000d960>] (work_pending+0xc/0x20)
>> Call flow of the inline and static functions
>> netlink_release
>> -----netlink_remove
>> ---------__sk_del_bind_node
>> --------------__hlist_del
>>
>> Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com>
> This doesn't tell us anything about how this situation can be
> arrived at.
>
> When subscriptions changes, we delete the node with the table lock
> held if subscriptions goes to zero. We only try to delete the node
> when subscriptions was zero.
^ permalink raw reply
* RE: [PATCH 8/9] net: Don't keep around original SKB when we software segment GSO frames.
From: David Laight @ 2014-09-02 8:49 UTC (permalink / raw)
To: 'Tom Herbert', David Miller; +Cc: Linux Netdev List
In-Reply-To: <CA+mtBx-1r-vJYDx0xJ+p=Tjr=_v559XdrSu1SZ4UXWE_4fLbZg@mail.gmail.com>
From: Tom Herbert
> On Mon, Sep 1, 2014 at 3:25 PM, David Miller <davem@davemloft.net> wrote:
> >
> > Just maintain the list properly by returning the head of the remaining
> > SKB list from dev_hard_start_xmit().
> >
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> > ---
> > include/linux/netdevice.h | 4 +--
> > net/core/dev.c | 79 +++++++++--------------------------------------
> > net/sched/sch_generic.c | 2 +-
> > 3 files changed, 17 insertions(+), 68 deletions(-)
> >
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index 47c49ba..202c25a 100644
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -2828,8 +2828,8 @@ int dev_change_carrier(struct net_device *, bool new_carrier);
> > int dev_get_phys_port_id(struct net_device *dev,
> > struct netdev_phys_port_id *ppid);
> > struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device *dev);
> > -int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
> > - struct netdev_queue *txq);
> > +struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
> > + struct netdev_queue *txq, int *ret);
>
> Might be slightly better to still return int but pass struct sk_buff
> **skb. One less argument and doesn't change return type.
It makes a difference to how the compiler can compile the calling code.
Whichever variable you pass by reference has to be assumed to be changeable
by every following function call - so can't be placed in a callee saved register.
Ideally you want both values returned in registers - difficult to do portably.
David
^ permalink raw reply
* [PATCH v2 net] bnx2x: Configure device endianity on driver load and reset endianity on removal.
From: Manish Chopra @ 2014-09-02 8:31 UTC (permalink / raw)
To: davem; +Cc: netdev, Ariel.Elior, Yuval.Mintz
Some hosts can be both little and big endian.
In certain scenarios a big endian kernel can kexec a little endian kernel.
This patch fixes this case from both ends:
1) Return endianity to original values on shutdown (in case little endian kernel boots after we shutdown).
2) Do not rely on HW reset values when loading driver in little endian kernel
but configure them explicitly (in case previous kernel was big endian and did not reset the HW).
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
---
Hi David,
Please consider applying this patch to `net'
v2: Reset endianity registers on driver removal under IS_PF(bp) check.
Thanks,
Manish
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 57 +++++++++++++++-------
1 files changed, 39 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 900cab4..f6bd5ec 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -6849,6 +6849,37 @@ static void bnx2x__common_init_phy(struct bnx2x *bp)
bnx2x_release_phy_lock(bp);
}
+static void bnx2x_config_endianity(struct bnx2x *bp, u32 val)
+{
+ REG_WR(bp, PXP2_REG_RQ_QM_ENDIAN_M, val);
+ REG_WR(bp, PXP2_REG_RQ_TM_ENDIAN_M, val);
+ REG_WR(bp, PXP2_REG_RQ_SRC_ENDIAN_M, val);
+ REG_WR(bp, PXP2_REG_RQ_CDU_ENDIAN_M, val);
+ REG_WR(bp, PXP2_REG_RQ_DBG_ENDIAN_M, val);
+
+ /* make sure this value is 0 */
+ REG_WR(bp, PXP2_REG_RQ_HC_ENDIAN_M, 0);
+
+ REG_WR(bp, PXP2_REG_RD_QM_SWAP_MODE, val);
+ REG_WR(bp, PXP2_REG_RD_TM_SWAP_MODE, val);
+ REG_WR(bp, PXP2_REG_RD_SRC_SWAP_MODE, val);
+ REG_WR(bp, PXP2_REG_RD_CDURD_SWAP_MODE, val);
+}
+
+static void bnx2x_set_endianity(struct bnx2x *bp)
+{
+#ifdef __BIG_ENDIAN
+ bnx2x_config_endianity(bp, 1);
+#else
+ bnx2x_config_endianity(bp, 0);
+#endif
+}
+
+static void bnx2x_reset_endianity(struct bnx2x *bp)
+{
+ bnx2x_config_endianity(bp, 0);
+}
+
/**
* bnx2x_init_hw_common - initialize the HW at the COMMON phase.
*
@@ -6915,23 +6946,7 @@ static int bnx2x_init_hw_common(struct bnx2x *bp)
bnx2x_init_block(bp, BLOCK_PXP2, PHASE_COMMON);
bnx2x_init_pxp(bp);
-
-#ifdef __BIG_ENDIAN
- REG_WR(bp, PXP2_REG_RQ_QM_ENDIAN_M, 1);
- REG_WR(bp, PXP2_REG_RQ_TM_ENDIAN_M, 1);
- REG_WR(bp, PXP2_REG_RQ_SRC_ENDIAN_M, 1);
- REG_WR(bp, PXP2_REG_RQ_CDU_ENDIAN_M, 1);
- REG_WR(bp, PXP2_REG_RQ_DBG_ENDIAN_M, 1);
- /* make sure this value is 0 */
- REG_WR(bp, PXP2_REG_RQ_HC_ENDIAN_M, 0);
-
-/* REG_WR(bp, PXP2_REG_RD_PBF_SWAP_MODE, 1); */
- REG_WR(bp, PXP2_REG_RD_QM_SWAP_MODE, 1);
- REG_WR(bp, PXP2_REG_RD_TM_SWAP_MODE, 1);
- REG_WR(bp, PXP2_REG_RD_SRC_SWAP_MODE, 1);
- REG_WR(bp, PXP2_REG_RD_CDURD_SWAP_MODE, 1);
-#endif
-
+ bnx2x_set_endianity(bp);
bnx2x_ilt_init_page_size(bp, INITOP_SET);
if (CHIP_REV_IS_FPGA(bp) && CHIP_IS_E1H(bp))
@@ -13169,9 +13184,15 @@ static void __bnx2x_remove(struct pci_dev *pdev,
bnx2x_iov_remove_one(bp);
/* Power on: we can't let PCI layer write to us while we are in D3 */
- if (IS_PF(bp))
+ if (IS_PF(bp)) {
bnx2x_set_power_state(bp, PCI_D0);
+ /* Set endianity registers to reset values in case next driver
+ * boots in different endianty environment.
+ */
+ bnx2x_reset_endianity(bp);
+ }
+
/* Disable MSI/MSI-X */
bnx2x_disable_msi(bp);
--
1.7.1
^ permalink raw reply related
* Re: [net PATCH 1/1] drivers: net: cpsw: dual_emac: fix reducing of rx descriptor during ifdown
From: Mugunthan V N @ 2014-09-02 9:21 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20140901.183108.784916699845611422.davem@davemloft.net>
David
On Tuesday 02 September 2014 07:01 AM, David Miller wrote:
> From: Mugunthan V N <mugunthanvnm@ti.com>
> Date: Fri, 29 Aug 2014 14:52:25 +0530
>
>> In Dual EMAC, when both interface are up and while doing ifdown with heavy
>> traffic then skbs already processed by DMA from that slave emac has to be
>> requeued as still the other interface is up and running.
>>
>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
>
> I don't see why this is important.
>
> If the packet arrived via the down interface, let it be dropped and
> the sender will simply resend if necessary.
>
> Also you are putting this new multi-slave logic under the "status < 0"
> condition as well as the interface being down, that's not right either.
>
Multi slave logic is already there though out the driver, this is one
corner case where it fails. Let me explain more
DMA is common for both interfaces and serves both the slave ports. In
heavy traffic when one interface is put down, there are chances that
some packets are already processed in are in completed state.
Since DMA is a common entity for both interface, DMA is disabled only
when there all the slave interfaces are down. so when both interface is
up and putting down one interface, DMA de-init doesn't happen as the
other interface is up.
In this scenario, when cpsw_rx_handler is called for processing the
packet which might have packets for interfaces which is down already.
Previously the driver simply drops the skb and doesn't do re-queue of
the descriptor which results in one descriptor less for rx DMA.
When ifup and ifdown is run continuously, for each spilled packet (for
interface which is down) from DMA, the total number of rx descriptor
goes down and at one instance all the descriptor is lost and both the
interface stops working.
To recover from this we need to put down both the interface and open the
interface which will re-init the DMA which intern queues fresh set of
skbs for rx.
So to overcome this issue, I did this fix by re-queuing the rx
descriptor back to DMA when any one interface is so that the no of rx
descriptor is kept constant always.
Regards
Mugunthan V N
^ permalink raw reply
* Re: [PATCH net-next 2/2] net: exit busy loop when another process is runnable
From: Michael S. Tsirkin @ 2014-09-02 8:31 UTC (permalink / raw)
To: Eliezer Tamir
Cc: Jason Wang, Ingo Molnar, Mike Galbraith, davem, netdev,
linux-kernel, Peter Zijlstra, Ingo Molnar
In-Reply-To: <54056076.2030603@linux.intel.com>
On Tue, Sep 02, 2014 at 09:15:18AM +0300, Eliezer Tamir wrote:
> On 02/09/2014 06:29, Jason Wang wrote:
> > On 09/01/2014 02:39 PM, Eliezer Tamir wrote:
> >> On 29/08/2014 06:08, Jason Wang wrote:
> >>>> Yes, but rx busy polling only works in process context and does not
> >>>> disable bh, so it may be not an issue.
> >> sk_busy_loop() uses rcu_read_lock_bh(), so it does run with bh disabled.
> >
> > True, so we need probably also exit the loop when there are pending bhs.
>
> I'm not so sure, in the typical busy poll scenario, the incoming
> traffic is the most time-critical thing in the system.
> It's so important that you are willing to trade lots of CPU power
> for better latency. The user has decided that he wants to dedicate
> this CPU mostly for that. This is not something that plays nice with
> other apps, but this is what the user wants.
I think most applications wouldn't interpret this flag as "burn up CPU I don't
care what is the result", what apps want is more of "maximise throughput
and minimise latency even if throughput/CPU ratio goes down".
Jason posted benchmarks that show throughput going up because other
processes get more of a chance to run, so this seems consistent
with that goal.
> So, you definitely don't want to starve any bh, and you should
> regularly re-enable bh's, but you also don't want to stop everything
> at any time a bh is scheduled.
>
> You also want network processing on the queues that are busy polled
> to come through busy polling and not through NAPI, which is run in bh
> context.
>
> -Eliezer
^ permalink raw reply
* Re: [PATCH 1/2] ipv6: add sysctl_mld_qrv to configure query robustness variable
From: Hannes Frederic Sowa @ 2014-09-02 9:32 UTC (permalink / raw)
To: Flavio Leitner; +Cc: netdev
In-Reply-To: <20140902000554.GA7909@t520.home>
Hi Flavio,
On Mo, 2014-09-01 at 21:05 -0300, Flavio Leitner wrote:
> Hi Hannes,
>
> On Mon, Sep 01, 2014 at 09:55:34PM +0200, Hannes Frederic Sowa wrote:
> > This patch adds a new sysctl_mld_qrv knob to configure the mldv1/v2 query
> > robustness variable. It specifies how many retransmit of unsolicited mld
> > retransmit should happen. Admins might want to tune this on lossy links.
> >
> > Also reset mld state on interface down/up, so we pick up new sysctl
> > settings during interface up event.
> >
> > IPv6 certification requests this knob to be available.
> >
> > I didn't make this knob netns specific, as it is mostly a setting in a
> > physical environment and should be per host.
> >
> > Cc: Flavio Leitner <fbl@redhat.com>
> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> > ---
> > v2) no changes to original version
> >
> > Documentation/networking/ip-sysctl.txt | 3 +++
> > include/net/ipv6.h | 1 +
> > net/ipv6/mcast.c | 20 ++++++++++++--------
> > net/ipv6/sysctl_net_ipv6.c | 10 ++++++++++
> > 4 files changed, 26 insertions(+), 8 deletions(-)
> >
> > diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
> > index 3cce8ea..b7fe844 100644
> > --- a/Documentation/networking/ip-sysctl.txt
> > +++ b/Documentation/networking/ip-sysctl.txt
> > @@ -1152,6 +1152,9 @@ anycast_src_echo_reply - BOOLEAN
> > FALSE: disabled
> > Default: FALSE
> >
> > +mld_qrv - INTEGER
> > + Controls the MLD query robustness variable (see RFC3810 9.1).
> > +
> > IPv6 Fragmentation:
> >
> > ip6frag_high_thresh - INTEGER
> > diff --git a/include/net/ipv6.h b/include/net/ipv6.h
> > index a2db816..7e247e9 100644
> > --- a/include/net/ipv6.h
> > +++ b/include/net/ipv6.h
> > @@ -121,6 +121,7 @@ struct frag_hdr {
> >
> > /* sysctls */
> > extern int sysctl_mld_max_msf;
> > +extern int sysctl_mld_qrv;
> >
> > #define _DEVINC(net, statname, modifier, idev, field) \
> > ({ \
> > diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
> > index 7088179..6efb0e5 100644
> > --- a/net/ipv6/mcast.c
> > +++ b/net/ipv6/mcast.c
> > @@ -121,6 +121,7 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
> > #define IPV6_MLD_MAX_MSF 64
> >
> > int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF;
> > +int sysctl_mld_qrv __read_mostly = MLD_QRV_DEFAULT;
> >
> > /*
> > * socket join on multicast group
> > @@ -1196,7 +1197,7 @@ static void mld_update_qrv(struct inet6_dev *idev,
> > if (mlh2->mld2q_qrv > 0)
> > idev->mc_qrv = mlh2->mld2q_qrv;
> >
> > - if (unlikely(idev->mc_qrv < 2)) {
> > + if (unlikely(idev->mc_qrv < MLD_QRV_DEFAULT)) {
> > net_warn_ratelimited("IPv6: MLD: clamping QRV from %u to %u!\n",
> > idev->mc_qrv, MLD_QRV_DEFAULT);
> > idev->mc_qrv = MLD_QRV_DEFAULT;
>
> You allow the sysctl to be 1, but here it is limited to 2?
I wanted to keep limiting the remotely set value to at least 2.
Is this more reasonable?
const int min_qrv = min(MLD_QRV_DEFAULT, sysctl_mld_qrv);
if (unlikely(idev->mc_qrv < min_qrv)) {
net_warn_ratelimited(...);
idev->mc_qrv = min_qrv;
}
> > @@ -2478,6 +2479,14 @@ void ipv6_mc_down(struct inet6_dev *idev)
> > mld_clear_delrec(idev);
> > }
> >
> > +static void ipv6_mc_reset(struct inet6_dev *idev)
> > +{
> > + idev->mc_qrv = sysctl_mld_qrv;
> > + idev->mc_qi = MLD_QI_DEFAULT;
> > + idev->mc_qri = MLD_QRI_DEFAULT;
> > + idev->mc_v1_seen = 0;
> > + idev->mc_maxdelay = unsolicited_report_interval(idev);
> > +}
> >
> > /* Device going up */
> >
> > @@ -2488,6 +2497,7 @@ void ipv6_mc_up(struct inet6_dev *idev)
> > /* Install multicast list, except for all-nodes (already installed) */
> >
> > read_lock_bh(&idev->lock);
> > + ipv6_mc_reset(idev);
>
> ok, up and down the interface to get the sysctl value applied.
>
> > for (i = idev->mc_list; i; i = i->next)
> > igmp6_group_added(i);
> > read_unlock_bh(&idev->lock);
> > @@ -2508,13 +2518,7 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
> > (unsigned long)idev);
> > setup_timer(&idev->mc_dad_timer, mld_dad_timer_expire,
> > (unsigned long)idev);
> > -
> > - idev->mc_qrv = MLD_QRV_DEFAULT;
> > - idev->mc_qi = MLD_QI_DEFAULT;
> > - idev->mc_qri = MLD_QRI_DEFAULT;
> > -
> > - idev->mc_maxdelay = unsolicited_report_interval(idev);
> > - idev->mc_v1_seen = 0;
> > + ipv6_mc_reset(idev);
>
> looks good to me.
>
>
> > write_unlock_bh(&idev->lock);
> > }
> >
> > diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
> > index 0c56c93..c5c10fa 100644
> > --- a/net/ipv6/sysctl_net_ipv6.c
> > +++ b/net/ipv6/sysctl_net_ipv6.c
> > @@ -16,6 +16,8 @@
> > #include <net/addrconf.h>
> > #include <net/inet_frag.h>
> >
> > +static int one = 1;
> > +
>
> Although that can be reused later for other purposes, it's nice to
> have a comment telling where that value came from. Since you have
> defined MLD_QRV_DEFAULT, it helps. Still I didn't know about
> rfc6636#section-4.5, so I'd appreciate if you include that info
> either in ip-sysctl.txt or close to MLD_QRV_DEFAULT.
I think ip-sysctl.txt is a good place, do you agree?
> E.g.:
>
> /* See RFC3810 9.1 and rfc6636 4.5 */
> +int sysctl_mld_qrv __read_mostly = MLD_QRV_DEFAULT;
>
> Actually, maybe that int could be something not specific to ipv6
> because I believe there are more users of the same thing. That's ok,
> just a comment and it's not part of this patch.
Sorry, I did not understand that. ;)
Do you propose to use one sysctl variable for igmp and mld?
Bye,
Hannes
^ permalink raw reply
* Re: [RFC] net: ipv4: drop unicast encapsulated in L2 multicast
From: Johannes Berg @ 2014-09-02 9:33 UTC (permalink / raw)
To: Julian Anastasov; +Cc: David Miller, linux-wireless, netdev
In-Reply-To: <alpine.LFD.2.11.1408271625500.2348@ja.home.ssi.bg>
On Wed, 2014-08-27 at 17:31 +0300, Julian Anastasov wrote:
> > All IP protocols, this comes either from the IPv4 RFC (1122) or from the
> > wireless issue which affects all protocols.
>
> I did a grep for inet_add_protocol, in case if
> we prefer to use per-protocol checks:
>
> Protocols that look ok to me: TCP, SCTP, DCCP
>
> ICMP: missing check in icmp_rcv
> UDP, UDPLITE: need check in __udp4_lib_rcv
> IGMP: uses only multicast address?
> PIM: not sure if __pim_rcv() needs check, before skb_tunnel_rx()
> changes pkt_type?
>
> More protocols are also registered with inet_add_protocol(), I don't
> see pkt_type checks there, mostly tunnels:
> - IPPROTO_GRE
> - IPPROTO_L2TP
> - IPPROTO_IPIP
> - IPPROTO_IPV6 (tunnel64_rcv)
>
> If going to use a global check I hope there are
> no protocols that require exception to this rule.
Yeah that's the big question. Are you saying that TCP already implements
this? But I guess for TCP it's least interesting in a sense? Not really
sure.
I'd feel better implementing it at the IP level though, since it's a
fairly low-level requirement and also RFC 1122 is on the IP level
(obviously)
johannes
^ permalink raw reply
* Re: question about drivers/net/ethernet/ti/cpsw.c
From: Daniel Mack @ 2014-09-02 9:34 UTC (permalink / raw)
To: David Miller, julia.lawall; +Cc: netdev
In-Reply-To: <20140901.181101.2132157946809255487.davem@davemloft.net>
On 09/02/2014 03:11 AM, David Miller wrote:
> From: Julia Lawall <julia.lawall@lip6.fr>
> Date: Thu, 28 Aug 2014 21:26:55 +0200 (CEST)
>
>> I wonder if the following patch:
>>
>> commit aa1a15e2d9199711cdcc9399fdb22544ab835a83
>> Author: Daniel Mack <zonque@gmail.com>
>> Date: Sat Sep 21 00:50:38 2013 +0530
>>
>> introduced a race condition in drivers/net/ethernet/ti/cpsw.c. I was
>> looking at an old version of the file (Linux 3.10), and it has
>>
>> clean_irq_ret:
>> for (i = 0; i < priv->num_irqs; i++)
>> free_irq(priv->irqs_table[i], priv);
>>
>> at the beginning of the cleanup code of the probe function (cpsw_probe).
>> The above patch replaces request_irq by devm_request_irq and gets rid of
>> the above cleanup code. But that moves the stopping of the interrupts
>> after the following code at the end of the function:
>>
>> free_netdev(priv->ndev);
>>
>> The interrupt handler (cpsw_interrupt) does reference priv->ndev:
>>
>> if (netif_running(priv->ndev)) {
>> napi_schedule(&priv->napi);
>> return IRQ_HANDLED;
>> }
>>
>> so perhaps this could be a problem. The same happens in the remove
>> function.
>
> It could definitely be a problem.
>
> Probably it would be better for this device to request IRQs in open
> and release them in close like so many other networking drivers do.
Thanks for spotting this, Julia!
I'll be working on a fix for this as soon as I can.
Best regards,
Daniel
^ permalink raw reply
* Re: [RFC] net: ipv4: drop unicast encapsulated in L2 multicast
From: Johannes Berg @ 2014-09-02 9:36 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: linux-wireless, netdev
In-Reply-To: <1409133238.26515.13.camel@localhost>
On Wed, 2014-08-27 at 11:53 +0200, Hannes Frederic Sowa wrote:
> > I don't know if that's really useful? OTOH, there surely must have been
> > a reason for this to be in the IPv4 RFC, so maybe for that same reason
> > it should also be in the IPv6 RFC?
>
> Either it is an oversight, but RFC6085 3) tries to at least clarify the
> multicast destination with LL unicast address. So there must have been
> people trying to enfore a relationship between LL address and IPv6 one.
That seems to allow a multicast IPv6 frame in a unicast LL address,
which is a different situation but still ...
> I think it would be OK to drop it by default in case we don't break any
> other assumptions in the stack (e.g. CLUSTERIP).
Fair enough.
> > The question now is, in the absence of such a latter required check (and
> > indeed, in the case of CLUSTERIP), how we implement such a check.
> > Perhaps a sysctl is needed after all?
>
> Yeah, unfortunate situation.
>
> One could add those IP addresses as broadcast addresses (/32) to the
> routing table, so the brd_input jump would be taken.
>
> But this would still break users of CLUSTERIP until they install those
> routes. :(
I'm not even sure I understand this part :)
Any suggestions?
As long as IPv6 doesn't mandate it in the RFCs I'm not really sure we
should just drop it, even if we think it won't cause any problems?
CLUSTERIP seems like a special configuration, but I'm not sure it can be
detected and automatically allowed?
johannes
^ permalink raw reply
* [PATCH net-next 0/6] Simplify Intel Wired LAN driver init/exit routine
From: Jean Sacren @ 2014-09-02 9:36 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: e1000-devel, netdev, linux.nics
This series uses module_pci_driver() to simplify the init/exit
routine of some Intel Wired LAN drivers.
Jean Sacren (6):
ixgb: remove the boilerplate of ixgb module for init/exit
ixgbevf: remove the boilerplate of ixgbevf module for init/exit
e100: remove the boilerplate of e100 module for init/exit
igbvf: remove the boilerplate of igbvf module for init/exit
e1000e: remove the boilerplate of e1000e module for init/exit
i40evf: remove the boilerplate of i40evf module for init/exit
drivers/net/ethernet/intel/e100.c | 22 ++++---------
drivers/net/ethernet/intel/e1000e/netdev.c | 35 +++-----------------
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 37 +++------------------
drivers/net/ethernet/intel/igbvf/netdev.c | 35 +++-----------------
drivers/net/ethernet/intel/ixgb/ixgb_main.c | 39 +++--------------------
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 38 ++++------------------
6 files changed, 32 insertions(+), 174 deletions(-)
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* [PATCH net-next 1/6] ixgb: remove the boilerplate of ixgb module for init/exit
From: Jean Sacren @ 2014-09-02 9:36 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: e1000-devel, netdev, linux.nics
Use module_pci_driver() to simplify ixgb driver module init/exit
routine.
After the change, the basic driver info doesn't print unless the
pertinent hardware is present. Printing such info generally
pronounces the presence of the hardware and it should be part of the
probe routine. Blindly printing not only clutters the console, but
also incurs unnecessary confusion.
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
drivers/net/ethernet/intel/ixgb/ixgb_main.c | 39 ++++-------------------------
1 file changed, 5 insertions(+), 34 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index 055961b0f24b..339e1535482e 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -70,8 +70,6 @@ static const struct pci_device_id ixgb_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, ixgb_pci_tbl);
/* Local Function Prototypes */
-static int ixgb_init_module(void);
-static void ixgb_exit_module(void);
static int ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
static void ixgb_remove(struct pci_dev *pdev);
static int ixgb_sw_init(struct ixgb_adapter *adapter);
@@ -141,38 +139,7 @@ static int debug = -1;
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
-/**
- * ixgb_init_module - Driver Registration Routine
- *
- * ixgb_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- **/
-
-static int __init
-ixgb_init_module(void)
-{
- pr_info("%s - version %s\n", ixgb_driver_string, ixgb_driver_version);
- pr_info("%s\n", ixgb_copyright);
-
- return pci_register_driver(&ixgb_driver);
-}
-
-module_init(ixgb_init_module);
-
-/**
- * ixgb_exit_module - Driver Exit Cleanup Routine
- *
- * ixgb_exit_module is called just before the driver is removed
- * from memory.
- **/
-
-static void __exit
-ixgb_exit_module(void)
-{
- pci_unregister_driver(&ixgb_driver);
-}
-
-module_exit(ixgb_exit_module);
+module_pci_driver(ixgb_driver);
/**
* ixgb_irq_disable - Mask off interrupt generation on the NIC
@@ -403,6 +370,10 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
int i;
int err;
+ pr_info_once("%s - version %s\n",
+ ixgb_driver_string, ixgb_driver_version);
+ pr_info_once("%s\n", ixgb_copyright);
+
err = pci_enable_device(pdev);
if (err)
return err;
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH net-next 2/6] ixgbevf: remove the boilerplate of ixgbevf module for init/exit
From: Jean Sacren @ 2014-09-02 9:36 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: e1000-devel, netdev, linux.nics
Use module_pci_driver() to simplify ixgbevf driver module init/exit
routine.
After the change, the basic driver info doesn't print unless the
pertinent hardware is present. Printing such info generally
pronounces the presence of the hardware and it should be part of the
probe routine. Blindly printing not only clutters the console, but
also incurs unnecessary confusion.
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 38 ++++-------------------
1 file changed, 6 insertions(+), 32 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index c22a00c3621a..e93b4d2a17f8 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -3467,6 +3467,10 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
static int cards_found;
int err, pci_using_dac;
+ pr_info_once("%s - version %s\n",
+ ixgbevf_driver_string, ixgbevf_driver_version);
+ pr_info_once("%s\n", ixgbevf_copyright);
+
err = pci_enable_device(pdev);
if (err)
return err;
@@ -3761,37 +3765,6 @@ static struct pci_driver ixgbevf_driver = {
.err_handler = &ixgbevf_err_handler
};
-/**
- * ixgbevf_init_module - Driver Registration Routine
- *
- * ixgbevf_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- **/
-static int __init ixgbevf_init_module(void)
-{
- int ret;
- pr_info("%s - version %s\n", ixgbevf_driver_string,
- ixgbevf_driver_version);
-
- pr_info("%s\n", ixgbevf_copyright);
-
- ret = pci_register_driver(&ixgbevf_driver);
- return ret;
-}
-
-module_init(ixgbevf_init_module);
-
-/**
- * ixgbevf_exit_module - Driver Exit Cleanup Routine
- *
- * ixgbevf_exit_module is called just before the driver is removed
- * from memory.
- **/
-static void __exit ixgbevf_exit_module(void)
-{
- pci_unregister_driver(&ixgbevf_driver);
-}
-
#ifdef DEBUG
/**
* ixgbevf_get_hw_dev_name - return device name string
@@ -3804,6 +3777,7 @@ char *ixgbevf_get_hw_dev_name(struct ixgbe_hw *hw)
}
#endif
-module_exit(ixgbevf_exit_module);
+
+module_pci_driver(ixgbevf_driver);
/* ixgbevf_main.c */
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH net-next 3/6] e100: remove the boilerplate of e100 module for init/exit
From: Jean Sacren @ 2014-09-02 9:36 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: e1000-devel, netdev, linux.nics
Use module_pci_driver() to simplify e100 driver module init/exit
routine.
After the change, the basic driver info doesn't print unless the
pertinent hardware is present. Printing such info generally
pronounces the presence of the hardware and it should be part of the
probe routine. Blindly printing not only clutters the console, but
also incurs unnecessary confusion.
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
drivers/net/ethernet/intel/e100.c | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 781065eb5431..8b95129fcf91 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -2846,6 +2846,11 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct nic *nic;
int err;
+ if (((1 << debug) - 1) & NETIF_MSG_DRV) {
+ pr_info_once("%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
+ pr_info_once("%s\n", DRV_COPYRIGHT);
+ }
+
if (!(netdev = alloc_etherdev(sizeof(struct nic))))
return -ENOMEM;
@@ -3184,19 +3189,4 @@ static struct pci_driver e100_driver = {
.err_handler = &e100_err_handler,
};
-static int __init e100_init_module(void)
-{
- if (((1 << debug) - 1) & NETIF_MSG_DRV) {
- pr_info("%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
- pr_info("%s\n", DRV_COPYRIGHT);
- }
- return pci_register_driver(&e100_driver);
-}
-
-static void __exit e100_cleanup_module(void)
-{
- pci_unregister_driver(&e100_driver);
-}
-
-module_init(e100_init_module);
-module_exit(e100_cleanup_module);
+module_pci_driver(e100_driver);
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH net-next 4/6] igbvf: remove the boilerplate of igbvf module for init/exit
From: Jean Sacren @ 2014-09-02 9:36 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: e1000-devel, netdev, linux.nics
Use module_pci_driver() to simplify igbvf driver module init/exit
routine.
After the change, the basic driver info doesn't print unless the
pertinent hardware is present. Printing such info generally
pronounces the presence of the hardware and it should be part of the
probe routine. Blindly printing not only clutters the console, but
also incurs unnecessary confusion.
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
drivers/net/ethernet/intel/igbvf/netdev.c | 35 +++++--------------------------
1 file changed, 5 insertions(+), 30 deletions(-)
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 63c807c9b21c..f3b4d7f676f1 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2630,6 +2630,10 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
static int cards_found;
int err, pci_using_dac;
+ pr_info_once("%s - version %s\n",
+ igbvf_driver_string, igbvf_driver_version);
+ pr_info_once("%s\n", igbvf_copyright);
+
err = pci_enable_device_mem(pdev);
if (err)
return err;
@@ -2875,36 +2879,7 @@ static struct pci_driver igbvf_driver = {
.err_handler = &igbvf_err_handler
};
-/**
- * igbvf_init_module - Driver Registration Routine
- *
- * igbvf_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- **/
-static int __init igbvf_init_module(void)
-{
- int ret;
- pr_info("%s - version %s\n", igbvf_driver_string, igbvf_driver_version);
- pr_info("%s\n", igbvf_copyright);
-
- ret = pci_register_driver(&igbvf_driver);
-
- return ret;
-}
-module_init(igbvf_init_module);
-
-/**
- * igbvf_exit_module - Driver Exit Cleanup Routine
- *
- * igbvf_exit_module is called just before the driver is removed
- * from memory.
- **/
-static void __exit igbvf_exit_module(void)
-{
- pci_unregister_driver(&igbvf_driver);
-}
-module_exit(igbvf_exit_module);
-
+module_pci_driver(igbvf_driver);
MODULE_AUTHOR("Intel Corporation, <e1000-devel@lists.sourceforge.net>");
MODULE_DESCRIPTION("Intel(R) Gigabit Virtual Function Network Driver");
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH net-next 5/6] e1000e: remove the boilerplate of e1000e module for init/exit
From: Jean Sacren @ 2014-09-02 9:36 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: e1000-devel, netdev, linux.nics
Use module_pci_driver() to simplify e1000e driver module init/exit
routine.
After the change, the basic driver info doesn't print unless the
pertinent hardware is present. Printing such info generally
pronounces the presence of the hardware and it should be part of the
probe routine. Blindly printing not only clutters the console, but
also incurs unnecessary confusion.
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 35 +++++-------------------------
1 file changed, 5 insertions(+), 30 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 65c3aef2bd36..1b5f99028ac6 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6741,6 +6741,10 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
u16 eeprom_apme_mask = E1000_EEPROM_APME;
s32 rval = 0;
+ pr_info_once("Intel(R) PRO/1000 Network Driver - %s\n",
+ e1000e_driver_version);
+ pr_info_once("Copyright(c) 1999 - 2014 Intel Corporation.\n");
+
if (ei->flags2 & FLAG2_DISABLE_ASPM_L0S)
aspm_disable_flag = PCIE_LINK_STATE_L0S;
if (ei->flags2 & FLAG2_DISABLE_ASPM_L1)
@@ -7249,36 +7253,7 @@ static struct pci_driver e1000_driver = {
.err_handler = &e1000_err_handler
};
-/**
- * e1000_init_module - Driver Registration Routine
- *
- * e1000_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- **/
-static int __init e1000_init_module(void)
-{
- int ret;
-
- pr_info("Intel(R) PRO/1000 Network Driver - %s\n",
- e1000e_driver_version);
- pr_info("Copyright(c) 1999 - 2014 Intel Corporation.\n");
- ret = pci_register_driver(&e1000_driver);
-
- return ret;
-}
-module_init(e1000_init_module);
-
-/**
- * e1000_exit_module - Driver Exit Cleanup Routine
- *
- * e1000_exit_module is called just before the driver is removed
- * from memory.
- **/
-static void __exit e1000_exit_module(void)
-{
- pci_unregister_driver(&e1000_driver);
-}
-module_exit(e1000_exit_module);
+module_pci_driver(e1000_driver);
MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH net-next 6/6] i40evf: remove the boilerplate of i40evf module for init/exit
From: Jean Sacren @ 2014-09-02 9:36 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: e1000-devel, netdev, linux.nics
Use module_pci_driver() to simplify i40evf driver module init/exit
routine.
After the change, the basic driver info doesn't print unless the
pertinent hardware is present. Printing such info generally
pronounces the presence of the hardware and it should be part of the
probe routine. Blindly printing not only clutters the console, but
also incurs unnecessary confusion.
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 37 ++++---------------------
1 file changed, 5 insertions(+), 32 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 38429fae4fcf..e577b1c6dcab 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2255,6 +2255,10 @@ static int i40evf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct i40e_hw *hw = NULL;
int err;
+ pr_info_once("i40evf: %s - version %s\n",
+ i40evf_driver_string, i40evf_driver_version);
+ pr_info_once("%s\n", i40evf_copyright);
+
err = pci_enable_device(pdev);
if (err)
return err;
@@ -2491,37 +2495,6 @@ static struct pci_driver i40evf_driver = {
.shutdown = i40evf_shutdown,
};
-/**
- * i40e_init_module - Driver Registration Routine
- *
- * i40e_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- **/
-static int __init i40evf_init_module(void)
-{
- int ret;
- pr_info("i40evf: %s - version %s\n", i40evf_driver_string,
- i40evf_driver_version);
-
- pr_info("%s\n", i40evf_copyright);
-
- ret = pci_register_driver(&i40evf_driver);
- return ret;
-}
-
-module_init(i40evf_init_module);
-
-/**
- * i40e_exit_module - Driver Exit Cleanup Routine
- *
- * i40e_exit_module is called just before the driver is removed
- * from memory.
- **/
-static void __exit i40evf_exit_module(void)
-{
- pci_unregister_driver(&i40evf_driver);
-}
-
-module_exit(i40evf_exit_module);
+module_pci_driver(i40evf_driver);
/* i40evf_main.c */
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* Re: [PATCH] net: calxedaxgmac: fix driver dependencies
From: Bartlomiej Zolnierkiewicz @ 2014-09-02 9:51 UTC (permalink / raw)
To: Rob Herring
Cc: David S. Miller, Kyungmin Park, netdev,
linux-kernel@vger.kernel.org
In-Reply-To: <CAL_JsqJV0rJ_PCLBsZNYdYdbER7UR_MV40BGjpykh7uubLh__g@mail.gmail.com>
Hi,
On Monday, September 01, 2014 09:36:39 PM Rob Herring wrote:
> On Mon, Sep 1, 2014 at 10:39 AM, Bartlomiej Zolnierkiewicz
> <b.zolnierkie@samsung.com> wrote:
> > Calxeda 1G/10G XGMAC Ethernet support should be available only on
> > Calxeda ECX-1000/2000 (Highbank/Midway) platforms.
> >
> > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
> > Cc: Rob Herring <robh@kernel.org>
> > ---
> > drivers/net/ethernet/calxeda/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > Index: b/drivers/net/ethernet/calxeda/Kconfig
> > ===================================================================
> > --- a/drivers/net/ethernet/calxeda/Kconfig 2014-07-30 14:31:12.159522474 +0200
> > +++ b/drivers/net/ethernet/calxeda/Kconfig 2014-09-01 17:33:49.232810483 +0200
> > @@ -1,6 +1,7 @@
> > config NET_CALXEDA_XGMAC
> > tristate "Calxeda 1G/10G XGMAC Ethernet driver"
> > depends on HAS_IOMEM && HAS_DMA
> > + depends on ARCH_HIGHBANK || COMPILE_TEST
>
> Opinions differ on whether drivers should be restricted in this way.
> There is no actual dependency requiring ARCH_HIGHBANK. So I leave it
> to David.
The hardware is specific to ARCH_HIGHBANK and it is just unavailble on
any other platform (i.e. I have completely no use for this option on
ARM Exynos platform). In such cases we restrict drivers to the specific
hardware platform so they don't pollute configs for other platforms
(i.e. this option is enabled by default in multi_v7_defconfig and once
I go from multi defconfing to single platform one, the option stays
enabled).
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply
* [PATCH net-next 0/2] r8152: random MAC address
From: Hayes Wang @ 2014-09-02 9:55 UTC (permalink / raw)
To: netdev; +Cc: nic_swsd, linux-kernel, linux-usb
If the interface has invalid MAC address, it couldn't
be used. In order to let it work normally, give a
random one.
Hayes Wang (2):
r8152: change the location of rtl8152_set_mac_address
r8152: use eth_hw_addr_random
drivers/net/usb/r8152.c | 65 ++++++++++++++++++++++++++++---------------------
1 file changed, 37 insertions(+), 28 deletions(-)
--
1.9.3
^ permalink raw reply
* [PATCH net-next 1/2] r8152: change the location of rtl8152_set_mac_address
From: Hayes Wang @ 2014-09-02 9:55 UTC (permalink / raw)
To: netdev; +Cc: nic_swsd, linux-kernel, linux-usb
In-Reply-To: <1394712342-15778-26-Taiwan-albertk@realtek.com>
Exchange the location of rtl8152_set_mac_address() and
set_ethernet_addr(). Then, the set_ethernet_addr() could
set the MAC address by calling rtl8152_set_mac_address()
later.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/usb/r8152.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 80b0179..b5ff933 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -975,6 +975,23 @@ void write_mii_word(struct net_device *netdev, int phy_id, int reg, int val)
static int
r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags);
+static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
+{
+ struct r8152 *tp = netdev_priv(netdev);
+ struct sockaddr *addr = p;
+
+ if (!is_valid_ether_addr(addr->sa_data))
+ return -EADDRNOTAVAIL;
+
+ memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+
+ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG);
+ pla_ocp_write(tp, PLA_IDR, BYTE_EN_SIX_BYTES, 8, addr->sa_data);
+ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
+
+ return 0;
+}
+
static inline void set_ethernet_addr(struct r8152 *tp)
{
struct net_device *dev = tp->netdev;
@@ -1003,23 +1020,6 @@ static inline void set_ethernet_addr(struct r8152 *tp)
}
}
-static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
-{
- struct r8152 *tp = netdev_priv(netdev);
- struct sockaddr *addr = p;
-
- if (!is_valid_ether_addr(addr->sa_data))
- return -EADDRNOTAVAIL;
-
- memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
-
- ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG);
- pla_ocp_write(tp, PLA_IDR, BYTE_EN_SIX_BYTES, 8, addr->sa_data);
- ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
-
- return 0;
-}
-
static void read_bulk_callback(struct urb *urb)
{
struct net_device *netdev;
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 2/2] r8152: use eth_hw_addr_random
From: Hayes Wang @ 2014-09-02 9:55 UTC (permalink / raw)
To: netdev; +Cc: nic_swsd, linux-kernel, linux-usb
In-Reply-To: <1394712342-15778-26-Taiwan-albertk@realtek.com>
If the hw doesn't have a valid MAC address, give a random one and
set it to the hw.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/usb/r8152.c | 39 ++++++++++++++++++++++++---------------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index b5ff933..2bc1b8d 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -992,32 +992,41 @@ static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
return 0;
}
-static inline void set_ethernet_addr(struct r8152 *tp)
+static int set_ethernet_addr(struct r8152 *tp)
{
struct net_device *dev = tp->netdev;
+ struct sockaddr sa;
int ret;
- u8 node_id[8] = {0};
if (tp->version == RTL_VER_01)
- ret = pla_ocp_read(tp, PLA_IDR, sizeof(node_id), node_id);
+ ret = pla_ocp_read(tp, PLA_IDR, 8, sa.sa_data);
else
- ret = pla_ocp_read(tp, PLA_BACKUP, sizeof(node_id), node_id);
+ ret = pla_ocp_read(tp, PLA_BACKUP, 8, sa.sa_data);
if (ret < 0) {
- netif_notice(tp, probe, dev, "inet addr fail\n");
+ netif_err(tp, probe, dev, "Get ether addr fail\n");
+ } else if (!is_valid_ether_addr(sa.sa_data)) {
+ netif_err(tp, probe, dev,
+ "Invalid ether addr %02x:%02x:%02x:%02x:%02x:%02x\n",
+ sa.sa_data[0], sa.sa_data[1], sa.sa_data[2],
+ sa.sa_data[3], sa.sa_data[4], sa.sa_data[5]);
+ eth_hw_addr_random(dev);
+ ether_addr_copy(sa.sa_data, dev->dev_addr);
+ ret = rtl8152_set_mac_address(dev, &sa);
+ netif_info(tp, probe, dev,
+ "Random ether addr %02x:%02x:%02x:%02x:%02x:%02x\n",
+ sa.sa_data[0], sa.sa_data[1], sa.sa_data[2],
+ sa.sa_data[3], sa.sa_data[4], sa.sa_data[5]);
} else {
- if (tp->version != RTL_VER_01) {
- ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR,
- CRWECR_CONFIG);
- pla_ocp_write(tp, PLA_IDR, BYTE_EN_SIX_BYTES,
- sizeof(node_id), node_id);
- ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR,
- CRWECR_NORAML);
- }
+ if (tp->version == RTL_VER_01)
+ ether_addr_copy(dev->dev_addr, sa.sa_data);
+ else
+ ret = rtl8152_set_mac_address(dev, &sa);
- memcpy(dev->dev_addr, node_id, dev->addr_len);
- memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
+ ether_addr_copy(dev->perm_addr, dev->dev_addr);
}
+
+ return ret;
}
static void read_bulk_callback(struct urb *urb)
--
1.9.3
^ permalink raw reply related
* Re: [PATCH net v2] ipv6: fix rtnl locking in setsockopt for anycast and multicast
From: Hannes Frederic Sowa @ 2014-09-02 10:07 UTC (permalink / raw)
To: Sabrina Dubroca
Cc: Cong Wang, Tommi Rantala, David S. Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy, netdev, LKML,
trinity, Dave Jones
In-Reply-To: <20140902082929.GA8483@kria>
On Di, 2014-09-02 at 10:29 +0200, Sabrina Dubroca wrote:
> Calling setsockopt with IPV6_JOIN_ANYCAST or IPV6_LEAVE_ANYCAST
> triggers the assertion in addrconf_join_solict()/addrconf_leave_solict()
>
> ipv6_sock_ac_join(), ipv6_sock_ac_drop(), ipv6_sock_ac_close() need to
> take RTNL before calling ipv6_dev_ac_inc/dec. Same thing with
> ipv6_sock_mc_join(), ipv6_sock_mc_drop(), ipv6_sock_mc_close() before
> calling ipv6_dev_mc_inc/dec.
>
> This patch moves ASSERT_RTNL() up a level in the call stack.
>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> Reported-by: Tommi Rantala <tt.rantala@gmail.com>
> ---
> As was said earlier, this should go in stable.
>
> v2:
> - based on net
> - keep dev_get_by_flags_rcu and RCU in ipv6_sock_ac_*
> - remove two ASSERT_RTNL() that are not necessary
>
> Thank you for your help, Hannes!
Thanks for fixing! ;)
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
^ 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