Netdev List
 help / color / mirror / Atom feed
* [PATCH v3] net: introduce helper macro for_each_cmsghdr
From: Gu Zheng @ 2014-12-11  3:22 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Joe Perches

Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating
cmsghdr from msghdr, just cleanup.

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
---
v3:
 -drop the changes about user-land programs as David suggested.
v2:
 -use the lower-case macro name as Joe suggested.

 crypto/af_alg.c        |    2 +-
 include/linux/socket.h |    4 ++++
 net/core/scm.c         |    3 +--
 net/dccp/proto.c       |    5 ++---
 net/ipv4/ip_sockglue.c |    2 +-
 net/ipv6/datagram.c    |    2 +-
 net/iucv/af_iucv.c     |    4 +---
 net/rds/send.c         |    4 ++--
 net/rxrpc/ar-output.c  |    2 +-
 net/sctp/socket.c      |    3 +--
 10 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 6a3ad80..bc21f52 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -399,7 +399,7 @@ int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con)
 {
 	struct cmsghdr *cmsg;
 
-	for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+	for_each_cmsghdr(cmsg, msg) {
 		if (!CMSG_OK(msg, cmsg))
 			return -EINVAL;
 		if (cmsg->cmsg_level != SOL_ALG)
diff --git a/include/linux/socket.h b/include/linux/socket.h
index bb9b836..0e71278 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -94,6 +94,10 @@ struct cmsghdr {
 			     (cmsg)->cmsg_len <= (unsigned long) \
 			     ((mhdr)->msg_controllen - \
 			      ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
+#define for_each_cmsghdr(cmsg, msg) \
+	for (cmsg = CMSG_FIRSTHDR(msg); \
+	     cmsg; \
+	     cmsg = CMSG_NXTHDR(msg, cmsg))
 
 /*
  *	Get the next cmsg header
diff --git a/net/core/scm.c b/net/core/scm.c
index b442e7e..3b6899b 100644
--- a/net/core/scm.c
+++ b/net/core/scm.c
@@ -129,8 +129,7 @@ int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p)
 	struct cmsghdr *cmsg;
 	int err;
 
-	for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg))
-	{
+	for_each_cmsghdr(cmsg, msg) {
 		err = -EINVAL;
 
 		/* Verify that cmsg_len is at least sizeof(struct cmsghdr) */
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 5ab6627..e7413a9 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -703,7 +703,7 @@ EXPORT_SYMBOL_GPL(compat_dccp_getsockopt);
 
 static int dccp_msghdr_parse(struct msghdr *msg, struct sk_buff *skb)
 {
-	struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
+	struct cmsghdr *cmsg;
 
 	/*
 	 * Assign an (opaque) qpolicy priority value to skb->priority.
@@ -717,8 +717,7 @@ static int dccp_msghdr_parse(struct msghdr *msg, struct sk_buff *skb)
 	 */
 	skb->priority = 0;
 
-	for (; cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) {
-
+	for_each_cmsghdr(cmsg, msg) {
 		if (!CMSG_OK(msg, cmsg))
 			return -EINVAL;
 
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 9daf217..839db9d 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -192,7 +192,7 @@ int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc,
 	int err, val;
 	struct cmsghdr *cmsg;
 
-	for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+	for_each_cmsghdr(cmsg, msg) {
 		if (!CMSG_OK(msg, cmsg))
 			return -EINVAL;
 #if IS_ENABLED(CONFIG_IPV6)
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 2cdc383..7252965 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -640,7 +640,7 @@ int ip6_datagram_send_ctl(struct net *net, struct sock *sk,
 	int len;
 	int err = 0;
 
-	for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+	for_each_cmsghdr(cmsg, msg) {
 		int addr_type;
 
 		if (!CMSG_OK(msg, cmsg)) {
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index a089b6b..b69d87e 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -1070,9 +1070,7 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
 	txmsg.class = 0;
 
 	/* iterate over control messages */
-	for (cmsg = CMSG_FIRSTHDR(msg); cmsg;
-		cmsg = CMSG_NXTHDR(msg, cmsg)) {
-
+	for_each_cmsghdr(cmsg, msg) {
 		if (!CMSG_OK(msg, cmsg)) {
 			err = -EINVAL;
 			goto out;
diff --git a/net/rds/send.c b/net/rds/send.c
index 0a64541..b23e7b8 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -826,7 +826,7 @@ static int rds_rm_size(struct msghdr *msg, int data_len)
 	int cmsg_groups = 0;
 	int retval;
 
-	for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+	for_each_cmsghdr(cmsg, msg) {
 		if (!CMSG_OK(msg, cmsg))
 			return -EINVAL;
 
@@ -878,7 +878,7 @@ static int rds_cmsg_send(struct rds_sock *rs, struct rds_message *rm,
 	struct cmsghdr *cmsg;
 	int ret = 0;
 
-	for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+	for_each_cmsghdr(cmsg, msg) {
 		if (!CMSG_OK(msg, cmsg))
 			return -EINVAL;
 
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
index 0b4b9a7..83b4616 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
@@ -45,7 +45,7 @@ static int rxrpc_sendmsg_cmsg(struct rxrpc_sock *rx, struct msghdr *msg,
 	if (msg->msg_controllen == 0)
 		return -EINVAL;
 
-	for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+	for_each_cmsghdr(cmsg, msg) {
 		if (!CMSG_OK(msg, cmsg))
 			return -EINVAL;
 
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 634a2ab..a3802ed 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -6592,8 +6592,7 @@ static int sctp_msghdr_parse(const struct msghdr *msg, sctp_cmsgs_t *cmsgs)
 	struct cmsghdr *cmsg;
 	struct msghdr *my_msg = (struct msghdr *)msg;
 
-	for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL;
-	     cmsg = CMSG_NXTHDR(my_msg, cmsg)) {
+	for_each_cmsghdr(cmsg, my_msg) {
 		if (!CMSG_OK(my_msg, cmsg))
 			return -EINVAL;
 
-- 
1.7.7

^ permalink raw reply related

* default enable sparse __CHECK_ENDIAN__ (was: Re: [PATCH v7 2/3] net: Add Keystone NetCP ethernet driver)
From: Joe Perches @ 2014-12-11  3:04 UTC (permalink / raw)
  To: David Miller, Andrew Morton, Christopher Li, Michal Marek
  Cc: m-karicheri2-l0cyMroinI0, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	linux-sparse-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20141210.204110.618599360537141819.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

On Wed, 2014-12-10 at 20:41 -0500, David Miller wrote:
> From: Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>
> > Are you referring to the static code analyser sparse that is invoked
> > through?
> You have to explicitly enable endian checking, it's not on by
> default.

There don't seem to be thousands of warnings anymore.

Maybe it's time to default enable it when using C=?

from: Documentation/sparse.txt:

The optional make variable CF can be used to pass arguments to sparse.  The
build system passes -Wbitwise to sparse automatically.  To perform endianness
checks, you may define __CHECK_ENDIAN__:

        make C=2 CF="-D__CHECK_ENDIAN__"

These checks are disabled by default as they generate a host of warnings.



--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
From: Toshiaki Makita @ 2014-12-11  2:20 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, bridge
In-Reply-To: <20141210.211306.1331714594864472914.davem@davemloft.net>

On 2014/12/11 11:13, David Miller wrote:
> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> Date: Thu, 11 Dec 2014 11:04:44 +0900
> 
>> On 2014/12/11 4:50, David Miller wrote:
>>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>>> Date: Wed, 10 Dec 2014 11:43:14 +0900
>>>
>>>> -	features &= ~NETIF_F_ONE_FOR_ALL;
>>>> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
>>>
>>> I don't think this is the expression you intend to use.
>>
>> Thank you, but this is really my intended expression.
>>
>> "features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
>> including GSO_SOFTWARE.
>> But I want to leave GSO_SOFTWARE bits here.
> 
> It is clearer to say this as:
> 
> 	~(NETIF_F_ONE_FOR_ALL & ~NETIF_F_GSO_SOFTWARE)
> 
> Or create a new NETIF_F_* macro to express this idea succinctly.

OK, I will. (once net-next is reopened)

Thanks,
Toshiaki Makita

^ permalink raw reply

* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
From: David Miller @ 2014-12-11  2:13 UTC (permalink / raw)
  To: makita.toshiaki; +Cc: stephen, netdev, bridge
In-Reply-To: <5488FBBC.2050105@lab.ntt.co.jp>

From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Thu, 11 Dec 2014 11:04:44 +0900

> On 2014/12/11 4:50, David Miller wrote:
>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>> Date: Wed, 10 Dec 2014 11:43:14 +0900
>> 
>>> -	features &= ~NETIF_F_ONE_FOR_ALL;
>>> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
>> 
>> I don't think this is the expression you intend to use.
> 
> Thank you, but this is really my intended expression.
> 
> "features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
> including GSO_SOFTWARE.
> But I want to leave GSO_SOFTWARE bits here.

It is clearer to say this as:

	~(NETIF_F_ONE_FOR_ALL & ~NETIF_F_GSO_SOFTWARE)

Or create a new NETIF_F_* macro to express this idea succinctly.

^ permalink raw reply

* [PATCH net-next v2 1/3] net: fec: reset fep link status in suspend function
From: Fugang Duan @ 2014-12-11  1:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, bhutchings, stephen, b38611
In-Reply-To: <1418260833-896-1-git-send-email-b38611@freescale.com>

On some i.MX6 serial boards, phy power and refrence clock are supplied
or controlled by SOC. When do suspend/resume test, the power and clock
are disabled, so phy device link down.

For current driver, fep->link is still up status, which cause extra operation
like below code. To avoid the dumy operation, we set fep->link to down when
phy device is real down.
...
if (fep->link) {
	napi_disable(&fep->napi);
	netif_tx_lock_bh(ndev);
	fec_stop(ndev);
	netif_tx_unlock_bh(ndev);
	napi_enable(&fep->napi);
	fep->link = phy_dev->link;
	status_change = 1;
}
...

Signed-off-by: Fugang Duan <B38611@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index fee2afe..b118b7d 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3332,6 +3332,12 @@ static int __maybe_unused fec_suspend(struct device *dev)
 	if (fep->reg_phy)
 		regulator_disable(fep->reg_phy);
 
+	/* SOC supply clock to phy, when clock is disabled, phy link down
+	 * SOC control phy regulator, when regulator is disabled, phy link down
+	 */
+	if (fep->clk_enet_out || fep->reg_phy)
+		fep->link = 0;
+
 	return 0;
 }
 
-- 
1.7.8

^ permalink raw reply related

* Re: [PATCH net] gianfar: Fix dma check map error when DMA_API_DEBUG is enabled
From: Kevin Hao @ 2014-12-11  2:06 UTC (permalink / raw)
  To: David Miller; +Cc: claudiu.manoil, netdev
In-Reply-To: <20141210.131347.2165044584202384761.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]

On Wed, Dec 10, 2014 at 01:13:47PM -0500, David Miller wrote:
> From: Claudiu Manoil <claudiu.manoil@freescale.com>
> Date: Tue, 9 Dec 2014 16:24:35 +0200
> 
> > From: Kevin Hao <haokexin@gmail.com>
> > 
> > We need to use dma_mapping_error() to check the dma address returned
> > by dma_map_single/page(). Otherwise we would get warning like this:
>  ...
> > For TX, we need to unmap the pages which has already been mapped and
> > free the skb before return. For RX, just let the rxbdp as unempty.
> > We can retry to initialize it to empty in next round.
> > 
> > Signed-off-by: Kevin Hao <haokexin@gmail.com>
> > Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
> 
> The RX behavior needs to be adjusted.
> 
> You should never leave holes in the RX ring, ever.
> 
> Instead, try allocating the new RX skb first, and only if
> you are successful should you pass up the original SKB.  If
> it fails, then reuse the original SKB in the RX ring.

OK, will do.

Thanks,
Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply

* Re: [PATCH] net: openvswitch: Support masked set actions.
From: Jesse Gross @ 2014-12-11  2:05 UTC (permalink / raw)
  To: Jarno Rajahalme; +Cc: David Miller, netdev, dev@openvswitch.org
In-Reply-To: <2A734ABB-853F-4D17-91BB-1B62A784881C@nicira.com>

On Wed, Dec 10, 2014 at 12:03 PM, Jarno Rajahalme <jrajahalme@nicira.com> wrote:
>
> On Dec 10, 2014, at 11:48 AM, David Miller <davem@davemloft.net> wrote:
>
>> From: Jarno Rajahalme <jrajahalme@nicira.com>
>> Date: Tue,  9 Dec 2014 16:10:25 -0800
>>
>>> OVS userspace already probes the openvswitch kernel module for
>>> OVS_ACTION_ATTR_SET_MASKED support.  This patch adds the kernel module
>>> implementation of masked set actions.
>>>
>>> The existing set action sets many fields at once.  When only a subset
>>> of the IP header fields, for example, should be modified, all the IP
>>> fields need to be exact matched so that the other field values can be
>>> copied to the set action.  A masked set action allows modification of
>>> an arbitrary subset of the supported header bits without requiring the
>>> rest to be matched.
>>>
>>> Masked set action is now supported for all writeable key types, except
>>> for the tunnel key.  The set tunnel action is an exception as any
>>> input tunnel info is cleared before action processing starts, so there
>>> is no tunnel info to mask.
>>>
>>> The kernel module converts all (non-tunnel) set actions to masked set
>>> actions.  This makes action processing more uniform, and results in
>>> less branching and duplicating the action processing code.  When
>>> returning actions to userspace, the fully masked set actions are
>>> converted back to normal set actions.  We use a kernel internal action
>>> code to be able to tell the userspace provided and converted masked
>>> set actions apart.
>>>
>>> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
>>
>> How does this work, should I be waiting for a signoff or ACK from
>> Pravin before applying this directly to my tree?
>
> In this case you should wait for an Acked-by from Jesse, as he has
> reviewed previous versions of this patch sent to dev@openvswitch.org
> only. I should have included a note about that, sorry.

I gave some review comments but generally speaking my expectation is
that Pravin, as the maintainer, will provide an ack for OVS patches.

^ permalink raw reply

* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
From: Toshiaki Makita @ 2014-12-11  2:04 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, bridge
In-Reply-To: <20141210.145047.1148744559031706340.davem@davemloft.net>

On 2014/12/11 4:50, David Miller wrote:
> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> Date: Wed, 10 Dec 2014 11:43:14 +0900
> 
>> -	features &= ~NETIF_F_ONE_FOR_ALL;
>> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
> 
> I don't think this is the expression you intend to use.

Thank you, but this is really my intended expression.

"features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
including GSO_SOFTWARE.
But I want to leave GSO_SOFTWARE bits here.

> 
> I think you meant:
> 
> 	features &= ~(NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE);

ONE_FOR_ALL already includes GSO_SOFTWARE.

> 
> Or:
> 
> 	features = ~NETIF_F_ONE_FOR_ALL;
> 	features |= NETIF_F_GSO_SOFTWARE;

This way, users cannot drop TSO/UFO by ethtool.

Thanks,
Toshiaki Makita

^ permalink raw reply

* Re: [PATCH] net: openvswitch: Support masked set actions.
From: Jesse Gross @ 2014-12-11  2:03 UTC (permalink / raw)
  To: Jarno Rajahalme; +Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev
In-Reply-To: <1418170225-9328-1-git-send-email-jrajahalme-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>

On Tue, Dec 9, 2014 at 4:10 PM, Jarno Rajahalme <jrajahalme@nicira.com> wrote:
> diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
> index df3c7f2..276bb60 100644
> --- a/net/openvswitch/flow_netlink.c
> +++ b/net/openvswitch/flow_netlink.c
> @@ -2007,6 +2117,18 @@ int ovs_nla_put_actions(const struct nlattr *attr, int len, struct sk_buff *skb)
>                                 return err;
>                         break;
>
> +               case OVS_ACTION_ATTR_SET_MASKED:
> +                       err = masked_set_action_to_attr(a, skb);
> +                       if (err)
> +                               return err;
> +                       break;

I don't think this is necessary - the default case will handle things
that don't need any special processing.

I think you can also remove the port checks in validate_tp_port()
since the reasoning behind them is the same as the IP proto check.

Otherwise, I'm generally happy with this though.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

^ permalink raw reply

* Re: [PATCH net-next RESEND 2/2] ipv6: fix sparse warning
From: Ying Xue @ 2014-12-11  1:56 UTC (permalink / raw)
  To: paulmck
  Cc: davem, eric.dumazet, jon.maloy, erik.hugne, netdev, kbuild-all,
	linux-kernel
In-Reply-To: <20141210160406.GS25340@linux.vnet.ibm.com>

On 12/11/2014 12:04 AM, Paul E. McKenney wrote:
> On Wed, Dec 10, 2014 at 04:46:07PM +0800, Ying Xue wrote:
>> This fixes the following spare warning when using
>>
>> make C=1 CF=-D__CHECK_ENDIAN__ net/ipv6/addrconf.o
>> net/ipv6/addrconf.c:3495:9: error: incompatible types in comparison expression (different address spaces)
>> net/ipv6/addrconf.c:3495:9: error: incompatible types in comparison expression (different address spaces)
>> net/ipv6/addrconf.c:3495:9: error: incompatible types in comparison expression (different address spaces)
>> net/ipv6/addrconf.c:3495:9: error: incompatible types in comparison expression (different address spaces)
>>
>> To silence above spare complaint, an RCU annotation should be added
>> to "next" pointer of hlist_node structure through hlist_next_rcu()
>> macro when iterating over a hlist with
>> hlist_for_each_entry_continue_rcu_bh().
>>
>> By the way, this commit also resolves the same error appearing in
>> hlist_for_each_entry_continue_rcu().
>>
>> Signed-off-by: Ying Xue <ying.xue@windriver.com>
> 
> If you pull the rculist.h changes from the first patch into this one,
> I will queue it up through -rcu.
> 

Please just queue this patch into your RCU tree. Some changes of the
first patch currently only exists in net-next tree, so it cannot be
merged into RCU tree now. Therefore, please temporarily ignore it. In
next 3.19 development cycle, I will resubmit it to you.

Thanks,
Ying

> 							Thanx, Paul
> 
>> ---
>>  include/linux/rculist.h |   16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/include/linux/rculist.h b/include/linux/rculist.h
>> index 866d9c9..32bd4ad 100644
>> --- a/include/linux/rculist.h
>> +++ b/include/linux/rculist.h
>> @@ -524,11 +524,11 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n,
>>   * @member:	the name of the hlist_node within the struct.
>>   */
>>  #define hlist_for_each_entry_continue_rcu(pos, member)			\
>> -	for (pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\
>> -			typeof(*(pos)), member);			\
>> +	for (pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \
>> +			&(pos)->member)), typeof(*(pos)), member);	\
>>  	     pos;							\
>> -	     pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\
>> -			typeof(*(pos)), member))
>> +	     pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(	\
>> +			&(pos)->member)), typeof(*(pos)), member))
>>
>>  /**
>>   * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point
>> @@ -536,11 +536,11 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n,
>>   * @member:	the name of the hlist_node within the struct.
>>   */
>>  #define hlist_for_each_entry_continue_rcu_bh(pos, member)		\
>> -	for (pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\
>> -			typeof(*(pos)), member);			\
>> +	for (pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu(  \
>> +			&(pos)->member)), typeof(*(pos)), member);	\
>>  	     pos;							\
>> -	     pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\
>> -			typeof(*(pos)), member))
>> +	     pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu(	\
>> +			&(pos)->member)), typeof(*(pos)), member))
>>
>>  /**
>>   * hlist_for_each_entry_from_rcu - iterate over a hlist continuing from current point
>> -- 
>> 1.7.9.5
>>
> 
> 
> 

^ permalink raw reply

* [PATCH net-next v2 3/3] net: fec: only enable mdio interrupt before phy device link up
From: Fugang Duan @ 2014-12-11  1:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, bhutchings, stephen, b38611
In-Reply-To: <1418260833-896-1-git-send-email-b38611@freescale.com>

Before phy device link up, we only enable FEC mdio interrupt, which
is more reasonable.

Signed-off-by: Fugang Duan <B38611@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 85c955e..8c5b15e 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1075,7 +1075,10 @@ fec_restart(struct net_device *ndev)
 		fec_ptp_start_cyclecounter(ndev);
 
 	/* Enable interrupts we wish to service */
-	writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+	if (fep->link)
+		writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+	else
+		writel(FEC_ENET_MII, fep->hwp + FEC_IMASK);
 
 	/* Init the interrupt coalescing */
 	fec_enet_itr_coal_init(ndev);
-- 
1.7.8

^ permalink raw reply related

* [PATCH net-next v2 2/3] net: fec: clear all interrupt events to support i.MX6SX
From: Fugang Duan @ 2014-12-11  1:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, bhutchings, stephen, b38611
In-Reply-To: <1418260833-896-1-git-send-email-b38611@freescale.com>

For i.MX6SX FEC controller, there have interrupt mask and event
field extension. To support all SOCs FEC, we clear all interrupt
events during MAVC initial process.

Signed-off-by: Fugang Duan <B38611@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index b118b7d..85c955e 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -940,7 +940,7 @@ fec_restart(struct net_device *ndev)
 	}
 
 	/* Clear any outstanding interrupt. */
-	writel(0xffc00000, fep->hwp + FEC_IEVENT);
+	writel(0xffffffff, fep->hwp + FEC_IEVENT);
 
 	fec_enet_bd_init(ndev);
 
-- 
1.7.8

^ permalink raw reply related

* [PATCH net-next v2 0/3] net: fec: driver code clean and bug fix
From: Fugang Duan @ 2014-12-11  1:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, bhutchings, stephen, b38611

The patch serial include code clean and bug fix:
Patch#1: avoid dummy operation during suspend/resume test.
Patch#2: bug fix for i.MX6SX SOC that clean all interrupt events during MAC initial process.
Patch#3: before phy device link status is up, only enable MDIO bus interrupt.

V2:
- Modify the comment form from David's suggestion.

Fugang Duan (3):
  net: fec: reset fep link status in suspend function
  net: fec: clear all interrupt events to support i.MX6SX
  net: fec: only enable mdio interrupt before phy device link up

 drivers/net/ethernet/freescale/fec_main.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

-- 
1.7.8

^ permalink raw reply

* Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr
From: Gu Zheng @ 2014-12-11  1:50 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel, joe
In-Reply-To: <20141210.204703.1525194278635097457.davem@davemloft.net>

Hi David,
On 12/11/2014 09:47 AM, David Miller wrote:

> From: Gu Zheng <guz.fnst@cn.fujitsu.com>
> Date: Thu, 11 Dec 2014 09:05:59 +0800
> 
>> IMO, the user-land programs need to be build with the matched
>> headers separately.
> 
> You absolutely cannot provide this new interface to userland and
> expect programs to be able to just use it, it's non-standard and does
> not exist in older headers.

Got it, sorry for my mistake, and thanks for your correction.

> 
> I do not want this new interface available to userland programs.
> They can just open-code the list traversal just like every program
> in history has had to do since BSD UNIX.

Agree. Let's leave the user-land ones as they are.
I'll send a new version (without changing user-land ones) soon.

Best regards,
Gu

> .
> 

^ permalink raw reply

* Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr
From: David Miller @ 2014-12-11  1:47 UTC (permalink / raw)
  To: guz.fnst; +Cc: netdev, linux-kernel, joe
In-Reply-To: <5488EDF7.7070001@cn.fujitsu.com>

From: Gu Zheng <guz.fnst@cn.fujitsu.com>
Date: Thu, 11 Dec 2014 09:05:59 +0800

> IMO, the user-land programs need to be build with the matched
> headers separately.

You absolutely cannot provide this new interface to userland and
expect programs to be able to just use it, it's non-standard and does
not exist in older headers.

I do not want this new interface available to userland programs.
They can just open-code the list traversal just like every program
in history has had to do since BSD UNIX.

^ permalink raw reply

* Re: [PATCH v2] if_bridge: fix conflict with glibc
From: David Miller @ 2014-12-11  1:44 UTC (permalink / raw)
  To: stephen; +Cc: gregory.0xf0, f.fainelli, xiyou.wangcong, netdev
In-Reply-To: <20141210155745.3d375230@urahara>

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 10 Dec 2014 15:57:45 -0800

> On Wed, 10 Dec 2014 13:34:17 -0500 (EST)
> David Miller <davem@davemloft.net> wrote:
> 
>> No, we really want to incluse the linux/in6.h header, as that's where all
>> the special GLIBC CPP checks are, such as:
>> 
>> #if __UAPI_DEF_IN6_ADDR_ALT
>> 
>> Please research how we have resolved the conflict between GLIBC and the
>> kernel's exported headers.  We really need to use linux/in6.h for all of
>> this to work.
>> 
>> I understand that it is upsetting that iproute2 stopped building for you,
>> but I'd like to kindly ask that you look more deeply into this and think
>> more longer term, rather than having a knee jerk reaction and looking for
>> quick fixes.
> 
> I don't have the time to understand the intricacies of glibc headers.
> The problem is that Gcc warns about duplicate definitions in headers;
> this is a useful warning and not something that I want to disable.
> Hacks with #undef seem to be heading the wrong way.

GLIBC and the kernel have unconditionally defined various types in
their copies of in.h, and the only way to resolve this moving forward
is to have some communication between the two so we can know who is
in fact in charge of instantianting the type.

The new defines, such as __UAPI_DEF_IN6_ADDR_ALT, are that new
mechanism.

^ permalink raw reply

* Re: errors in alignment changes..
From: David Miller @ 2014-12-11  1:42 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: mitsuhiro.kimura.kc, netdev
In-Reply-To: <5488C447.5080906@cogentembedded.com>

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 11 Dec 2014 01:08:07 +0300

>    I guess we can just do:
> 
> 		rxdesc->addr = dma_map_single(...);

Best not to leave a potentially invalid DMA address in a
receive descriptor the chip can potentially fetch and
look at.

That's why I said to put it into a local variable and
check for errors first.

^ permalink raw reply

* Re: [PATCH v7 2/3] net: Add Keystone NetCP ethernet driver
From: David Miller @ 2014-12-11  1:41 UTC (permalink / raw)
  To: m-karicheri2-l0cyMroinI0
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <5488BB96.9070609-l0cyMroinI0@public.gmane.org>

From: Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>
Date: Wed, 10 Dec 2014 16:31:02 -0500

> Are you referring to the static code analyser sparse that is invoked
> through?

You have to explicitly enable endian checking, it's not on by
default.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* RE: [PATCH net-next 1/3] net: fec: reset fep link status in suspend function
From: fugang.duan @ 2014-12-11  1:40 UTC (permalink / raw)
  To: David Miller
  Cc: netdev@vger.kernel.org, bhutchings@solarflare.com,
	stephen@networkplumber.org
In-Reply-To: <20141210.145424.35618035568083747.davem@davemloft.net>

From: David Miller <davem@davemloft.net> Sent: Thursday, December 11, 2014 3:54 AM
> To: Duan Fugang-B38611
> Cc: netdev@vger.kernel.org; bhutchings@solarflare.com;
> stephen@networkplumber.org
> Subject: Re: [PATCH net-next 1/3] net: fec: reset fep link status in
> suspend function
> 
> From: Fugang Duan <b38611@freescale.com>
> Date: Wed, 10 Dec 2014 17:54:47 +0800
> 
> > +	/*
> > +	 * SOC supply clock to phy, when clock is disabled, phy link down
> > +	 * SOC control phy regulator, when regulator is disabled, phy link
> down
> > +	 */
> 
> Comments in the networking should be of the form:
> 
> 	/* Like
> 	 * this.
> 	 */
> 
> Not:
> 
> 	/*
> 	 * Like
> 	 * this.
> 	 */

Thanks for your comment. I will change it and send V2 version.

Regards,
Andy

^ permalink raw reply

* Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr
From: Gu Zheng @ 2014-12-11  1:11 UTC (permalink / raw)
  To: Joe Perches; +Cc: David S. Miller, netdev, linux-kernel
In-Reply-To: <1418223106.18092.1.camel@perches.com>

Hi Joe,
On 12/10/2014 10:51 PM, Joe Perches wrote:

> On Wed, 2014-12-10 at 16:15 +0800, Gu Zheng wrote:
>> On 12/10/2014 02:56 PM, Joe Perches wrote:
>>> On Wed, 2014-12-10 at 13:36 +0800, Gu Zheng wrote:
>>>> Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating
>>>> cmsghdr from msghdr, just cleanup. 
>>>
>>> This looks nicer.
>>> Ideally this would have used: [PATCH V3] as the subject
>>
>> The previous v2 thread was marked as mistake, so this is the really active
>> v2 version.
> 
> A buggy submitted version is still a version.
> Using an incremented version number helps.

Got it, this can also avoid some unnecessary misreading.
Thanks for your suggestion.

Regards,
Gu

> 
> 

^ permalink raw reply

* Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr
From: Gu Zheng @ 2014-12-11  1:05 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel, joe
In-Reply-To: <20141210.144430.1749715282635917425.davem@davemloft.net>

Hi David,
On 12/11/2014 03:44 AM, David Miller wrote:

> From: David Miller <davem@davemloft.net>
> Date: Wed, 10 Dec 2014 13:48:04 -0500 (EST)
> 
>> From: Gu Zheng <guz.fnst@cn.fujitsu.com>
>> Date: Wed, 10 Dec 2014 13:36:25 +0800
>>
>>> Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating
>>> cmsghdr from msghdr, just cleanup. 
>>>
>>> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
>>
>> Applied, thanks.
> 
> This breaks the build, I'm reverting.

I'm very sorry.

> 
> You cannot use your new macros in
> Documentation/networking/timestamping/txtimestamp.c, that is a
> userland program and the header you are adding your helper to is not
> available to userspace.

IMO, the user-land programs need to be build with the matched headers separately.
I split the kernel codes and the user-land programs, build and install the kernel first,
and then build the user-land ones. 

> 
> This also means you didn't sufficiently test the build of your
> changes.

To be honest, I do the test as I mentioned above.

Thanks,
Gu

> 
> Documentation/networking/timestamping/timestamping.c: In function ‘printpacket’:
> Documentation/networking/timestamping/timestamping.c:172:2: warning: implicit declaration of function ‘for_each_cmsghdr’ [-Wimplicit-function-declaration]
> Documentation/networking/timestamping/timestamping.c:172:30: error: expected ‘;’ before ‘{’ token
> Documentation/networking/timestamping/timestamping.c:161:18: warning: unused variable ‘ts’ [-Wunused-variable]
> Documentation/networking/timestamping/timestamping.c:160:17: warning: unused variable ‘tv’ [-Wunused-variable]
> make[3]: *** [Documentation/networking/timestamping/timestamping] Error 1
> make[3]: *** Waiting for unfinished jobs....
> Documentation/networking/timestamping/txtimestamp.c: In function ‘__recv_errmsg_cmsg’:
> Documentation/networking/timestamping/txtimestamp.c:187:2: warning: implicit declaration of function ‘for_each_cmsghdr’ [-Wimplicit-function-declaration]
> Documentation/networking/timestamping/txtimestamp.c:187:19: error: ‘cmsg’ undeclared (first use in this function)
> Documentation/networking/timestamping/txtimestamp.c:187:19: note: each undeclared identifier is reported only once for each function it appears in
> Documentation/networking/timestamping/txtimestamp.c:187:30: error: expected ‘;’ before ‘{’ token
> Documentation/networking/timestamping/txtimestamp.c:185:18: warning: unused variable ‘cm’ [-Wunused-variable]
> Documentation/networking/timestamping/txtimestamp.c:184:27: warning: unused variable ‘tss’ [-Wunused-variable]
> Documentation/networking/timestamping/txtimestamp.c:183:28: warning: unused variable ‘serr’ [-Wunused-variable]
> Documentation/networking/timestamping/txtimestamp.c: At top level:
> Documentation/networking/timestamping/txtimestamp.c:123:13: warning: ‘print_timestamp’ defined but not used [-Wunused-function]
> Documentation/networking/timestamping/txtimestamp.c:159:13: warning: ‘print_pktinfo’ defined but not used [-Wunused-function]
> 

^ permalink raw reply

* NetDev 0.1 Registration open
From: Richard Guy Briggs @ 2014-12-11  1:03 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA, lwn-T1hC0tSOHrs,
	netdev01-wool9L35kiczKOhml7GhPkB+6BGkLq7r,
	lartc-u79uwXL29TY76Z2rM5mHXA, netfilter-u79uwXL29TY76Z2rM5mHXA,
	netfilter-devel-u79uwXL29TY76Z2rM5mHXA

We are pleased to announce that registration is now open for netdev 0.1, the
community-driven Linux networking conference held back-to-back with netconf in 
Ottawa, Canada, February 14-17, 2015.

Registration is now open at https://onlineregistrations.ca/netdev01.
Fees: $100/day, or $350 for 4 days (Canadian Dollars)

Online registration closes Feb 12.


Main site:                      https://www.netdev01.org/
Announcement:                   https://www.netdev01.org/announce
CFP:                            https://www.netdev01.org/cfp
Travel/hotel/weather/clothing:  https://www.netdev01.org/travel



	slainte mhath, RGB

--
Richard Guy Briggs               --  ~\    -- ~\
<www.TriColour.ca>                 --  \___   o \@       @
Ottawa, ON, CANADA                  --  Lo_>__M__\\/\%__\\/\%
_____________________________GTVS6#790__(*)__(*)________(*)(*)_________________
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [net: sock] BUG: unable to handle kernel NULL pointer dereference at 0000000000000007
From: Dave Jones @ 2014-12-11  1:00 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: Fengguang Wu, LKP, LKML, Network Development, dborkman
In-Reply-To: <CAMEtUuxexMXtvK_R7YZEvx_iyK9mAx_zrqr1bkj3PsUwoq0p5A@mail.gmail.com>

On Wed, Dec 10, 2014 at 03:51:33PM -0800, Alexei Starovoitov wrote:
 > On Wed, Dec 10, 2014 at 3:29 PM, Fengguang Wu <fengguang.wu@intel.com> wrote:
 > > Greetings,
 > >
 > > 0day kernel testing robot got the below dmesg and the first bad commit is
 > >
 > >     net: sock: allow eBPF programs to be attached to sockets
 > 
 > > [init] Kernel was tainted on startup. Will ignore flags that are already set.
 > > [init] Started watchdog process, PID is 9354
 > > [main] Main thread is alive.
 > > [   21.233581] BUG: unable to handle kernel NULL pointer dereference at 0000000000000007
 > > [   21.234709] IP: [<ffffffff8156ebda>] sk_attach_bpf+0x39/0xc2
 > 
 > thanks for the report! syscall fuzzer is great.
 > I missed an extra check. Working on a fix.

This might be the first time I've seen it trip up the bpf code iirc.
Daniel wrote some pretty nifty bpf generator code in trinity,
(net/bpf.c) that you might want to see if you can think of enhancing.

Though it might be the case that we're not even needing to do anything
that complicated to hit this particular bug..

	Dave

^ permalink raw reply

* BUG: kernel panic nf_ct_del_from_dying_or_unconfirmed_list
From: Markus Kaindl @ 2014-12-11  0:55 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netdev, netfilter-devel, Linux Kernel

Hi,

shortly after changing from wireless to wired network connection, both using 
IPv4 and Isatap, I experienced the following kernel panic. I was doing a 
speedtest on the wired connection when the panic occured.

I tried to reproduce it, but I was not able to.

[...] (could not get more scroll back...)
[13139.648381] ffff880174d149e0 ffff88000cb8b828 ffff8800a73b7858 ffffffff81864dbe
[13139.648429] ffff88000cb8b828 ffff8800a?3b?B?0 ffffffffB1825e85 ffff88000cb8b828
[13139.648472] Call Trace:
[13139.648490] [<ffffffff81869885>] destroy_conntrack+0x55/0xc0
[13139.648521] [<ffffffff81864dbe>] nf_conntrack_destroy+0x1e/0x30
[13139.648555] [<ffffffff81825e85>] skb_release_head_state+0xa5/0xf0
[13139.648590] [<ffffffff8182682d>] skb_release_all+0xd/0x30
[13139.648620] [<ffffffff818268a2>] kfree_skb+0x32/0xa0
[13139.648649] [<ffffffff81884630>] ? ip_fragment+0x8d0/0x8d0
[13139.848681] [<ffffffff81864fd8>] nf_hook_slow+0x108/0x120
[13139.648712] [<ffffffff81884630>] ? ip_fragment+0x8d0/0x8d0
[13139.648745] [<ffffffffB18861e5>] ip_output+0x75/0x90
[13139.648775] [<ffffffff8188592b>] ip_local_out_sk+0x2b/0x30
[13139.648807] [<ffffffff818c71ab>] iptunnel_xmit+0xfb/0x120
[13139.648839] [<ffffffff8192548e>] sit_tunnel_xmit+0x3de/0x700
[13139.648870] [<ffffffff8112563e>] ? internal_add_timer+0x5e/0x80
[13139.648902] [<ffffffff81838c1?>] dev_hard_start_xmit+0x337/0x660
[13139.648933] [<ffffffff81839253>] __dev_queue_xmit+0x313/0x510
[13139.648965] [<ffffffff8183945b>] dev_queue_xmit+0xb/0x10
[13139.648995] [<ffffffff8184022c>] neigh_direct_output+0xc/0x10
[13139.649028] [<ffffffff818eb609>] ip6_finish_output2+0x159/0x490
[13139.649062] [<ffffffff818ee7f0>] ? ip6_fragment+0xa90/0xa90
[13139.649094] [<ffffffff818ee877>] ip6_finish_output+0x87/0xc0
[13139.649125] [<ffffffff818ee920>] ip6_output+0x70/0xb0
[13139.649154] [<ffffffff818ebd2a>] ip6_xmit+0x3ea/0x4d0
[13139.649184] [<ffffffff819195ba>] inet6_csk_xmit+0x6a/0xb0
[13139.649216] [<ffffffff8189cfc0>] tcp_transmit_skb+0x490/0x920
[13139.649249] [<ffffffff8189eba2>] tcp_connect+0x7d2/0x8f0
[13139.649280] [<£fffffff8191209a>] tcp_v6_connect+0x32a/0x620
[13139.649313] [<ffffffff8181d8ca>] ? sock_destroy_inode+0x2a/0x30
[13139.650532] [<ffffffff818b85c5>] __inet_stream_connect+0x95/0x310
[13139.651647] [<ffffffff810f323d>] ? get_parent_ip+0xd/0x50
[13139.652770] [<ffffffff810f32cd>] ? preempt_count_add+0x4d/0xa0
[13139.653904] [<ffffffff810d2b3e>] ? __local_bh_enable_ip+0x3e/0xa0
[13139.651985] [<ffffffff818b8873>] inet_stream_connect+0x33/0x50
[13139.656001] [<ffffffff8181ea57>] SYSC_connect+0xc7/0x100
[13139.656801] [<ffffffff81468a43>] ? __this_cpu_preempt_check+0x13/0x20
[13139.657584] [<ffffffff81011012>] ? syscall_trace_enter+0x232/0x260
[13139.658371] [<ffffffff8181f919>] SyS_connect+0x9/0x10
[13139.659154] [<ffffffff81a1608b>] tracesys+0xdd/0xe2
[13139.659923] Code: 98 e0 07 00 00 0f b7 47 06 48 03 1c c5 20 84 0d 82 48 89 
df e8 84 ce 1d 00 49 8b 44 24 10 48 85 c0 74 2d 49 8b 54 24 08 f6 c2 01 <48> 
89 10 75 04 48 89 42 08 48 b8 00 02 20 00 00 00 ad de 48 89
[13139.661710] RIP [<ffffffff81868b5e>] 
nf_ct_del_from_dying_or_unconfirmed_list+0x3e/0x70
[13139.662579] RSP (ffff8800a?3b?810>
[13139.669137] Kernel panic — not syncing: Fatal exception in interrupt
[13139.670262] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 
0xffffffff80000000-0xffffffff9fffffff)
[13139.671137] drm_kms_helper: panic occurred, switching back to text console


Any guesses?

Thanks,
Markus

^ permalink raw reply

* Re: [bisected] xfrm: TCP connection initiating PMTU discovery stalls on v3.
From: Wolfgang Walter @ 2014-12-11  0:36 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Thomas Jarosch, netdev, Eric Dumazet, Herbert Xu,
	Steffen Klassert
In-Reply-To: <1418238603.27198.37.camel@edumazet-glaptop2.roam.corp.google.com>

Am Mittwoch, 10. Dezember 2014, 11:10:03 schrieb Eric Dumazet:
> On Wed, 2014-12-10 at 19:34 +0100, Wolfgang Walter wrote:
> > So gso is on. When the hang happens sk_setup_caps is called from
> > inet_sk_rebuild_header(). Now the path
> > 
> > 		sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
> > 
> > is taken as dst->header_len is now non zero.
> > 
> > This is the reason why later calls of sk_can_gso() return false.
> > 
> > I'll try to change the above patch to
> > 
> > @@ -1585,6 +1585,8 @@ void sk_setup_caps(struct sock *sk, struct dst_entry
> > *dst) sk->sk_gso_max_size = dst->dev->gso_max_size;
> > 
> >  			sk->sk_gso_max_segs = dst->dev->gso_max_segs;
> >  		
> >  		}
> > 	
> > 	}
> > 
> > +   if (sk_can_gso(sk)) {
> > +		sk->sk_gso_max_segs = 1;
> > 
> >  	}
> >  
> >  }
> >  EXPORT_SYMBOL_GPL(sk_setup_caps);
> > 
> > so that the case that GSO is disabled because of dst->header_len != 0 sets
> > sk_gso_max_segs, too.
> 
> Sounds good, or maybe simply :
> 
> diff --git a/net/core/sock.c b/net/core/sock.c
> index
> 9a56b2000c3f374fb95aedada3327447816a9512..edca31319dfee57cabe5b376505324bea
> 07f767a 100644 --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -1577,6 +1577,7 @@ void sk_setup_caps(struct sock *sk, struct dst_entry
> *dst) if (sk->sk_route_caps & NETIF_F_GSO)
>  		sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE;
>  	sk->sk_route_caps &= ~sk->sk_route_nocaps;
> +	sk->sk_gso_max_segs = 1;
>  	if (sk_can_gso(sk)) {
>  		if (dst->header_len) {
>  			sk->sk_route_caps &= ~NETIF_F_GSO_MASK;

Yes, true.


This fixes the issue. That means no hangs any more even if gso is enabled on 
the device serving the ipsec traffic.

As said I could not apply https://patchwork.ozlabs.org/patch/418506/ 
unmodified to 3.14. This is because the following patch is missing in v.3.14:

commit e114a710aa5058c0ba4aa1dfb105132aefeb5e04
Author: Eric Dumazet <edumazet@google.com>
Date:   Wed Apr 30 11:58:13 2014 -0700

    tcp: fix cwnd limited checking to improve congestion control

(and the follow-up 249015515fe3fc9818d86cb5c83bbc92505ad7dc).

I'll next try to apply these patches on v3.14.26, see if the other patch then 
applies cleanly, add that one-liner - and hopefully it will work.

Regards,
-- 
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts

^ 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