* Re: [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs
From: David Miller @ 2018-08-08 0:59 UTC (permalink / raw)
To: gustavo
Cc: netdev, linux-kernel, linux-net-drivers, ecree, bkenward, jes,
linux-acenic, michael.chan, nicolas.ferre, derek.chickles,
satananda.burla, felix.manlunas, raghu.vatsavayi, ganeshgr,
santosh, sgoutham, rric, linux-arm-kernel, linux-parisc,
sathya.perla, ajit.khaparde, sriharsha.basavapatna, somnath.kotur,
yisen.zhuang, salil.mehta, jeffrey.t.kirsher, intel-wired-lan,
tariqt, l
In-Reply-To: <cover.1533675546.git.gustavo@embeddedor.com>
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Tue, 7 Aug 2018 18:09:00 -0500
> In preparation to enabling -Wimplicit-fallthrough, this patchset aims
> to add some annotations in order to mark switch cases where we are
> expecting to fall through.
Ok, I went through all of these and they look good.
If any are not correct we can revert/fix.
Series applied, thanks.
^ permalink raw reply
* Re: [net-next 00/12][pull request] 40GbE Intel Wired LAN Driver Updates 2018-08-07
From: David Miller @ 2018-08-07 22:43 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
In-Reply-To: <20180807192757.21592-1-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 7 Aug 2018 12:27:45 -0700
> This series contains updates to i40e and i40evf only.
Pulled, thanks Jeff.
^ permalink raw reply
* Re: [PATCH] net: nixge: Get rid of unused struct member 'last_link'
From: David Miller @ 2018-08-08 1:01 UTC (permalink / raw)
To: mdf; +Cc: keescook, netdev, linux-kernel, alex.williams
In-Reply-To: <20180807233520.31127-1-mdf@kernel.org>
From: Moritz Fischer <mdf@kernel.org>
Date: Tue, 7 Aug 2018 16:35:20 -0700
> Get rid of unused struct member 'last_link'
>
> Signed-off-by: Moritz Fischer <mdf@kernel.org>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net v2] dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart()
From: David Miller @ 2018-08-07 22:49 UTC (permalink / raw)
To: alexey.kodanev; +Cc: netdev, gerrit, dccp
In-Reply-To: <1533661437-26715-1-git-send-email-alexey.kodanev@oracle.com>
From: Alexey Kodanev <alexey.kodanev@oracle.com>
Date: Tue, 7 Aug 2018 20:03:57 +0300
> The shift of 'cwnd' with '(now - hc->tx_lsndtime) / hc->tx_rto' value
> can lead to undefined behavior [1].
>
> In order to fix this use a gradual shift of the window with a 'while'
> loop, similar to what tcp_cwnd_restart() is doing.
>
> When comparing delta and RTO there is a minor difference between TCP
> and DCCP, the last one also invokes dccp_cwnd_restart() and reduces
> 'cwnd' if delta equals RTO. That case is preserved in this change.
...
> Fixes: 113ced1f52e5 ("dccp ccid-2: Perform congestion-window validation")
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
>
> v2: instead of checking the value with min(), use gradual shifting,
> similar to tcp_cwnd_restart().
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [Patch net] llc: use refcount_inc_not_zero() for llc_sap_find()
From: David Miller @ 2018-08-07 22:54 UTC (permalink / raw)
To: xiyou.wangcong; +Cc: netdev
In-Reply-To: <20180807194138.5863-1-xiyou.wangcong@gmail.com>
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue, 7 Aug 2018 12:41:38 -0700
> llc_sap_put() decreases the refcnt before deleting sap
> from the global list. Therefore, there is a chance
> llc_sap_find() could find a sap with zero refcnt
> in this global list.
>
> Close this race condition by checking if refcnt is zero
> or not in llc_sap_find(), if it is zero then it is being
> removed so we can just treat it as gone.
>
> Reported-by: <syzbot+278893f3f7803871f7ce@syzkaller.appspotmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH net-next 1/1] tc-tests: initial version of nat action unit tests
From: David Miller @ 2018-08-07 22:55 UTC (permalink / raw)
To: kleib; +Cc: netdev, jhs, xiyou.wangcong, jiri, lucasb
In-Reply-To: <1533669523-3935-1-git-send-email-kleib@mojatatu.com>
From: Keara Leibovitz <kleib@mojatatu.com>
Date: Tue, 7 Aug 2018 15:18:43 -0400
> Initial set of nat action unit tests.
>
> Signed-off-by: Keara Leibovitz <kleib@mojatatu.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next] selftests: forwarding: gre_multipath: Update next-hop statistics match criteria
From: David Miller @ 2018-08-07 23:02 UTC (permalink / raw)
To: nird; +Cc: netdev, mlxsw
In-Reply-To: <20180807164155.2831-1-nird@mellanox.com>
From: Nir Dotan <nird@mellanox.com>
Date: Tue, 7 Aug 2018 19:41:55 +0300
> gre_multipath test was using egress vlan_id matching on flows, for the
> purpose of collecting next-hops statistics, later to be compared
> against configured weights.
> As matching on vlan_id on egress direction is not supported on all HW
> devices, change the match criteria to use destination IP.
>
> Signed-off-by: Nir Dotan <nird@mellanox.com>
> Acked-by: Petr Machata <petrm@mellanox.com>
Applied.
^ permalink raw reply
* [PATCH 02/33] alteon: acenic: 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
Cc: Jes Sorensen, linux-acenic
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: 114891 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/alteon/acenic.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index 08945ba..4f11f98 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -551,6 +551,7 @@ static int acenic_probe_one(struct pci_dev *pdev,
ap->name);
break;
}
+ /* Fall through */
case PCI_VENDOR_ID_SGI:
printk(KERN_INFO "%s: SGI AceNIC ", ap->name);
break;
--
2.7.4
^ permalink raw reply related
* [PATCH 00/33] net: ethernet: Mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:09 UTC (permalink / raw)
To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
Cc: Solarflare linux maintainers, Edward Cree, Bert Kenward,
Jes Sorensen, linux-acenic, Michael Chan, Nicolas Ferre,
Derek Chickles, Satanand Burla, Felix Manlunas, Raghu Vatsavayi,
Ganesh Goudar, Santosh Raspatur, Sunil Goutham, Robert Richter,
linux-arm-kernel, linux-parisc, Sathya Perla, Ajit
Hi all,
In preparation to enabling -Wimplicit-fallthrough, this patchset aims
to add some annotations in order to mark switch cases where we are
expecting to fall through.
Thanks
Gustavo A. R. Silva (33):
8390: axnet_cs: Mark expected switch fall-through
alteon: acenic: mark expected switch fall-through
bnx2x: Mark expected switch fall-thoughs
net: macb: Mark expected switch fall-through
liquidio: mark expected switch fall-through
cxgb4/l2t: Mark expected switch fall-through
cxgb4/t4_hw: mark expected switch fall-throughs
cxgb3/l2t: Mark expected switch fall-through
net: thunderx: mark expected switch fall-through
net: tulip_core: mark expected switch fall-through
net: tulip: de4x5: mark expected switch fall-throughs
be2net: Mark expected switch fall-through
net: hns: Mark expected switch fall-through
net: hns3: Mark expected switch fall-through
i40e_main: mark expected switch fall-through
i40e_txrx: mark expected switch fall-through
net/mlx4/mcg: Mark expected switch fall-throughs
net/mlx4/en_rx: Mark expected switch fall-throughs
igb_main: Mark expected switch fall-throughs
igb: e1000_82575: Mark expected switch fall-through
igb: e1000_phy: Mark expected switch fall-through
igbvf: netdev: Mark expected switch fall-through
vxge: Mark expected switch fall-throughs
net/mlx5e: Mark expected switch fall-throughs
qed: qed_dev: Mark expected switch fall-throughs
netxen_nic: Mark expected switch fall-throughs
qede: qede_fp: Mark expected switch fall-through
qlcnic: Mark expected switch fall-througs
qlge: mark expected switch fall-through
net: ethernet: sxgbe: mark expected switch fall-throughs
net: sfc: falcon: mark expected switch fall-through
net: tlan: Mark expected switch fall-through
net: ethernet: ti: cpts: mark expected switch fall-through
drivers/net/ethernet/8390/axnet_cs.c | 1 +
drivers/net/ethernet/alteon/acenic.c | 1 +
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
drivers/net/ethernet/cadence/macb_ptp.c | 1 +
drivers/net/ethernet/cavium/liquidio/lio_main.c | 1 +
drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c | 1 +
drivers/net/ethernet/chelsio/cxgb3/l2t.c | 1 +
drivers/net/ethernet/chelsio/cxgb4/l2t.c | 1 +
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 +++
drivers/net/ethernet/dec/tulip/de4x5.c | 6 ++++++
drivers/net/ethernet/dec/tulip/tulip_core.c | 1 +
drivers/net/ethernet/emulex/benet/be_ethtool.c | 1 +
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 1 +
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 1 +
drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++-
drivers/net/ethernet/intel/igb/e1000_82575.c | 1 +
drivers/net/ethernet/intel/igb/e1000_phy.c | 1 +
drivers/net/ethernet/intel/igb/igb_main.c | 2 ++
drivers/net/ethernet/intel/igbvf/netdev.c | 1 +
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 ++
drivers/net/ethernet/mellanox/mlx4/mcg.c | 2 ++
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 ++
drivers/net/ethernet/neterion/vxge/vxge-config.c | 3 +++
drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c | 3 ++-
drivers/net/ethernet/qlogic/qed/qed_dev.c | 4 ++--
drivers/net/ethernet/qlogic/qede/qede_fp.c | 2 ++
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 3 ++-
drivers/net/ethernet/qlogic/qlge/qlge_mpi.c | 1 +
drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c | 2 ++
drivers/net/ethernet/sfc/falcon/ethtool.c | 1 +
drivers/net/ethernet/ti/cpts.c | 1 +
drivers/net/ethernet/ti/tlan.c | 1 +
33 files changed, 52 insertions(+), 6 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH 04/33] net: macb: Mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:11 UTC (permalink / raw)
To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva; +Cc: Nicolas Ferre
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.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/cadence/macb_ptp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/cadence/macb_ptp.c b/drivers/net/ethernet/cadence/macb_ptp.c
index 6788351..cd5296b8 100644
--- a/drivers/net/ethernet/cadence/macb_ptp.c
+++ b/drivers/net/ethernet/cadence/macb_ptp.c
@@ -466,6 +466,7 @@ int gem_set_hwtst(struct net_device *dev, struct ifreq *ifr, int cmd)
case HWTSTAMP_TX_ONESTEP_SYNC:
if (gem_ptp_set_one_step_sync(bp, 1) != 0)
return -ERANGE;
+ /* fall through */
case HWTSTAMP_TX_ON:
tx_bd_control = TSTAMP_ALL_FRAMES;
break;
--
2.7.4
^ permalink raw reply related
* [PATCH 03/33] bnx2x: Mark expected switch fall-thoughs
From: Gustavo A. R. Silva @ 2018-08-07 23:11 UTC (permalink / raw)
To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva; +Cc: Michael Chan
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: 114878 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index d7f51ab..8bb1e38 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1729,8 +1729,8 @@ static int bnxt_async_event_process(struct bnxt *bp,
speed);
}
set_bit(BNXT_LINK_SPEED_CHNG_SP_EVENT, &bp->sp_event);
- /* fall through */
}
+ /* fall through */
case ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE:
set_bit(BNXT_LINK_CHNG_SP_EVENT, &bp->sp_event);
break;
--
2.7.4
^ permalink raw reply related
* [PATCH 05/33] liquidio: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:13 UTC (permalink / raw)
To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
Cc: Derek Chickles, Satanand Burla, Felix Manlunas, Raghu Vatsavayi
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: 143135 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/cavium/liquidio/lio_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index 8ef87a7..6fb13fa 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -2209,6 +2209,7 @@ static int liquidio_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
case SIOCSHWTSTAMP:
if (lio->oct_dev->ptp_enable)
return hwtstamp_ioctl(netdev, ifr);
+ /* fall through */
default:
return -EOPNOTSUPP;
}
--
2.7.4
^ permalink raw reply related
* [PATCH 06/33] cxgb4/l2t: Mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:13 UTC (permalink / raw)
To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva; +Cc: Ganesh Goudar
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: 114910 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/chelsio/cxgb4/l2t.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
index 77c2c53..301c4df 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
@@ -231,6 +231,7 @@ int cxgb4_l2t_send(struct net_device *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 t4_ofld_send(adap, skb);
case L2T_STATE_RESOLVING:
--
2.7.4
^ permalink raw reply related
* [PATCH 07/33] cxgb4/t4_hw: mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:13 UTC (permalink / raw)
To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva; +Cc: Ganesh Goudar
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: 114777 ("Missing break in switch")
Addresses-Coverity-ID: 114778 ("Missing break in switch")
Addresses-Coverity-ID: 114779 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 2d9943f..5fe5d16 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -7504,10 +7504,13 @@ int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
switch (nmac) {
case 5:
memcpy(mac + 24, c.nmac3, sizeof(c.nmac3));
+ /* Fall through */
case 4:
memcpy(mac + 18, c.nmac2, sizeof(c.nmac2));
+ /* Fall through */
case 3:
memcpy(mac + 12, c.nmac1, sizeof(c.nmac1));
+ /* Fall through */
case 2:
memcpy(mac + 6, c.nmac0, sizeof(c.nmac0));
}
--
2.7.4
^ permalink raw reply related
* [PATCH 09/33] net: thunderx: 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: Sunil Goutham, Robert Richter, linux-arm-kernel
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: 114781 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
index 5603f5a..92ba958 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
@@ -527,6 +527,7 @@ static int nicvf_get_rss_hash_opts(struct nicvf *nic,
case SCTP_V4_FLOW:
case SCTP_V6_FLOW:
info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
+ /* Fall through */
case IPV4_FLOW:
case IPV6_FLOW:
info->data |= RXH_IP_SRC | RXH_IP_DST;
--
2.7.4
^ permalink raw reply related
* [PATCH 11/33] net: tulip: de4x5: mark expected switch fall-throughs
From: Gustavo A. R. Silva @ 2018-08-07 23:16 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: 114784 ("Missing break in switch")
Addresses-Coverity-ID: 114785 ("Missing break in switch")
Addresses-Coverity-ID: 114786 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/dec/tulip/de4x5.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
index a31b4df..66535d1 100644
--- a/drivers/net/ethernet/dec/tulip/de4x5.c
+++ b/drivers/net/ethernet/dec/tulip/de4x5.c
@@ -3204,6 +3204,8 @@ srom_map_media(struct net_device *dev)
case SROM_10BASETF:
if (!lp->params.fdx) return -1;
lp->fdx = true;
+ /* fall through */
+
case SROM_10BASET:
if (lp->params.fdx && !lp->fdx) return -1;
if ((lp->chipset == DC21140) || ((lp->chipset & ~0x00ff) == DC2114x)) {
@@ -3224,6 +3226,8 @@ srom_map_media(struct net_device *dev)
case SROM_100BASETF:
if (!lp->params.fdx) return -1;
lp->fdx = true;
+ /* fall through */
+
case SROM_100BASET:
if (lp->params.fdx && !lp->fdx) return -1;
lp->media = _100Mb;
@@ -3236,6 +3240,8 @@ srom_map_media(struct net_device *dev)
case SROM_100BASEFF:
if (!lp->params.fdx) return -1;
lp->fdx = true;
+ /* fall through */
+
case SROM_100BASEF:
if (lp->params.fdx && !lp->fdx) return -1;
lp->media = _100Mb;
--
2.7.4
^ permalink raw reply related
* [PATCH 13/33] net: hns: 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: Yisen Zhuang, Salil Mehta
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: 114788 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index 3957205..08f3c47 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -307,6 +307,7 @@ static int __lb_setup(struct net_device *ndev,
break;
case MAC_LOOP_PHY_NONE:
ret = hns_nic_config_phy_loopback(phy_dev, 0x0);
+ /* fall through */
case MAC_LOOP_NONE:
if (!ret && h->dev->ops->set_loopback) {
if (priv->ae_handle->phy_if != PHY_INTERFACE_MODE_XGMII)
--
2.7.4
^ permalink raw reply related
* [PATCH 14/33] net: hns3: Mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:18 UTC (permalink / raw)
To: David S. Miller, netdev, linux-kernel, Gustavo A. R. Silva
Cc: Yisen Zhuang, Salil Mehta
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: 114789 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index bd031af..a64d69c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -2104,6 +2104,7 @@ static void hns3_rx_checksum(struct hns3_enet_ring *ring, struct sk_buff *skb,
case HNS3_OL4_TYPE_MAC_IN_UDP:
case HNS3_OL4_TYPE_NVGRE:
skb->csum_level = 1;
+ /* fall through */
case HNS3_OL4_TYPE_NO_TUN:
/* Can checksum ipv4 or ipv6 + UDP/TCP/SCTP packets */
if ((l3_type == HNS3_L3_TYPE_IPV4 ||
--
2.7.4
^ permalink raw reply related
* [PATCH 15/33] i40e_main: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:19 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: 114790 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 5176242..a1a274d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1800,6 +1800,7 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
num_tc_qps);
break;
}
+ /* fall through */
case I40E_VSI_FDIR:
case I40E_VSI_SRIOV:
case I40E_VSI_VMDQ2:
--
2.7.4
^ permalink raw reply related
* [PATCH 16/33] i40e_txrx: mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:20 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: 114791 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index b151ae3..b5042d1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2253,9 +2253,10 @@ static struct sk_buff *i40e_run_xdp(struct i40e_ring *rx_ring,
break;
default:
bpf_warn_invalid_xdp_action(act);
+ /* fall through */
case XDP_ABORTED:
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
- /* fallthrough -- handle aborts by dropping packet */
+ /* fall through -- handle aborts by dropping packet */
case XDP_DROP:
result = I40E_XDP_CONSUMED;
break;
--
2.7.4
^ permalink raw reply related
* [PATCH 18/33] net/mlx4/en_rx: 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: 114794 ("Missing break in switch")
Addresses-Coverity-ID: 114795 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 3360f7b..a1aeeb8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -795,8 +795,10 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
goto xdp_drop_no_cnt; /* Drop on xmit failure */
default:
bpf_warn_invalid_xdp_action(act);
+ /* fall through */
case XDP_ABORTED:
trace_xdp_exception(dev, xdp_prog, act);
+ /* fall through */
case XDP_DROP:
ring->xdp_drop++;
xdp_drop_no_cnt:
--
2.7.4
^ permalink raw reply related
* [PATCH 20/33] igb: e1000_82575: Mark expected switch fall-through
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: 114799 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/intel/igb/e1000_82575.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index a795c07..bafdcf7 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -1708,6 +1708,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX:
/* disable PCS autoneg and support parallel detect only */
pcs_autoneg = false;
+ /* fall through */
default:
if (hw->mac.type == e1000_82575 ||
hw->mac.type == e1000_82576) {
--
2.7.4
^ permalink raw reply related
* [PATCH 21/33] igb: e1000_phy: Mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-08-07 23:23 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: 114800 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/intel/igb/e1000_phy.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c
index 2be0e76..ad2125e 100644
--- a/drivers/net/ethernet/intel/igb/e1000_phy.c
+++ b/drivers/net/ethernet/intel/igb/e1000_phy.c
@@ -659,6 +659,7 @@ s32 igb_copper_link_setup_m88_gen2(struct e1000_hw *hw)
phy_data |= M88E1000_PSCR_AUTO_X_1000T;
break;
}
+ /* fall through */
case 0:
default:
phy_data |= M88E1000_PSCR_AUTO_X_MODE;
--
2.7.4
^ permalink raw reply related
* [PATCH 22/33] igbvf: netdev: Mark expected switch fall-through
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: 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: 114801 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/intel/igbvf/netdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index f818f06..e0c989f 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2102,6 +2102,7 @@ static bool igbvf_tx_csum(struct igbvf_ring *tx_ring, struct sk_buff *skb,
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
* Re: [PATCH bpf-next 12/13] docs: net: Fix various minor typos
From: Tobin C. Harding @ 2018-08-08 1:42 UTC (permalink / raw)
To: Daniel Borkmann
Cc: Alexei Starovoitov, Jonathan Corbet, David S. Miller, linux-doc,
netdev, linux-kernel
In-Reply-To: <76cf11bc-61b3-8068-5546-79d3ff3a58e9@iogearbox.net>
On Fri, Aug 03, 2018 at 10:41:12AM +0200, Daniel Borkmann wrote:
> On 08/01/2018 07:09 AM, Tobin C. Harding wrote:
> > There are a few minor typos and grammatical issues. We should however
> > try to keep the current flavour of the document.
> >
> > Fix typos and grammar if glaringly required.
> >
> > Signed-off-by: Tobin C. Harding <me@tobin.cc>
>
> Overall looks good, just some minor nits:
>
> > Documentation/networking/filter.rst | 65 +++++++++++++++--------------
> > 1 file changed, 33 insertions(+), 32 deletions(-)
> >
> > diff --git a/Documentation/networking/filter.rst b/Documentation/networking/filter.rst
> > index 99dfa74fc4f7..b989a6c882b8 100644
> > --- a/Documentation/networking/filter.rst
> > +++ b/Documentation/networking/filter.rst
> > @@ -32,10 +32,10 @@ removing the old one and placing your new one in its place, assuming your
> > filter has passed the checks, otherwise if it fails the old filter will
> > remain on that socket.
> >
> > -SO_LOCK_FILTER option allows to lock the filter attached to a socket. Once
> > -set, a filter cannot be removed or changed. This allows one process to
> > +SO_LOCK_FILTER option allows locking of the filter attached to a socket.
> > +Once set, a filter cannot be removed or changed. This allows one process to
> > setup a socket, attach a filter, lock it then drop privileges and be
> > -assured that the filter will be kept until the socket is closed.
> > +assured that the filter will be kept until the socket is closed.
>
> ^-- looks like extra whitespace slipped in?
>
> > The biggest user of this construct might be libpcap. Issuing a high-level
> > filter command like ``tcpdump -i em1 port 22`` passes through the libpcap
> > @@ -470,7 +470,7 @@ JIT compiler
> > ============
> >
> > The Linux kernel has a built-in BPF JIT compiler for x86_64, SPARC, PowerPC,
> > -ARM, ARM64, MIPS and s390 and can be enabled through CONFIG_BPF_JIT. The JIT
> > +ARM, ARM64, MIPS and s390 which can be enabled through CONFIG_BPF_JIT. The JIT
> > compiler is transparently invoked for each attached filter from user space
> > or for internal kernel users if it has been previously enabled by root::
> >
> > @@ -580,7 +580,7 @@ Internally, for the kernel interpreter, a different instruction set
> > format with similar underlying principles from BPF described in previous
> > paragraphs is being used. However, the instruction set format is modelled
> > closer to the underlying architecture to mimic native instruction sets, so
> > -that a better performance can be achieved (more details later). This new
> > +that better performance can be achieved (more details later). This new
> > ISA is called 'eBPF' or 'internal BPF' interchangeably. (Note: eBPF which
> > originates from [e]xtended BPF is not the same as BPF extensions! While
> > eBPF is an ISA, BPF extensions date back to classic BPF's 'overloading'
> > @@ -655,12 +655,12 @@ Some core changes of the new internal format:
> >
> > 32-bit architectures run 64-bit internal BPF programs via interpreter.
> > Their JITs may convert BPF programs that only use 32-bit subregisters into
> > - native instruction set and let the rest being interpreted.
> > + native instruction set and let the rest be interpreted.
> >
> > - Operation is 64-bit, because on 64-bit architectures, pointers are also
> > - 64-bit wide, and we want to pass 64-bit values in/out of kernel functions,
> > - so 32-bit eBPF registers would otherwise require to define register-pair
> > - ABI, thus, there won't be able to use a direct eBPF register to HW register
> > + Operation is 64-bit since on 64-bit architectures pointers are also
> > + 64-bit wide and we want to pass 64-bit values in/out of kernel functions.
> > + 32-bit eBPF registers would otherwise require us to define a register-pair
> > + ABI, thus we would not be able to use a direct eBPF register to HW register
> > mapping and JIT would need to do combine/split/move operations for every
> > register in and out of the function, which is complex, bug prone and slow.
> > Another reason is the use of atomic 64-bit counters.
> > @@ -694,7 +694,7 @@ Some core changes of the new internal format:
> > situations without performance penalty.
> >
> > After an in-kernel function call, R1 - R5 are reset to unreadable and R0 has
> > - a return value of the function. Since R6 - R9 are callee saved, their state
> > + the return value of the function. Since R6 - R9 are callee saved, their state
> > is preserved across the call.
> >
> > For example, consider three C functions::
> > @@ -732,7 +732,7 @@ Some core changes of the new internal format:
> > are currently not supported, but these restrictions can be lifted if necessary
> > in the future.
> >
> > - On 64-bit architectures all register map to HW registers one to one. For
> > + On 64-bit architectures all registers map to HW registers one to one. For
> > example, x86_64 JIT compiler can map them as ... ::
> >
> > R0 - rax
> > @@ -831,9 +831,10 @@ A program, that is translated internally consists of the following elements::
> >
> > op:16, jt:8, jf:8, k:32 ==> op:8, dst_reg:4, src_reg:4, off:16, imm:32
> >
> > -So far 87 internal BPF instructions were implemented. 8-bit ``op`` opcode field
> > -has room for new instructions. Some of them may use 16/24/32 byte encoding. New
> > -instructions must be multiple of 8 bytes to preserve backward compatibility.
> > +So far 87 internal BPF instructions have been implemented. 8-bit ``op``
> > +opcode field has room for new instructions. Some of them may use 16/24/32
> > +byte encoding. New instructions must be a multiple of 8 bytes to preserve
> > +backward compatibility.
> >
> > Internal BPF is a general purpose RISC instruction set. Not every register and
> > every instruction are used during translation from original BPF to new format.
> > @@ -844,11 +845,11 @@ out of registers and would have to resort to spill/fill to stack.
> >
> > Internal BPF can used as generic assembler for last step performance
> > optimizations, socket filters and seccomp are using it as assembler. Tracing
> > -filters may use it as assembler to generate code from kernel. In kernel usage
> > +filters may use it as assembler to generate code from kernel. In-kernel usage
>
> ^-- ditto
Hi Daniel,
Thanks for doing such a careful review that you noticed this. I'm
working on this more ATM and I've moved the document to use double
spaces between _all_ full stops. Currently the document uses mostly
single spaces but there are some sections with double space. The
internet tells me this is a 'style' issue not a rule. And I've seen
single and double spacing in tree and do not know if one is favoured.
Do you care? If you do not care I'll just use double spaces. If you do
care and would prefer me to uniformly use a single space I can do that
also. Oh, and FTR filter.txt looks like its going into userspace-api/
so you may care even less with that move.
If this is overly pedantic just tell me to go away :)
thanks,
Tobin.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox