Skip to content

Commit c84afab

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix ppp_mppe crypto soft dependencies, from Takashi Iawi. 2) Fix TX completion to be finite, from Sergej Benilov. 3) Use register_pernet_device to avoid a dst leak in tipc, from Xin Long. 4) Double free of TX cleanup in Dirk van der Merwe. 5) Memory leak in packet_set_ring(), from Eric Dumazet. 6) Out of bounds read in qmi_wwan, from Bjørn Mork. 7) Fix iif used in mcast/bcast looped back packets, from Stephen Suryaputra. 8) Fix neighbour resolution on raw ipv6 sockets, from Nicolas Dichtel. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (25 commits) af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET sctp: change to hold sk after auth shkey is created successfully ipv6: fix neighbour resolution with raw socket ipv6: constify rt6_nexthop() net: dsa: microchip: Use gpiod_set_value_cansleep() net: aquantia: fix vlans not working over bridged network ipv4: reset rt_iif for recirculated mcast/bcast out pkts team: Always enable vlan tx offload net/smc: Fix error path in smc_init net/smc: hold conns_lock before calling smc_lgr_register_conn() bonding: Always enable vlan tx offload net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down" ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop qmi_wwan: Fix out-of-bounds read tipc: check msg->req data len in tipc_nl_compat_bearer_disable net: macb: do not copy the mac address if NULL net/packet: fix memory leak in packet_set_ring() net/tls: fix page double free on TX cleanup net/sched: cbs: Fix error path of cbs_module_init tipc: change to use register_pernet_device ...
2 parents 249155c + 89ed5b5 commit c84afab

File tree

34 files changed

+194
-84
lines changed

34 files changed

+194
-84
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4320,12 +4320,12 @@ void bond_setup(struct net_device *bond_dev)
43204320
bond_dev->features |= NETIF_F_NETNS_LOCAL;
43214321

43224322
bond_dev->hw_features = BOND_VLAN_FEATURES |
4323-
NETIF_F_HW_VLAN_CTAG_TX |
43244323
NETIF_F_HW_VLAN_CTAG_RX |
43254324
NETIF_F_HW_VLAN_CTAG_FILTER;
43264325

43274326
bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4;
43284327
bond_dev->features |= bond_dev->hw_features;
4328+
bond_dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
43294329
}
43304330

43314331
/* Destroy a bonding device.

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ int ksz_switch_register(struct ksz_device *dev,
436436
return PTR_ERR(dev->reset_gpio);
437437

438438
if (dev->reset_gpio) {
439-
gpiod_set_value(dev->reset_gpio, 1);
439+
gpiod_set_value_cansleep(dev->reset_gpio, 1);
440440
mdelay(10);
441-
gpiod_set_value(dev->reset_gpio, 0);
441+
gpiod_set_value_cansleep(dev->reset_gpio, 0);
442442
}
443443

444444
mutex_init(&dev->dev_mutex);
@@ -487,7 +487,7 @@ void ksz_switch_remove(struct ksz_device *dev)
487487
dsa_unregister_switch(dev->ds);
488488

489489
if (dev->reset_gpio)
490-
gpiod_set_value(dev->reset_gpio, 1);
490+
gpiod_set_value_cansleep(dev->reset_gpio, 1);
491491

492492
}
493493
EXPORT_SYMBOL(ksz_switch_remove);

drivers/net/ethernet/aquantia/atlantic/aq_filters.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,14 @@ int aq_filters_vlans_update(struct aq_nic_s *aq_nic)
843843
return err;
844844

845845
if (aq_nic->ndev->features & NETIF_F_HW_VLAN_CTAG_FILTER) {
846-
if (hweight < AQ_VLAN_MAX_FILTERS)
847-
err = aq_hw_ops->hw_filter_vlan_ctrl(aq_hw, true);
846+
if (hweight < AQ_VLAN_MAX_FILTERS && hweight > 0) {
847+
err = aq_hw_ops->hw_filter_vlan_ctrl(aq_hw,
848+
!(aq_nic->packet_filter & IFF_PROMISC));
849+
aq_nic->aq_nic_cfg.is_vlan_force_promisc = false;
850+
} else {
848851
/* otherwise left in promiscue mode */
852+
aq_nic->aq_nic_cfg.is_vlan_force_promisc = true;
853+
}
849854
}
850855

851856
return err;
@@ -866,6 +871,7 @@ int aq_filters_vlan_offload_off(struct aq_nic_s *aq_nic)
866871
if (unlikely(!aq_hw_ops->hw_filter_vlan_ctrl))
867872
return -EOPNOTSUPP;
868873

874+
aq_nic->aq_nic_cfg.is_vlan_force_promisc = true;
869875
err = aq_hw_ops->hw_filter_vlan_ctrl(aq_hw, false);
870876
if (err)
871877
return err;

drivers/net/ethernet/aquantia/atlantic/aq_nic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ void aq_nic_cfg_start(struct aq_nic_s *self)
126126

127127
cfg->link_speed_msk &= cfg->aq_hw_caps->link_speed_msk;
128128
cfg->features = cfg->aq_hw_caps->hw_features;
129+
cfg->is_vlan_force_promisc = true;
129130
}
130131

131132
static int aq_nic_update_link_status(struct aq_nic_s *self)

drivers/net/ethernet/aquantia/atlantic/aq_nic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct aq_nic_cfg_s {
3535
u32 flow_control;
3636
u32 link_speed_msk;
3737
u32 wol;
38+
bool is_vlan_force_promisc;
3839
u16 is_mc_list_enabled;
3940
u16 mc_list_count;
4041
bool is_autoneg;

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,15 @@ static int hw_atl_b0_hw_packet_filter_set(struct aq_hw_s *self,
778778
unsigned int packet_filter)
779779
{
780780
unsigned int i = 0U;
781+
struct aq_nic_cfg_s *cfg = self->aq_nic_cfg;
782+
783+
hw_atl_rpfl2promiscuous_mode_en_set(self,
784+
IS_FILTER_ENABLED(IFF_PROMISC));
785+
786+
hw_atl_rpf_vlan_prom_mode_en_set(self,
787+
IS_FILTER_ENABLED(IFF_PROMISC) ||
788+
cfg->is_vlan_force_promisc);
781789

782-
hw_atl_rpfl2promiscuous_mode_en_set(self, IS_FILTER_ENABLED(IFF_PROMISC));
783790
hw_atl_rpfl2multicast_flr_en_set(self,
784791
IS_FILTER_ENABLED(IFF_ALLMULTI), 0);
785792

@@ -788,13 +795,13 @@ static int hw_atl_b0_hw_packet_filter_set(struct aq_hw_s *self,
788795

789796
hw_atl_rpfl2broadcast_en_set(self, IS_FILTER_ENABLED(IFF_BROADCAST));
790797

791-
self->aq_nic_cfg->is_mc_list_enabled = IS_FILTER_ENABLED(IFF_MULTICAST);
798+
cfg->is_mc_list_enabled = IS_FILTER_ENABLED(IFF_MULTICAST);
792799

793800
for (i = HW_ATL_B0_MAC_MIN; i < HW_ATL_B0_MAC_MAX; ++i)
794801
hw_atl_rpfl2_uc_flr_en_set(self,
795-
(self->aq_nic_cfg->is_mc_list_enabled &&
796-
(i <= self->aq_nic_cfg->mc_list_count)) ?
797-
1U : 0U, i);
802+
(cfg->is_mc_list_enabled &&
803+
(i <= cfg->mc_list_count)) ?
804+
1U : 0U, i);
798805

799806
return aq_hw_err_from_flags(self);
800807
}
@@ -1086,7 +1093,7 @@ static int hw_atl_b0_hw_vlan_set(struct aq_hw_s *self,
10861093
static int hw_atl_b0_hw_vlan_ctrl(struct aq_hw_s *self, bool enable)
10871094
{
10881095
/* set promisc in case of disabing the vland filter */
1089-
hw_atl_rpf_vlan_prom_mode_en_set(self, !!!enable);
1096+
hw_atl_rpf_vlan_prom_mode_en_set(self, !enable);
10901097

10911098
return aq_hw_err_from_flags(self);
10921099
}

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4180,7 +4180,7 @@ static int macb_probe(struct platform_device *pdev)
41804180
if (PTR_ERR(mac) == -EPROBE_DEFER) {
41814181
err = -EPROBE_DEFER;
41824182
goto err_out_free_netdev;
4183-
} else if (!IS_ERR(mac)) {
4183+
} else if (!IS_ERR_OR_NULL(mac)) {
41844184
ether_addr_copy(bp->dev->dev_addr, mac);
41854185
} else {
41864186
macb_get_hwaddr(bp);

drivers/net/ethernet/emulex/benet/be_ethtool.c

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static void be_self_test(struct net_device *netdev, struct ethtool_test *test,
891891
u64 *data)
892892
{
893893
struct be_adapter *adapter = netdev_priv(netdev);
894-
int status;
894+
int status, cnt;
895895
u8 link_status = 0;
896896

897897
if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) {
@@ -902,6 +902,9 @@ static void be_self_test(struct net_device *netdev, struct ethtool_test *test,
902902

903903
memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM);
904904

905+
/* check link status before offline tests */
906+
link_status = netif_carrier_ok(netdev);
907+
905908
if (test->flags & ETH_TEST_FL_OFFLINE) {
906909
if (be_loopback_test(adapter, BE_MAC_LOOPBACK, &data[0]) != 0)
907910
test->flags |= ETH_TEST_FL_FAILED;
@@ -922,13 +925,26 @@ static void be_self_test(struct net_device *netdev, struct ethtool_test *test,
922925
test->flags |= ETH_TEST_FL_FAILED;
923926
}
924927

925-
status = be_cmd_link_status_query(adapter, NULL, &link_status, 0);
926-
if (status) {
927-
test->flags |= ETH_TEST_FL_FAILED;
928-
data[4] = -1;
929-
} else if (!link_status) {
928+
/* link status was down prior to test */
929+
if (!link_status) {
930930
test->flags |= ETH_TEST_FL_FAILED;
931931
data[4] = 1;
932+
return;
933+
}
934+
935+
for (cnt = 10; cnt; cnt--) {
936+
status = be_cmd_link_status_query(adapter, NULL, &link_status,
937+
0);
938+
if (status) {
939+
test->flags |= ETH_TEST_FL_FAILED;
940+
data[4] = -1;
941+
break;
942+
}
943+
944+
if (link_status)
945+
break;
946+
947+
msleep_interruptible(500);
932948
}
933949
}
934950

drivers/net/ethernet/sis/sis900.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ sis900_open(struct net_device *net_dev)
10571057
sis900_set_mode(sis_priv, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
10581058

10591059
/* Enable all known interrupts by setting the interrupt mask. */
1060-
sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE);
1060+
sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE | TxDESC);
10611061
sw32(cr, RxENA | sr32(cr));
10621062
sw32(ier, IE);
10631063

@@ -1578,7 +1578,7 @@ static void sis900_tx_timeout(struct net_device *net_dev)
15781578
sw32(txdp, sis_priv->tx_ring_dma);
15791579

15801580
/* Enable all known interrupts by setting the interrupt mask. */
1581-
sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE);
1581+
sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE | TxDESC);
15821582
}
15831583

15841584
/**
@@ -1618,7 +1618,7 @@ sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
16181618
spin_unlock_irqrestore(&sis_priv->lock, flags);
16191619
return NETDEV_TX_OK;
16201620
}
1621-
sis_priv->tx_ring[entry].cmdsts = (OWN | skb->len);
1621+
sis_priv->tx_ring[entry].cmdsts = (OWN | INTR | skb->len);
16221622
sw32(cr, TxENA | sr32(cr));
16231623

16241624
sis_priv->cur_tx ++;
@@ -1674,7 +1674,7 @@ static irqreturn_t sis900_interrupt(int irq, void *dev_instance)
16741674
do {
16751675
status = sr32(isr);
16761676

1677-
if ((status & (HIBERR|TxURN|TxERR|TxIDLE|RxORN|RxERR|RxOK)) == 0)
1677+
if ((status & (HIBERR|TxURN|TxERR|TxIDLE|TxDESC|RxORN|RxERR|RxOK)) == 0)
16781678
/* nothing intresting happened */
16791679
break;
16801680
handled = 1;
@@ -1684,7 +1684,7 @@ static irqreturn_t sis900_interrupt(int irq, void *dev_instance)
16841684
/* Rx interrupt */
16851685
sis900_rx(net_dev);
16861686

1687-
if (status & (TxURN | TxERR | TxIDLE))
1687+
if (status & (TxURN | TxERR | TxIDLE | TxDESC))
16881688
/* Tx interrupt */
16891689
sis900_finish_xmit(net_dev);
16901690

@@ -1896,8 +1896,8 @@ static void sis900_finish_xmit (struct net_device *net_dev)
18961896

18971897
if (tx_status & OWN) {
18981898
/* The packet is not transmitted yet (owned by hardware) !
1899-
* Note: the interrupt is generated only when Tx Machine
1900-
* is idle, so this is an almost impossible case */
1899+
* Note: this is an almost impossible condition
1900+
* in case of TxDESC ('descriptor interrupt') */
19011901
break;
19021902
}
19031903

@@ -2473,7 +2473,7 @@ static int sis900_resume(struct pci_dev *pci_dev)
24732473
sis900_set_mode(sis_priv, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
24742474

24752475
/* Enable all known interrupts by setting the interrupt mask. */
2476-
sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE);
2476+
sw32(imr, RxSOVR | RxORN | RxERR | RxOK | TxURN | TxERR | TxIDLE | TxDESC);
24772477
sw32(cr, RxENA | sr32(cr));
24782478
sw32(ier, IE);
24792479

drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static int adjust_systime(void __iomem *ioaddr, u32 sec, u32 nsec,
112112
* programmed with (2^32 – <new_sec_value>)
113113
*/
114114
if (gmac4)
115-
sec = (100000000ULL - sec);
115+
sec = -sec;
116116

117117
value = readl(ioaddr + PTP_TCR);
118118
if (value & PTP_TCR_TSCTRLSSR)

0 commit comments

Comments
 (0)