RE: Help needed - Kernel lockup while running ipsec

2019-08-22 Thread Vakul Garg



> -Original Message-
> From: Florian Westphal 
> Sent: Wednesday, August 21, 2019 9:42 PM
> To: Vakul Garg 
> Cc: Florian Westphal ; netdev@vger.kernel.org
> Subject: Re: Help needed - Kernel lockup while running ipsec
> 
> Vakul Garg  wrote:
> > > Policy refcount is decreasing properly on 4.19.
> > > Same should be on the latest kernel too.
> >
> > On kernel-4.14, I find dst_release() is getting called through
> xfrm_output_one().
> > However since dst->__refcnt gets decremented to '1', the
> > call_rcu(&dst->rcu_head, dst_destroy_rcu) is not invoked.
> >
> > On kernel-4.19, dst->__refcnt gets decremented to '0', hence things
> > fall in place and
> > dst_destroy_rcu() eventually executes.
> >
> > Any further help/pointers for kernel-4.14 would be deeply appreciated.
> 
> Can you try getting rid of the pcpu dst cache?
> 
> I had a look at 4.14-stable and it at least lacks 2950278d2d04ff531.
> 
> I've attached an (untested) revert of the pcpu cache (its gone in 4.19 and
> onwards).
> 

This patch fixed the refcnt issue. Many thanks for your help.
Would you send this patch for inclusion into 4.14-stable?



Re: Help needed - Kernel lockup while running ipsec

2019-08-21 Thread Florian Westphal
Vakul Garg  wrote:
> > Policy refcount is decreasing properly on 4.19.
> > Same should be on the latest kernel too.
> 
> On kernel-4.14, I find dst_release() is getting called through 
> xfrm_output_one().
> However since dst->__refcnt gets decremented to '1', 
> the call_rcu(&dst->rcu_head, dst_destroy_rcu) is not invoked. 
> 
> On kernel-4.19, dst->__refcnt gets decremented to '0', hence things fall in 
> place and 
> dst_destroy_rcu() eventually executes.
> 
> Any further help/pointers for kernel-4.14 would be deeply appreciated.

Can you try getting rid of the pcpu dst cache?

I had a look at 4.14-stable and it at least lacks 2950278d2d04ff531.

I've attached an (untested) revert of the pcpu cache (its gone in 4.19
and onwards).


>From 058cb6719223d10dc57743dbf5c20424f118e7e7 Mon Sep 17 00:00:00 2001
From: Florian Westphal 
Date: Mon, 25 Jun 2018 17:26:02 +0200
Subject: [PATCH 4.4.14.y] xfrm: policy: remove pcpu policy cache

commit e4db5b61c572475bbbcf63e3c8a2606bfccf2c9d upstream.

Kristian Evensen says:
  In a project I am involved in, we are running ipsec (Strongswan) on
  different mt7621-based routers. Each router is configured as an
  initiator and has around ~30 tunnels to different responders (running
  on misc. devices). Before the flow cache was removed (kernel 4.9), we
  got a combined throughput of around 70Mbit/s for all tunnels on one
  router. However, we recently switched to kernel 4.14 (4.14.48), and
  the total throughput is somewhere around 57Mbit/s (best-case). I.e., a
  drop of around 20%. Reverting the flow cache removal restores, as
  expected, performance levels to that of kernel 4.9.

When pcpu xdst exists, it has to be validated first before it can be
used.

A negative hit thus increases cost vs. no-cache.

As number of tunnels increases, hit rate decreases so this pcpu caching
isn't a viable strategy.

Furthermore, the xdst cache also needs to run with BH off, so when
removing this the bh disable/enable pairs can be removed too.

Kristian tested a 4.14.y backport of this change and reported
increased performance:

  In our tests, the throughput reduction has been reduced from around -20%
  to -5%. We also see that the overall throughput is independent of the
  number of tunnels, while before the throughput was reduced as the number
  of tunnels increased.

Reported-by: Kristian Evensen 
Signed-off-by: Florian Westphal 
Signed-off-by: Steffen Klassert 
---
 include/net/xfrm.h |   1 -
 net/xfrm/xfrm_device.c |  10 ---
 net/xfrm/xfrm_policy.c | 138 +
 net/xfrm/xfrm_state.c  |   5 +-
 4 files changed, 3 insertions(+), 151 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index db99efb2d1d0..bdf185ae93db 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -323,7 +323,6 @@ int xfrm_policy_register_afinfo(const struct xfrm_policy_afinfo *afinfo, int fam
 void xfrm_policy_unregister_afinfo(const struct xfrm_policy_afinfo *afinfo);
 void km_policy_notify(struct xfrm_policy *xp, int dir,
 		  const struct km_event *c);
-void xfrm_policy_cache_flush(void);
 void km_state_notify(struct xfrm_state *x, const struct km_event *c);
 
 struct xfrm_tmpl;
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 30e5746085b8..4e458fd9236a 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -153,12 +153,6 @@ static int xfrm_dev_register(struct net_device *dev)
 	return NOTIFY_DONE;
 }
 
-static int xfrm_dev_unregister(struct net_device *dev)
-{
-	xfrm_policy_cache_flush();
-	return NOTIFY_DONE;
-}
-
 static int xfrm_dev_feat_change(struct net_device *dev)
 {
 	if ((dev->features & NETIF_F_HW_ESP) && !dev->xfrmdev_ops)
@@ -178,7 +172,6 @@ static int xfrm_dev_down(struct net_device *dev)
 	if (dev->features & NETIF_F_HW_ESP)
 		xfrm_dev_state_flush(dev_net(dev), dev, true);
 
-	xfrm_policy_cache_flush();
 	return NOTIFY_DONE;
 }
 
@@ -190,9 +183,6 @@ static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void
 	case NETDEV_REGISTER:
 		return xfrm_dev_register(dev);
 
-	case NETDEV_UNREGISTER:
-		return xfrm_dev_unregister(dev);
-
 	case NETDEV_FEAT_CHANGE:
 		return xfrm_dev_feat_change(dev);
 
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 70ec57b887f6..b5006a091fd6 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -45,8 +45,6 @@ struct xfrm_flo {
 	u8 flags;
 };
 
-static DEFINE_PER_CPU(struct xfrm_dst *, xfrm_last_dst);
-static struct work_struct *xfrm_pcpu_work __read_mostly;
 static DEFINE_SPINLOCK(xfrm_policy_afinfo_lock);
 static struct xfrm_policy_afinfo const __rcu *xfrm_policy_afinfo[AF_INET6 + 1]
 		__read_mostly;
@@ -1715,108 +1713,6 @@ static int xfrm_expand_policies(const struct flowi *fl, u16 family,
 
 }
 
-static void xfrm_last_dst_update(struct xfrm_dst *xdst, struct xfrm_dst *old)
-{
-	this_cpu_write(xfrm_last_dst, xdst);
-	if (old)
-		dst_release(&old->u.dst);
-}
-
-static void __xfrm_pcpu_work_fn(void)
-{
-	struct xf

RE: Help needed - Kernel lockup while running ipsec

2019-08-21 Thread Vakul Garg



> -Original Message-
> From: Vakul Garg
> Sent: Tuesday, August 20, 2019 4:08 PM
> To: Florian Westphal 
> Cc: netdev@vger.kernel.org
> Subject: RE: Help needed - Kernel lockup while running ipsec
> 
> 
> 
> >
> > > -Original Message-
> > > From: Florian Westphal 
> > > Sent: Tuesday, August 20, 2019 3:08 PM
> > > To: Vakul Garg 
> > > Cc: Florian Westphal ; netdev@vger.kernel.org
> > > Subject: Re: Help needed - Kernel lockup while running ipsec
> > >
> > > Vakul Garg  wrote:
> > > >
> > > >
> > > > > -Original Message-
> > > > > From: Florian Westphal 
> > > > > Sent: Tuesday, August 20, 2019 2:53 PM
> > > > > To: Vakul Garg 
> > > > > Cc: Florian Westphal ; netdev@vger.kernel.org
> > > > > Subject: Re: Help needed - Kernel lockup while running ipsec
> > > > >
> > > > > Vakul Garg  wrote:
> > > > > > > > With kernel 4.14.122, I am getting a kernel softlockup while
> > > > > > > > running single
> > > > > > > static ipsec tunnel.
> > > > > > > > The problem reproduces mostly after running 8-10 hours of
> > > > > > > > ipsec encap
> > > > > > > test (on my dual core arm board).
> > > > > > > >
> > > > > > > > I found that in function xfrm_policy_lookup_bytype(), the
> > > > > > > > policy in variable
> > > > > > > 'ret' shows refcnt=0 under problem situation.
> > > > > > > > This creates an infinite loop in  xfrm_policy_lookup_bytype()
> > > > > > > > and hence the
> > > > > > > lockup.
> > > > > > > >
> > > > > > > > Can some body please provide me pointers about 'refcnt'?
> > > > > > > > Is it legitimate for 'refcnt' to become '0'? Under what
> > > > > > > > condition can it
> > > > > > > become '0'?
> > > > > > >
> > > > > > > Yes, when policy is destroyed and the last user calls
> > > > > > > xfrm_pol_put() which will invoke call_rcu to free the structure.
> > > > > >
> > > > > > It seems that policy reference count never gets decremented during
> > > > > > packet
> > > > > ipsec encap.
> > > > > > It is getting incremented for every frame that hits the policy.
> > > > > > In setkey -DP output, I see refcnt to be wrapping around after '0'.
> > > > >
> > > > > Thats a bug.  Does this affect 4.14 only or does this happen on
> > > > > current tree as well?
> > > >
> > > > I am yet to try it on 4.19.
> > > > Can you help me with the right fix? Which part of code should it get
> > > decremented?
> > > > I am not conversant with xfrm code.
> > >
> > > Normally policy reference counts get decremented when the skb is
> free'd,
> > via
> > > dst destruction (xfrm_dst_destroy()).
> > >
> > > Do you see a dst leak as well?
> >
> > Can you please guide me how to detect it?
> >
> > (I am checking refcount on recent kernel and will let you know.)
> 
> Policy refcount is decreasing properly on 4.19.
> Same should be on the latest kernel too.

On kernel-4.14, I find dst_release() is getting called through 
xfrm_output_one().
However since dst->__refcnt gets decremented to '1', 
the call_rcu(&dst->rcu_head, dst_destroy_rcu) is not invoked. 

On kernel-4.19, dst->__refcnt gets decremented to '0', hence things fall in 
place and 
dst_destroy_rcu() eventually executes.

Any further help/pointers for kernel-4.14 would be deeply appreciated.





RE: Help needed - Kernel lockup while running ipsec

2019-08-20 Thread Vakul Garg



> 
> > -Original Message-
> > From: Florian Westphal 
> > Sent: Tuesday, August 20, 2019 3:08 PM
> > To: Vakul Garg 
> > Cc: Florian Westphal ; netdev@vger.kernel.org
> > Subject: Re: Help needed - Kernel lockup while running ipsec
> >
> > Vakul Garg  wrote:
> > >
> > >
> > > > -Original Message-
> > > > From: Florian Westphal 
> > > > Sent: Tuesday, August 20, 2019 2:53 PM
> > > > To: Vakul Garg 
> > > > Cc: Florian Westphal ; netdev@vger.kernel.org
> > > > Subject: Re: Help needed - Kernel lockup while running ipsec
> > > >
> > > > Vakul Garg  wrote:
> > > > > > > With kernel 4.14.122, I am getting a kernel softlockup while
> > > > > > > running single
> > > > > > static ipsec tunnel.
> > > > > > > The problem reproduces mostly after running 8-10 hours of
> > > > > > > ipsec encap
> > > > > > test (on my dual core arm board).
> > > > > > >
> > > > > > > I found that in function xfrm_policy_lookup_bytype(), the
> > > > > > > policy in variable
> > > > > > 'ret' shows refcnt=0 under problem situation.
> > > > > > > This creates an infinite loop in  xfrm_policy_lookup_bytype()
> > > > > > > and hence the
> > > > > > lockup.
> > > > > > >
> > > > > > > Can some body please provide me pointers about 'refcnt'?
> > > > > > > Is it legitimate for 'refcnt' to become '0'? Under what
> > > > > > > condition can it
> > > > > > become '0'?
> > > > > >
> > > > > > Yes, when policy is destroyed and the last user calls
> > > > > > xfrm_pol_put() which will invoke call_rcu to free the structure.
> > > > >
> > > > > It seems that policy reference count never gets decremented during
> > > > > packet
> > > > ipsec encap.
> > > > > It is getting incremented for every frame that hits the policy.
> > > > > In setkey -DP output, I see refcnt to be wrapping around after '0'.
> > > >
> > > > Thats a bug.  Does this affect 4.14 only or does this happen on
> > > > current tree as well?
> > >
> > > I am yet to try it on 4.19.
> > > Can you help me with the right fix? Which part of code should it get
> > decremented?
> > > I am not conversant with xfrm code.
> >
> > Normally policy reference counts get decremented when the skb is free'd,
> via
> > dst destruction (xfrm_dst_destroy()).
> >
> > Do you see a dst leak as well?
> 
> Can you please guide me how to detect it?
> 
> (I am checking refcount on recent kernel and will let you know.)

Policy refcount is decreasing properly on 4.19.
Same should be on the latest kernel too.




RE: Help needed - Kernel lockup while running ipsec

2019-08-20 Thread Vakul Garg



> -Original Message-
> From: Florian Westphal 
> Sent: Tuesday, August 20, 2019 3:08 PM
> To: Vakul Garg 
> Cc: Florian Westphal ; netdev@vger.kernel.org
> Subject: Re: Help needed - Kernel lockup while running ipsec
> 
> Vakul Garg  wrote:
> >
> >
> > > -Original Message-
> > > From: Florian Westphal 
> > > Sent: Tuesday, August 20, 2019 2:53 PM
> > > To: Vakul Garg 
> > > Cc: Florian Westphal ; netdev@vger.kernel.org
> > > Subject: Re: Help needed - Kernel lockup while running ipsec
> > >
> > > Vakul Garg  wrote:
> > > > > > With kernel 4.14.122, I am getting a kernel softlockup while
> > > > > > running single
> > > > > static ipsec tunnel.
> > > > > > The problem reproduces mostly after running 8-10 hours of
> > > > > > ipsec encap
> > > > > test (on my dual core arm board).
> > > > > >
> > > > > > I found that in function xfrm_policy_lookup_bytype(), the
> > > > > > policy in variable
> > > > > 'ret' shows refcnt=0 under problem situation.
> > > > > > This creates an infinite loop in  xfrm_policy_lookup_bytype()
> > > > > > and hence the
> > > > > lockup.
> > > > > >
> > > > > > Can some body please provide me pointers about 'refcnt'?
> > > > > > Is it legitimate for 'refcnt' to become '0'? Under what
> > > > > > condition can it
> > > > > become '0'?
> > > > >
> > > > > Yes, when policy is destroyed and the last user calls
> > > > > xfrm_pol_put() which will invoke call_rcu to free the structure.
> > > >
> > > > It seems that policy reference count never gets decremented during
> > > > packet
> > > ipsec encap.
> > > > It is getting incremented for every frame that hits the policy.
> > > > In setkey -DP output, I see refcnt to be wrapping around after '0'.
> > >
> > > Thats a bug.  Does this affect 4.14 only or does this happen on
> > > current tree as well?
> >
> > I am yet to try it on 4.19.
> > Can you help me with the right fix? Which part of code should it get
> decremented?
> > I am not conversant with xfrm code.
> 
> Normally policy reference counts get decremented when the skb is free'd, via
> dst destruction (xfrm_dst_destroy()).
> 
> Do you see a dst leak as well?

Can you please guide me how to detect it?

(I am checking refcount on recent kernel and will let you know.)


Re: Help needed - Kernel lockup while running ipsec

2019-08-20 Thread Florian Westphal
Vakul Garg  wrote:
> 
> 
> > -Original Message-
> > From: Florian Westphal 
> > Sent: Tuesday, August 20, 2019 2:53 PM
> > To: Vakul Garg 
> > Cc: Florian Westphal ; netdev@vger.kernel.org
> > Subject: Re: Help needed - Kernel lockup while running ipsec
> > 
> > Vakul Garg  wrote:
> > > > > With kernel 4.14.122, I am getting a kernel softlockup while
> > > > > running single
> > > > static ipsec tunnel.
> > > > > The problem reproduces mostly after running 8-10 hours of ipsec
> > > > > encap
> > > > test (on my dual core arm board).
> > > > >
> > > > > I found that in function xfrm_policy_lookup_bytype(), the policy
> > > > > in variable
> > > > 'ret' shows refcnt=0 under problem situation.
> > > > > This creates an infinite loop in  xfrm_policy_lookup_bytype() and
> > > > > hence the
> > > > lockup.
> > > > >
> > > > > Can some body please provide me pointers about 'refcnt'?
> > > > > Is it legitimate for 'refcnt' to become '0'? Under what condition
> > > > > can it
> > > > become '0'?
> > > >
> > > > Yes, when policy is destroyed and the last user calls
> > > > xfrm_pol_put() which will invoke call_rcu to free the structure.
> > >
> > > It seems that policy reference count never gets decremented during packet
> > ipsec encap.
> > > It is getting incremented for every frame that hits the policy.
> > > In setkey -DP output, I see refcnt to be wrapping around after '0'.
> > 
> > Thats a bug.  Does this affect 4.14 only or does this happen on current tree
> > as well?
>  
> I am yet to try it on 4.19.
> Can you help me with the right fix? Which part of code should it get 
> decremented?
> I am not conversant with xfrm code.

Normally policy reference counts get decremented when the skb is free'd, via dst
destruction (xfrm_dst_destroy()).

Do you see a dst leak as well?



RE: Help needed - Kernel lockup while running ipsec

2019-08-20 Thread Vakul Garg



> > -Original Message-
> > From: Florian Westphal 
> > Sent: Tuesday, August 20, 2019 2:53 PM
> > To: Vakul Garg 
> > Cc: Florian Westphal ; netdev@vger.kernel.org
> > Subject: Re: Help needed - Kernel lockup while running ipsec
> >
> > Vakul Garg  wrote:
> > > > > With kernel 4.14.122, I am getting a kernel softlockup while
> > > > > running single
> > > > static ipsec tunnel.
> > > > > The problem reproduces mostly after running 8-10 hours of ipsec
> > > > > encap
> > > > test (on my dual core arm board).
> > > > >
> > > > > I found that in function xfrm_policy_lookup_bytype(), the policy
> > > > > in variable
> > > > 'ret' shows refcnt=0 under problem situation.
> > > > > This creates an infinite loop in  xfrm_policy_lookup_bytype() and
> > > > > hence the
> > > > lockup.
> > > > >
> > > > > Can some body please provide me pointers about 'refcnt'?
> > > > > Is it legitimate for 'refcnt' to become '0'? Under what condition
> > > > > can it
> > > > become '0'?
> > > >
> > > > Yes, when policy is destroyed and the last user calls
> > > > xfrm_pol_put() which will invoke call_rcu to free the structure.
> > >
> > > It seems that policy reference count never gets decremented during
> packet
> > ipsec encap.
> > > It is getting incremented for every frame that hits the policy.
> > > In setkey -DP output, I see refcnt to be wrapping around after '0'.
> >
> > Thats a bug.  Does this affect 4.14 only or does this happen on current tree
> > as well?
> 
> I am yet to try it on 4.19.

Correction: I am yet to try it on current tree.

> Can you help me with the right fix? Which part of code should it get
> decremented?
> I am not conversant with xfrm code.



RE: Help needed - Kernel lockup while running ipsec

2019-08-20 Thread Vakul Garg



> -Original Message-
> From: Florian Westphal 
> Sent: Tuesday, August 20, 2019 2:53 PM
> To: Vakul Garg 
> Cc: Florian Westphal ; netdev@vger.kernel.org
> Subject: Re: Help needed - Kernel lockup while running ipsec
> 
> Vakul Garg  wrote:
> > > > With kernel 4.14.122, I am getting a kernel softlockup while
> > > > running single
> > > static ipsec tunnel.
> > > > The problem reproduces mostly after running 8-10 hours of ipsec
> > > > encap
> > > test (on my dual core arm board).
> > > >
> > > > I found that in function xfrm_policy_lookup_bytype(), the policy
> > > > in variable
> > > 'ret' shows refcnt=0 under problem situation.
> > > > This creates an infinite loop in  xfrm_policy_lookup_bytype() and
> > > > hence the
> > > lockup.
> > > >
> > > > Can some body please provide me pointers about 'refcnt'?
> > > > Is it legitimate for 'refcnt' to become '0'? Under what condition
> > > > can it
> > > become '0'?
> > >
> > > Yes, when policy is destroyed and the last user calls
> > > xfrm_pol_put() which will invoke call_rcu to free the structure.
> >
> > It seems that policy reference count never gets decremented during packet
> ipsec encap.
> > It is getting incremented for every frame that hits the policy.
> > In setkey -DP output, I see refcnt to be wrapping around after '0'.
> 
> Thats a bug.  Does this affect 4.14 only or does this happen on current tree
> as well?
 
I am yet to try it on 4.19.
Can you help me with the right fix? Which part of code should it get 
decremented?
I am not conversant with xfrm code.



Re: Help needed - Kernel lockup while running ipsec

2019-08-20 Thread Florian Westphal
Vakul Garg  wrote:
> > > With kernel 4.14.122, I am getting a kernel softlockup while running 
> > > single
> > static ipsec tunnel.
> > > The problem reproduces mostly after running 8-10 hours of ipsec encap
> > test (on my dual core arm board).
> > >
> > > I found that in function xfrm_policy_lookup_bytype(), the policy in 
> > > variable
> > 'ret' shows refcnt=0 under problem situation.
> > > This creates an infinite loop in  xfrm_policy_lookup_bytype() and hence 
> > > the
> > lockup.
> > >
> > > Can some body please provide me pointers about 'refcnt'?
> > > Is it legitimate for 'refcnt' to become '0'? Under what condition can it
> > become '0'?
> > 
> > Yes, when policy is destroyed and the last user calls
> > xfrm_pol_put() which will invoke call_rcu to free the structure.
> 
> It seems that policy reference count never gets decremented during packet 
> ipsec encap.
> It is getting incremented for every frame that hits the policy.
> In setkey -DP output, I see refcnt to be wrapping around after '0'.

Thats a bug.  Does this affect 4.14 only or does this happen on current
tree as well?


RE: Help needed - Kernel lockup while running ipsec

2019-08-20 Thread Vakul Garg
Thanks for your response.


> -Original Message-
> From: Florian Westphal 
> Sent: Monday, August 19, 2019 11:08 PM
> To: Vakul Garg 
> Cc: netdev@vger.kernel.org
> Subject: Re: Help needed - Kernel lockup while running ipsec
> 
> Vakul Garg  wrote:
> > Hi
> >
> > With kernel 4.14.122, I am getting a kernel softlockup while running single
> static ipsec tunnel.
> > The problem reproduces mostly after running 8-10 hours of ipsec encap
> test (on my dual core arm board).
> >
> > I found that in function xfrm_policy_lookup_bytype(), the policy in variable
> 'ret' shows refcnt=0 under problem situation.
> > This creates an infinite loop in  xfrm_policy_lookup_bytype() and hence the
> lockup.
> >
> > Can some body please provide me pointers about 'refcnt'?
> > Is it legitimate for 'refcnt' to become '0'? Under what condition can it
> become '0'?
> 
> Yes, when policy is destroyed and the last user calls
> xfrm_pol_put() which will invoke call_rcu to free the structure.

It seems that policy reference count never gets decremented during packet ipsec 
encap.
It is getting incremented for every frame that hits the policy.
In setkey -DP output, I see refcnt to be wrapping around after '0'.

Is this designed to be like this or is it weird?



Re: Help needed - Kernel lockup while running ipsec

2019-08-19 Thread Florian Westphal
Vakul Garg  wrote:
> Hi
> 
> With kernel 4.14.122, I am getting a kernel softlockup while running single 
> static ipsec tunnel.
> The problem reproduces mostly after running 8-10 hours of ipsec encap test 
> (on my dual core arm board).
> 
> I found that in function xfrm_policy_lookup_bytype(), the policy in variable 
> 'ret' shows refcnt=0 under problem situation.
> This creates an infinite loop in  xfrm_policy_lookup_bytype() and hence the 
> lockup.
> 
> Can some body please provide me pointers about 'refcnt'?
> Is it legitimate for 'refcnt' to become '0'? Under what condition can it 
> become '0'?

Yes, when policy is destroyed and the last user calls
xfrm_pol_put() which will invoke call_rcu to free the structure.


Help needed - Kernel lockup while running ipsec

2019-08-19 Thread Vakul Garg
Hi

With kernel 4.14.122, I am getting a kernel softlockup while running single 
static ipsec tunnel.
The problem reproduces mostly after running 8-10 hours of ipsec encap test (on 
my dual core arm board).

I found that in function xfrm_policy_lookup_bytype(), the policy in variable 
'ret' shows refcnt=0 under problem situation.
This creates an infinite loop in  xfrm_policy_lookup_bytype() and hence the 
lockup.

Can some body please provide me pointers about 'refcnt'?
Is it legitimate for 'refcnt' to become '0'? Under what condition can it become 
'0'?

Regards
Vakul


Re: Help needed!

2018-02-04 Thread Sandra Younes
Good Day,

Forgive my indignation if this message comes to you as a surprise and may 
offend your personality for contacting you without your prior consent and 
writing through this channel.

I came across your name and contact on the course of my personal searching when 
i was searching for a foreign reliable partner. I was assured of your 
capability and reliability after going true your profile.

I'm (Miss. Sandra) from Benghazi libya, My father of blessed memory by name 
late General Abdel Fattah Younes who was shot death by Islamist-linked militia 
within the anti-Gaddafi forces on 28th July, 2011 and after two days later my 
mother with my two brothers was killed one early morning by the rebels as 
result of civil war that is going on in my country Libya, then after the burial 
of my parents, my uncles conspired and sold my father's properties and left 
nothing for me. On a faithful morning, I opened my father's briefcase and 
discover a document which he has deposited ($6.250M USD) in a bank in a Turkish 
Bank which has a small branch in Canada with my name as the legitimate/next of 
kin. Meanwhile i have located the bank,and have also discussed the possiblity 
of transfering the fund. My father left a clause to the bank that i must 
introduce a trusted foreign partner who would be my trustee to help me invest 
this fund; hence the need for your assistance,i request that you be my tr
 ustee and assist me in th

You will also be responsible for the investment and management of the fund for 
me and also you will help me get a good school where i will further my 
education.
I agreed to give you 40% of the $6.250M once the transfer is done. this is my 
true life story, I will be glad to receive your respond soonest for more 
details to enable us start and champion the transfer less than 14 banking days 
as i was informed by the bank manager.

Thanks for giving me your attention,

Yours sincerely,
Miss. Sandra Younes


Re: rtk8168 driver help needed

2016-05-24 Thread Murali Karicheri
On 05/19/2016 08:31 PM, Francois Romieu wrote:
> Murali Karicheri  :
> [...]
>> Do you what could be wrong with rtk8168?
> 
> Hardly.
> 
> What do the device registers (ethtool -d) and device stats (ethtool -S)
> look like ?
Will dump in the next opportunity and respond
> 
> (please trim useless material from previous mail)
> 
Ok. Will keep in mind next time.

-- 
Murali Karicheri
Linux Kernel, Keystone


Re: rtk8168 driver help needed

2016-05-19 Thread Francois Romieu
Murali Karicheri  :
[...]
> Do you what could be wrong with rtk8168?

Hardly.

What do the device registers (ethtool -d) and device stats (ethtool -S)
look like ?

(please trim useless material from previous mail)

-- 
Ueimor


Re: rtk8168 driver help needed

2016-05-19 Thread Murali Karicheri
On 05/07/2016 04:35 AM, Francois Romieu wrote:
> Murali Karicheri  :
> [...]
>> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
>> on my Keystone EVM.
> 
> Which (EVM) one ?
> 
>> I purchased the rtl8111c Gib card from Amazon. The Card is detected
>> by the RC and I can see it is enumerated and show up when doing lspci 
>> command.
> 
> What does "the RC" mean ? A different PC ?
> 
>> However I can't get the Ethernet port functional.
> 
>> Does this need MSI interrupt ?
> 
> No.
> 
>> I can't see it has requested any.
> 
> Yes, something went really, really wrong. See below.
> 
I have figured out why I was getting all zeros over the PCIe bus. The PCIe 
address range used by the CPU to access the PCI space is wrong. Once that
is fixed, I was able to test few PCIe EP devices such as Intel e1000e, Broadcom
tg3, Marvel SATA etc. But the rtk8168 driver still don't work. I have following
log now.

[2.372877] pci_bus :00: root bus resource [bus 00-ff]
[2.378362] pci_bus :00: root bus resource [io  0x-0x3fff]
[2.384609] pci_bus :00: root bus resource [mem 0x7000-0x7fff]
[2.392155] PCI: bus0: Fast back to back transfers disabled
[2.411222] PCI: bus1: Fast back to back transfers disabled
[2.416964] pci :00:00.0: BAR 8: assigned [mem 0x7000-0x700f]
[2.423927] pci :00:00.0: BAR 9: assigned [mem 0x7010-0x701f
pref]
[2.431217] pci :00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
[2.437315] pci :01:00.0: BAR 6: assigned [mem 0x7010-0x7011
pref]
[2.444597] pci :01:00.0: BAR 4: assigned [mem 0x7012-0x7012
64bit pref]
[2.452383] pci :01:00.0: BAR 2: assigned [mem 0x7000-0x7fff
64bit]
[2.459705] pci :01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
[2.465825] pci :00:00.0: PCI bridge to [bus 01]
[2.470788] pci :00:00.0:   bridge window [io  0x1000-0x1fff]
[2.476905] pci :00:00.0:   bridge window [mem 0x7000-0x700f]
[2.483711] pci :00:00.0:   bridge window [mem 0x7010-0x701f
pref]


And then 

root@k2g-evm:~# lspci -v
00:00.0 PCI bridge: Texas Instruments Device b00b (rev 01) (prog-if 00 [Normal
decode])
Flags: bus master, fast devsel, latency 0, IRQ 287
Memory at  (32-bit, non-prefetchable)
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 1000-1fff
Memory behind bridge: 7000-700f
Prefetchable memory behind bridge: 7010-701f
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Root Port (Slot-), MSI 00
Capabilities: [100] Advanced Error Reporting
Kernel driver in use: pcieport
lspci: Unable to load libkmod resources: error -12

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411
PCI Express Gigabit Ethernet Controller (rev 02)
Subsystem: Realtek Semiconductor Co., Ltd. Device 0123
Flags: fast devsel, IRQ 319
I/O ports at 1000 [disabled] [size=256]
Memory at 7000 (64-bit, non-prefetchable) [disabled] [size=4K]
Memory at 7012 (64-bit, prefetchable) [disabled] [size=64K]
[virtual] Expansion ROM at 7010 [disabled] [size=128K]
Capabilities: [40] Power Management version 0
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 01
Capabilities: [b0] MSI-X: Enable- Count=2 Masked-
Capabilities: [d0] Vital Product Data
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00


And then

root@k2g-evm:/# insmod r8169.ko
[   43.980877] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[   43.986609] r8169 :01:00.0: enabling device (0140 -> 0143)
[   43.993132] r8169 :01:00.0: limiting MRRS to 256
[   44.004152] r8169 :01:00.0 eth1: RTL8168c/8111c at 0xf0f56000,
00:e0:4c:21:16:2c, XID 1c4000c0 IRQ 288
[   44.024167] r8169 :01:00.0 eth1: jumbo features [frames: 6128 bytes, tx
checksumming: ko]
root@k2g-evm:/# ifup eth1
[   51.782650] r8169 :01:00.0 eth1: link down
[   51.787121] r8169 :01:00.0 eth1: link down
[   51.792348] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
udhcpc (v1.23.1) started
Sending discover...
[   54.158011] r8169 :01:00.0 eth1: link up
[   54.162344] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
Sending discover...
Sending discover...
No lease, forking to background
root@k2g-evm:/# ifconfig
eth0  Link encap:Ethernet  HWaddr 50:72:24:D6:DE:ED
  UP BROADCAST MULTICAST  MTU:1500  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:0

Re: rtk8168 driver help needed

2016-05-09 Thread Murali Karicheri
On 05/09/2016 01:25 PM, Murali Karicheri wrote:
> On 05/09/2016 10:54 AM, Murali Karicheri wrote:
>> Francois,
>>
>> Thanks for responding.
>>
>> On 05/07/2016 04:35 AM, Francois Romieu wrote:
>>> Murali Karicheri  :
>>> [...]
 I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
 on my Keystone EVM.
>>>
>>> Which (EVM) one ?
>> K2G EVM. This is a new EVM for which work has been started to add it to 
>> upstream
>> kernel. But it not there yet. The PCIe h/w in the K2G SoC is a re-use from
>> existing SoC such as K2E. The PCIe controller (Root complex a.k.a RC) driver
>> based on this PCIe h/w works fine on K2E EVM with a Marvel SATA controller
>> connected to the PCIe port. On K2G EVM, I have a PCIe slot to which I have
>> plugged the rtl8168 PCIe card and power on with the log I had sent you. The
>> serdes driver is responsible for link setup seems to work fine, link is up 
>> and
>> could detect the rtl8168 below.
>>>
 I purchased the rtl8111c Gib card from Amazon. The Card is detected
 by the RC and I can see it is enumerated and show up when doing lspci 
 command.
>>>
>>> What does "the RC" mean ? A different PC ?
>>
>> RC - Root Complex (PCIe controller - drivers/pci/host/pci-keystone.c, a 
>> designware
>> based PCIe controller driver)
>>
>> The the PCIe controller driver bindings...
>>
>> pcie0_phy: phy@232 {
>> #phy-cells = <0>;
>> compatible = "ti,keystone-serdes-pcie";
>> reg = <0x0232 0x4000>;
>> link-rate-kbps = <500>;
>> num-lanes = <1>;
>> status = "disabled";
>> };
>>
>> pcie0: pcie@2180 {
>> compatible = "ti,keystone-pcie", "snps,dw-pcie";
>> power-domains = <&k2g_pds K2G_DEV_PCIE0>;
>> clocks = <&k2g_clks K2G_DEV_PCIE0 
>> K2G_DEV_PCIE_VBUS_CLK>;
>> clock-names = "pcie";
>> #address-cells = <3>;
>> #size-cells = <2>;
>> reg =  <0x21801000 0x2000>, <0x2180 0x1000>, 
>> <0x02620128 4>;
>> ranges = <0x8100 0 0 0x2325 0 0x4000
>> 0x8200 0 0x5000 0x5000 0 
>> 0x1000>;
>>
>> status = "disabled";
>> device_type = "pci";
>> num-lanes = <1>;
>> phys = <&pcie0_phy>;
>>
>> #interrupt-cells = <1>;
>> interrupt-map-mask = <0 0 0 7>;
>> interrupt-map = <0 0 0 1 &pcie_intc0 0>, /* INT A */
>> <0 0 0 2 &pcie_intc0 1>, /* INT B */
>> <0 0 0 3 &pcie_intc0 2>, /* INT C */
>> <0 0 0 4 &pcie_intc0 3>; /* INT D */
>> pcie_msi_intc0: msi-interrupt-controller {
>> interrupt-controller;
>> #interrupt-cells = <1>;
>> interrupt-parent = <&gic>;
>> interrupts = > IRQ_TYPE_EDGE_RISING>,
>> ,
>> ,
>> ,
>> ,
>> ,
>> ,
>> ;
>> };
>>
>> pcie_intc0: legacy-interrupt-controller {
>> interrupt-controller;
>> #interrupt-cells = <1>;
>> interrupt-parent = <&gic>;
>> interrupts = > IRQ_TYPE_EDGE_RISING>,
>> ,
>> ,
>> ;
>> };
>> };
>>
>>
>>>
 However I can't get the Ethernet port functional.
>>>
 Does this need MSI interrupt ?
>>>
>>> No.
>>
>> Does it also work with MSI?? Is there anything to be set in the driver
>> to request MSI interrupt?
>>
>>>
 I can't see it has requested any.
>>>
>>> Yes, something went really, really wrong. See below.
>>>
>>> [...]
 [2.303965] PCI host bridge /soc/pcie@2180 ranges:
 [2.309108]   No bus range found for /soc/pcie@2180, using [bus 
 00-ff]
 [2.316269]IO 0x2325..0x23253fff -> 0x
 [2.321499]   MEM 0x5000..0x5fff -> 0x5000
 [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
 [2.338283] pci_bus :00: root bus resource [bus 00-ff]
 [2.343

Re: rtk8168 driver help needed

2016-05-09 Thread Murali Karicheri
On 05/09/2016 10:54 AM, Murali Karicheri wrote:
> Francois,
> 
> Thanks for responding.
> 
> On 05/07/2016 04:35 AM, Francois Romieu wrote:
>> Murali Karicheri  :
>> [...]
>>> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
>>> on my Keystone EVM.
>>
>> Which (EVM) one ?
> K2G EVM. This is a new EVM for which work has been started to add it to 
> upstream
> kernel. But it not there yet. The PCIe h/w in the K2G SoC is a re-use from
> existing SoC such as K2E. The PCIe controller (Root complex a.k.a RC) driver
> based on this PCIe h/w works fine on K2E EVM with a Marvel SATA controller
> connected to the PCIe port. On K2G EVM, I have a PCIe slot to which I have
> plugged the rtl8168 PCIe card and power on with the log I had sent you. The
> serdes driver is responsible for link setup seems to work fine, link is up and
> could detect the rtl8168 below.
>>
>>> I purchased the rtl8111c Gib card from Amazon. The Card is detected
>>> by the RC and I can see it is enumerated and show up when doing lspci 
>>> command.
>>
>> What does "the RC" mean ? A different PC ?
> 
> RC - Root Complex (PCIe controller - drivers/pci/host/pci-keystone.c, a 
> designware
> based PCIe controller driver)
> 
> The the PCIe controller driver bindings...
> 
> pcie0_phy: phy@232 {
> #phy-cells = <0>;
> compatible = "ti,keystone-serdes-pcie";
> reg = <0x0232 0x4000>;
> link-rate-kbps = <500>;
> num-lanes = <1>;
> status = "disabled";
> };
> 
> pcie0: pcie@2180 {
> compatible = "ti,keystone-pcie", "snps,dw-pcie";
> power-domains = <&k2g_pds K2G_DEV_PCIE0>;
> clocks = <&k2g_clks K2G_DEV_PCIE0 
> K2G_DEV_PCIE_VBUS_CLK>;
> clock-names = "pcie";
> #address-cells = <3>;
> #size-cells = <2>;
> reg =  <0x21801000 0x2000>, <0x2180 0x1000>, 
> <0x02620128 4>;
> ranges = <0x8100 0 0 0x2325 0 0x4000
> 0x8200 0 0x5000 0x5000 0 
> 0x1000>;
> 
> status = "disabled";
> device_type = "pci";
> num-lanes = <1>;
> phys = <&pcie0_phy>;
> 
> #interrupt-cells = <1>;
> interrupt-map-mask = <0 0 0 7>;
> interrupt-map = <0 0 0 1 &pcie_intc0 0>, /* INT A */
> <0 0 0 2 &pcie_intc0 1>, /* INT B */
> <0 0 0 3 &pcie_intc0 2>, /* INT C */
> <0 0 0 4 &pcie_intc0 3>; /* INT D */
> pcie_msi_intc0: msi-interrupt-controller {
> interrupt-controller;
> #interrupt-cells = <1>;
> interrupt-parent = <&gic>;
> interrupts =  IRQ_TYPE_EDGE_RISING>,
> ,
> ,
> ,
> ,
> ,
> ,
> ;
> };
> 
> pcie_intc0: legacy-interrupt-controller {
> interrupt-controller;
> #interrupt-cells = <1>;
> interrupt-parent = <&gic>;
> interrupts =  IRQ_TYPE_EDGE_RISING>,
> ,
> ,
> ;
> };
> };
> 
> 
>>
>>> However I can't get the Ethernet port functional.
>>
>>> Does this need MSI interrupt ?
>>
>> No.
> 
> Does it also work with MSI?? Is there anything to be set in the driver
> to request MSI interrupt?
> 
>>
>>> I can't see it has requested any.
>>
>> Yes, something went really, really wrong. See below.
>>
>> [...]
>>> [2.303965] PCI host bridge /soc/pcie@2180 ranges:
>>> [2.309108]   No bus range found for /soc/pcie@2180, using [bus 
>>> 00-ff]
>>> [2.316269]IO 0x2325..0x23253fff -> 0x
>>> [2.321499]   MEM 0x5000..0x5fff -> 0x5000
>>> [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
>>> [2.338283] pci_bus :00: root bus resource [bus 00-ff]
>>> [2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
>>> [2.350114] pci_bus :00: root bus resource [mem 
>>> 0x5000-0x5fff]
>>> [2.35

Re: rtk8168 driver help needed

2016-05-09 Thread Murali Karicheri
Francois,

Thanks for responding.

On 05/07/2016 04:35 AM, Francois Romieu wrote:
> Murali Karicheri  :
> [...]
>> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
>> on my Keystone EVM.
> 
> Which (EVM) one ?
K2G EVM. This is a new EVM for which work has been started to add it to upstream
kernel. But it not there yet. The PCIe h/w in the K2G SoC is a re-use from
existing SoC such as K2E. The PCIe controller (Root complex a.k.a RC) driver
based on this PCIe h/w works fine on K2E EVM with a Marvel SATA controller
connected to the PCIe port. On K2G EVM, I have a PCIe slot to which I have
plugged the rtl8168 PCIe card and power on with the log I had sent you. The
serdes driver is responsible for link setup seems to work fine, link is up and
could detect the rtl8168 below.
> 
>> I purchased the rtl8111c Gib card from Amazon. The Card is detected
>> by the RC and I can see it is enumerated and show up when doing lspci 
>> command.
> 
> What does "the RC" mean ? A different PC ?

RC - Root Complex (PCIe controller - drivers/pci/host/pci-keystone.c, a 
designware
based PCIe controller driver)

The the PCIe controller driver bindings...

pcie0_phy: phy@232 {
#phy-cells = <0>;
compatible = "ti,keystone-serdes-pcie";
reg = <0x0232 0x4000>;
link-rate-kbps = <500>;
num-lanes = <1>;
status = "disabled";
};

pcie0: pcie@2180 {
compatible = "ti,keystone-pcie", "snps,dw-pcie";
power-domains = <&k2g_pds K2G_DEV_PCIE0>;
clocks = <&k2g_clks K2G_DEV_PCIE0 
K2G_DEV_PCIE_VBUS_CLK>;
clock-names = "pcie";
#address-cells = <3>;
#size-cells = <2>;
reg =  <0x21801000 0x2000>, <0x2180 0x1000>, 
<0x02620128 4>;
ranges = <0x8100 0 0 0x2325 0 0x4000
0x8200 0 0x5000 0x5000 0 
0x1000>;

status = "disabled";
device_type = "pci";
num-lanes = <1>;
phys = <&pcie0_phy>;

#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0 0 0 1 &pcie_intc0 0>, /* INT A */
<0 0 0 2 &pcie_intc0 1>, /* INT B */
<0 0 0 3 &pcie_intc0 2>, /* INT C */
<0 0 0 4 &pcie_intc0 3>; /* INT D */
pcie_msi_intc0: msi-interrupt-controller {
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&gic>;
interrupts = ,
,
,
,
,
,
,
;
};

pcie_intc0: legacy-interrupt-controller {
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&gic>;
interrupts = ,
,
,
;
};
};


> 
>> However I can't get the Ethernet port functional.
> 
>> Does this need MSI interrupt ?
> 
> No.

Does it also work with MSI?? Is there anything to be set in the driver
to request MSI interrupt?

> 
>> I can't see it has requested any.
> 
> Yes, something went really, really wrong. See below.
> 
> [...]
>> [2.303965] PCI host bridge /soc/pcie@2180 ranges:
>> [2.309108]   No bus range found for /soc/pcie@2180, using [bus 00-ff]
>> [2.316269]IO 0x2325..0x23253fff -> 0x
>> [2.321499]   MEM 0x5000..0x5fff -> 0x5000
>> [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
>> [2.338283] pci_bus :00: root bus resource [bus 00-ff]
>> [2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
>> [2.350114] pci_bus :00: root bus resource [mem 0x5000-0x5fff]
>> [2.357095] pci :00:00.0: [104c:b00b] type 01 class 0x060400
>> [2.357665] PCI: bus0: Fast back to back transfers disabled
>> [2.363717] pci :01:00.0: [10ec:8168] type 00 class 0x02
>> [2.363809] pci :01:00.0: reg 0x10: [io  0x-0x00ff]
>> [2.363867] pci :01:00.0:

Re: rtk8168 driver help needed

2016-05-07 Thread Francois Romieu
Murali Karicheri  :
[...]
> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
> on my Keystone EVM.

Which (EVM) one ?

> I purchased the rtl8111c Gib card from Amazon. The Card is detected
> by the RC and I can see it is enumerated and show up when doing lspci command.

What does "the RC" mean ? A different PC ?

> However I can't get the Ethernet port functional.

> Does this need MSI interrupt ?

No.

> I can't see it has requested any.

Yes, something went really, really wrong. See below.

[...]
> [2.303965] PCI host bridge /soc/pcie@2180 ranges:
> [2.309108]   No bus range found for /soc/pcie@2180, using [bus 00-ff]
> [2.316269]IO 0x2325..0x23253fff -> 0x
> [2.321499]   MEM 0x5000..0x5fff -> 0x5000
> [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
> [2.338283] pci_bus :00: root bus resource [bus 00-ff]
> [2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
> [2.350114] pci_bus :00: root bus resource [mem 0x5000-0x5fff]
> [2.357095] pci :00:00.0: [104c:b00b] type 01 class 0x060400
> [2.357665] PCI: bus0: Fast back to back transfers disabled
> [2.363717] pci :01:00.0: [10ec:8168] type 00 class 0x02
> [2.363809] pci :01:00.0: reg 0x10: [io  0x-0x00ff]
> [2.363867] pci :01:00.0: reg 0x18: [mem 0x-0x0fff 64bit]
> [2.363909] pci :01:00.0: reg 0x20: [mem 0x-0x 64bit 
> pref]
> [2.363939] pci :01:00.0: reg 0x30: [mem 0x-0x0001 pref]
> [2.364099] pci :01:00.0: supports D1 D2
> [2.364116] pci :01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [2.381251] PCI: bus1: Fast back to back transfers disabled
> [2.386989] pci :00:00.0: BAR 8: assigned [mem 0x5000-0x500f]
> [2.393937] pci :00:00.0: BAR 9: assigned [mem 0x5010-0x501f 
> pref]
> [2.401221] pci :00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
> [2.407320] pci :01:00.0: BAR 6: assigned [mem 0x5010-0x5011 
> pref]
> [2.414597] pci :01:00.0: BAR 4: assigned [mem 0x5012-0x5012 
> 64bit pref]
> [2.422380] pci :01:00.0: BAR 2: assigned [mem 0x5000-0x5fff 
> 64bit]
> [2.429702] pci :01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
> [2.435821] pci :00:00.0: PCI bridge to [bus 01]
> [2.440783] pci :00:00.0:   bridge window [io  0x1000-0x1fff]
> [2.446896] pci :00:00.0:   bridge window [mem 0x5000-0x500f]
> [2.453699] pci :00:00.0:   bridge window [mem 0x5010-0x501f 
> pref]
> [2.461453] pcieport :00:00.0: Signaling PME through PCIe PME interrupt
> [2.468411] pci :01:00.0: Signaling PME through PCIe PME interrupt
> [2.475075] pcie_pme :00:00.0:pcie01: service driver pcie_pme loaded
> [2.475392] aer :00:00.0:pcie02: service driver aer loaded
> [2.475652] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
> [2.481419] r8169 :01:00.0: enabling device (0140 -> 0143)
> [2.488865] r8169 :01:00.0 eth0: RTL8169 at 0xf0d6a000, 
> 00:00:00:00:00:00, XID  IRQ 286

No need to go further, there is a serious problem here.

Most of the XID bits are read from a mapped register. They're definitely not
expected to be null as the driver requires it to identify a proper chipset
(the common PCI configuration registers only tell that you aren't dealing
with a coffee machine).

Any read returning zeroes would not surprize me.

[...]
> Can someone help me figure out what is missing ?

Hardly at this point. I can only suggest to switch power off, plug
the 8168 device in a x86 (32 or 64 bits) system and check how it behaves.

-- 
Ueimor


Re: rtk8168 driver help needed

2016-05-06 Thread Murali Karicheri
On 05/06/2016 06:02 PM, Murali Karicheri wrote:
> Hi,
> 
> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional on 
> my
> Keystone EVM. I purchased the rtl8111c Gib card from Amazon. The Card is 
> detected
> by the RC and I can see it is enumerated and show up when doing lspci command.
> However I can't get the Ethernet port functional. Does this need MSI 
> interrupt?
> I can't see it has requested any.
> 
> root@k2g-evm:~# cat /proc/interrupts 
>CPU0   
>  18: 152104   GIC  27 Edge  arch_timer
>  22:   3326   GIC 196 Edge  serial
>  24:  0   GIC 120 Edge  253.i2c
>  25:  0   GIC 121 Edge  2530400.i2c
>  26: 14   GIC  98 Edge  21805800.spi
>  27:  0   GIC 160 Edge  268.keystone-dwc3, xhci-hcd:usb1
>  30:  0   GIC 228 Edge  gpmc
>  31:  0   GIC 229 Edge  21c8000.elm
>  32:159   GIC 356 Level 2a0.msgmgr rx_005_002
>  49:  0   GIC 232 Edge  270.edma_ccint
>  51:  0   GIC 249 Edge  270.edma_ccerrint
>  52:   1840   GIC 240 Edge  2728000.edma_ccint
>  54:  2   GIC 252 Edge  2728000.edma_ccerrint
>  57:   5424   GIC 128 Edge  mmc0
>  58:461   GIC 129 Edge  mmc1
> 285:  0  Keystone-PCIe-MSI-IRQ   0 Edge  PCIe PME, aerdrv
> IPI0:  0  CPU wakeup interrupts
> IPI1:  0  Timer broadcast interrupts
> IPI2:  0  Rescheduling interrupts
> IPI3:  0  Function call interrupts
> IPI4:  0  Single function call interrupts
> IPI5:  0  CPU stop interrupts
> IPI6:  0  IRQ work interrupts
> IPI7:  0  completion interrupts
> 
> 
> root@k2g-evm:~# ifconfig -a
> eth0  Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
>   BROADCAST MULTICAST  MTU:1500  Metric:1
>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1000 
>   RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Also why MAC address is showing all zeros? Any settings needed?

> 
> gre0  Link encap:UNSPEC  HWaddr 
> 00-00-00-00-00-00-00-50-00-00-00-00-00-00-00-00  
>   NOARP  MTU:1476  Metric:1
>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1 
>   RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> gretap0   Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
>   BROADCAST MULTICAST  MTU:1462  Metric:1
>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1000 
>   RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> loLink encap:Local Loopback  
>   inet addr:127.0.0.1  Mask:255.0.0.0
>   inet6 addr: ::1/128 Scope:Host
>   UP LOOPBACK RUNNING  MTU:65536  Metric:1
>   RX packets:14 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1 
>   RX bytes:968 (968.0 B)  TX bytes:968 (968.0 B)
> 
> tunl0 Link encap:UNSPEC  HWaddr 
> 00-00-00-00-31-00-00-50-00-00-00-00-00-00-00-00  
>   NOARP  MTU:1480  Metric:1
>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1 
>   RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> root@k2g-evm:~# ifup eth0
> ifconfig: SIOCSIFFLAGS: Cannot assign requested address
> 
> 
> [2.303965] PCI host bridge /soc/pcie@2180 ranges:
> [2.309108]   No bus range found for /soc/pcie@2180, using [bus 00-ff]
> [2.316269]IO 0x2325..0x23253fff -> 0x
> [2.321499]   MEM 0x5000..0x5fff -> 0x5000
> [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
> [2.338283] pci_bus :00: root bus resource [bus 00-ff]
> [2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
> [2.350114] pci_bus :00: root bus resource [mem 0x5000-0x5fff]
> [2.357095] pci :00:00.0: [104c:b00b] type 01 class 0x060400
> [2.357665] PCI: bus0: Fast back to back transfers disabled
> [2.363717] pci :01:00.0: [10ec:8168] type 00 class 0x02
> [2.363809] pci :01:00.0: reg 0x10: [io  0x-0x00ff]
> [2.363867] pci :01:00.0: reg 0x18: [mem 0x-0x0fff 64bit]
> [2.363909] pci :01:00.0: reg 0x20: [mem 0x-0x 64bit 
> pref]
> [2.363939] pci :01:00.0: reg 0x30: [mem 0x-0x0001 pref]
> [2.364099] pci :01:00.0: supports D1 D2
> [2.364116] pci :01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [2.381251] PCI: bus1: Fast back to ba

rtk8168 driver help needed

2016-05-06 Thread Murali Karicheri
Hi,

I am trying to integrate the rtl8168 PCIe card to have Ethernet functional on my
Keystone EVM. I purchased the rtl8111c Gib card from Amazon. The Card is 
detected
by the RC and I can see it is enumerated and show up when doing lspci command.
However I can't get the Ethernet port functional. Does this need MSI interrupt?
I can't see it has requested any.

root@k2g-evm:~# cat /proc/interrupts 
   CPU0   
 18: 152104   GIC  27 Edge  arch_timer
 22:   3326   GIC 196 Edge  serial
 24:  0   GIC 120 Edge  253.i2c
 25:  0   GIC 121 Edge  2530400.i2c
 26: 14   GIC  98 Edge  21805800.spi
 27:  0   GIC 160 Edge  268.keystone-dwc3, xhci-hcd:usb1
 30:  0   GIC 228 Edge  gpmc
 31:  0   GIC 229 Edge  21c8000.elm
 32:159   GIC 356 Level 2a0.msgmgr rx_005_002
 49:  0   GIC 232 Edge  270.edma_ccint
 51:  0   GIC 249 Edge  270.edma_ccerrint
 52:   1840   GIC 240 Edge  2728000.edma_ccint
 54:  2   GIC 252 Edge  2728000.edma_ccerrint
 57:   5424   GIC 128 Edge  mmc0
 58:461   GIC 129 Edge  mmc1
285:  0  Keystone-PCIe-MSI-IRQ   0 Edge  PCIe PME, aerdrv
IPI0:  0  CPU wakeup interrupts
IPI1:  0  Timer broadcast interrupts
IPI2:  0  Rescheduling interrupts
IPI3:  0  Function call interrupts
IPI4:  0  Single function call interrupts
IPI5:  0  CPU stop interrupts
IPI6:  0  IRQ work interrupts
IPI7:  0  completion interrupts


root@k2g-evm:~# ifconfig -a
eth0  Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
  BROADCAST MULTICAST  MTU:1500  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

gre0  Link encap:UNSPEC  HWaddr 
00-00-00-00-00-00-00-50-00-00-00-00-00-00-00-00  
  NOARP  MTU:1476  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1 
  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

gretap0   Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
  BROADCAST MULTICAST  MTU:1462  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

loLink encap:Local Loopback  
  inet addr:127.0.0.1  Mask:255.0.0.0
  inet6 addr: ::1/128 Scope:Host
  UP LOOPBACK RUNNING  MTU:65536  Metric:1
  RX packets:14 errors:0 dropped:0 overruns:0 frame:0
  TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1 
  RX bytes:968 (968.0 B)  TX bytes:968 (968.0 B)

tunl0 Link encap:UNSPEC  HWaddr 
00-00-00-00-31-00-00-50-00-00-00-00-00-00-00-00  
  NOARP  MTU:1480  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1 
  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@k2g-evm:~# ifup eth0
ifconfig: SIOCSIFFLAGS: Cannot assign requested address


[2.303965] PCI host bridge /soc/pcie@2180 ranges:
[2.309108]   No bus range found for /soc/pcie@2180, using [bus 00-ff]
[2.316269]IO 0x2325..0x23253fff -> 0x
[2.321499]   MEM 0x5000..0x5fff -> 0x5000
[2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
[2.338283] pci_bus :00: root bus resource [bus 00-ff]
[2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
[2.350114] pci_bus :00: root bus resource [mem 0x5000-0x5fff]
[2.357095] pci :00:00.0: [104c:b00b] type 01 class 0x060400
[2.357665] PCI: bus0: Fast back to back transfers disabled
[2.363717] pci :01:00.0: [10ec:8168] type 00 class 0x02
[2.363809] pci :01:00.0: reg 0x10: [io  0x-0x00ff]
[2.363867] pci :01:00.0: reg 0x18: [mem 0x-0x0fff 64bit]
[2.363909] pci :01:00.0: reg 0x20: [mem 0x-0x 64bit 
pref]
[2.363939] pci :01:00.0: reg 0x30: [mem 0x-0x0001 pref]
[2.364099] pci :01:00.0: supports D1 D2
[2.364116] pci :01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[2.381251] PCI: bus1: Fast back to back transfers disabled
[2.386989] pci :00:00.0: BAR 8: assigned [mem 0x5000-0x500f]
[2.393937] pci :00:00.0: BAR 9: assigned [mem 0x5010-0x501f 
pref]
[2.401221] pci :00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
[2.407320] pci :01:00.0: BAR 6: assigned [mem 0x5010-0x50

Re: [Help needed] Kernel level, OSI layers 2-3 Network driver developments, anyone in Northwest US region ?

2015-10-07 Thread John D Allen, Leveridge Systems INC
Kernel level, OSI layers 2-3 Network driver developments, anyone in Northwest 
US ?

thanks, John.

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

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


Ethernet frames filtering/relaying. Help needed

2007-05-21 Thread Primiano Tucci
Hi all, I'm new to this Mailing list
Some days ago I started development of a new 2.6 network driver (formerly it
should be a decentered Network Load Balancing driver).
I'm not too much familiar with kernel networking, so I'm asking you what's
the best approach to do something like this:
- Allocate a new tun interface... let's say tun0 (no problems with this
step)
- Monitor layer2 traffic on an existing device(let's say eth0).
-Catch all Ethernet frames arrived on eth0 with an arbitrary destination MAC
address let's say catch all the frames that has 01:00:02:03:04:05 as
destination MAC addr.
-Extrapolate the IP datagram contained in the frames and push it in tun0

I need some suggestions about the best approach to catch and relay Ethernet
frames on eth0. Should I use netfilter? Should I not?
Any help will be appreciated. Thanks

Primiano Tucci


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: anthropology of linux: help needed

2007-03-03 Thread Roel Bindels
m a a [EMAIL PROTECTED] ac uk schreef:
> Hello,
> 
> This is a rather strange e-mail for these mailing
> lists, I know. I am a third year Social Anthropology
> student in the University of Durham doing my
> dissertation (thesis) on the Anthropology of
> GNU/Linux. I would really appreciate if you could help
> me out and offer some of your time to fill in the
> questionnaire below- it will only take 2 minutes.
> Replies will be confidential and everything in the
> dissertation will be anonymous. Results will be
> e-mailed to participants upon request.
> 
> Thanks in advance, and... enjoy!
> Maria Kastrinou
> 
> 
> 
> QUESTIONS:
> 
> 1. When did you start using GNU/Linux OS?
6 years ago
> 
> 
> 2. What is your level of involvement?
> newbie/ user/ developer (delete as appropriate)
developer
> 
> 
> 3. Why are you using Linux?
I like it more than the alternatives
> 
> 
> 4. Is Linux fun? How?
It's safe, flexibel
> 
> 
> 5. Which distribution of Linux do you use?
For clients I normaly use SuSE - sometimes Ubuntu, for servers I use debian.
> 
> 
> 6. What in your opinion constitutes a ¡good hack¢?
Since hacking is not a negative thing, I think a good hack is some code
that does the job and also is very nice developed
> 
> 
> 7. Would you describe yourself as a ¡hacker¢?
if hacker is equelent to software developer, yes. If it is somebody that
cracks (cracker) code then no.
> 
> 
> 8. Which super-hero (apart from Tux) do you think
> would represent Linux best?
I don't believe superheroes excists. Linux does..
> 
> 
> 9. Describe Microsoft OS in one word.
buggy
> 
> 
> 10. How do you view the recent patent agreement
> between Microsoft and Novell?
I think NOVELL is a big boy and can play it's own game.
> 
> 
> 11. GNU GPL, copyleft and freedom of speech: good, bad
> or irrelevant?
very good
> 
> 
> 12. How many Linux mailing lists are you a member of?
10

> 
> 
> 13. Would you reply to a question sent through Linux
> mailing lists and why?
No ;), open communication
> 
> 
> 14. Microsoft vs. Linux: cathedral vs. bazaar or
> something altogether different?
Commercial vs Non-Commercial

> 
> 
> 15. Open Source or Free Software?
Open Source
> 
> 
> Personal Information:
> a) Age:
29
> b) Gender:
Male
> c) Occupation:
Tutor
> d) Your current geographic location:
Netherlands
> 
> Any other comments?
Nope
> 
> 
> Would you like me to e-mail you the results? YES/ NO
Put them on the list ;)
> 
> 
> Hope you enjoyed it!
> 
> THANK YOU!
> 
> Maria
> 
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-gcc" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: anthropology of linux: help needed

2007-02-24 Thread Haines Brown
> 
> 1. When did you start using GNU/Linux OS?

Not sure. Perhaps 2000. 

> 2. What is your level of involvement?
> newbie/ user/ developer (delete as appropriate)

user

> 3. Why are you using Linux?

Stability, keyboard-orientation (don't run a  desktop), more fun. 

> 4. Is Linux fun? How?

Yes. Modularization, file configuration give sense of understanding
and control.

> 5. Which distribution of Linux do you use?

Debian Sarge
 
> 6. What in your opinion constitutes a ¡good hack¢?

Not sure how to answer this.

> 7. Would you describe yourself as a ¡hacker¢?

No.

> 8. Which super-hero (apart from Tux) do you think
> would represent Linux best?

no opinion

> 9. Describe Microsoft OS in one word.

Clunky

> 10. How do you view the recent patent agreement
> between Microsoft and Novell?

Well, no strong opionion.

> 11. GNU GPL, copyleft and freedom of speech: good, bad
> or irrelevant?

Good. Most of my work depends on fair use doctrine.

> 12. How many Linux mailing lists are you a member of?

Not sure. Perhaps four.

> 13. Would you reply to a question sent through Linux
> mailing lists and why?

Yes. Desire to be helpful.

> 14. Microsoft vs. Linux: cathedral vs. bazaar or
> something altogether different?

Good question. I felt "cathedral vs. bazaar" was a bit rhetorical and
inflated. I see MS as example of capitalism, while Linux is more petit
bourgeois. Their difference is not my concern.

> 15. Open Source or Free Software?

Not either or. Not being a developer, I can only support open source
at a distance as a good idea. Free software does affect me because I'm
low income. The two seem interdependent.

> Personal Information:
> a) Age: 71
> b) Gender: M
> c) Occupation: retire teacher
> d) Your current geographic location: Connecticut, US
> 
> Any other comments?
> 
> 
> Would you like me to e-mail you the results? YES/ NO

yes
> 
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


anthropology of linux: help needed

2007-02-22 Thread m a a [EMAIL PROTECTED] ac uk

Hello,

This is a rather strange e-mail for these mailing
lists, I know. I am a third year Social Anthropology
student in the University of Durham doing my
dissertation (thesis) on the Anthropology of
GNU/Linux. I would really appreciate if you could help
me out and offer some of your time to fill in the
questionnaire below- it will only take 2 minutes.
Replies will be confidential and everything in the
dissertation will be anonymous. Results will be
e-mailed to participants upon request.

Thanks in advance, and... enjoy!
Maria Kastrinou



QUESTIONS:

1. When did you start using GNU/Linux OS?


2. What is your level of involvement?
newbie/ user/ developer (delete as appropriate)


3. Why are you using Linux?


4. Is Linux fun? How?


5. Which distribution of Linux do you use?


6. What in your opinion constitutes a ¡good hack¢?


7. Would you describe yourself as a ¡hacker¢?


8. Which super-hero (apart from Tux) do you think
would represent Linux best?


9. Describe Microsoft OS in one word.


10. How do you view the recent patent agreement
between Microsoft and Novell?


11. GNU GPL, copyleft and freedom of speech: good, bad
or irrelevant?


12. How many Linux mailing lists are you a member of?


13. Would you reply to a question sent through Linux
mailing lists and why?


14. Microsoft vs. Linux: cathedral vs. bazaar or
something altogether different?


15. Open Source or Free Software?


Personal Information:
a) Age:
b) Gender:
c) Occupation:
d) Your current geographic location:

Any other comments?


Would you like me to e-mail you the results? YES/ NO


Hope you enjoyed it!

THANK YOU!

Maria




-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


help needed in n/w

2006-04-12 Thread varun

Hi all,

   Iam new to netfilters and iam trying to play around to 
understand a few things. By default when no policies are specified then 
it allows all traffic to go out and in to the n/w. I want to change this 
to default as deny.

   That is when there is no policy all should be default deny.

 So in order to achieve that i tried to change the  code a little.
  In the file iptable_filter.c there is a variable called 
static int forward = NF_ACCEPT
   I changed this to NF_DROP and when i compiled and used it 
sure i was not able to send any or recv any packets
   but even after i give a policy like iptables -t filter -A 
INPUT -j ACCEPT
   Nothing changes. So achieve what i want what should i do? 
And where do i change?


   Another thing is that in normally when i put a policy like 
iptables -t filter -A OUTPUT -j REJECT

Even my own self IP doesnt ping? Why should this happen?
 Isint it ok to ping local ip and loopback ip?
  If i want such implementation where i should be able to 
ping to self and local but not any other ip?

  Is it possible?
  I dont want to add policies rather is it possible just by 
changing the iptables kernel code?


  Please help me on this?

Varun
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html