Skip to content

Commit a878764

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) There was a simplification in the ipv6 ndisc packet sending attempted here, which avoided using memory accounting on the per-netns ndisc socket for sending NDISC packets. It did fix some important issues, but it causes regressions so it gets reverted here too. Specifically, the problem with this change is that the IPV6 output path really depends upon there being a valid skb->sk attached. The reason we want to do this change in some form when we figure out how to do it right, is that if a device goes down the ndisc_sk socket send queue will fill up and block NDISC packets that we want to send to other devices too. That's really bad behavior. Hopefully Thomas can come up with a better version of this change. 2) Fix a severe TCP performance regression by reverting a change made to dev_pick_tx() quite some time ago. From Eric Dumazet. 3) TIPC returns wrongly signed error codes, fix from Erik Hugne. 4) Fix OOPS when doing IPSEC over ipv4 tunnels due to orphaning the skb->sk too early. Fix from Li Hongjun. 5) RAW ipv4 sockets can use the wrong routing key during lookup, from Chris Clark. 6) Similar to raspberrypi#1 revert an older change that tried to use plain alloc_skb() for SYN/ACK TCP packets, this broke the netfilter owner mark which needs to see the skb->sk for such frames. From Phil Oester. 7) BNX2x driver bug fixes from Ariel Elior and Yuval Mintz, specifically in the handling of virtual functions. 8) IPSEC path error propagations to sockets is not done properly when we have v4 in v6, and v6 in v4 type rules. Fix from Hannes Frederic Sowa. 9) Fix missing channel context release in mac80211, from Johannes Berg. 10) Fix network namespace handing wrt. SCM_RIGHTS, from Andy Lutomirski. 11) Fix usage of bogus NAPI weight in jme, netxen, and ps3_gelic drivers. From Michal Schmidt. 12) Hopefully a complete and correct fix for the genetlink dump locking and module reference counting. From Pravin B Shelar. 13) sk_busy_loop() must do a cpu_relax(), from Eliezer Tamir. 14) Fix handling of timestamp offset when restoring a snapshotted TCP socket. From Andrew Vagin. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (44 commits) net: fec: fix time stamping logic after napi conversion net: bridge: convert MLDv2 Query MRC into msecs_to_jiffies for max_delay mISDN: return -EINVAL on error in dsp_control_req() net: revert 8728c54 ("net: dev_pick_tx() fix") Revert "ipv6: Don't depend on per socket memory for neighbour discovery messages" ipv4 tunnels: fix an oops when using ipip/sit with IPsec tipc: set sk_err correctly when connection fails tcp: tcp_make_synack() should use sock_wmalloc bridge: separate querier and query timer into IGMP/IPv4 and MLD/IPv6 ones ipv6: Don't depend on per socket memory for neighbour discovery messages ipv4: sendto/hdrincl: don't use destination address found in header tcp: don't apply tsoffset if rcv_tsecr is zero tcp: initialize rcv_tstamp for restored sockets net: xilinx: fix memleak net: usb: Add HP hs2434 device to ZLP exception table net: add cpu_relax to busy poll loop net: stmmac: fixed the pbl setting with DT genl: Hold reference on correct module while netlink-dump. genl: Fix genl dumpit() locking. xfrm: Fix potential null pointer dereference in xdst_queue_output ...
2 parents de80963 + 0affdf3 commit a878764

59 files changed

Lines changed: 590 additions & 260 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/isdn/mISDN/dsp_core.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,10 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb)
288288
u8 *data;
289289
int len;
290290

291-
if (skb->len < sizeof(int))
291+
if (skb->len < sizeof(int)) {
292292
printk(KERN_ERR "%s: PH_CONTROL message too short\n", __func__);
293+
return -EINVAL;
294+
}
293295
cont = *((int *)skb->data);
294296
len = skb->len - sizeof(int);
295297
data = skb->data + sizeof(int);

‎drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to)
5353
struct bnx2x_fp_stats *to_fp_stats = &bp->fp_stats[to];
5454
int old_max_eth_txqs, new_max_eth_txqs;
5555
int old_txdata_index = 0, new_txdata_index = 0;
56+
struct bnx2x_agg_info *old_tpa_info = to_fp->tpa_info;
5657

5758
/* Copy the NAPI object as it has been already initialized */
5859
from_fp->napi = to_fp->napi;
@@ -61,6 +62,11 @@ static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to)
6162
memcpy(to_fp, from_fp, sizeof(*to_fp));
6263
to_fp->index = to;
6364

65+
/* Retain the tpa_info of the original `to' version as we don't want
66+
* 2 FPs to contain the same tpa_info pointer.
67+
*/
68+
to_fp->tpa_info = old_tpa_info;
69+
6470
/* move sp_objs contents as well, as their indices match fp ones */
6571
memcpy(to_sp_objs, from_sp_objs, sizeof(*to_sp_objs));
6672

@@ -2956,8 +2962,9 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link)
29562962
if (IS_PF(bp)) {
29572963
if (CNIC_LOADED(bp))
29582964
bnx2x_free_mem_cnic(bp);
2959-
bnx2x_free_mem(bp);
29602965
}
2966+
bnx2x_free_mem(bp);
2967+
29612968
bp->state = BNX2X_STATE_CLOSED;
29622969
bp->cnic_loaded = false;
29632970

‎drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7855,12 +7855,15 @@ void bnx2x_free_mem(struct bnx2x *bp)
78557855
{
78567856
int i;
78577857

7858-
BNX2X_PCI_FREE(bp->def_status_blk, bp->def_status_blk_mapping,
7859-
sizeof(struct host_sp_status_block));
7860-
78617858
BNX2X_PCI_FREE(bp->fw_stats, bp->fw_stats_mapping,
78627859
bp->fw_stats_data_sz + bp->fw_stats_req_sz);
78637860

7861+
if (IS_VF(bp))
7862+
return;
7863+
7864+
BNX2X_PCI_FREE(bp->def_status_blk, bp->def_status_blk_mapping,
7865+
sizeof(struct host_sp_status_block));
7866+
78647867
BNX2X_PCI_FREE(bp->slowpath, bp->slowpath_mapping,
78657868
sizeof(struct bnx2x_slowpath));
78667869

‎drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c‎

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -522,23 +522,6 @@ static int bnx2x_vfop_set_user_req(struct bnx2x *bp,
522522
return 0;
523523
}
524524

525-
static int
526-
bnx2x_vfop_config_vlan0(struct bnx2x *bp,
527-
struct bnx2x_vlan_mac_ramrod_params *vlan_mac,
528-
bool add)
529-
{
530-
int rc;
531-
532-
vlan_mac->user_req.cmd = add ? BNX2X_VLAN_MAC_ADD :
533-
BNX2X_VLAN_MAC_DEL;
534-
vlan_mac->user_req.u.vlan.vlan = 0;
535-
536-
rc = bnx2x_config_vlan_mac(bp, vlan_mac);
537-
if (rc == -EEXIST)
538-
rc = 0;
539-
return rc;
540-
}
541-
542525
static int bnx2x_vfop_config_list(struct bnx2x *bp,
543526
struct bnx2x_vfop_filters *filters,
544527
struct bnx2x_vlan_mac_ramrod_params *vlan_mac)
@@ -643,30 +626,14 @@ static void bnx2x_vfop_vlan_mac(struct bnx2x *bp, struct bnx2x_virtf *vf)
643626

644627
case BNX2X_VFOP_VLAN_CONFIG_LIST:
645628
/* next state */
646-
vfop->state = BNX2X_VFOP_VLAN_CONFIG_LIST_0;
647-
648-
/* remove vlan0 - could be no-op */
649-
vfop->rc = bnx2x_vfop_config_vlan0(bp, vlan_mac, false);
650-
if (vfop->rc)
651-
goto op_err;
629+
vfop->state = BNX2X_VFOP_VLAN_MAC_CHK_DONE;
652630

653-
/* Do vlan list config. if this operation fails we try to
654-
* restore vlan0 to keep the queue is working order
655-
*/
631+
/* do list config */
656632
vfop->rc = bnx2x_vfop_config_list(bp, filters, vlan_mac);
657633
if (!vfop->rc) {
658634
set_bit(RAMROD_CONT, &vlan_mac->ramrod_flags);
659635
vfop->rc = bnx2x_config_vlan_mac(bp, vlan_mac);
660636
}
661-
bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT); /* fall-through */
662-
663-
case BNX2X_VFOP_VLAN_CONFIG_LIST_0:
664-
/* next state */
665-
vfop->state = BNX2X_VFOP_VLAN_MAC_CHK_DONE;
666-
667-
if (list_empty(&obj->head))
668-
/* add vlan0 */
669-
vfop->rc = bnx2x_vfop_config_vlan0(bp, vlan_mac, true);
670637
bnx2x_vfop_finalize(vf, vfop->rc, VFOP_DONE);
671638

672639
default:
@@ -2819,6 +2786,18 @@ int bnx2x_vf_init(struct bnx2x *bp, struct bnx2x_virtf *vf, dma_addr_t *sb_map)
28192786
return 0;
28202787
}
28212788

2789+
struct set_vf_state_cookie {
2790+
struct bnx2x_virtf *vf;
2791+
u8 state;
2792+
};
2793+
2794+
void bnx2x_set_vf_state(void *cookie)
2795+
{
2796+
struct set_vf_state_cookie *p = (struct set_vf_state_cookie *)cookie;
2797+
2798+
p->vf->state = p->state;
2799+
}
2800+
28222801
/* VFOP close (teardown the queues, delete mcasts and close HW) */
28232802
static void bnx2x_vfop_close(struct bnx2x *bp, struct bnx2x_virtf *vf)
28242803
{
@@ -2869,7 +2848,19 @@ static void bnx2x_vfop_close(struct bnx2x *bp, struct bnx2x_virtf *vf)
28692848
op_err:
28702849
BNX2X_ERR("VF[%d] CLOSE error: rc %d\n", vf->abs_vfid, vfop->rc);
28712850
op_done:
2872-
vf->state = VF_ACQUIRED;
2851+
2852+
/* need to make sure there are no outstanding stats ramrods which may
2853+
* cause the device to access the VF's stats buffer which it will free
2854+
* as soon as we return from the close flow.
2855+
*/
2856+
{
2857+
struct set_vf_state_cookie cookie;
2858+
2859+
cookie.vf = vf;
2860+
cookie.state = VF_ACQUIRED;
2861+
bnx2x_stats_safe_exec(bp, bnx2x_set_vf_state, &cookie);
2862+
}
2863+
28732864
DP(BNX2X_MSG_IOV, "set state to acquired\n");
28742865
bnx2x_vfop_end(bp, vf, vfop);
28752866
}

‎drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c‎

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -522,20 +522,16 @@ static void bnx2x_func_stats_init(struct bnx2x *bp)
522522
/* should be called under stats_sema */
523523
static void __bnx2x_stats_start(struct bnx2x *bp)
524524
{
525-
/* vfs travel through here as part of the statistics FSM, but no action
526-
* is required
527-
*/
528-
if (IS_VF(bp))
529-
return;
530-
531-
if (bp->port.pmf)
532-
bnx2x_port_stats_init(bp);
525+
if (IS_PF(bp)) {
526+
if (bp->port.pmf)
527+
bnx2x_port_stats_init(bp);
533528

534-
else if (bp->func_stx)
535-
bnx2x_func_stats_init(bp);
529+
else if (bp->func_stx)
530+
bnx2x_func_stats_init(bp);
536531

537-
bnx2x_hw_stats_post(bp);
538-
bnx2x_storm_stats_post(bp);
532+
bnx2x_hw_stats_post(bp);
533+
bnx2x_storm_stats_post(bp);
534+
}
539535

540536
bp->stats_started = true;
541537
}
@@ -1997,3 +1993,14 @@ void bnx2x_afex_collect_stats(struct bnx2x *bp, void *void_afex_stats,
19971993
estats->mac_discard);
19981994
}
19991995
}
1996+
1997+
void bnx2x_stats_safe_exec(struct bnx2x *bp,
1998+
void (func_to_exec)(void *cookie),
1999+
void *cookie){
2000+
if (down_timeout(&bp->stats_sema, HZ/10))
2001+
BNX2X_ERR("Unable to acquire stats lock\n");
2002+
bnx2x_stats_comp(bp);
2003+
func_to_exec(cookie);
2004+
__bnx2x_stats_start(bp);
2005+
up(&bp->stats_sema);
2006+
}

‎drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ struct bnx2x;
539539
void bnx2x_memset_stats(struct bnx2x *bp);
540540
void bnx2x_stats_init(struct bnx2x *bp);
541541
void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event);
542+
void bnx2x_stats_safe_exec(struct bnx2x *bp,
543+
void (func_to_exec)(void *cookie),
544+
void *cookie);
542545

543546
/**
544547
* bnx2x_save_statistics - save statistics when unloading.

‎drivers/net/ethernet/emulex/benet/be_main.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4373,6 +4373,10 @@ static int be_resume(struct pci_dev *pdev)
43734373
pci_set_power_state(pdev, PCI_D0);
43744374
pci_restore_state(pdev);
43754375

4376+
status = be_fw_wait_ready(adapter);
4377+
if (status)
4378+
return status;
4379+
43764380
/* tell fw we're ready to fire cmds */
43774381
status = be_cmd_fw_init(adapter);
43784382
if (status)

‎drivers/net/ethernet/freescale/fec_main.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,8 +971,7 @@ fec_enet_rx(struct net_device *ndev, int budget)
971971
htons(ETH_P_8021Q),
972972
vlan_tag);
973973

974-
if (!skb_defer_rx_timestamp(skb))
975-
napi_gro_receive(&fep->napi, skb);
974+
napi_gro_receive(&fep->napi, skb);
976975
}
977976

978977
bdp->cbd_bufaddr = dma_map_single(&fep->pdev->dev, data,

‎drivers/net/ethernet/jme.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3069,7 +3069,7 @@ jme_init_one(struct pci_dev *pdev,
30693069
jwrite32(jme, JME_APMC, apmc);
30703070
}
30713071

3072-
NETIF_NAPI_SET(netdev, &jme->napi, jme_poll, jme->rx_ring_size >> 2)
3072+
NETIF_NAPI_SET(netdev, &jme->napi, jme_poll, NAPI_POLL_WEIGHT)
30733073

30743074
spin_lock_init(&jme->phy_lock);
30753075
spin_lock_init(&jme->macaddr_lock);

‎drivers/net/ethernet/qlogic/netxen/netxen_nic.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,6 @@ typedef struct {
11711171

11721172
#define NETXEN_DB_MAPSIZE_BYTES 0x1000
11731173

1174-
#define NETXEN_NETDEV_WEIGHT 128
11751174
#define NETXEN_ADAPTER_UP_MAGIC 777
11761175
#define NETXEN_NIC_PEG_TUNE 0
11771176

0 commit comments

Comments
 (0)