Skip to content

Commit 4cf7562

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: "Another batch of fixes: 1) Remove nft_compat counter flush optimization, it generates warnings from the refcount infrastructure. From Florian Westphal. 2) Fix BPF to search for build id more robustly, from Jiri Olsa. 3) Handle bogus getopt lengths in ebtables, from Florian Westphal. 4) Infoleak and other fixes to j1939 CAN driver, from Eric Dumazet and Oleksij Rempel. 5) Reset iter properly on mptcp sendmsg() error, from Florian Westphal. 6) Show a saner speed in bonding broadcast mode, from Jarod Wilson. 7) Various kerneldoc fixes in bonding and elsewhere, from Lee Jones. 8) Fix double unregister in bonding during namespace tear down, from Cong Wang. 9) Disable RP filter during icmp_redirect selftest, from David Ahern" * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (75 commits) otx2_common: Use devm_kcalloc() in otx2_config_npa() net: qrtr: fix usage of idr in port assignment to socket selftests: disable rp_filter for icmp_redirect.sh Revert "net: xdp: pull ethernet header off packet after computing skb->protocol" phylink: <linux/phylink.h>: fix function prototype kernel-doc warning mptcp: sendmsg: reset iter on error redux net: devlink: Remove overzealous WARN_ON with snapshots tipc: not enable tipc when ipv6 works as a module tipc: fix uninit skb->data in tipc_nl_compat_dumpit() net: Fix potential wrong skb->protocol in skb_vlan_untag() net: xdp: pull ethernet header off packet after computing skb->protocol ipvlan: fix device features bonding: fix a potential double-unregister can: j1939: add rxtimer for multipacket broadcast session can: j1939: abort multipacket broadcast session when timeout occurs can: j1939: cancel rxtimer on multipacket broadcast session complete can: j1939: fix support for multipacket broadcast message net: fddi: skfp: cfm: Remove seemingly unused variable 'ID_sccs' net: fddi: skfp: cfm: Remove set but unused variable 'oldstate' net: fddi: skfp: smt: Remove seemingly unused variable 'ID_sccs' ...
2 parents 29e44f4 + bf2bcd6 commit 4cf7562

Some content is hidden

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

76 files changed

+768
-349
lines changed

Documentation/bpf/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ Two sets of Questions and Answers (Q&A) are maintained.
3636
bpf_devel_QA
3737

3838

39+
Helper functions
40+
================
41+
42+
* `bpf-helpers(7)`_ maintains a list of helpers available to eBPF programs.
43+
44+
3945
Program types
4046
=============
4147

@@ -79,4 +85,5 @@ Other
7985
.. _networking-filter: ../networking/filter.rst
8086
.. _man-pages: https://www.kernel.org/doc/man-pages/
8187
.. _bpf(2): https://man7.org/linux/man-pages/man2/bpf.2.html
88+
.. _bpf-helpers(7): https://man7.org/linux/man-pages/man7/bpf-helpers.7.html
8289
.. _BPF and XDP Reference Guide: https://docs.cilium.io/en/latest/bpf/

Documentation/networking/bonding.rst

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,17 +2860,6 @@ version of the linux kernel, found on http://kernel.org
28602860
The latest version of this document can be found in the latest kernel
28612861
source (named Documentation/networking/bonding.rst).
28622862

2863-
Discussions regarding the usage of the bonding driver take place on the
2864-
bonding-devel mailing list, hosted at sourceforge.net. If you have questions or
2865-
problems, post them to the list. The list address is:
2866-
2867-
2868-
2869-
The administrative interface (to subscribe or unsubscribe) can
2870-
be found at:
2871-
2872-
https://lists.sourceforge.net/lists/listinfo/bonding-devel
2873-
28742863
Discussions regarding the development of the bonding driver take place
28752864
on the main Linux network mailing list, hosted at vger.kernel.org. The list
28762865
address is:
@@ -2881,10 +2870,3 @@ The administrative interface (to subscribe or unsubscribe) can
28812870
be found at:
28822871

28832872
http://vger.kernel.org/vger-lists.html#netdev
2884-
2885-
Donald Becker's Ethernet Drivers and diag programs may be found at :
2886-
2887-
- http://web.archive.org/web/%2E/http://www.scyld.com/network/
2888-
2889-
You will also find a lot of information regarding Ethernet, NWay, MII,
2890-
etc. at www.scyld.com.

drivers/net/bonding/bond_3ad.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static inline struct bonding *__get_bond_by_port(struct port *port)
130130

131131
/**
132132
* __get_first_agg - get the first aggregator in the bond
133-
* @bond: the bond we're looking at
133+
* @port: the port we're looking at
134134
*
135135
* Return the aggregator of the first slave in @bond, or %NULL if it can't be
136136
* found.
@@ -1626,7 +1626,7 @@ static int agg_device_up(const struct aggregator *agg)
16261626

16271627
/**
16281628
* ad_agg_selection_logic - select an aggregation group for a team
1629-
* @aggregator: the aggregator we're looking at
1629+
* @agg: the aggregator we're looking at
16301630
* @update_slave_arr: Does slave array need update?
16311631
*
16321632
* It is assumed that only one aggregator may be selected for a team.
@@ -1810,7 +1810,7 @@ static void ad_initialize_agg(struct aggregator *aggregator)
18101810

18111811
/**
18121812
* ad_initialize_port - initialize a given port's parameters
1813-
* @aggregator: the aggregator we're looking at
1813+
* @port: the port we're looking at
18141814
* @lacp_fast: boolean. whether fast periodic should be used
18151815
*/
18161816
static void ad_initialize_port(struct port *port, int lacp_fast)
@@ -1967,6 +1967,7 @@ static void ad_marker_response_received(struct bond_marker *marker,
19671967
/**
19681968
* bond_3ad_initiate_agg_selection - initate aggregator selection
19691969
* @bond: bonding struct
1970+
* @timeout: timeout value to set
19701971
*
19711972
* Set the aggregation selection timer, to initiate an agg selection in
19721973
* the very near future. Called during first initialization, and during
@@ -2259,7 +2260,7 @@ void bond_3ad_update_ad_actor_settings(struct bonding *bond)
22592260

22602261
/**
22612262
* bond_3ad_state_machine_handler - handle state machines timeout
2262-
* @bond: bonding struct to work on
2263+
* @work: work context to fetch bonding struct to work on from
22632264
*
22642265
* The state machine handling concept in this module is to check every tick
22652266
* which state machine should operate any function. The execution order is
@@ -2500,7 +2501,7 @@ void bond_3ad_adapter_speed_duplex_changed(struct slave *slave)
25002501
/**
25012502
* bond_3ad_handle_link_change - handle a slave's link status change indication
25022503
* @slave: slave struct to work on
2503-
* @status: whether the link is now up or down
2504+
* @link: whether the link is now up or down
25042505
*
25052506
* Handle reselection of aggregator (if needed) for this port.
25062507
*/
@@ -2551,7 +2552,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
25512552

25522553
/**
25532554
* bond_3ad_set_carrier - set link state for bonding master
2554-
* @bond - bonding structure
2555+
* @bond: bonding structure
25552556
*
25562557
* if we have an active aggregator, we're up, if not, we're down.
25572558
* Presumes that we cannot have an active aggregator if there are
@@ -2664,7 +2665,7 @@ int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
26642665

26652666
/**
26662667
* bond_3ad_update_lacp_rate - change the lacp rate
2667-
* @bond - bonding struct
2668+
* @bond: bonding struct
26682669
*
26692670
* When modify lacp_rate parameter via sysfs,
26702671
* update actor_oper_port_state of each port.

drivers/net/bonding/bond_alb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,8 +1206,8 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
12061206

12071207
/**
12081208
* alb_set_mac_address
1209-
* @bond:
1210-
* @addr:
1209+
* @bond: bonding we're working on
1210+
* @addr: MAC address to set
12111211
*
12121212
* In TLB mode all slaves are configured to the bond's hw address, but set
12131213
* their dev_addr field to different addresses (based on their permanent hw

drivers/net/bonding/bond_main.c

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
322322
/**
323323
* bond_vlan_rx_add_vid - Propagates adding an id to slaves
324324
* @bond_dev: bonding net device that got called
325+
* @proto: network protocol ID
325326
* @vid: vlan id being added
326327
*/
327328
static int bond_vlan_rx_add_vid(struct net_device *bond_dev,
@@ -355,6 +356,7 @@ static int bond_vlan_rx_add_vid(struct net_device *bond_dev,
355356
/**
356357
* bond_vlan_rx_kill_vid - Propagates deleting an id to slaves
357358
* @bond_dev: bonding net device that got called
359+
* @proto: network protocol ID
358360
* @vid: vlan id being removed
359361
*/
360362
static int bond_vlan_rx_kill_vid(struct net_device *bond_dev,
@@ -948,7 +950,7 @@ static bool bond_should_notify_peers(struct bonding *bond)
948950
/**
949951
* change_active_interface - change the active slave into the specified one
950952
* @bond: our bonding struct
951-
* @new: the new slave to make the active one
953+
* @new_active: the new slave to make the active one
952954
*
953955
* Set the new slave to the bond's settings and unset them on the old
954956
* curr_active_slave.
@@ -2205,7 +2207,8 @@ static int bond_release_and_destroy(struct net_device *bond_dev,
22052207
int ret;
22062208

22072209
ret = __bond_release_one(bond_dev, slave_dev, false, true);
2208-
if (ret == 0 && !bond_has_slaves(bond)) {
2210+
if (ret == 0 && !bond_has_slaves(bond) &&
2211+
bond_dev->reg_state != NETREG_UNREGISTERING) {
22092212
bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
22102213
netdev_info(bond_dev, "Destroying bond\n");
22112214
bond_remove_proc_entry(bond);
@@ -4552,13 +4555,23 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
45524555
return ret;
45534556
}
45544557

4558+
static u32 bond_mode_bcast_speed(struct slave *slave, u32 speed)
4559+
{
4560+
if (speed == 0 || speed == SPEED_UNKNOWN)
4561+
speed = slave->speed;
4562+
else
4563+
speed = min(speed, slave->speed);
4564+
4565+
return speed;
4566+
}
4567+
45554568
static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
45564569
struct ethtool_link_ksettings *cmd)
45574570
{
45584571
struct bonding *bond = netdev_priv(bond_dev);
4559-
unsigned long speed = 0;
45604572
struct list_head *iter;
45614573
struct slave *slave;
4574+
u32 speed = 0;
45624575

45634576
cmd->base.duplex = DUPLEX_UNKNOWN;
45644577
cmd->base.port = PORT_OTHER;
@@ -4570,8 +4583,13 @@ static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
45704583
*/
45714584
bond_for_each_slave(bond, slave, iter) {
45724585
if (bond_slave_can_tx(slave)) {
4573-
if (slave->speed != SPEED_UNKNOWN)
4574-
speed += slave->speed;
4586+
if (slave->speed != SPEED_UNKNOWN) {
4587+
if (BOND_MODE(bond) == BOND_MODE_BROADCAST)
4588+
speed = bond_mode_bcast_speed(slave,
4589+
speed);
4590+
else
4591+
speed += slave->speed;
4592+
}
45754593
if (cmd->base.duplex == DUPLEX_UNKNOWN &&
45764594
slave->duplex != DUPLEX_UNKNOWN)
45774595
cmd->base.duplex = slave->duplex;

drivers/net/ethernet/3com/3c574_cs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev)
951951
static void update_stats(struct net_device *dev)
952952
{
953953
unsigned int ioaddr = dev->base_addr;
954-
u8 rx, tx, up;
954+
u8 up;
955955

956956
pr_debug("%s: updating the statistics.\n", dev->name);
957957

@@ -972,8 +972,8 @@ static void update_stats(struct net_device *dev)
972972
dev->stats.tx_packets += (up&0x30) << 4;
973973
/* Rx packets */ inb(ioaddr + 7);
974974
/* Tx deferrals */ inb(ioaddr + 8);
975-
rx = inw(ioaddr + 10);
976-
tx = inw(ioaddr + 12);
975+
/* rx */ inw(ioaddr + 10);
976+
/* tx */ inw(ioaddr + 12);
977977

978978
EL3WINDOW(4);
979979
/* BadSSD */ inb(ioaddr + 12);

drivers/net/ethernet/8390/axnet_cs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ static int ax_close(struct net_device *dev)
898898
/**
899899
* axnet_tx_timeout - handle transmit time out condition
900900
* @dev: network device which has apparently fallen asleep
901+
* @txqueue: unused
901902
*
902903
* Called by kernel when device never acknowledges a transmit has
903904
* completed (or failed) - i.e. never posted a Tx related interrupt.

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3715,11 +3715,11 @@ fec_probe(struct platform_device *pdev)
37153715
failed_irq:
37163716
failed_init:
37173717
fec_ptp_stop(pdev);
3718-
if (fep->reg_phy)
3719-
regulator_disable(fep->reg_phy);
37203718
failed_reset:
37213719
pm_runtime_put_noidle(&pdev->dev);
37223720
pm_runtime_disable(&pdev->dev);
3721+
if (fep->reg_phy)
3722+
regulator_disable(fep->reg_phy);
37233723
failed_regulator:
37243724
clk_disable_unprepare(fep->clk_ahb);
37253725
failed_clk_ahb:

drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes {
981981
#define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04
982982
#define I40E_AQC_SET_VSI_DEFAULT 0x08
983983
#define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10
984-
#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000
984+
#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000
985985
__le16 seid;
986986
__le16 vlan_tag;
987987
#define I40E_AQC_SET_VSI_VLAN_VALID 0x8000

drivers/net/ethernet/intel/i40e/i40e_common.c

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,21 @@ i40e_status i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
19661966
return status;
19671967
}
19681968

1969+
/**
1970+
* i40e_is_aq_api_ver_ge
1971+
* @aq: pointer to AdminQ info containing HW API version to compare
1972+
* @maj: API major value
1973+
* @min: API minor value
1974+
*
1975+
* Assert whether current HW API version is greater/equal than provided.
1976+
**/
1977+
static bool i40e_is_aq_api_ver_ge(struct i40e_adminq_info *aq, u16 maj,
1978+
u16 min)
1979+
{
1980+
return (aq->api_maj_ver > maj ||
1981+
(aq->api_maj_ver == maj && aq->api_min_ver >= min));
1982+
}
1983+
19691984
/**
19701985
* i40e_aq_add_vsi
19711986
* @hw: pointer to the hw struct
@@ -2091,18 +2106,16 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
20912106

20922107
if (set) {
20932108
flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
2094-
if (rx_only_promisc &&
2095-
(((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) ||
2096-
(hw->aq.api_maj_ver > 1)))
2097-
flags |= I40E_AQC_SET_VSI_PROMISC_TX;
2109+
if (rx_only_promisc && i40e_is_aq_api_ver_ge(&hw->aq, 1, 5))
2110+
flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY;
20982111
}
20992112

21002113
cmd->promiscuous_flags = cpu_to_le16(flags);
21012114

21022115
cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_UNICAST);
2103-
if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) ||
2104-
(hw->aq.api_maj_ver > 1))
2105-
cmd->valid_flags |= cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_TX);
2116+
if (i40e_is_aq_api_ver_ge(&hw->aq, 1, 5))
2117+
cmd->valid_flags |=
2118+
cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY);
21062119

21072120
cmd->seid = cpu_to_le16(seid);
21082121
status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
@@ -2199,11 +2212,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
21992212
i40e_fill_default_direct_cmd_desc(&desc,
22002213
i40e_aqc_opc_set_vsi_promiscuous_modes);
22012214

2202-
if (enable)
2215+
if (enable) {
22032216
flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
2217+
if (i40e_is_aq_api_ver_ge(&hw->aq, 1, 5))
2218+
flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY;
2219+
}
22042220

22052221
cmd->promiscuous_flags = cpu_to_le16(flags);
22062222
cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_UNICAST);
2223+
if (i40e_is_aq_api_ver_ge(&hw->aq, 1, 5))
2224+
cmd->valid_flags |=
2225+
cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY);
22072226
cmd->seid = cpu_to_le16(seid);
22082227
cmd->vlan_tag = cpu_to_le16(vid | I40E_AQC_SET_VSI_VLAN_VALID);
22092228

0 commit comments

Comments
 (0)