projects/linux·commit c5edde3a

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

c5edde3a · Linus Torvalds <[email protected]> · 2016-04-21 12:57:34 -07:00

Pull networking fixes from David Miller:

 1) Fix memory leak in iwlwifi, from Matti Gottlieb.

 2) Add missing registration of netfilter arp_tables into initial
    namespace, from Florian Westphal.

 3) Fix potential NULL deref in DecNET routing code.

 4) Restrict NETLINK_URELEASE to truly bound sockets only, from Dmitry
    Ivanov.

 5) Fix dst ref counting in VRF, from David Ahern.

 6) Fix TSO segmenting limits in i40e driver, from Alexander Duyck.

 7) Fix heap leak in PACKET_DIAG_MCLIST, from Mathias Krause.

 8) Ravalidate IPV6 datagram socket cached routes properly, particularly
    with UDP, from Martin KaFai Lau.

 9) Fix endian bug in RDS dp_ack_seq handling, from Qing Huang.

10) Fix stats typing in bcmgenet driver, from Eric Dumazet.

11) Openvswitch needs to orphan SKBs before ipv6 fragmentation handing,
    from Joe Stringer.

12) SPI device reference leak in spi_ks8895 PHY driver, from Mark Brown.

13) atl2 doesn't actually support scatter-gather, so don't advertise the
    feature.  From Ben Hucthings.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (72 commits)
  openvswitch: use flow protocol when recalculating ipv6 checksums
  Driver: Vmxnet3: set CHECKSUM_UNNECESSARY for IPv6 packets
  atl2: Disable unimplemented scatter/gather feature
  net/mlx4_en: Split SW RX dropped counter per RX ring
  net/mlx4_core: Don't allow to VF change global pause settings
  net/mlx4_core: Avoid repeated calls to pci enable/disable
  net/mlx4_core: Implement pci_resume callback
  net: phy: spi_ks8895: Don't leak references to SPI devices
  net: ethernet: davinci_emac: Fix platform_data overwrite
  net: ethernet: davinci_emac: Fix Unbalanced pm_runtime_enable
  qede: Fix single MTU sized packet from firmware GRO flow
  qede: Fix setting Skb network header
  qede: Fix various memory allocation error flows for fastpath
  tcp: Merge tx_flags and tskey in tcp_shifted_skb
  tcp: Merge tx_flags and tskey in tcp_collapse_retrans
  drivers: net: cpsw: fix wrong regs access in cpsw_ndo_open
  tcp: Fix SOF_TIMESTAMPING_TX_ACK when handling dup acks
  openvswitch: Orphan skbs before IPv6 defrag
  Revert "Prevent NUll pointer dereference with two PHYs on cpsw"
  VSOCK: Only check error on skb_recv_datagram when skb is NULL
  ...
Commit
c5edde3a81149d29ceae4221f09f4c7bc2f70846
Parents
f862d66a · b4f70527

Merge commit. Changes below are compared with the first parent: f862d66a.

Changes

84 files changed · +1009 −529

FileStatusAddDelContent
Documentation/devicetree/bindings/net/mediatek-net.txtmodified+5−2View file
drivers/bcma/main.cmodified+4−13View file
drivers/isdn/mISDN/socket.cmodified+3−0View file
drivers/net/Kconfigmodified+1−0View file
drivers/net/dsa/mv88e6xxx.cmodified+5−29View file
drivers/net/ethernet/atheros/atlx/atl2.cmodified+1−1View file
drivers/net/ethernet/broadcom/bgmac.cmodified+5−0View file
drivers/net/ethernet/broadcom/bgmac.hmodified+3−3View file
drivers/net/ethernet/broadcom/genet/bcmgenet.cmodified+5−1View file
drivers/net/ethernet/cavium/thunder/thunder_bgx.cmodified+3−2View file
drivers/net/ethernet/chelsio/cxgb4/cxgb4.hmodified+3−0View file
drivers/net/ethernet/chelsio/cxgb4/sge.cmodified+17−3View file
drivers/net/ethernet/chelsio/cxgb4/t4_hw.cmodified+33−0View file
drivers/net/ethernet/intel/fm10k/fm10k_pf.cmodified+22−8View file
drivers/net/ethernet/intel/i40e/i40e_txrx.cmodified+24−25View file
drivers/net/ethernet/intel/i40e/i40e_txrx.hmodified+7−3View file
drivers/net/ethernet/intel/i40evf/i40e_txrx.cmodified+24−25View file
drivers/net/ethernet/intel/i40evf/i40e_txrx.hmodified+7−3View file
drivers/net/ethernet/mellanox/mlx4/en_ethtool.cmodified+4−1View file
drivers/net/ethernet/mellanox/mlx4/en_port.cmodified+4−1View file
drivers/net/ethernet/mellanox/mlx4/en_rx.cmodified+8−4View file
drivers/net/ethernet/mellanox/mlx4/main.cmodified+57−19View file
drivers/net/ethernet/mellanox/mlx4/mlx4.hmodified+2−0View file
drivers/net/ethernet/mellanox/mlx4/mlx4_en.hmodified+1−0View file
drivers/net/ethernet/mellanox/mlx4/port.cmodified+13−0View file
drivers/net/ethernet/qlogic/qede/qede_main.cmodified+100−57View file
drivers/net/ethernet/renesas/ravb_main.cmodified+3−0View file
drivers/net/ethernet/renesas/sh_eth.cmodified+1−5View file
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.cmodified+13−3View file
drivers/net/ethernet/ti/cpsw.cmodified+2−2View file
drivers/net/ethernet/ti/davinci_emac.cmodified+1−2View file
drivers/net/phy/spi_ks8995.cmodified+1−1View file
drivers/net/usb/cdc_mbim.cmodified+7−2View file
drivers/net/vmxnet3/vmxnet3_drv.cmodified+8−4View file
drivers/net/vmxnet3/vmxnet3_int.hmodified+2−2View file
drivers/net/vrf.cmodified+16−161View file
drivers/net/wireless/broadcom/b43/main.cmodified+4−2View file
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.cmodified+2−0View file
drivers/net/wireless/intel/iwlwifi/mvm/ops.cmodified+0−2View file
drivers/net/wireless/intel/iwlwifi/pcie/trans.cmodified+2−2View file
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.cmodified+3−3View file
include/linux/mlx4/device.hmodified+7−0View file
include/linux/rculist_nulls.hmodified+39−0View file
include/net/cls_cgroup.hmodified+5−2View file
include/net/ip6_route.hmodified+3−0View file
include/net/ipv6.hmodified+2−0View file
include/net/route.hmodified+3−0View file
include/net/sctp/structs.hmodified+7−1View file
include/net/sock.hmodified+5−1View file
include/net/tcp.hmodified+2−0View file
include/uapi/linux/Kbuildmodified+1−0View file
kernel/bpf/verifier.cmodified+1−0View file
net/bridge/netfilter/ebtables.cmodified+5−1View file
net/core/skbuff.cmodified+5−2View file
net/decnet/dn_route.cmodified+8−1View file
net/ipv4/netfilter/arptable_filter.cmodified+6−0View file
net/ipv4/route.cmodified+16−3View file
net/ipv4/tcp_input.cmodified+3−1View file
net/ipv4/tcp_output.cmodified+16−0View file
net/ipv4/udp.cmodified+7−2View file
net/ipv6/addrconf.cmodified+20−2View file
net/ipv6/datagram.cmodified+106−63View file
net/ipv6/route.cmodified+16−3View file
net/ipv6/udp.cmodified+1−0View file
net/netfilter/nf_conntrack_proto_tcp.cmodified+4−0View file
net/netlink/af_netlink.cmodified+1−1View file
net/openvswitch/actions.cmodified+2−2View file
net/openvswitch/conntrack.cmodified+1−0View file
net/packet/af_packet.cmodified+1−0View file
net/rds/cong.cmodified+2−2View file
net/rds/ib_cm.cmodified+1−1View file
net/sched/sch_generic.cmodified+4−1View file
net/sctp/outqueue.cmodified+10−5View file
net/sctp/sm_make_chunk.cmodified+1−2View file
net/sctp/sm_sideeffect.cmodified+16−20View file
net/sctp/transport.cmodified+13−6View file
net/tipc/core.cmodified+1−0View file
net/tipc/core.hmodified+3−0View file
net/tipc/name_distr.cmodified+26−9View file
net/vmw_vsock/vmci_transport.cmodified+2−5View file
net/wireless/nl80211.cmodified+1−1View file
tools/testing/selftests/net/.gitignoremodified+1−0View file
tools/testing/selftests/net/Makefilemodified+1−1View file
tools/testing/selftests/net/reuseport_dualstack.cadded+208−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/devicetree/bindings/net/mediatek-net.txt

View file
diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
index 5ca7929..32eaaca 100644
--- a/Documentation/devicetree/bindings/net/mediatek-net.txt
+++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
@@ -9,7 +9,8 @@ have dual GMAC each represented by a child node..
Required properties:
- compatible: Should be "mediatek,mt7623-eth"
- reg: Address and length of the register set for the device
-- interrupts: Should contain the frame engines interrupt
+- interrupts: Should contain the three frame engines interrupts in numeric
+ order. These are fe_int0, fe_int1 and fe_int2.
- clocks: the clock used by the core
- clock-names: the names of the clock listed in the clocks property. These are
"ethif", "esw", "gp2", "gp1"
@@ -42,7 +43,9 @@ eth: ethernet@1b100000 {
<&ethsys CLK_ETHSYS_GP2>,
<&ethsys CLK_ETHSYS_GP1>;
clock-names = "ethif", "esw", "gp2", "gp1";
- interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_LOW>;
+ interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_LOW
+ GIC_SPI 199 IRQ_TYPE_LEVEL_LOW
+ GIC_SPI 198 IRQ_TYPE_LEVEL_LOW>;
power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>;
resets = <&ethsys MT2701_ETHSYS_ETH_RST>;
reset-names = "eth";

drivers/bcma/main.c

View file
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 786be8f..1f63547 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -136,7 +136,6 @@ static bool bcma_is_core_needed_early(u16 core_id)
return false;
}
-#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
struct bcma_device *core)
{
@@ -184,7 +183,7 @@ static unsigned int bcma_of_get_irq(struct platform_device *parent,
struct of_phandle_args out_irq;
int ret;
- if (!parent || !parent->dev.of_node)
+ if (!IS_ENABLED(CONFIG_OF_IRQ) || !parent || !parent->dev.of_node)
return 0;
ret = bcma_of_irq_parse(parent, core, &out_irq, num);
@@ -202,23 +201,15 @@ static void bcma_of_fill_device(struct platform_device *parent,
{
struct device_node *node;
+ if (!IS_ENABLED(CONFIG_OF_IRQ))
+ return;
+
node = bcma_of_find_child_device(parent, core);
if (node)
core->dev.of_node = node;
core->irq = bcma_of_get_irq(parent, core, 0);
}
-#else
-static void bcma_of_fill_device(struct platform_device *parent,
- struct bcma_device *core)
-{
-}
-static inline unsigned int bcma_of_get_irq(struct platform_device *parent,
- struct bcma_device *core, int num)
-{
- return 0;
-}
-#endif /* CONFIG_OF */
unsigned int bcma_core_irq(struct bcma_device *core, int num)
{

drivers/isdn/mISDN/socket.c

View file
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 0d29b5a..99e5f97 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -715,6 +715,9 @@ base_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
if (!maddr || maddr->family != AF_ISDN)
return -EINVAL;
+ if (addr_len < sizeof(struct sockaddr_mISDN))
+ return -EINVAL;
+
lock_sock(sk);
if (_pms(sk)->dev) {

drivers/net/Kconfig

View file
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 2a1ba62..a24c18e 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -195,6 +195,7 @@ config GENEVE
config MACSEC
tristate "IEEE 802.1AE MAC-level encryption (MACsec)"
+ select CRYPTO
select CRYPTO_AES
select CRYPTO_GCM
---help---

drivers/net/dsa/mv88e6xxx.c

View file
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 50454be..a290402 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -2181,27 +2181,10 @@ int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port,
struct net_device *bridge)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
- u16 fid;
int i, err;
mutex_lock(&ps->smi_mutex);
- /* Get or create the bridge FID and assign it to the port */
- for (i = 0; i < ps->num_ports; ++i)
- if (ps->ports[i].bridge_dev == bridge)
- break;
-
- if (i < ps->num_ports)
- err = _mv88e6xxx_port_fid_get(ds, i, &fid);
- else
- err = _mv88e6xxx_fid_new(ds, &fid);
- if (err)
- goto unlock;
-
- err = _mv88e6xxx_port_fid_set(ds, port, fid);
- if (err)
- goto unlock;
-
/* Assign the bridge and remap each port's VLANTable */
ps->ports[port].bridge_dev = bridge;
@@ -2213,7 +2196,6 @@ int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port,
}
}
-unlock:
mutex_unlock(&ps->smi_mutex);
return err;
@@ -2223,16 +2205,10 @@ void mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
struct net_device *bridge = ps->ports[port].bridge_dev;
- u16 fid;
int i;
mutex_lock(&ps->smi_mutex);
- /* Give the port a fresh Filtering Information Database */
- if (_mv88e6xxx_fid_new(ds, &fid) ||
- _mv88e6xxx_port_fid_set(ds, port, fid))
- netdev_warn(ds->ports[port], "failed to assign a new FID\n");
-
/* Unassign the bridge and remap each port's VLANTable */
ps->ports[port].bridge_dev = NULL;
@@ -2476,9 +2452,9 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
* the other bits clear.
*/
reg = 1 << port;
- /* Disable learning for DSA and CPU ports */
- if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))
- reg = PORT_ASSOC_VECTOR_LOCKED_PORT;
+ /* Disable learning for CPU port */
+ if (dsa_is_cpu_port(ds, port))
+ reg = 0;
ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_ASSOC_VECTOR, reg);
if (ret)
@@ -2558,11 +2534,11 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
if (ret)
goto abort;
- /* Port based VLAN map: give each port its own address
+ /* Port based VLAN map: give each port the same default address
* database, and allow bidirectional communication between the
* CPU and DSA port(s), and the other ports.
*/
- ret = _mv88e6xxx_port_fid_set(ds, port, port + 1);
+ ret = _mv88e6xxx_port_fid_set(ds, port, 0);
if (ret)
goto abort;

drivers/net/ethernet/atheros/atlx/atl2.c

View file
diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c
index 8f76f45..2ff4658 100644
--- a/drivers/net/ethernet/atheros/atlx/atl2.c
+++ b/drivers/net/ethernet/atheros/atlx/atl2.c
@@ -1412,7 +1412,7 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err = -EIO;
- netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_CTAG_RX;
+ netdev->hw_features = NETIF_F_HW_VLAN_CTAG_RX;
netdev->features |= (NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX);
/* Init PHY as early as possible due to power saving issue */

drivers/net/ethernet/broadcom/bgmac.c

View file
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 99b30a9..38db2e4 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1572,6 +1572,11 @@ static int bgmac_probe(struct bcma_device *core)
dev_warn(&core->dev, "Using random MAC: %pM\n", mac);
}
+ /* This (reset &) enable is not preset in specs or reference driver but
+ * Broadcom does it in arch PCI code when enabling fake PCI device.
+ */
+ bcma_core_enable(core, 0);
+
/* Allocation and references */
net_dev = alloc_etherdev(sizeof(*bgmac));
if (!net_dev)

drivers/net/ethernet/broadcom/bgmac.h

View file
diff --git a/drivers/net/ethernet/broadcom/bgmac.h b/drivers/net/ethernet/broadcom/bgmac.h
index 4fbb093..9a03c14 100644
--- a/drivers/net/ethernet/broadcom/bgmac.h
+++ b/drivers/net/ethernet/broadcom/bgmac.h
@@ -199,9 +199,9 @@
#define BGMAC_CMDCFG_TAI 0x00000200
#define BGMAC_CMDCFG_HD 0x00000400 /* Set if in half duplex mode */
#define BGMAC_CMDCFG_HD_SHIFT 10
-#define BGMAC_CMDCFG_SR_REV0 0x00000800 /* Set to reset mode, for other revs */
-#define BGMAC_CMDCFG_SR_REV4 0x00002000 /* Set to reset mode, only for core rev 4 */
-#define BGMAC_CMDCFG_SR(rev) ((rev == 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
+#define BGMAC_CMDCFG_SR_REV0 0x00000800 /* Set to reset mode, for core rev 0-3 */
+#define BGMAC_CMDCFG_SR_REV4 0x00002000 /* Set to reset mode, for core rev >= 4 */
+#define BGMAC_CMDCFG_SR(rev) ((rev >= 4) ? BGMAC_CMDCFG_SR_REV4 : BGMAC_CMDCFG_SR_REV0)
#define BGMAC_CMDCFG_ML 0x00008000 /* Set to activate mac loopback mode */
#define BGMAC_CMDCFG_AE 0x00400000
#define BGMAC_CMDCFG_CFE 0x00800000

drivers/net/ethernet/broadcom/genet/bcmgenet.c

View file
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index cf6445d..44ad149 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -878,7 +878,11 @@ static void bcmgenet_get_ethtool_stats(struct net_device *dev,
else
p = (char *)priv;
p += s->stat_offset;
- data[i] = *(u32 *)p;
+ if (sizeof(unsigned long) != sizeof(u32) &&
+ s->stat_sizeof == sizeof(unsigned long))
+ data[i] = *(unsigned long *)p;
+ else
+ data[i] = *(u32 *)p;
}
}

drivers/net/ethernet/cavium/thunder/thunder_bgx.c

View file
diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 9679515..d20539a 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -1011,10 +1011,11 @@ static int bgx_init_of_phy(struct bgx *bgx)
}
lmac++;
- if (lmac == MAX_LMAC_PER_BGX)
+ if (lmac == MAX_LMAC_PER_BGX) {
+ of_node_put(node);
break;
+ }
}
- of_node_put(node);
return 0;
defer:

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

View file
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index 984a3cc..326d400 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -1451,6 +1451,9 @@ int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
unsigned int mmd, unsigned int reg, u16 *valp);
int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
unsigned int mmd, unsigned int reg, u16 val);
+int t4_iq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf,
+ unsigned int vf, unsigned int iqtype, unsigned int iqid,
+ unsigned int fl0id, unsigned int fl1id);
int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
unsigned int vf, unsigned int iqtype, unsigned int iqid,
unsigned int fl0id, unsigned int fl1id);

drivers/net/ethernet/chelsio/cxgb4/sge.c

View file
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 13b144b..6278e5a 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -2981,14 +2981,28 @@ void t4_free_ofld_rxqs(struct adapter *adap, int n, struct sge_ofld_rxq *q)
void t4_free_sge_resources(struct adapter *adap)
{
int i;
- struct sge_eth_rxq *eq = adap->sge.ethrxq;
- struct sge_eth_txq *etq = adap->sge.ethtxq;
+ struct sge_eth_rxq *eq;
+ struct sge_eth_txq *etq;
+
+ /* stop all Rx queues in order to start them draining */
+ for (i = 0; i < adap->sge.ethqsets; i++) {
+ eq = &adap->sge.ethrxq[i];
+ if (eq->rspq.desc)
+ t4_iq_stop(adap, adap->mbox, adap->pf, 0,
+ FW_IQ_TYPE_FL_INT_CAP,
+ eq->rspq.cntxt_id,
+ eq->fl.size ? eq->fl.cntxt_id : 0xffff,
+ 0xffff);
+ }
/* clean up Ethernet Tx/Rx queues */
- for (i = 0; i < adap->sge.ethqsets; i++, eq++, etq++) {
+ for (i = 0; i < adap->sge.ethqsets; i++) {
+ eq = &adap->sge.ethrxq[i];
if (eq->rspq.desc)
free_rspq_fl(adap, &eq->rspq,
eq->fl.size ? &eq->fl : NULL);
+
+ etq = &adap->sge.ethtxq[i];
if (etq->q.desc) {
t4_eth_eq_free(adap, adap->mbox, adap->pf, 0,
etq->q.cntxt_id);

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

View file
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index c7efb11..71586a3 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -6950,6 +6950,39 @@ int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid,
}
/**
+ * t4_iq_stop - stop an ingress queue and its FLs
+ * @adap: the adapter
+ * @mbox: mailbox to use for the FW command
+ * @pf: the PF owning the queues
+ * @vf: the VF owning the queues
+ * @iqtype: the ingress queue type (FW_IQ_TYPE_FL_INT_CAP, etc.)
+ * @iqid: ingress queue id
+ * @fl0id: FL0 queue id or 0xffff if no attached FL0
+ * @fl1id: FL1 queue id or 0xffff if no attached FL1
+ *
+ * Stops an ingress queue and its associated FLs, if any. This causes
+ * any current or future data/messages destined for these queues to be
+ * tossed.
+ */
+int t4_iq_stop(struct adapter *adap, unsigned int mbox, unsigned int pf,
+ unsigned int vf, unsigned int iqtype, unsigned int iqid,
+ unsigned int fl0id, unsigned int fl1id)
+{
+ struct fw_iq_cmd c;
+
+ memset(&c, 0, sizeof(c));
+ c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_IQ_CMD) | FW_CMD_REQUEST_F |
+ FW_CMD_EXEC_F | FW_IQ_CMD_PFN_V(pf) |
+ FW_IQ_CMD_VFN_V(vf));
+ c.alloc_to_len16 = cpu_to_be32(FW_IQ_CMD_IQSTOP_F | FW_LEN16(c));
+ c.type_to_iqandstindex = cpu_to_be32(FW_IQ_CMD_TYPE_V(iqtype));
+ c.iqid = cpu_to_be16(iqid);
+ c.fl0id = cpu_to_be16(fl0id);
+ c.fl1id = cpu_to_be16(fl1id);
+ return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
+}
+
+/**
* t4_iq_free - free an ingress queue and its FLs
* @adap: the adapter
* @mbox: mailbox to use for the FW command

drivers/net/ethernet/intel/fm10k/fm10k_pf.c

View file
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
index 62ccebc..8cf943d 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
@@ -1223,18 +1223,32 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results,
if (err)
return err;
- /* verify upper 16 bits are zero */
- if (vid >> 16)
- return FM10K_ERR_PARAM;
-
set = !(vid & FM10K_VLAN_CLEAR);
vid &= ~FM10K_VLAN_CLEAR;
- err = fm10k_iov_select_vid(vf_info, (u16)vid);
- if (err < 0)
- return err;
+ /* if the length field has been set, this is a multi-bit
+ * update request. For multi-bit requests, simply disallow
+ * them when the pf_vid has been set. In this case, the PF
+ * should have already cleared the VLAN_TABLE, and if we
+ * allowed them, it could allow a rogue VF to receive traffic
+ * on a VLAN it was not assigned. In the single-bit case, we
+ * need to modify requests for VLAN 0 to use the default PF or
+ * SW vid when assigned.
+ */
- vid = err;
+ if (vid >> 16) {
+ /* prevent multi-bit requests when PF has
+ * administratively set the VLAN for this VF
+ */
+ if (vf_info->pf_vid)
+ return FM10K_ERR_PARAM;
+ } else {
+ err = fm10k_iov_select_vid(vf_info, (u16)vid);
+ if (err < 0)
+ return err;
+
+ vid = err;
+ }
/* update VSI info for VF in regards to VLAN table */
err = hw->mac.ops.update_vlan(hw, vid, vf_info->vsi, set);

drivers/net/ethernet/intel/i40e/i40e_txrx.c

View file
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 084d0ab..6a49b7a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2594,35 +2594,34 @@ int __i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size)
}
/**
- * __i40e_chk_linearize - Check if there are more than 8 fragments per packet
+ * __i40e_chk_linearize - Check if there are more than 8 buffers per packet
* @skb: send buffer
*
- * Note: Our HW can't scatter-gather more than 8 fragments to build
- * a packet on the wire and so we need to figure out the cases where we
- * need to linearize the skb.
+ * Note: Our HW can't DMA more than 8 buffers to build a packet on the wire
+ * and so we need to figure out the cases where we need to linearize the skb.
+ *
+ * For TSO we need to count the TSO header and segment payload separately.
+ * As such we need to check cases where we have 7 fragments or more as we
+ * can potentially require 9 DMA transactions, 1 for the TSO header, 1 for
+ * the segment payload in the first descriptor, and another 7 for the
+ * fragments.
**/
bool __i40e_chk_linearize(struct sk_buff *skb)
{
const struct skb_frag_struct *frag, *stale;
- int gso_size, nr_frags, sum;
-
- /* check to see if TSO is enabled, if so we may get a repreive */
- gso_size = skb_shinfo(skb)->gso_size;
- if (unlikely(!gso_size))
- return true;
+ int nr_frags, sum;
- /* no need to check if number of frags is less than 8 */
+ /* no need to check if number of frags is less than 7 */
nr_frags = skb_shinfo(skb)->nr_frags;
- if (nr_frags < I40E_MAX_BUFFER_TXD)
+ if (nr_frags < (I40E_MAX_BUFFER_TXD - 1))
return false;
/* We need to walk through the list and validate that each group
* of 6 fragments totals at least gso_size. However we don't need
- * to perform such validation on the first or last 6 since the first
- * 6 cannot inherit any data from a descriptor before them, and the
- * last 6 cannot inherit any data from a descriptor after them.
+ * to perform such validation on the last 6 since the last 6 cannot
+ * inherit any data from a descriptor after them.
*/
- nr_frags -= I40E_MAX_BUFFER_TXD - 1;
+ nr_frags -= I40E_MAX_BUFFER_TXD - 2;
frag = &skb_shinfo(skb)->frags[0];
/* Initialize size to the negative value of gso_size minus 1. We
@@ -2631,21 +2630,21 @@ bool __i40e_chk_linearize(struct sk_buff *skb)
* descriptors for a single transmit as the header and previous
* fragment are already consuming 2 descriptors.
*/
- sum = 1 - gso_size;
+ sum = 1 - skb_shinfo(skb)->gso_size;
- /* Add size of frags 1 through 5 to create our initial sum */
- sum += skb_frag_size(++frag);
- sum += skb_frag_size(++frag);
- sum += skb_frag_size(++frag);
- sum += skb_frag_size(++frag);
- sum += skb_frag_size(++frag);
+ /* Add size of frags 0 through 4 to create our initial sum */
+ sum += skb_frag_size(frag++);
+ sum += skb_frag_size(frag++);
+ sum += skb_frag_size(frag++);
+ sum += skb_frag_size(frag++);
+ sum += skb_frag_size(frag++);
/* Walk through fragments adding latest fragment, testing it, and
* then removing stale fragments from the sum.
*/
stale = &skb_shinfo(skb)->frags[0];
for (;;) {
- sum += skb_frag_size(++frag);
+ sum += skb_frag_size(frag++);
/* if sum is negative we failed to make sufficient progress */
if (sum < 0)
@@ -2655,7 +2654,7 @@ bool __i40e_chk_linearize(struct sk_buff *skb)
if (!--nr_frags)
break;
- sum -= skb_frag_size(++stale);
+ sum -= skb_frag_size(stale++);
}
return false;

drivers/net/ethernet/intel/i40e/i40e_txrx.h

View file
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
index cdd5dc0..a9bd705 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
@@ -413,10 +413,14 @@ static inline int i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size)
**/
static inline bool i40e_chk_linearize(struct sk_buff *skb, int count)
{
- /* we can only support up to 8 data buffers for a single send */
- if (likely(count <= I40E_MAX_BUFFER_TXD))
+ /* Both TSO and single send will work if count is less than 8 */
+ if (likely(count < I40E_MAX_BUFFER_TXD))
return false;
- return __i40e_chk_linearize(skb);
+ if (skb_is_gso(skb))
+ return __i40e_chk_linearize(skb);
+
+ /* we can support up to 8 data buffers for a single send */
+ return count != I40E_MAX_BUFFER_TXD;
}
#endif /* _I40E_TXRX_H_ */

drivers/net/ethernet/intel/i40evf/i40e_txrx.c

View file
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index ebcc25c..cea97da 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1796,35 +1796,34 @@ static void i40e_create_tx_ctx(struct i40e_ring *tx_ring,
}
/**
- * __i40evf_chk_linearize - Check if there are more than 8 fragments per packet
+ * __i40evf_chk_linearize - Check if there are more than 8 buffers per packet
* @skb: send buffer
*
- * Note: Our HW can't scatter-gather more than 8 fragments to build
- * a packet on the wire and so we need to figure out the cases where we
- * need to linearize the skb.
+ * Note: Our HW can't DMA more than 8 buffers to build a packet on the wire
+ * and so we need to figure out the cases where we need to linearize the skb.
+ *
+ * For TSO we need to count the TSO header and segment payload separately.
+ * As such we need to check cases where we have 7 fragments or more as we
+ * can potentially require 9 DMA transactions, 1 for the TSO header, 1 for
+ * the segment payload in the first descriptor, and another 7 for the
+ * fragments.
**/
bool __i40evf_chk_linearize(struct sk_buff *skb)
{
const struct skb_frag_struct *frag, *stale;
- int gso_size, nr_frags, sum;
-
- /* check to see if TSO is enabled, if so we may get a repreive */
- gso_size = skb_shinfo(skb)->gso_size;
- if (unlikely(!gso_size))
- return true;
+ int nr_frags, sum;
- /* no need to check if number of frags is less than 8 */
+ /* no need to check if number of frags is less than 7 */
nr_frags = skb_shinfo(skb)->nr_frags;
- if (nr_frags < I40E_MAX_BUFFER_TXD)
+ if (nr_frags < (I40E_MAX_BUFFER_TXD - 1))
return false;
/* We need to walk through the list and validate that each group
* of 6 fragments totals at least gso_size. However we don't need
- * to perform such validation on the first or last 6 since the first
- * 6 cannot inherit any data from a descriptor before them, and the
- * last 6 cannot inherit any data from a descriptor after them.
+ * to perform such validation on the last 6 since the last 6 cannot
+ * inherit any data from a descriptor after them.
*/
- nr_frags -= I40E_MAX_BUFFER_TXD - 1;
+ nr_frags -= I40E_MAX_BUFFER_TXD - 2;
frag = &skb_shinfo(skb)->frags[0];
/* Initialize size to the negative value of gso_size minus 1. We
@@ -1833,21 +1832,21 @@ bool __i40evf_chk_linearize(struct sk_buff *skb)
* descriptors for a single transmit as the header and previous
* fragment are already consuming 2 descriptors.
*/
- sum = 1 - gso_size;
+ sum = 1 - skb_shinfo(skb)->gso_size;
- /* Add size of frags 1 through 5 to create our initial sum */
- sum += skb_frag_size(++frag);
- sum += skb_frag_size(++frag);
- sum += skb_frag_size(++frag);
- sum += skb_frag_size(++frag);
- sum += skb_frag_size(++frag);
+ /* Add size of frags 0 through 4 to create our initial sum */
+ sum += skb_frag_size(frag++);
+ sum += skb_frag_size(frag++);
+ sum += skb_frag_size(frag++);
+ sum += skb_frag_size(frag++);
+ sum += skb_frag_size(frag++);
/* Walk through fragments adding latest fragment, testing it, and
* then removing stale fragments from the sum.
*/
stale = &skb_shinfo(skb)->frags[0];
for (;;) {
- sum += skb_frag_size(++frag);

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/i40evf/i40e_txrx.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx4/en_ethtool.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx4/en_port.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx4/en_rx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx4/main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx4/mlx4.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx4/mlx4_en.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx4/port.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/qlogic/qede/qede_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/renesas/ravb_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/renesas/sh_eth.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/ti/cpsw.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/ti/davinci_emac.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/spi_ks8995.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/cdc_mbim.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/vmxnet3/vmxnet3_drv.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/vmxnet3/vmxnet3_int.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/vrf.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/broadcom/b43/main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/ops.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/pcie/trans.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c

View file

This diff is incomplete. Download the complete patch.

include/linux/mlx4/device.h

View file

This diff is incomplete. Download the complete patch.

include/linux/rculist_nulls.h

View file

This diff is incomplete. Download the complete patch.

include/net/cls_cgroup.h

View file

This diff is incomplete. Download the complete patch.

include/net/ip6_route.h

View file

This diff is incomplete. Download the complete patch.

include/net/ipv6.h

View file

This diff is incomplete. Download the complete patch.

include/net/route.h

View file

This diff is incomplete. Download the complete patch.

include/net/sctp/structs.h

View file

This diff is incomplete. Download the complete patch.

include/net/sock.h

View file

This diff is incomplete. Download the complete patch.

include/net/tcp.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/Kbuild

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/verifier.c

View file

This diff is incomplete. Download the complete patch.

net/bridge/netfilter/ebtables.c

View file

This diff is incomplete. Download the complete patch.

net/core/skbuff.c

View file

This diff is incomplete. Download the complete patch.

net/decnet/dn_route.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/netfilter/arptable_filter.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/route.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_input.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_output.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/udp.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/addrconf.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/datagram.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/route.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/udp.c

View file

This diff is incomplete. Download the complete patch.

net/netfilter/nf_conntrack_proto_tcp.c

View file

This diff is incomplete. Download the complete patch.

net/netlink/af_netlink.c

View file

This diff is incomplete. Download the complete patch.

net/openvswitch/actions.c

View file

This diff is incomplete. Download the complete patch.

net/openvswitch/conntrack.c

View file

This diff is incomplete. Download the complete patch.

net/packet/af_packet.c

View file

This diff is incomplete. Download the complete patch.

net/rds/cong.c

View file

This diff is incomplete. Download the complete patch.

net/rds/ib_cm.c

View file

This diff is incomplete. Download the complete patch.

net/sched/sch_generic.c

View file

This diff is incomplete. Download the complete patch.

net/sctp/outqueue.c

View file

This diff is incomplete. Download the complete patch.

net/sctp/sm_make_chunk.c

View file

This diff is incomplete. Download the complete patch.

net/sctp/sm_sideeffect.c

View file

This diff is incomplete. Download the complete patch.

net/sctp/transport.c

View file

This diff is incomplete. Download the complete patch.

net/tipc/core.c

View file

This diff is incomplete. Download the complete patch.

net/tipc/core.h

View file

This diff is incomplete. Download the complete patch.

net/tipc/name_distr.c

View file

This diff is incomplete. Download the complete patch.

net/vmw_vsock/vmci_transport.c

View file

This diff is incomplete. Download the complete patch.

net/wireless/nl80211.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/.gitignore

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/reuseport_dualstack.c

View file

This diff is incomplete. Download the complete patch.