Skip to content

Commit a0d60e6

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix leak in fsl/fman driver, from Dan Carpenter. 2) Call flow dissector initcall earlier than any networking driver can register and start to use it, from Eric Dumazet. 3) Some dup header fixes from Geliang Tang. 4) TIPC link monitoring compat fix from Jon Paul Maloy. 5) Link changes require EEE re-negotiation in bcm_sf2 driver, from Florian Fainelli. 6) Fix bogus handle ID passed into tfilter_notify_chain(), from Roman Mashak. 7) Fix dump size calculation in rtnl_calcit(), from Zhang Shengju. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits) tipc: resolve connection flow control compatibility problem mvpp2: use correct size for memset net/mlx5: drop duplicate header delay.h net: ieee802154: drop duplicate header delay.h ibmvnic: drop duplicate header seq_file.h fsl/fman: fix a leak in tgec_free() net: ethtool: don't require CAP_NET_ADMIN for ETHTOOL_GLINKSETTINGS tipc: improve sanity check for received domain records tipc: fix compatibility bug in link monitoring net: ethernet: mvneta: Remove IFF_UNICAST_FLT which is not implemented dwc_eth_qos: drop duplicate headers net sched filters: fix filter handle ID in tfilter_notify_chain() net: dsa: bcm_sf2: Ensure we re-negotiate EEE during after link change bnxt: do not busy-poll when link is down udplite: call proper backlog handlers ipv6: bump genid when the IFA_F_TENTATIVE flag is clear net/mlx4_en: Free netdev resources under state lock net: revert "net: l2tp: Treat NET_XMIT_CN as success in l2tp_eth_dev_xmit" rtnetlink: fix the wrong minimal dump size getting from rtnl_calcit() bnxt_en: Fix a VXLAN vs GENEVE issue ...
2 parents 30e2b7c + 6998cc6 commit a0d60e6

File tree

35 files changed

+101
-60
lines changed

35 files changed

+101
-60
lines changed

drivers/net/dsa/bcm_sf2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ static void bcm_sf2_sw_adjust_link(struct dsa_switch *ds, int port,
588588
struct phy_device *phydev)
589589
{
590590
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
591+
struct ethtool_eee *p = &priv->port_sts[port].eee;
591592
u32 id_mode_dis = 0, port_mode;
592593
const char *str = NULL;
593594
u32 reg;
@@ -662,6 +663,9 @@ static void bcm_sf2_sw_adjust_link(struct dsa_switch *ds, int port,
662663
reg |= DUPLX_MODE;
663664

664665
core_writel(priv, reg, CORE_STS_OVERRIDE_GMIIP_PORT(port));
666+
667+
if (!phydev->is_pseudo_fixed_link)
668+
p->eee_enabled = bcm_sf2_eee_init(ds, port, phydev);
665669
}
666670

667671
static void bcm_sf2_sw_fixed_link_update(struct dsa_switch *ds, int port,

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,6 +1811,9 @@ static int bnxt_busy_poll(struct napi_struct *napi)
18111811
if (atomic_read(&bp->intr_sem) != 0)
18121812
return LL_FLUSH_FAILED;
18131813

1814+
if (!bp->link_info.link_up)
1815+
return LL_FLUSH_FAILED;
1816+
18141817
if (!bnxt_lock_poll(bnapi))
18151818
return LL_FLUSH_BUSY;
18161819

@@ -3210,11 +3213,17 @@ static int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, __be16 port,
32103213
goto err_out;
32113214
}
32123215

3213-
if (tunnel_type & TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN)
3216+
switch (tunnel_type) {
3217+
case TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN:
32143218
bp->vxlan_fw_dst_port_id = resp->tunnel_dst_port_id;
3215-
3216-
else if (tunnel_type & TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE)
3219+
break;
3220+
case TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE:
32173221
bp->nge_fw_dst_port_id = resp->tunnel_dst_port_id;
3222+
break;
3223+
default:
3224+
break;
3225+
}
3226+
32183227
err_out:
32193228
mutex_unlock(&bp->hwrm_cmd_lock);
32203229
return rc;

drivers/net/ethernet/freescale/fman/fman_tgec.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,6 @@ int tgec_free(struct fman_mac *tgec)
722722
{
723723
free_init_resources(tgec);
724724

725-
if (tgec->cfg)
726-
tgec->cfg = NULL;
727-
728725
kfree(tgec->cfg);
729726
kfree(tgec);
730727

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
#include <asm/iommu.h>
7575
#include <linux/uaccess.h>
7676
#include <asm/firmware.h>
77-
#include <linux/seq_file.h>
7877
#include <linux/workqueue.h>
7978

8079
#include "ibmvnic.h"

drivers/net/ethernet/marvell/mvneta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4151,7 +4151,7 @@ static int mvneta_probe(struct platform_device *pdev)
41514151
dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
41524152
dev->hw_features |= dev->features;
41534153
dev->vlan_features |= dev->features;
4154-
dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
4154+
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
41554155
dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
41564156

41574157
err = register_netdev(dev);

drivers/net/ethernet/marvell/mvpp2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3293,7 +3293,7 @@ static void mvpp2_cls_init(struct mvpp2 *priv)
32933293
mvpp2_write(priv, MVPP2_CLS_MODE_REG, MVPP2_CLS_MODE_ACTIVE_MASK);
32943294

32953295
/* Clear classifier flow table */
3296-
memset(&fe.data, 0, MVPP2_CLS_FLOWS_TBL_DATA_WORDS);
3296+
memset(&fe.data, 0, sizeof(fe.data));
32973297
for (index = 0; index < MVPP2_CLS_FLOWS_TBL_SIZE; index++) {
32983298
fe.index = index;
32993299
mvpp2_cls_flow_write(priv, &fe);

drivers/net/ethernet/mellanox/mlx4/en_netdev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ static enum mlx4_net_trans_rule_id mlx4_ip_proto_to_trans_rule_id(u8 ip_proto)
129129
}
130130
};
131131

132+
/* Must not acquire state_lock, as its corresponding work_sync
133+
* is done under it.
134+
*/
132135
static void mlx4_en_filter_work(struct work_struct *work)
133136
{
134137
struct mlx4_en_filter *filter = container_of(work,
@@ -2189,13 +2192,13 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
21892192
mutex_lock(&mdev->state_lock);
21902193
mdev->pndev[priv->port] = NULL;
21912194
mdev->upper[priv->port] = NULL;
2192-
mutex_unlock(&mdev->state_lock);
21932195

21942196
#ifdef CONFIG_RFS_ACCEL
21952197
mlx4_en_cleanup_filters(priv);
21962198
#endif
21972199

21982200
mlx4_en_free_resources(priv);
2201+
mutex_unlock(&mdev->state_lock);
21992202

22002203
kfree(priv->tx_ring);
22012204
kfree(priv->tx_cq);

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#include <linux/mlx5/srq.h>
4747
#include <linux/debugfs.h>
4848
#include <linux/kmod.h>
49-
#include <linux/delay.h>
5049
#include <linux/mlx5/mlx5_ifc.h>
5150
#ifdef CONFIG_RFS_ACCEL
5251
#include <linux/cpu_rmap.h>

drivers/net/ethernet/synopsys/dwc_eth_qos.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <linux/stat.h>
3434
#include <linux/types.h>
3535

36-
#include <linux/types.h>
3736
#include <linux/slab.h>
3837
#include <linux/delay.h>
3938
#include <linux/mm.h>
@@ -43,7 +42,6 @@
4342

4443
#include <linux/phy.h>
4544
#include <linux/mii.h>
46-
#include <linux/delay.h>
4745
#include <linux/dma-mapping.h>
4846
#include <linux/vmalloc.h>
4947

drivers/net/ieee802154/adf7242.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <linux/skbuff.h>
2121
#include <linux/of.h>
2222
#include <linux/irq.h>
23-
#include <linux/delay.h>
2423
#include <linux/debugfs.h>
2524
#include <linux/bitops.h>
2625
#include <linux/ieee802154.h>

drivers/net/macvlan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,8 @@ static int macvlan_open(struct net_device *dev)
623623
return 0;
624624

625625
clear_multi:
626-
dev_set_allmulti(lowerdev, -1);
626+
if (dev->flags & IFF_ALLMULTI)
627+
dev_set_allmulti(lowerdev, -1);
627628
del_unicast:
628629
dev_uc_del(lowerdev, dev->dev_addr);
629630
out:

drivers/net/phy/micrel.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ static int ksz8041_config_init(struct phy_device *phydev)
318318
/* Limit supported and advertised modes in fiber mode */
319319
if (of_property_read_bool(of_node, "micrel,fiber-mode")) {
320320
phydev->dev_flags |= MICREL_PHY_FXEN;
321-
phydev->supported &= SUPPORTED_FIBRE |
322-
SUPPORTED_100baseT_Full |
321+
phydev->supported &= SUPPORTED_100baseT_Full |
323322
SUPPORTED_100baseT_Half;
324-
phydev->advertising &= ADVERTISED_FIBRE |
325-
ADVERTISED_100baseT_Full |
323+
phydev->supported |= SUPPORTED_FIBRE;
324+
phydev->advertising &= ADVERTISED_100baseT_Full |
326325
ADVERTISED_100baseT_Half;
326+
phydev->advertising |= ADVERTISED_FIBRE;
327327
phydev->autoneg = AUTONEG_DISABLE;
328328
}
329329

include/linux/netdevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ enum netdev_priv_flags {
16191619
* @dcbnl_ops: Data Center Bridging netlink ops
16201620
* @num_tc: Number of traffic classes in the net device
16211621
* @tc_to_txq: XXX: need comments on this one
1622-
* @prio_tc_map XXX: need comments on this one
1622+
* @prio_tc_map: XXX: need comments on this one
16231623
*
16241624
* @fcoe_ddp_xid: Max exchange id for FCoE LRO by ddp
16251625
*

include/net/bluetooth/hci_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ static inline void hci_set_drvdata(struct hci_dev *hdev, void *data)
10181018
}
10191019

10201020
struct hci_dev *hci_dev_get(int index);
1021-
struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src);
1021+
struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src, u8 src_type);
10221022

10231023
struct hci_dev *hci_alloc_dev(void);
10241024
void hci_free_dev(struct hci_dev *hdev);

net/bluetooth/6lowpan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,6 @@ static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type,
10901090
{
10911091
struct hci_conn *hcon;
10921092
struct hci_dev *hdev;
1093-
bdaddr_t *src = BDADDR_ANY;
10941093
int n;
10951094

10961095
n = sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hhu",
@@ -1101,7 +1100,8 @@ static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type,
11011100
if (n < 7)
11021101
return -EINVAL;
11031102

1104-
hdev = hci_get_route(addr, src);
1103+
/* The LE_PUBLIC address type is ignored because of BDADDR_ANY */
1104+
hdev = hci_get_route(addr, BDADDR_ANY, BDADDR_LE_PUBLIC);
11051105
if (!hdev)
11061106
return -ENOENT;
11071107

net/bluetooth/hci_conn.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ int hci_conn_del(struct hci_conn *conn)
613613
return 0;
614614
}
615615

616-
struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src)
616+
struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src, uint8_t src_type)
617617
{
618618
int use_src = bacmp(src, BDADDR_ANY);
619619
struct hci_dev *hdev = NULL, *d;
@@ -634,7 +634,29 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src)
634634
*/
635635

636636
if (use_src) {
637-
if (!bacmp(&d->bdaddr, src)) {
637+
bdaddr_t id_addr;
638+
u8 id_addr_type;
639+
640+
if (src_type == BDADDR_BREDR) {
641+
if (!lmp_bredr_capable(d))
642+
continue;
643+
bacpy(&id_addr, &d->bdaddr);
644+
id_addr_type = BDADDR_BREDR;
645+
} else {
646+
if (!lmp_le_capable(d))
647+
continue;
648+
649+
hci_copy_identity_address(d, &id_addr,
650+
&id_addr_type);
651+
652+
/* Convert from HCI to three-value type */
653+
if (id_addr_type == ADDR_LE_DEV_PUBLIC)
654+
id_addr_type = BDADDR_LE_PUBLIC;
655+
else
656+
id_addr_type = BDADDR_LE_RANDOM;
657+
}
658+
659+
if (!bacmp(&id_addr, src) && id_addr_type == src_type) {
638660
hdev = d; break;
639661
}
640662
} else {

net/bluetooth/l2cap_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7060,7 +7060,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
70607060
BT_DBG("%pMR -> %pMR (type %u) psm 0x%2.2x", &chan->src, dst,
70617061
dst_type, __le16_to_cpu(psm));
70627062

7063-
hdev = hci_get_route(dst, &chan->src);
7063+
hdev = hci_get_route(dst, &chan->src, chan->src_type);
70647064
if (!hdev)
70657065
return -EHOSTUNREACH;
70667066

net/bluetooth/rfcomm/tty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static void rfcomm_reparent_device(struct rfcomm_dev *dev)
178178
struct hci_dev *hdev;
179179
struct hci_conn *conn;
180180

181-
hdev = hci_get_route(&dev->dst, &dev->src);
181+
hdev = hci_get_route(&dev->dst, &dev->src, BDADDR_BREDR);
182182
if (!hdev)
183183
return;
184184

net/bluetooth/sco.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static int sco_connect(struct sock *sk)
219219

220220
BT_DBG("%pMR -> %pMR", &sco_pi(sk)->src, &sco_pi(sk)->dst);
221221

222-
hdev = hci_get_route(&sco_pi(sk)->dst, &sco_pi(sk)->src);
222+
hdev = hci_get_route(&sco_pi(sk)->dst, &sco_pi(sk)->src, BDADDR_BREDR);
223223
if (!hdev)
224224
return -EHOSTUNREACH;
225225

net/can/bcm.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
(CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG) : \
7878
(CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG))
7979

80-
#define CAN_BCM_VERSION "20160617"
80+
#define CAN_BCM_VERSION "20161123"
8181

8282
MODULE_DESCRIPTION("PF_CAN broadcast manager protocol");
8383
MODULE_LICENSE("Dual BSD/GPL");
@@ -109,8 +109,9 @@ struct bcm_op {
109109
u32 count;
110110
u32 nframes;
111111
u32 currframe;
112-
struct canfd_frame *frames;
113-
struct canfd_frame *last_frames;
112+
/* void pointers to arrays of struct can[fd]_frame */
113+
void *frames;
114+
void *last_frames;
114115
struct canfd_frame sframe;
115116
struct canfd_frame last_sframe;
116117
struct sock *sk;
@@ -681,7 +682,7 @@ static void bcm_rx_handler(struct sk_buff *skb, void *data)
681682

682683
if (op->flags & RX_FILTER_ID) {
683684
/* the easiest case */
684-
bcm_rx_update_and_send(op, &op->last_frames[0], rxframe);
685+
bcm_rx_update_and_send(op, op->last_frames, rxframe);
685686
goto rx_starttimer;
686687
}
687688

@@ -1068,7 +1069,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
10681069

10691070
if (msg_head->nframes) {
10701071
/* update CAN frames content */
1071-
err = memcpy_from_msg((u8 *)op->frames, msg,
1072+
err = memcpy_from_msg(op->frames, msg,
10721073
msg_head->nframes * op->cfsiz);
10731074
if (err < 0)
10741075
return err;
@@ -1118,7 +1119,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
11181119
}
11191120

11201121
if (msg_head->nframes) {
1121-
err = memcpy_from_msg((u8 *)op->frames, msg,
1122+
err = memcpy_from_msg(op->frames, msg,
11221123
msg_head->nframes * op->cfsiz);
11231124
if (err < 0) {
11241125
if (op->frames != &op->sframe)
@@ -1163,6 +1164,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
11631164
/* check flags */
11641165

11651166
if (op->flags & RX_RTR_FRAME) {
1167+
struct canfd_frame *frame0 = op->frames;
11661168

11671169
/* no timers in RTR-mode */
11681170
hrtimer_cancel(&op->thrtimer);
@@ -1174,8 +1176,8 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
11741176
* prevent a full-load-loopback-test ... ;-]
11751177
*/
11761178
if ((op->flags & TX_CP_CAN_ID) ||
1177-
(op->frames[0].can_id == op->can_id))
1178-
op->frames[0].can_id = op->can_id & ~CAN_RTR_FLAG;
1179+
(frame0->can_id == op->can_id))
1180+
frame0->can_id = op->can_id & ~CAN_RTR_FLAG;
11791181

11801182
} else {
11811183
if (op->flags & SETTIMER) {

net/core/ethtool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,6 +2479,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
24792479
case ETHTOOL_GET_TS_INFO:
24802480
case ETHTOOL_GEEE:
24812481
case ETHTOOL_GTUNABLE:
2482+
case ETHTOOL_GLINKSETTINGS:
24822483
break;
24832484
default:
24842485
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))

net/core/flow_dissector.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,4 +1013,4 @@ static int __init init_default_flow_dissectors(void)
10131013
return 0;
10141014
}
10151015

1016-
late_initcall_sync(init_default_flow_dissectors);
1016+
core_initcall(init_default_flow_dissectors);

net/core/rtnetlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2737,7 +2737,7 @@ static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
27372737
ext_filter_mask));
27382738
}
27392739

2740-
return min_ifinfo_dump_size;
2740+
return nlmsg_total_size(min_ifinfo_dump_size);
27412741
}
27422742

27432743
static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)

net/ipv4/udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ static void udp_v4_rehash(struct sock *sk)
14551455
udp_lib_rehash(sk, new_hash);
14561456
}
14571457

1458-
static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
1458+
int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
14591459
{
14601460
int rc;
14611461

net/ipv4/udp_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
2525
int flags, int *addr_len);
2626
int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,
2727
int flags);
28-
int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
28+
int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
2929
void udp_destroy_sock(struct sock *sk);
3030

3131
#ifdef CONFIG_PROC_FS

net/ipv4/udplite.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct proto udplite_prot = {
5050
.sendmsg = udp_sendmsg,
5151
.recvmsg = udp_recvmsg,
5252
.sendpage = udp_sendpage,
53-
.backlog_rcv = udp_queue_rcv_skb,
53+
.backlog_rcv = __udp_queue_rcv_skb,
5454
.hash = udp_lib_hash,
5555
.unhash = udp_lib_unhash,
5656
.get_port = udp_v4_get_port,

0 commit comments

Comments
 (0)