Netdev List
 help / color / mirror / Atom feed
* [PATCH] net/hamradio/6pack: remove redundant variable channel
From: Colin King @ 2018-07-05 10:11 UTC (permalink / raw)
  To: Andreas Koensgen, David S . Miller, linux-hams, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable channel is being assigned but is never used hence it is
redundant and can be removed.

Cleans up two clang warnings:
warning: variable 'channel' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/hamradio/6pack.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 32f49c4ce457..d79a69dd2146 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -878,10 +878,8 @@ static void decode_data(struct sixpack *sp, unsigned char inbyte)
 
 static void decode_prio_command(struct sixpack *sp, unsigned char cmd)
 {
-	unsigned char channel;
 	int actual;
 
-	channel = cmd & SIXP_CHN_MASK;
 	if ((cmd & SIXP_PRIO_DATA_MASK) != 0) {     /* idle ? */
 
 	/* RX and DCD flags can only be set in the same prio command,
@@ -933,10 +931,9 @@ static void decode_prio_command(struct sixpack *sp, unsigned char cmd)
 
 static void decode_std_command(struct sixpack *sp, unsigned char cmd)
 {
-	unsigned char checksum = 0, rest = 0, channel;
+	unsigned char checksum = 0, rest = 0;
 	short i;
 
-	channel = cmd & SIXP_CHN_MASK;
 	switch (cmd & SIXP_CMD_MASK) {     /* normal command */
 	case SIXP_SEOF:
 		if ((sp->rx_count == 0) && (sp->rx_count_cooked == 0)) {
-- 
2.17.1

^ permalink raw reply related

* Re: [PATCH][net-next][v2] net: limit each hash list length to MAX_GRO_SKBS
From: David Miller @ 2018-07-05 10:20 UTC (permalink / raw)
  To: lirongqing; +Cc: netdev
In-Reply-To: <1530772472-8674-1-git-send-email-lirongqing@baidu.com>

From: Li RongQing <lirongqing@baidu.com>
Date: Thu,  5 Jul 2018 14:34:32 +0800

> After commit 07d78363dcff ("net: Convert NAPI gro list into a small hash
> table.")' there is 8 hash buckets, which allows more flows to be held for
> merging.  but MAX_GRO_SKBS, the total held skb for merging, is 8 skb still,
> limit the hash table performance.
> 
> keep MAX_GRO_SKBS as 8 skb, but limit each hash list length to 8 skb, not
> the total 8 skb
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] net: dsa: vsc73xx: Make some functions static
From: David Miller @ 2018-07-05 10:30 UTC (permalink / raw)
  To: weiyongjun1
  Cc: andrew, vivien.didelot, f.fainelli, linus.walleij, netdev,
	kernel-janitors
In-Reply-To: <1530781149-52681-1-git-send-email-weiyongjun1@huawei.com>

From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Thu, 5 Jul 2018 08:59:09 +0000

> Fixes the following sparse warnings:
> 
> drivers/net/dsa/vitesse-vsc73xx.c:1054:6: warning:
>  symbol 'vsc73xx_get_strings' was not declared. Should it be static?
> drivers/net/dsa/vitesse-vsc73xx.c:1113:5: warning:
>  symbol 'vsc73xx_get_sset_count' was not declared. Should it be static?
> drivers/net/dsa/vitesse-vsc73xx.c:1122:6: warning:
>  symbol 'vsc73xx_get_ethtool_stats' was not declared. Should it be static?
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] net: aquantia: Make some functions static
From: David Miller @ 2018-07-05 10:30 UTC (permalink / raw)
  To: weiyongjun1; +Cc: igor.russkikh, pavel.belous, netdev, kernel-janitors
In-Reply-To: <1530781210-54589-1-git-send-email-weiyongjun1@huawei.com>

From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Thu, 5 Jul 2018 09:00:10 +0000

> Fixes the following sparse warnings:
> 
> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:525:5: warning:
>  symbol 'hw_atl_utils_mpi_set_speed' was not declared. Should it be static?
> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:536:5: warning:
>  symbol 'hw_atl_utils_mpi_set_state' was not declared. Should it be static?
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.

^ permalink raw reply

* Re: [PATCH] net: socionext: remove redundant pointer ndev
From: David Miller @ 2018-07-05 10:31 UTC (permalink / raw)
  To: colin.king; +Cc: jaswinder.singh, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20180705092613.20560-1-colin.king@canonical.com>

From: Colin King <colin.king@canonical.com>
Date: Thu,  5 Jul 2018 10:26:13 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer ndev is being assigned but is never used hence it is
> redundant and can be removed.
> 
> Cleans up clang warning:
> warning: variable 'ndev' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply

* Re: [PATCH] net: ethernet: sun: remove redundant variables adv and lpa
From: David Miller @ 2018-07-05 10:33 UTC (permalink / raw)
  To: colin.king; +Cc: netdev, kernel-janitors, linux-kernel
In-Reply-To: <20180705093732.21650-1-colin.king@canonical.com>

From: Colin King <colin.king@canonical.com>
Date: Thu,  5 Jul 2018 10:37:32 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variables adv and lpa are being assigned but are never used hence they
> are redundant and can be removed.
> 
> Cleans up clang warnings:
> warning: variable 'lpa' set but not used [-Wunused-but-set-variable]
> warning: variable 'adv' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

I think you can safely remove the register reads too, so please
do so.

Thanks.

^ permalink raw reply

* Re: [PATCH] net: tehuti: remove redundant pointer skb
From: David Miller @ 2018-07-05 10:33 UTC (permalink / raw)
  To: colin.king; +Cc: andy, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20180705095549.22042-1-colin.king@canonical.com>

From: Colin King <colin.king@canonical.com>
Date: Thu,  5 Jul 2018 10:55:49 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer skb is being assigned but is never used hence it is
> redundant and can be removed.
> 
> Cleans up clang warning:
> warning: variable 'skb' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply

* Re: [PATCH] fjes: use currently unused variable my_epid and max_epid
From: David Miller @ 2018-07-05 10:35 UTC (permalink / raw)
  To: colin.king; +Cc: netdev, kernel-janitors, linux-kernel
In-Reply-To: <20180705100532.22277-1-colin.king@canonical.com>

From: Colin King <colin.king@canonical.com>
Date: Thu,  5 Jul 2018 11:05:32 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variables my_epid and max_epid are currently assigned and not being
> used - however, I suspect they were intended to be used in the for-loops
> to reduce the dereferencing of hw.  Replace hw->my_epid and hw->max_epid
> with these variables.
> 
> Cleans up clang warnings:
> warning: variable 'my_epid' set but not used [-Wunused-but-set-variable]
> variable 'max_epid' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply

* Re: [PATCH] net/hamradio/6pack: remove redundant variable channel
From: David Miller @ 2018-07-05 10:35 UTC (permalink / raw)
  To: colin.king; +Cc: ajk, linux-hams, netdev, kernel-janitors, linux-kernel
In-Reply-To: <20180705101107.22897-1-colin.king@canonical.com>

From: Colin King <colin.king@canonical.com>
Date: Thu,  5 Jul 2018 11:11:07 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable channel is being assigned but is never used hence it is
> redundant and can be removed.
> 
> Cleans up two clang warnings:
> warning: variable 'channel' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply

* Re: [RFC net-next 00/15] net: A socket API for LoRa
From: Helmut Tschemernjak @ 2018-07-05 10:43 UTC (permalink / raw)
  To: Stefan Schmidt, Andreas Färber, netdev
  Cc: Michal Kubeček, Konstantin Böhm, contact, Ken Yu,
	Michael Röder, Rob Herring, lora, Alexander Graf,
	Jan Jongboom, Janus Piwek, Jon Ortego, Jian-Hong Pan, devicetree,
	Jiri Pirko, Marcel Holtmann, Mark Brown, Dollar Chen, Brian Ray,
	linux-arm-kernel, lora, Matthias Brugger, Ben Whitten,
	linux-kernel, linux-spi
In-Reply-To: <487df785-ddf5-ed81-a253-6afb7f2de811@datenfreihafen.org>

Dear Andreas,

I put the kernel support for the SX1276 LoRa chip in question. I don’t 
think that this kind of device should be in the Linux kernel.

Here are a few facts to consider:
- A LoRa transaction is very slow  (e.g. SF7 needs about 210 ms, for 
SF12 6280 ms) for 12 bytes user data with acknowledge.

- There are many different implementations for the antenna switch, 
switching between receiving/sending, PA-BOOST, 433, 868/915 MHz. (I know 
SX1276 Heltec ESP32, SX1276 Murata, RFM95-(1276), SX1276 Heltec 
STM32-L4) they are all different regarding this.

- The LoRa chip device ID is only 8-bit which is not sufficient for 
larger networks, e.g. our RadioShuttle protocol uses compressed 32-bit 
device IDs.

- The chip can do MTU sizes up to 2048 bytes, most protocols use less 
than 250 bytes.

- Applications do on-the-fly channel and spreading factor switching 
which makes it more difficult for the configuration.

- The chip supports Lora modulation as well as  FSK, GFSK, MSK, GMSK, 
and OOK modulation, for some use cases the other modulations are of 
interest, e.g. to communicated with other devices.

- Power saving modes, like sleep, suspend may be required for battery 
operation.

- Cad detection is very flexible and can be differently used.

- LoRa preamble may be different depending on the protocol used.

- The new Lora chip SX1262 / 68 (successor of the SX1276) has different 
hardware and all different registers, it is driver incompatible with the 
SX1276. It needs an entire new driver.

- The device is not multi-process capable (only a single process can 
communicate with it).

- There are SX1276 LoRa modules with a build-in protocol (LoRaWAN and 
RAW) via a serial connection only, again complete different API compared 
the SX1276 chip. Software updates for this devices are difficult.

- I am even convinced that the LoRaWAN protocol with the concentrator 
concept is not good, the peer to peer communication and a standard MQTT 
gateway (what we do) is way more flexible.

For all this reasons, I feel a user level driver task implementation is 
way more flexible. I did a lot of work/enhancements on the SX1276 link 
level driver from Semtech, it is available and maintained on mbed.org 
and supports mbed-os, Arduino and is prepared for Linux.
https://os.mbed.com/users/Helmut64/code/SX1276GenericLib/

Protocols e.g. our RadioShuttle LoRa peer to peer protocol or the 
LoRaWAN protocol can run on top of the SX1276GenericLib. We may should 
focus on such a driver library getting supported for multiple OS's (Win, 
Linux, mbed, Ardino, etc.)

Again I feel a Linux kernel device driver for the SX1276 chip make 
little sense for me.

Regards
Helmut Tschemernjak (www.radioshuttle.de, www.helios.de)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* Re: [PATCH] net: ethernet: sun: remove redundant variables adv and lpa
From: Colin Ian King @ 2018-07-05 10:50 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, kernel-janitors, linux-kernel
In-Reply-To: <20180705.193315.2106014813802269928.davem@davemloft.net>

On 05/07/18 11:33, David Miller wrote:
> From: Colin King <colin.king@canonical.com>
> Date: Thu,  5 Jul 2018 10:37:32 +0100
> 
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Variables adv and lpa are being assigned but are never used hence they
>> are redundant and can be removed.
>>
>> Cleans up clang warnings:
>> warning: variable 'lpa' set but not used [-Wunused-but-set-variable]
>> warning: variable 'adv' set but not used [-Wunused-but-set-variable]
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> I think you can safely remove the register reads too, so please
> do so.

Just to clarify, just the MII_ADVERTISE and MII_LPA, or both these AND
also MII_ESTATUS too?

> 
> Thanks.
> 

^ permalink raw reply

* Re: [PATCH] net: ethernet: sun: remove redundant variables adv and lpa
From: David Miller @ 2018-07-05 10:52 UTC (permalink / raw)
  To: colin.king; +Cc: netdev, kernel-janitors, linux-kernel
In-Reply-To: <dfecea10-87b5-2110-6efb-02f46e7b4e2c@canonical.com>

From: Colin Ian King <colin.king@canonical.com>
Date: Thu, 5 Jul 2018 11:50:01 +0100

> Just to clarify, just the MII_ADVERTISE and MII_LPA, or both these AND
> also MII_ESTATUS too?

I think you can safely remove all three.

^ permalink raw reply

* Re: [PATCH 3/3] net: ethernet: sfc: Make subdir logic consistent with other vendors
From: Martin Habets @ 2018-07-05 10:54 UTC (permalink / raw)
  To: Geert Uytterhoeven, David S . Miller, Bert Kenward
  Cc: Nicolas Ferre, Solarflare linux maintainers, Edward Cree, netdev,
	linux-kernel
In-Reply-To: <20180704115013.28078-4-geert+renesas@glider.be>


On 04/07/18 12:50, Geert Uytterhoeven wrote:
> Both SFC and SFC_FALCON depend on NET_VENDOR_SOLARFLARE, hence use the
> latter to decide whether to descend into the sfc subdirectory.
> Move the rule to descend into sfc/falcon to the sfc subdirectory.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Martin Habets <mhabets@solarflare.com>

> ---
>  drivers/net/ethernet/Makefile     | 3 +--
>  drivers/net/ethernet/sfc/Makefile | 2 ++
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
> index 0c3ab7efff8c9ddb..22555e7fa752c67e 100644
> --- a/drivers/net/ethernet/Makefile
> +++ b/drivers/net/ethernet/Makefile
> @@ -80,8 +80,7 @@ obj-$(CONFIG_NET_VENDOR_SAMSUNG) += samsung/
>  obj-$(CONFIG_NET_VENDOR_SEEQ) += seeq/
>  obj-$(CONFIG_NET_VENDOR_SILAN) += silan/
>  obj-$(CONFIG_NET_VENDOR_SIS) += sis/
> -obj-$(CONFIG_SFC) += sfc/
> -obj-$(CONFIG_SFC_FALCON) += sfc/falcon/
> +obj-$(CONFIG_NET_VENDOR_SOLARFLARE) += sfc/
>  obj-$(CONFIG_NET_VENDOR_SGI) += sgi/
>  obj-$(CONFIG_NET_VENDOR_SMSC) += smsc/
>  obj-$(CONFIG_NET_VENDOR_SOCIONEXT) += socionext/
> diff --git a/drivers/net/ethernet/sfc/Makefile b/drivers/net/ethernet/sfc/Makefile
> index 3bac58d0f88b20f8..c5c297e78d068f41 100644
> --- a/drivers/net/ethernet/sfc/Makefile
> +++ b/drivers/net/ethernet/sfc/Makefile
> @@ -6,3 +6,5 @@ sfc-$(CONFIG_SFC_MTD)	+= mtd.o
>  sfc-$(CONFIG_SFC_SRIOV)	+= sriov.o siena_sriov.o ef10_sriov.o
>  
>  obj-$(CONFIG_SFC)	+= sfc.o
> +
> +obj-$(CONFIG_SFC_FALCON) += falcon/
> 

^ permalink raw reply

* Re: [PATCH net-next 00/10] Add configuration parameters support
From: David Miller @ 2018-07-05 10:58 UTC (permalink / raw)
  To: moshe; +Cc: vasundhara-v.volam, jiri, netdev, linux-kernel
In-Reply-To: <1530703837-24563-1-git-send-email-moshe@mellanox.com>

From: Moshe Shemesh <moshe@mellanox.com>
Date: Wed,  4 Jul 2018 14:30:27 +0300

> Add configuration parameters setting through devlink.
> Each device registers supported configuration parameters table.
> Each parameter can be either generic or driver specific.
> The user can retrieve data on these parameters by "devlink param show"
> command and can set new value to a parameter by "devlink param set"
> command.
> The parameters can be set in different configuration modes:
>   runtime - set while driver is running, no reset required.
>   driverinit - applied while driver initializes, requires restart
>                driver by devlink reload command.
>   permanent - written to device's non-volatile memory, hard reset required.
> 
> The patches at the end of the patchset introduce few params that are using
> the introduced infrastructure on mlx4 and bnxt.
> 
> Command examples and output:
 ...

Looks great, series applied, thanks!

^ permalink raw reply

* [PATCH][V2] net: ethernet: sun: remove redundant variables adv and lpa and mii_reads
From: Colin King @ 2018-07-05 11:05 UTC (permalink / raw)
  To: David S . Miller, netdev; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variables adv and lpa are being assigned but are never used hence they
are redundant and can be removed.  Also remove the unncessary mii_reads
too.

Cleans up clang warnings:
warning: variable 'lpa' set but not used [-Wunused-but-set-variable]
warning: variable 'adv' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---

V2: remove mii_reads as suggessted by Dan Carpenter and David Miller

---
 drivers/net/ethernet/sun/niu.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index 88c12474a0c3..9319d84bf49f 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -1225,25 +1225,9 @@ static int link_status_1g_rgmii(struct niu *np, int *link_up_p)
 
 	bmsr = err;
 	if (bmsr & BMSR_LSTATUS) {
-		u16 adv, lpa;
-
-		err = mii_read(np, np->phy_addr, MII_ADVERTISE);
-		if (err < 0)
-			goto out;
-		adv = err;
-
-		err = mii_read(np, np->phy_addr, MII_LPA);
-		if (err < 0)
-			goto out;
-		lpa = err;
-
-		err = mii_read(np, np->phy_addr, MII_ESTATUS);
-		if (err < 0)
-			goto out;
 		link_up = 1;
 		current_speed = SPEED_1000;
 		current_duplex = DUPLEX_FULL;
-
 	}
 	lp->active_speed = current_speed;
 	lp->active_duplex = current_duplex;
-- 
2.17.1

^ permalink raw reply related

* Re: [PATCH 0/3] net: ethernet: Miscellaneous Kconfig and Makefile cleanups
From: David Miller @ 2018-07-05 11:06 UTC (permalink / raw)
  To: geert+renesas
  Cc: nicolas.ferre, linux-net-drivers, ecree, bkenward, netdev,
	linux-kernel
In-Reply-To: <20180704115013.28078-1-geert+renesas@glider.be>

From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: Wed,  4 Jul 2018 13:50:10 +0200

> This patch series contains a few Kconfig and Makefile cleanups w.r.t.
> Ethernet vendors.

Series applied to net-next, thanks Geert.

^ permalink raw reply

* Re: [PATCH][V2] net: ethernet: sun: remove redundant variables adv and lpa and mii_reads
From: David Miller @ 2018-07-05 11:08 UTC (permalink / raw)
  To: colin.king; +Cc: netdev, kernel-janitors, linux-kernel
In-Reply-To: <20180705110525.27231-1-colin.king@canonical.com>

From: Colin King <colin.king@canonical.com>
Date: Thu,  5 Jul 2018 12:05:25 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variables adv and lpa are being assigned but are never used hence they
> are redundant and can be removed.  Also remove the unncessary mii_reads
> too.
> 
> Cleans up clang warnings:
> warning: variable 'lpa' set but not used [-Wunused-but-set-variable]
> warning: variable 'adv' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> 
> V2: remove mii_reads as suggessted by Dan Carpenter and David Miller

Applied, thanks Colin.

^ permalink raw reply

* Re: [PATCH net] qed: off by one in qed_parse_mcp_trace_buf()
From: David Miller @ 2018-07-05 11:13 UTC (permalink / raw)
  To: dan.carpenter
  Cc: Ariel.Elior, Michal.Kalderon, everest-linux-l2, netdev,
	kernel-janitors
In-Reply-To: <20180704095236.l3ub5au4jhoihk3g@kili.mountain>

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 4 Jul 2018 12:52:36 +0300

> If format_idx == s_mcp_trace_meta.formats_num then we read one element
> beyond the end of the s_mcp_trace_meta.formats[] array.
> 
> Fixes: 50bc60cb155c ("qed*: Utilize FW 8.33.11.0")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

^ permalink raw reply

* Re: [PATCH net] ixgbe: Off by one in ixgbe_ipsec_tx()
From: David Miller @ 2018-07-05 11:13 UTC (permalink / raw)
  To: dan.carpenter
  Cc: jeffrey.t.kirsher, shannon.nelson, intel-wired-lan, netdev,
	kernel-janitors
In-Reply-To: <20180704095337.nqiczkkd5r6k755v@kili.mountain>

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 4 Jul 2018 12:53:37 +0300

> The ipsec->tx_tbl[] has IXGBE_IPSEC_MAX_SA_COUNT elements so the > needs
> to be changed to >= so we don't read one element beyond the end of the
> array.
> 
> Fixes: 592594704761 ("ixgbe: process the Tx ipsec offload")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

I'll let Jeff pick this up.

^ permalink raw reply

* Re: [PATCH net-next] cxgb4: Fix the condition to check if the card is T5
From: David Miller @ 2018-07-05 11:14 UTC (permalink / raw)
  To: ganeshgr; +Cc: netdev, nirranjan, indranil
In-Reply-To: <1530706773-8870-1-git-send-email-ganeshgr@chelsio.com>

From: Ganesh Goudar <ganeshgr@chelsio.com>
Date: Wed,  4 Jul 2018 17:49:33 +0530

> Use 'chip_ver' rather than 'chip' to check if the card
> is T5.
> 
> Fixes: e8d452923ae6 ("cxgb4: clean up init_one")
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>

Applied.

^ permalink raw reply

* Re: [RFC PATCH v3] ipv6: make ipv6_renew_options() interrupt/kernel safe
From: David Miller @ 2018-07-05 11:15 UTC (permalink / raw)
  To: pmoore; +Cc: netdev, viro, selinux, linux-security-module
In-Reply-To: <153071268532.4174.13831205890855497876.stgit@chester>

From: Paul Moore <pmoore@redhat.com>
Date: Wed, 04 Jul 2018 09:58:05 -0400

> From: Paul Moore <paul@paul-moore.com>
> 
> At present the ipv6_renew_options_kern() function ends up calling into
> access_ok() which is problematic if done from inside an interrupt as
> access_ok() calls WARN_ON_IN_IRQ() on some (all?) architectures
> (x86-64 is affected).  Example warning/backtrace is shown below:
> 
>  WARNING: CPU: 1 PID: 3144 at lib/usercopy.c:11 _copy_from_user+0x85/0x90
 ...
> While not present in the backtrace, ipv6_renew_option() ends up calling
> access_ok() via the following chain:
> 
>   access_ok()
>   _copy_from_user()
>   copy_from_user()
>   ipv6_renew_option()
> 
> The fix presented in this patch is to perform the userspace copy
> earlier in the call chain such that it is only called when the option
> data is actually coming from userspace; that place is
> do_ipv6_setsockopt().  Not only does this solve the problem seen in
> the backtrace above, it also allows us to simplify the code quite a
> bit by removing ipv6_renew_options_kern() completely.  We also take
> this opportunity to cleanup ipv6_renew_options()/ipv6_renew_option()
> a small amount as well.
> 
> This patch is heavily based on a rough patch by Al Viro.  I've taken
> his original patch, converted a kmemdup() call in do_ipv6_setsockopt()
> to a memdup_user() call, made better use of the e_inval jump target in
> the same function, and cleaned up the use ipv6_renew_option() by
> ipv6_renew_options().
> 
> CC: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Paul Moore <paul@paul-moore.com>

This looks good to me, applied to 'net'.

^ permalink raw reply

* Re: [PATCH wpan 1/2] net: 6lowpan: fix reserved space for single frames
From: Stefan Schmidt @ 2018-07-05 11:16 UTC (permalink / raw)
  To: Alexander Aring, stefan
  Cc: linux-wpan, netdev, kernel, David Palma, Rabi Narayan Sahoo
In-Reply-To: <20180702203203.21316-1-aring@mojatatu.com>

Hello.

[CC David Palma and Rabi Narayan Sahoo]

On 02.07.2018 22:32, Alexander Aring wrote:
> This patch fixes patch add handling to take care tail and headroom for
> single 6lowpan frames. We need to be sure we have a skb with the right
> head and tailroom for single frames. This patch do it by using
> skb_copy_expand() if head and tailroom is not enough allocated by upper
> layer.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195059
> Reported-by: David Palma <david.palma@ntnu.no>
> Reported-by: Rabi Narayan Sahoo <rabinarayans0828@gmail.com>
> Signed-off-by: Alexander Aring <aring@mojatatu.com>

David, Rabi and you please test these two patches and verify that it
fixes the problems you have?

regards
Stefan Schmidt

> ---
>  net/ieee802154/6lowpan/tx.c | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan/tx.c b/net/ieee802154/6lowpan/tx.c
> index e6ff5128e61a..d0c4d220de08 100644
> --- a/net/ieee802154/6lowpan/tx.c
> +++ b/net/ieee802154/6lowpan/tx.c
> @@ -265,9 +265,24 @@ netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *ldev)
>  	/* We must take a copy of the skb before we modify/replace the ipv6
>  	 * header as the header could be used elsewhere
>  	 */
> -	skb = skb_unshare(skb, GFP_ATOMIC);
> -	if (!skb)
> -		return NET_XMIT_DROP;
> +	if (unlikely(skb_headroom(skb) < ldev->needed_headroom ||
> +		     skb_tailroom(skb) < ldev->needed_tailroom)) {
> +		struct sk_buff *nskb;
> +
> +		nskb = skb_copy_expand(skb, ldev->needed_headroom,
> +				       ldev->needed_tailroom, GFP_ATOMIC);
> +		if (likely(skb)) {
> +			consume_skb(skb);
> +			skb = nskb;
> +		} else {
> +			kfree_skb(skb);
> +			return NET_XMIT_DROP;
> +		}
> +	} else {
> +		skb = skb_unshare(skb, GFP_ATOMIC);
> +		if (!skb)
> +			return NET_XMIT_DROP;
> +	}
>  
>  	ret = lowpan_header(skb, ldev, &dgram_size, &dgram_offset);
>  	if (ret < 0) {
> 

^ permalink raw reply

* Re: [PATCH 0/2] net: qrtr: Broadcasting control messages
From: David Miller @ 2018-07-05 11:20 UTC (permalink / raw)
  To: aneela; +Cc: bjorn.andersson, netdev, linux-kernel, linux-arm-msm
In-Reply-To: <1530713973-26696-1-git-send-email-aneela@codeaurora.org>

From: Arun Kumar Neelakantam <aneela@codeaurora.org>
Date: Wed,  4 Jul 2018 19:49:31 +0530

> Allow messages only from control port to broadcast to avoid unnecessary 
> messages and reset the node to local router NODE ID in control messages
> otherwise remote routers consider the packets as invalid and Drops it.

Series applied, thanks.

^ permalink raw reply

* Re: [4/4] rhashtable: improve rhashtable_walk stability when stop/start used.
From: Paolo Abeni @ 2018-07-05 11:20 UTC (permalink / raw)
  To: NeilBrown, Thomas Graf, Herbert Xu, David Miller; +Cc: netdev, linux-kernel
In-Reply-To: <152452255351.1456.12384285355497513812.stgit@noble>

On Tue, 2018-04-24 at 08:29 +1000, NeilBrown wrote:
> diff --git a/lib/rhashtable.c b/lib/rhashtable.c
> index 81edf1ab38ab..9427b5766134 100644
> --- a/lib/rhashtable.c
> +++ b/lib/rhashtable.c
> @@ -727,6 +727,7 @@ int rhashtable_walk_start_check(struct rhashtable_iter *iter)
>  	__acquires(RCU)
>  {
>  	struct rhashtable *ht = iter->ht;
> +	bool rhlist = ht->rhlist;
>  
>  	rcu_read_lock();
>  
> @@ -735,13 +736,52 @@ int rhashtable_walk_start_check(struct rhashtable_iter *iter)
>  		list_del(&iter->walker.list);
>  	spin_unlock(&ht->lock);
>  
> -	if (!iter->walker.tbl && !iter->end_of_table) {
> +	if (iter->end_of_table)
> +		return 0;
> +	if (!iter->walker.tbl) {
>  		iter->walker.tbl = rht_dereference_rcu(ht->tbl, ht);
>  		iter->slot = 0;
>  		iter->skip = 0;
>  		return -EAGAIN;
>  	}
>  
> +	if (iter->p && !rhlist) {
> +		/*
> +		 * We need to validate that 'p' is still in the table, and
> +		 * if so, update 'skip'
> +		 */
> +		struct rhash_head *p;
> +		int skip = 0;
> +		rht_for_each_rcu(p, iter->walker.tbl, iter->slot) {
> +			skip++;
> +			if (p == iter->p) {
> +				iter->skip = skip;
> +				goto found;
> +			}
> +		}
> +		iter->p = NULL;
> +	} else if (iter->p && rhlist) {
> +		/* Need to validate that 'list' is still in the table, and
> +		 * if so, update 'skip' and 'p'.
> +		 */
> +		struct rhash_head *p;
> +		struct rhlist_head *list;
> +		int skip = 0;
> +		rht_for_each_rcu(p, iter->walker.tbl, iter->slot) {
> +			for (list = container_of(p, struct rhlist_head, rhead);
> +			     list;
> +			     list = rcu_dereference(list->next)) {
> +				skip++;
> +				if (list == iter->list) {
> +					iter->p = p;
> +					skip = skip;
> +					goto found;
> +				}
> +			}
> +		}
> +		iter->p = NULL;
> +	}
> +found:
>  	return 0;
>  }
>  EXPORT_SYMBOL_GPL(rhashtable_walk_start_check);

While testing new code that uses the rhashtable walker, I'm obeserving
an use after free, that is apparently caused by the above:

[  146.834815] ==================================================================
[  146.842933] BUG: KASAN: use-after-free in inet_frag_worker+0x9f/0x210
[  146.850120] Read of size 4 at addr ffff881b6b9342d8 by task kworker/13:1/177
[  146.857984] 
[  146.859645] CPU: 13 PID: 177 Comm: kworker/13:1 Not tainted 4.18.0-rc3.mirror_unclone_6_frag_dbg+ #1974
[  146.870128] Hardware name: Dell Inc. PowerEdge R730/072T6D, BIOS 2.1.7 06/16/2016
[  146.878478] Workqueue: events inet_frag_worker
[  146.883433] Call Trace:
[  146.886162]  dump_stack+0x90/0xe3
[  146.889861]  print_address_description+0x6a/0x2a0
[  146.895109]  kasan_report+0x176/0x2d0
[  146.899193]  ? inet_frag_worker+0x9f/0x210
[  146.903762]  inet_frag_worker+0x9f/0x210
[  146.908142]  process_one_work+0x24f/0x6e0
[  146.912614]  ? process_one_work+0x1a6/0x6e0
[  146.917285]  worker_thread+0x4e/0x3d0
[  146.921373]  kthread+0x106/0x140
[  146.924970]  ? process_one_work+0x6e0/0x6e0
[  146.929637]  ? kthread_bind+0x10/0x10
[  146.933723]  ret_from_fork+0x3a/0x50
[  146.937717] 
[  146.939377] Allocated by task 177:
[  146.943170]  kasan_kmalloc+0x86/0xb0
[  146.947158]  __kmalloc_node+0x181/0x430
[  146.951438]  kvmalloc_node+0x4f/0x70
[  146.955427]  alloc_bucket_spinlocks+0x34/0xa0
[  146.960286]  bucket_table_alloc.isra.13+0x61/0x180
[  146.965630]  rhashtable_rehash_alloc+0x26/0x80
[  146.970585]  rht_deferred_worker+0x394/0x810
[  146.975348]  process_one_work+0x24f/0x6e0
[  146.979819]  worker_thread+0x4e/0x3d0
[  146.983902]  kthread+0x106/0x140
[  146.987502]  ret_from_fork+0x3a/0x50
[  146.991487] 
[  146.993146] Freed by task 90:
[  146.996455]  __kasan_slab_free+0x11d/0x180
[  147.001025]  kfree+0x113/0x350
[  147.004431]  bucket_table_free+0x1c/0x70
[  147.008806]  rcu_process_callbacks+0x6c8/0x880
[  147.013762]  __do_softirq+0xd5/0x505
[  147.017747] 
[  147.019407] The buggy address belongs to the object at ffff881b6b934200
[  147.019407]  which belongs to the cache kmalloc-8192 of size 8192
[  147.033574] The buggy address is located 216 bytes inside of
[  147.033574]  8192-byte region [ffff881b6b934200, ffff881b6b936200)
[  147.046773] The buggy address belongs to the page:
[  147.052116] page:ffffea006dae4c00 count:1 mapcount:0 mapping:ffff880107c0e400 index:0x0 compound_mapcount: 0
[  147.063086] flags: 0x17ffffc0008100(slab|head)
[  147.068043] raw: 0017ffffc0008100 dead000000000100 dead000000000200 ffff880107c0e400
[  147.076684] raw: 0000000000000000 0000000000030003 00000001ffffffff 0000000000000000
[  147.085324] page dumped because: kasan: bad access detected
[  147.091540] 
[  147.093210] Memory state around the buggy address:
[  147.098553]  ffff881b6b934180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  147.106613]  ffff881b6b934200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[  147.114670] >ffff881b6b934280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[  147.122730]                                                     ^
[  147.129527]  ffff881b6b934300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[  147.137587]  ffff881b6b934380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[  147.145646] ==================================================================

Reverting the above change avoid the issue. 

I *think* that reusing iter->p after a
rcu_read_lock()/rcu_read_unlock() is unsafe:
if the table has been reashed we can still and reuse 'p', but the
related grace period could be already expired.

I can't think of any better fix than a revert. Other opinions welcome!

Paolo

^ permalink raw reply

* Re: [PATCH v2] qmi_wwan: add support for Quectel EG91
From: David Miller @ 2018-07-05 11:22 UTC (permalink / raw)
  To: vucnikm; +Cc: bjorn, netdev, linux-usb, linux-kernel
In-Reply-To: <1530720768-18349-1-git-send-email-vucnikm@gmail.com>

From: Matevz Vucnik <vucnikm@gmail.com>
Date: Wed,  4 Jul 2018 18:12:48 +0200

> This adds the USB id of LTE modem Quectel EG91. It requires the
> same quirk as other Quectel modems to make it work.
> 
> Signed-off-by: Matevz Vucnik <vucnikm@gmail.com>

Applied and queued up for -stable.

^ 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