diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-24 18:51:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-24 18:51:40 -0500 |
commit | 701b259f446be2f3625fb852bceb93afe76e206d (patch) | |
tree | 93f15bcd00bd59c38b4e59fed9af7ddf6b06c8b3 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | |
parent | d2346963bfcbb9a8ee783ca3c3b3bdd7448ec9d5 (diff) | |
parent | efc3dbc37412c027e363736b4f4c74ee5e8ecffc (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Davem says:
1) Fix JIT code generation on x86-64 for divide by zero, from Eric Dumazet.
2) tg3 header length computation correction from Eric Dumazet.
3) More build and reference counting fixes for socket memory cgroup
code from Glauber Costa.
4) module.h snuck back into a core header after all the hard work we
did to remove that, from Paul Gortmaker and Jesper Dangaard Brouer.
5) Fix PHY naming regression and add some new PCI IDs in stmmac, from
Alessandro Rubini.
6) Netlink message generation fix in new team driver, should only advertise
the entries that changed during events, from Jiri Pirko.
7) SRIOV VF registration and unregistration fixes, and also add a
missing PCI ID, from Roopa Prabhu.
8) Fix infinite loop in tx queue flush code of brcmsmac, from Stanislaw Gruszka.
9) ftgmac100/ftmac100 build fix, missing interrupt.h include.
10) Memory leak fix in net/hyperv do_set_mutlicast() handling, from Wei Yongjun.
11) Off by one fix in netem packet scheduler, from Vijay Subramanian.
12) TCP loss detection fix from Yuchung Cheng.
13) TCP reset packet MD5 calculation uses wrong address, fix from Shawn Lu.
14) skge carrier assertion and DMA mapping fixes from Stephen Hemminger.
15) Congestion recovery undo performed at the wrong spot in BIC and CUBIC
congestion control modules, fix from Neal Cardwell.
16) Ethtool ETHTOOL_GSSET_INFO is unnecessarily restrictive, from Michał Mirosław.
17) Fix triggerable race in ipv6 sysctl handling, from Francesco Ruggeri.
18) Statistics bug fixes in mlx4 from Eugenia Emantayev.
19) rds locking bug fix during info dumps, from your's truly.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (67 commits)
rds: Make rds_sock_lock BH rather than IRQ safe.
netprio_cgroup.h: dont include module.h from other includes
net: flow_dissector.c missing include linux/export.h
team: send only changed options/ports via netlink
net/hyperv: fix possible memory leak in do_set_multicast()
drivers/net: dsa/mv88e6xxx.c files need linux/module.h
stmmac: added PCI identifiers
llc: Fix race condition in llc_ui_recvmsg
stmmac: fix phy naming inconsistency
dsa: Add reporting of silicon revision for Marvell 88E6123/88E6161/88E6165 switches.
tg3: fix ipv6 header length computation
skge: add byte queue limit support
mv643xx_eth: Add Rx Discard and Rx Overrun statistics
bnx2x: fix compilation error with SOE in fw_dump
bnx2x: handle CHIP_REVISION during init_one
bnx2x: allow user to change ring size in ISCSI SD mode
bnx2x: fix Big-Endianess in ethtool -t
bnx2x: fixed ethtool statistics for MF modes
bnx2x: credit-leakage fixup on vlan_mac_del_all
macvlan: fix a possible use after free
...
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c index 5ac616093f9f..cb6339c35571 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | |||
@@ -50,6 +50,7 @@ static inline void bnx2x_exe_queue_init(struct bnx2x *bp, | |||
50 | int exe_len, | 50 | int exe_len, |
51 | union bnx2x_qable_obj *owner, | 51 | union bnx2x_qable_obj *owner, |
52 | exe_q_validate validate, | 52 | exe_q_validate validate, |
53 | exe_q_remove remove, | ||
53 | exe_q_optimize optimize, | 54 | exe_q_optimize optimize, |
54 | exe_q_execute exec, | 55 | exe_q_execute exec, |
55 | exe_q_get get) | 56 | exe_q_get get) |
@@ -66,6 +67,7 @@ static inline void bnx2x_exe_queue_init(struct bnx2x *bp, | |||
66 | 67 | ||
67 | /* Owner specific callbacks */ | 68 | /* Owner specific callbacks */ |
68 | o->validate = validate; | 69 | o->validate = validate; |
70 | o->remove = remove; | ||
69 | o->optimize = optimize; | 71 | o->optimize = optimize; |
70 | o->execute = exec; | 72 | o->execute = exec; |
71 | o->get = get; | 73 | o->get = get; |
@@ -1340,6 +1342,35 @@ static int bnx2x_validate_vlan_mac(struct bnx2x *bp, | |||
1340 | } | 1342 | } |
1341 | } | 1343 | } |
1342 | 1344 | ||
1345 | static int bnx2x_remove_vlan_mac(struct bnx2x *bp, | ||
1346 | union bnx2x_qable_obj *qo, | ||
1347 | struct bnx2x_exeq_elem *elem) | ||
1348 | { | ||
1349 | int rc = 0; | ||
1350 | |||
1351 | /* If consumption wasn't required, nothing to do */ | ||
1352 | if (test_bit(BNX2X_DONT_CONSUME_CAM_CREDIT, | ||
1353 | &elem->cmd_data.vlan_mac.vlan_mac_flags)) | ||
1354 | return 0; | ||
1355 | |||
1356 | switch (elem->cmd_data.vlan_mac.cmd) { | ||
1357 | case BNX2X_VLAN_MAC_ADD: | ||
1358 | case BNX2X_VLAN_MAC_MOVE: | ||
1359 | rc = qo->vlan_mac.put_credit(&qo->vlan_mac); | ||
1360 | break; | ||
1361 | case BNX2X_VLAN_MAC_DEL: | ||
1362 | rc = qo->vlan_mac.get_credit(&qo->vlan_mac); | ||
1363 | break; | ||
1364 | default: | ||
1365 | return -EINVAL; | ||
1366 | } | ||
1367 | |||
1368 | if (rc != true) | ||
1369 | return -EINVAL; | ||
1370 | |||
1371 | return 0; | ||
1372 | } | ||
1373 | |||
1343 | /** | 1374 | /** |
1344 | * bnx2x_wait_vlan_mac - passivly wait for 5 seconds until all work completes. | 1375 | * bnx2x_wait_vlan_mac - passivly wait for 5 seconds until all work completes. |
1345 | * | 1376 | * |
@@ -1801,8 +1832,14 @@ static int bnx2x_vlan_mac_del_all(struct bnx2x *bp, | |||
1801 | 1832 | ||
1802 | list_for_each_entry_safe(exeq_pos, exeq_pos_n, &exeq->exe_queue, link) { | 1833 | list_for_each_entry_safe(exeq_pos, exeq_pos_n, &exeq->exe_queue, link) { |
1803 | if (exeq_pos->cmd_data.vlan_mac.vlan_mac_flags == | 1834 | if (exeq_pos->cmd_data.vlan_mac.vlan_mac_flags == |
1804 | *vlan_mac_flags) | 1835 | *vlan_mac_flags) { |
1836 | rc = exeq->remove(bp, exeq->owner, exeq_pos); | ||
1837 | if (rc) { | ||
1838 | BNX2X_ERR("Failed to remove command\n"); | ||
1839 | return rc; | ||
1840 | } | ||
1805 | list_del(&exeq_pos->link); | 1841 | list_del(&exeq_pos->link); |
1842 | } | ||
1806 | } | 1843 | } |
1807 | 1844 | ||
1808 | spin_unlock_bh(&exeq->lock); | 1845 | spin_unlock_bh(&exeq->lock); |
@@ -1908,6 +1945,7 @@ void bnx2x_init_mac_obj(struct bnx2x *bp, | |||
1908 | bnx2x_exe_queue_init(bp, | 1945 | bnx2x_exe_queue_init(bp, |
1909 | &mac_obj->exe_queue, 1, qable_obj, | 1946 | &mac_obj->exe_queue, 1, qable_obj, |
1910 | bnx2x_validate_vlan_mac, | 1947 | bnx2x_validate_vlan_mac, |
1948 | bnx2x_remove_vlan_mac, | ||
1911 | bnx2x_optimize_vlan_mac, | 1949 | bnx2x_optimize_vlan_mac, |
1912 | bnx2x_execute_vlan_mac, | 1950 | bnx2x_execute_vlan_mac, |
1913 | bnx2x_exeq_get_mac); | 1951 | bnx2x_exeq_get_mac); |
@@ -1924,6 +1962,7 @@ void bnx2x_init_mac_obj(struct bnx2x *bp, | |||
1924 | bnx2x_exe_queue_init(bp, | 1962 | bnx2x_exe_queue_init(bp, |
1925 | &mac_obj->exe_queue, CLASSIFY_RULES_COUNT, | 1963 | &mac_obj->exe_queue, CLASSIFY_RULES_COUNT, |
1926 | qable_obj, bnx2x_validate_vlan_mac, | 1964 | qable_obj, bnx2x_validate_vlan_mac, |
1965 | bnx2x_remove_vlan_mac, | ||
1927 | bnx2x_optimize_vlan_mac, | 1966 | bnx2x_optimize_vlan_mac, |
1928 | bnx2x_execute_vlan_mac, | 1967 | bnx2x_execute_vlan_mac, |
1929 | bnx2x_exeq_get_mac); | 1968 | bnx2x_exeq_get_mac); |
@@ -1963,6 +2002,7 @@ void bnx2x_init_vlan_obj(struct bnx2x *bp, | |||
1963 | bnx2x_exe_queue_init(bp, | 2002 | bnx2x_exe_queue_init(bp, |
1964 | &vlan_obj->exe_queue, CLASSIFY_RULES_COUNT, | 2003 | &vlan_obj->exe_queue, CLASSIFY_RULES_COUNT, |
1965 | qable_obj, bnx2x_validate_vlan_mac, | 2004 | qable_obj, bnx2x_validate_vlan_mac, |
2005 | bnx2x_remove_vlan_mac, | ||
1966 | bnx2x_optimize_vlan_mac, | 2006 | bnx2x_optimize_vlan_mac, |
1967 | bnx2x_execute_vlan_mac, | 2007 | bnx2x_execute_vlan_mac, |
1968 | bnx2x_exeq_get_vlan); | 2008 | bnx2x_exeq_get_vlan); |
@@ -2009,6 +2049,7 @@ void bnx2x_init_vlan_mac_obj(struct bnx2x *bp, | |||
2009 | bnx2x_exe_queue_init(bp, | 2049 | bnx2x_exe_queue_init(bp, |
2010 | &vlan_mac_obj->exe_queue, 1, qable_obj, | 2050 | &vlan_mac_obj->exe_queue, 1, qable_obj, |
2011 | bnx2x_validate_vlan_mac, | 2051 | bnx2x_validate_vlan_mac, |
2052 | bnx2x_remove_vlan_mac, | ||
2012 | bnx2x_optimize_vlan_mac, | 2053 | bnx2x_optimize_vlan_mac, |
2013 | bnx2x_execute_vlan_mac, | 2054 | bnx2x_execute_vlan_mac, |
2014 | bnx2x_exeq_get_vlan_mac); | 2055 | bnx2x_exeq_get_vlan_mac); |
@@ -2025,6 +2066,7 @@ void bnx2x_init_vlan_mac_obj(struct bnx2x *bp, | |||
2025 | &vlan_mac_obj->exe_queue, | 2066 | &vlan_mac_obj->exe_queue, |
2026 | CLASSIFY_RULES_COUNT, | 2067 | CLASSIFY_RULES_COUNT, |
2027 | qable_obj, bnx2x_validate_vlan_mac, | 2068 | qable_obj, bnx2x_validate_vlan_mac, |
2069 | bnx2x_remove_vlan_mac, | ||
2028 | bnx2x_optimize_vlan_mac, | 2070 | bnx2x_optimize_vlan_mac, |
2029 | bnx2x_execute_vlan_mac, | 2071 | bnx2x_execute_vlan_mac, |
2030 | bnx2x_exeq_get_vlan_mac); | 2072 | bnx2x_exeq_get_vlan_mac); |