Netdev List
 help / color / mirror / Atom feed
* [PATCH][net-next] net: Use RCU_POINTER_INITIALIZER() to init static variable
From: Li RongQing @ 2019-02-25  2:43 UTC (permalink / raw)
  To: netdev

This pointer is RCU protected, so proper primitives should be used.

Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/sched/sch_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 38e5add14fab..7bcee8b8f803 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -559,7 +559,7 @@ struct Qdisc_ops noop_qdisc_ops __read_mostly = {
 };
 
 static struct netdev_queue noop_netdev_queue = {
-	.qdisc		=	&noop_qdisc,
+	RCU_POINTER_INITIALIZER(qdisc, &noop_qdisc),
 	.qdisc_sleeping	=	&noop_qdisc,
 };
 
-- 
2.16.2


^ permalink raw reply related

* [PATCH] ath9k: remove set but not used variable 'acq'
From: YueHaibing @ 2019-02-25  3:32 UTC (permalink / raw)
  To: QCA ath9k Development, Kalle Valo
  Cc: YueHaibing, linux-wireless, netdev, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/ath/ath9k/recv.c: In function 'ath_rx_count_airtime':
drivers/net/wireless/ath/ath9k/recv.c:1010:18: warning:
 variable 'acq' set but not used [-Wunused-but-set-variable]

It's not used after 89cea7493a34 ("ath9k: Switch to mac80211 TXQ scheduling
and airtime APIs"). Also remove related variables.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/wireless/ath/ath9k/recv.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 285a62d3019d..4e97f7f3b2a3 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1006,9 +1006,6 @@ static void ath_rx_count_airtime(struct ath_softc *sc,
 				 struct ath_rx_status *rs,
 				 struct sk_buff *skb)
 {
-	struct ath_node *an;
-	struct ath_acq *acq;
-	struct ath_vif *avp;
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(ah);
@@ -1019,7 +1016,7 @@ static void ath_rx_count_airtime(struct ath_softc *sc,
 	int phy;
 	u16 len = rs->rs_datalen;
 	u32 airtime = 0;
-	u8 tidno, acno;
+	u8 tidno;
 
 	if (!ieee80211_is_data(hdr->frame_control))
 		return;
@@ -1029,11 +1026,7 @@ static void ath_rx_count_airtime(struct ath_softc *sc,
 	sta = ieee80211_find_sta_by_ifaddr(sc->hw, hdr->addr2, NULL);
 	if (!sta)
 		goto exit;
-	an = (struct ath_node *) sta->drv_priv;
-	avp = (struct ath_vif *) an->vif->drv_priv;
 	tidno = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
-	acno = TID_TO_WME_AC(tidno);
-	acq = &avp->chanctx->acq[acno];
 
 	rxs = IEEE80211_SKB_RXCB(skb);




^ permalink raw reply related

* [RFC] nasty corner case in unix_dgram_sendmsg()
From: Al Viro @ 2019-02-25  3:51 UTC (permalink / raw)
  To: netdev

	Consider the following scenario: sendmsg() with explicit ->msg_name
on unconnected SOCK_DGRAM AF_UNIX socket finds the recepient just about to
die.  We go through
        sk_locked = 0;
        unix_state_lock(other);
restart_locked:
        err = -EPERM;
        if (!unix_may_send(sk, other))
                goto out_unlock;
OK, since other->peer is already NULL
        if (unlikely(sock_flag(other, SOCK_DEAD))) {
Yes, it is.
                /*
                 *      Check with 1003.1g - what should
                 *      datagram error
                 */
                unix_state_unlock(other);
no locks held now...
                sock_put(other);
... and there goes the last reference to other.  We get preempted (to make
the window wider - the race would still exist without preempt, but it
would be much harder to hit).

Memory that used to hold *other gets reused for another AF_UNIX socket,
which gets bound to the same address *and* another thread does connect()
to that address on our socket.  Now unix_peer(sk) is equal to other.
Our thread gets to run again, and
                if (!sk_locked)
                        unix_state_lock(sk);
grabs sk->lock
                err = 0;
                if (unix_peer(sk) == other) {
... yes, it is.  Not the same object, though
                        unix_peer(sk) = NULL;
... and it gets disconnected
                        unix_dgram_peer_wake_disconnect_wakeup(sk, other);

                        unix_state_unlock(sk);

                        unix_dgram_disconnected(sk, other);
... with receive queue purged.

AFAICS, that's bogus.  And easily prevented - all we need here is do
the first sock_put() *after* the "have we just found the peer dead?"
logics, avoiding the memory reuse.

Objections?

PS: unix_dgram_sendmsg() is really much too subtle for its own good -
AFAICS, it *does* avoid blocking operations under sk->lock, but proof
is considerably more complex than one would like it to be...  And
I'm still not convinced that no codepath in it could end up doing
something unpleasant to SOCK_SEQPACKET sockets ;-/

^ permalink raw reply

* [net v3 1/1] tipc: fix race condition causing hung sendto
From: Tung Nguyen @ 2019-02-25  3:57 UTC (permalink / raw)
  To: davem, netdev; +Cc: tipc-discussion
In-Reply-To: <20190221033121.4220-1-tung.q.nguyen@dektech.com.au>

When sending multicast messages via blocking socket,
if sending link is congested (tsk->cong_link_cnt is set to 1),
the sending thread will be put into sleeping state. However,
tipc_sk_filter_rcv() is called under socket spin lock but
tipc_wait_for_cond() is not. So, there is no guarantee that
the setting of tsk->cong_link_cnt to 0 in tipc_sk_proto_rcv() in
CPU-1 will be perceived by CPU-0. If that is the case, the sending
thread in CPU-0 after being waken up, will continue to see
tsk->cong_link_cnt as 1 and put the sending thread into sleeping
state again. The sending thread will sleep forever.

CPU-0                                | CPU-1
tipc_wait_for_cond()                 |
{                                    |
 // condition_ = !tsk->cong_link_cnt |
 while ((rc_ = !(condition_))) {     |
  ...                                |
  release_sock(sk_);                 |
  wait_woken();                      |
                                     | if (!sock_owned_by_user(sk))
                                     |  tipc_sk_filter_rcv()
                                     |  {
                                     |   ...
                                     |   tipc_sk_proto_rcv()
                                     |   {
                                     |    ...
                                     |    tsk->cong_link_cnt--;
                                     |    ...
                                     |    sk->sk_write_space(sk);
                                     |    ...
                                     |   }
                                     |   ...
                                     |  }
  sched_annotate_sleep();            |
  lock_sock(sk_);                    |
  remove_wait_queue();               |
 }                                   |
}                                    |

This commit fixes it by adding memory barrier to tipc_sk_proto_rcv()
and tipc_wait_for_cond().

Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
---
 net/tipc/socket.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 684f2125fc6b..70343ac448b1 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -379,11 +379,13 @@ static int tipc_sk_sock_err(struct socket *sock, long *timeout)
 
 #define tipc_wait_for_cond(sock_, timeo_, condition_)			       \
 ({                                                                             \
+	DEFINE_WAIT_FUNC(wait_, woken_wake_function);                          \
 	struct sock *sk_;						       \
 	int rc_;							       \
 									       \
 	while ((rc_ = !(condition_))) {					       \
-		DEFINE_WAIT_FUNC(wait_, woken_wake_function);	               \
+		/* coupled with smp_wmb() in tipc_sk_proto_rcv() */            \
+		smp_rmb();                                                     \
 		sk_ = (sock_)->sk;					       \
 		rc_ = tipc_sk_sock_err((sock_), timeo_);		       \
 		if (rc_)						       \
@@ -1983,6 +1985,8 @@ static void tipc_sk_proto_rcv(struct sock *sk,
 		return;
 	case SOCK_WAKEUP:
 		tipc_dest_del(&tsk->cong_links, msg_orignode(hdr), 0);
+		/* coupled with smp_rmb() in tipc_wait_for_cond() */
+		smp_wmb();
 		tsk->cong_link_cnt--;
 		wakeup = true;
 		break;
-- 
2.17.1


^ permalink raw reply related

* Re: [PATCH net-next v2 2/2] net: phy: aquantia: add hwmon support
From: Andrew Lunn @ 2019-02-25  4:02 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Heiner Kallweit, David Miller, netdev@vger.kernel.org
In-Reply-To: <5e9c1d9f-4c9f-10fd-439e-26f7f2cc467e@gmail.com>

On Sun, Feb 24, 2019 at 06:17:49PM -0800, Florian Fainelli wrote:
> Le 2/24/19 à 1:36 PM, Heiner Kallweit a écrit :
> > This adds HWMON support for the temperature sensor and the related
> > alarms on the 107/108/109 chips. This patch is based on work from
> > Nikita and Andrew. I added:
> > - support for changing alarm thresholds via sysfs
> > - move HWMON code to a separate source file to improve maintainability
> > - smaller changes like using IS_REACHABLE instead of ifdef
> >   (avoids problems if PHY driver is built in and HWMON is a module)
> > 
> > v2:
> > - remove struct aqr_priv
> > - rename header file to aquantia.h
> > 
> > Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
> 
> Should not Nikita be the author for that patch? Some minor nits below:
> 
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Hi Florian

The history is convoluted. I did the initial implementation, but at
the time i did not have the hardware. So it got passed to Nikita who
did. He made it actually work, and passed patches back. I then passed
it onto Heiner who has done all the work on the driver and core for
C45.

	Andrew

^ permalink raw reply

* [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled
From: Hangbin Liu @ 2019-02-25  4:12 UTC (permalink / raw)
  To: netdev; +Cc: Stefano Brivio, David S . Miller, David Ahern, Hangbin Liu

ipv6_mod_enabled() is more safe and gentle to check if ipv6 is disabled
at running time.

Fixes: 173656accaf5 ("sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach()")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/ipv6/sit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index e8a1dabef803..eea1f19985a7 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -546,7 +546,7 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
 	}
 
 	err = 0;
-	if (__in6_dev_get(skb->dev) &&
+	if (ipv6_mod_enabled() &&
 	    !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4, type, data_len))
 		goto out;
 
-- 
2.19.2


^ permalink raw reply related

* [PATCH net] geneve: use ipv6_mod_enabled to check if ipv6 is disabled
From: Hangbin Liu @ 2019-02-25  4:13 UTC (permalink / raw)
  To: netdev; +Cc: Stefano Brivio, David S . Miller, David Ahern, Hangbin Liu

ipv6_mod_enabled() is more safe and gentle to check if ipv6 is disabled
at running time.

Fixes: c0a47e44c098 ("geneve: should not call rt6_lookup() when ipv6 was disabled")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 drivers/net/geneve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 3377ac66a347..42c5e43ece68 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1514,7 +1514,7 @@ static void geneve_link_config(struct net_device *dev,
 	case AF_INET6: {
 		struct rt6_info *rt;
 
-		if (!__in6_dev_get(dev))
+		if (!ipv6_mod_enabled())
 			break;
 
 		rt = rt6_lookup(geneve->net, &info->key.u.ipv6.dst, NULL, 0,
-- 
2.19.2


^ permalink raw reply related

* Re: [PATCH net-next v2 0/7] net: phy: marvell10g: Add 2.5GBaseT support
From: David Miller @ 2019-02-25  1:45 UTC (permalink / raw)
  To: maxime.chevallier
  Cc: netdev, linux-kernel, andrew, f.fainelli, hkallweit1, linux,
	linux-arm-kernel, antoine.tenart, thomas.petazzoni,
	gregory.clement, miquel.raynal, nadavh, stefanc, mw
In-Reply-To: <20190222233744.25735-1-maxime.chevallier@bootlin.com>

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Sat, 23 Feb 2019 00:37:37 +0100

> This series adds the missing bits necessary to fully support 2.5GBaseT
> in the Marvell Alaska PHYs.
> 
> The main points for that support are :
> 
>  - Making use of the .get_features call, recently introduced by Heiner
>    and Andrew, that allows having a fully populated list of supported
>    modes, including 2500BaseT.  
> 
>  - Configuring the MII to 2500BaseX when establishing a link at 2.5G
> 
>  - Adding a small quirk to take into account the fact that some PHYs in
>    the family won't report the correct supported abilities
> 
> The rest of the series consists of small cosmetic improvements such as
> using the correct helper to set a linkmode bit and adding macros for the
> PHY ids.
> 
> We also add support for the 88E2110 PHY, which doesn't require the
> quirk, and support for 2500BaseT in the PPv2 driver, in order to have a
> fully working setup on the MacchiatoBin board.
> 
> Changes since V1 : Fixed formatting issue in patch 01, rebased.

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH v4 net-next 0/4] net: dsa: microchip: add MIB counters support
From: David Miller @ 2019-02-25  1:50 UTC (permalink / raw)
  To: Tristram.Ha
  Cc: sergio.paracuellos, andrew, f.fainelli, pavel, UNGLinuxDriver,
	netdev
In-Reply-To: <1550882211-10381-1-git-send-email-Tristram.Ha@microchip.com>

From: <Tristram.Ha@microchip.com>
Date: Fri, 22 Feb 2019 16:36:46 -0800

> This series of patches is to modify the KSZ9477 DSA driver to read MIB
> counters periodically to avoid overflow.

Series applied.

^ permalink raw reply

* Re: [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled
From: Eric Dumazet @ 2019-02-25  4:24 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: Stefano Brivio, David S . Miller, David Ahern
In-Reply-To: <20190225041243.9753-1-liuhangbin@gmail.com>



On 02/24/2019 08:12 PM, Hangbin Liu wrote:
> ipv6_mod_enabled() is more safe and gentle to check if ipv6 is disabled
> at running time.
> 


Why is it better exactly ?

IPv6 can be enabled on the host, but disabled per device

/proc/sys/net/ipv6/conf/{name}/disable_ipv6


> Fixes: 173656accaf5 ("sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach()")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  net/ipv6/sit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
> index e8a1dabef803..eea1f19985a7 100644
> --- a/net/ipv6/sit.c
> +++ b/net/ipv6/sit.c
> @@ -546,7 +546,7 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
>  	}
>  
>  	err = 0;
> -	if (__in6_dev_get(skb->dev) &&
> +	if (ipv6_mod_enabled() &&
>  	    !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4, type, data_len))
>  		goto out;
>  
> 

^ permalink raw reply

* Re: [PATCH net-next 00/15] mlxsw: spectrum_acl: Don't take rtnl mutex for region rehash
From: David Miller @ 2019-02-25  4:26 UTC (permalink / raw)
  To: idosch; +Cc: netdev, jiri, mlxsw
In-Reply-To: <20190224064525.14913-1-idosch@mellanox.com>

From: Ido Schimmel <idosch@mellanox.com>
Date: Sun, 24 Feb 2019 06:46:21 +0000

> Jiri says:
> 
> During region rehash, a new region is created with a more optimized set
> of masks (ERPs). When transitioning to the new region, all the rules
> from the old region are copied one-by-one to the new region. This
> transition can be time consuming and currently done under RTNL lock.
> 
> In order to remove RTNL lock dependency during region rehash, introduce
> multiple smaller locks guarding dedicated structures or parts of them.
> That is the vast majority of this patchset. Only patch #1 is simple
> cleanup and patches 12-15 are improving or introducing new selftests.

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] net/sched: act_tunnel_key: Add dst_cache support
From: David Miller @ 2019-02-25  5:52 UTC (permalink / raw)
  To: wenxu; +Cc: jhs, netdev
In-Reply-To: <1550822292-14980-1-git-send-email-wenxu@ucloud.cn>

From: wenxu@ucloud.cn
Date: Fri, 22 Feb 2019 15:58:12 +0800

> From: wenxu <wenxu@ucloud.cn>
> 
> The metadata_dst is not init the dst_cache which make the
> ip_md_tunnel_xmit can't use the dst_cache. It will lookup
> route table every packets.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>

Applied.

^ permalink raw reply

* Re: [PATCH] ila: Fix uninitialised return value in ila_xlat_nl_cmd_flush
From: David Miller @ 2019-02-25  5:55 UTC (permalink / raw)
  To: herbert
  Cc: dan.carpenter, kbuild, kbuild-all, linux-wireless, johannes.berg,
	netdev
In-Reply-To: <20190223053047.tiwcuvs6tcg2htie@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Sat, 23 Feb 2019 13:30:47 +0800

> This patch fixes an uninitialised return value error in
> ila_xlat_nl_cmd_flush.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: 6c4128f65857 ("rhashtable: Remove obsolete...")
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied, thanks Herbert.

^ permalink raw reply

* Re: [PATCH net-next v2 0/3] ipv4/v6: icmp: small cleanup and update
From: David Miller @ 2019-02-25  5:57 UTC (permalink / raw)
  To: wangkefeng.wang; +Cc: netdev, eric.dumazet
In-Reply-To: <20190223072828.159975-1-wangkefeng.wang@huawei.com>

From: Kefeng Wang <wangkefeng.wang@huawei.com>
Date: Sat, 23 Feb 2019 15:28:25 +0800

> v2:
> - Add cover letter and user proper patch subject-prefix suggested-by Eric Dumazet
> 
> This patch series contains some small cleanup and update,
> 1) use icmp/v6_sk_exit when icmp_sk_init fails instead of open-code
> 2) use new percpu allocation interface for the ipv6.icmp_sk

Series applied, thanks.

^ permalink raw reply

* Re: [PATCHv3 net-next] tls: Return type of non-data records retrieved using MSG_PEEK in recvmsg
From: David Miller @ 2019-02-25  5:59 UTC (permalink / raw)
  To: vakul.garg; +Cc: netdev, borisp, aviadye, davejwatson, doronrk
In-Reply-To: <20190223084010.17021-1-vakul.garg@nxp.com>

From: Vakul Garg <vakul.garg@nxp.com>
Date: Sat, 23 Feb 2019 08:42:37 +0000

> The patch enables returning 'type' in msghdr for records that are
> retrieved with MSG_PEEK in recvmsg. Further it prevents records peeked
> from socket from getting clubbed with any other record of different
> type when records are subsequently dequeued from strparser.
> 
> For each record, we now retain its type in sk_buff's control buffer
> cb[]. Inside control buffer, record's full length and offset are already
> stored by strparser in 'struct strp_msg'. We store record type after
> 'struct strp_msg' inside 'struct tls_msg'. For tls1.2, the type is
> stored just after record dequeue. For tls1.3, the type is stored after
> record has been decrypted.
> 
> Inside process_rx_list(), before processing a non-data record, we check
> that we must be able to return back the record type to the user
> application. If not, the decrypted records in tls context's rx_list is
> left there without consuming any data.
> 
> Fixes: 692d7b5d1f912 ("tls: Fix recvmsg() to be able to peek across
> multiple records")
> Signed-off-by: Vakul Garg <vakul.garg@nxp.com>

Applied, but please don't break up long Fixes: lines into multiple lines.
Always keep it all on one single line.

^ permalink raw reply

* RE: [PATCHv3 net-next] tls: Return type of non-data records retrieved using MSG_PEEK in recvmsg
From: Vakul Garg @ 2019-02-25  6:02 UTC (permalink / raw)
  To: David Miller
  Cc: netdev@vger.kernel.org, borisp@mellanox.com, aviadye@mellanox.com,
	davejwatson@fb.com, doronrk@fb.com
In-Reply-To: <20190224.215904.2270271071160812988.davem@davemloft.net>



> -----Original Message-----
> From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> Behalf Of David Miller
> Sent: Monday, February 25, 2019 11:29 AM
> To: Vakul Garg <vakul.garg@nxp.com>
> Cc: netdev@vger.kernel.org; borisp@mellanox.com;
> aviadye@mellanox.com; davejwatson@fb.com; doronrk@fb.com
> Subject: Re: [PATCHv3 net-next] tls: Return type of non-data records
> retrieved using MSG_PEEK in recvmsg
> 
> From: Vakul Garg <vakul.garg@nxp.com>
> Date: Sat, 23 Feb 2019 08:42:37 +0000
> 
> > The patch enables returning 'type' in msghdr for records that are
> > retrieved with MSG_PEEK in recvmsg. Further it prevents records peeked
> > from socket from getting clubbed with any other record of different
> > type when records are subsequently dequeued from strparser.
> >
> > For each record, we now retain its type in sk_buff's control buffer
> > cb[]. Inside control buffer, record's full length and offset are
> > already stored by strparser in 'struct strp_msg'. We store record type
> > after 'struct strp_msg' inside 'struct tls_msg'. For tls1.2, the type
> > is stored just after record dequeue. For tls1.3, the type is stored
> > after record has been decrypted.
> >
> > Inside process_rx_list(), before processing a non-data record, we
> > check that we must be able to return back the record type to the user
> > application. If not, the decrypted records in tls context's rx_list is
> > left there without consuming any data.
> >
> > Fixes: 692d7b5d1f912 ("tls: Fix recvmsg() to be able to peek across
> > multiple records")
> > Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
> 
> Applied, but please don't break up long Fixes: lines into multiple lines.
> Always keep it all on one single line.
 
I am sorry.
Since I fixed this problem in v3 patch, did you still find it?
I am confused.


^ permalink raw reply

* Re: [PATCH 0/3] soc: fsl: dpio: enable and configure cache stashing
From: David Miller @ 2019-02-25  6:06 UTC (permalink / raw)
  To: ioana.ciornei
  Cc: leoyang.li, roy.pledge, ruxandra.radulescu, laurentiu.tudor,
	horia.geanta, brouer, netdev, linux-kernel
In-Reply-To: <20190223084816.28985-1-ioana.ciornei@nxp.com>

From: Ioana Ciornei <ioana.ciornei@nxp.com>
Date: Sat, 23 Feb 2019 08:48:42 +0000

> The first two patches enable cache stashing and configure the core cluster
> destination per software portal while the third patch is the one
> configuring the amount of stashing on a queue.

Should I merge this series in via my networking tree?

Thanks.

^ permalink raw reply

* Re: [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver
From: David Miller @ 2019-02-25  6:10 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm
In-Reply-To: <1550913739-13232-1-git-send-email-tanhuazhong@huawei.com>

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Sat, 23 Feb 2019 17:22:07 +0800

> This patchset includes bugfixes and code optimizations for
> the HNS3 ethernet controller driver.

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH] tun: fix blocking read
From: David Miller @ 2019-02-25  6:12 UTC (permalink / raw)
  To: mail; +Cc: netdev, linux-kernel
In-Reply-To: <20190223115313.15064-1-mail@timurcelik.de>

From: Timur Celik <mail@timurcelik.de>
Date: Sat, 23 Feb 2019 12:53:13 +0100

> This patch moves setting of the current state into the loop. Otherwise
> the task may end up in a busy wait loop if none of the break conditions
> are met.
> 
> Signed-off-by: Timur Celik <mail@timurcelik.de>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCH net-next v4] ip_tunnel: Add dst_cache support in lwtunnel_state of ip tunnel
From: David Miller @ 2019-02-25  6:14 UTC (permalink / raw)
  To: wenxu; +Cc: netdev
In-Reply-To: <1550928774-20575-1-git-send-email-wenxu@ucloud.cn>

From: wenxu@ucloud.cn
Date: Sat, 23 Feb 2019 21:32:54 +0800

> From: wenxu <wenxu@ucloud.cn>
> 
> The lwtunnel_state is not init the dst_cache Which make the
> ip_md_tunnel_xmit can't use the dst_cache. It will lookup
> route table every packets.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>

Applied.

^ permalink raw reply

* [PATCH v3 2/2] drivers: net: phy: mdio-mux: Add support for Generic Mux controls
From: Pankaj Bansal @ 2019-02-25  6:16 UTC (permalink / raw)
  To: Leo Li, Peter Rosin, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit
  Cc: Pankaj Bansal, netdev@vger.kernel.org
In-Reply-To: <20190225114121.7878-1-pankaj.bansal@nxp.com>

Add support for Generic Mux controls, when Mdio mux node is a consumer
of mux produced by some other device.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
---

Notes:
    V3:
    - Avoid recast from platform_get_drvdata
    - Check mux_control_deselect output in switch_fn
    - rearrange swithc_fn code to reduce code indentation by one tab
    - Add do_deselect boolean in driver data to indicate that mux_control_deselect
      has to be called, becuase mux_control_select has been called once.
    V2:
    - Moved the changes from mdio-mux module to new module mdio-mux-multiplexer
    - defined new CONFIG
    - using new compatible "mdio-mux-multiplexer"

 drivers/net/phy/Kconfig                |  12 +++
 drivers/net/phy/Makefile               |   1 +
 drivers/net/phy/mdio-mux-multiplexer.c | 122 +++++++++++++++++++++++
 3 files changed, 135 insertions(+)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 3d187cd50eb0..7f66af446ec7 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -87,6 +87,18 @@ config MDIO_BUS_MUX_MMIOREG
 
 	  Currently, only 8/16/32 bits registers are supported.
 
+config MDIO_BUS_MUX_MULTIPLEXER
+	tristate "MDIO bus multiplexer using kernel multiplexer subsystem"
+	depends on OF
+	select MULTIPLEXER
+	select MDIO_BUS_MUX
+	help
+	  This module provides a driver for MDIO bus multiplexer
+	  that is controlled via the kernel multiplexer subsystem. The
+	  bus multiplexer connects one of several child MDIO busses to
+	  a parent bus.  Child bus selection is under the control of
+	  the kernel multiplexer subsystem.
+
 config MDIO_CAVIUM
 	tristate
 
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 5805c0b7d60e..766106237a90 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_MDIO_BUS_MUX)	+= mdio-mux.o
 obj-$(CONFIG_MDIO_BUS_MUX_BCM_IPROC)	+= mdio-mux-bcm-iproc.o
 obj-$(CONFIG_MDIO_BUS_MUX_GPIO)	+= mdio-mux-gpio.o
 obj-$(CONFIG_MDIO_BUS_MUX_MMIOREG) += mdio-mux-mmioreg.o
+obj-$(CONFIG_MDIO_BUS_MUX_MULTIPLEXER) += mdio-mux-multiplexer.o
 obj-$(CONFIG_MDIO_CAVIUM)	+= mdio-cavium.o
 obj-$(CONFIG_MDIO_GPIO)		+= mdio-gpio.o
 obj-$(CONFIG_MDIO_HISI_FEMAC)	+= mdio-hisi-femac.o
diff --git a/drivers/net/phy/mdio-mux-multiplexer.c b/drivers/net/phy/mdio-mux-multiplexer.c
new file mode 100644
index 000000000000..d6564381aa3e
--- /dev/null
+++ b/drivers/net/phy/mdio-mux-multiplexer.c
@@ -0,0 +1,122 @@
+// SPDX-License-Identifier: GPL-2.0+
+/* MDIO bus multiplexer using kernel multiplexer subsystem
+ *
+ * Copyright 2019 NXP
+ */
+
+#include <linux/platform_device.h>
+#include <linux/mdio-mux.h>
+#include <linux/module.h>
+#include <linux/mux/consumer.h>
+
+struct mdio_mux_multiplexer_state {
+	struct mux_control *muxc;
+	bool do_deselect;
+	void *mux_handle;
+};
+
+/**
+ * mdio_mux_multiplexer_switch_fn - This function is called by the mdio-mux
+ *                                  layer when it thinks the mdio bus
+ *                                  multiplexer needs to switch.
+ * @current_child:  current value of the mux register.
+ * @desired_child: value of the 'reg' property of the target child MDIO node.
+ * @data: Private data used by this switch_fn passed to mdio_mux_init function
+ *        via mdio_mux_init(.., .., .., .., data, ..).
+ *
+ * The first time this function is called, current_child == -1.
+ * If current_child == desired_child, then the mux is already set to the
+ * correct bus.
+ */
+static int mdio_mux_multiplexer_switch_fn(int current_child, int desired_child,
+					  void *data)
+{
+	struct platform_device *pdev;
+	struct mdio_mux_multiplexer_state *s;
+	int ret = 0;
+
+	pdev = (struct platform_device *)data;
+	s = platform_get_drvdata(pdev);
+
+	if (!(current_child ^ desired_child))
+		return 0;
+
+	if (s->do_deselect)
+		ret = mux_control_deselect(s->muxc);
+	if (ret) {
+		dev_err(&pdev->dev, "mux_control_deselect failed in %s: %d\n",
+			__func__, ret);
+		return ret;
+	}
+
+	ret =  mux_control_select(s->muxc, desired_child);
+	if (!ret) {
+		dev_dbg(&pdev->dev, "%s %d -> %d\n", __func__, current_child,
+			desired_child);
+		s->do_deselect = true;
+	} else {
+		s->do_deselect = false;
+	}
+
+	return ret;
+}
+
+static int mdio_mux_multiplexer_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct mdio_mux_multiplexer_state *s;
+	int ret = 0;
+
+	s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL);
+	if (!s)
+		return -ENOMEM;
+
+	s->muxc = devm_mux_control_get(dev, NULL);
+	if (IS_ERR(s->muxc)) {
+		ret = PTR_ERR(s->muxc);
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Failed to get mux: %d\n", ret);
+		return ret;
+	}
+
+	platform_set_drvdata(pdev, s);
+
+	ret = mdio_mux_init(&pdev->dev, pdev->dev.of_node,
+			    mdio_mux_multiplexer_switch_fn, &s->mux_handle,
+			    pdev, NULL);
+
+	return ret;
+}
+
+static int mdio_mux_multiplexer_remove(struct platform_device *pdev)
+{
+	struct mdio_mux_multiplexer_state *s = platform_get_drvdata(pdev);
+
+	mdio_mux_uninit(s->mux_handle);
+
+	if (s->do_deselect)
+		mux_control_deselect(s->muxc);
+
+	return 0;
+}
+
+static const struct of_device_id mdio_mux_multiplexer_match[] = {
+	{ .compatible = "mdio-mux-multiplexer", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mdio_mux_multiplexer_match);
+
+static struct platform_driver mdio_mux_multiplexer_driver = {
+	.driver = {
+		.name		= "mdio-mux-multiplexer",
+		.of_match_table	= mdio_mux_multiplexer_match,
+	},
+	.probe		= mdio_mux_multiplexer_probe,
+	.remove		= mdio_mux_multiplexer_remove,
+};
+
+module_platform_driver(mdio_mux_multiplexer_driver);
+
+MODULE_DESCRIPTION("MDIO bus multiplexer using kernel multiplexer subsystem");
+MODULE_AUTHOR("Pankaj Bansal <pankaj.bansal@nxp.com>");
+MODULE_LICENSE("GPL");
-- 
2.17.1


^ permalink raw reply related

* [PATCH v3 1/2] dt-bindings: net:  Add bindings for mdio mux consumers
From: Pankaj Bansal @ 2019-02-25  6:16 UTC (permalink / raw)
  To: Leo Li, Peter Rosin, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, Rob Herring, Mark Rutland
  Cc: Pankaj Bansal, devicetree@vger.kernel.org, netdev@vger.kernel.org

When we use the bindings defined in Documentation/devicetree/bindings/mux
to define mdio mux in producer and consumer terms, it results in two
devices. one is mux producer and other is mux consumer.

Add the bindings needed for Mdio mux consumer devices.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
---

Notes:
    V3:
    - No Change
    V2:
    - moved the bindings from mdio-mux.txt to new file mdio-mux-multiplexer.txt
    - changed compatible to mdio-mux-multiplexer

 .../bindings/net/mdio-mux-multiplexer.txt    | 83 ++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt b/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
new file mode 100644
index 000000000000..9d5384849929
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mdio-mux-multiplexer.txt
@@ -0,0 +1,83 @@
+Properties for an MDIO bus multiplexer consumer device
+
+This is a special case of MDIO mux  when MDIO mux is defined as a consumer
+of a mux producer device. The mux producer can be of any type like mmio mux
+producer, gpio mux producer or generic register based mux producer.
+
+Required properties in addition to the MDIO Bus multiplexer properties:
+
+- compatible : should be "mmio-mux-multiplexer"
+- mux-controls : mux controller node to use for operating the mux
+- mdio-parent-bus : phandle to the parent MDIO bus.
+
+each child node of mdio bus multiplexer consumer device represent a mdio
+bus.
+
+for more information please refer
+Documentation/devicetree/bindings/mux/mux-controller.txt
+and Documentation/devicetree/bindings/net/mdio-mux.txt
+
+Example:
+In below example the Mux producer and consumer are separate nodes.
+
+&i2c0 {
+	fpga@66 { // fpga connected to i2c
+		compatible = "fsl,lx2160aqds-fpga", "fsl,fpga-qixis-i2c",
+			     "simple-mfd";
+		reg = <0x66>;
+
+		mux: mux-controller { // Mux Producer
+			compatible = "reg-mux";
+			#mux-control-cells = <1>;
+			mux-reg-masks = <0x54 0xf8>, /* 0: reg 0x54, bits 7:3 */
+					<0x54 0x07>; /* 1: reg 0x54, bits 2:0 */
+		};
+	};
+};
+
+mdio-mux-1 { // Mux consumer
+	compatible = "mdio-mux-multiplexer";
+	mux-controls = <&mux 0>;
+	mdio-parent-bus = <&emdio1>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	mdio@0 {
+		reg = <0x0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	mdio@8 {
+		reg = <0x8>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	..
+	..
+};
+
+mdio-mux-2 { // Mux consumer
+	compatible = "mdio-mux-multiplexer";
+	mux-controls = <&mux 1>;
+	mdio-parent-bus = <&emdio2>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	mdio@0 {
+		reg = <0x0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	mdio@1 {
+		reg = <0x1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	..
+	..
+};
+
-- 
2.17.1


^ permalink raw reply related

* Re: [PATCH net-next 0/2] mv88e6xxx: Avoid false positive Lockdep splats
From: David Miller @ 2019-02-25  6:21 UTC (permalink / raw)
  To: andrew; +Cc: vivien.didelot, rmk+kernel, netdev
In-Reply-To: <20190223164357.17284-1-andrew@lunn.ch>

From: Andrew Lunn <andrew@lunn.ch>
Date: Sat, 23 Feb 2019 17:43:55 +0100

> When acquiring the GPIO interrupt line for the switch, it is possible
> to trigger lockdep splats. These are false positives, the mutex is in
> a different IRQ descriptor. But fix it anyway, since it could mask
> real locking issues.

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next v3] ip_tunnel: Add ip tunnel tun_info type dst_cache in ip_tunnel_xmit
From: David Miller @ 2019-02-25  6:25 UTC (permalink / raw)
  To: wenxu; +Cc: netdev
In-Reply-To: <1550967885-18628-1-git-send-email-wenxu@ucloud.cn>

From: wenxu@ucloud.cn
Date: Sun, 24 Feb 2019 08:24:45 +0800

> From: wenxu <wenxu@ucloud.cn>
> 
> ip l add dev tun type gretap key 1000
> 
> Non-tunnel-dst ip tunnel device can send packet through lwtunnel
> This patch provide the tun_inf dst cache support for this mode.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net: fix double-free in bpf_lwt_xmit_reroute
From: David Miller @ 2019-02-25  6:25 UTC (permalink / raw)
  To: posk; +Cc: netdev, posk
In-Reply-To: <20190224022501.71889-1-posk@google.com>

From: Peter Oskolkov <posk@google.com>
Date: Sat, 23 Feb 2019 18:25:01 -0800

> dst_output() frees skb when it fails (see, for example,
> ip_finish_output2), so it must not be freed in this case.
> 
> Fixes: 3bd0b15281af ("bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c")
> Signed-off-by: Peter Oskolkov <posk@google.com>

Applied.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox