Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic.
From: Arun Sudhilal @ 2018-10-23  4:46 UTC (permalink / raw)
  To: mhocko-DgEjT+Ai2ygdnm+yROfE0A
  Cc: snitzer-H+wXaHxf7aLQT0dZR+AlfA,
	benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r,
	kemi.wang-ral2JQCrhuEAvxtiuMwx3w,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	bfields-uC3wQj2KruNg9hUCZPvPmw, linux-sctp-u79uwXL29TY76Z2rM5mHXA,
	paulus-eUNUBHrolfbYtjvyW6yDsg, pavel-+ZI9xUNit7I,
	cl-vYTEC60ixJUAvxtiuMwx3w, kys-0li6OtcxBFHby3iVrkZq2A,
	sumit.semwal-QSEj5FYQhm4dnm+yROfE0A, David1.Zhou-5C7GfCeVMHo,
	ptesarik-IBi9RG/b67k, mpe-Gsx/Oe8HsFggBc27wqDAHg,
	ceph-devel-u79uwXL29TY76Z2rM5mHXA, jejb-6jwH94ZQLHl74goWV3ctuw,
	kasan-dev-/JYPxA39Uh5TLH3MbocFFw,
	marcos.souza.org-Re5JQEeQqe8AvxtiuMwx3w,
	steven.hill-YGCgFSpz5w/QT0dZR+AlfA,
	rientjes-hpIqsD4AKlfQT0dZR+AlfA,
	anthony.yznaga-QHcLZuEGTsvQT0dZR+AlfA,
	neelx-H+wXaHxf7aLQT0dZR+AlfA, guro-b10kYP2dOMg,
	len.brown-ral2JQCrhuEAvxtiuMwx3w, linux-pm-u79uwXL29TY76Z2rM5mHXA,
	vbabka-AlSwsSmVLrQ, linux-um-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	rppt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn,
	tglx-hfZtesqFncYOwBW4kG4KsQ,
	trond.myklebust-F/q8l9xzQnoyLce1RVWEUA,
	anton-yrGDUoBaLx3QT0dZR+AlfA, linux-parisc-u79uwXL29TY76Z2rM5mHXA,
	malat-8fiUuRrzOP0dnm+yROfE0A,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	rdunlap-wEGCiKHe2LqWVfeAwA7xHQ, rjw-LthD3rsA81gm4RdzfppkhA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, cyrilbur
In-Reply-To: <20181022181122.GK18839-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>

On Mon, Oct 22, 2018 at 11:41 PM Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>
> On Mon 22-10-18 22:53:22, Arun KS wrote:
> > Remove managed_page_count_lock spinlock and instead use atomic
> > variables.
>

Hello Michal,
> I assume this has been auto-generated. If yes, it would be better to
> mention the script so that people can review it and regenerate for
> comparision. Such a large change is hard to review manually.

Changes were made partially with script.  For totalram_pages and
totalhigh_pages,

find dir -type f -exec sed -i
's/totalram_pages/atomic_long_read(\&totalram_pages)/g' {} \;
find dir -type f -exec sed -i
's/totalhigh_pages/atomic_long_read(\&totalhigh_pages)/g' {} \;

For managed_pages it was mostly manual edits after using,
find mm/ -type f -exec sed -i
's/zone->managed_pages/atomic_long_read(\&zone->managed_pages)/g' {}
\;

Regards,
Arun

> --
> Michal Hocko
> SUSE Labs

^ permalink raw reply

* Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic.
From: Arun KS @ 2018-10-23  4:48 UTC (permalink / raw)
  To: Joe Perches
  Cc: Mike Snitzer, Benjamin Herrenschmidt, Kemi Wang,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, J. Bruce Fields,
	linux-sctp-u79uwXL29TY76Z2rM5mHXA, Paul Mackerras, Pavel Machek,
	Christoph Lameter, K. Y. Srinivasan, Sumit Semwal,
	David (ChunMing) Zhou, Petr Tesarik, Michael Ellerman,
	ceph-devel-u79uwXL29TY76Z2rM5mHXA, James E.J. Bottomley,
	kasan-dev-/JYPxA39Uh5TLH3MbocFFw, Marcos Paulo de Souza,
	Steven J. Hill, David Rientjes, Anthony Yznaga, Daniel Vacek,
	Roman Gushchin, Len Brown <len.b
In-Reply-To: <c57bcc584b3700c483b0311881ec3ae8786f88b1.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>

On 2018-10-23 09:45, Joe Perches wrote:
> On Mon, 2018-10-22 at 22:53 +0530, Arun KS wrote:
>> Remove managed_page_count_lock spinlock and instead use atomic
>> variables.
> 

Hello Joe,
> Perhaps better to define and use macros for the accesses
> instead of specific uses of atomic_long_<inc/dec/read>
> 
> Something like:
> 
> #define totalram_pages()	(unsigned 
> long)atomic_long_read(&_totalram_pages)
> #define totalram_pages_inc()	(unsigned 
> long)atomic_long_inc(&_totalram_pages)
> #define totalram_pages_dec()	(unsigned 
> long)atomic_long_dec(&_totalram_pages)

That sounds like a nice idea.

Regards,
Arun

^ permalink raw reply

* [PATCH 03/20] ath9k: ar9002_phy: mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-10-22 20:38 UTC (permalink / raw)
  To: QCA ath9k Development
  Cc: Kalle Valo, linux-wireless, David S. Miller, netdev, linux-kernel,
	Gustavo A. R. Silva
In-Reply-To: <cover.1540239684.git.gustavo@embeddedor.com>

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1056532 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/wireless/ath/ath9k/ar9002_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9002_phy.c b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
index 7132918..6f32b8d 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
@@ -119,7 +119,7 @@ static int ar9002_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
 				aModeRefSel = 2;
 			if (aModeRefSel)
 				break;
-			/* else: fall through */
+			/* fall through */
 		case 1:
 		default:
 			aModeRefSel = 0;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 05/20] carl9170: rx: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-10-22 20:39 UTC (permalink / raw)
  To: Christian Lamparter
  Cc: Kalle Valo, linux-wireless, David S. Miller, netdev, linux-kernel,
	Gustavo A. R. Silva
In-Reply-To: <cover.1540239684.git.gustavo@embeddedor.com>

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1056534 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/wireless/ath/carl9170/rx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index 7050632..f7c2f19 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -766,6 +766,7 @@ static void carl9170_rx_untie_data(struct ar9170 *ar, u8 *buf, int len)
 
 			goto drop;
 		}
+		/* fall through */
 
 	case AR9170_RX_STATUS_MPDU_MIDDLE:
 		/*  These are just data + mac status */
-- 
2.7.4

^ permalink raw reply related

* [PATCH 12/20] prism54: islpci_dev: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-10-22 20:43 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Kalle Valo, linux-wireless, David S. Miller, netdev, linux-kernel,
	Gustavo A. R. Silva
In-Reply-To: <cover.1540239684.git.gustavo@embeddedor.com>

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 114947 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/wireless/intersil/prism54/islpci_dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/intersil/prism54/islpci_dev.c b/drivers/net/wireless/intersil/prism54/islpci_dev.c
index 325176d..ad6d3a5 100644
--- a/drivers/net/wireless/intersil/prism54/islpci_dev.c
+++ b/drivers/net/wireless/intersil/prism54/islpci_dev.c
@@ -932,6 +932,7 @@ islpci_set_state(islpci_private *priv, islpci_state_t new_state)
 	switch (new_state) {
 	case PRV_STATE_OFF:
 		priv->state_off++;
+		/* fall through */
 	default:
 		priv->state = new_state;
 		break;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 17/20] rt2x00: rt61pci: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-10-22 20:46 UTC (permalink / raw)
  To: Stanislaw Gruszka, Helmut Schaa
  Cc: Kalle Valo, linux-wireless, David S. Miller, netdev, linux-kernel,
	Gustavo A. R. Silva
In-Reply-To: <cover.1540239684.git.gustavo@embeddedor.com>

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/wireless/ralink/rt2x00/rt61pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt61pci.c b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
index cb0e119..4c5de8f 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
@@ -2226,7 +2226,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
 			break;
 		case 6: /* Failure, excessive retries */
 			__set_bit(TXDONE_EXCESSIVE_RETRY, &txdesc.flags);
-			/* Don't break, this is a failed frame! */
+			/* Fall through - this is a failed frame! */
 		default: /* Failure */
 			__set_bit(TXDONE_FAILURE, &txdesc.flags);
 		}
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH net 1/4] net/sched: act_gact: disallow 'goto chain' on fallback control action
From: Jiri Pirko @ 2018-10-22 20:55 UTC (permalink / raw)
  To: Davide Caratti; +Cc: Cong Wang, Jamal Hadi Salim, David S. Miller, netdev
In-Reply-To: <02f04ade8a0087781778d02fbb645b1d72f9d777.1540070509.git.dcaratti@redhat.com>

Sat, Oct 20, 2018 at 11:33:07PM CEST, dcaratti@redhat.com wrote:
>in the following command:
>
> # tc action add action <c1> random <rand_type> <c2> <rand_param>
>
>'goto chain x' is allowed only for c1: setting it for c2 makes the kernel
>crash with NULL pointer dereference, since TC core doesn't initialize the
>chain handle.
>
>Signed-off-by: Davide Caratti <dcaratti@redhat.com>
>---
> net/sched/act_gact.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
>index cd1d9bd32ef9..505138047e5c 100644
>--- a/net/sched/act_gact.c
>+++ b/net/sched/act_gact.c
>@@ -88,6 +88,11 @@ static int tcf_gact_init(struct net *net, struct nlattr *nla,
> 		p_parm = nla_data(tb[TCA_GACT_PROB]);
> 		if (p_parm->ptype >= MAX_RAND)
> 			return -EINVAL;
>+		if (TC_ACT_EXT_CMP(p_parm->paction, TC_ACT_GOTO_CHAIN)) {
>+			NL_SET_ERR_MSG(extack,
>+				       "goto chain not allowed on fallback");

No need for a line-wrap. Otherwise
Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply

* Re: [PATCH net 2/4] net/sched: act_police: disallow 'goto chain' on fallback control action
From: Jiri Pirko @ 2018-10-22 20:57 UTC (permalink / raw)
  To: Davide Caratti; +Cc: Cong Wang, Jamal Hadi Salim, David S. Miller, netdev
In-Reply-To: <c2f076b0758b8cd997574b45c2abe064e28aca74.1540070509.git.dcaratti@redhat.com>

Sat, Oct 20, 2018 at 11:33:08PM CEST, dcaratti@redhat.com wrote:
>in the following command:
>
> # tc action add action police rate <r> burst <b> conform-exceed <c1>/<c2>
>
>'goto chain x' is allowed only for c1: setting it for c2 makes the kernel
>crash with NULL pointer dereference, since TC core doesn't initialize the
>chain handle.
>
>Signed-off-by: Davide Caratti <dcaratti@redhat.com>
>---
> net/sched/act_police.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
>diff --git a/net/sched/act_police.c b/net/sched/act_police.c
>index 5d8bfa878477..3b793393efd1 100644
>--- a/net/sched/act_police.c
>+++ b/net/sched/act_police.c
>@@ -150,6 +150,16 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,
> 		goto failure;
> 	}
> 
>+	if (tb[TCA_POLICE_RESULT]) {
>+		police->tcfp_result = nla_get_u32(tb[TCA_POLICE_RESULT]);
>+		if (TC_ACT_EXT_CMP(police->tcfp_result, TC_ACT_GOTO_CHAIN)) {
>+			NL_SET_ERR_MSG(extack,
>+				       "goto chain not allowed on fallback");

Also, no need for line-wrap

Acked-by: Jiri Pirko <jiri@mellanox.com>



>+			err = -EINVAL;
>+			goto failure;
>+		}
>+	}
>+
> 	spin_lock_bh(&police->tcf_lock);
> 	/* No failure allowed after this point */
> 	police->tcfp_mtu = parm->mtu;
>@@ -173,8 +183,6 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,
> 		police->peak_present = false;
> 	}
> 
>-	if (tb[TCA_POLICE_RESULT])
>-		police->tcfp_result = nla_get_u32(tb[TCA_POLICE_RESULT]);
> 	police->tcfp_burst = PSCHED_TICKS2NS(parm->burst);
> 	police->tcfp_toks = police->tcfp_burst;
> 	if (police->peak_present) {
>-- 
>2.17.1
>

^ permalink raw reply

* Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic.
From: Huang, Ying @ 2018-10-23  5:37 UTC (permalink / raw)
  To: Arun KS
  Cc: Mike Snitzer, Benjamin Herrenschmidt, Kemi Wang,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, J. Bruce Fields,
	linux-sctp-u79uwXL29TY76Z2rM5mHXA, Paul Mackerras, Pavel Machek,
	Christoph Lameter, K. Y. Srinivasan, Sumit Semwal,
	David (ChunMing) Zhou, Petr Tesarik, Michael Ellerman,
	ceph-devel-u79uwXL29TY76Z2rM5mHXA, James E.J. Bottomley,
	kasan-dev-/JYPxA39Uh5TLH3MbocFFw, Marcos Paulo de Souza,
	Steven J. Hill, David Rientjes, Anthony Yznaga, Daniel Vacek,
	Roman Gushchin, Len Brown <len.
In-Reply-To: <1540229092-25207-1-git-send-email-arunks-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

Arun KS <arunks-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> writes:

> Remove managed_page_count_lock spinlock and instead use atomic
> variables.
>
> Suggested-by: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
> Suggested-by: Vlastimil Babka <vbabka-AlSwsSmVLrQ@public.gmane.org>
> Signed-off-by: Arun KS <arunks-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
>
> ---
> As discussed here,
> https://patchwork.kernel.org/patch/10627521/#22261253

My 2 cents.  I think you should include at least part of the discussion
in the patch description to make it more readable by itself.

Best Regards,
Huang, Ying

^ permalink raw reply

* [PATCH] rtlwifi: remove set but not used variable 'radiob_array_table' and 'radiob_arraylen'
From: zhong jiang @ 2018-10-23  5:47 UTC (permalink / raw)
  To: kvalo; +Cc: pkshih, davem, linux-wireless, netdev, linux-kernel

'radiob_array_table' and 'radiob_arraylen' is not used after setting its value.
It is safe to remove the unused variable.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
index 5cf29f5..3f33278 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
@@ -509,13 +509,10 @@ bool rtl8723e_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
 	int i;
 	bool rtstatus = true;
 	u32 *radioa_array_table;
-	u32 *radiob_array_table;
-	u16 radioa_arraylen, radiob_arraylen;
+	u16 radioa_arraylen;
 
 	radioa_arraylen = RTL8723ERADIOA_1TARRAYLENGTH;
 	radioa_array_table = RTL8723E_RADIOA_1TARRAY;
-	radiob_arraylen = RTL8723E_RADIOB_1TARRAYLENGTH;
-	radiob_array_table = RTL8723E_RADIOB_1TARRAY;
 
 	rtstatus = true;
 
-- 
1.7.12.4

^ permalink raw reply related

* Re: Some suggestions for tc-tests
From: Lucas Bates @ 2018-10-22 21:54 UTC (permalink / raw)
  To: Cong Wang; +Cc: Roman Mashak, Jamal Hadi Salim, Linux Kernel Network Developers
In-Reply-To: <CAM_iQpUHoq4Z8rqZvwkY2E8SqJDB_GdVCOcbG8eTJHAbxy-hcA@mail.gmail.com>

Hi Cong,

>
> 1. Create veth pair devices by its own. The most important thing for
> tc-tests is to automate everything, it is not friendly for users to
> create their own veth pair named v0p0 to just run the tests. tc-tests
> should be able to create a veth pair with random names and clean up
> them once it is finished.
You can actually do this automatically in two steps: first, create a
symlink to plugin-lib/nsPlugin.py in the plugins/ directory. Then,
when running tdc, always invoke the '-n' option.  This will execute
all the commands inside a namespace *and* automatically create the
veth pair that get used in the testing.

It's referenced in the readme, but if you think it's useful to make it
a default setup I could add an installation/setup script to tdc to
create the symlink.

> 2. Test iproute2 version or capability. Apparently my iproute2 doesn't
> support tc filter chain yet, this makes many tests failed. Ideally,
> each test should be able to check if the iproute2 supports the thing
> it wants to test, if not just skip it, at least by default.

So is this a version you compile yourself, or is it just the default
/sbin/tc?  Because you can specify the tc executable you want to use
in tdc_config.py...  But yes, we're looking at ways to make sure the
support is there before running tests.  We're hoping to send some patches soon.

> 3. Is there anything in the tests that can be done only with Python3?
> If we could lower the requirement to Python2, then it would be easier
> to setup and run these tests.

I'd have to go back and re-check to see what python 3-specific
features I'm using, but there *are* some.

Do you maybe have the ability to run a VM or Docker container on your
system to run python 3?

Thanks!

^ permalink raw reply

* Re: CRC errors between mvneta and macb
From: Richard Genoud @ 2018-10-23  6:56 UTC (permalink / raw)
  To: Willy Tarreau, Richard Genoud
  Cc: linux-kernel, Thomas Petazzoni, Antoine Tenart, Gregory CLEMENT,
	Yelena Krivosheev, Maxime Chevallier, Nicolas Ferre, netdev,
	Andrew Lunn
In-Reply-To: <20181022163429.GA22826@1wt.eu>

Le 22/10/2018 à 18:34, Willy Tarreau a écrit :
> On Mon, Oct 22, 2018 at 05:15:21PM +0200, Richard Genoud wrote:
>> After analyzing the ethernet frame on the Davicom PHY's output (pin
>> TX+), I find out that the FCS errors occurs when the ethernet preamble
>> is longer than 56bits. (something like 58 or 60 bits)
>>
>> To say this in another way, instead of having 28 times 1-0 followed by
>> the SFD (10101011), I see 29 or 30 times 1-0 followed by the SFD.
>> (sometimes 29, sometimes 30)
>>
>>
>> Should a longer preamble be considered as an FCS error ? It seems a
>> little harsh since the point of the preamble is to synchronize the frame.
> 
> That indeed seems a bit strange considering that you're not supposed to
> know what is before the preamble so it would very well contain random
> noise looking a lot like alteranted bits.
> 
>> I don't know what the 802.3 standard says about that.
> 
> Just found it :-)
> 
>      https://www.trincoll.edu/Academics/MajorsAndMinors/Engineering/Documents/IEEE%20Standard%20for%20Ethernet.pdf
> 
> Page 132, #7.2.3.2 :
> 
>     The DTE is required to supply at least 56 bits of preamble in
>     order to satisfy system requirements. System components consume
>     preamble bits in order to perform their functions. The number
>     of preamble bits sourced ensures an adequate number of bits are
>     provided to each system component to correctly implement its
>     function.
> 
> So that totally makes sense since the purpose is to enable signal
> detection at the hardware leve, hence the problem definitely is on
> the receiver in your case.
> 
> Willy
> 
Great ! Thanks !
I'll check on the Marvell side

Richard

^ permalink raw reply

* [net-next:master 451/481] drivers/net/ethernet/amazon/ena/ena_com.h:1104:2: error: implicit declaration of function 'prefetchw'
From: kbuild test robot @ 2018-10-22 22:35 UTC (permalink / raw)
  To: Netanel Belgazal; +Cc: kbuild-all, netdev

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

Hi Netanel,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   21ea1d36f6dfcb1d59184937c672022d5d01902a
commit: 8c590f9776386b8f697fd0b7ed6142ae6e3de79e [451/481] net: ena: Fix Kconfig dependency on X86
config: microblaze-allmodconfig (attached as .config)
compiler: microblaze-linux-gcc (GCC) 8.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 8c590f9776386b8f697fd0b7ed6142ae6e3de79e
        # save the attached .config to linux build tree
        GCC_VERSION=8.1.0 make.cross ARCH=microblaze 

All errors (new ones prefixed by >>):

   In file included from drivers/net/ethernet/amazon/ena/ena_com.c:33:
   drivers/net/ethernet/amazon/ena/ena_com.h: In function 'ena_com_get_next_bounce_buffer':
>> drivers/net/ethernet/amazon/ena/ena_com.h:1104:2: error: implicit declaration of function 'prefetchw' [-Werror=implicit-function-declaration]
     prefetchw(bounce_buf_ctrl->base_buffer +
     ^~~~~~~~~
   cc1: some warnings being treated as errors

vim +/prefetchw +1104 drivers/net/ethernet/amazon/ena/ena_com.h

1738cd3e Netanel Belgazal  2016-08-10  1092  
689b2bda Arthur Kiyanovski 2018-10-11  1093  static inline u8 *ena_com_get_next_bounce_buffer(struct ena_com_io_bounce_buffer_control *bounce_buf_ctrl)
689b2bda Arthur Kiyanovski 2018-10-11  1094  {
689b2bda Arthur Kiyanovski 2018-10-11  1095  	u16 size, buffers_num;
689b2bda Arthur Kiyanovski 2018-10-11  1096  	u8 *buf;
689b2bda Arthur Kiyanovski 2018-10-11  1097  
689b2bda Arthur Kiyanovski 2018-10-11  1098  	size = bounce_buf_ctrl->buffer_size;
689b2bda Arthur Kiyanovski 2018-10-11  1099  	buffers_num = bounce_buf_ctrl->buffers_num;
689b2bda Arthur Kiyanovski 2018-10-11  1100  
689b2bda Arthur Kiyanovski 2018-10-11  1101  	buf = bounce_buf_ctrl->base_buffer +
689b2bda Arthur Kiyanovski 2018-10-11  1102  		(bounce_buf_ctrl->next_to_use++ & (buffers_num - 1)) * size;
689b2bda Arthur Kiyanovski 2018-10-11  1103  
689b2bda Arthur Kiyanovski 2018-10-11 @1104  	prefetchw(bounce_buf_ctrl->base_buffer +
689b2bda Arthur Kiyanovski 2018-10-11  1105  		(bounce_buf_ctrl->next_to_use & (buffers_num - 1)) * size);
689b2bda Arthur Kiyanovski 2018-10-11  1106  
689b2bda Arthur Kiyanovski 2018-10-11  1107  	return buf;
689b2bda Arthur Kiyanovski 2018-10-11  1108  }
689b2bda Arthur Kiyanovski 2018-10-11  1109  

:::::: The code at line 1104 was first introduced by commit
:::::: 689b2bdaaa1480ad2c14bdc4c6eaf38284549022 net: ena: add functions for handling Low Latency Queues in ena_com

:::::: TO: Arthur Kiyanovski <akiyano@amazon.com>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 54668 bytes --]

^ permalink raw reply

* Re: CRC errors between mvneta and macb
From: Richard Genoud @ 2018-10-23  6:58 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Willy Tarreau, linux-kernel, Thomas Petazzoni, Antoine Tenart,
	Gregory CLEMENT, Yelena Krivosheev, Maxime Chevallier,
	Nicolas Ferre, netdev
In-Reply-To: <20181022181918.GF24112@lunn.ch>

Le 22/10/2018 à 20:19, Andrew Lunn a écrit :
>> I dug more on the subject, and I think I found what Marvell's PHY/MAC
>> doesn't like.
> 
> Hi Richard
> 
> What PHY is being used?
> 
88E1512-NNP2

>> After analyzing the ethernet frame on the Davicom PHY's output (pin
>> TX+), I find out that the FCS errors occurs when the ethernet preamble
>> is longer than 56bits. (something like 58 or 60 bits)
> 
> Some Marvell PHYs have a register bit which might be of interest: Page
> 2, register 16, bit 6.
> 
> 0 = Pad odd nibble preambles in copper receive packets.
> 1 = Pass as is and do not pad odd nibble preambles in
> 
>   Andrew
> 

Thanks, I'll look into that.

Richard

^ permalink raw reply

* Re: [PATCH v2] wireless: mark expected switch fall-throughs
From: Johannes Berg @ 2018-10-23  7:01 UTC (permalink / raw)
  To: Gustavo A. R. Silva, David S. Miller
  Cc: linux-wireless, netdev, linux-kernel, Kees Cook
In-Reply-To: <20181023001308.GA4150@embeddedor.com>

On Tue, 2018-10-23 at 02:13 +0200, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Warning level 3 was used: -Wimplicit-fallthrough=3
> 
> This code was not tested and GCC 7.2.0 was used to compile it.

Look, I'm not going to make this any clearer: I'm not applying patches
like that where you've invested no effort whatsoever on verifying that
they're correct.

johannes

^ permalink raw reply

* Re: Improving accuracy of PHC readings
From: Richard Cochran @ 2018-10-22 22:48 UTC (permalink / raw)
  To: Miroslav Lichvar; +Cc: netdev, Keller, Jacob E
In-Reply-To: <20181019095137.GG4407@localhost>

On Fri, Oct 19, 2018 at 11:51:37AM +0200, Miroslav Lichvar wrote:
> A solution to this would be a new driver function that wraps the
> latching register read with readings of the system clock and return
> three timestamps instead of one. For example:
> 
>         ktime_get_real_ts64(&sys_ts1);
> 	IXGBE_READ_REG(hw, IXGBE_SYSTIMR);
> 	ktime_get_real_ts64(&sys_ts2);
> 	phc_ts.tv_nsec = IXGBE_READ_REG(hw, IXGBE_SYSTIML);
> 	phc_ts.tv_sec = IXGBE_READ_REG(hw, IXGBE_SYSTIMH);

Makes sense...
  
> The extra timestamp doesn't fit the API of the PTP_SYS_OFFSET ioctl,
> so it would need to shift the timestamp it returns by the missing
> intervals (assuming the frequency offset between the PHC and system
> clock is small), or a new ioctl could be introduced that would return
> all timestamps in an array looking like this:
> 
> 	[sys, phc, sys, sys, phc, sys, ...]

How about a new ioctl with number of trials as input and single offset
as output?

Then it would be up to the driver to implement the device-specific
loop.

Thanks,
Richard

^ permalink raw reply

* Re: Improving accuracy of PHC readings
From: Richard Cochran @ 2018-10-22 22:48 UTC (permalink / raw)
  To: Keller, Jacob E; +Cc: Miroslav Lichvar, netdev@vger.kernel.org
In-Reply-To: <02874ECE860811409154E81DA85FBB5884CDD9F4@ORSMSX115.amr.corp.intel.com>

On Fri, Oct 19, 2018 at 04:52:13PM +0000, Keller, Jacob E wrote:
> Nice! I think this is good. I'd love to see some data to back it up, but it makes sense to me.

+1

^ permalink raw reply

* Re: [PATCH] rtlwifi: remove set but not used variable 'radiob_array_table' and 'radiob_arraylen'
From: Pkshih @ 2018-10-23  8:05 UTC (permalink / raw)
  To: zhongjiang@huawei.com, kvalo@codeaurora.org
  Cc: linux-wireless@vger.kernel.org, davem@davemloft.net,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <1540273651-64688-1-git-send-email-zhongjiang@huawei.com>

On Tue, 2018-10-23 at 13:47 +0800, zhong jiang wrote:
> 'radiob_array_table' and 'radiob_arraylen' is not used after setting its
> value.
> It is safe to remove the unused variable.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> index 5cf29f5..3f33278 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
> @@ -509,13 +509,10 @@ bool rtl8723e_phy_config_rf_with_headerfile(struct
> ieee80211_hw *hw,
>  	int i;
>  	bool rtstatus = true;
>  	u32 *radioa_array_table;
> -	u32 *radiob_array_table;
> -	u16 radioa_arraylen, radiob_arraylen;
> +	u16 radioa_arraylen;
>  
>  	radioa_arraylen = RTL8723ERADIOA_1TARRAYLENGTH;
>  	radioa_array_table = RTL8723E_RADIOA_1TARRAY;
> -	radiob_arraylen = RTL8723E_RADIOB_1TARRAYLENGTH;
> -	radiob_array_table = RTL8723E_RADIOB_1TARRAY;
>  
>  	rtstatus = true;
>  

I think 8723ae has only one antenna, so you can remove radio B array as well.


^ permalink raw reply

* Re: [PATCH] rtlwifi: remove set but not used variable 'radiob_array_table' and 'radiob_arraylen'
From: zhong jiang @ 2018-10-23  8:23 UTC (permalink / raw)
  To: Pkshih
  Cc: kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
	davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <1540281873.25715.2.camel@realtek.com>

On 2018/10/23 16:05, Pkshih wrote:
> On Tue, 2018-10-23 at 13:47 +0800, zhong jiang wrote:
>> 'radiob_array_table' and 'radiob_arraylen' is not used after setting its
>> value.
>> It is safe to remove the unused variable.
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>>  drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
>> b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
>> index 5cf29f5..3f33278 100644
>> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
>> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
>> @@ -509,13 +509,10 @@ bool rtl8723e_phy_config_rf_with_headerfile(struct
>> ieee80211_hw *hw,
>>  	int i;
>>  	bool rtstatus = true;
>>  	u32 *radioa_array_table;
>> -	u32 *radiob_array_table;
>> -	u16 radioa_arraylen, radiob_arraylen;
>> +	u16 radioa_arraylen;
>>  
>>  	radioa_arraylen = RTL8723ERADIOA_1TARRAYLENGTH;
>>  	radioa_array_table = RTL8723E_RADIOA_1TARRAY;
>> -	radiob_arraylen = RTL8723E_RADIOB_1TARRAYLENGTH;
>> -	radiob_array_table = RTL8723E_RADIOB_1TARRAY;
>>  
>>  	rtstatus = true;
>>  
> I think 8723ae has only one antenna, so you can remove radio B array as well.
>
Yep,  Will do.

Thanks,
zhong jiang

^ permalink raw reply

* Re: [PATCH v2] rtlwifi: remove set but not used variable 'radiob_array_table' and 'radiob_arraylen'
From: Pkshih @ 2018-10-23  9:35 UTC (permalink / raw)
  To: zhongjiang@huawei.com, kvalo@codeaurora.org
  Cc: linux-wireless@vger.kernel.org, davem@davemloft.net,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <1540283282-9772-1-git-send-email-zhongjiang@huawei.com>

On Tue, 2018-10-23 at 16:28 +0800, zhong jiang wrote:
> radiob_array_table' and 'radiob_arraylen' are not used after setting its
> value.
> It is safe to remove the unused variable. Meanwhile, radio B radio should be
> removed as well. because it will no longer be referenced.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> 

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Thank you


^ permalink raw reply

* Re: [PATCH] rtlwifi: btcoex: remove set but not used variable 'ppsc'
From: Pkshih @ 2018-10-23  1:24 UTC (permalink / raw)
  To: yuehaibing@huawei.com, kvalo@codeaurora.org,
	colin.king@canonical.com, Larry.Finger@lwfinger.net,
	natechancellor@gmail.com
  Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org
In-Reply-To: <1540194675-65562-1-git-send-email-yuehaibing@huawei.com>

On Mon, 2018-10-22 at 07:51 +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c: In function
> 'halbtc_leave_lps':
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:295:21: warning:
>  variable 'ppsc' set but not used [-Wunused-but-set-variable]
> 
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c: In function
> 'halbtc_enter_lps':
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:318:21: warning:
>  variable 'ppsc' set but not used [-Wunused-but-set-variable]
> 
> It never used since introduction in
> commit aa45a673b291 ("rtlwifi: btcoexist: Add new mini driver")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>


Acked-by: Ping-Ke Shih <pkshih@realtek.com>



^ permalink raw reply

* KASAN: use-after-free Read in sctp_outq_select_transport
From: syzbot @ 2018-10-23 10:13 UTC (permalink / raw)
  To: davem, linux-kernel, linux-sctp, marcelo.leitner, netdev, nhorman,
	syzkaller-bugs, vyasevich

Hello,

syzbot found the following crash on:

HEAD commit:    23469de647c4 Merge git://git.kernel.org/pub/scm/linux/kern..
git tree:       net
console output: https://syzkaller.appspot.com/x/log.txt?x=13580ce5400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=b3f55cb3dfcc6c33
dashboard link: https://syzkaller.appspot.com/bug?extid=56a40ceee5fb35932f4d
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+56a40ceee5fb35932f4d@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in sctp_outq_select_transport+0x77e/0x9a0  
net/sctp/outqueue.c:840
Read of size 4 at addr ffff8801c5ff2614 by task syz-executor5/8275

CPU: 0 PID: 8275 Comm: syz-executor5 Not tainted 4.19.0-rc8+ #152
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Call Trace:
  <IRQ>
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x1c4/0x2b6 lib/dump_stack.c:113
  print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256
  kasan_report_error mm/kasan/report.c:354 [inline]
  kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412
  __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432
  sctp_outq_select_transport+0x77e/0x9a0 net/sctp/outqueue.c:840
  sctp_outq_flush_data net/sctp/outqueue.c:1100 [inline]
  sctp_outq_flush+0x14f7/0x34f0 net/sctp/outqueue.c:1209
  sctp_outq_uncork+0x6a/0x80 net/sctp/outqueue.c:776
  sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1820 [inline]
  sctp_side_effects net/sctp/sm_sideeffect.c:1220 [inline]
  sctp_do_sm+0x608/0x7190 net/sctp/sm_sideeffect.c:1191
  sctp_assoc_bh_rcv+0x346/0x670 net/sctp/associola.c:1067
  sctp_inq_push+0x280/0x370 net/sctp/inqueue.c:95
  sctp_rcv+0x2d93/0x3c00 net/sctp/input.c:268
  sctp6_rcv+0x15/0x30 net/sctp/ipv6.c:1061
  ip6_input_finish+0x3fc/0x1aa0 net/ipv6/ip6_input.c:383
  NF_HOOK include/linux/netfilter.h:289 [inline]
  ip6_input+0xe9/0x600 net/ipv6/ip6_input.c:426
  dst_input include/net/dst.h:450 [inline]
  ip6_rcv_finish+0x17a/0x330 net/ipv6/ip6_input.c:76
  NF_HOOK include/linux/netfilter.h:289 [inline]
  ipv6_rcv+0x120/0x640 net/ipv6/ip6_input.c:271
  __netif_receive_skb_one_core+0x14d/0x200 net/core/dev.c:4913
  __netif_receive_skb+0x2c/0x1e0 net/core/dev.c:5023
  process_backlog+0x218/0x6f0 net/core/dev.c:5829
  napi_poll net/core/dev.c:6249 [inline]
  net_rx_action+0x7c5/0x1950 net/core/dev.c:6315
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready
  __do_softirq+0x30c/0xb03 kernel/softirq.c:292
  do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1047
  </IRQ>
  do_softirq.part.13+0x126/0x160 kernel/softirq.c:336
  do_softirq kernel/softirq.c:328 [inline]
  __local_bh_enable_ip+0x21d/0x260 kernel/softirq.c:189
  local_bh_enable include/linux/bottom_half.h:32 [inline]
  rcu_read_unlock_bh include/linux/rcupdate.h:723 [inline]
  ip6_finish_output2+0xce4/0x27a0 net/ipv6/ip6_output.c:121
  ip6_finish_output+0x58c/0xc60 net/ipv6/ip6_output.c:154
  NF_HOOK_COND include/linux/netfilter.h:278 [inline]
  ip6_output+0x232/0x9d0 net/ipv6/ip6_output.c:171
  dst_output include/net/dst.h:444 [inline]
  NF_HOOK include/linux/netfilter.h:289 [inline]
  ip6_xmit+0xf69/0x2420 net/ipv6/ip6_output.c:275
  sctp_v6_xmit+0x3b2/0x790 net/sctp/ipv6.c:230
  sctp_packet_transmit+0x298e/0x3db0 net/sctp/output.c:656
  sctp_packet_singleton net/sctp/outqueue.c:791 [inline]
  sctp_outq_flush_ctrl.constprop.11+0x7a9/0xe50 net/sctp/outqueue.c:922
  sctp_outq_flush+0x310/0x34f0 net/sctp/outqueue.c:1204
  sctp_outq_uncork+0x6a/0x80 net/sctp/outqueue.c:776
kobject: 'rfkill9' (0000000067be229d): fill_kobj_path: path  
= '/devices/virtual/mac80211_hwsim/hwsim7/ieee80211/phy7/rfkill9'
  sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1349 [inline]
  sctp_side_effects net/sctp/sm_sideeffect.c:1220 [inline]
  sctp_do_sm+0x4f25/0x7190 net/sctp/sm_sideeffect.c:1191
ieee80211 phy7: Selected rate control algorithm 'minstrel_ht'
kobject: 'net' (00000000cdd117dc): kobject_add_internal: parent: 'hwsim7',  
set: '(null)'
  sctp_endpoint_bh_rcv+0x465/0x960 net/sctp/endpointola.c:456
kobject: 'wlan0' (00000000c9d333fc): kobject_add_internal: parent: 'net',  
set: 'devices'
  sctp_inq_push+0x280/0x370 net/sctp/inqueue.c:95
  sctp_backlog_rcv+0x1a8/0xd50 net/sctp/input.c:351
kobject: 'wlan0' (00000000c9d333fc): kobject_uevent_env
kobject: 'wlan0' (00000000c9d333fc): fill_kobj_path: path  
= '/devices/virtual/mac80211_hwsim/hwsim7/net/wlan0'
  sk_backlog_rcv include/net/sock.h:931 [inline]
  __release_sock+0x12f/0x3a0 net/core/sock.c:2336
kobject: 'queues' (00000000c5d009e9): kobject_add_internal:  
parent: 'wlan0', set: '<NULL>'
  release_sock+0xad/0x2c0 net/core/sock.c:2849
  sock_setsockopt+0x60d/0x2280 net/core/sock.c:1054
kobject: 'queues' (00000000c5d009e9): kobject_uevent_env
kobject: 'queues' (00000000c5d009e9): kobject_uevent_env: filter function  
caused the event to drop!
  __sys_setsockopt+0x304/0x3c0 net/socket.c:1898
kobject: 'rx-0' (000000007736ba36): kobject_add_internal: parent: 'queues',  
set: 'queues'
  __do_sys_setsockopt net/socket.c:1913 [inline]
  __se_sys_setsockopt net/socket.c:1910 [inline]
  __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1910
  do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
kobject: 'rx-0' (000000007736ba36): kobject_uevent_env
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
kobject: 'rx-0' (000000007736ba36): fill_kobj_path: path  
= '/devices/virtual/mac80211_hwsim/hwsim7/net/wlan0/queues/rx-0'
RIP: 0033:0x457569
Code: fd b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7  
48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff  
ff 0f 83 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f0613beec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000457569
RDX: 000000000000001a RSI: 0000000000000001 RDI: 0000000000000003
RBP: 000000000072c040 R08: 0000000000000010 R09: 0000000000000000
R10: 00000000200000c0 R11: 0000000000000246 R12: 00007f0613bef6d4
R13: 00000000004c3b61 R14: 00000000004d5c88 R15: 00000000ffffffff

Allocated by task 8261:
  save_stack+0x43/0xd0 mm/kasan/kasan.c:448
kobject: 'tx-0' (000000008f0eae4c): kobject_add_internal: parent: 'queues',  
set: 'queues'
  set_track mm/kasan/kasan.c:460 [inline]
  kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553
  kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620
  kmalloc include/linux/slab.h:513 [inline]
  kzalloc include/linux/slab.h:707 [inline]
  sctp_transport_new+0x10a/0x880 net/sctp/transport.c:111
  sctp_assoc_add_peer+0x2de/0x10d0 net/sctp/associola.c:630
  sctp_process_param net/sctp/sm_make_chunk.c:2540 [inline]
  sctp_process_init+0xfc0/0x29e0 net/sctp/sm_make_chunk.c:2356
  sctp_cmd_process_init net/sctp/sm_sideeffect.c:682 [inline]
  sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1410 [inline]
  sctp_side_effects net/sctp/sm_sideeffect.c:1220 [inline]
  sctp_do_sm+0x13b9/0x7190 net/sctp/sm_sideeffect.c:1191
  sctp_assoc_bh_rcv+0x346/0x670 net/sctp/associola.c:1067
  sctp_inq_push+0x280/0x370 net/sctp/inqueue.c:95
  sctp_backlog_rcv+0x1a8/0xd50 net/sctp/input.c:351
  sk_backlog_rcv include/net/sock.h:931 [inline]
  __release_sock+0x12f/0x3a0 net/core/sock.c:2336
kobject: 'tx-0' (000000008f0eae4c): kobject_uevent_env
  release_sock+0xad/0x2c0 net/core/sock.c:2849
  sctp_wait_for_connect+0x391/0x640 net/sctp/socket.c:8667
  sctp_sendmsg_to_asoc+0x1d0f/0x2230 net/sctp/socket.c:1985
  sctp_sendmsg+0x13c2/0x1da0 net/sctp/socket.c:2131
  inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798
  sock_sendmsg_nosec net/socket.c:621 [inline]
  sock_sendmsg+0xd5/0x120 net/socket.c:631
  __sys_sendto+0x3d7/0x670 net/socket.c:1788
  __do_sys_sendto net/socket.c:1800 [inline]
  __se_sys_sendto net/socket.c:1796 [inline]
  __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1796
  do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
kobject: 'tx-0' (000000008f0eae4c): fill_kobj_path: path  
= '/devices/virtual/mac80211_hwsim/hwsim7/net/wlan0/queues/tx-0'

Freed by task 9:
  save_stack+0x43/0xd0 mm/kasan/kasan.c:448
  set_track mm/kasan/kasan.c:460 [inline]
  __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
  kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
  __cache_free mm/slab.c:3498 [inline]
  kfree+0xcf/0x230 mm/slab.c:3813
  sctp_transport_destroy_rcu+0x4a/0x60 net/sctp/transport.c:163
  __rcu_reclaim kernel/rcu/rcu.h:236 [inline]
  rcu_do_batch kernel/rcu/tree.c:2576 [inline]
  invoke_rcu_callbacks kernel/rcu/tree.c:2880 [inline]
  __rcu_process_callbacks kernel/rcu/tree.c:2847 [inline]
  rcu_process_callbacks+0xf23/0x2670 kernel/rcu/tree.c:2864
  __do_softirq+0x30c/0xb03 kernel/softirq.c:292
kobject: 'tx-1' (000000009aaee194): kobject_add_internal: parent: 'queues',  
set: 'queues'

The buggy address belongs to the object at ffff8801c5ff24c0
  which belongs to the cache kmalloc-1024 of size 1024
The buggy address is located 340 bytes inside of
  1024-byte region [ffff8801c5ff24c0, ffff8801c5ff28c0)
The buggy address belongs to the page:
page:ffffea000717fc80 count:1 mapcount:0 mapping:ffff8801da800ac0 index:0x0  
compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffffea00070ed808 ffffea00071b2488 ffff8801da800ac0
raw: 0000000000000000 ffff8801c5ff2040 0000000100000007 0000000000000000
kobject: 'tx-1' (000000009aaee194): kobject_uevent_env
page dumped because: kasan: bad access detected

Memory state around the buggy address:
  ffff8801c5ff2500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8801c5ff2580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff8801c5ff2600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                          ^
  ffff8801c5ff2680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8801c5ff2700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with  
syzbot.

^ permalink raw reply

* [PATCH net] net/ipv6: Add anycast addresses to a global hashtable
From: Jeff Barnhill @ 2018-10-23  2:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuznet, yoshfuji, Jeff Barnhill

icmp6_send() function is expensive on systems with a large number of
interfaces. Every time it’s called, it has to verify that the source
address does not correspond to an existing anycast address by looping
through every device and every anycast address on the device.  This can
result in significant delays for a CPU when there are a large number of
neighbors and ND timers are frequently timing out and calling
neigh_invalidate().

Add anycast addresses to a global hashtable to allow quick searching for
matching anycast addresses.  This is based on inet6_addr_lst in addrconf.c.

Signed-off-by: Jeff Barnhill <0xeffeff@gmail.com>
---
 include/net/addrconf.h |   2 +
 include/net/if_inet6.h |   8 ++++
 net/ipv6/af_inet6.c    |   5 ++
 net/ipv6/anycast.c     | 122 ++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 135 insertions(+), 2 deletions(-)

diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 6def0351bcc3..0cee3f99c41d 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -312,6 +312,8 @@ bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
 			 const struct in6_addr *addr);
 bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev,
 			     const struct in6_addr *addr);
+int anycast_init(void);
+void anycast_cleanup(void);
 
 /* Device notifier */
 int register_inet6addr_notifier(struct notifier_block *nb);
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index d7578cf49c3a..ac02b2cf2ba1 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -142,6 +142,14 @@ struct ipv6_ac_socklist {
 	struct ipv6_ac_socklist *acl_next;
 };
 
+struct ipv6_ac_addrlist {
+	struct in6_addr		acal_addr;
+	int			acal_ifindex; /* net */
+	int			acal_users;
+	struct hlist_node	acal_lst; /* inet6_acaddr_lst */
+	struct rcu_head		rcu;
+};
+
 struct ifacaddr6 {
 	struct in6_addr		aca_addr;
 	struct fib6_info	*aca_rt;
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 9a4261e50272..971a05fdd3bd 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -1001,6 +1001,9 @@ static int __init inet6_init(void)
 	err = ip6_flowlabel_init();
 	if (err)
 		goto ip6_flowlabel_fail;
+	err = anycast_init();
+	if (err)
+		goto anycast_fail;
 	err = addrconf_init();
 	if (err)
 		goto addrconf_fail;
@@ -1091,6 +1094,8 @@ static int __init inet6_init(void)
 ipv6_exthdrs_fail:
 	addrconf_cleanup();
 addrconf_fail:
+	anycast_cleanup();
+anycast_fail:
 	ip6_flowlabel_cleanup();
 ip6_flowlabel_fail:
 	ndisc_late_cleanup();
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 4e0ff7031edd..58d31e0980aa 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -44,8 +44,22 @@
 
 #include <net/checksum.h>
 
+#define IN6_ADDR_HSIZE_SHIFT	8
+#define IN6_ADDR_HSIZE		BIT(IN6_ADDR_HSIZE_SHIFT)
+/*	anycast address hash table
+ */
+static struct hlist_head inet6_acaddr_lst[IN6_ADDR_HSIZE];
+static DEFINE_SPINLOCK(acaddr_hash_lock);
+
 static int ipv6_dev_ac_dec(struct net_device *dev, const struct in6_addr *addr);
 
+static u32 inet6_acaddr_hash(struct net *net, const struct in6_addr *addr)
+{
+	u32 val = ipv6_addr_hash(addr) ^ net_hash_mix(net);
+
+	return hash_32(val, IN6_ADDR_HSIZE_SHIFT);
+}
+
 /*
  *	socket join an anycast group
  */
@@ -204,6 +218,73 @@ void ipv6_sock_ac_close(struct sock *sk)
 	rtnl_unlock();
 }
 
+static struct ipv6_ac_addrlist *acal_alloc(int ifindex,
+					   const struct in6_addr *addr)
+{
+	struct ipv6_ac_addrlist *acal;
+
+	acal = kzalloc(sizeof(*acal), GFP_ATOMIC);
+	if (!acal)
+		return NULL;
+
+	acal->acal_addr = *addr;
+	acal->acal_ifindex = ifindex;
+	acal->acal_users = 1;
+	INIT_HLIST_NODE(&acal->acal_lst);
+
+	return acal;
+}
+
+static int ipv6_add_acaddr_hash(struct net *net, const struct in6_addr *addr)
+{
+	unsigned int hash = inet6_acaddr_hash(net, addr);
+	struct ipv6_ac_addrlist *acal;
+	int err = 0;
+
+	spin_lock(&acaddr_hash_lock);
+	hlist_for_each_entry(acal, &inet6_acaddr_lst[hash], acal_lst) {
+		if (acal->acal_ifindex != net->ifindex)
+			continue;
+		if (ipv6_addr_equal(&acal->acal_addr, addr)) {
+			acal->acal_users++;
+			goto out;
+		}
+	}
+
+	acal = acal_alloc(net->ifindex, addr);
+	if (!acal) {
+		err = -ENOMEM;
+		goto out;
+	}
+
+	hlist_add_head_rcu(&acal->acal_lst, &inet6_acaddr_lst[hash]);
+
+out:
+	spin_unlock(&acaddr_hash_lock);
+	return err;
+}
+
+static void ipv6_del_acaddr_hash(struct net *net, const struct in6_addr *addr)
+{
+	unsigned int hash = inet6_acaddr_hash(net, addr);
+	struct ipv6_ac_addrlist *acal;
+
+	spin_lock(&acaddr_hash_lock);
+	hlist_for_each_entry(acal, &inet6_acaddr_lst[hash], acal_lst) {
+		if (acal->acal_ifindex != net->ifindex)
+			continue;
+		if (ipv6_addr_equal(&acal->acal_addr, addr)) {
+			if (--acal->acal_users < 1) {
+				hlist_del_init_rcu(&acal->acal_lst);
+				kfree_rcu(acal, rcu);
+			}
+			spin_unlock(&acaddr_hash_lock);
+			return;
+		}
+	}
+	spin_unlock(&acaddr_hash_lock);
+}
+
 static void aca_get(struct ifacaddr6 *aca)
 {
 	refcount_inc(&aca->aca_refcnt);
@@ -275,6 +356,13 @@ int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr)
 		err = -ENOMEM;
 		goto out;
 	}
+	err = ipv6_add_acaddr_hash(dev_net(idev->dev), addr);
+	if (err) {
+		fib6_info_release(f6i);
+		fib6_info_release(f6i);
+		kfree(aca);
+		goto out;
+	}
 
 	aca->aca_next = idev->ac_list;
 	idev->ac_list = aca;
@@ -324,6 +412,7 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr)
 		prev_aca->aca_next = aca->aca_next;
 	else
 		idev->ac_list = aca->aca_next;
+	ipv6_del_acaddr_hash(dev_net(idev->dev), &aca->aca_addr);
 	write_unlock_bh(&idev->lock);
 	addrconf_leave_solict(idev, &aca->aca_addr);
 
@@ -350,6 +439,8 @@ void ipv6_ac_destroy_dev(struct inet6_dev *idev)
 	write_lock_bh(&idev->lock);
 	while ((aca = idev->ac_list) != NULL) {
 		idev->ac_list = aca->aca_next;
+		ipv6_del_acaddr_hash(dev_net(idev->dev), &aca->aca_addr);
+
 		write_unlock_bh(&idev->lock);
 
 		addrconf_leave_solict(idev, &aca->aca_addr);
@@ -391,16 +482,22 @@ bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
 			 const struct in6_addr *addr)
 {
 	bool found = false;
+	unsigned int hash = inet6_acaddr_hash(net, addr);
+	struct ipv6_ac_addrlist *acal;
 
 	rcu_read_lock();
 	if (dev)
 		found = ipv6_chk_acast_dev(dev, addr);
 	else
-		for_each_netdev_rcu(net, dev)
-			if (ipv6_chk_acast_dev(dev, addr)) {
+		hlist_for_each_entry_rcu(acal, &inet6_acaddr_lst[hash],
+					 acal_lst) {
+			if (acal->acal_ifindex != net->ifindex)
+				continue;
+			if (ipv6_addr_equal(&acal->acal_addr, addr)) {
 				found = true;
 				break;
 			}
+		}
 	rcu_read_unlock();
 	return found;
 }
@@ -539,4 +636,25 @@ void ac6_proc_exit(struct net *net)
 {
 	remove_proc_entry("anycast6", net->proc_net);
 }
+
+/*	Init / cleanup code
+ */
+int __init anycast_init(void)
+{
+	int i;
+
+	for (i = 0; i < IN6_ADDR_HSIZE; i++)
+		INIT_HLIST_HEAD(&inet6_acaddr_lst[i]);
+	return 0;
+}
+
+void anycast_cleanup(void)
+{
+	int i;
+
+	spin_lock(&acaddr_hash_lock);
+	for (i = 0; i < IN6_ADDR_HSIZE; i++)
+		WARN_ON(!hlist_empty(&inet6_acaddr_lst[i]));
+	spin_unlock(&acaddr_hash_lock);
+}
 #endif
-- 
2.14.1

^ permalink raw reply related

* Re: [PATCH v3] isdn: hfc_{pci,sx}: Avoid empty body if statements
From: David Miller @ 2018-10-23  2:25 UTC (permalink / raw)
  To: natechancellor; +Cc: isdn, netdev, linux-kernel, yamada.masahiro
In-Reply-To: <20181019011103.32087-1-natechancellor@gmail.com>

From: Nathan Chancellor <natechancellor@gmail.com>
Date: Thu, 18 Oct 2018 18:11:04 -0700

> Clang warns:
> 
> drivers/isdn/hisax/hfc_pci.c:131:34: error: if statement has empty body
> [-Werror,-Wempty-body]
>         if (Read_hfc(cs, HFCPCI_INT_S1));
>                                         ^
> drivers/isdn/hisax/hfc_pci.c:131:34: note: put the semicolon on a
> separate line to silence this warning
> 
> In my attempt to hide the warnings because I thought they didn't serve
> any purpose[1], Masahiro Yamada pointed out that {Read,Write}_hfc in
> hci_pci.c should be using a standard register access method; otherwise,
> the compiler will just remove the if statements.
> 
> For hfc_pci, use the versions of {Read,Write}_hfc found in
> drivers/isdn/hardware/mISDN/hfc_pCI.h while converting pci_io to be
> 'void __iomem *' (and clean up ioremap) then remove the empty if
> statements.
> 
> For hfc_sx, {Read,Write}_hfc are already use a proper register accessor
> (inb, outb) so just remove the unnecessary if statements.
> 
> [1]: https://lore.kernel.org/lkml/20181016021454.11953-1-natechancellor@gmail.com/
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/66
> Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH] tipc: use destination length for copy string
From: David Miller @ 2018-10-23  2:25 UTC (permalink / raw)
  To: gqjiang; +Cc: jon.maloy, ying.xue, netdev, tipc-discussion
In-Reply-To: <20181019040822.15961-1-gqjiang@suse.com>

From: Guoqing Jiang <gqjiang@suse.com>
Date: Fri, 19 Oct 2018 12:08:22 +0800

> Got below warning with gcc 8.2 compiler.
> 
> net/tipc/topsrv.c: In function ‘tipc_topsrv_start’:
> net/tipc/topsrv.c:660:2: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
>   strncpy(srv->name, name, strlen(name) + 1);
>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> net/tipc/topsrv.c:660:27: note: length computed here
>   strncpy(srv->name, name, strlen(name) + 1);
>                            ^~~~~~~~~~~~
> So change it to correct length and use strscpy.
> 
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>

Applied.

^ permalink raw reply


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