mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
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 ...
This commit is contained in:
commit
ba6d973f78
@ -2,11 +2,14 @@ Hisilicon hix5hd2 gmac controller
|
|||||||
|
|
||||||
Required properties:
|
Required properties:
|
||||||
- compatible: should contain one of the following SoC strings:
|
- compatible: should contain one of the following SoC strings:
|
||||||
* "hisilicon,hix5hd2-gemac"
|
* "hisilicon,hix5hd2-gmac"
|
||||||
* "hisilicon,hi3798cv200-gemac"
|
* "hisilicon,hi3798cv200-gmac"
|
||||||
|
* "hisilicon,hi3516a-gmac"
|
||||||
and one of the following version string:
|
and one of the following version string:
|
||||||
* "hisilicon,hisi-gemac-v1"
|
* "hisilicon,hisi-gmac-v1"
|
||||||
* "hisilicon,hisi-gemac-v2"
|
* "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.
|
- reg: specifies base physical address(s) and size of the device registers.
|
||||||
The first region is the MAC register base and size.
|
The first region is the MAC register base and size.
|
||||||
The second region is external interface control register.
|
The second region is external interface control register.
|
||||||
@ -35,7 +38,7 @@ Required properties:
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
gmac0: ethernet@f9840000 {
|
gmac0: ethernet@f9840000 {
|
||||||
compatible = "hisilicon,hi3798cv200-gemac", "hisilicon,hisi-gemac-v2";
|
compatible = "hisilicon,hi3798cv200-gmac", "hisilicon,hisi-gmac-v2";
|
||||||
reg = <0xf9840000 0x1000>,<0xf984300c 0x4>;
|
reg = <0xf9840000 0x1000>,<0xf984300c 0x4>;
|
||||||
interrupts = <0 71 4>;
|
interrupts = <0 71 4>;
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
|
@ -38,8 +38,14 @@ Optional Properties:
|
|||||||
- enet-phy-lane-swap: If set, indicates the PHY will swap the TX/RX lanes to
|
- 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.
|
compensate for the board being designed with the lanes swapped.
|
||||||
|
|
||||||
- eee-broken-modes: Bits to clear in the MDIO_AN_EEE_ADV register to
|
- eee-broken-100tx:
|
||||||
disable EEE broken modes.
|
- 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:
|
Example:
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
gmac0: ethernet@1840000 {
|
gmac0: ethernet@1840000 {
|
||||||
compatible = "hisilicon,hix5hd2-gemac", "hisilicon,hisi-gemac-v1";
|
compatible = "hisilicon,hix5hd2-gmac", "hisilicon,hisi-gmac-v1";
|
||||||
reg = <0x1840000 0x1000>,<0x184300c 0x4>;
|
reg = <0x1840000 0x1000>,<0x184300c 0x4>;
|
||||||
interrupts = <0 71 4>;
|
interrupts = <0 71 4>;
|
||||||
clocks = <&clock HIX5HD2_MAC0_CLK>;
|
clocks = <&clock HIX5HD2_MAC0_CLK>;
|
||||||
@ -447,7 +447,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
gmac1: ethernet@1841000 {
|
gmac1: ethernet@1841000 {
|
||||||
compatible = "hisilicon,hix5hd2-gemac", "hisilicon,hisi-gemac-v1";
|
compatible = "hisilicon,hix5hd2-gmac", "hisilicon,hisi-gmac-v1";
|
||||||
reg = <0x1841000 0x1000>,<0x1843010 0x4>;
|
reg = <0x1841000 0x1000>,<0x1843010 0x4>;
|
||||||
interrupts = <0 72 4>;
|
interrupts = <0 72 4>;
|
||||||
clocks = <&clock HIX5HD2_MAC1_CLK>;
|
clocks = <&clock HIX5HD2_MAC1_CLK>;
|
||||||
|
@ -117,9 +117,6 @@ static const struct of_device_id of_device_ids[] = {
|
|||||||
{
|
{
|
||||||
.compatible = "fsl,qe",
|
.compatible = "fsl,qe",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
.compatible = "fsl,fman",
|
|
||||||
},
|
|
||||||
/* The following two are for the Freescale hypervisor */
|
/* The following two are for the Freescale hypervisor */
|
||||||
{
|
{
|
||||||
.name = "hypervisor",
|
.name = "hypervisor",
|
||||||
|
@ -166,7 +166,6 @@ source "drivers/net/ethernet/seeq/Kconfig"
|
|||||||
source "drivers/net/ethernet/silan/Kconfig"
|
source "drivers/net/ethernet/silan/Kconfig"
|
||||||
source "drivers/net/ethernet/sis/Kconfig"
|
source "drivers/net/ethernet/sis/Kconfig"
|
||||||
source "drivers/net/ethernet/sfc/Kconfig"
|
source "drivers/net/ethernet/sfc/Kconfig"
|
||||||
source "drivers/net/ethernet/sfc/falcon/Kconfig"
|
|
||||||
source "drivers/net/ethernet/sgi/Kconfig"
|
source "drivers/net/ethernet/sgi/Kconfig"
|
||||||
source "drivers/net/ethernet/smsc/Kconfig"
|
source "drivers/net/ethernet/smsc/Kconfig"
|
||||||
source "drivers/net/ethernet/stmicro/Kconfig"
|
source "drivers/net/ethernet/stmicro/Kconfig"
|
||||||
|
@ -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 = (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 = (u64)devm_ioremap(&pdev->dev, p->agl_prt_ctl_phys,
|
||||||
p->agl_prt_ctl_size);
|
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);
|
spin_lock_init(&p->lock);
|
||||||
|
|
||||||
skb_queue_head_init(&p->tx_list);
|
skb_queue_head_init(&p->tx_list);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
config FSL_FMAN
|
config FSL_FMAN
|
||||||
tristate "FMan support"
|
tristate "FMan support"
|
||||||
depends on FSL_SOC || COMPILE_TEST
|
depends on FSL_SOC || ARCH_LAYERSCAPE || COMPILE_TEST
|
||||||
select GENERIC_ALLOCATOR
|
select GENERIC_ALLOCATOR
|
||||||
select PHYLIB
|
select PHYLIB
|
||||||
default n
|
default n
|
||||||
|
@ -1890,6 +1890,7 @@ static int fman_reset(struct fman *fman)
|
|||||||
|
|
||||||
goto _return;
|
goto _return;
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef CONFIG_PPC
|
||||||
struct device_node *guts_node;
|
struct device_node *guts_node;
|
||||||
struct ccsr_guts __iomem *guts_regs;
|
struct ccsr_guts __iomem *guts_regs;
|
||||||
u32 devdisr2, reg;
|
u32 devdisr2, reg;
|
||||||
@ -1921,6 +1922,7 @@ static int fman_reset(struct fman *fman)
|
|||||||
|
|
||||||
/* Enable all MACs */
|
/* Enable all MACs */
|
||||||
iowrite32be(reg, &guts_regs->devdisr2);
|
iowrite32be(reg, &guts_regs->devdisr2);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Perform FMan reset */
|
/* Perform FMan reset */
|
||||||
iowrite32be(FPM_RSTC_FM_RESET, &fman->fpm_regs->fm_rstc);
|
iowrite32be(FPM_RSTC_FM_RESET, &fman->fpm_regs->fm_rstc);
|
||||||
@ -1932,25 +1934,31 @@ static int fman_reset(struct fman *fman)
|
|||||||
} while (((ioread32be(&fman->fpm_regs->fm_rstc)) &
|
} while (((ioread32be(&fman->fpm_regs->fm_rstc)) &
|
||||||
FPM_RSTC_FM_RESET) && --count);
|
FPM_RSTC_FM_RESET) && --count);
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
|
#ifdef CONFIG_PPC
|
||||||
iounmap(guts_regs);
|
iounmap(guts_regs);
|
||||||
of_node_put(guts_node);
|
of_node_put(guts_node);
|
||||||
|
#endif
|
||||||
err = -EBUSY;
|
err = -EBUSY;
|
||||||
goto _return;
|
goto _return;
|
||||||
}
|
}
|
||||||
|
#ifdef CONFIG_PPC
|
||||||
|
|
||||||
/* Restore devdisr2 value */
|
/* Restore devdisr2 value */
|
||||||
iowrite32be(devdisr2, &guts_regs->devdisr2);
|
iowrite32be(devdisr2, &guts_regs->devdisr2);
|
||||||
|
|
||||||
iounmap(guts_regs);
|
iounmap(guts_regs);
|
||||||
of_node_put(guts_node);
|
of_node_put(guts_node);
|
||||||
|
#endif
|
||||||
|
|
||||||
goto _return;
|
goto _return;
|
||||||
|
|
||||||
|
#ifdef CONFIG_PPC
|
||||||
guts_regs:
|
guts_regs:
|
||||||
of_node_put(guts_node);
|
of_node_put(guts_node);
|
||||||
guts_node:
|
guts_node:
|
||||||
dev_dbg(fman->dev, "%s: Didn't perform FManV3 reset due to Errata A007273!\n",
|
dev_dbg(fman->dev, "%s: Didn't perform FManV3 reset due to Errata A007273!\n",
|
||||||
__func__);
|
__func__);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
_return:
|
_return:
|
||||||
return err;
|
return err;
|
||||||
@ -2868,6 +2876,13 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
|
|||||||
|
|
||||||
fman->dev = &of_dev->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;
|
return fman;
|
||||||
|
|
||||||
fman_node_put:
|
fman_node_put:
|
||||||
|
@ -594,6 +594,7 @@ static const u16 phy2speed[] = {
|
|||||||
[PHY_INTERFACE_MODE_RGMII_RXID] = SPEED_1000,
|
[PHY_INTERFACE_MODE_RGMII_RXID] = SPEED_1000,
|
||||||
[PHY_INTERFACE_MODE_RGMII_TXID] = SPEED_1000,
|
[PHY_INTERFACE_MODE_RGMII_TXID] = SPEED_1000,
|
||||||
[PHY_INTERFACE_MODE_RTBI] = SPEED_1000,
|
[PHY_INTERFACE_MODE_RTBI] = SPEED_1000,
|
||||||
|
[PHY_INTERFACE_MODE_QSGMII] = SPEED_1000,
|
||||||
[PHY_INTERFACE_MODE_XGMII] = SPEED_10000
|
[PHY_INTERFACE_MODE_XGMII] = SPEED_10000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1316,10 +1316,11 @@ static int hix5hd2_dev_remove(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct of_device_id hix5hd2_of_match[] = {
|
static const struct of_device_id hix5hd2_of_match[] = {
|
||||||
{ .compatible = "hisilicon,hisi-gemac-v1", .data = (void *)GEMAC_V1 },
|
{ .compatible = "hisilicon,hisi-gmac-v1", .data = (void *)GEMAC_V1 },
|
||||||
{ .compatible = "hisilicon,hisi-gemac-v2", .data = (void *)GEMAC_V2 },
|
{ .compatible = "hisilicon,hisi-gmac-v2", .data = (void *)GEMAC_V2 },
|
||||||
{ .compatible = "hisilicon,hix5hd2-gemac", .data = (void *)GEMAC_V1 },
|
{ .compatible = "hisilicon,hix5hd2-gmac", .data = (void *)GEMAC_V1 },
|
||||||
{ .compatible = "hisilicon,hi3798cv200-gemac", .data = (void *)GEMAC_V2 },
|
{ .compatible = "hisilicon,hi3798cv200-gmac", .data = (void *)GEMAC_V2 },
|
||||||
|
{ .compatible = "hisilicon,hi3516a-gmac", .data = (void *)GEMAC_V2 },
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1327,7 +1328,7 @@ MODULE_DEVICE_TABLE(of, hix5hd2_of_match);
|
|||||||
|
|
||||||
static struct platform_driver hix5hd2_dev_driver = {
|
static struct platform_driver hix5hd2_dev_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "hisi-gemac",
|
.name = "hisi-gmac",
|
||||||
.of_match_table = hix5hd2_of_match,
|
.of_match_table = hix5hd2_of_match,
|
||||||
},
|
},
|
||||||
.probe = hix5hd2_dev_probe,
|
.probe = hix5hd2_dev_probe,
|
||||||
@ -1338,4 +1339,4 @@ module_platform_driver(hix5hd2_dev_driver);
|
|||||||
|
|
||||||
MODULE_DESCRIPTION("HISILICON Gigabit Ethernet MAC driver");
|
MODULE_DESCRIPTION("HISILICON Gigabit Ethernet MAC driver");
|
||||||
MODULE_LICENSE("GPL v2");
|
MODULE_LICENSE("GPL v2");
|
||||||
MODULE_ALIAS("platform:hisi-gemac");
|
MODULE_ALIAS("platform:hisi-gmac");
|
||||||
|
@ -75,7 +75,7 @@ static void mlx5_fc_stats_insert(struct rb_root *root, struct mlx5_fc *counter)
|
|||||||
struct rb_node *parent = NULL;
|
struct rb_node *parent = NULL;
|
||||||
|
|
||||||
while (*new) {
|
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;
|
int result = counter->id - this->id;
|
||||||
|
|
||||||
parent = *new;
|
parent = *new;
|
||||||
|
@ -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
|
config SFC
|
||||||
tristate "Solarflare SFC9000/SFC9100-family support"
|
tristate "Solarflare SFC9000/SFC9100-family support"
|
||||||
depends on PCI
|
depends on PCI
|
||||||
@ -44,3 +61,7 @@ config SFC_MCDI_LOGGING
|
|||||||
Driver-Interface) commands and responses, allowing debugging of
|
Driver-Interface) commands and responses, allowing debugging of
|
||||||
driver/firmware interaction. The tracing is actually enabled by
|
driver/firmware interaction. The tracing is actually enabled by
|
||||||
a sysfs file 'mcdi_logging' under the PCI device.
|
a sysfs file 'mcdi_logging' under the PCI device.
|
||||||
|
|
||||||
|
source "drivers/net/ethernet/sfc/falcon/Kconfig"
|
||||||
|
|
||||||
|
endif # NET_VENDOR_SOLARFLARE
|
||||||
|
@ -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
|
* descriptors for the same frame has to be set before, to
|
||||||
* avoid race condition.
|
* avoid race condition.
|
||||||
*/
|
*/
|
||||||
wmb();
|
dma_wmb();
|
||||||
|
|
||||||
p->des3 = cpu_to_le32(tdes3);
|
p->des3 = cpu_to_le32(tdes3);
|
||||||
}
|
}
|
||||||
@ -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
|
* descriptors for the same frame has to be set before, to
|
||||||
* avoid race condition.
|
* avoid race condition.
|
||||||
*/
|
*/
|
||||||
wmb();
|
dma_wmb();
|
||||||
|
|
||||||
p->des3 = cpu_to_le32(tdes3);
|
p->des3 = cpu_to_le32(tdes3);
|
||||||
}
|
}
|
||||||
|
@ -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
|
* descriptors for the same frame has to be set before, to
|
||||||
* avoid race condition.
|
* avoid race condition.
|
||||||
*/
|
*/
|
||||||
wmb();
|
dma_wmb();
|
||||||
|
|
||||||
p->des0 = cpu_to_le32(tdes0);
|
p->des0 = cpu_to_le32(tdes0);
|
||||||
}
|
}
|
||||||
|
@ -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
|
* descriptor and then barrier is needed to make sure that
|
||||||
* all is coherent before granting the DMA engine.
|
* all is coherent before granting the DMA engine.
|
||||||
*/
|
*/
|
||||||
smp_wmb();
|
dma_wmb();
|
||||||
|
|
||||||
if (netif_msg_pktdata(priv)) {
|
if (netif_msg_pktdata(priv)) {
|
||||||
pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n",
|
pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n",
|
||||||
@ -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
|
* descriptor and then barrier is needed to make sure that
|
||||||
* all is coherent before granting the DMA engine.
|
* all is coherent before granting the DMA engine.
|
||||||
*/
|
*/
|
||||||
smp_wmb();
|
dma_wmb();
|
||||||
}
|
}
|
||||||
|
|
||||||
netdev_sent_queue(dev, skb->len);
|
netdev_sent_queue(dev, skb->len);
|
||||||
@ -2443,14 +2443,14 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv)
|
|||||||
netif_dbg(priv, rx_status, priv->dev,
|
netif_dbg(priv, rx_status, priv->dev,
|
||||||
"refill entry #%d\n", entry);
|
"refill entry #%d\n", entry);
|
||||||
}
|
}
|
||||||
wmb();
|
dma_wmb();
|
||||||
|
|
||||||
if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00))
|
if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00))
|
||||||
priv->hw->desc->init_rx_desc(p, priv->use_riwt, 0, 0);
|
priv->hw->desc->init_rx_desc(p, priv->use_riwt, 0, 0);
|
||||||
else
|
else
|
||||||
priv->hw->desc->set_rx_owner(p);
|
priv->hw->desc->set_rx_owner(p);
|
||||||
|
|
||||||
wmb();
|
dma_wmb();
|
||||||
|
|
||||||
entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE);
|
entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,7 @@
|
|||||||
|
|
||||||
/* offset relative to base of XGBE_SS_REG_INDEX */
|
/* offset relative to base of XGBE_SS_REG_INDEX */
|
||||||
#define XGBE10_SGMII_MODULE_OFFSET 0x100
|
#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 */
|
/* offset relative to base of XGBE_SM_REG_INDEX */
|
||||||
#define XGBE10_HOST_PORT_OFFSET 0x34
|
#define XGBE10_HOST_PORT_OFFSET 0x34
|
||||||
#define XGBE10_SLAVE_PORT_OFFSET 0x64
|
#define XGBE10_SLAVE_PORT_OFFSET 0x64
|
||||||
@ -1746,6 +1747,17 @@ static void keystone_set_msglevel(struct net_device *ndev, u32 value)
|
|||||||
netcp->msg_enable = 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,
|
static void keystone_get_stat_strings(struct net_device *ndev,
|
||||||
uint32_t stringset, uint8_t *data)
|
uint32_t stringset, uint8_t *data)
|
||||||
{
|
{
|
||||||
@ -1754,7 +1766,7 @@ static void keystone_get_stat_strings(struct net_device *ndev,
|
|||||||
struct gbe_priv *gbe_dev;
|
struct gbe_priv *gbe_dev;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
|
gbe_intf = keystone_get_intf_data(netcp);
|
||||||
if (!gbe_intf)
|
if (!gbe_intf)
|
||||||
return;
|
return;
|
||||||
gbe_dev = gbe_intf->gbe_dev;
|
gbe_dev = gbe_intf->gbe_dev;
|
||||||
@ -1778,7 +1790,7 @@ static int keystone_get_sset_count(struct net_device *ndev, int stringset)
|
|||||||
struct gbe_intf *gbe_intf;
|
struct gbe_intf *gbe_intf;
|
||||||
struct gbe_priv *gbe_dev;
|
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)
|
if (!gbe_intf)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
gbe_dev = gbe_intf->gbe_dev;
|
gbe_dev = gbe_intf->gbe_dev;
|
||||||
@ -1896,7 +1908,7 @@ static void keystone_get_ethtool_stats(struct net_device *ndev,
|
|||||||
struct gbe_intf *gbe_intf;
|
struct gbe_intf *gbe_intf;
|
||||||
struct gbe_priv *gbe_dev;
|
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)
|
if (!gbe_intf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1920,7 +1932,7 @@ static int keystone_get_link_ksettings(struct net_device *ndev,
|
|||||||
if (!phy)
|
if (!phy)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
|
gbe_intf = keystone_get_intf_data(netcp);
|
||||||
if (!gbe_intf)
|
if (!gbe_intf)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -1953,7 +1965,7 @@ static int keystone_set_link_ksettings(struct net_device *ndev,
|
|||||||
if (!phy)
|
if (!phy)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
|
gbe_intf = keystone_get_intf_data(netcp);
|
||||||
if (!gbe_intf)
|
if (!gbe_intf)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -2311,7 +2323,7 @@ static void gbe_init_host_port(struct gbe_priv *priv)
|
|||||||
int bypass_en = 1;
|
int bypass_en = 1;
|
||||||
|
|
||||||
/* Host Tx Pri */
|
/* 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,
|
writel(HOST_TX_PRI_MAP_DEFAULT,
|
||||||
GBE_REG_ADDR(priv, host_port_regs, tx_pri_map));
|
GBE_REG_ADDR(priv, host_port_regs, tx_pri_map));
|
||||||
|
|
||||||
|
@ -1187,8 +1187,8 @@ static int genphy_config_advert(struct phy_device *phydev)
|
|||||||
*/
|
*/
|
||||||
static int genphy_config_eee_advert(struct phy_device *phydev)
|
static int genphy_config_eee_advert(struct phy_device *phydev)
|
||||||
{
|
{
|
||||||
u32 broken = phydev->eee_broken_modes;
|
int broken = phydev->eee_broken_modes;
|
||||||
u32 old_adv, adv;
|
int old_adv, adv;
|
||||||
|
|
||||||
/* Nothing to disable */
|
/* Nothing to disable */
|
||||||
if (!broken)
|
if (!broken)
|
||||||
@ -1665,7 +1665,7 @@ static void of_set_phy_supported(struct phy_device *phydev)
|
|||||||
static void of_set_phy_eee_broken(struct phy_device *phydev)
|
static void of_set_phy_eee_broken(struct phy_device *phydev)
|
||||||
{
|
{
|
||||||
struct device_node *node = phydev->mdio.dev.of_node;
|
struct device_node *node = phydev->mdio.dev.of_node;
|
||||||
u32 broken;
|
u32 broken = 0;
|
||||||
|
|
||||||
if (!IS_ENABLED(CONFIG_OF_MDIO))
|
if (!IS_ENABLED(CONFIG_OF_MDIO))
|
||||||
return;
|
return;
|
||||||
@ -1673,8 +1673,20 @@ static void of_set_phy_eee_broken(struct phy_device *phydev)
|
|||||||
if (!node)
|
if (!node)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!of_property_read_u32(node, "eee-broken-modes", &broken))
|
if (of_property_read_bool(node, "eee-broken-100tx"))
|
||||||
phydev->eee_broken_modes = broken;
|
broken |= MDIO_EEE_100TX;
|
||||||
|
if (of_property_read_bool(node, "eee-broken-1000t"))
|
||||||
|
broken |= MDIO_EEE_1000T;
|
||||||
|
if (of_property_read_bool(node, "eee-broken-10gt"))
|
||||||
|
broken |= MDIO_EEE_10GT;
|
||||||
|
if (of_property_read_bool(node, "eee-broken-1000kx"))
|
||||||
|
broken |= MDIO_EEE_1000KX;
|
||||||
|
if (of_property_read_bool(node, "eee-broken-10gkx4"))
|
||||||
|
broken |= MDIO_EEE_10GKX4;
|
||||||
|
if (of_property_read_bool(node, "eee-broken-10gkr"))
|
||||||
|
broken |= MDIO_EEE_10GKR;
|
||||||
|
|
||||||
|
phydev->eee_broken_modes = broken;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
* This header provides generic constants for ethernet MDIO bindings
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _DT_BINDINGS_NET_MDIO_H
|
|
||||||
#define _DT_BINDINGS_NET_MDIO_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* EEE capability Advertisement
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MDIO_EEE_100TX 0x0002 /* 100TX EEE cap */
|
|
||||||
#define MDIO_EEE_1000T 0x0004 /* 1000T EEE cap */
|
|
||||||
#define MDIO_EEE_10GT 0x0008 /* 10GT EEE cap */
|
|
||||||
#define MDIO_EEE_1000KX 0x0010 /* 1000KX EEE cap */
|
|
||||||
#define MDIO_EEE_10GKX4 0x0020 /* 10G KX4 EEE cap */
|
|
||||||
#define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */
|
|
||||||
|
|
||||||
#endif
|
|
@ -958,7 +958,7 @@ static int __ip_append_data(struct sock *sk,
|
|||||||
csummode = CHECKSUM_PARTIAL;
|
csummode = CHECKSUM_PARTIAL;
|
||||||
|
|
||||||
cork->length += length;
|
cork->length += length;
|
||||||
if (((length > mtu) || (skb && skb_is_gso(skb))) &&
|
if ((((length + fragheaderlen) > mtu) || (skb && skb_is_gso(skb))) &&
|
||||||
(sk->sk_protocol == IPPROTO_UDP) &&
|
(sk->sk_protocol == IPPROTO_UDP) &&
|
||||||
(rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len &&
|
(rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len &&
|
||||||
(sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) {
|
(sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) {
|
||||||
|
@ -2195,6 +2195,7 @@ static int validate_set(const struct nlattr *a,
|
|||||||
case OVS_KEY_ATTR_ETHERNET:
|
case OVS_KEY_ATTR_ETHERNET:
|
||||||
if (mac_proto != MAC_PROTO_ETHERNET)
|
if (mac_proto != MAC_PROTO_ETHERNET)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
break;
|
||||||
|
|
||||||
case OVS_KEY_ATTR_TUNNEL:
|
case OVS_KEY_ATTR_TUNNEL:
|
||||||
if (masked)
|
if (masked)
|
||||||
|
@ -135,7 +135,7 @@ void rds_rdma_drop_keys(struct rds_sock *rs)
|
|||||||
/* Release any MRs associated with this socket */
|
/* Release any MRs associated with this socket */
|
||||||
spin_lock_irqsave(&rs->rs_rdma_lock, flags);
|
spin_lock_irqsave(&rs->rs_rdma_lock, flags);
|
||||||
while ((node = rb_first(&rs->rs_rdma_keys))) {
|
while ((node = rb_first(&rs->rs_rdma_keys))) {
|
||||||
mr = container_of(node, struct rds_mr, r_rb_node);
|
mr = rb_entry(node, struct rds_mr, r_rb_node);
|
||||||
if (mr->r_trans == rs->rs_transport)
|
if (mr->r_trans == rs->rs_transport)
|
||||||
mr->r_invalidate = 0;
|
mr->r_invalidate = 0;
|
||||||
rb_erase(&mr->r_rb_node, &rs->rs_rdma_keys);
|
rb_erase(&mr->r_rb_node, &rs->rs_rdma_keys);
|
||||||
|
@ -136,7 +136,7 @@ static void fq_flow_set_throttled(struct fq_sched_data *q, struct fq_flow *f)
|
|||||||
struct fq_flow *aux;
|
struct fq_flow *aux;
|
||||||
|
|
||||||
parent = *p;
|
parent = *p;
|
||||||
aux = container_of(parent, struct fq_flow, rate_node);
|
aux = rb_entry(parent, struct fq_flow, rate_node);
|
||||||
if (f->time_next_packet >= aux->time_next_packet)
|
if (f->time_next_packet >= aux->time_next_packet)
|
||||||
p = &parent->rb_right;
|
p = &parent->rb_right;
|
||||||
else
|
else
|
||||||
@ -188,7 +188,7 @@ static void fq_gc(struct fq_sched_data *q,
|
|||||||
while (*p) {
|
while (*p) {
|
||||||
parent = *p;
|
parent = *p;
|
||||||
|
|
||||||
f = container_of(parent, struct fq_flow, fq_node);
|
f = rb_entry(parent, struct fq_flow, fq_node);
|
||||||
if (f->sk == sk)
|
if (f->sk == sk)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ static struct fq_flow *fq_classify(struct sk_buff *skb, struct fq_sched_data *q)
|
|||||||
while (*p) {
|
while (*p) {
|
||||||
parent = *p;
|
parent = *p;
|
||||||
|
|
||||||
f = container_of(parent, struct fq_flow, fq_node);
|
f = rb_entry(parent, struct fq_flow, fq_node);
|
||||||
if (f->sk == sk) {
|
if (f->sk == sk) {
|
||||||
/* socket might have been reallocated, so check
|
/* socket might have been reallocated, so check
|
||||||
* if its sk_hash is the same.
|
* if its sk_hash is the same.
|
||||||
@ -424,7 +424,7 @@ static void fq_check_throttled(struct fq_sched_data *q, u64 now)
|
|||||||
|
|
||||||
q->time_next_delayed_flow = ~0ULL;
|
q->time_next_delayed_flow = ~0ULL;
|
||||||
while ((p = rb_first(&q->delayed)) != NULL) {
|
while ((p = rb_first(&q->delayed)) != NULL) {
|
||||||
struct fq_flow *f = container_of(p, struct fq_flow, rate_node);
|
struct fq_flow *f = rb_entry(p, struct fq_flow, rate_node);
|
||||||
|
|
||||||
if (f->time_next_packet > now) {
|
if (f->time_next_packet > now) {
|
||||||
q->time_next_delayed_flow = f->time_next_packet;
|
q->time_next_delayed_flow = f->time_next_packet;
|
||||||
@ -563,7 +563,7 @@ static void fq_reset(struct Qdisc *sch)
|
|||||||
for (idx = 0; idx < (1U << q->fq_trees_log); idx++) {
|
for (idx = 0; idx < (1U << q->fq_trees_log); idx++) {
|
||||||
root = &q->fq_root[idx];
|
root = &q->fq_root[idx];
|
||||||
while ((p = rb_first(root)) != NULL) {
|
while ((p = rb_first(root)) != NULL) {
|
||||||
f = container_of(p, struct fq_flow, fq_node);
|
f = rb_entry(p, struct fq_flow, fq_node);
|
||||||
rb_erase(p, root);
|
rb_erase(p, root);
|
||||||
|
|
||||||
fq_flow_purge(f);
|
fq_flow_purge(f);
|
||||||
@ -593,7 +593,7 @@ static void fq_rehash(struct fq_sched_data *q,
|
|||||||
oroot = &old_array[idx];
|
oroot = &old_array[idx];
|
||||||
while ((op = rb_first(oroot)) != NULL) {
|
while ((op = rb_first(oroot)) != NULL) {
|
||||||
rb_erase(op, oroot);
|
rb_erase(op, oroot);
|
||||||
of = container_of(op, struct fq_flow, fq_node);
|
of = rb_entry(op, struct fq_flow, fq_node);
|
||||||
if (fq_gc_candidate(of)) {
|
if (fq_gc_candidate(of)) {
|
||||||
fcnt++;
|
fcnt++;
|
||||||
kmem_cache_free(fq_flow_cachep, of);
|
kmem_cache_free(fq_flow_cachep, of);
|
||||||
@ -606,7 +606,7 @@ static void fq_rehash(struct fq_sched_data *q,
|
|||||||
while (*np) {
|
while (*np) {
|
||||||
parent = *np;
|
parent = *np;
|
||||||
|
|
||||||
nf = container_of(parent, struct fq_flow, fq_node);
|
nf = rb_entry(parent, struct fq_flow, fq_node);
|
||||||
BUG_ON(nf->sk == of->sk);
|
BUG_ON(nf->sk == of->sk);
|
||||||
|
|
||||||
if (nf->sk > of->sk)
|
if (nf->sk > of->sk)
|
||||||
|
@ -152,7 +152,7 @@ struct netem_skb_cb {
|
|||||||
|
|
||||||
static struct sk_buff *netem_rb_to_skb(struct rb_node *rb)
|
static struct sk_buff *netem_rb_to_skb(struct rb_node *rb)
|
||||||
{
|
{
|
||||||
return container_of(rb, struct sk_buff, rbnode);
|
return rb_entry(rb, struct sk_buff, rbnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb)
|
static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb)
|
||||||
|
@ -292,6 +292,8 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
|
|||||||
}
|
}
|
||||||
|
|
||||||
af->from_addr_param(&addr, rawaddr, htons(port), 0);
|
af->from_addr_param(&addr, rawaddr, htons(port), 0);
|
||||||
|
if (sctp_bind_addr_state(bp, &addr) != -1)
|
||||||
|
goto next;
|
||||||
retval = sctp_add_bind_addr(bp, &addr, sizeof(addr),
|
retval = sctp_add_bind_addr(bp, &addr, sizeof(addr),
|
||||||
SCTP_ADDR_SRC, gfp);
|
SCTP_ADDR_SRC, gfp);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
@ -300,6 +302,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
next:
|
||||||
len = ntohs(param->length);
|
len = ntohs(param->length);
|
||||||
addrs_len -= len;
|
addrs_len -= len;
|
||||||
raw_addr_list += len;
|
raw_addr_list += len;
|
||||||
|
@ -205,26 +205,30 @@ int sctp_copy_local_addr_list(struct net *net, struct sctp_bind_addr *bp,
|
|||||||
list_for_each_entry_rcu(addr, &net->sctp.local_addr_list, list) {
|
list_for_each_entry_rcu(addr, &net->sctp.local_addr_list, list) {
|
||||||
if (!addr->valid)
|
if (!addr->valid)
|
||||||
continue;
|
continue;
|
||||||
if (sctp_in_scope(net, &addr->a, scope)) {
|
if (!sctp_in_scope(net, &addr->a, scope))
|
||||||
/* Now that the address is in scope, check to see if
|
continue;
|
||||||
* the address type is really supported by the local
|
|
||||||
* sock as well as the remote peer.
|
/* Now that the address is in scope, check to see if
|
||||||
*/
|
* the address type is really supported by the local
|
||||||
if ((((AF_INET == addr->a.sa.sa_family) &&
|
* sock as well as the remote peer.
|
||||||
(copy_flags & SCTP_ADDR4_PEERSUPP))) ||
|
*/
|
||||||
(((AF_INET6 == addr->a.sa.sa_family) &&
|
if (addr->a.sa.sa_family == AF_INET &&
|
||||||
(copy_flags & SCTP_ADDR6_ALLOWED) &&
|
!(copy_flags & SCTP_ADDR4_PEERSUPP))
|
||||||
(copy_flags & SCTP_ADDR6_PEERSUPP)))) {
|
continue;
|
||||||
error = sctp_add_bind_addr(bp, &addr->a,
|
if (addr->a.sa.sa_family == AF_INET6 &&
|
||||||
sizeof(addr->a),
|
(!(copy_flags & SCTP_ADDR6_ALLOWED) ||
|
||||||
SCTP_ADDR_SRC, GFP_ATOMIC);
|
!(copy_flags & SCTP_ADDR6_PEERSUPP)))
|
||||||
if (error)
|
continue;
|
||||||
goto end_copy;
|
|
||||||
}
|
if (sctp_bind_addr_state(bp, &addr->a) != -1)
|
||||||
}
|
continue;
|
||||||
|
|
||||||
|
error = sctp_add_bind_addr(bp, &addr->a, sizeof(addr->a),
|
||||||
|
SCTP_ADDR_SRC, GFP_ATOMIC);
|
||||||
|
if (error)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
end_copy:
|
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user