mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
Merge 3aaf0a27ff ("Merge tag 'clang-format-for-linux-v5.11-rc7' of git://github.com/ojeda/linux") into android-mainline
Steps on the way to 5.11-rc7 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ie42c0b673d6b3c832fecf7665125b7fbdca3caa6
This commit is contained in:
commit
4fb49de702
|
|
@ -122,6 +122,7 @@ ForEachMacros:
|
|||
- 'drm_for_each_bridge_in_chain'
|
||||
- 'drm_for_each_connector_iter'
|
||||
- 'drm_for_each_crtc'
|
||||
- 'drm_for_each_crtc_reverse'
|
||||
- 'drm_for_each_encoder'
|
||||
- 'drm_for_each_encoder_mask'
|
||||
- 'drm_for_each_fb'
|
||||
|
|
@ -203,14 +204,13 @@ ForEachMacros:
|
|||
- 'for_each_matching_node'
|
||||
- 'for_each_matching_node_and_match'
|
||||
- 'for_each_member'
|
||||
- 'for_each_mem_region'
|
||||
- 'for_each_memblock_type'
|
||||
- 'for_each_memcg_cache_index'
|
||||
- 'for_each_mem_pfn_range'
|
||||
- '__for_each_mem_range'
|
||||
- 'for_each_mem_range'
|
||||
- '__for_each_mem_range_rev'
|
||||
- 'for_each_mem_range_rev'
|
||||
- 'for_each_mem_region'
|
||||
- 'for_each_migratetype_order'
|
||||
- 'for_each_msi_entry'
|
||||
- 'for_each_msi_entry_safe'
|
||||
|
|
@ -276,10 +276,8 @@ ForEachMacros:
|
|||
- 'for_each_reserved_mem_range'
|
||||
- 'for_each_reserved_mem_region'
|
||||
- 'for_each_rtd_codec_dais'
|
||||
- 'for_each_rtd_codec_dais_rollback'
|
||||
- 'for_each_rtd_components'
|
||||
- 'for_each_rtd_cpu_dais'
|
||||
- 'for_each_rtd_cpu_dais_rollback'
|
||||
- 'for_each_rtd_dais'
|
||||
- 'for_each_set_bit'
|
||||
- 'for_each_set_bit_from'
|
||||
|
|
@ -298,6 +296,7 @@ ForEachMacros:
|
|||
- '__for_each_thread'
|
||||
- 'for_each_thread'
|
||||
- 'for_each_unicast_dest_pgid'
|
||||
- 'for_each_vsi'
|
||||
- 'for_each_wakeup_source'
|
||||
- 'for_each_zone'
|
||||
- 'for_each_zone_zonelist'
|
||||
|
|
@ -330,6 +329,7 @@ ForEachMacros:
|
|||
- 'hlist_for_each_entry_rcu_bh'
|
||||
- 'hlist_for_each_entry_rcu_notrace'
|
||||
- 'hlist_for_each_entry_safe'
|
||||
- 'hlist_for_each_entry_srcu'
|
||||
- '__hlist_for_each_rcu'
|
||||
- 'hlist_for_each_safe'
|
||||
- 'hlist_nulls_for_each_entry'
|
||||
|
|
@ -378,6 +378,7 @@ ForEachMacros:
|
|||
- 'list_for_each_entry_safe_continue'
|
||||
- 'list_for_each_entry_safe_from'
|
||||
- 'list_for_each_entry_safe_reverse'
|
||||
- 'list_for_each_entry_srcu'
|
||||
- 'list_for_each_prev'
|
||||
- 'list_for_each_prev_safe'
|
||||
- 'list_for_each_safe'
|
||||
|
|
@ -411,6 +412,8 @@ ForEachMacros:
|
|||
- 'of_property_for_each_string'
|
||||
- 'of_property_for_each_u32'
|
||||
- 'pci_bus_for_each_resource'
|
||||
- 'pcl_for_each_chunk'
|
||||
- 'pcl_for_each_segment'
|
||||
- 'pcm_for_each_format'
|
||||
- 'ping_portaddr_for_each_entry'
|
||||
- 'plist_for_each'
|
||||
|
|
|
|||
|
|
@ -13,6 +13,22 @@ This file documents the driver for the Rockchip ISP1 that is part of RK3288
|
|||
and RK3399 SoCs. The driver is located under drivers/staging/media/rkisp1
|
||||
and uses the Media-Controller API.
|
||||
|
||||
Revisions
|
||||
=========
|
||||
|
||||
There exist multiple smaller revisions to this ISP that got introduced in
|
||||
later SoCs. Revisions can be found in the enum :c:type:`rkisp1_cif_isp_version`
|
||||
in the UAPI and the revision of the ISP inside the running SoC can be read
|
||||
in the field hw_revision of struct media_device_info as returned by
|
||||
ioctl MEDIA_IOC_DEVICE_INFO.
|
||||
|
||||
Versions in use are:
|
||||
|
||||
- RKISP1_V10: used at least in rk3288 and rk3399
|
||||
- RKISP1_V11: declared in the original vendor code, but not used
|
||||
- RKISP1_V12: used at least in rk3326 and px30
|
||||
- RKISP1_V13: used at least in rk1808
|
||||
|
||||
Topology
|
||||
========
|
||||
.. _rkisp1_topology_graph:
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@
|
|||
struct rkisp1_match_data {
|
||||
const char * const *clks;
|
||||
unsigned int size;
|
||||
enum rkisp1_cif_isp_version isp_ver;
|
||||
};
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
|
|
@ -411,15 +412,16 @@ static const char * const rk3399_isp_clks[] = {
|
|||
"hclk",
|
||||
};
|
||||
|
||||
static const struct rkisp1_match_data rk3399_isp_clk_data = {
|
||||
static const struct rkisp1_match_data rk3399_isp_match_data = {
|
||||
.clks = rk3399_isp_clks,
|
||||
.size = ARRAY_SIZE(rk3399_isp_clks),
|
||||
.isp_ver = RKISP1_V10,
|
||||
};
|
||||
|
||||
static const struct of_device_id rkisp1_of_match[] = {
|
||||
{
|
||||
.compatible = "rockchip,rk3399-cif-isp",
|
||||
.data = &rk3399_isp_clk_data,
|
||||
.data = &rk3399_isp_match_data,
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
|
@ -457,15 +459,15 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
|
|||
|
||||
static int rkisp1_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct rkisp1_match_data *clk_data;
|
||||
const struct rkisp1_match_data *match_data;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct rkisp1_device *rkisp1;
|
||||
struct v4l2_device *v4l2_dev;
|
||||
unsigned int i;
|
||||
int ret, irq;
|
||||
|
||||
clk_data = of_device_get_match_data(&pdev->dev);
|
||||
if (!clk_data)
|
||||
match_data = of_device_get_match_data(&pdev->dev);
|
||||
if (!match_data)
|
||||
return -ENODEV;
|
||||
|
||||
rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL);
|
||||
|
|
@ -494,15 +496,16 @@ static int rkisp1_probe(struct platform_device *pdev)
|
|||
|
||||
rkisp1->irq = irq;
|
||||
|
||||
for (i = 0; i < clk_data->size; i++)
|
||||
rkisp1->clks[i].id = clk_data->clks[i];
|
||||
ret = devm_clk_bulk_get(dev, clk_data->size, rkisp1->clks);
|
||||
for (i = 0; i < match_data->size; i++)
|
||||
rkisp1->clks[i].id = match_data->clks[i];
|
||||
ret = devm_clk_bulk_get(dev, match_data->size, rkisp1->clks);
|
||||
if (ret)
|
||||
return ret;
|
||||
rkisp1->clk_size = clk_data->size;
|
||||
rkisp1->clk_size = match_data->size;
|
||||
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
rkisp1->media_dev.hw_revision = match_data->isp_ver;
|
||||
strscpy(rkisp1->media_dev.model, RKISP1_DRIVER_NAME,
|
||||
sizeof(rkisp1->media_dev.model));
|
||||
rkisp1->media_dev.dev = &pdev->dev;
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ static void rkisp1_goc_config(struct rkisp1_params *params,
|
|||
RKISP1_CIF_ISP_CTRL_ISP_GAMMA_OUT_ENA);
|
||||
rkisp1_write(params->rkisp1, arg->mode, RKISP1_CIF_ISP_GAMMA_OUT_MODE);
|
||||
|
||||
for (i = 0; i < RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES; i++)
|
||||
for (i = 0; i < RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10; i++)
|
||||
rkisp1_write(params->rkisp1, arg->gamma_y[i],
|
||||
RKISP1_CIF_ISP_GAMMA_OUT_Y_0 + i * 4);
|
||||
}
|
||||
|
|
@ -589,7 +589,6 @@ static void rkisp1_hst_config(struct rkisp1_params *params,
|
|||
RKISP1_CIF_ISP_HIST_WEIGHT_22TO03,
|
||||
RKISP1_CIF_ISP_HIST_WEIGHT_13TO43,
|
||||
RKISP1_CIF_ISP_HIST_WEIGHT_04TO34,
|
||||
RKISP1_CIF_ISP_HIST_WEIGHT_44,
|
||||
};
|
||||
const u8 *weight;
|
||||
unsigned int i;
|
||||
|
|
@ -622,6 +621,8 @@ static void rkisp1_hst_config(struct rkisp1_params *params,
|
|||
weight[2],
|
||||
weight[3]),
|
||||
hist_weight_regs[i]);
|
||||
|
||||
rkisp1_write(params->rkisp1, weight[0] & 0x1F, RKISP1_CIF_ISP_HIST_WEIGHT_44);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -365,6 +365,7 @@
|
|||
#define RKISP1_CIF_ISP_MAX_HIST_PREDIVIDER 0x0000007F
|
||||
#define RKISP1_CIF_ISP_HIST_ROW_NUM 5
|
||||
#define RKISP1_CIF_ISP_HIST_COLUMN_NUM 5
|
||||
#define RKISP1_CIF_ISP_HIST_GET_BIN(x) ((x) & 0x000FFFFF)
|
||||
|
||||
/* AUTO FOCUS MEASUREMENT: ISP_AFM_CTRL */
|
||||
#define RKISP1_ISP_AFM_CTRL_ENABLE BIT(0)
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ static void rkisp1_stats_get_aec_meas(struct rkisp1_stats *stats,
|
|||
unsigned int i;
|
||||
|
||||
pbuf->meas_type |= RKISP1_CIF_ISP_STAT_AUTOEXP;
|
||||
for (i = 0; i < RKISP1_CIF_ISP_AE_MEAN_MAX; i++)
|
||||
for (i = 0; i < RKISP1_CIF_ISP_AE_MEAN_MAX_V10; i++)
|
||||
pbuf->params.ae.exp_mean[i] =
|
||||
(u8)rkisp1_read(rkisp1,
|
||||
RKISP1_CIF_ISP_EXP_MEAN_00 + i * 4);
|
||||
|
|
@ -233,10 +233,11 @@ static void rkisp1_stats_get_hst_meas(struct rkisp1_stats *stats,
|
|||
unsigned int i;
|
||||
|
||||
pbuf->meas_type |= RKISP1_CIF_ISP_STAT_HIST;
|
||||
for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX; i++)
|
||||
pbuf->params.hist.hist_bins[i] =
|
||||
(u8)rkisp1_read(rkisp1,
|
||||
RKISP1_CIF_ISP_HIST_BIN_0 + i * 4);
|
||||
for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10; i++) {
|
||||
u32 reg_val = rkisp1_read(rkisp1, RKISP1_CIF_ISP_HIST_BIN_0 + i * 4);
|
||||
|
||||
pbuf->params.hist.hist_bins[i] = RKISP1_CIF_ISP_HIST_GET_BIN(reg_val);
|
||||
}
|
||||
}
|
||||
|
||||
static void rkisp1_stats_get_bls_meas(struct rkisp1_stats *stats,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -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.
|
||||
*
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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).
|
||||
*/
|
||||
|
|
@ -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.
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ static int __init com90io_init(void)
|
|||
err = com90io_probe(dev);
|
||||
|
||||
if (err) {
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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,
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -219,9 +219,9 @@ 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.
|
||||
|
|
@ -229,7 +229,6 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -638,7 +638,7 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)
|
|||
}
|
||||
|
||||
out:
|
||||
return 0;
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1262,8 +1262,10 @@ static void mlx5e_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
|
|||
mlx5e_complete_rx_cqe(rq, cqe, cqe_bcnt, skb);
|
||||
|
||||
if (mlx5e_cqe_regb_chain(cqe))
|
||||
if (!mlx5e_tc_update_skb(cqe, skb))
|
||||
if (!mlx5e_tc_update_skb(cqe, skb)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
goto free_wqe;
|
||||
}
|
||||
|
||||
napi_gro_receive(rq->cq.napi, skb);
|
||||
|
||||
|
|
@ -1316,8 +1318,10 @@ static void mlx5e_handle_rx_cqe_rep(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
|
|||
if (rep->vlan && skb_vlan_tag_present(skb))
|
||||
skb_vlan_pop(skb);
|
||||
|
||||
if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv))
|
||||
if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
goto free_wqe;
|
||||
}
|
||||
|
||||
napi_gro_receive(rq->cq.napi, skb);
|
||||
|
||||
|
|
@ -1371,8 +1375,10 @@ static void mlx5e_handle_rx_cqe_mpwrq_rep(struct mlx5e_rq *rq, struct mlx5_cqe64
|
|||
|
||||
mlx5e_complete_rx_cqe(rq, cqe, cqe_bcnt, skb);
|
||||
|
||||
if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv))
|
||||
if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
goto mpwrq_cqe_out;
|
||||
}
|
||||
|
||||
napi_gro_receive(rq->cq.napi, skb);
|
||||
|
||||
|
|
@ -1528,8 +1534,10 @@ static void mlx5e_handle_rx_cqe_mpwrq(struct mlx5e_rq *rq, struct mlx5_cqe64 *cq
|
|||
mlx5e_complete_rx_cqe(rq, cqe, cqe_bcnt, skb);
|
||||
|
||||
if (mlx5e_cqe_regb_chain(cqe))
|
||||
if (!mlx5e_tc_update_skb(cqe, skb))
|
||||
if (!mlx5e_tc_update_skb(cqe, skb)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
goto mpwrq_cqe_out;
|
||||
}
|
||||
|
||||
napi_gro_receive(rq->cq.napi, skb);
|
||||
|
||||
|
|
|
|||
|
|
@ -1760,6 +1760,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
|
|||
if (!fte_tmp)
|
||||
continue;
|
||||
rule = add_rule_fg(g, spec, flow_act, dest, dest_num, fte_tmp);
|
||||
/* No error check needed here, because insert_fte() is not called */
|
||||
up_write_ref_node(&fte_tmp->node, false);
|
||||
tree_put_node(&fte_tmp->node, false);
|
||||
kmem_cache_free(steering->ftes_cache, fte);
|
||||
|
|
@ -1812,6 +1813,8 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
|
|||
up_write_ref_node(&g->node, false);
|
||||
rule = add_rule_fg(g, spec, flow_act, dest, dest_num, fte);
|
||||
up_write_ref_node(&fte->node, false);
|
||||
if (IS_ERR(rule))
|
||||
tree_put_node(&fte->node, false);
|
||||
return rule;
|
||||
}
|
||||
rule = ERR_PTR(-ENOENT);
|
||||
|
|
@ -1910,6 +1913,8 @@ _mlx5_add_flow_rules(struct mlx5_flow_table *ft,
|
|||
up_write_ref_node(&g->node, false);
|
||||
rule = add_rule_fg(g, spec, flow_act, dest, dest_num, fte);
|
||||
up_write_ref_node(&fte->node, false);
|
||||
if (IS_ERR(rule))
|
||||
tree_put_node(&fte->node, false);
|
||||
tree_put_node(&g->node, false);
|
||||
return rule;
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ enum {
|
|||
|
||||
static u32 get_function(u16 func_id, bool ec_function)
|
||||
{
|
||||
return func_id & (ec_function << 16);
|
||||
return (u32)func_id | (ec_function << 16);
|
||||
}
|
||||
|
||||
static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 function)
|
||||
|
|
|
|||
|
|
@ -4046,17 +4046,72 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
static bool rtl_test_hw_pad_bug(struct rtl8169_private *tp)
|
||||
static bool rtl_skb_is_udp(struct sk_buff *skb)
|
||||
{
|
||||
int no = skb_network_offset(skb);
|
||||
struct ipv6hdr *i6h, _i6h;
|
||||
struct iphdr *ih, _ih;
|
||||
|
||||
switch (vlan_get_protocol(skb)) {
|
||||
case htons(ETH_P_IP):
|
||||
ih = skb_header_pointer(skb, no, sizeof(_ih), &_ih);
|
||||
return ih && ih->protocol == IPPROTO_UDP;
|
||||
case htons(ETH_P_IPV6):
|
||||
i6h = skb_header_pointer(skb, no, sizeof(_i6h), &_i6h);
|
||||
return i6h && i6h->nexthdr == IPPROTO_UDP;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#define RTL_MIN_PATCH_LEN 47
|
||||
|
||||
/* see rtl8125_get_patch_pad_len() in r8125 vendor driver */
|
||||
static unsigned int rtl8125_quirk_udp_padto(struct rtl8169_private *tp,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
unsigned int padto = 0, len = skb->len;
|
||||
|
||||
if (rtl_is_8125(tp) && len < 128 + RTL_MIN_PATCH_LEN &&
|
||||
rtl_skb_is_udp(skb) && skb_transport_header_was_set(skb)) {
|
||||
unsigned int trans_data_len = skb_tail_pointer(skb) -
|
||||
skb_transport_header(skb);
|
||||
|
||||
if (trans_data_len >= offsetof(struct udphdr, len) &&
|
||||
trans_data_len < RTL_MIN_PATCH_LEN) {
|
||||
u16 dest = ntohs(udp_hdr(skb)->dest);
|
||||
|
||||
/* dest is a standard PTP port */
|
||||
if (dest == 319 || dest == 320)
|
||||
padto = len + RTL_MIN_PATCH_LEN - trans_data_len;
|
||||
}
|
||||
|
||||
if (trans_data_len < sizeof(struct udphdr))
|
||||
padto = max_t(unsigned int, padto,
|
||||
len + sizeof(struct udphdr) - trans_data_len);
|
||||
}
|
||||
|
||||
return padto;
|
||||
}
|
||||
|
||||
static unsigned int rtl_quirk_packet_padto(struct rtl8169_private *tp,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
unsigned int padto;
|
||||
|
||||
padto = rtl8125_quirk_udp_padto(tp, skb);
|
||||
|
||||
switch (tp->mac_version) {
|
||||
case RTL_GIGA_MAC_VER_34:
|
||||
case RTL_GIGA_MAC_VER_60:
|
||||
case RTL_GIGA_MAC_VER_61:
|
||||
case RTL_GIGA_MAC_VER_63:
|
||||
return true;
|
||||
padto = max_t(unsigned int, padto, ETH_ZLEN);
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return padto;
|
||||
}
|
||||
|
||||
static void rtl8169_tso_csum_v1(struct sk_buff *skb, u32 *opts)
|
||||
|
|
@ -4128,9 +4183,10 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
|
|||
|
||||
opts[1] |= transport_offset << TCPHO_SHIFT;
|
||||
} else {
|
||||
if (unlikely(skb->len < ETH_ZLEN && rtl_test_hw_pad_bug(tp)))
|
||||
/* eth_skb_pad would free the skb on error */
|
||||
return !__skb_put_padto(skb, ETH_ZLEN, false);
|
||||
unsigned int padto = rtl_quirk_packet_padto(tp, skb);
|
||||
|
||||
/* skb_padto would free the skb on error */
|
||||
return !__skb_put_padto(skb, padto, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -4307,6 +4363,9 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
|
|||
if (skb->len < ETH_ZLEN)
|
||||
features &= ~NETIF_F_CSUM_MASK;
|
||||
|
||||
if (rtl_quirk_packet_padto(tp, skb))
|
||||
features &= ~NETIF_F_CSUM_MASK;
|
||||
|
||||
if (transport_offset > TCPHO_MAX &&
|
||||
rtl_chip_supports_csum_v2(tp))
|
||||
features &= ~NETIF_F_CSUM_MASK;
|
||||
|
|
@ -4645,10 +4704,10 @@ static int rtl8169_close(struct net_device *dev)
|
|||
|
||||
cancel_work_sync(&tp->wk.work);
|
||||
|
||||
phy_disconnect(tp->phydev);
|
||||
|
||||
free_irq(pci_irq_vector(pdev, 0), tp);
|
||||
|
||||
phy_disconnect(tp->phydev);
|
||||
|
||||
dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
|
||||
tp->RxPhyAddr);
|
||||
dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ static void gsi_evt_ring_de_alloc_command(struct gsi *gsi, u32 evt_ring_id)
|
|||
static enum gsi_channel_state gsi_channel_state(struct gsi_channel *channel)
|
||||
{
|
||||
u32 channel_id = gsi_channel_id(channel);
|
||||
void *virt = channel->gsi->virt;
|
||||
void __iomem *virt = channel->gsi->virt;
|
||||
u32 val;
|
||||
|
||||
val = ioread32(virt + GSI_CH_C_CNTXT_0_OFFSET(channel_id));
|
||||
|
|
@ -1373,7 +1373,7 @@ static int gsi_ring_alloc(struct gsi *gsi, struct gsi_ring *ring, u32 count)
|
|||
/* Hardware requires a 2^n ring size, with alignment equal to size */
|
||||
ring->virt = dma_alloc_coherent(dev, size, &addr, GFP_KERNEL);
|
||||
if (ring->virt && addr % size) {
|
||||
dma_free_coherent(dev, size, ring->virt, ring->addr);
|
||||
dma_free_coherent(dev, size, ring->virt, addr);
|
||||
dev_err(dev, "unable to alloc 0x%zx-aligned ring buffer\n",
|
||||
size);
|
||||
return -EINVAL; /* Not a good error value, but distinct */
|
||||
|
|
|
|||
|
|
@ -588,7 +588,7 @@ static void ipa_endpoint_init_hdr_metadata_mask(struct ipa_endpoint *endpoint)
|
|||
|
||||
/* Note that HDR_ENDIANNESS indicates big endian header fields */
|
||||
if (endpoint->data->qmap)
|
||||
val = cpu_to_be32(IPA_ENDPOINT_QMAP_METADATA_MASK);
|
||||
val = (__force u32)cpu_to_be32(IPA_ENDPOINT_QMAP_METADATA_MASK);
|
||||
|
||||
iowrite32(val, endpoint->ipa->reg_virt + offset);
|
||||
}
|
||||
|
|
@ -1164,8 +1164,8 @@ static bool ipa_endpoint_status_skip(struct ipa_endpoint *endpoint,
|
|||
return true;
|
||||
if (!status->pkt_len)
|
||||
return true;
|
||||
endpoint_id = u32_get_bits(status->endp_dst_idx,
|
||||
IPA_STATUS_DST_IDX_FMASK);
|
||||
endpoint_id = u8_get_bits(status->endp_dst_idx,
|
||||
IPA_STATUS_DST_IDX_FMASK);
|
||||
if (endpoint_id != endpoint->endpoint_id)
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ static void ipa_imem_exit(struct ipa *ipa)
|
|||
|
||||
size = iommu_unmap(domain, ipa->imem_iova, ipa->imem_size);
|
||||
if (size != ipa->imem_size)
|
||||
dev_warn(dev, "unmapped %zu IMEM bytes, expected %lu\n",
|
||||
dev_warn(dev, "unmapped %zu IMEM bytes, expected %zu\n",
|
||||
size, ipa->imem_size);
|
||||
} else {
|
||||
dev_err(dev, "couldn't get IPA IOMMU domain for IMEM\n");
|
||||
|
|
@ -440,7 +440,7 @@ static void ipa_smem_exit(struct ipa *ipa)
|
|||
|
||||
size = iommu_unmap(domain, ipa->smem_iova, ipa->smem_size);
|
||||
if (size != ipa->smem_size)
|
||||
dev_warn(dev, "unmapped %zu SMEM bytes, expected %lu\n",
|
||||
dev_warn(dev, "unmapped %zu SMEM bytes, expected %zu\n",
|
||||
size, ipa->smem_size);
|
||||
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -339,8 +339,6 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct
|
|||
|
||||
padapter = rtw_netdev_priv(pnetdev);
|
||||
|
||||
rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj));
|
||||
|
||||
/* 3 3. init driver special setting, interface, OS and hardware relative */
|
||||
|
||||
/* 4 3.1 set hardware operation functions */
|
||||
|
|
@ -378,6 +376,8 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct
|
|||
goto free_hal_data;
|
||||
}
|
||||
|
||||
rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj));
|
||||
|
||||
/* 3 8. get WLan MAC address */
|
||||
/* set mac addr */
|
||||
rtw_macaddr_cfg(&psdio->func->dev, padapter->eeprompriv.mac_addr);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ struct mlx5_vdpa_direct_mr {
|
|||
struct sg_table sg_head;
|
||||
int log_size;
|
||||
int nsg;
|
||||
int nent;
|
||||
struct list_head list;
|
||||
u64 offset;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,17 +25,6 @@ static int get_octo_len(u64 len, int page_shift)
|
|||
return (npages + 1) / 2;
|
||||
}
|
||||
|
||||
static void fill_sg(struct mlx5_vdpa_direct_mr *mr, void *in)
|
||||
{
|
||||
struct scatterlist *sg;
|
||||
__be64 *pas;
|
||||
int i;
|
||||
|
||||
pas = MLX5_ADDR_OF(create_mkey_in, in, klm_pas_mtt);
|
||||
for_each_sg(mr->sg_head.sgl, sg, mr->nsg, i)
|
||||
(*pas) = cpu_to_be64(sg_dma_address(sg));
|
||||
}
|
||||
|
||||
static void mlx5_set_access_mode(void *mkc, int mode)
|
||||
{
|
||||
MLX5_SET(mkc, mkc, access_mode_1_0, mode & 0x3);
|
||||
|
|
@ -45,10 +34,18 @@ static void mlx5_set_access_mode(void *mkc, int mode)
|
|||
static void populate_mtts(struct mlx5_vdpa_direct_mr *mr, __be64 *mtt)
|
||||
{
|
||||
struct scatterlist *sg;
|
||||
int nsg = mr->nsg;
|
||||
u64 dma_addr;
|
||||
u64 dma_len;
|
||||
int j = 0;
|
||||
int i;
|
||||
|
||||
for_each_sg(mr->sg_head.sgl, sg, mr->nsg, i)
|
||||
mtt[i] = cpu_to_be64(sg_dma_address(sg));
|
||||
for_each_sg(mr->sg_head.sgl, sg, mr->nent, i) {
|
||||
for (dma_addr = sg_dma_address(sg), dma_len = sg_dma_len(sg);
|
||||
nsg && dma_len;
|
||||
nsg--, dma_addr += BIT(mr->log_size), dma_len -= BIT(mr->log_size))
|
||||
mtt[j++] = cpu_to_be64(dma_addr);
|
||||
}
|
||||
}
|
||||
|
||||
static int create_direct_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_direct_mr *mr)
|
||||
|
|
@ -64,7 +61,6 @@ static int create_direct_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_direct
|
|||
return -ENOMEM;
|
||||
|
||||
MLX5_SET(create_mkey_in, in, uid, mvdev->res.uid);
|
||||
fill_sg(mr, in);
|
||||
mkc = MLX5_ADDR_OF(create_mkey_in, in, memory_key_mkey_entry);
|
||||
MLX5_SET(mkc, mkc, lw, !!(mr->perm & VHOST_MAP_WO));
|
||||
MLX5_SET(mkc, mkc, lr, !!(mr->perm & VHOST_MAP_RO));
|
||||
|
|
@ -276,8 +272,8 @@ static int map_direct_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_direct_mr
|
|||
done:
|
||||
mr->log_size = log_entity_size;
|
||||
mr->nsg = nsg;
|
||||
err = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
|
||||
if (!err)
|
||||
mr->nent = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
|
||||
if (!mr->nent)
|
||||
goto err_map;
|
||||
|
||||
err = create_direct_mr(mvdev, mr);
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ static int __init afs_init(void)
|
|||
goto error_cache;
|
||||
#endif
|
||||
|
||||
ret = register_pernet_subsys(&afs_net_ops);
|
||||
ret = register_pernet_device(&afs_net_ops);
|
||||
if (ret < 0)
|
||||
goto error_net;
|
||||
|
||||
|
|
@ -213,7 +213,7 @@ static int __init afs_init(void)
|
|||
error_proc:
|
||||
afs_fs_exit();
|
||||
error_fs:
|
||||
unregister_pernet_subsys(&afs_net_ops);
|
||||
unregister_pernet_device(&afs_net_ops);
|
||||
error_net:
|
||||
#ifdef CONFIG_AFS_FSCACHE
|
||||
fscache_unregister_netfs(&afs_cache_netfs);
|
||||
|
|
@ -244,7 +244,7 @@ static void __exit afs_exit(void)
|
|||
|
||||
proc_remove(afs_proc_symlink);
|
||||
afs_fs_exit();
|
||||
unregister_pernet_subsys(&afs_net_ops);
|
||||
unregister_pernet_device(&afs_net_ops);
|
||||
#ifdef CONFIG_AFS_FSCACHE
|
||||
fscache_unregister_netfs(&afs_cache_netfs);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1143,7 +1143,7 @@ static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new,
|
|||
old = *pold;
|
||||
*pold = new;
|
||||
if (old != NULL)
|
||||
qdisc_tree_flush_backlog(old);
|
||||
qdisc_purge_queue(old);
|
||||
sch_tree_unlock(sch);
|
||||
|
||||
return old;
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ struct sk_buff *udp_gro_receive(struct list_head *head, struct sk_buff *skb,
|
|||
int udp_gro_complete(struct sk_buff *skb, int nhoff, udp_lookup_t lookup);
|
||||
|
||||
struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
|
||||
netdev_features_t features);
|
||||
netdev_features_t features, bool is_ipv6);
|
||||
|
||||
static inline struct udphdr *udp_gro_udphdr(struct sk_buff *skb)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,8 +49,14 @@
|
|||
#define RKISP1_CIF_ISP_CTK_COEFF_MAX 0x100
|
||||
#define RKISP1_CIF_ISP_CTK_OFFSET_MAX 0x800
|
||||
|
||||
#define RKISP1_CIF_ISP_AE_MEAN_MAX 25
|
||||
#define RKISP1_CIF_ISP_HIST_BIN_N_MAX 16
|
||||
#define RKISP1_CIF_ISP_AE_MEAN_MAX_V10 25
|
||||
#define RKISP1_CIF_ISP_AE_MEAN_MAX_V12 81
|
||||
#define RKISP1_CIF_ISP_AE_MEAN_MAX RKISP1_CIF_ISP_AE_MEAN_MAX_V12
|
||||
|
||||
#define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 16
|
||||
#define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 32
|
||||
#define RKISP1_CIF_ISP_HIST_BIN_N_MAX RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12
|
||||
|
||||
#define RKISP1_CIF_ISP_AFM_MAX_WINDOWS 3
|
||||
#define RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE 17
|
||||
|
||||
|
|
@ -86,7 +92,9 @@
|
|||
* Gamma out
|
||||
*/
|
||||
/* Maximum number of color samples supported */
|
||||
#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES 17
|
||||
#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 17
|
||||
#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 34
|
||||
#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12
|
||||
|
||||
/*
|
||||
* Lens shade correction
|
||||
|
|
@ -102,8 +110,9 @@
|
|||
/*
|
||||
* Histogram calculation
|
||||
*/
|
||||
/* Last 3 values unused. */
|
||||
#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE 28
|
||||
#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 25
|
||||
#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 81
|
||||
#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12
|
||||
|
||||
/*
|
||||
* Defect Pixel Cluster Correction
|
||||
|
|
@ -124,6 +133,21 @@
|
|||
#define RKISP1_CIF_ISP_STAT_AFM (1U << 2)
|
||||
#define RKISP1_CIF_ISP_STAT_HIST (1U << 3)
|
||||
|
||||
/**
|
||||
* enum rkisp1_cif_isp_version - ISP variants
|
||||
*
|
||||
* @RKISP1_V10: used at least in rk3288 and rk3399
|
||||
* @RKISP1_V11: declared in the original vendor code, but not used
|
||||
* @RKISP1_V12: used at least in rk3326 and px30
|
||||
* @RKISP1_V13: used at least in rk1808
|
||||
*/
|
||||
enum rkisp1_cif_isp_version {
|
||||
RKISP1_V10 = 10,
|
||||
RKISP1_V11,
|
||||
RKISP1_V12,
|
||||
RKISP1_V13,
|
||||
};
|
||||
|
||||
enum rkisp1_cif_isp_histogram_mode {
|
||||
RKISP1_CIF_ISP_HISTOGRAM_MODE_DISABLE,
|
||||
RKISP1_CIF_ISP_HISTOGRAM_MODE_RGB_COMBINED,
|
||||
|
|
@ -510,6 +534,15 @@ enum rkisp1_cif_isp_goc_mode {
|
|||
*
|
||||
* @mode: goc mode (from enum rkisp1_cif_isp_goc_mode)
|
||||
* @gamma_y: gamma out curve y-axis for all color components
|
||||
*
|
||||
* The number of entries of @gamma_y depends on the hardware revision
|
||||
* as is reported by the hw_revision field of the struct media_device_info
|
||||
* that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
|
||||
*
|
||||
* Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10
|
||||
* entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12
|
||||
* entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum
|
||||
* of the two.
|
||||
*/
|
||||
struct rkisp1_cif_isp_goc_config {
|
||||
__u32 mode;
|
||||
|
|
@ -524,6 +557,15 @@ struct rkisp1_cif_isp_goc_config {
|
|||
* skipped
|
||||
* @meas_window: coordinates of the measure window
|
||||
* @hist_weight: weighting factor for sub-windows
|
||||
*
|
||||
* The number of entries of @hist_weight depends on the hardware revision
|
||||
* as is reported by the hw_revision field of the struct media_device_info
|
||||
* that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
|
||||
*
|
||||
* Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10
|
||||
* entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12
|
||||
* entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum
|
||||
* of the two.
|
||||
*/
|
||||
struct rkisp1_cif_isp_hst_config {
|
||||
__u32 mode;
|
||||
|
|
@ -811,7 +853,15 @@ struct rkisp1_cif_isp_bls_meas_val {
|
|||
* @exp_mean: Mean luminance value of block xx
|
||||
* @bls_val: BLS measured values
|
||||
*
|
||||
* Image is divided into 5x5 blocks.
|
||||
* The number of entries of @exp_mean depends on the hardware revision
|
||||
* as is reported by the hw_revision field of the struct media_device_info
|
||||
* that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
|
||||
*
|
||||
* Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries,
|
||||
* versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries.
|
||||
* RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two.
|
||||
*
|
||||
* Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.
|
||||
*/
|
||||
struct rkisp1_cif_isp_ae_stat {
|
||||
__u8 exp_mean[RKISP1_CIF_ISP_AE_MEAN_MAX];
|
||||
|
|
@ -844,13 +894,29 @@ struct rkisp1_cif_isp_af_stat {
|
|||
/**
|
||||
* struct rkisp1_cif_isp_hist_stat - statistics histogram data
|
||||
*
|
||||
* @hist_bins: measured bin counters
|
||||
* @hist_bins: measured bin counters. Each bin is a 20 bits unsigned fixed point
|
||||
* type. Bits 0-4 are the fractional part and bits 5-19 are the
|
||||
* integer part.
|
||||
*
|
||||
* Measurement window divided into 25 sub-windows, set
|
||||
* with ISP_HIST_XXX
|
||||
* The window of the measurements area is divided to 5x5 sub-windows for
|
||||
* V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for
|
||||
* each sub-window independently and the final result is a weighted average of
|
||||
* the histogram measurements on all sub-windows. The window of the
|
||||
* measurements area and the weight of each sub-window are configurable using
|
||||
* struct @rkisp1_cif_isp_hst_config.
|
||||
*
|
||||
* The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13.
|
||||
*
|
||||
* The number of entries of @hist_bins depends on the hardware revision
|
||||
* as is reported by the hw_revision field of the struct media_device_info
|
||||
* that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
|
||||
*
|
||||
* Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries,
|
||||
* versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries.
|
||||
* RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two.
|
||||
*/
|
||||
struct rkisp1_cif_isp_hist_stat {
|
||||
__u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];
|
||||
__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -125,8 +125,12 @@ static int bpf_fd_inode_storage_update_elem(struct bpf_map *map, void *key,
|
|||
|
||||
fd = *(int *)key;
|
||||
f = fget_raw(fd);
|
||||
if (!f || !inode_storage_ptr(f->f_inode))
|
||||
if (!f)
|
||||
return -EBADF;
|
||||
if (!inode_storage_ptr(f->f_inode)) {
|
||||
fput(f);
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
sdata = bpf_local_storage_update(f->f_inode,
|
||||
(struct bpf_local_storage_map *)map,
|
||||
|
|
|
|||
|
|
@ -149,7 +149,11 @@ BTF_ID(func, bpf_lsm_file_ioctl)
|
|||
BTF_ID(func, bpf_lsm_file_lock)
|
||||
BTF_ID(func, bpf_lsm_file_open)
|
||||
BTF_ID(func, bpf_lsm_file_receive)
|
||||
|
||||
#ifdef CONFIG_SECURITY_NETWORK
|
||||
BTF_ID(func, bpf_lsm_inet_conn_established)
|
||||
#endif /* CONFIG_SECURITY_NETWORK */
|
||||
|
||||
BTF_ID(func, bpf_lsm_inode_create)
|
||||
BTF_ID(func, bpf_lsm_inode_free_security)
|
||||
BTF_ID(func, bpf_lsm_inode_getattr)
|
||||
|
|
@ -166,7 +170,11 @@ BTF_ID(func, bpf_lsm_inode_symlink)
|
|||
BTF_ID(func, bpf_lsm_inode_unlink)
|
||||
BTF_ID(func, bpf_lsm_kernel_module_request)
|
||||
BTF_ID(func, bpf_lsm_kernfs_init_security)
|
||||
|
||||
#ifdef CONFIG_KEYS
|
||||
BTF_ID(func, bpf_lsm_key_free)
|
||||
#endif /* CONFIG_KEYS */
|
||||
|
||||
BTF_ID(func, bpf_lsm_mmap_file)
|
||||
BTF_ID(func, bpf_lsm_netlink_send)
|
||||
BTF_ID(func, bpf_lsm_path_notify)
|
||||
|
|
@ -181,6 +189,8 @@ BTF_ID(func, bpf_lsm_sb_show_options)
|
|||
BTF_ID(func, bpf_lsm_sb_statfs)
|
||||
BTF_ID(func, bpf_lsm_sb_umount)
|
||||
BTF_ID(func, bpf_lsm_settime)
|
||||
|
||||
#ifdef CONFIG_SECURITY_NETWORK
|
||||
BTF_ID(func, bpf_lsm_socket_accept)
|
||||
BTF_ID(func, bpf_lsm_socket_bind)
|
||||
BTF_ID(func, bpf_lsm_socket_connect)
|
||||
|
|
@ -195,6 +205,8 @@ BTF_ID(func, bpf_lsm_socket_recvmsg)
|
|||
BTF_ID(func, bpf_lsm_socket_sendmsg)
|
||||
BTF_ID(func, bpf_lsm_socket_shutdown)
|
||||
BTF_ID(func, bpf_lsm_socket_socketpair)
|
||||
#endif /* CONFIG_SECURITY_NETWORK */
|
||||
|
||||
BTF_ID(func, bpf_lsm_syslog)
|
||||
BTF_ID(func, bpf_lsm_task_alloc)
|
||||
BTF_ID(func, bpf_lsm_task_getsecid)
|
||||
|
|
|
|||
|
|
@ -1442,6 +1442,11 @@ int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level,
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (ctx.optlen < 0) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (copy_from_user(ctx.optval, optval,
|
||||
min(ctx.optlen, max_optlen)) != 0) {
|
||||
ret = -EFAULT;
|
||||
|
|
@ -1459,7 +1464,7 @@ int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level,
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (ctx.optlen > max_optlen) {
|
||||
if (ctx.optlen > max_optlen || ctx.optlen < 0) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,11 @@ LIBBPF_SRCS = $(srctree)/tools/lib/bpf/
|
|||
LIBBPF_A = $(obj)/libbpf.a
|
||||
LIBBPF_OUT = $(abspath $(obj))
|
||||
|
||||
# Although not in use by libbpf's Makefile, set $(O) so that the "dummy" test
|
||||
# in tools/scripts/Makefile.include always succeeds when building the kernel
|
||||
# with $(O) pointing to a relative path, as in "make O=build bindeb-pkg".
|
||||
$(LIBBPF_A):
|
||||
$(Q)$(MAKE) -C $(LIBBPF_SRCS) OUTPUT=$(LIBBPF_OUT)/ $(LIBBPF_OUT)/libbpf.a
|
||||
$(Q)$(MAKE) -C $(LIBBPF_SRCS) O=$(LIBBPF_OUT)/ OUTPUT=$(LIBBPF_OUT)/ $(LIBBPF_OUT)/libbpf.a
|
||||
|
||||
userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi \
|
||||
-I $(srctree)/tools/lib/ -Wno-unused-result
|
||||
|
|
|
|||
|
|
@ -147,8 +147,10 @@ static int do_map_benchmark(struct map_benchmark_data *map)
|
|||
atomic64_set(&map->sum_sq_unmap, 0);
|
||||
atomic64_set(&map->loops, 0);
|
||||
|
||||
for (i = 0; i < threads; i++)
|
||||
for (i = 0; i < threads; i++) {
|
||||
get_task_struct(tsk[i]);
|
||||
wake_up_process(tsk[i]);
|
||||
}
|
||||
|
||||
msleep_interruptible(map->bparam.seconds * 1000);
|
||||
|
||||
|
|
@ -183,6 +185,8 @@ static int do_map_benchmark(struct map_benchmark_data *map)
|
|||
}
|
||||
|
||||
out:
|
||||
for (i = 0; i < threads; i++)
|
||||
put_task_struct(tsk[i]);
|
||||
put_device(map->dev);
|
||||
kfree(tsk);
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -1245,13 +1245,14 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr,
|
|||
old = neigh->nud_state;
|
||||
err = -EPERM;
|
||||
|
||||
if (neigh->dead) {
|
||||
NL_SET_ERR_MSG(extack, "Neighbor entry is now dead");
|
||||
new = old;
|
||||
goto out;
|
||||
}
|
||||
if (!(flags & NEIGH_UPDATE_F_ADMIN) &&
|
||||
(old & (NUD_NOARP | NUD_PERMANENT)))
|
||||
goto out;
|
||||
if (neigh->dead) {
|
||||
NL_SET_ERR_MSG(extack, "Neighbor entry is now dead");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ext_learn_change = neigh_update_ext_learned(neigh, flags, ¬ify);
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,10 @@ struct hsr_priv {
|
|||
u8 net_id; /* for PRP, it occupies most significant 3 bits
|
||||
* of lan_id
|
||||
*/
|
||||
unsigned char sup_multicast_addr[ETH_ALEN];
|
||||
unsigned char sup_multicast_addr[ETH_ALEN] __aligned(sizeof(u16));
|
||||
/* Align to u16 boundary to avoid unaligned access
|
||||
* in ether_addr_equal
|
||||
*/
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
struct dentry *node_tbl_root;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ static int ip_tunnel_bind_dev(struct net_device *dev)
|
|||
}
|
||||
|
||||
dev->needed_headroom = t_hlen + hlen;
|
||||
mtu -= (dev->hard_header_len + t_hlen);
|
||||
mtu -= t_hlen;
|
||||
|
||||
if (mtu < IPV4_MIN_MTU)
|
||||
mtu = IPV4_MIN_MTU;
|
||||
|
|
@ -347,7 +347,7 @@ static struct ip_tunnel *ip_tunnel_create(struct net *net,
|
|||
nt = netdev_priv(dev);
|
||||
t_hlen = nt->hlen + sizeof(struct iphdr);
|
||||
dev->min_mtu = ETH_MIN_MTU;
|
||||
dev->max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen;
|
||||
dev->max_mtu = IP_MAX_MTU - t_hlen;
|
||||
ip_tunnel_add(itn, nt);
|
||||
return nt;
|
||||
|
||||
|
|
@ -488,11 +488,10 @@ static int tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb,
|
|||
int mtu;
|
||||
|
||||
tunnel_hlen = md ? tunnel_hlen : tunnel->hlen;
|
||||
pkt_size = skb->len - tunnel_hlen - dev->hard_header_len;
|
||||
pkt_size = skb->len - tunnel_hlen;
|
||||
|
||||
if (df)
|
||||
mtu = dst_mtu(&rt->dst) - dev->hard_header_len
|
||||
- sizeof(struct iphdr) - tunnel_hlen;
|
||||
mtu = dst_mtu(&rt->dst) - (sizeof(struct iphdr) + tunnel_hlen);
|
||||
else
|
||||
mtu = skb_valid_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
|
||||
|
||||
|
|
@ -972,7 +971,7 @@ int __ip_tunnel_change_mtu(struct net_device *dev, int new_mtu, bool strict)
|
|||
{
|
||||
struct ip_tunnel *tunnel = netdev_priv(dev);
|
||||
int t_hlen = tunnel->hlen + sizeof(struct iphdr);
|
||||
int max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen;
|
||||
int max_mtu = IP_MAX_MTU - t_hlen;
|
||||
|
||||
if (new_mtu < ETH_MIN_MTU)
|
||||
return -EINVAL;
|
||||
|
|
@ -1149,10 +1148,9 @@ int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
|
|||
|
||||
mtu = ip_tunnel_bind_dev(dev);
|
||||
if (tb[IFLA_MTU]) {
|
||||
unsigned int max = IP_MAX_MTU - dev->hard_header_len - nt->hlen;
|
||||
unsigned int max = IP_MAX_MTU - (nt->hlen + sizeof(struct iphdr));
|
||||
|
||||
mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
|
||||
(unsigned int)(max - sizeof(struct iphdr)));
|
||||
mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU, max);
|
||||
}
|
||||
|
||||
err = dev_set_mtu(dev, mtu);
|
||||
|
|
|
|||
|
|
@ -187,8 +187,67 @@ struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
|
|||
}
|
||||
EXPORT_SYMBOL(skb_udp_tunnel_segment);
|
||||
|
||||
static void __udpv4_gso_segment_csum(struct sk_buff *seg,
|
||||
__be32 *oldip, __be32 *newip,
|
||||
__be16 *oldport, __be16 *newport)
|
||||
{
|
||||
struct udphdr *uh;
|
||||
struct iphdr *iph;
|
||||
|
||||
if (*oldip == *newip && *oldport == *newport)
|
||||
return;
|
||||
|
||||
uh = udp_hdr(seg);
|
||||
iph = ip_hdr(seg);
|
||||
|
||||
if (uh->check) {
|
||||
inet_proto_csum_replace4(&uh->check, seg, *oldip, *newip,
|
||||
true);
|
||||
inet_proto_csum_replace2(&uh->check, seg, *oldport, *newport,
|
||||
false);
|
||||
if (!uh->check)
|
||||
uh->check = CSUM_MANGLED_0;
|
||||
}
|
||||
*oldport = *newport;
|
||||
|
||||
csum_replace4(&iph->check, *oldip, *newip);
|
||||
*oldip = *newip;
|
||||
}
|
||||
|
||||
static struct sk_buff *__udpv4_gso_segment_list_csum(struct sk_buff *segs)
|
||||
{
|
||||
struct sk_buff *seg;
|
||||
struct udphdr *uh, *uh2;
|
||||
struct iphdr *iph, *iph2;
|
||||
|
||||
seg = segs;
|
||||
uh = udp_hdr(seg);
|
||||
iph = ip_hdr(seg);
|
||||
|
||||
if ((udp_hdr(seg)->dest == udp_hdr(seg->next)->dest) &&
|
||||
(udp_hdr(seg)->source == udp_hdr(seg->next)->source) &&
|
||||
(ip_hdr(seg)->daddr == ip_hdr(seg->next)->daddr) &&
|
||||
(ip_hdr(seg)->saddr == ip_hdr(seg->next)->saddr))
|
||||
return segs;
|
||||
|
||||
while ((seg = seg->next)) {
|
||||
uh2 = udp_hdr(seg);
|
||||
iph2 = ip_hdr(seg);
|
||||
|
||||
__udpv4_gso_segment_csum(seg,
|
||||
&iph2->saddr, &iph->saddr,
|
||||
&uh2->source, &uh->source);
|
||||
__udpv4_gso_segment_csum(seg,
|
||||
&iph2->daddr, &iph->daddr,
|
||||
&uh2->dest, &uh->dest);
|
||||
}
|
||||
|
||||
return segs;
|
||||
}
|
||||
|
||||
static struct sk_buff *__udp_gso_segment_list(struct sk_buff *skb,
|
||||
netdev_features_t features)
|
||||
netdev_features_t features,
|
||||
bool is_ipv6)
|
||||
{
|
||||
unsigned int mss = skb_shinfo(skb)->gso_size;
|
||||
|
||||
|
|
@ -198,11 +257,11 @@ static struct sk_buff *__udp_gso_segment_list(struct sk_buff *skb,
|
|||
|
||||
udp_hdr(skb)->len = htons(sizeof(struct udphdr) + mss);
|
||||
|
||||
return skb;
|
||||
return is_ipv6 ? skb : __udpv4_gso_segment_list_csum(skb);
|
||||
}
|
||||
|
||||
struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
|
||||
netdev_features_t features)
|
||||
netdev_features_t features, bool is_ipv6)
|
||||
{
|
||||
struct sock *sk = gso_skb->sk;
|
||||
unsigned int sum_truesize = 0;
|
||||
|
|
@ -214,7 +273,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
|
|||
__be16 newlen;
|
||||
|
||||
if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST)
|
||||
return __udp_gso_segment_list(gso_skb, features);
|
||||
return __udp_gso_segment_list(gso_skb, features, is_ipv6);
|
||||
|
||||
mss = skb_shinfo(gso_skb)->gso_size;
|
||||
if (gso_skb->len <= sizeof(*uh) + mss)
|
||||
|
|
@ -328,7 +387,7 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb,
|
|||
goto out;
|
||||
|
||||
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4)
|
||||
return __udp_gso_segment(skb, features);
|
||||
return __udp_gso_segment(skb, features, false);
|
||||
|
||||
mss = skb_shinfo(skb)->gso_size;
|
||||
if (unlikely(skb->len <= mss))
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
|
|||
goto out;
|
||||
|
||||
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4)
|
||||
return __udp_gso_segment(skb, features);
|
||||
return __udp_gso_segment(skb, features, true);
|
||||
|
||||
mss = skb_shinfo(skb)->gso_size;
|
||||
if (unlikely(skb->len <= mss))
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ void lapb_kick(struct lapb_cb *lapb)
|
|||
skb = skb_dequeue(&lapb->write_queue);
|
||||
|
||||
do {
|
||||
if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
|
||||
skbn = skb_copy(skb, GFP_ATOMIC);
|
||||
if (!skbn) {
|
||||
skb_queue_head(&lapb->write_queue, skb);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,8 +125,11 @@ int drv_sta_state(struct ieee80211_local *local,
|
|||
} else if (old_state == IEEE80211_STA_AUTH &&
|
||||
new_state == IEEE80211_STA_ASSOC) {
|
||||
ret = drv_sta_add(local, sdata, &sta->sta);
|
||||
if (ret == 0)
|
||||
if (ret == 0) {
|
||||
sta->uploaded = true;
|
||||
if (rcu_access_pointer(sta->sta.rates))
|
||||
drv_sta_rate_tbl_update(local, sdata, &sta->sta);
|
||||
}
|
||||
} else if (old_state == IEEE80211_STA_ASSOC &&
|
||||
new_state == IEEE80211_STA_AUTH) {
|
||||
drv_sta_remove(local, sdata, &sta->sta);
|
||||
|
|
|
|||
|
|
@ -960,7 +960,8 @@ int rate_control_set_rates(struct ieee80211_hw *hw,
|
|||
if (old)
|
||||
kfree_rcu(old, rcu_head);
|
||||
|
||||
drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
|
||||
if (sta->uploaded)
|
||||
drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
|
||||
|
||||
ieee80211_sta_set_expected_throughput(pubsta, sta_get_expected_throughput(sta));
|
||||
|
||||
|
|
|
|||
|
|
@ -565,6 +565,9 @@ int rds_rdma_extra_size(struct rds_rdma_args *args,
|
|||
if (args->nr_local == 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (args->nr_local > UIO_MAXIOV)
|
||||
return -EMSGSIZE;
|
||||
|
||||
iov->iov = kcalloc(args->nr_local,
|
||||
sizeof(struct rds_iovec),
|
||||
GFP_KERNEL);
|
||||
|
|
|
|||
|
|
@ -990,7 +990,7 @@ static int __init af_rxrpc_init(void)
|
|||
goto error_security;
|
||||
}
|
||||
|
||||
ret = register_pernet_subsys(&rxrpc_net_ops);
|
||||
ret = register_pernet_device(&rxrpc_net_ops);
|
||||
if (ret)
|
||||
goto error_pernet;
|
||||
|
||||
|
|
@ -1035,7 +1035,7 @@ static int __init af_rxrpc_init(void)
|
|||
error_sock:
|
||||
proto_unregister(&rxrpc_proto);
|
||||
error_proto:
|
||||
unregister_pernet_subsys(&rxrpc_net_ops);
|
||||
unregister_pernet_device(&rxrpc_net_ops);
|
||||
error_pernet:
|
||||
rxrpc_exit_security();
|
||||
error_security:
|
||||
|
|
@ -1057,7 +1057,7 @@ static void __exit af_rxrpc_exit(void)
|
|||
unregister_key_type(&key_type_rxrpc);
|
||||
sock_unregister(PF_RXRPC);
|
||||
proto_unregister(&rxrpc_proto);
|
||||
unregister_pernet_subsys(&rxrpc_net_ops);
|
||||
unregister_pernet_device(&rxrpc_net_ops);
|
||||
ASSERTCMP(atomic_read(&rxrpc_n_tx_skbs), ==, 0);
|
||||
ASSERTCMP(atomic_read(&rxrpc_n_rx_skbs), ==, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -1014,9 +1014,12 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
|
|||
mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
|
||||
|
||||
} else if (sock->type == SOCK_STREAM) {
|
||||
const struct vsock_transport *transport = vsk->transport;
|
||||
const struct vsock_transport *transport;
|
||||
|
||||
lock_sock(sk);
|
||||
|
||||
transport = vsk->transport;
|
||||
|
||||
/* Listening sockets that have connections in their accept
|
||||
* queue can be read.
|
||||
*/
|
||||
|
|
@ -1099,10 +1102,11 @@ static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
|
|||
err = 0;
|
||||
sk = sock->sk;
|
||||
vsk = vsock_sk(sk);
|
||||
transport = vsk->transport;
|
||||
|
||||
lock_sock(sk);
|
||||
|
||||
transport = vsk->transport;
|
||||
|
||||
err = vsock_auto_bind(vsk);
|
||||
if (err)
|
||||
goto out;
|
||||
|
|
@ -1561,10 +1565,11 @@ static int vsock_stream_setsockopt(struct socket *sock,
|
|||
err = 0;
|
||||
sk = sock->sk;
|
||||
vsk = vsock_sk(sk);
|
||||
transport = vsk->transport;
|
||||
|
||||
lock_sock(sk);
|
||||
|
||||
transport = vsk->transport;
|
||||
|
||||
switch (optname) {
|
||||
case SO_VM_SOCKETS_BUFFER_SIZE:
|
||||
COPY_IN(val);
|
||||
|
|
@ -1697,7 +1702,6 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
|
|||
|
||||
sk = sock->sk;
|
||||
vsk = vsock_sk(sk);
|
||||
transport = vsk->transport;
|
||||
total_written = 0;
|
||||
err = 0;
|
||||
|
||||
|
|
@ -1706,6 +1710,8 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
|
|||
|
||||
lock_sock(sk);
|
||||
|
||||
transport = vsk->transport;
|
||||
|
||||
/* Callers should not provide a destination with stream sockets. */
|
||||
if (msg->msg_namelen) {
|
||||
err = sk->sk_state == TCP_ESTABLISHED ? -EISCONN : -EOPNOTSUPP;
|
||||
|
|
@ -1840,11 +1846,12 @@ vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
|
|||
|
||||
sk = sock->sk;
|
||||
vsk = vsock_sk(sk);
|
||||
transport = vsk->transport;
|
||||
err = 0;
|
||||
|
||||
lock_sock(sk);
|
||||
|
||||
transport = vsk->transport;
|
||||
|
||||
if (!transport || sk->sk_state != TCP_ESTABLISHED) {
|
||||
/* Recvmsg is supposed to return 0 if a peer performs an
|
||||
* orderly shutdown. Differentiate between that case and when a
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user