Netdev List
 help / color / mirror / Atom feed
* [PATCH 31/33] net: sfc: falcon: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:31 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Solarflare linux maintainers, Edward Cree, Bert Kenward
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 1384500 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/sfc/falcon/ethtool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sfc/falcon/ethtool.c b/drivers/net/ethernet/sfc/falcon/ethtool.c
index 5604915..1ccdb7a 100644
--- a/drivers/net/ethernet/sfc/falcon/ethtool.c
+++ b/drivers/net/ethernet/sfc/falcon/ethtool.c
@@ -963,6 +963,7 @@ ef4_ethtool_get_rxnfc(struct net_device *net_dev,
 		switch (info->flow_type) {
 		case TCP_V4_FLOW:
 			info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+			/* Fall through */
 		case UDP_V4_FLOW:
 		case SCTP_V4_FLOW:
 		case AH_ESP_V4_FLOW:
-- 
2.7.4

^ permalink raw reply related

* [PATCH 30/33] net: ethernet: sxgbe: mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:30 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Byungho An, Girish K S, Vipul Pandya
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 1357414 ("Missing break in switch")
Addresses-Coverity-ID: 1357415 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c
index 542b67d..c9aad0e 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c
@@ -319,6 +319,7 @@ static int sxgbe_get_rss_hash_opts(struct sxgbe_priv_data *priv,
 	case TCP_V4_FLOW:
 	case UDP_V4_FLOW:
 		cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+		/* Fall through */
 	case SCTP_V4_FLOW:
 	case AH_ESP_V4_FLOW:
 	case AH_V4_FLOW:
@@ -329,6 +330,7 @@ static int sxgbe_get_rss_hash_opts(struct sxgbe_priv_data *priv,
 	case TCP_V6_FLOW:
 	case UDP_V6_FLOW:
 		cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+		/* Fall through */
 	case SCTP_V6_FLOW:
 	case AH_ESP_V6_FLOW:
 	case AH_V6_FLOW:
-- 
2.7.4

^ permalink raw reply related

* [PATCH 29/33] qlge: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:29 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Harish Patil, Manish Chopra, Dept-GELinuxNICDev
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 114811 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/qlogic/qlge/qlge_mpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_mpi.c b/drivers/net/ethernet/qlogic/qlge/qlge_mpi.c
index 4be65d6..957c729 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_mpi.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_mpi.c
@@ -1176,6 +1176,7 @@ void ql_mpi_idc_work(struct work_struct *work)
 	case MB_CMD_PORT_RESET:
 	case MB_CMD_STOP_FW:
 		ql_link_off(qdev);
+		/* Fall through */
 	case MB_CMD_SET_PORT_CFG:
 		/* Signal the resulting link up AEN
 		 * that the frame routing and mac addr
-- 
2.7.4

^ permalink raw reply related

* [PATCH 28/33] qlcnic: Mark expected switch fall-througs
From: Gustavo A. R. Silva @ 2018-08-07 23:28 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Harish Patil, Manish Chopra, Dept-GELinuxNICDev
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 1410181 ("Missing break in switch")
Addresses-Coverity-ID: 1410184 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index 7f7deea..3b0adda 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -351,9 +351,9 @@ static int qlcnic_82xx_get_link_ksettings(struct qlcnic_adapter *adapter,
 	case QLCNIC_BRDTYPE_P3P_REF_QG:
 	case QLCNIC_BRDTYPE_P3P_4_GB:
 	case QLCNIC_BRDTYPE_P3P_4_GB_MM:
-
 		supported |= SUPPORTED_Autoneg;
 		advertising |= ADVERTISED_Autoneg;
+		/* fall through */
 	case QLCNIC_BRDTYPE_P3P_10G_CX4:
 	case QLCNIC_BRDTYPE_P3P_10G_CX4_LP:
 	case QLCNIC_BRDTYPE_P3P_10000_BASE_T:
@@ -377,6 +377,7 @@ static int qlcnic_82xx_get_link_ksettings(struct qlcnic_adapter *adapter,
 		supported |= SUPPORTED_TP;
 		check_sfp_module = netif_running(adapter->netdev) &&
 				   ahw->has_link_events;
+		/* fall through */
 	case QLCNIC_BRDTYPE_P3P_10G_XFP:
 		supported |= SUPPORTED_FIBRE;
 		advertising |= ADVERTISED_FIBRE;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 26/33] netxen_nic: Mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:26 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Manish Chopra, Rahul Verma, Dept-GELinuxNICDev
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 1410182 ("Missing break in switch")
Addresses-Coverity-ID: 1410183 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
index 3157f97..3c1be87 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
@@ -167,9 +167,9 @@ netxen_nic_get_link_ksettings(struct net_device *dev,
 	case NETXEN_BRDTYPE_P3_REF_QG:
 	case NETXEN_BRDTYPE_P3_4_GB:
 	case NETXEN_BRDTYPE_P3_4_GB_MM:
-
 		supported |= SUPPORTED_Autoneg;
 		advertising |= ADVERTISED_Autoneg;
+		/* fall through */
 	case NETXEN_BRDTYPE_P2_SB31_10G_CX4:
 	case NETXEN_BRDTYPE_P3_10G_CX4:
 	case NETXEN_BRDTYPE_P3_10G_CX4_LP:
@@ -198,6 +198,7 @@ netxen_nic_get_link_ksettings(struct net_device *dev,
 		supported |= SUPPORTED_TP;
 		check_sfp_module = netif_running(dev) &&
 			adapter->has_link_events;
+		/* fall through */
 	case NETXEN_BRDTYPE_P2_SB31_10G:
 	case NETXEN_BRDTYPE_P3_10G_XFP:
 		supported |= SUPPORTED_FIBRE;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 25/33] qed: qed_dev: Mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:25 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Ariel Elior, everest-linux-l2
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Notice that in this particular case, I replaced the code comments with
a proper "fall through" annotation, which is what GCC is expecting
to find.

Addresses-Coverity-ID: 114809 ("Missing break in switch")
Addresses-Coverity-ID: 114810 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index 6a0b46f..2f42df3 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -1709,14 +1709,14 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
 						p_hwfn->hw_info.hw_mode);
 			if (rc)
 				break;
-		/* Fall into */
+		/* Fall through */
 		case FW_MSG_CODE_DRV_LOAD_PORT:
 			rc = qed_hw_init_port(p_hwfn, p_hwfn->p_main_ptt,
 					      p_hwfn->hw_info.hw_mode);
 			if (rc)
 				break;
 
-		/* Fall into */
+		/* Fall through */
 		case FW_MSG_CODE_DRV_LOAD_FUNCTION:
 			rc = qed_hw_init_pf(p_hwfn, p_hwfn->p_main_ptt,
 					    p_params->p_tunn,
-- 
2.7.4

^ permalink raw reply related

* [PATCH 24/33] net/mlx5e: Mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:25 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Saeed Mahameed, Leon Romanovsky, linux-rdma
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 114808 ("Missing break in switch")
Addresses-Coverity-ID: 114802 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
index 1881468..ad6d471 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
@@ -91,9 +91,11 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di,
 		return true;
 	default:
 		bpf_warn_invalid_xdp_action(act);
+		/* fall through */
 	case XDP_ABORTED:
 xdp_abort:
 		trace_xdp_exception(rq->netdev, prog, act);
+		/* fall through */
 	case XDP_DROP:
 		rq->stats->xdp_drop++;
 		return true;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 23/33] vxge: Mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:24 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva; +Cc: Jon Mason
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 114796 ("Missing break in switch")
Addresses-Coverity-ID: 114804 ("Missing break in switch")
Addresses-Coverity-ID: 114806 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/neterion/vxge/vxge-config.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c
index a2c0a93..ae81498 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c
@@ -3783,17 +3783,20 @@ vxge_hw_rts_rth_data0_data1_get(u32 j, u64 *data0, u64 *data1,
 			VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM0_ENTRY_EN |
 			VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM0_BUCKET_DATA(
 			itable[j]);
+		/* fall through */
 	case 2:
 		*data0 |=
 			VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM1_BUCKET_NUM(j)|
 			VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM1_ENTRY_EN |
 			VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM1_BUCKET_DATA(
 			itable[j]);
+		/* fall through */
 	case 3:
 		*data1 = VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM0_BUCKET_NUM(j)|
 			VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM0_ENTRY_EN |
 			VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM0_BUCKET_DATA(
 			itable[j]);
+		/* fall through */
 	case 4:
 		*data1 |=
 			VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM1_BUCKET_NUM(j)|
-- 
2.7.4

^ permalink raw reply related

* Re: possible deadlock in rds_wake_sk_sleep
From: Sowmini Varadhan @ 2018-08-07 21:07 UTC (permalink / raw)
  To: syzbot
  Cc: davem, linux-kernel, linux-rdma, netdev, rds-devel,
	santosh.shilimkar, syzkaller-bugs
In-Reply-To: <000000000000fb5cd90572de7ebd@google.com>

On (08/07/18 13:47), syzbot wrote:
>  Possible unsafe locking scenario:
> 
>        CPU0                    CPU1
>        ----                    ----
>   lock(&(&rm->m_rs_lock)->rlock);
>                                lock(&rs->rs_recv_lock);
>                                lock(&(&rm->m_rs_lock)->rlock);
>   lock(&rs->rs_recv_lock);
> 
>  *** DEADLOCK ***

looks like a valid find, I think the deadlock should be avoided
by having rds_clear_recv_queue do something like

 get rs_recv_lock
 un-tether the rs_recv_queue into a temporary list 
 releease rs_recv_lock
 purge the rds_incoming  temporary list

I can give this a shot later this week.

--Sowmini

^ permalink raw reply

* [PATCH 19/33] igb_main: Mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:22 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Jeff Kirsher, intel-wired-lan
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 200521 ("Missing break in switch")
Addresses-Coverity-ID: 114797 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 636d805..d03c2f0 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5175,6 +5175,7 @@ bool igb_has_link(struct igb_adapter *adapter)
 	case e1000_media_type_copper:
 		if (!hw->mac.get_link_status)
 			return true;
+		/* fall through */
 	case e1000_media_type_internal_serdes:
 		hw->mac.ops.check_for_link(hw);
 		link_active = !hw->mac.get_link_status;
@@ -5835,6 +5836,7 @@ static void igb_tx_csum(struct igb_ring *tx_ring, struct igb_tx_buffer *first)
 			type_tucmd = E1000_ADVTXD_TUCMD_L4T_SCTP;
 			break;
 		}
+		/* fall through */
 	default:
 		skb_checksum_help(skb);
 		goto csum_failed;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 17/33] net/mlx4/mcg: Mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:21 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Tariq Toukan, linux-rdma
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 114792 ("Missing break in switch")
Addresses-Coverity-ID: 114793 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/mellanox/mlx4/mcg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index 4c5306d..ffed2d4 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -1412,6 +1412,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
 	case MLX4_STEERING_MODE_A0:
 		if (prot == MLX4_PROT_ETH)
 			return 0;
+		/* fall through */
 
 	case MLX4_STEERING_MODE_B0:
 		if (prot == MLX4_PROT_ETH)
@@ -1441,6 +1442,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
 	case MLX4_STEERING_MODE_A0:
 		if (prot == MLX4_PROT_ETH)
 			return 0;
+		/* fall through */
 
 	case MLX4_STEERING_MODE_B0:
 		if (prot == MLX4_PROT_ETH)
-- 
2.7.4

^ permalink raw reply related

* Re: [RFC bpf-next v2 3/3] docs: Split filter.txt into separate documents.
From: Tobin C. Harding @ 2018-08-07 23:19 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Daniel Borkmann, Alexei Starovoitov, David S. Miller, linux-doc,
	netdev, linux-kernel
In-Reply-To: <20180807071405.58d38277@lwn.net>

On Tue, Aug 07, 2018 at 07:14:05AM -0600, Jonathan Corbet wrote:
> On Tue, 7 Aug 2018 12:48:44 +1000
> "Tobin C. Harding" <me@tobin.cc> wrote:
> 
> > How about these steps:
> > 
> > 	1. start with foo.txt
> > 	2. do typo and grammar fixes (any number of patches).
> > 	3. rename to foo.rst, do whitespace changes, code snippet
> > 	   indentation, heading adornments, update references to this file.
> > 	   (single patch).
> > 	4. Fix up references in the file text to use RST (i.e :ref: blah)
> > 	5. Fix up RST markers (backticks etc). (any number of patches)
> 
> That can certainly work; just don't call it foo.rst until it actually is a
> valid RST file.
> 
> And, of course, go easy with the later steps and try to avoid the
> temptation to mark up everything; we really want to preserve the
> readability of the plain-text files.

Yeah I get over zealous sometimes, I'll keep it in mind.

What is the current view on references embedded in the text versus a
local label with the full reference at the bottom of the file.  I've
seen both and do not know which is _more_ readable?


1.	some random text referencing
	:ref:`Documentation/path/to/file.rst <label>` and more text
	

2.	some random text referencing `file`_ and more text
	...

	.. Links
	.. _file path/to/file.rst:


Although the later form is found in Documentation/ it does not seem work
for local build (since the path is relative) or am I doing something
wrong with my local build?

And for the first form I could not get the html link produced to work if
the <label> was omitted - this label seems superfluous if it is to the
top of the file (I've already added a couple of such labels).

These are minor issues, answer only if and when you have time.


thanks,
Tobin.

^ permalink raw reply

* [PATCH 12/33] be2net: Mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:17 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Sathya Perla, Ajit Khaparde, Sriharsha Basavapatna, Somnath Kotur
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 114787 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/emulex/benet/be_ethtool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index 7f7e206..3f6749f 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -575,6 +575,7 @@ static u32 convert_to_et_setting(struct be_adapter *adapter, u32 if_speeds)
 				break;
 			}
 		}
+		/* fall through */
 	case PHY_TYPE_SFP_PLUS_10GB:
 	case PHY_TYPE_XFP_10GB:
 	case PHY_TYPE_SFP_1GB:
-- 
2.7.4

^ permalink raw reply related

* [PATCH 10/33] net: tulip_core: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:15 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva; +Cc: linux-parisc
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 114782 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/dec/tulip/tulip_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c
index 00d02a0..3e3e086 100644
--- a/drivers/net/ethernet/dec/tulip/tulip_core.c
+++ b/drivers/net/ethernet/dec/tulip/tulip_core.c
@@ -923,6 +923,7 @@ static int private_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 			data->phy_id = 1;
 		else
 			return -ENODEV;
+		/* Fall through */
 
 	case SIOCGMIIREG:		/* Read MII PHY register. */
 		if (data->phy_id == 32 && (tp->flags & HAS_NWAY)) {
-- 
2.7.4

^ permalink raw reply related

* [PATCH 08/33] cxgb3/l2t: Mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:14 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
  Cc: Santosh Raspatur
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

Addresses-Coverity-ID: 114780 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/chelsio/cxgb3/l2t.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb3/l2t.c b/drivers/net/ethernet/chelsio/cxgb3/l2t.c
index 248e40c..0e9182d 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/l2t.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/l2t.c
@@ -136,6 +136,7 @@ int t3_l2t_send_slow(struct t3cdev *dev, struct sk_buff *skb,
 		if (e->state == L2T_STATE_STALE)
 			e->state = L2T_STATE_VALID;
 		spin_unlock_bh(&e->lock);
+		/* fall through */
 	case L2T_STATE_VALID:	/* fast-path, send the packet on */
 		return cxgb3_ofld_send(dev, skb);
 	case L2T_STATE_RESOLVING:
-- 
2.7.4

^ permalink raw reply related

* [PATCH 01/33] 8390: axnet_cs: Mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:09 UTC (permalink / raw)
  To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>

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

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

diff --git a/drivers/net/ethernet/8390/axnet_cs.c b/drivers/net/ethernet/8390/axnet_cs.c
index d422a12..0b6bbf6 100644
--- a/drivers/net/ethernet/8390/axnet_cs.c
+++ b/drivers/net/ethernet/8390/axnet_cs.c
@@ -610,6 +610,7 @@ static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
     switch (cmd) {
     case SIOCGMIIPHY:
 	data->phy_id = info->phy_id;
+	/* Fall through */
     case SIOCGMIIREG:		/* Read MII PHY register. */
 	data->val_out = mdio_read(mii_addr, data->phy_id, data->reg_num & 0x1f);
 	return 0;
-- 
2.7.4

^ permalink raw reply related

* [PATCH wireless-drivers] mt76x0: Remove VLA usage
From: Kees Cook @ 2018-08-07 22:50 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Stanislaw Gruszka, David S. Miller,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Even with "const" variables, the compiler will generate warnings about
VLA usage. In the quest to remove all VLAs from the kernel[1], this uses
a #define instead of a const to do the array sizing.

[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Fixes: e87b5039511a ("mt76x0: eeprom files")
Signed-off-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
Please include this for the v4.19 merge window. The VLA was introduced
with the new source file (which I also note is missing a SPDX line), so
I'd like to avoid the kernel ever getting released with a VLA here.
---
 drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
index 1ecd018f12b8..af2fd6a1bb44 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
@@ -81,15 +81,15 @@ mt76x0_efuse_read(struct mt76x0_dev *dev, u16 addr, u8 *data,
 	return 0;
 }
 
+#define MT_MAP_READS	DIV_ROUND_UP(MT_EFUSE_USAGE_MAP_SIZE, 16)
 static int
 mt76x0_efuse_physical_size_check(struct mt76x0_dev *dev)
 {
-	const int map_reads = DIV_ROUND_UP(MT_EFUSE_USAGE_MAP_SIZE, 16);
-	u8 data[map_reads * 16];
+	u8 data[MT_MAP_READS * 16];
 	int ret, i;
 	u32 start = 0, end = 0, cnt_free;
 
-	for (i = 0; i < map_reads; i++) {
+	for (i = 0; i < MT_MAP_READS; i++) {
 		ret = mt76x0_efuse_read(dev, MT_EE_USAGE_MAP_START + i * 16,
 					 data + i * 16, MT_EE_PHYSICAL_READ);
 		if (ret)
-- 
2.17.1


-- 
Kees Cook
Pixel Security

^ permalink raw reply related

* Re: [PATCH 0/3] Add Broadcom Omega SoC internal switch and phy
From: David Miller @ 2018-08-07 22:49 UTC (permalink / raw)
  To: andrew
  Cc: arun.parameswaran, f.fainelli, vivien.didelot, robh+dt,
	mark.rutland, netdev, devicetree, linux-kernel,
	bcm-kernel-feedback-list
In-Reply-To: <20180807180827.GH18350@lunn.ch>

From: Andrew Lunn <andrew@lunn.ch>
Date: Tue, 7 Aug 2018 20:08:27 +0200

> On Tue, Aug 07, 2018 at 10:02:41AM -0700, Arun Parameswaran wrote:
>> Hi,
>> 
>> The patchset is based on David Miller's "net-next" repo.
>> 
>> The patches add support for the Broadcom Omega SoC's internal ethernet
>> switch and the internal gphy.
>> 
>> The internal ethernet switch in the Omega is a b53 srab based switch.
>> The support for the switch is added to the b53 driver in the dsa
>> framework.
>> 
>> The gphy support is added to the bcm7xxx driver.
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Series applied.

^ permalink raw reply

* Re: [PATCH bpf-next 3/3] bpf: add sample for BPF_MAP_TYPE_QUEUE
From: Jakub Kicinski @ 2018-08-07 20:31 UTC (permalink / raw)
  To: Mauricio Vasquez B; +Cc: Alexei Starovoitov, Daniel Borkmann, netdev
In-Reply-To: <153356392410.6981.1290059578982921349.stgit@kernel>

On Mon, 06 Aug 2018 15:58:47 +0200, Mauricio Vasquez B wrote:
> @@ -109,6 +110,7 @@ xdpsock-objs := xdpsock_user.o
>  xdp_fwd-objs := xdp_fwd_user.o
>  task_fd_query-objs := bpf_load.o task_fd_query_user.o $(TRACE_HELPERS)
>  xdp_sample_pkts-objs := xdp_sample_pkts_user.o $(TRACE_HELPERS)
> +test_queuemap-objs := bpf_load.o test_queuemap_user.o
>  
>  # Tell kbuild to always build the programs
>  always := $(hostprogs-y)

nit: would you mind using libbpf instead of bpf_load.o ?

^ permalink raw reply

* Re: [PATCH net-next v3 0/3] qed: Add Multi-TC RoCE support
From: David Miller @ 2018-08-07 20:22 UTC (permalink / raw)
  To: denis.bolotin; +Cc: netdev
In-Reply-To: <20180807124810.17386-1-denis.bolotin@cavium.com>

From: Denis Bolotin <denis.bolotin@cavium.com>
Date: Tue, 7 Aug 2018 15:48:07 +0300

> Hi Dave,
> This patch series adds support for multiple concurrent traffic classes for RoCE.
> The first three patches enable the required parts of the driver to learn the TC
> configuration, and the last one makes use of it to enable the feature.
> Please consider applying this to net-next.
> 
> V1->V2:
> -------
> Avoid allocation in qed_dcbx_get_priority_tc().
> Move qed_dcbx_get_priority_tc() out of CONFIG_DCB section since it doesn't call
> qed_dcbx_query_params() anymore.
> 
> v2->V3:
> -------
> patch 1/3:
> qed_dcbx_get_priority_tc() always returns a valid TC by value. In error cases,
> it returns QED_DCBX_DEFAULT_TC (currently defined 0).
> patch 3/3:
> Cosmetic changes in qed_dev.c.

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH] tipc: fix an interrupt unsafe locking scenario
From: David Miller @ 2018-08-07 20:18 UTC (permalink / raw)
  To: ying.xue; +Cc: netdev, jon.maloy, tipc-discussion
In-Reply-To: <1533628352-31928-1-git-send-email-ying.xue@windriver.com>

From: Ying Xue <ying.xue@windriver.com>
Date: Tue, 7 Aug 2018 15:52:32 +0800

> Commit 9faa89d4ed9d ("tipc: make function tipc_net_finalize() thread
> safe") tries to make it thread safe to set node address, so it uses
> node_list_lock lock to serialize the whole process of setting node
> address in tipc_net_finalize(). But it causes the following interrupt
> unsafe locking scenario:
 ...
> When rhashtable_rehash_table() holds ht->lock on CPU0, it doesn't
> disable BH. So if an interrupt happens after the lock, it can create
> an inverse lock ordering between ht->lock and tn->node_list_lock. As
> a consequence, deadlock might happen.
> 
> The reason causing the inverse lock ordering scenario above is because
> the initial purpose of node_list_lock is not designed to do the
> serialization of node address setting.
> 
> As cmpxchg() can guarantee CAS (compare-and-swap) process is atomic,
> we use it to replace node_list_lock to ensure setting node address can
> be atomically finished. It turns out the potential deadlock can be
> avoided as well.
> 
> Fixes: 9faa89d4ed9d ("tipc: make function tipc_net_finalize() thread safe")
> Signed-off-by: Ying Xue <ying.xue@windriver.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] net: allow to call netif_reset_xps_queues() under cpu_read_lock
From: David Miller @ 2018-08-07 20:15 UTC (permalink / raw)
  To: avagin; +Cc: netdev, virtualization, avagin, amritha.nambiar, mst, jasowang
In-Reply-To: <20180807041454.18315-1-avagin@openvz.org>

From: Andrei Vagin <avagin@openvz.org>
Date: Mon,  6 Aug 2018 21:14:54 -0700

> This patch adds an ability to call __netif_set_xps_queue under
> cpu_read_lock().

Please don't add conditional locking using a boolean argument.

Simply wrap calls to __netif_set_xps_queue() with cpu read
lock held by the caller or similar.

^ permalink raw reply

* [net-next:master 479/480] drivers/net/ieee802154/mac802154_hwsim.c:409:17: sparse: incorrect type in assignment (different address spaces)
From: kbuild test robot @ 2018-08-07 20:03 UTC (permalink / raw)
  To: Alexander Aring; +Cc: kbuild-all, netdev, Stefan Schmidt

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   1ba982806ce58baac44c52e6c7812245afad27c8
commit: c5d99d2b35dadebab2408bb10dcd50364eaaf9f4 [479/480] ieee802154: hwsim: fix rcu address annotation
reproduce:
        # apt-get install sparse
        git checkout c5d99d2b35dadebab2408bb10dcd50364eaaf9f4
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   drivers/net/ieee802154/mac802154_hwsim.c:799:18: sparse: incorrect type in assignment (different address spaces) @@    expected struct hwsim_pib [noderef] <asn:4>*pib @@    got  hwsim_pib [noderef] <asn:4>*pib @@
   drivers/net/ieee802154/mac802154_hwsim.c:799:18:    expected struct hwsim_pib [noderef] <asn:4>*pib
   drivers/net/ieee802154/mac802154_hwsim.c:799:18:    got struct hwsim_pib *[assigned] pib
   drivers/net/ieee802154/mac802154_hwsim.c:835:9: sparse: incorrect type in argument 1 (different address spaces) @@    expected struct callback_head *head @@    got struct callback_hstruct callback_head *head @@
   drivers/net/ieee802154/mac802154_hwsim.c:835:9:    expected struct callback_head *head
   drivers/net/ieee802154/mac802154_hwsim.c:835:9:    got struct callback_head [noderef] <asn:4>*<noident>
   drivers/net/ieee802154/mac802154_hwsim.c:113:17: sparse: incorrect type in assignment (different address spaces) @@    expected struct hwsim_pib *pib_old @@    got struct hwsim_pib struct hwsim_pib *pib_old @@
   drivers/net/ieee802154/mac802154_hwsim.c:113:17:    expected struct hwsim_pib *pib_old
   drivers/net/ieee802154/mac802154_hwsim.c:113:17:    got struct hwsim_pib [noderef] <asn:4>*pib
>> drivers/net/ieee802154/mac802154_hwsim.c:409:17: sparse: incorrect type in assignment (different address spaces) @@    expected struct hwsim_edge_info [noderef] <asn:4>*info @@    got  hwsim_edge_info [noderef] <asn:4>*info @@
   drivers/net/ieee802154/mac802154_hwsim.c:409:17:    expected struct hwsim_edge_info [noderef] <asn:4>*info
   drivers/net/ieee802154/mac802154_hwsim.c:409:17:    got struct hwsim_edge_info *[assigned] einfo
   drivers/net/ieee802154/mac802154_hwsim.c:417:9: sparse: incorrect type in argument 1 (different address spaces) @@    expected struct callback_head *head @@    got struct callback_hstruct callback_head *head @@
   drivers/net/ieee802154/mac802154_hwsim.c:417:9:    expected struct callback_head *head
   drivers/net/ieee802154/mac802154_hwsim.c:417:9:    got struct callback_head [noderef] <asn:4>*<noident>

vim +409 drivers/net/ieee802154/mac802154_hwsim.c

f25da51f Alexander Aring 2018-07-14  392  
f25da51f Alexander Aring 2018-07-14  393  static struct hwsim_edge *hwsim_alloc_edge(struct hwsim_phy *endpoint, u8 lqi)
f25da51f Alexander Aring 2018-07-14  394  {
f25da51f Alexander Aring 2018-07-14  395  	struct hwsim_edge_info *einfo;
f25da51f Alexander Aring 2018-07-14  396  	struct hwsim_edge *e;
f25da51f Alexander Aring 2018-07-14  397  
f25da51f Alexander Aring 2018-07-14  398  	e = kzalloc(sizeof(*e), GFP_KERNEL);
f25da51f Alexander Aring 2018-07-14  399  	if (!e)
f25da51f Alexander Aring 2018-07-14  400  		return NULL;
f25da51f Alexander Aring 2018-07-14  401  
f25da51f Alexander Aring 2018-07-14  402  	einfo = kzalloc(sizeof(*einfo), GFP_KERNEL);
f25da51f Alexander Aring 2018-07-14  403  	if (!einfo) {
f25da51f Alexander Aring 2018-07-14  404  		kfree(e);
f25da51f Alexander Aring 2018-07-14  405  		return NULL;
f25da51f Alexander Aring 2018-07-14  406  	}
f25da51f Alexander Aring 2018-07-14  407  
f25da51f Alexander Aring 2018-07-14  408  	einfo->lqi = 0xff;
f25da51f Alexander Aring 2018-07-14 @409  	e->info = einfo;
f25da51f Alexander Aring 2018-07-14  410  	e->endpoint = endpoint;
f25da51f Alexander Aring 2018-07-14  411  
f25da51f Alexander Aring 2018-07-14  412  	return e;
f25da51f Alexander Aring 2018-07-14  413  }
f25da51f Alexander Aring 2018-07-14  414  

:::::: The code at line 409 was first introduced by commit
:::::: f25da51fdc381ca2863248c7060b3662632f0872 ieee802154: hwsim: add replacement for fakelb

:::::: TO: Alexander Aring <aring@mojatatu.com>
:::::: CC: Stefan Schmidt <stefan@datenfreihafen.org>

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

^ permalink raw reply

* Re: Is it currently possible to connect SFP to dsa port?
From: Andrew Lunn @ 2018-08-07 20:03 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Marek Behun, netdev, Russell King - ARM Linux
In-Reply-To: <2d62b88b-3a92-d026-effe-defcb9d5838b@gmail.com>

On Tue, Aug 07, 2018 at 12:43:11PM -0700, Florian Fainelli wrote:
> 
> 
> On 08/07/2018 12:00 PM, Marek Behun wrote:
> > Hello,
> > 
> > I have a question regarding DSA/SFP code.
> > 
> > We are working on a modular router where it is possible to connect
> > multiple switch cards and at most one SFP cage card to a router.
> > 
> > Does the sfp/dsa driver support connecting SFP port to a DSA port? For
> > example the Marvell 6390 switch has two SGMII ports and 8 1Gbps PHYs.
> > One can then connect those 8 1Gbps PHYs to RJ-45 connectors, the first
> > SGMII port to the CPU and the second SGMII port to SFP.
> > 
> > I think this is currently not possible, but am not sure.
> 
> DSA recently gained support for PHYLINK which would allow you to do
> that, please make sure your tree has this commit at least:
> 
> aab9c4067d2389d0adfc9c53806437df7b0fe3d5 ("net: dsa: Plug in PHYLINK
> support").

Hi Florian

That gives enough to not break existing setups using the mv88e6xxx
driver. But to really use PHYLINK, more code is needed. I've taken
some of Russell Kings work, and merged that in, which gives us proper
support for validate, config_mac, etc. But Russell's code is missing
calls to phylink_mac_change, and handling SERDES interfaces, which are
needed for SFPs. I've got some code which is near, but it broke D in
DSA on my board :-(

    Andrew

^ permalink raw reply

* Re: Is it currently possible to connect SFP to dsa port?
From: Andrew Lunn @ 2018-08-07 19:58 UTC (permalink / raw)
  To: Marek Behun; +Cc: netdev, Russell King - ARM Linux
In-Reply-To: <20180807210023.0dc3d498@nic.cz>

On Tue, Aug 07, 2018 at 09:00:23PM +0200, Marek Behun wrote:
> Hello,
> 
> I have a question regarding DSA/SFP code.
> 
> We are working on a modular router where it is possible to connect
> multiple switch cards and at most one SFP cage card to a router.
> 
> Does the sfp/dsa driver support connecting SFP port to a DSA port? For
> example the Marvell 6390 switch has two SGMII ports and 8 1Gbps PHYs.
> One can then connect those 8 1Gbps PHYs to RJ-45 connectors, the first
> SGMII port to the CPU and the second SGMII port to SFP.

Hi Marek

I'm currently working on exactly this!

My primary aim is to allow SFP on ports 9 and 10. ports 2-7 can also
be connected to SFPs, but that is a bit harder, so it is going to take
me a little longer.

I hope i can post patches in the next few days.

  Andrew

^ 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