Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
Pull networking fixes and cleanups from David Miller:

 1) Use rb_entry() instead of hardcoded container_of(), from Geliang
    Tang.

 2) Use correct memory barriers in stammac driver, from Pavel Machek.

 3) Fix assoc bind address handling in SCTP, from Xin Long.

 4) Make the length check for UFO handling consistent between
    __ip_append_data() and ip_finish_output(), from Zheng Li.

 5) HSI driver compatible strings were busted fro hix5hd2, from Dongpo
    Li.

 6) Handle devm_ioremap() errors properly in cavium driver, from Arvind
    Yadav.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (22 commits)
  RDS: use rb_entry()
  net_sched: sch_netem: use rb_entry()
  net_sched: sch_fq: use rb_entry()
  net/mlx5: use rb_entry()
  ethernet: sfc: Add Kconfig entry for vendor Solarflare
  sctp: not copying duplicate addrs to the assoc's bind address list
  sctp: reduce indent level in sctp_copy_local_addr_list
  ARM: dts: hix5hd2: don't change the existing compatible string
  net: hix5hd2_gmac: fix compatible strings name
  openvswitch: Add a missing break statement.
  net: netcp: ethss: fix 10gbe host port tx pri map configuration
  net: netcp: ethss: fix errors in ethtool ops
  fsl/fman: enable compilation on ARM64
  fsl/fman: A007273 only applies to PPC SoCs
  powerpc: fsl/fman: remove fsl,fman from of_device_ids[]
  fsl/fman: fix 1G support for QSGMII interfaces
  dt: bindings: net: use boolean dt properties for eee broken modes
  net: phy: use boolean dt properties for eee broken modes
  net: phy: fix sign type error in genphy_config_eee_advert
  ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output
  ...
  • Loading branch information
torvalds committed Dec 20, 2016
2 parents 3eb8625 + a763f78 commit ba6d973
Show file tree
Hide file tree
Showing 25 changed files with 148 additions and 86 deletions.
13 changes: 8 additions & 5 deletions Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ Hisilicon hix5hd2 gmac controller

Required properties:
- compatible: should contain one of the following SoC strings:
* "hisilicon,hix5hd2-gemac"
* "hisilicon,hi3798cv200-gemac"
* "hisilicon,hix5hd2-gmac"
* "hisilicon,hi3798cv200-gmac"
* "hisilicon,hi3516a-gmac"
and one of the following version string:
* "hisilicon,hisi-gemac-v1"
* "hisilicon,hisi-gemac-v2"
* "hisilicon,hisi-gmac-v1"
* "hisilicon,hisi-gmac-v2"
The version v1 includes SoCs hix5hd2.
The version v2 includes SoCs hi3798cv200, hi3516a.
- reg: specifies base physical address(s) and size of the device registers.
The first region is the MAC register base and size.
The second region is external interface control register.
Expand Down Expand Up @@ -35,7 +38,7 @@ Required properties:

Example:
gmac0: ethernet@f9840000 {
compatible = "hisilicon,hi3798cv200-gemac", "hisilicon,hisi-gemac-v2";
compatible = "hisilicon,hi3798cv200-gmac", "hisilicon,hisi-gmac-v2";
reg = <0xf9840000 0x1000>,<0xf984300c 0x4>;
interrupts = <0 71 4>;
#address-cells = <1>;
Expand Down
10 changes: 8 additions & 2 deletions Documentation/devicetree/bindings/net/phy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ Optional Properties:
- enet-phy-lane-swap: If set, indicates the PHY will swap the TX/RX lanes to
compensate for the board being designed with the lanes swapped.

- eee-broken-modes: Bits to clear in the MDIO_AN_EEE_ADV register to
disable EEE broken modes.
- eee-broken-100tx:
- eee-broken-1000t:
- eee-broken-10gt:
- eee-broken-1000kx:
- eee-broken-10gkx4:
- eee-broken-10gkr:
Mark the corresponding energy efficient ethernet mode as broken and
request the ethernet to stop advertising it.

Example:

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/hisi-x5hd2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
};

gmac0: ethernet@1840000 {
compatible = "hisilicon,hix5hd2-gemac", "hisilicon,hisi-gemac-v1";
compatible = "hisilicon,hix5hd2-gmac", "hisilicon,hisi-gmac-v1";
reg = <0x1840000 0x1000>,<0x184300c 0x4>;
interrupts = <0 71 4>;
clocks = <&clock HIX5HD2_MAC0_CLK>;
Expand All @@ -447,7 +447,7 @@
};

gmac1: ethernet@1841000 {
compatible = "hisilicon,hix5hd2-gemac", "hisilicon,hisi-gemac-v1";
compatible = "hisilicon,hix5hd2-gmac", "hisilicon,hisi-gmac-v1";
reg = <0x1841000 0x1000>,<0x1843010 0x4>;
interrupts = <0 72 4>;
clocks = <&clock HIX5HD2_MAC1_CLK>;
Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/platforms/85xx/corenet_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ static const struct of_device_id of_device_ids[] = {
{
.compatible = "fsl,qe",
},
{
.compatible = "fsl,fman",
},
/* The following two are for the Freescale hypervisor */
{
.name = "hypervisor",
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ source "drivers/net/ethernet/seeq/Kconfig"
source "drivers/net/ethernet/silan/Kconfig"
source "drivers/net/ethernet/sis/Kconfig"
source "drivers/net/ethernet/sfc/Kconfig"
source "drivers/net/ethernet/sfc/falcon/Kconfig"
source "drivers/net/ethernet/sgi/Kconfig"
source "drivers/net/ethernet/smsc/Kconfig"
source "drivers/net/ethernet/stmicro/Kconfig"
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,12 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
p->agl = (u64)devm_ioremap(&pdev->dev, p->agl_phys, p->agl_size);
p->agl_prt_ctl = (u64)devm_ioremap(&pdev->dev, p->agl_prt_ctl_phys,
p->agl_prt_ctl_size);
if (!p->mix || !p->agl || !p->agl_prt_ctl) {
dev_err(&pdev->dev, "failed to map I/O memory\n");
result = -ENOMEM;
goto err;
}

spin_lock_init(&p->lock);

skb_queue_head_init(&p->tx_list);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/fman/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config FSL_FMAN
tristate "FMan support"
depends on FSL_SOC || COMPILE_TEST
depends on FSL_SOC || ARCH_LAYERSCAPE || COMPILE_TEST
select GENERIC_ALLOCATOR
select PHYLIB
default n
Expand Down
15 changes: 15 additions & 0 deletions drivers/net/ethernet/freescale/fman/fman.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,7 @@ static int fman_reset(struct fman *fman)

goto _return;
} else {
#ifdef CONFIG_PPC
struct device_node *guts_node;
struct ccsr_guts __iomem *guts_regs;
u32 devdisr2, reg;
Expand Down Expand Up @@ -1921,6 +1922,7 @@ static int fman_reset(struct fman *fman)

/* Enable all MACs */
iowrite32be(reg, &guts_regs->devdisr2);
#endif

/* Perform FMan reset */
iowrite32be(FPM_RSTC_FM_RESET, &fman->fpm_regs->fm_rstc);
Expand All @@ -1932,25 +1934,31 @@ static int fman_reset(struct fman *fman)
} while (((ioread32be(&fman->fpm_regs->fm_rstc)) &
FPM_RSTC_FM_RESET) && --count);
if (count == 0) {
#ifdef CONFIG_PPC
iounmap(guts_regs);
of_node_put(guts_node);
#endif
err = -EBUSY;
goto _return;
}
#ifdef CONFIG_PPC

/* Restore devdisr2 value */
iowrite32be(devdisr2, &guts_regs->devdisr2);

iounmap(guts_regs);
of_node_put(guts_node);
#endif

goto _return;

#ifdef CONFIG_PPC
guts_regs:
of_node_put(guts_node);
guts_node:
dev_dbg(fman->dev, "%s: Didn't perform FManV3 reset due to Errata A007273!\n",
__func__);
#endif
}
_return:
return err;
Expand Down Expand Up @@ -2868,6 +2876,13 @@ static struct fman *read_dts_node(struct platform_device *of_dev)

fman->dev = &of_dev->dev;

err = of_platform_populate(fm_node, NULL, NULL, &of_dev->dev);
if (err) {
dev_err(&of_dev->dev, "%s: of_platform_populate() failed\n",
__func__);
goto fman_free;
}

return fman;

fman_node_put:
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/freescale/fman/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ static const u16 phy2speed[] = {
[PHY_INTERFACE_MODE_RGMII_RXID] = SPEED_1000,
[PHY_INTERFACE_MODE_RGMII_TXID] = SPEED_1000,
[PHY_INTERFACE_MODE_RTBI] = SPEED_1000,
[PHY_INTERFACE_MODE_QSGMII] = SPEED_1000,
[PHY_INTERFACE_MODE_XGMII] = SPEED_10000
};

Expand Down
13 changes: 7 additions & 6 deletions drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1316,18 +1316,19 @@ static int hix5hd2_dev_remove(struct platform_device *pdev)
}

static const struct of_device_id hix5hd2_of_match[] = {
{ .compatible = "hisilicon,hisi-gemac-v1", .data = (void *)GEMAC_V1 },
{ .compatible = "hisilicon,hisi-gemac-v2", .data = (void *)GEMAC_V2 },
{ .compatible = "hisilicon,hix5hd2-gemac", .data = (void *)GEMAC_V1 },
{ .compatible = "hisilicon,hi3798cv200-gemac", .data = (void *)GEMAC_V2 },
{ .compatible = "hisilicon,hisi-gmac-v1", .data = (void *)GEMAC_V1 },
{ .compatible = "hisilicon,hisi-gmac-v2", .data = (void *)GEMAC_V2 },
{ .compatible = "hisilicon,hix5hd2-gmac", .data = (void *)GEMAC_V1 },
{ .compatible = "hisilicon,hi3798cv200-gmac", .data = (void *)GEMAC_V2 },
{ .compatible = "hisilicon,hi3516a-gmac", .data = (void *)GEMAC_V2 },
{},
};

MODULE_DEVICE_TABLE(of, hix5hd2_of_match);

static struct platform_driver hix5hd2_dev_driver = {
.driver = {
.name = "hisi-gemac",
.name = "hisi-gmac",
.of_match_table = hix5hd2_of_match,
},
.probe = hix5hd2_dev_probe,
Expand All @@ -1338,4 +1339,4 @@ module_platform_driver(hix5hd2_dev_driver);

MODULE_DESCRIPTION("HISILICON Gigabit Ethernet MAC driver");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:hisi-gemac");
MODULE_ALIAS("platform:hisi-gmac");
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void mlx5_fc_stats_insert(struct rb_root *root, struct mlx5_fc *counter)
struct rb_node *parent = NULL;

while (*new) {
struct mlx5_fc *this = container_of(*new, struct mlx5_fc, node);
struct mlx5_fc *this = rb_entry(*new, struct mlx5_fc, node);
int result = counter->id - this->id;

parent = *new;
Expand Down
21 changes: 21 additions & 0 deletions drivers/net/ethernet/sfc/Kconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
#
# Solarflare device configuration
#

config NET_VENDOR_SOLARFLARE
bool "Solarflare devices"
default y
---help---
If you have a network (Ethernet) card belonging to this class, say Y.

Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about Solarflare devices. If you say Y, you will be asked
for your specific card in the following questions.

if NET_VENDOR_SOLARFLARE

config SFC
tristate "Solarflare SFC9000/SFC9100-family support"
depends on PCI
Expand Down Expand Up @@ -44,3 +61,7 @@ config SFC_MCDI_LOGGING
Driver-Interface) commands and responses, allowing debugging of
driver/firmware interaction. The tracing is actually enabled by
a sysfs file 'mcdi_logging' under the PCI device.

source "drivers/net/ethernet/sfc/falcon/Kconfig"

endif # NET_VENDOR_SOLARFLARE
4 changes: 2 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ static void dwmac4_rd_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
* descriptors for the same frame has to be set before, to
* avoid race condition.
*/
wmb();
dma_wmb();

p->des3 = cpu_to_le32(tdes3);
}
Expand Down Expand Up @@ -377,7 +377,7 @@ static void dwmac4_rd_prepare_tso_tx_desc(struct dma_desc *p, int is_fs,
* descriptors for the same frame has to be set before, to
* avoid race condition.
*/
wmb();
dma_wmb();

p->des3 = cpu_to_le32(tdes3);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/enh_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static void enh_desc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
* descriptors for the same frame has to be set before, to
* avoid race condition.
*/
wmb();
dma_wmb();

p->des0 = cpu_to_le32(tdes0);
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,7 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
* descriptor and then barrier is needed to make sure that
* all is coherent before granting the DMA engine.
*/
smp_wmb();
dma_wmb();

if (netif_msg_pktdata(priv)) {
pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n",
Expand Down Expand Up @@ -2338,7 +2338,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
* descriptor and then barrier is needed to make sure that
* all is coherent before granting the DMA engine.
*/
smp_wmb();
dma_wmb();
}

netdev_sent_queue(dev, skb->len);
Expand Down Expand Up @@ -2443,14 +2443,14 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv)
netif_dbg(priv, rx_status, priv->dev,
"refill entry #%d\n", entry);
}
wmb();
dma_wmb();

if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00))
priv->hw->desc->init_rx_desc(p, priv->use_riwt, 0, 0);
else
priv->hw->desc->set_rx_owner(p);

wmb();
dma_wmb();

entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE);
}
Expand Down
24 changes: 18 additions & 6 deletions drivers/net/ethernet/ti/netcp_ethss.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@

/* offset relative to base of XGBE_SS_REG_INDEX */
#define XGBE10_SGMII_MODULE_OFFSET 0x100
#define IS_SS_ID_XGBE(d) ((d)->ss_version == XGBE_SS_VERSION_10)
/* offset relative to base of XGBE_SM_REG_INDEX */
#define XGBE10_HOST_PORT_OFFSET 0x34
#define XGBE10_SLAVE_PORT_OFFSET 0x64
Expand Down Expand Up @@ -1746,6 +1747,17 @@ static void keystone_set_msglevel(struct net_device *ndev, u32 value)
netcp->msg_enable = value;
}

static struct gbe_intf *keystone_get_intf_data(struct netcp_intf *netcp)
{
struct gbe_intf *gbe_intf;

gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
if (!gbe_intf)
gbe_intf = netcp_module_get_intf_data(&xgbe_module, netcp);

return gbe_intf;
}

static void keystone_get_stat_strings(struct net_device *ndev,
uint32_t stringset, uint8_t *data)
{
Expand All @@ -1754,7 +1766,7 @@ static void keystone_get_stat_strings(struct net_device *ndev,
struct gbe_priv *gbe_dev;
int i;

gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
return;
gbe_dev = gbe_intf->gbe_dev;
Expand All @@ -1778,7 +1790,7 @@ static int keystone_get_sset_count(struct net_device *ndev, int stringset)
struct gbe_intf *gbe_intf;
struct gbe_priv *gbe_dev;

gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
return -EINVAL;
gbe_dev = gbe_intf->gbe_dev;
Expand Down Expand Up @@ -1896,7 +1908,7 @@ static void keystone_get_ethtool_stats(struct net_device *ndev,
struct gbe_intf *gbe_intf;
struct gbe_priv *gbe_dev;

gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
return;

Expand All @@ -1920,7 +1932,7 @@ static int keystone_get_link_ksettings(struct net_device *ndev,
if (!phy)
return -EINVAL;

gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
return -EINVAL;

Expand Down Expand Up @@ -1953,7 +1965,7 @@ static int keystone_set_link_ksettings(struct net_device *ndev,
if (!phy)
return -EINVAL;

gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
return -EINVAL;

Expand Down Expand Up @@ -2311,7 +2323,7 @@ static void gbe_init_host_port(struct gbe_priv *priv)
int bypass_en = 1;

/* Host Tx Pri */
if (IS_SS_ID_NU(priv))
if (IS_SS_ID_NU(priv) || IS_SS_ID_XGBE(priv))
writel(HOST_TX_PRI_MAP_DEFAULT,
GBE_REG_ADDR(priv, host_port_regs, tx_pri_map));

Expand Down
Loading

0 comments on commit ba6d973

Please sign in to comment.