Skip to content

Commit 510c8a8

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix TCP checksum offload handling in iwlwifi driver, from Emmanuel Grumbach. 2) In ksz DSA tagging code, free SKB if skb_put_padto() fails. From Vivien Didelot. 3) Fix two regressions with bonding on wireless, from Andreas Born. 4) Fix build when busypoll is disabled, from Daniel Borkmann. 5) Fix copy_linear_skb() wrt. SO_PEEK_OFF, from Eric Dumazet. 6) Set SKB cached route properly in inet_rtm_getroute(), from Florian Westphal. 7) Fix PCI-E relaxed ordering handling in cxgb4 driver, from Ding Tianhong. 8) Fix module refcnt leak in ULP code, from Sabrina Dubroca. 9) Fix use of GFP_KERNEL in atomic contexts in AF_KEY code, from Eric Dumazet. 10) Need to purge socket write queue in dccp_destroy_sock(), also from Eric Dumazet. 11) Make bpf_trace_printk() work properly on 32-bit architectures, from Daniel Borkmann. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (47 commits) bpf: fix bpf_trace_printk on 32 bit archs PCI: fix oops when try to find Root Port for a PCI device sfc: don't try and read ef10 data on non-ef10 NIC net_sched: remove warning from qdisc_hash_add net_sched/sfq: update hierarchical backlog when drop packet net_sched: reset pointers to tcf blocks in classful qdiscs' destructors ipv4: fix NULL dereference in free_fib_info_rcu() net: Fix a typo in comment about sock flags. ipv6: fix NULL dereference in ip6_route_dev_notify() tcp: fix possible deadlock in TCP stack vs BPF filter dccp: purge write queue in dccp_destroy_sock() udp: fix linear skb reception with PEEK_OFF ipv6: release rt6->rt6i_idev properly during ifdown af_key: do not use GFP_KERNEL in atomic contexts tcp: ulp: avoid module refcnt leak in tcp_set_ulp net/cxgb4vf: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag net/cxgb4: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag PCI: Disable Relaxed Ordering Attributes for AMD A1100 PCI: Disable Relaxed Ordering for some Intel processors PCI: Disable PCIe Relaxed Ordering if unsupported ...
2 parents 40c6d1b + 88a5c69 commit 510c8a8

58 files changed

Lines changed: 512 additions & 159 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/fsm.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@
2626

2727
#define FSM_TIMER_DEBUG 0
2828

29-
void
29+
int
3030
mISDN_FsmNew(struct Fsm *fsm,
3131
struct FsmNode *fnlist, int fncount)
3232
{
3333
int i;
3434

3535
fsm->jumpmatrix = kzalloc(sizeof(FSMFNPTR) * fsm->state_count *
3636
fsm->event_count, GFP_KERNEL);
37+
if (fsm->jumpmatrix == NULL)
38+
return -ENOMEM;
3739

3840
for (i = 0; i < fncount; i++)
3941
if ((fnlist[i].state >= fsm->state_count) ||
@@ -45,6 +47,7 @@ mISDN_FsmNew(struct Fsm *fsm,
4547
} else
4648
fsm->jumpmatrix[fsm->state_count * fnlist[i].event +
4749
fnlist[i].state] = (FSMFNPTR) fnlist[i].routine;
50+
return 0;
4851
}
4952
EXPORT_SYMBOL(mISDN_FsmNew);
5053

‎drivers/isdn/mISDN/fsm.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct FsmTimer {
5555
void *arg;
5656
};
5757

58-
extern void mISDN_FsmNew(struct Fsm *, struct FsmNode *, int);
58+
extern int mISDN_FsmNew(struct Fsm *, struct FsmNode *, int);
5959
extern void mISDN_FsmFree(struct Fsm *);
6060
extern int mISDN_FsmEvent(struct FsmInst *, int , void *);
6161
extern void mISDN_FsmChangeState(struct FsmInst *, int);

‎drivers/isdn/mISDN/layer1.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,7 @@ l1_init(u_int *deb)
414414
l1fsm_s.event_count = L1_EVENT_COUNT;
415415
l1fsm_s.strEvent = strL1Event;
416416
l1fsm_s.strState = strL1SState;
417-
mISDN_FsmNew(&l1fsm_s, L1SFnList, ARRAY_SIZE(L1SFnList));
418-
return 0;
417+
return mISDN_FsmNew(&l1fsm_s, L1SFnList, ARRAY_SIZE(L1SFnList));
419418
}
420419

421420
void

‎drivers/isdn/mISDN/layer2.c‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,15 +2247,26 @@ static struct Bprotocol X75SLP = {
22472247
int
22482248
Isdnl2_Init(u_int *deb)
22492249
{
2250+
int res;
22502251
debug = deb;
22512252
mISDN_register_Bprotocol(&X75SLP);
22522253
l2fsm.state_count = L2_STATE_COUNT;
22532254
l2fsm.event_count = L2_EVENT_COUNT;
22542255
l2fsm.strEvent = strL2Event;
22552256
l2fsm.strState = strL2State;
2256-
mISDN_FsmNew(&l2fsm, L2FnList, ARRAY_SIZE(L2FnList));
2257-
TEIInit(deb);
2257+
res = mISDN_FsmNew(&l2fsm, L2FnList, ARRAY_SIZE(L2FnList));
2258+
if (res)
2259+
goto error;
2260+
res = TEIInit(deb);
2261+
if (res)
2262+
goto error_fsm;
22582263
return 0;
2264+
2265+
error_fsm:
2266+
mISDN_FsmFree(&l2fsm);
2267+
error:
2268+
mISDN_unregister_Bprotocol(&X75SLP);
2269+
return res;
22592270
}
22602271

22612272
void

‎drivers/isdn/mISDN/tei.c‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,23 +1387,37 @@ create_teimanager(struct mISDNdevice *dev)
13871387

13881388
int TEIInit(u_int *deb)
13891389
{
1390+
int res;
13901391
debug = deb;
13911392
teifsmu.state_count = TEI_STATE_COUNT;
13921393
teifsmu.event_count = TEI_EVENT_COUNT;
13931394
teifsmu.strEvent = strTeiEvent;
13941395
teifsmu.strState = strTeiState;
1395-
mISDN_FsmNew(&teifsmu, TeiFnListUser, ARRAY_SIZE(TeiFnListUser));
1396+
res = mISDN_FsmNew(&teifsmu, TeiFnListUser, ARRAY_SIZE(TeiFnListUser));
1397+
if (res)
1398+
goto error;
13961399
teifsmn.state_count = TEI_STATE_COUNT;
13971400
teifsmn.event_count = TEI_EVENT_COUNT;
13981401
teifsmn.strEvent = strTeiEvent;
13991402
teifsmn.strState = strTeiState;
1400-
mISDN_FsmNew(&teifsmn, TeiFnListNet, ARRAY_SIZE(TeiFnListNet));
1403+
res = mISDN_FsmNew(&teifsmn, TeiFnListNet, ARRAY_SIZE(TeiFnListNet));
1404+
if (res)
1405+
goto error_smn;
14011406
deactfsm.state_count = DEACT_STATE_COUNT;
14021407
deactfsm.event_count = DEACT_EVENT_COUNT;
14031408
deactfsm.strEvent = strDeactEvent;
14041409
deactfsm.strState = strDeactState;
1405-
mISDN_FsmNew(&deactfsm, DeactFnList, ARRAY_SIZE(DeactFnList));
1410+
res = mISDN_FsmNew(&deactfsm, DeactFnList, ARRAY_SIZE(DeactFnList));
1411+
if (res)
1412+
goto error_deact;
14061413
return 0;
1414+
1415+
error_deact:
1416+
mISDN_FsmFree(&teifsmn);
1417+
error_smn:
1418+
mISDN_FsmFree(&teifsmu);
1419+
error:
1420+
return res;
14071421
}
14081422

14091423
void TEIFree(void)

‎drivers/net/bonding/bond_main.c‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
15691569
new_slave->delay = 0;
15701570
new_slave->link_failure_count = 0;
15711571

1572-
if (bond_update_speed_duplex(new_slave))
1572+
if (bond_update_speed_duplex(new_slave) &&
1573+
bond_needs_speed_duplex(bond))
15731574
new_slave->link = BOND_LINK_DOWN;
15741575

15751576
new_slave->last_rx = jiffies -
@@ -2140,11 +2141,13 @@ static void bond_miimon_commit(struct bonding *bond)
21402141
continue;
21412142

21422143
case BOND_LINK_UP:
2143-
if (bond_update_speed_duplex(slave)) {
2144+
if (bond_update_speed_duplex(slave) &&
2145+
bond_needs_speed_duplex(bond)) {
21442146
slave->link = BOND_LINK_DOWN;
2145-
netdev_warn(bond->dev,
2146-
"failed to get link speed/duplex for %s\n",
2147-
slave->dev->name);
2147+
if (net_ratelimit())
2148+
netdev_warn(bond->dev,
2149+
"failed to get link speed/duplex for %s\n",
2150+
slave->dev->name);
21482151
continue;
21492152
}
21502153
bond_set_slave_link_state(slave, BOND_LINK_UP,

‎drivers/net/ethernet/chelsio/cxgb4/cxgb4.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ enum { /* adapter flags */
529529
USING_SOFT_PARAMS = (1 << 6),
530530
MASTER_PF = (1 << 7),
531531
FW_OFLD_CONN = (1 << 9),
532+
ROOT_NO_RELAXED_ORDERING = (1 << 10),
532533
};
533534

534535
enum {

‎drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4654,11 +4654,6 @@ static void print_port_info(const struct net_device *dev)
46544654
dev->name, adap->params.vpd.id, adap->name, buf);
46554655
}
46564656

4657-
static void enable_pcie_relaxed_ordering(struct pci_dev *dev)
4658-
{
4659-
pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN);
4660-
}
4661-
46624657
/*
46634658
* Free the following resources:
46644659
* - memory used for tables
@@ -4908,7 +4903,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
49084903
}
49094904

49104905
pci_enable_pcie_error_reporting(pdev);
4911-
enable_pcie_relaxed_ordering(pdev);
49124906
pci_set_master(pdev);
49134907
pci_save_state(pdev);
49144908

@@ -4947,6 +4941,23 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
49474941
adapter->msg_enable = DFLT_MSG_ENABLE;
49484942
memset(adapter->chan_map, 0xff, sizeof(adapter->chan_map));
49494943

4944+
/* If possible, we use PCIe Relaxed Ordering Attribute to deliver
4945+
* Ingress Packet Data to Free List Buffers in order to allow for
4946+
* chipset performance optimizations between the Root Complex and
4947+
* Memory Controllers. (Messages to the associated Ingress Queue
4948+
* notifying new Packet Placement in the Free Lists Buffers will be
4949+
* send without the Relaxed Ordering Attribute thus guaranteeing that
4950+
* all preceding PCIe Transaction Layer Packets will be processed
4951+
* first.) But some Root Complexes have various issues with Upstream
4952+
* Transaction Layer Packets with the Relaxed Ordering Attribute set.
4953+
* The PCIe devices which under the Root Complexes will be cleared the
4954+
* Relaxed Ordering bit in the configuration space, So we check our
4955+
* PCIe configuration space to see if it's flagged with advice against
4956+
* using Relaxed Ordering.
4957+
*/
4958+
if (!pcie_relaxed_ordering_enabled(pdev))
4959+
adapter->flags |= ROOT_NO_RELAXED_ORDERING;
4960+
49504961
spin_lock_init(&adapter->stats_lock);
49514962
spin_lock_init(&adapter->tid_release_lock);
49524963
spin_lock_init(&adapter->win0_lock);

‎drivers/net/ethernet/chelsio/cxgb4/sge.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,6 +2719,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
27192719
struct fw_iq_cmd c;
27202720
struct sge *s = &adap->sge;
27212721
struct port_info *pi = netdev_priv(dev);
2722+
int relaxed = !(adap->flags & ROOT_NO_RELAXED_ORDERING);
27222723

27232724
/* Size needs to be multiple of 16, including status entry. */
27242725
iq->size = roundup(iq->size, 16);
@@ -2772,8 +2773,8 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
27722773

27732774
flsz = fl->size / 8 + s->stat_len / sizeof(struct tx_desc);
27742775
c.iqns_to_fl0congen |= htonl(FW_IQ_CMD_FL0PACKEN_F |
2775-
FW_IQ_CMD_FL0FETCHRO_F |
2776-
FW_IQ_CMD_FL0DATARO_F |
2776+
FW_IQ_CMD_FL0FETCHRO_V(relaxed) |
2777+
FW_IQ_CMD_FL0DATARO_V(relaxed) |
27772778
FW_IQ_CMD_FL0PADEN_F);
27782779
if (cong >= 0)
27792780
c.iqns_to_fl0congen |=

‎drivers/net/ethernet/chelsio/cxgb4vf/adapter.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ enum { /* adapter flags */
408408
USING_MSI = (1UL << 1),
409409
USING_MSIX = (1UL << 2),
410410
QUEUES_BOUND = (1UL << 3),
411+
ROOT_NO_RELAXED_ORDERING = (1UL << 4),
411412
};
412413

413414
/*

0 commit comments

Comments
 (0)