Skip to content

Commit

Permalink
Merge tag 'net-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/netdev/net

Pull networking fixes from Jakub Kicinski:
 "Networking fixes for 5.11-rc7, including fixes from bpf and mac80211
  trees.

  Current release - regressions:

   - ip_tunnel: fix mtu calculation

   - mlx5: fix function calculation for page trees

  Previous releases - regressions:

   - vsock: fix the race conditions in multi-transport support

   - neighbour: prevent a dead entry from updating gc_list

   - dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add

  Previous releases - always broken:

   - bpf, cgroup: two copy_{from,to}_user() warn_on_once splats for BPF
     cgroup getsockopt infra when user space is trying to race against
     optlen, from Loris Reiff.

   - bpf: add missing fput() in BPF inode storage map update helper

   - udp: ipv4: manipulate network header of NATed UDP GRO fraglist

   - mac80211: fix station rate table updates on assoc

   - r8169: work around RTL8125 UDP HW bug

   - igc: report speed and duplex as unknown when device is runtime
     suspended

   - rxrpc: fix deadlock around release of dst cached on udp tunnel"

* tag 'net-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (36 commits)
  net: hsr: align sup_multicast_addr in struct hsr_priv to u16 boundary
  net: ipa: fix two format specifier errors
  net: ipa: use the right accessor in ipa_endpoint_status_skip()
  net: ipa: be explicit about endianness
  net: ipa: add a missing __iomem attribute
  net: ipa: pass correct dma_handle to dma_free_coherent()
  r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set
  net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS
  net: mvpp2: TCAM entry enable should be written after SRAM data
  net: lapb: Copy the skb before sending a packet
  net/mlx5e: Release skb in case of failure in tc update skb
  net/mlx5e: Update max_opened_tc also when channels are closed
  net/mlx5: Fix leak upon failure of rule creation
  net/mlx5: Fix function calculation for page trees
  docs: networking: swap words in icmp_errors_use_inbound_ifaddr doc
  udp: ipv4: manipulate network header of NATed UDP GRO fraglist
  net: ip_tunnel: fix mtu calculation
  vsock: fix the race conditions in multi-transport support
  net: sched: replaced invalid qdisc tree flush helper in qdisc_replace
  ibmvnic: device remove has higher precedence over reset
  ...
  • Loading branch information
Linus Torvalds committed Feb 2, 2021
2 parents 88bb507 + 6c9f18f commit a992562
Show file tree
Hide file tree
Showing 44 changed files with 328 additions and 107 deletions.
2 changes: 1 addition & 1 deletion Documentation/networking/ip-sysctl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ icmp_errors_use_inbound_ifaddr - BOOLEAN

If non-zero, the message will be sent with the primary address of
the interface that received the packet that caused the icmp error.
This is the behaviour network many administrators will expect from
This is the behaviour many network administrators will expect from
a router. And it can make debugging complicated network layouts
much easier.

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/arcnet/arc-rimi.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static int __init arc_rimi_init(void)
dev->irq = 9;

if (arcrimi_probe(dev)) {
free_netdev(dev);
free_arcdev(dev);
return -EIO;
}

Expand All @@ -349,7 +349,7 @@ static void __exit arc_rimi_exit(void)
iounmap(lp->mem_start);
release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
free_irq(dev->irq, dev);
free_netdev(dev);
free_arcdev(dev);
}

#ifndef MODULE
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/arcnet/arcdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ struct arcnet_local {

int excnak_pending; /* We just got an excesive nak interrupt */

/* RESET flag handling */
int reset_in_progress;
struct work_struct reset_work;

struct {
uint16_t sequence; /* sequence number (incs with each packet) */
__be16 aborted_seq;
Expand Down Expand Up @@ -350,7 +354,9 @@ void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc)

void arcnet_unregister_proto(struct ArcProto *proto);
irqreturn_t arcnet_interrupt(int irq, void *dev_id);

struct net_device *alloc_arcdev(const char *name);
void free_arcdev(struct net_device *dev);

int arcnet_open(struct net_device *dev);
int arcnet_close(struct net_device *dev);
Expand Down
66 changes: 62 additions & 4 deletions drivers/net/arcnet/arcnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,44 @@ static void arcnet_timer(struct timer_list *t)
struct arcnet_local *lp = from_timer(lp, t, timer);
struct net_device *dev = lp->dev;

if (!netif_carrier_ok(dev)) {
spin_lock_irq(&lp->lock);

if (!lp->reset_in_progress && !netif_carrier_ok(dev)) {
netif_carrier_on(dev);
netdev_info(dev, "link up\n");
}

spin_unlock_irq(&lp->lock);
}

static void reset_device_work(struct work_struct *work)
{
struct arcnet_local *lp;
struct net_device *dev;

lp = container_of(work, struct arcnet_local, reset_work);
dev = lp->dev;

/* Do not bring the network interface back up if an ifdown
* was already done.
*/
if (!netif_running(dev) || !lp->reset_in_progress)
return;

rtnl_lock();

/* Do another check, in case of an ifdown that was triggered in
* the small race window between the exit condition above and
* acquiring RTNL.
*/
if (!netif_running(dev) || !lp->reset_in_progress)
goto out;

dev_close(dev);
dev_open(dev, NULL);

out:
rtnl_unlock();
}

static void arcnet_reply_tasklet(unsigned long data)
Expand Down Expand Up @@ -452,12 +486,25 @@ struct net_device *alloc_arcdev(const char *name)
lp->dev = dev;
spin_lock_init(&lp->lock);
timer_setup(&lp->timer, arcnet_timer, 0);
INIT_WORK(&lp->reset_work, reset_device_work);
}

return dev;
}
EXPORT_SYMBOL(alloc_arcdev);

void free_arcdev(struct net_device *dev)
{
struct arcnet_local *lp = netdev_priv(dev);

/* Do not cancel this at ->ndo_close(), as the workqueue itself
* indirectly calls the ifdown path through dev_close().
*/
cancel_work_sync(&lp->reset_work);
free_netdev(dev);
}
EXPORT_SYMBOL(free_arcdev);

/* Open/initialize the board. This is called sometime after booting when
* the 'ifconfig' program is run.
*
Expand Down Expand Up @@ -587,6 +634,10 @@ int arcnet_close(struct net_device *dev)

/* shut down the card */
lp->hw.close(dev);

/* reset counters */
lp->reset_in_progress = 0;

module_put(lp->hw.owner);
return 0;
}
Expand Down Expand Up @@ -820,6 +871,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)

spin_lock_irqsave(&lp->lock, flags);

if (lp->reset_in_progress)
goto out;

/* RESET flag was enabled - if device is not running, we must
* clear it right away (but nothing else).
*/
Expand Down Expand Up @@ -852,11 +906,14 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
if (status & RESETflag) {
arc_printk(D_NORMAL, dev, "spurious reset (status=%Xh)\n",
status);
arcnet_close(dev);
arcnet_open(dev);

lp->reset_in_progress = 1;
netif_stop_queue(dev);
netif_carrier_off(dev);
schedule_work(&lp->reset_work);

/* get out of the interrupt handler! */
break;
goto out;
}
/* RX is inhibited - we must have received something.
* Prepare to receive into the next buffer.
Expand Down Expand Up @@ -1052,6 +1109,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
udelay(1);
lp->hw.intmask(dev, lp->intmask);

out:
spin_unlock_irqrestore(&lp->lock, flags);
return retval;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/arcnet/com20020-isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static int __init com20020_init(void)
dev->irq = 9;

if (com20020isa_probe(dev)) {
free_netdev(dev);
free_arcdev(dev);
return -EIO;
}

Expand All @@ -182,7 +182,7 @@ static void __exit com20020_exit(void)
unregister_netdev(my_dev);
free_irq(my_dev->irq, my_dev);
release_region(my_dev->base_addr, ARCNET_TOTAL_SIZE);
free_netdev(my_dev);
free_arcdev(my_dev);
}

#ifndef MODULE
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/arcnet/com20020-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ static void com20020pci_remove(struct pci_dev *pdev)

unregister_netdev(dev);
free_irq(dev->irq, dev);
free_netdev(dev);
free_arcdev(dev);
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/arcnet/com20020_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static void com20020_detach(struct pcmcia_device *link)
dev = info->dev;
if (dev) {
dev_dbg(&link->dev, "kfree...\n");
free_netdev(dev);
free_arcdev(dev);
}
dev_dbg(&link->dev, "kfree2...\n");
kfree(info);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/arcnet/com90io.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ static int __init com90io_init(void)
err = com90io_probe(dev);

if (err) {
free_netdev(dev);
free_arcdev(dev);
return err;
}

Expand All @@ -419,7 +419,7 @@ static void __exit com90io_exit(void)

free_irq(dev->irq, dev);
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
free_netdev(dev);
free_arcdev(dev);
}

module_init(com90io_init)
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/arcnet/com90xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem,
err_release_mem:
release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
err_free_dev:
free_netdev(dev);
free_arcdev(dev);
return -EIO;
}

Expand Down Expand Up @@ -672,7 +672,7 @@ static void __exit com90xx_exit(void)
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
release_mem_region(dev->mem_start,
dev->mem_end - dev->mem_start + 1);
free_netdev(dev);
free_arcdev(dev);
}
}

Expand Down
6 changes: 5 additions & 1 deletion drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,11 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port,
if (!entry.portvec)
entry.state = 0;
} else {
entry.portvec |= BIT(port);
if (state == MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC)
entry.portvec = BIT(port);
else
entry.portvec |= BIT(port);

entry.state = state;
}

Expand Down
5 changes: 0 additions & 5 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -5444,11 +5444,6 @@ static int ibmvnic_remove(struct vio_dev *dev)
unsigned long flags;

spin_lock_irqsave(&adapter->state_lock, flags);
if (test_bit(0, &adapter->resetting)) {
spin_unlock_irqrestore(&adapter->state_lock, flags);
return -EBUSY;
}

adapter->state = VNIC_REMOVING;
spin_unlock_irqrestore(&adapter->state_lock, flags);

Expand Down
13 changes: 1 addition & 12 deletions drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf)

pfe.event = VIRTCHNL_EVENT_LINK_CHANGE;
pfe.severity = PF_EVENT_SEVERITY_INFO;

/* Always report link is down if the VF queues aren't enabled */
if (!vf->queues_enabled) {
pfe.event_data.link_event.link_status = false;
pfe.event_data.link_event.link_speed = 0;
} else if (vf->link_forced) {
if (vf->link_forced) {
pfe.event_data.link_event.link_status = vf->link_up;
pfe.event_data.link_event.link_speed =
(vf->link_up ? i40e_virtchnl_link_speed(ls->link_speed) : 0);
Expand All @@ -70,7 +65,6 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf)
pfe.event_data.link_event.link_speed =
i40e_virtchnl_link_speed(ls->link_speed);
}

i40e_aq_send_msg_to_vf(hw, abs_vf_id, VIRTCHNL_OP_EVENT,
0, (u8 *)&pfe, sizeof(pfe), NULL);
}
Expand Down Expand Up @@ -2443,8 +2437,6 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg)
}
}

vf->queues_enabled = true;

error_param:
/* send the response to the VF */
return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES,
Expand All @@ -2466,9 +2458,6 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg)
struct i40e_pf *pf = vf->pf;
i40e_status aq_ret = 0;

/* Immediately mark queues as disabled */
vf->queues_enabled = false;

if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
aq_ret = I40E_ERR_PARAM;
goto error_param;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ struct i40e_vf {
unsigned int tx_rate; /* Tx bandwidth limit in Mbps */
bool link_forced;
bool link_up; /* only valid if VF link is forced */
bool queues_enabled; /* true if the VF queues are enabled */
bool spoofchk;
u16 num_vlan;

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/intel/igc/igc_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,8 @@ static int igc_ethtool_get_link_ksettings(struct net_device *netdev,
Asym_Pause);
}

status = rd32(IGC_STATUS);
status = pm_runtime_suspended(&adapter->pdev->dev) ?
0 : rd32(IGC_STATUS);

if (status & IGC_STATUS_LU) {
if (status & IGC_STATUS_SPEED_1000) {
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ethernet/intel/igc/igc_i225.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,16 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
u16 *data)
{
struct igc_nvm_info *nvm = &hw->nvm;
s32 ret_val = -IGC_ERR_NVM;
u32 attempts = 100000;
u32 i, k, eewr = 0;
s32 ret_val = 0;

/* A check for invalid values: offset too large, too many words,
* too many words for the offset, and not enough words.
*/
if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) ||
words == 0) {
hw_dbg("nvm parameter(s) out of bounds\n");
ret_val = -IGC_ERR_NVM;
goto out;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/igc/igc_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)
}

out:
return 0;
return ret_val;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ static int mvpp2_prs_hw_write(struct mvpp2 *priv, struct mvpp2_prs_entry *pe)
/* Clear entry invalidation bit */
pe->tcam[MVPP2_PRS_TCAM_INV_WORD] &= ~MVPP2_PRS_TCAM_INV_MASK;

/* Write tcam index - indirect access */
mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index);
for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++)
mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]);

/* Write sram index - indirect access */
mvpp2_write(priv, MVPP2_PRS_SRAM_IDX_REG, pe->index);
for (i = 0; i < MVPP2_PRS_SRAM_WORDS; i++)
mvpp2_write(priv, MVPP2_PRS_SRAM_DATA_REG(i), pe->sram[i]);

/* Write tcam index - indirect access */
mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index);
for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++)
mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]);

return 0;
}

Expand Down
6 changes: 2 additions & 4 deletions drivers/net/ethernet/mellanox/mlx5/core/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3627,12 +3627,10 @@ static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv,

err = mlx5e_safe_switch_channels(priv, &new_channels,
mlx5e_num_channels_changed_ctx, NULL);
if (err)
goto out;

priv->max_opened_tc = max_t(u8, priv->max_opened_tc,
new_channels.params.num_tc);
out:
priv->max_opened_tc = max_t(u8, priv->max_opened_tc,
priv->channels.params.num_tc);
mutex_unlock(&priv->state_lock);
return err;
}
Expand Down
Loading

0 comments on commit a992562

Please sign in to comment.