mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'net-6.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni:
"Including fixes from Bluetooth, IPsec and CAN.
No known regressions at this point.
Current release - regressions:
- xfrm: xfrm_alloc_spi shouldn't use 0 as SPI
Previous releases - regressions:
- xfrm: fix offloading of cross-family tunnels
- bluetooth: fix several races leading to UaFs
- dsa: lantiq_gswip: fix FDB entries creation for the CPU port
- eth:
- tun: update napi->skb after XDP process
- mlx: fix UAF in flow counter release
Previous releases - always broken:
- core: forbid FDB status change while nexthop is in a group
- smc: fix warning in smc_rx_splice() when calling get_page()
- can: provide missing ndo_change_mtu(), to prevent buffer overflow.
- eth:
- i40e: fix VF config validation
- broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl"
* tag 'net-6.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (40 commits)
octeontx2-pf: Fix potential use after free in otx2_tc_add_flow()
net: dsa: lantiq_gswip: suppress -EINVAL errors for bridge FDB entries added to the CPU port
net: dsa: lantiq_gswip: move gswip_add_single_port_br() call to port_setup()
libie: fix string names for AQ error codes
net/mlx5e: Fix missing FEC RS stats for RS_544_514_INTERLEAVED_QUAD
net/mlx5: HWS, ignore flow level for multi-dest table
net/mlx5: fs, fix UAF in flow counter release
selftests: fib_nexthops: Add test cases for FDB status change
selftests: fib_nexthops: Fix creation of non-FDB nexthops
nexthop: Forbid FDB status change while nexthop is in a group
net: allow alloc_skb_with_frags() to use MAX_SKB_FRAGS
bnxt_en: correct offset handling for IPv6 destination address
ptp: document behavior of PTP_STRICT_FLAGS
broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl
broadcom: fix support for PTP_PEROUT_DUTY_CYCLE
Bluetooth: MGMT: Fix possible UAFs
Bluetooth: hci_event: Fix UAF in hci_acl_create_conn_sync
Bluetooth: hci_event: Fix UAF in hci_conn_tx_dequeue
Bluetooth: hci_sync: Fix hci_resume_advertising_sync
Bluetooth: Fix build after header cleanup
...
This commit is contained in:
commit
4ff71af020
41 files changed
+548
-201
No files matched your search
@@ -312,7 +312,9 @@ config BT_HCIBCM4377
|
||||
|
||||
config BT_HCIBPA10X
|
||||
tristate "HCI BPA10x USB driver"
|
||||
depends on BT_HCIUART
|
||||
depends on USB
|
||||
select BT_HCIUART_H4
|
||||
help
|
||||
Bluetooth HCI BPA10x USB driver.
|
||||
This driver provides support for the Digianswer BPA 100/105 Bluetooth
|
||||
@@ -437,8 +439,10 @@ config BT_MTKSDIO
|
||||
|
||||
config BT_MTKUART
|
||||
tristate "MediaTek HCI UART driver"
|
||||
depends on BT_HCIUART
|
||||
depends on SERIAL_DEV_BUS
|
||||
depends on USB || !BT_HCIBTUSB_MTK
|
||||
select BT_HCIUART_H4
|
||||
select BT_MTK
|
||||
help
|
||||
MediaTek Bluetooth HCI UART driver.
|
||||
@@ -483,7 +487,9 @@ config BT_VIRTIO
|
||||
|
||||
config BT_NXPUART
|
||||
tristate "NXP protocol support"
|
||||
depends on BT_HCIUART
|
||||
depends on SERIAL_DEV_BUS
|
||||
select BT_HCIUART_H4
|
||||
select CRC32
|
||||
select CRC8
|
||||
help
|
||||
|
||||
@@ -121,10 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable);
|
||||
void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed,
|
||||
unsigned int oper_speed);
|
||||
|
||||
#ifdef CONFIG_BT_HCIUART_H4
|
||||
int h4_init(void);
|
||||
int h4_deinit(void);
|
||||
|
||||
struct h4_recv_pkt {
|
||||
u8 type; /* Packet type */
|
||||
u8 hlen; /* Header length */
|
||||
@@ -162,6 +158,10 @@ struct h4_recv_pkt {
|
||||
.lsize = 2, \
|
||||
.maxlen = HCI_MAX_FRAME_SIZE \
|
||||
|
||||
#ifdef CONFIG_BT_HCIUART_H4
|
||||
int h4_init(void);
|
||||
int h4_deinit(void);
|
||||
|
||||
struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
|
||||
const unsigned char *buffer, int count,
|
||||
const struct h4_recv_pkt *pkts, int pkts_count);
|
||||
|
||||
@@ -823,9 +823,6 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
|
||||
/* Reset Global error flags */
|
||||
rcar_canfd_write(gpriv->base, RCANFD_GERFL, 0x0);
|
||||
|
||||
/* Set the controller into appropriate mode */
|
||||
rcar_canfd_set_mode(gpriv);
|
||||
|
||||
/* Transition all Channels to reset mode */
|
||||
for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels) {
|
||||
rcar_canfd_clear_bit(gpriv->base,
|
||||
@@ -844,6 +841,10 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the controller into appropriate mode */
|
||||
rcar_canfd_set_mode(gpriv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -545,8 +545,6 @@ static int hi3110_stop(struct net_device *net)
|
||||
|
||||
priv->force_quit = 1;
|
||||
free_irq(spi->irq, priv);
|
||||
destroy_workqueue(priv->wq);
|
||||
priv->wq = NULL;
|
||||
|
||||
mutex_lock(&priv->hi3110_lock);
|
||||
|
||||
@@ -770,34 +768,23 @@ static int hi3110_open(struct net_device *net)
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
priv->wq = alloc_workqueue("hi3110_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,
|
||||
0);
|
||||
if (!priv->wq) {
|
||||
ret = -ENOMEM;
|
||||
goto out_free_irq;
|
||||
}
|
||||
INIT_WORK(&priv->tx_work, hi3110_tx_work_handler);
|
||||
INIT_WORK(&priv->restart_work, hi3110_restart_work_handler);
|
||||
|
||||
ret = hi3110_hw_reset(spi);
|
||||
if (ret)
|
||||
goto out_free_wq;
|
||||
goto out_free_irq;
|
||||
|
||||
ret = hi3110_setup(net);
|
||||
if (ret)
|
||||
goto out_free_wq;
|
||||
goto out_free_irq;
|
||||
|
||||
ret = hi3110_set_normal_mode(spi);
|
||||
if (ret)
|
||||
goto out_free_wq;
|
||||
goto out_free_irq;
|
||||
|
||||
netif_wake_queue(net);
|
||||
mutex_unlock(&priv->hi3110_lock);
|
||||
|
||||
return 0;
|
||||
|
||||
out_free_wq:
|
||||
destroy_workqueue(priv->wq);
|
||||
out_free_irq:
|
||||
free_irq(spi->irq, priv);
|
||||
hi3110_hw_sleep(spi);
|
||||
@@ -812,6 +799,7 @@ static const struct net_device_ops hi3110_netdev_ops = {
|
||||
.ndo_open = hi3110_open,
|
||||
.ndo_stop = hi3110_stop,
|
||||
.ndo_start_xmit = hi3110_hard_start_xmit,
|
||||
.ndo_change_mtu = can_change_mtu,
|
||||
};
|
||||
|
||||
static const struct ethtool_ops hi3110_ethtool_ops = {
|
||||
@@ -908,6 +896,15 @@ static int hi3110_can_probe(struct spi_device *spi)
|
||||
if (ret)
|
||||
goto out_clk;
|
||||
|
||||
priv->wq = alloc_workqueue("hi3110_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,
|
||||
0);
|
||||
if (!priv->wq) {
|
||||
ret = -ENOMEM;
|
||||
goto out_clk;
|
||||
}
|
||||
INIT_WORK(&priv->tx_work, hi3110_tx_work_handler);
|
||||
INIT_WORK(&priv->restart_work, hi3110_restart_work_handler);
|
||||
|
||||
priv->spi = spi;
|
||||
mutex_init(&priv->hi3110_lock);
|
||||
|
||||
@@ -943,6 +940,8 @@ static int hi3110_can_probe(struct spi_device *spi)
|
||||
return 0;
|
||||
|
||||
error_probe:
|
||||
destroy_workqueue(priv->wq);
|
||||
priv->wq = NULL;
|
||||
hi3110_power_enable(priv->power, 0);
|
||||
|
||||
out_clk:
|
||||
@@ -963,6 +962,9 @@ static void hi3110_can_remove(struct spi_device *spi)
|
||||
|
||||
hi3110_power_enable(priv->power, 0);
|
||||
|
||||
destroy_workqueue(priv->wq);
|
||||
priv->wq = NULL;
|
||||
|
||||
clk_disable_unprepare(priv->clk);
|
||||
|
||||
free_candev(net);
|
||||
|
||||
@@ -768,6 +768,7 @@ static const struct net_device_ops sun4ican_netdev_ops = {
|
||||
.ndo_open = sun4ican_open,
|
||||
.ndo_stop = sun4ican_close,
|
||||
.ndo_start_xmit = sun4ican_start_xmit,
|
||||
.ndo_change_mtu = can_change_mtu,
|
||||
};
|
||||
|
||||
static const struct ethtool_ops sun4ican_ethtool_ops = {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* Copyright (c) 2019 Robert Bosch Engineering and Business Solutions. All rights reserved.
|
||||
* Copyright (c) 2020 ETAS K.K.. All rights reserved.
|
||||
* Copyright (c) 2020-2022 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
|
||||
* Copyright (c) 2020-2025 Vincent Mailhol <mailhol@kernel.org>
|
||||
*/
|
||||
|
||||
#include <linux/unaligned.h>
|
||||
@@ -1977,6 +1977,7 @@ static const struct net_device_ops es58x_netdev_ops = {
|
||||
.ndo_stop = es58x_stop,
|
||||
.ndo_start_xmit = es58x_start_xmit,
|
||||
.ndo_eth_ioctl = can_eth_ioctl_hwts,
|
||||
.ndo_change_mtu = can_change_mtu,
|
||||
};
|
||||
|
||||
static const struct ethtool_ops es58x_ethtool_ops = {
|
||||
|
||||
@@ -761,6 +761,7 @@ static const struct net_device_ops mcba_netdev_ops = {
|
||||
.ndo_open = mcba_usb_open,
|
||||
.ndo_stop = mcba_usb_close,
|
||||
.ndo_start_xmit = mcba_usb_start_xmit,
|
||||
.ndo_change_mtu = can_change_mtu,
|
||||
};
|
||||
|
||||
static const struct ethtool_ops mcba_ethtool_ops = {
|
||||
|
||||
@@ -111,7 +111,7 @@ void peak_usb_update_ts_now(struct peak_time_ref *time_ref, u32 ts_now)
|
||||
u32 delta_ts = time_ref->ts_dev_2 - time_ref->ts_dev_1;
|
||||
|
||||
if (time_ref->ts_dev_2 < time_ref->ts_dev_1)
|
||||
delta_ts &= (1 << time_ref->adapter->ts_used_bits) - 1;
|
||||
delta_ts &= (1ULL << time_ref->adapter->ts_used_bits) - 1;
|
||||
|
||||
time_ref->ts_total += delta_ts;
|
||||
}
|
||||
|
||||
@@ -685,18 +685,27 @@ static int gswip_add_single_port_br(struct gswip_priv *priv, int port, bool add)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gswip_port_enable(struct dsa_switch *ds, int port,
|
||||
struct phy_device *phydev)
|
||||
static int gswip_port_setup(struct dsa_switch *ds, int port)
|
||||
{
|
||||
struct gswip_priv *priv = ds->priv;
|
||||
int err;
|
||||
|
||||
if (!dsa_is_cpu_port(ds, port)) {
|
||||
u32 mdio_phy = 0;
|
||||
|
||||
err = gswip_add_single_port_br(priv, port, true);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gswip_port_enable(struct dsa_switch *ds, int port,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
struct gswip_priv *priv = ds->priv;
|
||||
|
||||
if (!dsa_is_cpu_port(ds, port)) {
|
||||
u32 mdio_phy = 0;
|
||||
|
||||
if (phydev)
|
||||
mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK;
|
||||
@@ -1359,8 +1368,9 @@ static int gswip_port_fdb(struct dsa_switch *ds, int port,
|
||||
int i;
|
||||
int err;
|
||||
|
||||
/* Operation not supported on the CPU port, don't throw errors */
|
||||
if (!bridge)
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
|
||||
for (i = max_ports; i < ARRAY_SIZE(priv->vlans); i++) {
|
||||
if (priv->vlans[i].bridge == bridge) {
|
||||
@@ -1829,6 +1839,7 @@ static const struct phylink_mac_ops gswip_phylink_mac_ops = {
|
||||
static const struct dsa_switch_ops gswip_xrx200_switch_ops = {
|
||||
.get_tag_protocol = gswip_get_tag_protocol,
|
||||
.setup = gswip_setup,
|
||||
.port_setup = gswip_port_setup,
|
||||
.port_enable = gswip_port_enable,
|
||||
.port_disable = gswip_port_disable,
|
||||
.port_bridge_join = gswip_port_bridge_join,
|
||||
|
||||
@@ -244,7 +244,7 @@ bnxt_tc_parse_pedit(struct bnxt *bp, struct bnxt_tc_actions *actions,
|
||||
offset < offset_of_ip6_daddr + 16) {
|
||||
actions->nat.src_xlate = false;
|
||||
idx = (offset - offset_of_ip6_daddr) / 4;
|
||||
actions->nat.l3.ipv6.saddr.s6_addr32[idx] = htonl(val);
|
||||
actions->nat.l3.ipv6.daddr.s6_addr32[idx] = htonl(val);
|
||||
} else {
|
||||
netdev_err(bp->dev,
|
||||
"%s: IPv6_hdr: Invalid pedit field\n",
|
||||
|
||||
@@ -1278,7 +1278,8 @@ struct i40e_mac_filter *i40e_add_mac_filter(struct i40e_vsi *vsi,
|
||||
const u8 *macaddr);
|
||||
int i40e_del_mac_filter(struct i40e_vsi *vsi, const u8 *macaddr);
|
||||
bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi);
|
||||
int i40e_count_filters(struct i40e_vsi *vsi);
|
||||
int i40e_count_all_filters(struct i40e_vsi *vsi);
|
||||
int i40e_count_active_filters(struct i40e_vsi *vsi);
|
||||
struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, const u8 *macaddr);
|
||||
void i40e_vlan_stripping_enable(struct i40e_vsi *vsi);
|
||||
static inline bool i40e_is_sw_dcb(struct i40e_pf *pf)
|
||||
|
||||
@@ -1243,12 +1243,30 @@ void i40e_update_stats(struct i40e_vsi *vsi)
|
||||
}
|
||||
|
||||
/**
|
||||
* i40e_count_filters - counts VSI mac filters
|
||||
* i40e_count_all_filters - counts VSI MAC filters
|
||||
* @vsi: the VSI to be searched
|
||||
*
|
||||
* Returns count of mac filters
|
||||
**/
|
||||
int i40e_count_filters(struct i40e_vsi *vsi)
|
||||
* Return: count of MAC filters in any state.
|
||||
*/
|
||||
int i40e_count_all_filters(struct i40e_vsi *vsi)
|
||||
{
|
||||
struct i40e_mac_filter *f;
|
||||
struct hlist_node *h;
|
||||
int bkt, cnt = 0;
|
||||
|
||||
hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist)
|
||||
cnt++;
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* i40e_count_active_filters - counts VSI MAC filters
|
||||
* @vsi: the VSI to be searched
|
||||
*
|
||||
* Return: count of active MAC filters.
|
||||
*/
|
||||
int i40e_count_active_filters(struct i40e_vsi *vsi)
|
||||
{
|
||||
struct i40e_mac_filter *f;
|
||||
struct hlist_node *h;
|
||||
|
||||
@@ -448,7 +448,7 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,
|
||||
(qtype << I40E_QINT_RQCTL_NEXTQ_TYPE_SHIFT) |
|
||||
(pf_queue_id << I40E_QINT_RQCTL_NEXTQ_INDX_SHIFT) |
|
||||
BIT(I40E_QINT_RQCTL_CAUSE_ENA_SHIFT) |
|
||||
(itr_idx << I40E_QINT_RQCTL_ITR_INDX_SHIFT);
|
||||
FIELD_PREP(I40E_QINT_RQCTL_ITR_INDX_MASK, itr_idx);
|
||||
wr32(hw, reg_idx, reg);
|
||||
}
|
||||
|
||||
@@ -653,6 +653,13 @@ static int i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_id,
|
||||
|
||||
/* only set the required fields */
|
||||
tx_ctx.base = info->dma_ring_addr / 128;
|
||||
|
||||
/* ring_len has to be multiple of 8 */
|
||||
if (!IS_ALIGNED(info->ring_len, 8) ||
|
||||
info->ring_len > I40E_MAX_NUM_DESCRIPTORS_XL710) {
|
||||
ret = -EINVAL;
|
||||
goto error_context;
|
||||
}
|
||||
tx_ctx.qlen = info->ring_len;
|
||||
tx_ctx.rdylist = le16_to_cpu(vsi->info.qs_handle[0]);
|
||||
tx_ctx.rdylist_act = 0;
|
||||
@@ -716,6 +723,13 @@ static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_id,
|
||||
|
||||
/* only set the required fields */
|
||||
rx_ctx.base = info->dma_ring_addr / 128;
|
||||
|
||||
/* ring_len has to be multiple of 32 */
|
||||
if (!IS_ALIGNED(info->ring_len, 32) ||
|
||||
info->ring_len > I40E_MAX_NUM_DESCRIPTORS_XL710) {
|
||||
ret = -EINVAL;
|
||||
goto error_param;
|
||||
}
|
||||
rx_ctx.qlen = info->ring_len;
|
||||
|
||||
if (info->splithdr_enabled) {
|
||||
@@ -1450,6 +1464,7 @@ static void i40e_trigger_vf_reset(struct i40e_vf *vf, bool flr)
|
||||
* functions that may still be running at this point.
|
||||
*/
|
||||
clear_bit(I40E_VF_STATE_INIT, &vf->vf_states);
|
||||
clear_bit(I40E_VF_STATE_RESOURCES_LOADED, &vf->vf_states);
|
||||
|
||||
/* In the case of a VFLR, the HW has already reset the VF and we
|
||||
* just need to clean up, so don't hit the VFRTRIG register.
|
||||
@@ -2116,7 +2131,10 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
|
||||
size_t len = 0;
|
||||
int ret;
|
||||
|
||||
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_INIT)) {
|
||||
i40e_sync_vf_state(vf, I40E_VF_STATE_INIT);
|
||||
|
||||
if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states) ||
|
||||
test_bit(I40E_VF_STATE_RESOURCES_LOADED, &vf->vf_states)) {
|
||||
aq_ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
@@ -2219,6 +2237,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
|
||||
vf->default_lan_addr.addr);
|
||||
}
|
||||
set_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states);
|
||||
set_bit(I40E_VF_STATE_RESOURCES_LOADED, &vf->vf_states);
|
||||
|
||||
err:
|
||||
/* send the response back to the VF */
|
||||
@@ -2381,7 +2400,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
|
||||
}
|
||||
|
||||
if (vf->adq_enabled) {
|
||||
if (idx >= ARRAY_SIZE(vf->ch)) {
|
||||
if (idx >= vf->num_tc) {
|
||||
aq_ret = -ENODEV;
|
||||
goto error_param;
|
||||
}
|
||||
@@ -2402,7 +2421,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
|
||||
* to its appropriate VSIs based on TC mapping
|
||||
*/
|
||||
if (vf->adq_enabled) {
|
||||
if (idx >= ARRAY_SIZE(vf->ch)) {
|
||||
if (idx >= vf->num_tc) {
|
||||
aq_ret = -ENODEV;
|
||||
goto error_param;
|
||||
}
|
||||
@@ -2452,8 +2471,10 @@ static int i40e_validate_queue_map(struct i40e_vf *vf, u16 vsi_id,
|
||||
u16 vsi_queue_id, queue_id;
|
||||
|
||||
for_each_set_bit(vsi_queue_id, &queuemap, I40E_MAX_VSI_QP) {
|
||||
if (vf->adq_enabled) {
|
||||
vsi_id = vf->ch[vsi_queue_id / I40E_MAX_VF_VSI].vsi_id;
|
||||
u16 idx = vsi_queue_id / I40E_MAX_VF_VSI;
|
||||
|
||||
if (vf->adq_enabled && idx < vf->num_tc) {
|
||||
vsi_id = vf->ch[idx].vsi_id;
|
||||
queue_id = (vsi_queue_id % I40E_DEFAULT_QUEUES_PER_VF);
|
||||
} else {
|
||||
queue_id = vsi_queue_id;
|
||||
@@ -2841,24 +2862,6 @@ error_param:
|
||||
(u8 *)&stats, sizeof(stats));
|
||||
}
|
||||
|
||||
/**
|
||||
* i40e_can_vf_change_mac
|
||||
* @vf: pointer to the VF info
|
||||
*
|
||||
* Return true if the VF is allowed to change its MAC filters, false otherwise
|
||||
*/
|
||||
static bool i40e_can_vf_change_mac(struct i40e_vf *vf)
|
||||
{
|
||||
/* If the VF MAC address has been set administratively (via the
|
||||
* ndo_set_vf_mac command), then deny permission to the VF to
|
||||
* add/delete unicast MAC addresses, unless the VF is trusted
|
||||
*/
|
||||
if (vf->pf_set_mac && !vf->trusted)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#define I40E_MAX_MACVLAN_PER_HW 3072
|
||||
#define I40E_MAX_MACVLAN_PER_PF(num_ports) (I40E_MAX_MACVLAN_PER_HW / \
|
||||
(num_ports))
|
||||
@@ -2897,8 +2900,10 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf,
|
||||
struct i40e_pf *pf = vf->pf;
|
||||
struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx];
|
||||
struct i40e_hw *hw = &pf->hw;
|
||||
int mac2add_cnt = 0;
|
||||
int i;
|
||||
int i, mac_add_max, mac_add_cnt = 0;
|
||||
bool vf_trusted;
|
||||
|
||||
vf_trusted = test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);
|
||||
|
||||
for (i = 0; i < al->num_elements; i++) {
|
||||
struct i40e_mac_filter *f;
|
||||
@@ -2918,9 +2923,8 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf,
|
||||
* The VF may request to set the MAC address filter already
|
||||
* assigned to it so do not return an error in that case.
|
||||
*/
|
||||
if (!i40e_can_vf_change_mac(vf) &&
|
||||
!is_multicast_ether_addr(addr) &&
|
||||
!ether_addr_equal(addr, vf->default_lan_addr.addr)) {
|
||||
if (!vf_trusted && !is_multicast_ether_addr(addr) &&
|
||||
vf->pf_set_mac && !ether_addr_equal(addr, vf->default_lan_addr.addr)) {
|
||||
dev_err(&pf->pdev->dev,
|
||||
"VF attempting to override administratively set MAC address, bring down and up the VF interface to resume normal operation\n");
|
||||
return -EPERM;
|
||||
@@ -2929,29 +2933,33 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf,
|
||||
/*count filters that really will be added*/
|
||||
f = i40e_find_mac(vsi, addr);
|
||||
if (!f)
|
||||
++mac2add_cnt;
|
||||
++mac_add_cnt;
|
||||
}
|
||||
|
||||
/* If this VF is not privileged, then we can't add more than a limited
|
||||
* number of addresses. Check to make sure that the additions do not
|
||||
* push us over the limit.
|
||||
*/
|
||||
if (!test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps)) {
|
||||
if ((i40e_count_filters(vsi) + mac2add_cnt) >
|
||||
I40E_VC_MAX_MAC_ADDR_PER_VF) {
|
||||
dev_err(&pf->pdev->dev,
|
||||
"Cannot add more MAC addresses, VF is not trusted, switch the VF to trusted to add more functionality\n");
|
||||
return -EPERM;
|
||||
}
|
||||
/* If this VF is trusted, it can use more resources than untrusted.
|
||||
* number of addresses.
|
||||
*
|
||||
* If this VF is trusted, it can use more resources than untrusted.
|
||||
* However to ensure that every trusted VF has appropriate number of
|
||||
* resources, divide whole pool of resources per port and then across
|
||||
* all VFs.
|
||||
*/
|
||||
} else {
|
||||
if ((i40e_count_filters(vsi) + mac2add_cnt) >
|
||||
I40E_VC_MAX_MACVLAN_PER_TRUSTED_VF(pf->num_alloc_vfs,
|
||||
hw->num_ports)) {
|
||||
if (!vf_trusted)
|
||||
mac_add_max = I40E_VC_MAX_MAC_ADDR_PER_VF;
|
||||
else
|
||||
mac_add_max = I40E_VC_MAX_MACVLAN_PER_TRUSTED_VF(pf->num_alloc_vfs, hw->num_ports);
|
||||
|
||||
/* VF can replace all its filters in one step, in this case mac_add_max
|
||||
* will be added as active and another mac_add_max will be in
|
||||
* a to-be-removed state. Account for that.
|
||||
*/
|
||||
if ((i40e_count_active_filters(vsi) + mac_add_cnt) > mac_add_max ||
|
||||
(i40e_count_all_filters(vsi) + mac_add_cnt) > 2 * mac_add_max) {
|
||||
if (!vf_trusted) {
|
||||
dev_err(&pf->pdev->dev,
|
||||
"Cannot add more MAC addresses, VF is not trusted, switch the VF to trusted to add more functionality\n");
|
||||
return -EPERM;
|
||||
} else {
|
||||
dev_err(&pf->pdev->dev,
|
||||
"Cannot add more MAC addresses, trusted VF exhausted it's resources\n");
|
||||
return -EPERM;
|
||||
@@ -3587,7 +3595,7 @@ static int i40e_validate_cloud_filter(struct i40e_vf *vf,
|
||||
|
||||
/* action_meta is TC number here to which the filter is applied */
|
||||
if (!tc_filter->action_meta ||
|
||||
tc_filter->action_meta > vf->num_tc) {
|
||||
tc_filter->action_meta >= vf->num_tc) {
|
||||
dev_info(&pf->pdev->dev, "VF %d: Invalid TC number %u\n",
|
||||
vf->vf_id, tc_filter->action_meta);
|
||||
goto err;
|
||||
@@ -3884,6 +3892,8 @@ err:
|
||||
aq_ret);
|
||||
}
|
||||
|
||||
#define I40E_MAX_VF_CLOUD_FILTER 0xFF00
|
||||
|
||||
/**
|
||||
* i40e_vc_add_cloud_filter
|
||||
* @vf: pointer to the VF info
|
||||
@@ -3923,6 +3933,14 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg)
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
if (vf->num_cloud_filters >= I40E_MAX_VF_CLOUD_FILTER) {
|
||||
dev_warn(&pf->pdev->dev,
|
||||
"VF %d: Max number of filters reached, can't apply cloud filter\n",
|
||||
vf->vf_id);
|
||||
aq_ret = -ENOSPC;
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
cfilter = kzalloc(sizeof(*cfilter), GFP_KERNEL);
|
||||
if (!cfilter) {
|
||||
aq_ret = -ENOMEM;
|
||||
|
||||
@@ -41,7 +41,8 @@ enum i40e_vf_states {
|
||||
I40E_VF_STATE_MC_PROMISC,
|
||||
I40E_VF_STATE_UC_PROMISC,
|
||||
I40E_VF_STATE_PRE_ENABLE,
|
||||
I40E_VF_STATE_RESETTING
|
||||
I40E_VF_STATE_RESETTING,
|
||||
I40E_VF_STATE_RESOURCES_LOADED,
|
||||
};
|
||||
|
||||
/* VF capabilities */
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
static const char * const libie_aq_str_arr[] = {
|
||||
#define LIBIE_AQ_STR(x) \
|
||||
[LIBIE_AQ_RC_##x] = "LIBIE_AQ_RC" #x
|
||||
[LIBIE_AQ_RC_##x] = "LIBIE_AQ_RC_" #x
|
||||
LIBIE_AQ_STR(OK),
|
||||
LIBIE_AQ_STR(EPERM),
|
||||
LIBIE_AQ_STR(ENOENT),
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
#include "rvu.h"
|
||||
#include "lmac_common.h"
|
||||
|
||||
#define DRV_NAME "Marvell-CGX/RPM"
|
||||
#define DRV_STRING "Marvell CGX/RPM Driver"
|
||||
#define DRV_NAME "Marvell-CGX-RPM"
|
||||
|
||||
#define CGX_RX_STAT_GLOBAL_INDEX 9
|
||||
|
||||
|
||||
@@ -1326,7 +1326,6 @@ static int otx2_tc_add_flow(struct otx2_nic *nic,
|
||||
|
||||
free_leaf:
|
||||
otx2_tc_del_from_flow_list(flow_cfg, new_node);
|
||||
kfree_rcu(new_node, rcu);
|
||||
if (new_node->is_act_police) {
|
||||
mutex_lock(&nic->mbox.lock);
|
||||
|
||||
@@ -1346,6 +1345,7 @@ free_leaf:
|
||||
|
||||
mutex_unlock(&nic->mbox.lock);
|
||||
}
|
||||
kfree_rcu(new_node, rcu);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1466,6 +1466,7 @@ static void fec_set_block_stats(struct mlx5e_priv *priv,
|
||||
case MLX5E_FEC_RS_528_514:
|
||||
case MLX5E_FEC_RS_544_514:
|
||||
case MLX5E_FEC_LLRS_272_257_1:
|
||||
case MLX5E_FEC_RS_544_514_INTERLEAVED_QUAD:
|
||||
fec_set_rs_stats(fec_stats, out);
|
||||
return;
|
||||
case MLX5E_FEC_FIRECODE:
|
||||
|
||||
@@ -663,7 +663,7 @@ static void del_sw_hw_rule(struct fs_node *node)
|
||||
BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_ACTION) |
|
||||
BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_FLOW_COUNTERS);
|
||||
fte->act_dests.action.action &= ~MLX5_FLOW_CONTEXT_ACTION_COUNT;
|
||||
mlx5_fc_local_destroy(rule->dest_attr.counter);
|
||||
mlx5_fc_local_put(rule->dest_attr.counter);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -343,6 +343,7 @@ struct mlx5_fc {
|
||||
enum mlx5_fc_type type;
|
||||
struct mlx5_fc_bulk *bulk;
|
||||
struct mlx5_fc_cache cache;
|
||||
refcount_t fc_local_refcount;
|
||||
/* last{packets,bytes} are used for calculating deltas since last reading. */
|
||||
u64 lastpackets;
|
||||
u64 lastbytes;
|
||||
|
||||
Loaded 20 of 41 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user