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 from David Miller:

 1) Don't use uninitialized data in IPVS, from Dan Carpenter.

 2) conntrack race fixes from Pablo Neira Ayuso.

 3) Fix TX hangs with i40e, from Jesse Brandeburg.

 4) Fix budget return from poll calls in dnet and alx, from Eric
    Dumazet.

 5) Fix bugus "if (unlikely(x) < 0)" test in AF_PACKET, from Christoph
    Jaeger.

 6) Fix bug introduced by conversion to list_head in TIPC retransmit
    code, from Jon Paul Maloy.

 7) Don't use GFP_NOIO under spinlock in USB kaweth driver, from Alexey
    Khoroshilov.

 8) Fix bridge build with INET disabled, from Arnd Bergmann.

 9) Fix netlink array overrun for PROBE attributes in openvswitch, from
    Thomas Graf.

10) Don't hold spinlock across synchronize_irq() in tg3 driver, from
    Prashant Sreedharan.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (44 commits)
  tg3: Release tp->lock before invoking synchronize_irq()
  tg3: tg3_reset_task() needs to use rtnl_lock to synchronize
  tg3: tg3_timer() should grab tp->lock before checking for tp->irq_sync
  team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin
  openvswitch: packet messages need their own probe attribtue
  i40e: adds FCoE configure option
  cxgb4vf: Fix queue allocation for 40G adapter
  netdevice: Add missing parentheses in macro
  bridge: only provide proxy ARP when CONFIG_INET is enabled
  neighbour: fix base_reachable_time(_ms) not effective immediatly when changed
  net: fec: fix MDIO bus assignement for dual fec SoC's
  xen-netfront: use different locks for Rx and Tx stats
  drivers: net: cpsw: fix multicast flush in dual emac mode
  cxgb4vf: Initialize mdio_addr before using it
  net: Corrected the comment describing the ndo operations to reflect the actual prototype for couple of operations
  usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()
  MAINTAINERS: add me as ibmveth maintainer
  tipc: fix bug in broadcast retransmit code
  update ip-sysctl.txt documentation (v2)
  net/at91_ether: prepare and unprepare clock
  ...
  • Loading branch information
Linus Torvalds committed Jan 14, 2015
2 parents 48c53db + c637dbc commit a6391a9
Show file tree
Hide file tree
Showing 49 changed files with 419 additions and 175 deletions.
2 changes: 2 additions & 0 deletions Documentation/networking/ip-sysctl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ fwmark_reflect - BOOLEAN
route/max_size - INTEGER
Maximum number of routes allowed in the kernel. Increase
this when using large numbers of interfaces and/or routes.
From linux kernel 3.6 onwards, this is deprecated for ipv4
as route cache is no longer used.

neigh/default/gc_thresh1 - INTEGER
Minimum number of entries to keep. Garbage collector will not
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4749,7 +4749,7 @@ S: Supported
F: drivers/scsi/ipr.*

IBM Power Virtual Ethernet Device Driver
M: Santiago Leon <santil@linux.vnet.ibm.com>
M: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
L: netdev@vger.kernel.org
S: Supported
F: drivers/net/ethernet/ibm/ibmveth.*
Expand Down
15 changes: 15 additions & 0 deletions arch/arm/boot/dts/imx6sx-sdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,28 @@
pinctrl-0 = <&pinctrl_enet1>;
phy-supply = <&reg_enet_3v3>;
phy-mode = "rgmii";
phy-handle = <&ethphy1>;
status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;

ethphy1: ethernet-phy@0 {
reg = <0>;
};

ethphy2: ethernet-phy@1 {
reg = <1>;
};
};
};

&fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet2>;
phy-mode = "rgmii";
phy-handle = <&ethphy2>;
status = "okay";
};

Expand Down
15 changes: 15 additions & 0 deletions arch/arm/boot/dts/vf610-twr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,28 @@

&fec0 {
phy-mode = "rmii";
phy-handle = <&ethphy0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec0>;
status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;

ethphy0: ethernet-phy@0 {
reg = <0>;
};

ethphy1: ethernet-phy@1 {
reg = <1>;
};
};
};

&fec1 {
phy-mode = "rmii";
phy-handle = <&ethphy1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec1>;
status = "okay";
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/hardware/eicon/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -4880,7 +4880,7 @@ static void sig_ind(PLCI *plci)
byte SS_Ind[] = "\x05\x02\x00\x02\x00\x00"; /* Hold_Ind struct*/
byte CF_Ind[] = "\x09\x02\x00\x06\x00\x00\x00\x00\x00\x00";
byte Interr_Err_Ind[] = "\x0a\x02\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
byte CONF_Ind[] = "\x09\x16\x00\x06\x00\x00\0x00\0x00\0x00\0x00";
byte CONF_Ind[] = "\x09\x16\x00\x06\x00\x00\x00\x00\x00\x00";
byte force_mt_info = false;
byte dir;
dword d;
Expand Down
24 changes: 13 additions & 11 deletions drivers/net/ethernet/atheros/alx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,16 @@ static void alx_schedule_reset(struct alx_priv *alx)
schedule_work(&alx->reset_wk);
}

static bool alx_clean_rx_irq(struct alx_priv *alx, int budget)
static int alx_clean_rx_irq(struct alx_priv *alx, int budget)
{
struct alx_rx_queue *rxq = &alx->rxq;
struct alx_rrd *rrd;
struct alx_buffer *rxb;
struct sk_buff *skb;
u16 length, rfd_cleaned = 0;
int work = 0;

while (budget > 0) {
while (work < budget) {
rrd = &rxq->rrd[rxq->rrd_read_idx];
if (!(rrd->word3 & cpu_to_le32(1 << RRD_UPDATED_SHIFT)))
break;
Expand All @@ -203,7 +204,7 @@ static bool alx_clean_rx_irq(struct alx_priv *alx, int budget)
ALX_GET_FIELD(le32_to_cpu(rrd->word0),
RRD_NOR) != 1) {
alx_schedule_reset(alx);
return 0;
return work;
}

rxb = &rxq->bufs[rxq->read_idx];
Expand Down Expand Up @@ -243,7 +244,7 @@ static bool alx_clean_rx_irq(struct alx_priv *alx, int budget)
}

napi_gro_receive(&alx->napi, skb);
budget--;
work++;

next_pkt:
if (++rxq->read_idx == alx->rx_ringsz)
Expand All @@ -258,21 +259,22 @@ static bool alx_clean_rx_irq(struct alx_priv *alx, int budget)
if (rfd_cleaned)
alx_refill_rx_ring(alx, GFP_ATOMIC);

return budget > 0;
return work;
}

static int alx_poll(struct napi_struct *napi, int budget)
{
struct alx_priv *alx = container_of(napi, struct alx_priv, napi);
struct alx_hw *hw = &alx->hw;
bool complete = true;
unsigned long flags;
bool tx_complete;
int work;

complete = alx_clean_tx_irq(alx) &&
alx_clean_rx_irq(alx, budget);
tx_complete = alx_clean_tx_irq(alx);
work = alx_clean_rx_irq(alx, budget);

if (!complete)
return 1;
if (!tx_complete || work == budget)
return budget;

napi_complete(&alx->napi);

Expand All @@ -284,7 +286,7 @@ static int alx_poll(struct napi_struct *napi, int budget)

alx_post_write(hw);

return 0;
return work;
}

static irqreturn_t alx_intr_handle(struct alx_priv *alx, u32 intr)
Expand Down
23 changes: 20 additions & 3 deletions drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -7413,6 +7413,8 @@ static inline void tg3_netif_start(struct tg3 *tp)
}

static void tg3_irq_quiesce(struct tg3 *tp)
__releases(tp->lock)
__acquires(tp->lock)
{
int i;

Expand All @@ -7421,8 +7423,12 @@ static void tg3_irq_quiesce(struct tg3 *tp)
tp->irq_sync = 1;
smp_mb();

spin_unlock_bh(&tp->lock);

for (i = 0; i < tp->irq_cnt; i++)
synchronize_irq(tp->napi[i].irq_vec);

spin_lock_bh(&tp->lock);
}

/* Fully shutdown all tg3 driver activity elsewhere in the system.
Expand Down Expand Up @@ -9018,6 +9024,8 @@ static void tg3_restore_clk(struct tg3 *tp)

/* tp->lock is held. */
static int tg3_chip_reset(struct tg3 *tp)
__releases(tp->lock)
__acquires(tp->lock)
{
u32 val;
void (*write_op)(struct tg3 *, u32, u32);
Expand Down Expand Up @@ -9073,9 +9081,13 @@ static int tg3_chip_reset(struct tg3 *tp)
}
smp_mb();

tg3_full_unlock(tp);

for (i = 0; i < tp->irq_cnt; i++)
synchronize_irq(tp->napi[i].irq_vec);

tg3_full_lock(tp, 0);

if (tg3_asic_rev(tp) == ASIC_REV_57780) {
val = tr32(TG3_PCIE_LNKCTL) & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN;
tw32(TG3_PCIE_LNKCTL, val | TG3_PCIE_LNKCTL_L1_PLL_PD_DIS);
Expand Down Expand Up @@ -10903,11 +10915,13 @@ static void tg3_timer(unsigned long __opaque)
{
struct tg3 *tp = (struct tg3 *) __opaque;

if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING))
goto restart_timer;

spin_lock(&tp->lock);

if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING)) {
spin_unlock(&tp->lock);
goto restart_timer;
}

if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
tg3_flag(tp, 57765_CLASS))
tg3_chk_missed_msi(tp);
Expand Down Expand Up @@ -11101,11 +11115,13 @@ static void tg3_reset_task(struct work_struct *work)
struct tg3 *tp = container_of(work, struct tg3, reset_task);
int err;

rtnl_lock();
tg3_full_lock(tp, 0);

if (!netif_running(tp->dev)) {
tg3_flag_clear(tp, RESET_TASK_PENDING);
tg3_full_unlock(tp);
rtnl_unlock();
return;
}

Expand Down Expand Up @@ -11138,6 +11154,7 @@ static void tg3_reset_task(struct work_struct *work)
tg3_phy_start(tp);

tg3_flag_clear(tp, RESET_TASK_PENDING);
rtnl_unlock();
}

static int tg3_request_irq(struct tg3 *tp, int irq_num)
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/ethernet/cadence/at91_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
res = PTR_ERR(lp->pclk);
goto err_free_dev;
}
clk_enable(lp->pclk);
clk_prepare_enable(lp->pclk);

lp->hclk = ERR_PTR(-ENOENT);
lp->tx_clk = ERR_PTR(-ENOENT);
Expand Down Expand Up @@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
err_out_unregister_netdev:
unregister_netdev(dev);
err_disable_clock:
clk_disable(lp->pclk);
clk_disable_unprepare(lp->pclk);
err_free_dev:
free_netdev(dev);
return res;
Expand All @@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
kfree(lp->mii_bus->irq);
mdiobus_free(lp->mii_bus);
unregister_netdev(dev);
clk_disable(lp->pclk);
clk_disable_unprepare(lp->pclk);
free_netdev(dev);

return 0;
Expand All @@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
netif_stop_queue(net_dev);
netif_device_detach(net_dev);

clk_disable(lp->pclk);
clk_disable_unprepare(lp->pclk);
}
return 0;
}
Expand All @@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
struct macb *lp = netdev_priv(net_dev);

if (netif_running(net_dev)) {
clk_enable(lp->pclk);
clk_prepare_enable(lp->pclk);

netif_device_attach(net_dev);
netif_start_queue(net_dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2430,7 +2430,7 @@ static void cfg_queues(struct adapter *adapter)
*/
n10g = 0;
for_each_port(adapter, pidx)
n10g += is_10g_port(&adap2pinfo(adapter, pidx)->link_cfg);
n10g += is_x_10g_port(&adap2pinfo(adapter, pidx)->link_cfg);

/*
* We default to 1 queue per non-10G port and up to # of cores queues
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ int t4vf_port_init(struct adapter *adapter, int pidx)
return v;

v = be32_to_cpu(port_rpl.u.info.lstatus_to_modtype);
pi->mdio_addr = (v & FW_PORT_CMD_MDIOCAP_F) ?
FW_PORT_CMD_MDIOADDR_G(v) : -1;
pi->port_type = FW_PORT_CMD_PTYPE_G(v);
pi->mod_type = FW_PORT_MOD_TYPE_NA;

Expand Down
18 changes: 5 additions & 13 deletions drivers/net/ethernet/dnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,8 @@ static int dnet_poll(struct napi_struct *napi, int budget)
* break out of while loop if there are no more
* packets waiting
*/
if (!(dnet_readl(bp, RX_FIFO_WCNT) >> 16)) {
napi_complete(napi);
int_enable = dnet_readl(bp, INTR_ENB);
int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF;
dnet_writel(bp, int_enable, INTR_ENB);
return 0;
}
if (!(dnet_readl(bp, RX_FIFO_WCNT) >> 16))
break;

cmd_word = dnet_readl(bp, RX_LEN_FIFO);
pkt_len = cmd_word & 0xFFFF;
Expand Down Expand Up @@ -433,20 +428,17 @@ static int dnet_poll(struct napi_struct *napi, int budget)
"size %u.\n", dev->name, pkt_len);
}

budget -= npackets;

if (npackets < budget) {
/* We processed all packets available. Tell NAPI it can
* stop polling then re-enable rx interrupts */
* stop polling then re-enable rx interrupts.
*/
napi_complete(napi);
int_enable = dnet_readl(bp, INTR_ENB);
int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF;
dnet_writel(bp, int_enable, INTR_ENB);
return 0;
}

/* There are still packets waiting */
return 1;
return npackets;
}

static irqreturn_t dnet_interrupt(int irq, void *dev_id)
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/freescale/fec.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ struct bufdesc_ex {
* (40ns * 6).
*/
#define FEC_QUIRK_BUG_CAPTURE (1 << 10)
/* Controller has only one MDIO bus */
#define FEC_QUIRK_SINGLE_MDIO (1 << 11)

struct fec_enet_priv_tx_q {
int index;
Expand Down
Loading

0 comments on commit a6391a9

Please sign in to comment.