mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
Merge tag 'net-7.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski:
"Including fixes from netfilter, wireless and bluetooth.
Previous releases - regressions:
- tcp: rate limit receive queue collapsing
- raw: fix ICMP unreachable sent when receive queue is full
- eth: bnxt_en: take RTNL before netif_close() when aborting FW reset
Previous releases - always broken:
- tcp:
- bound snd_cwnd_clamp to TCP_MAX_SND_CWND
- number of fixes for TCP Fast Open
- gro:
- invalidate frag0 after a pull
- avoid parsing headers from shared fragments
- cipso: stop modifying live ip_options_rcu
- udp: do not use a cross-family sk_rx_dst in early demux
- fou: gue: check IP version of held packets for direct IP
encapsulation
- skbuff: preserve fclone lifetime when freeing stolen heads
- eth:
- mlx5e:
- fix crashes on queue stats access to queues without stats
- SHAMPO, disable end padding when relaxed ordering is
- ena: keep the RX buffer mapped if skb allocation fails"
* tag 'net-7.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (227 commits)
selftests: net: add a test for NSH GSO
nsh: limit recursion in nsh_gso_segment()
selftests: tls: Cover the cap on consecutive empty records
selftests: tls: Extend coverage for zero-length records
selftests: tls: Skip the zero_len tests when TLS is unavailable
tls: Consume empty data records in tls_sw_splice_read()
tls: Break the connection after a burst of empty data records
net: phy: c45: select BASE-T1 type for the forced speed
net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure
net/mlx5e: IPsec, don't match upper proto selectors in crypto offload TX
tcp: fix request_sock use-after-free during Fast Open accept()
net: usb: cdc_ncm: don't underflow the NDP room check
net: netns: fix INT_MAX nsid cleanup
amt: use ipv6_hdr() in amt_mldv1_leave_handler()
af_unix: Inherit SO_INQ in unix_stream_connect()
tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req().
mailmap: add entries for Hangbin Liu
net: virtio: validate outer protocol of UDP tunnel GSO packets
tun: clear stale skb->protocol of NAPI frags skbs
net: virtio: fix UDP tunnel GSO header of VLAN tagged packets
...
This commit is contained in:
@@ -365,6 +365,9 @@ Guru Das Srinagesh <[email protected]> <[email protected]>
|
||||
Gustavo Padovan <[email protected]>
|
||||
Gustavo Padovan <[email protected]>
|
||||
Hamza Mahfooz <[email protected]> <[email protected]>
|
||||
Hangbin Liu <[email protected]> <[email protected]>
|
||||
Hangbin Liu <[email protected]> <[email protected]>
|
||||
Hangbin Liu <[email protected]> <[email protected]>
|
||||
Hanjun Guo <[email protected]> <[email protected]>
|
||||
Hans de Goede <[email protected]> <[email protected]>
|
||||
Hans Verkuil <[email protected]> <[email protected]>
|
||||
|
||||
@@ -304,31 +304,13 @@ downstream distributions.
|
||||
|
||||
Q: Do you accept patches as well for iproute2's BPF loader?
|
||||
-----------------------------------------------------------
|
||||
A: Patches for the iproute2's BPF loader have to be sent to:
|
||||
A: Patches for iproute2, including its BPF loader, are sent to
|
||||
[email protected]. For details on iproute2 patch submission, see
|
||||
"Co-posting iproute2 patches" in Documentation/process/maintainer-netdev.rst.
|
||||
|
||||
netdev@vger.kernel.org
|
||||
|
||||
While those patches are not processed by the BPF kernel maintainers,
|
||||
please keep them in Cc as well, so they can be reviewed.
|
||||
|
||||
The official git repository for iproute2 is run by Stephen Hemminger
|
||||
and can be found at:
|
||||
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git/
|
||||
|
||||
The patches need to have a subject prefix of '``[PATCH iproute2
|
||||
master]``' or '``[PATCH iproute2 net-next]``'. '``master``' or
|
||||
'``net-next``' describes the target branch where the patch should be
|
||||
applied to. Meaning, if kernel changes went into the net-next kernel
|
||||
tree, then the related iproute2 changes need to go into the iproute2
|
||||
net-next branch, otherwise they can be targeted at master branch. The
|
||||
iproute2 net-next branch will get merged into the master branch after
|
||||
the current iproute2 version from master has been released.
|
||||
|
||||
Like BPF, the patches end up in patchwork under the netdev project and
|
||||
are delegated to 'shemminger' for further processing:
|
||||
|
||||
http://patchwork.ozlabs.org/project/netdev/list/?delegate=389
|
||||
While iproute2 BPF loader patches are not processed by the BPF kernel
|
||||
maintainers, please Cc [email protected] and the BPF maintainers for
|
||||
review.
|
||||
|
||||
Q: What is the minimum requirement before I submit my BPF patches?
|
||||
------------------------------------------------------------------
|
||||
|
||||
@@ -107,6 +107,7 @@ u32[3] received_ecn_bytes read_mostly read_w
|
||||
u8:4 received_ce_pending read_mostly read_write
|
||||
u32[3] delivered_ecn_bytes read_write
|
||||
u16 pkts_acked_ewma read_write
|
||||
u32 rcv_collapse_credit read_write tcp_queue_rcv,tcp_data_queue_ofo,tcp_prune_queue
|
||||
u8:2 syn_ect_snt write_mostly read_write
|
||||
u8:2 syn_ect_rcv read_mostly read_write
|
||||
u8:2 accecn_minlen write_mostly read_write
|
||||
|
||||
@@ -367,6 +367,41 @@ to the mailing list, e.g.::
|
||||
Posting as one thread is discouraged because it confuses patchwork
|
||||
(as of patchwork 2.2.2).
|
||||
|
||||
Co-posting iproute2 patches
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The official git repositories for iproute2 are:
|
||||
|
||||
- iproute2: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
|
||||
- iproute2-next: https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git
|
||||
|
||||
Patches for iproute2 must have a subject prefix of ``[PATCH iproute2]``
|
||||
or ``[PATCH iproute2-next]`` to indicate the target repository where the
|
||||
patch should be applied. If kernel changes target net-next or bpf-next,
|
||||
then the related iproute2 changes need to target iproute2-next, else they
|
||||
must target iproute2. The iproute2-next tree will be merged into the
|
||||
iproute2 tree after the current iproute2 version has been released.
|
||||
|
||||
Patches are tracked in patchwork under the netdevbpf project. iproute2
|
||||
patches are delegated to 'shemminger' (Stephen Hemminger), iproute2-next
|
||||
patches to 'dsa' (David Ahern):
|
||||
|
||||
- iproute2: https://patchwork.kernel.org/project/netdevbpf/list/?delegate=7961&state=*
|
||||
- iproute2-next: https://patchwork.kernel.org/project/netdevbpf/list/?delegate=123859&state=*
|
||||
|
||||
Send patches to [email protected] and always include the iproute2
|
||||
maintainers in the email Cc: list. See the MAINTAINERS file in the
|
||||
repository for email addresses and other details:
|
||||
|
||||
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/MAINTAINERS
|
||||
|
||||
For patches that target iproute2's BPF loader, also include
|
||||
[email protected] and the BPF maintainers.
|
||||
|
||||
For more information, see also README.devel in the repository:
|
||||
|
||||
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/README.devel
|
||||
|
||||
Co-posting selftests
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
+8
-4
@@ -18313,6 +18313,7 @@ F: drivers/net/phy/microchip_t1.c
|
||||
|
||||
MICROCHIP LAN966X ETHERNET DRIVER
|
||||
M: Horatiu Vultur <[email protected]>
|
||||
M: Daniel Machon <[email protected]>
|
||||
M: [email protected]
|
||||
L: [email protected]
|
||||
S: Maintained
|
||||
@@ -19634,7 +19635,9 @@ M: Steffen Klassert <[email protected]>
|
||||
M: Herbert Xu <[email protected]>
|
||||
M: "David S. Miller" <[email protected]>
|
||||
L: [email protected]
|
||||
L: [email protected]
|
||||
S: Maintained
|
||||
Q: https://patchwork.kernel.org/project/ipsec/list/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git
|
||||
F: Documentation/networking/xfrm/
|
||||
@@ -19800,6 +19803,7 @@ F: Documentation/networking/tls*
|
||||
F: include/net/tls.h
|
||||
F: include/uapi/linux/tls.h
|
||||
F: net/tls/
|
||||
F: tools/testing/selftests/drivers/net/hw/tls*
|
||||
F: tools/testing/selftests/net/tls.c
|
||||
|
||||
NETWORKING [SOCKETS]
|
||||
@@ -24816,7 +24820,7 @@ F: drivers/iommu/s390-iommu.c
|
||||
|
||||
S390 IUCV NETWORK LAYER
|
||||
M: Alexandra Winter <[email protected]>
|
||||
M: Thorsten Winkler <twinkler@linux.ibm.com>
|
||||
M: Hidayath Khan <hidayath@linux.ibm.com>
|
||||
L: [email protected]
|
||||
L: [email protected]
|
||||
S: Supported
|
||||
@@ -25604,7 +25608,8 @@ F: drivers/slimbus/
|
||||
F: include/linux/slimbus.h
|
||||
|
||||
SFC NETWORK DRIVER
|
||||
M: Edward Cree <ecree.xilinx@gmail.com>
|
||||
M: Alex Austin <alex.austin@amd.com>
|
||||
M: Andy Moreton <[email protected]>
|
||||
L: [email protected]
|
||||
L: [email protected]
|
||||
S: Maintained
|
||||
@@ -26123,9 +26128,8 @@ S: Maintained
|
||||
F: drivers/net/ethernet/natsemi/sonic.*
|
||||
|
||||
SONICS SILICON BACKPLANE DRIVER (SSB)
|
||||
M: Michael Buesch <[email protected]>
|
||||
L: [email protected]
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
F: drivers/ssb/
|
||||
F: include/linux/ssb/
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* ChipCommon core driver
|
||||
*
|
||||
* Copyright 2005, Broadcom Corporation
|
||||
* Copyright 2006, 2007, Michael Buesch <m@bues.ch>
|
||||
* Copyright 2006, 2007, Michael Buesch
|
||||
* Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de>
|
||||
*
|
||||
* Licensed under the GNU/GPL. See COPYING for details.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Broadcom specific AMBA
|
||||
* ChipCommon Power Management Unit driver
|
||||
*
|
||||
* Copyright 2009, Michael Buesch <m@bues.ch>
|
||||
* Copyright 2009, Michael Buesch
|
||||
* Copyright 2007, 2011, Broadcom Corporation
|
||||
* Copyright 2011, 2012, Hauke Mehrtens <hauke@hauke-m.de>
|
||||
*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* PCI Core
|
||||
*
|
||||
* Copyright 2005, 2011, Broadcom Corporation
|
||||
* Copyright 2006, 2007, Michael Buesch <m@bues.ch>
|
||||
* Copyright 2006, 2007, Michael Buesch
|
||||
* Copyright 2011, 2012, Hauke Mehrtens <hauke@hauke-m.de>
|
||||
*
|
||||
* Licensed under the GNU/GPL. See COPYING for details.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* PCI Core in hostmode
|
||||
*
|
||||
* Copyright 2005 - 2011, Broadcom Corporation
|
||||
* Copyright 2006, 2007, Michael Buesch <m@bues.ch>
|
||||
* Copyright 2006, 2007, Michael Buesch
|
||||
* Copyright 2011, 2012, Hauke Mehrtens <hauke@hauke-m.de>
|
||||
*
|
||||
* Licensed under the GNU/GPL. See COPYING for details.
|
||||
|
||||
@@ -943,6 +943,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
|
||||
switch (soc_type) {
|
||||
case QCA_QCA2066:
|
||||
case QCA_QCA6390:
|
||||
case QCA_WCN3950:
|
||||
case QCA_WCN3991:
|
||||
case QCA_WCN6750:
|
||||
case QCA_WCN6855:
|
||||
|
||||
@@ -1088,6 +1088,8 @@ struct btusb_data {
|
||||
int (*disconnect)(struct hci_dev *hdev);
|
||||
|
||||
int oob_wake_irq; /* irq for out-of-band wake-on-bt */
|
||||
|
||||
struct dentry *force_poll_sync_dentry;
|
||||
};
|
||||
|
||||
static void btusb_reset(struct hci_dev *hdev)
|
||||
@@ -4820,8 +4822,9 @@ static int btusb_probe(struct usb_interface *intf,
|
||||
|
||||
usb_set_intfdata(intf, data);
|
||||
|
||||
debugfs_create_file("force_poll_sync", 0644, hdev->debugfs, data,
|
||||
&force_poll_sync_fops);
|
||||
data->force_poll_sync_dentry =
|
||||
debugfs_create_file("force_poll_sync", 0644, hdev->debugfs,
|
||||
data, &force_poll_sync_fops);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -4862,6 +4865,9 @@ static void btusb_disconnect(struct usb_interface *intf)
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
debugfs_remove(data->force_poll_sync_dentry);
|
||||
data->force_poll_sync_dentry = NULL;
|
||||
|
||||
hdev = data->hdev;
|
||||
usb_set_intfdata(data->intf, NULL);
|
||||
|
||||
|
||||
@@ -161,6 +161,7 @@ struct qca_data {
|
||||
struct delayed_work ctrl_memdump_timeout;
|
||||
struct qca_memdump_info *qca_memdump;
|
||||
unsigned long flags;
|
||||
struct dentry *debugfs_ibs_dir;
|
||||
struct completion drop_ev_comp;
|
||||
wait_queue_head_t suspend_wait_q;
|
||||
enum qca_memdump_states memdump_state;
|
||||
@@ -665,6 +666,7 @@ static void qca_debugfs_init(struct hci_dev *hdev)
|
||||
return;
|
||||
|
||||
ibs_dir = debugfs_create_dir("ibs", hdev->debugfs);
|
||||
qca->debugfs_ibs_dir = ibs_dir;
|
||||
|
||||
/* read only */
|
||||
mode = 0444;
|
||||
@@ -744,6 +746,9 @@ static int qca_close(struct hci_uart *hu)
|
||||
|
||||
hu->priv = NULL;
|
||||
|
||||
debugfs_remove_recursive(qca->debugfs_ibs_dir);
|
||||
qca->debugfs_ibs_dir = NULL;
|
||||
|
||||
kfree(qca);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1081,7 +1081,8 @@ int dpll_pin_ref_sync_pair_add(struct dpll_pin *pin,
|
||||
mutex_lock(&dpll_lock);
|
||||
ret = xa_insert(&pin->ref_sync_pins, ref_sync_pin->id,
|
||||
ref_sync_pin, GFP_KERNEL);
|
||||
__dpll_pin_change_ntf(pin);
|
||||
if (!ret)
|
||||
__dpll_pin_change_ntf(pin);
|
||||
mutex_unlock(&dpll_lock);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org>
|
||||
* Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
|
||||
* Copyright (C) 2006 Michael Buesch <m@bues.ch>
|
||||
* Copyright (C) 2006 Michael Buesch
|
||||
* Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org>
|
||||
* Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de>
|
||||
*
|
||||
|
||||
+26
-35
@@ -2147,13 +2147,12 @@ static void amt_mldv1_leave_handler(struct amt_dev *amt, struct sk_buff *skb,
|
||||
struct amt_tunnel_list *tunnel)
|
||||
{
|
||||
struct mld_msg *mld = (struct mld_msg *)icmp6_hdr(skb);
|
||||
struct iphdr *iph = ip_hdr(skb);
|
||||
struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
||||
struct amt_group_node *gnode;
|
||||
union amt_addr group, host;
|
||||
|
||||
memcpy(&group.ip6, &mld->mld_mca, sizeof(struct in6_addr));
|
||||
memset(&host, 0, sizeof(union amt_addr));
|
||||
host.ip4 = iph->saddr;
|
||||
memcpy(&host.ip6, &ip6h->saddr, sizeof(struct in6_addr));
|
||||
|
||||
gnode = amt_lookup_group(tunnel, &group, &host, true);
|
||||
if (gnode) {
|
||||
@@ -3404,22 +3403,6 @@ static struct rtnl_link_ops amt_link_ops __read_mostly = {
|
||||
.fill_info = amt_fill_info,
|
||||
};
|
||||
|
||||
static struct net_device *amt_lookup_upper_dev(struct net_device *dev)
|
||||
{
|
||||
struct net_device *upper_dev;
|
||||
struct amt_dev *amt;
|
||||
|
||||
for_each_netdev(dev_net(dev), upper_dev) {
|
||||
if (netif_is_amt(upper_dev)) {
|
||||
amt = netdev_priv(upper_dev);
|
||||
if (amt->stream_dev == dev)
|
||||
return upper_dev;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int amt_device_event(struct notifier_block *unused,
|
||||
unsigned long event, void *ptr)
|
||||
{
|
||||
@@ -3429,26 +3412,34 @@ static int amt_device_event(struct notifier_block *unused,
|
||||
LIST_HEAD(list);
|
||||
int new_mtu;
|
||||
|
||||
upper_dev = amt_lookup_upper_dev(dev);
|
||||
if (!upper_dev)
|
||||
return NOTIFY_DONE;
|
||||
amt = netdev_priv(upper_dev);
|
||||
/* amt_dellink() leaves each device on the netns device list until
|
||||
* unregister_netdevice_many(), so the walk stays valid.
|
||||
*/
|
||||
for_each_netdev(dev_net(dev), upper_dev) {
|
||||
if (!netif_is_amt(upper_dev))
|
||||
continue;
|
||||
amt = netdev_priv(upper_dev);
|
||||
if (amt->stream_dev != dev)
|
||||
continue;
|
||||
|
||||
switch (event) {
|
||||
case NETDEV_UNREGISTER:
|
||||
amt_dellink(amt->dev, &list);
|
||||
unregister_netdevice_many(&list);
|
||||
break;
|
||||
case NETDEV_CHANGEMTU:
|
||||
if (amt->mode == AMT_MODE_RELAY)
|
||||
new_mtu = dev->mtu - AMT_RELAY_HLEN;
|
||||
else
|
||||
new_mtu = dev->mtu - AMT_GW_HLEN;
|
||||
switch (event) {
|
||||
case NETDEV_UNREGISTER:
|
||||
amt_dellink(amt->dev, &list);
|
||||
break;
|
||||
case NETDEV_CHANGEMTU:
|
||||
if (amt->mode == AMT_MODE_RELAY)
|
||||
new_mtu = dev->mtu - AMT_RELAY_HLEN;
|
||||
else
|
||||
new_mtu = dev->mtu - AMT_GW_HLEN;
|
||||
|
||||
dev_set_mtu(amt->dev, new_mtu);
|
||||
break;
|
||||
dev_set_mtu(amt->dev, new_mtu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (event == NETDEV_UNREGISTER)
|
||||
unregister_netdevice_many(&list);
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2305,7 +2305,7 @@ skip_mac_set:
|
||||
SLAVE_NL_ERR(bond_dev, slave_dev, extack,
|
||||
"Slave does not support XDP");
|
||||
res = -EOPNOTSUPP;
|
||||
goto err_sysfs_del;
|
||||
goto err_dec_slave_cnt;
|
||||
}
|
||||
} else if (bond->xdp_prog) {
|
||||
struct netdev_bpf xdp = {
|
||||
@@ -2319,14 +2319,14 @@ skip_mac_set:
|
||||
SLAVE_NL_ERR(bond_dev, slave_dev, extack,
|
||||
"Slave has XDP program loaded, please unload before enslaving");
|
||||
res = -EOPNOTSUPP;
|
||||
goto err_sysfs_del;
|
||||
goto err_dec_slave_cnt;
|
||||
}
|
||||
|
||||
res = dev_xdp_propagate(slave_dev, &xdp);
|
||||
if (res < 0) {
|
||||
/* ndo_bpf() sets extack error message */
|
||||
slave_dbg(bond_dev, slave_dev, "Error %d calling ndo_bpf\n", res);
|
||||
goto err_sysfs_del;
|
||||
goto err_dec_slave_cnt;
|
||||
}
|
||||
if (bond->xdp_prog)
|
||||
bpf_prog_inc(bond->xdp_prog);
|
||||
@@ -2348,6 +2348,9 @@ skip_mac_set:
|
||||
return 0;
|
||||
|
||||
/* Undo stages on error */
|
||||
err_dec_slave_cnt:
|
||||
WRITE_ONCE(bond->slave_cnt, bond->slave_cnt - 1);
|
||||
|
||||
err_sysfs_del:
|
||||
bond_sysfs_slave_del(new_slave);
|
||||
|
||||
|
||||
@@ -4023,6 +4023,7 @@ int ksz_switch_register(struct ksz_device *dev)
|
||||
mutex_init(&dev->regmap_mutex);
|
||||
mutex_init(&dev->alu_mutex);
|
||||
mutex_init(&dev->vlan_mutex);
|
||||
mutex_init(&dev->lock_irq);
|
||||
|
||||
ret = ksz_switch_detect(dev);
|
||||
if (ret)
|
||||
|
||||
@@ -1405,6 +1405,9 @@ yt921x_dsa_port_bridge_join(struct dsa_switch *ds, int port,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct yt921x_priv *priv = dsa_to_yt921x_priv(ds);
|
||||
struct yt921x_port *pp = &priv->ports[port];
|
||||
struct net_device *brport_dev;
|
||||
struct dsa_port *dp;
|
||||
u16 ports_mask;
|
||||
int res;
|
||||
|
||||
@@ -1414,7 +1417,12 @@ yt921x_dsa_port_bridge_join(struct dsa_switch *ds, int port,
|
||||
ports_mask = dsa_bridge_ports(ds, bridge.dev);
|
||||
ports_mask |= priv->cpu_ports_mask;
|
||||
|
||||
dp = dsa_to_port(ds, port);
|
||||
brport_dev = dsa_port_to_bridge_port(dp);
|
||||
|
||||
mutex_lock(&priv->reg_lock);
|
||||
pp->isolated = br_port_flag_is_set(brport_dev, BR_ISOLATED);
|
||||
pp->hairpin = br_port_flag_is_set(brport_dev, BR_HAIRPIN_MODE);
|
||||
res = yt921x_bridge_join(priv, port, ports_mask);
|
||||
mutex_unlock(&priv->reg_lock);
|
||||
|
||||
|
||||
@@ -1030,55 +1030,54 @@ yt921x_acl_rule_ext_parse_flow_action(struct yt921x_acl_rule_ext *ruleext,
|
||||
const struct flow_rule *rule = flow_cls_offload_flow_rule(cls);
|
||||
const struct flow_action *flow_action = &rule->action;
|
||||
struct netlink_ext_ack *extack = cls->common.extack;
|
||||
enum flow_action_id redir_act = NUM_FLOW_ACTIONS;
|
||||
const struct flow_action_entry *act;
|
||||
u32 *action = ruleext->r.action;
|
||||
bool seen_priority = false;
|
||||
const char *reason = NULL;
|
||||
bool seen_police = false;
|
||||
bool terminal = false;
|
||||
bool redir = false;
|
||||
const char *reason;
|
||||
unsigned int i;
|
||||
int res;
|
||||
|
||||
memset(action, 0, 3 * sizeof(*action));
|
||||
flow_action_for_each(i, act, flow_action)
|
||||
flow_action_for_each(i, act, flow_action) {
|
||||
/* The flow action entry carries no mirred control, so there
|
||||
* is no way to tell whether software would continue past a
|
||||
* redirect and apply the actions after it. Leave the list to
|
||||
* software instead of guessing a hardware verdict.
|
||||
*/
|
||||
if (redir) {
|
||||
reason = "Action after redirect";
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
switch (act->id) {
|
||||
case FLOW_ACTION_ACCEPT:
|
||||
action[2] |= YT921X_ACL_ACTc_FWD_EN |
|
||||
YT921X_ACL_ACTc_FWD_FWD;
|
||||
terminal = true;
|
||||
break;
|
||||
case FLOW_ACTION_DROP:
|
||||
case FLOW_ACTION_REDIRECT:
|
||||
if (redir_act != NUM_FLOW_ACTIONS &&
|
||||
redir_act != act->id) {
|
||||
reason = "Different redirect actions";
|
||||
action[2] |= YT921X_ACL_ACTc_FWD_EN |
|
||||
YT921X_ACL_ACTc_FWD_REDIR;
|
||||
terminal = true;
|
||||
break;
|
||||
case FLOW_ACTION_REDIRECT: {
|
||||
struct dsa_port *to_dp;
|
||||
|
||||
to_dp = dsa_port_from_netdev(act->dev);
|
||||
if (IS_ERR(to_dp) || to_dp->ds != &priv->ds) {
|
||||
reason = "Redirect to non-local port";
|
||||
goto fallback;
|
||||
}
|
||||
redir_act = act->id;
|
||||
|
||||
switch (act->id) {
|
||||
case FLOW_ACTION_ACCEPT:
|
||||
action[2] |= YT921X_ACL_ACTc_FWD_EN |
|
||||
YT921X_ACL_ACTc_FWD_FWD;
|
||||
break;
|
||||
case FLOW_ACTION_DROP:
|
||||
action[2] |= YT921X_ACL_ACTc_FWD_EN |
|
||||
YT921X_ACL_ACTc_FWD_REDIR;
|
||||
break;
|
||||
case FLOW_ACTION_REDIRECT: {
|
||||
struct dsa_port *to_dp;
|
||||
|
||||
to_dp = dsa_port_from_netdev(act->dev);
|
||||
if (IS_ERR(to_dp) || to_dp->ds != &priv->ds) {
|
||||
reason = "Redirect to non-local port";
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
action[2] |= YT921X_ACL_ACTc_FWD_EN |
|
||||
YT921X_ACL_ACTc_FWD_REDIR |
|
||||
YT921X_ACL_ACTc_FWD_REDIR_DPORTn(to_dp->index);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
action[2] |= YT921X_ACL_ACTc_FWD_EN |
|
||||
YT921X_ACL_ACTc_FWD_REDIR |
|
||||
YT921X_ACL_ACTc_FWD_REDIR_DPORTn(to_dp->index);
|
||||
redir = true;
|
||||
break;
|
||||
}
|
||||
case FLOW_ACTION_PRIORITY:
|
||||
if (seen_priority) {
|
||||
action[0] &= ~YT921X_ACL_ACTa_PRIO_EN;
|
||||
@@ -1122,6 +1121,7 @@ yt921x_acl_rule_ext_parse_flow_action(struct yt921x_acl_rule_ext *ruleext,
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reason = "Unsupported by HW";
|
||||
fallback:
|
||||
if (cls->common.skip_sw) {
|
||||
NL_SET_ERR_MSG_FMT_MOD(extack,
|
||||
@@ -1131,15 +1131,18 @@ fallback:
|
||||
}
|
||||
fallthrough;
|
||||
case FLOW_ACTION_TRAP:
|
||||
redir_act = FLOW_ACTION_TRAP;
|
||||
|
||||
action[2] &= ~YT921X_ACL_ACTc_FWD_REDIR_DPORTS_M &
|
||||
~YT921X_ACL_ACTc_FWD_M;
|
||||
action[2] |= YT921X_ACL_ACTc_FWD_EN |
|
||||
YT921X_ACL_ACTc_FWD_TRAP;
|
||||
terminal = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (terminal)
|
||||
break;
|
||||
}
|
||||
|
||||
ruleext->r.sw_assisted = !cls->common.skip_sw;
|
||||
return 0;
|
||||
}
|
||||
@@ -1223,7 +1226,7 @@ static u16 yt921x_acl_activated_ports(const struct yt921x_priv *priv)
|
||||
|
||||
static unsigned int
|
||||
yt921x_acl_find(const struct yt921x_priv *priv, enum tc_setup_type type,
|
||||
unsigned long tag)
|
||||
unsigned long tag, u16 ports_mask)
|
||||
{
|
||||
for (unsigned int blkid = 0; blkid < YT921X_ACL_BLK_NUM; blkid++) {
|
||||
const struct yt921x_acl_blk *aclblk = priv->acl_blks[blkid];
|
||||
@@ -1233,7 +1236,10 @@ yt921x_acl_find(const struct yt921x_priv *priv, enum tc_setup_type type,
|
||||
|
||||
for (unsigned int i = 0; i < YT921X_ACL_ENT_PER_BLK; i++)
|
||||
if (aclblk->rules[i] && aclblk->rules[i]->tag == tag &&
|
||||
aclblk->rules[i]->type == type)
|
||||
aclblk->rules[i]->type == type &&
|
||||
FIELD_GET(YT921X_ACL_KEYb_SPORTS_M,
|
||||
aclblk->rules[i]->entries[0].key[1]) ==
|
||||
ports_mask)
|
||||
return YT921X_ACL_ENT_PER_BLK * blkid + i;
|
||||
}
|
||||
|
||||
@@ -1361,7 +1367,7 @@ yt921x_acl_commit(struct yt921x_priv *priv, unsigned int entid, u8 entsmask)
|
||||
|
||||
static int
|
||||
yt921x_acl_del(struct yt921x_priv *priv, enum tc_setup_type type,
|
||||
unsigned long tag)
|
||||
unsigned long tag, u16 ports_mask)
|
||||
{
|
||||
struct yt921x_acl_rule *aclrule;
|
||||
struct yt921x_acl_blk *aclblk;
|
||||
@@ -1375,7 +1381,7 @@ yt921x_acl_del(struct yt921x_priv *priv, enum tc_setup_type type,
|
||||
int res;
|
||||
int ret;
|
||||
|
||||
entid = yt921x_acl_find(priv, type, tag);
|
||||
entid = yt921x_acl_find(priv, type, tag, ports_mask);
|
||||
if (entid == UINT_MAX)
|
||||
return -ENOENT;
|
||||
|
||||
@@ -1550,7 +1556,7 @@ yt921x_dsa_cls_flower_del(struct dsa_switch *ds, int port,
|
||||
int res;
|
||||
|
||||
mutex_lock(&priv->reg_lock);
|
||||
res = yt921x_acl_del(priv, TC_SETUP_CLSFLOWER, cls->cookie);
|
||||
res = yt921x_acl_del(priv, TC_SETUP_CLSFLOWER, cls->cookie, BIT(port));
|
||||
mutex_unlock(&priv->reg_lock);
|
||||
|
||||
return res;
|
||||
|
||||
@@ -986,7 +986,7 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
|
||||
page_offset = rx_info->page_offset;
|
||||
buf_addr = page_address(rx_info->page) + page_offset;
|
||||
|
||||
if (len <= rx_ring->rx_copybreak) {
|
||||
if (len <= rx_ring->rx_copybreak && likely(descs == 1)) {
|
||||
skb = ena_alloc_skb(rx_ring, NULL, len);
|
||||
if (unlikely(!skb))
|
||||
return NULL;
|
||||
@@ -1009,6 +1009,10 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
|
||||
|
||||
buf_len = SKB_DATA_ALIGN(len + buf_offset + tailroom);
|
||||
|
||||
skb = ena_alloc_skb(rx_ring, buf_addr, buf_len);
|
||||
if (unlikely(!skb))
|
||||
return NULL;
|
||||
|
||||
/* If XDP isn't loaded try to reuse part of the RX buffer */
|
||||
reuse_rx_buf_page = !is_xdp_loaded &&
|
||||
ena_try_rx_buf_page_reuse(rx_info, buf_len, len, pkt_offset);
|
||||
@@ -1016,10 +1020,6 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
|
||||
if (!reuse_rx_buf_page)
|
||||
ena_unmap_rx_buff_attrs(rx_ring, rx_info, DMA_ATTR_SKIP_CPU_SYNC);
|
||||
|
||||
skb = ena_alloc_skb(rx_ring, buf_addr, buf_len);
|
||||
if (unlikely(!skb))
|
||||
return NULL;
|
||||
|
||||
/* Populate skb's linear part */
|
||||
skb_reserve(skb, buf_offset);
|
||||
skb_put(skb, len);
|
||||
@@ -1293,7 +1293,8 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi,
|
||||
|
||||
skb_record_rx_queue(skb, rx_ring->qid);
|
||||
|
||||
if (rx_ring->ena_bufs[0].len <= rx_ring->rx_copybreak)
|
||||
if (rx_ring->ena_bufs[0].len <= rx_ring->rx_copybreak &&
|
||||
ena_rx_ctx.descs == 1)
|
||||
rx_copybreak_pkt++;
|
||||
|
||||
total_len += skb->len;
|
||||
|
||||
@@ -14837,7 +14837,10 @@ static int bnxt_get_registered_vfs(struct bnxt *bp)
|
||||
void bnxt_fw_reset(struct bnxt *bp)
|
||||
{
|
||||
bnxt_ulp_stop(bp);
|
||||
bnxt_lock_sp(bp);
|
||||
if (BNXT_PF(bp))
|
||||
bnxt_rtnl_lock_sp(bp);
|
||||
else
|
||||
bnxt_lock_sp(bp);
|
||||
if (test_bit(BNXT_STATE_OPEN, &bp->state) &&
|
||||
!test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) {
|
||||
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
|
||||
@@ -14883,7 +14886,10 @@ void bnxt_fw_reset(struct bnxt *bp)
|
||||
bnxt_queue_fw_reset_work(bp, tmo);
|
||||
}
|
||||
fw_reset_exit:
|
||||
bnxt_unlock_sp(bp);
|
||||
if (BNXT_PF(bp))
|
||||
bnxt_rtnl_unlock_sp(bp);
|
||||
else
|
||||
bnxt_unlock_sp(bp);
|
||||
}
|
||||
|
||||
static void bnxt_chk_missed_irq(struct bnxt *bp)
|
||||
@@ -15546,9 +15552,8 @@ static void bnxt_fw_reset_task(struct work_struct *work)
|
||||
bp->fw_reset_timestamp = jiffies;
|
||||
netdev_lock(bp->dev);
|
||||
if (test_bit(BNXT_STATE_ABORT_ERR, &bp->state)) {
|
||||
bnxt_fw_reset_abort(bp, rc);
|
||||
netdev_unlock(bp->dev);
|
||||
goto ulp_start;
|
||||
goto fw_reset_abort;
|
||||
}
|
||||
bnxt_fw_reset_close(bp);
|
||||
if (bp->fw_cap & BNXT_FW_CAP_ERR_RECOVER_RELOAD) {
|
||||
@@ -15681,9 +15686,11 @@ fw_reset_abort_status:
|
||||
netdev_err(bp->dev, "fw_health_status 0x%x\n", sts);
|
||||
}
|
||||
fw_reset_abort:
|
||||
rtnl_lock();
|
||||
netdev_lock(bp->dev);
|
||||
bnxt_fw_reset_abort(bp, rc);
|
||||
netdev_unlock(bp->dev);
|
||||
rtnl_unlock();
|
||||
ulp_start:
|
||||
if (!rc)
|
||||
bnxt_ulp_start(bp);
|
||||
|
||||
@@ -871,6 +871,10 @@ struct gve_ctrl_ops {
|
||||
int (*report_link_speed)(struct gve_priv *priv);
|
||||
};
|
||||
|
||||
struct gve_ring_err_stats {
|
||||
u64 rx_alloc_fails;
|
||||
};
|
||||
|
||||
struct gve_priv {
|
||||
struct net_device *dev;
|
||||
struct gve_tx_ring *tx; /* array of tx_cfg.num_queues */
|
||||
@@ -957,9 +961,17 @@ struct gve_priv {
|
||||
struct workqueue_struct *gve_wq;
|
||||
struct work_struct service_task;
|
||||
struct work_struct stats_report_task;
|
||||
/* Protects the priv->tx/priv->rx arrays, the in-place rewrite of
|
||||
* priv->rx[idx] and the queue counts against stats readers that do
|
||||
* not hold the netdev instance lock.
|
||||
* Also protects base_net_stats and base_ring_err_stats.
|
||||
*/
|
||||
spinlock_t stats_lock;
|
||||
unsigned long service_task_flags;
|
||||
unsigned long state_flags;
|
||||
|
||||
struct gve_ring_err_stats base_ring_err_stats;
|
||||
struct rtnl_link_stats64 base_net_stats;
|
||||
struct gve_stats_report *stats_report;
|
||||
u64 stats_report_len;
|
||||
dma_addr_t stats_report_bus; /* dma address for the stats report */
|
||||
|
||||
@@ -191,7 +191,9 @@ void gve_parse_device_option(struct gve_priv *priv,
|
||||
*dev_op_modify_ring = (void *)(option + 1);
|
||||
|
||||
/* device has not provided min ring size */
|
||||
if (option_length == GVE_DEVICE_OPTION_NO_MIN_RING_SIZE)
|
||||
if (option_length == GVE_DEVICE_OPTION_NO_MIN_RING_SIZE ||
|
||||
be16_to_cpu((*dev_op_modify_ring)->min_rx_ring_size) == 0 ||
|
||||
be16_to_cpu((*dev_op_modify_ring)->min_tx_ring_size) == 0)
|
||||
priv->device_info.default_min_ring_size = true;
|
||||
break;
|
||||
case GVE_DEV_OPT_ID_FLOW_STEERING:
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <net/netdev_lock.h>
|
||||
#include <net/netdev_queues.h>
|
||||
#include <net/sch_generic.h>
|
||||
#include <net/xdp_sock_drv.h>
|
||||
@@ -61,15 +62,44 @@ static netdev_tx_t gve_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
return gve_tx_dqo(skb, dev);
|
||||
}
|
||||
|
||||
static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
|
||||
static void gve_add_base_stats(struct gve_priv *priv,
|
||||
struct rtnl_link_stats64 *s)
|
||||
{
|
||||
struct rtnl_link_stats64 *base_stats = &priv->base_net_stats;
|
||||
|
||||
s->rx_packets += base_stats->rx_packets;
|
||||
s->rx_bytes += base_stats->rx_bytes;
|
||||
s->tx_packets += base_stats->tx_packets;
|
||||
s->tx_bytes += base_stats->tx_bytes;
|
||||
}
|
||||
|
||||
static void gve_add_tx_ring_range_stats(struct gve_priv *priv, int start_ring,
|
||||
int end_ring, u64 *packets, u64 *bytes)
|
||||
{
|
||||
struct gve_priv *priv = netdev_priv(dev);
|
||||
unsigned int start;
|
||||
u64 packets, bytes;
|
||||
int num_tx_queues;
|
||||
int ring;
|
||||
|
||||
num_tx_queues = gve_num_tx_queues(priv);
|
||||
for (ring = start_ring; ring < end_ring; ring++) {
|
||||
struct gve_tx_ring *tx = &priv->tx[ring];
|
||||
unsigned int start;
|
||||
u64 pkts, byts;
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&tx->statss);
|
||||
pkts = tx->pkt_done;
|
||||
byts = tx->bytes_done;
|
||||
} while (u64_stats_fetch_retry(&tx->statss, start));
|
||||
*packets += pkts;
|
||||
*bytes += byts;
|
||||
}
|
||||
}
|
||||
|
||||
static void gve_get_ring_stats(struct gve_priv *priv,
|
||||
struct rtnl_link_stats64 *s)
|
||||
{
|
||||
unsigned int start;
|
||||
u64 packets, bytes;
|
||||
int ring;
|
||||
|
||||
if (priv->rx) {
|
||||
for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) {
|
||||
do {
|
||||
@@ -83,21 +113,44 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
|
||||
s->rx_bytes += bytes;
|
||||
}
|
||||
}
|
||||
if (priv->tx) {
|
||||
for (ring = 0; ring < num_tx_queues; ring++) {
|
||||
do {
|
||||
start =
|
||||
u64_stats_fetch_begin(&priv->tx[ring].statss);
|
||||
packets = priv->tx[ring].pkt_done;
|
||||
bytes = priv->tx[ring].bytes_done;
|
||||
} while (u64_stats_fetch_retry(&priv->tx[ring].statss,
|
||||
start));
|
||||
s->tx_packets += packets;
|
||||
s->tx_bytes += bytes;
|
||||
}
|
||||
if (priv->tx)
|
||||
gve_add_tx_ring_range_stats(priv, 0, gve_num_tx_queues(priv),
|
||||
&s->tx_packets, &s->tx_bytes);
|
||||
}
|
||||
|
||||
static void gve_get_ring_err_stats(struct gve_priv *priv,
|
||||
struct gve_ring_err_stats *err_stats)
|
||||
{
|
||||
int ring;
|
||||
|
||||
if (!priv->rx)
|
||||
return;
|
||||
|
||||
for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) {
|
||||
struct gve_rx_ring *rx = &priv->rx[ring];
|
||||
unsigned int start;
|
||||
u64 rx_alloc_fails;
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&rx->statss);
|
||||
rx_alloc_fails = rx->rx_skb_alloc_fail +
|
||||
rx->rx_buf_alloc_fail;
|
||||
} while (u64_stats_fetch_retry(&rx->statss, start));
|
||||
|
||||
err_stats->rx_alloc_fails += rx_alloc_fails;
|
||||
}
|
||||
}
|
||||
|
||||
static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
|
||||
{
|
||||
struct gve_priv *priv = netdev_priv(dev);
|
||||
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
gve_get_ring_stats(priv, s);
|
||||
gve_add_base_stats(priv, s);
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
}
|
||||
|
||||
static int gve_alloc_flow_rule_caches(struct gve_priv *priv)
|
||||
{
|
||||
struct gve_flow_rules_cache *flow_rules_cache = &priv->flow_rules_cache;
|
||||
@@ -641,9 +694,16 @@ static void gve_queues_mem_remove(struct gve_priv *priv)
|
||||
struct gve_rx_alloc_rings_cfg rx_alloc_cfg = {0};
|
||||
|
||||
gve_get_curr_alloc_cfgs(priv, &tx_alloc_cfg, &rx_alloc_cfg);
|
||||
gve_queues_mem_free(priv, &tx_alloc_cfg, &rx_alloc_cfg);
|
||||
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
gve_get_ring_stats(priv, &priv->base_net_stats);
|
||||
gve_get_ring_err_stats(priv, &priv->base_ring_err_stats);
|
||||
|
||||
priv->tx = NULL;
|
||||
priv->rx = NULL;
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
|
||||
gve_queues_mem_free(priv, &tx_alloc_cfg, &rx_alloc_cfg);
|
||||
}
|
||||
|
||||
static void gve_free_control_plane_resources(struct gve_priv *priv)
|
||||
@@ -1370,6 +1430,37 @@ static void gve_queues_stop(struct gve_priv *priv)
|
||||
gve_rx_stop_rings(priv, priv->rx_cfg.num_queues);
|
||||
}
|
||||
|
||||
static void gve_handle_link_status(struct gve_priv *priv)
|
||||
{
|
||||
bool link_up;
|
||||
|
||||
netdev_assert_locked(priv->dev);
|
||||
|
||||
if (!gve_get_napi_enabled(priv))
|
||||
return;
|
||||
|
||||
link_up = READ_ONCE(priv->link_up);
|
||||
if (link_up == netif_carrier_ok(priv->dev))
|
||||
return;
|
||||
|
||||
if (link_up) {
|
||||
netdev_info(priv->dev, "Device link is up.\n");
|
||||
netif_carrier_on(priv->dev);
|
||||
} else {
|
||||
netdev_info(priv->dev, "Device link is down.\n");
|
||||
netif_carrier_off(priv->dev);
|
||||
}
|
||||
}
|
||||
|
||||
static void gve_turnup_and_check_status(struct gve_priv *priv)
|
||||
{
|
||||
const struct gve_ctrl_ops *ops = priv->ctrl_ops;
|
||||
|
||||
gve_turnup(priv);
|
||||
ops->report_link_status(priv);
|
||||
gve_handle_link_status(priv);
|
||||
}
|
||||
|
||||
/* The passed-in queue memory is stored into priv and the queues are made live.
|
||||
* No memory is allocated. Passed-in memory is freed on errors.
|
||||
*/
|
||||
@@ -1381,6 +1472,7 @@ static int gve_queues_start(struct gve_priv *priv,
|
||||
int err;
|
||||
|
||||
/* Record new resources into priv */
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
priv->tx = tx_alloc_cfg->tx;
|
||||
priv->rx = rx_alloc_cfg->rx;
|
||||
|
||||
@@ -1394,10 +1486,11 @@ static int gve_queues_start(struct gve_priv *priv,
|
||||
priv->rx_pages_per_qpl = rx_alloc_cfg->pages_per_qpl;
|
||||
priv->header_split_enabled = rx_alloc_cfg->enable_header_split;
|
||||
priv->rx_cfg.packet_buffer_size = rx_alloc_cfg->packet_buffer_size;
|
||||
gve_init_sync_stats(priv);
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
|
||||
gve_tx_start_rings(priv, gve_num_tx_queues(priv));
|
||||
gve_rx_start_rings(priv, rx_alloc_cfg->qcfg_rx->num_queues);
|
||||
gve_init_sync_stats(priv);
|
||||
|
||||
err = netif_set_real_num_tx_queues(dev, priv->tx_cfg.num_queues);
|
||||
if (err)
|
||||
@@ -1431,7 +1524,11 @@ static int gve_queues_start(struct gve_priv *priv,
|
||||
round_jiffies(jiffies +
|
||||
msecs_to_jiffies(priv->stats_report_timer_period)));
|
||||
|
||||
gve_turnup(priv);
|
||||
gve_turnup_and_check_status(priv);
|
||||
/* Also kick the service task. When the queues come back up after
|
||||
* gve_reset() or resume, this handles a reset requested while the
|
||||
* service task was disabled.
|
||||
*/
|
||||
queue_work(priv->gve_wq, &priv->service_task);
|
||||
priv->interface_up_cnt++;
|
||||
return 0;
|
||||
@@ -1507,26 +1604,6 @@ reset:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void gve_handle_link_status(struct gve_priv *priv)
|
||||
{
|
||||
bool link_up;
|
||||
|
||||
if (!gve_get_napi_enabled(priv))
|
||||
return;
|
||||
|
||||
link_up = READ_ONCE(priv->link_up);
|
||||
if (link_up == netif_carrier_ok(priv->dev))
|
||||
return;
|
||||
|
||||
if (link_up) {
|
||||
netdev_info(priv->dev, "Device link is up.\n");
|
||||
netif_carrier_on(priv->dev);
|
||||
} else {
|
||||
netdev_info(priv->dev, "Device link is down.\n");
|
||||
netif_carrier_off(priv->dev);
|
||||
}
|
||||
}
|
||||
|
||||
static int gve_configure_rings_xdp(struct gve_priv *priv,
|
||||
u16 num_xdp_rings)
|
||||
{
|
||||
@@ -2001,15 +2078,6 @@ static void gve_turnup(struct gve_priv *priv)
|
||||
gve_set_napi_enabled(priv);
|
||||
}
|
||||
|
||||
static void gve_turnup_and_check_status(struct gve_priv *priv)
|
||||
{
|
||||
const struct gve_ctrl_ops *ops = priv->ctrl_ops;
|
||||
|
||||
gve_turnup(priv);
|
||||
ops->report_link_status(priv);
|
||||
gve_handle_link_status(priv);
|
||||
}
|
||||
|
||||
static struct gve_notify_block *gve_get_tx_notify_block(struct gve_priv *priv,
|
||||
unsigned int txqueue)
|
||||
{
|
||||
@@ -2264,6 +2332,7 @@ void gve_handle_report_stats(struct gve_priv *priv)
|
||||
if (!gve_get_report_stats(priv))
|
||||
return;
|
||||
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
be64_add_cpu(&priv->stats_report->written_count, 1);
|
||||
/* tx stats */
|
||||
if (priv->tx) {
|
||||
@@ -2328,6 +2397,7 @@ void gve_handle_report_stats(struct gve_priv *priv)
|
||||
};
|
||||
}
|
||||
}
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
}
|
||||
|
||||
/* Handle NIC status register changes, reset requests and report stats */
|
||||
@@ -2341,8 +2411,14 @@ static void gve_service_task(struct work_struct *work)
|
||||
gve_handle_status(priv, status);
|
||||
|
||||
gve_handle_reset(priv);
|
||||
|
||||
/* Serialize with the synchronous link status updates, which all run
|
||||
* under the netdev instance lock.
|
||||
*/
|
||||
netdev_lock(priv->dev);
|
||||
ops->report_link_status(priv);
|
||||
gve_handle_link_status(priv);
|
||||
netdev_unlock(priv->dev);
|
||||
}
|
||||
|
||||
static void gve_set_netdev_xdp_features(struct gve_priv *priv)
|
||||
@@ -2677,8 +2753,20 @@ static int gve_rx_queue_stop(struct net_device *dev, void *per_q_mem, int idx)
|
||||
gve_turnup_and_check_status(priv);
|
||||
|
||||
gve_per_q_mem = (struct gve_rx_ring *)per_q_mem;
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
priv->base_net_stats.rx_packets += priv->rx[idx].rpackets;
|
||||
priv->base_net_stats.rx_bytes += priv->rx[idx].rbytes;
|
||||
priv->base_ring_err_stats.rx_alloc_fails +=
|
||||
priv->rx[idx].rx_skb_alloc_fail +
|
||||
priv->rx[idx].rx_buf_alloc_fail;
|
||||
*gve_per_q_mem = priv->rx[idx];
|
||||
memset(&priv->rx[idx], 0, sizeof(priv->rx[idx]));
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
|
||||
gve_per_q_mem->rpackets = 0;
|
||||
gve_per_q_mem->rbytes = 0;
|
||||
gve_per_q_mem->rx_skb_alloc_fail = 0;
|
||||
gve_per_q_mem->rx_buf_alloc_fail = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2732,7 +2820,9 @@ static int gve_rx_queue_start(struct net_device *dev,
|
||||
return -EAGAIN;
|
||||
|
||||
gve_per_q_mem = (struct gve_rx_ring *)per_q_mem;
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
priv->rx[idx] = *gve_per_q_mem;
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
|
||||
/* Single-queue creation requires quiescence on all queues */
|
||||
gve_turndown(priv);
|
||||
@@ -2768,7 +2858,9 @@ abort:
|
||||
* which needs the rtnl lock, will not run till this func returns and
|
||||
* its caller gives up the lock.
|
||||
*/
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
memset(&priv->rx[idx], 0, sizeof(priv->rx[idx]));
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -2784,9 +2876,15 @@ static void gve_get_rx_queue_stats(struct net_device *dev, int idx,
|
||||
struct netdev_queue_stats_rx *rx_stats)
|
||||
{
|
||||
struct gve_priv *priv = netdev_priv(dev);
|
||||
struct gve_rx_ring *rx = &priv->rx[idx];
|
||||
struct gve_rx_ring *rx;
|
||||
unsigned int start;
|
||||
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
if (!priv->rx)
|
||||
goto unlock;
|
||||
|
||||
rx = &priv->rx[idx];
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&rx->statss);
|
||||
rx_stats->packets = rx->rpackets;
|
||||
@@ -2794,32 +2892,62 @@ static void gve_get_rx_queue_stats(struct net_device *dev, int idx,
|
||||
rx_stats->alloc_fail = rx->rx_skb_alloc_fail +
|
||||
rx->rx_buf_alloc_fail;
|
||||
} while (u64_stats_fetch_retry(&rx->statss, start));
|
||||
|
||||
unlock:
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
}
|
||||
|
||||
static void gve_get_tx_queue_stats(struct net_device *dev, int idx,
|
||||
struct netdev_queue_stats_tx *tx_stats)
|
||||
{
|
||||
struct gve_priv *priv = netdev_priv(dev);
|
||||
struct gve_tx_ring *tx = &priv->tx[idx];
|
||||
struct gve_tx_ring *tx;
|
||||
unsigned int start;
|
||||
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
if (!priv->tx)
|
||||
goto unlock;
|
||||
|
||||
tx = &priv->tx[idx];
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&tx->statss);
|
||||
tx_stats->packets = tx->pkt_done;
|
||||
tx_stats->bytes = tx->bytes_done;
|
||||
} while (u64_stats_fetch_retry(&tx->statss, start));
|
||||
|
||||
unlock:
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
}
|
||||
|
||||
static void gve_get_base_stats(struct net_device *dev,
|
||||
struct netdev_queue_stats_rx *rx,
|
||||
struct netdev_queue_stats_tx *tx)
|
||||
{
|
||||
rx->packets = 0;
|
||||
rx->bytes = 0;
|
||||
rx->alloc_fail = 0;
|
||||
const struct gve_ring_err_stats *base_err_stats;
|
||||
const struct rtnl_link_stats64 *base_stats;
|
||||
struct gve_priv *priv;
|
||||
|
||||
tx->packets = 0;
|
||||
tx->bytes = 0;
|
||||
priv = netdev_priv(dev);
|
||||
base_stats = &priv->base_net_stats;
|
||||
base_err_stats = &priv->base_ring_err_stats;
|
||||
|
||||
spin_lock_bh(&priv->stats_lock);
|
||||
rx->packets = base_stats->rx_packets;
|
||||
rx->bytes = base_stats->rx_bytes;
|
||||
rx->alloc_fail = base_err_stats->rx_alloc_fails;
|
||||
|
||||
tx->packets = base_stats->tx_packets;
|
||||
tx->bytes = base_stats->tx_bytes;
|
||||
/* XDP TX rings are not exposed as netdev queues, so report their live
|
||||
* counters here to keep the device totals consistent with
|
||||
* ndo_get_stats64.
|
||||
*/
|
||||
if (priv->tx)
|
||||
gve_add_tx_ring_range_stats(priv, priv->tx_cfg.num_queues,
|
||||
gve_num_tx_queues(priv),
|
||||
&tx->packets, &tx->bytes);
|
||||
spin_unlock_bh(&priv->stats_lock);
|
||||
}
|
||||
|
||||
static const struct netdev_stat_ops gve_stat_ops = {
|
||||
@@ -2933,6 +3061,7 @@ static int gve_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
}
|
||||
INIT_WORK(&priv->service_task, gve_service_task);
|
||||
INIT_WORK(&priv->stats_report_task, gve_stats_report_task);
|
||||
spin_lock_init(&priv->stats_lock);
|
||||
priv->tx_cfg.max_queues = max_tx_queues;
|
||||
priv->rx_cfg.max_queues = max_rx_queues;
|
||||
|
||||
|
||||
@@ -320,22 +320,19 @@ static struct sk_buff *i40e_construct_skb_zc(struct i40e_ring *rx_ring,
|
||||
goto out;
|
||||
|
||||
for (int i = 0; i < nr_frags; i++) {
|
||||
struct skb_shared_info *skinfo = skb_shinfo(skb);
|
||||
skb_frag_t *frag = &sinfo->frags[i];
|
||||
unsigned int frag_size = skb_frag_size(frag);
|
||||
struct page *page;
|
||||
void *addr;
|
||||
|
||||
page = dev_alloc_page();
|
||||
if (!page) {
|
||||
dev_kfree_skb(skb);
|
||||
return NULL;
|
||||
skb = NULL;
|
||||
goto out;
|
||||
}
|
||||
addr = page_to_virt(page);
|
||||
|
||||
memcpy(addr, skb_frag_page(frag), skb_frag_size(frag));
|
||||
|
||||
__skb_fill_page_desc_noacc(skinfo, skinfo->nr_frags++,
|
||||
addr, 0, skb_frag_size(frag));
|
||||
memcpy(page_to_virt(page), skb_frag_address(frag), frag_size);
|
||||
skb_add_rx_frag(skb, i, page, 0, frag_size, PAGE_SIZE);
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -354,7 +351,6 @@ static void i40e_handle_xdp_result_zc(struct i40e_ring *rx_ring,
|
||||
struct sk_buff *skb;
|
||||
|
||||
*rx_packets = 1;
|
||||
*rx_bytes = xdp_get_buff_len(xdp_buff);
|
||||
|
||||
if (likely(xdp_res == I40E_XDP_REDIR) || xdp_res == I40E_XDP_TX)
|
||||
return;
|
||||
@@ -469,21 +465,30 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget)
|
||||
xsk_buff_set_size(bi, size);
|
||||
xsk_buff_dma_sync_for_cpu(bi);
|
||||
|
||||
if (!first)
|
||||
first = bi;
|
||||
else if (!xsk_buff_add_frag(first, bi)) {
|
||||
xsk_buff_free(first);
|
||||
break;
|
||||
}
|
||||
|
||||
if (++next_to_process == count)
|
||||
next_to_process = 0;
|
||||
|
||||
if (!first) {
|
||||
first = bi;
|
||||
} else if (!xsk_buff_add_frag(first, bi)) {
|
||||
/* Drop what has been gathered so far. xp_free() skips
|
||||
* @bi if it duplicates a buffer that is already on a
|
||||
* pool list. Remaining buffers of this packet, if any,
|
||||
* will be processed as a new packet.
|
||||
*/
|
||||
xsk_buff_free(first);
|
||||
xsk_buff_free(bi);
|
||||
next_to_clean = next_to_process;
|
||||
first = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i40e_is_non_eop(rx_ring, rx_desc))
|
||||
continue;
|
||||
|
||||
xsk_buff_to_i40e_ctx(first)->desc = rx_desc;
|
||||
|
||||
rx_bytes = xdp_get_buff_len(first);
|
||||
xdp_res = i40e_run_xdp_zc(rx_ring, first, xdp_prog);
|
||||
i40e_handle_xdp_result_zc(rx_ring, first, rx_desc, &rx_packets,
|
||||
&rx_bytes, xdp_res, &failure);
|
||||
|
||||
@@ -72,6 +72,7 @@ static struct ice_adapter *ice_adapter_new(struct pci_dev *pdev)
|
||||
spin_lock_init(&adapter->txq_ctx_lock);
|
||||
for (int i = 0; i < ARRAY_SIZE(adapter->cpi_phy_lock); i++)
|
||||
mutex_init(&adapter->cpi_phy_lock[i]);
|
||||
mutex_init(&adapter->cgu_synce_lock);
|
||||
refcount_set(&adapter->refcount, 1);
|
||||
|
||||
spin_lock_init(&adapter->ports.lock);
|
||||
@@ -85,6 +86,7 @@ static void ice_adapter_free(struct ice_adapter *adapter)
|
||||
WARN_ON(!list_empty(&adapter->ports.list));
|
||||
for (int i = 0; i < ARRAY_SIZE(adapter->cpi_phy_lock); i++)
|
||||
mutex_destroy(&adapter->cpi_phy_lock[i]);
|
||||
mutex_destroy(&adapter->cgu_synce_lock);
|
||||
|
||||
cleanup_srcu_struct(&adapter->ports.srcu);
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ struct ice_port_list {
|
||||
* @txq_ctx_lock: Spinlock protecting access to the GLCOMM_QTX_CNTX_CTL register
|
||||
* @cpi_phy_lock: Per-PHY mutex serializing CPI REQ/ACK transactions.
|
||||
* Index 0 = PHY0, index 1 = PHY1. Used on E825C devices.
|
||||
* @cgu_synce_lock: Mutex serializing changes of the CGU registers R10 and R11,
|
||||
* which all PFs reach. Used on E825C devices.
|
||||
* @ctrl_pf: Control PF of the adapter
|
||||
* @ports: Ports list
|
||||
* @index: 64-bit index cached for collision detection on 32bit systems
|
||||
@@ -53,6 +55,8 @@ struct ice_adapter {
|
||||
spinlock_t txq_ctx_lock;
|
||||
/* Serialize CPI REQ/ACK transactions per PHY (E825C only) */
|
||||
struct mutex cpi_phy_lock[ICE_E825_MAX_PHYS];
|
||||
/* Serialize changes of the SyncE CGU registers (E825C only) */
|
||||
struct mutex cgu_synce_lock;
|
||||
|
||||
struct ice_pf *ctrl_pf;
|
||||
struct ice_port_list ports;
|
||||
|
||||
@@ -2027,7 +2027,7 @@ ice_dpll_phase_offset_get(const struct dpll_pin *pin, void *pin_priv,
|
||||
*
|
||||
* DPLL subsystem callback. Set proper signals to recover clock from port.
|
||||
*
|
||||
* Context: Called under pf->dplls.lock
|
||||
* Context: Called under pf->dplls.lock, acquires adapter->cgu_synce_lock
|
||||
* Return:
|
||||
* * 0 - success
|
||||
* * negative - error
|
||||
@@ -2035,14 +2035,15 @@ ice_dpll_phase_offset_get(const struct dpll_pin *pin, void *pin_priv,
|
||||
static int ice_dpll_synce_update_e825c(struct ice_hw *hw, bool ena,
|
||||
u32 port_num, enum ice_synce_clk output)
|
||||
{
|
||||
struct ice_pf *pf = hw->back;
|
||||
int err;
|
||||
|
||||
mutex_lock(&pf->adapter->cgu_synce_lock);
|
||||
/* configure the mux to deliver proper signal to DPLL from the MUX */
|
||||
err = ice_tspll_cfg_bypass_mux_e825c(hw, ena, port_num, output);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = ice_tspll_cfg_synce_ethdiv_e825c(hw, output);
|
||||
if (!err)
|
||||
err = ice_tspll_cfg_synce_ethdiv_e825c(hw, output);
|
||||
mutex_unlock(&pf->adapter->cgu_synce_lock);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
||||
@@ -158,6 +158,7 @@ struct ice_dpll {
|
||||
* txclk_notify_rwsem (read)
|
||||
* -> pf->dplls.lock
|
||||
* -> ctrl_pf->dplls.lock
|
||||
* -> adapter->cgu_synce_lock
|
||||
*
|
||||
* - @lock serializes all DPLL state mutations on this PF. When the
|
||||
* controlling PF's lock must also be taken (e.g. updating the shared
|
||||
@@ -169,6 +170,9 @@ struct ice_dpll {
|
||||
* dpll_*_change_ntf() calls. ice_dpll_deinit() takes the write side
|
||||
* standalone (not nested under any other lock) to drain in-flight
|
||||
* readers before pins and the TXC DPLL device are freed.
|
||||
* - adapter->cgu_synce_lock serializes changes of the CGU registers R10 and
|
||||
* R11. All E825C PFs reach one CGU, so @lock, which is per PF, does not
|
||||
* cover them.
|
||||
*/
|
||||
struct ice_dplls {
|
||||
struct kthread_worker *kworker;
|
||||
|
||||
@@ -1350,6 +1350,7 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
|
||||
int pin, err;
|
||||
|
||||
mutex_lock(&pf->dplls.lock);
|
||||
mutex_lock(&pf->adapter->cgu_synce_lock);
|
||||
for (pin = 0; pin < ICE_SYNCE_CLK_NUM; pin++) {
|
||||
enum ice_synce_clk clk_pin;
|
||||
bool active;
|
||||
@@ -1368,14 +1369,19 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
|
||||
break;
|
||||
}
|
||||
|
||||
/* The divider is shared, set it only for our port */
|
||||
if (!active)
|
||||
continue;
|
||||
|
||||
err = ice_tspll_cfg_synce_ethdiv_e825c(hw, clk_pin);
|
||||
if (active && err) {
|
||||
if (err) {
|
||||
dev_err_once(ice_pf_to_dev(pf),
|
||||
"Failed to configure SyncE ETH divider for pin %d, err %d\n",
|
||||
pin, err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&pf->adapter->cgu_synce_lock);
|
||||
mutex_unlock(&pf->dplls.lock);
|
||||
|
||||
if (linkup)
|
||||
|
||||
@@ -746,6 +746,7 @@ int ice_tspll_init(struct ice_hw *hw)
|
||||
*
|
||||
* Check if given port is selected as recovered clock source for given output.
|
||||
*
|
||||
* Context: Called under pf->dplls.lock and adapter->cgu_synce_lock
|
||||
* Return:
|
||||
* * 0 - success
|
||||
* * negative - error
|
||||
@@ -774,8 +775,7 @@ int ice_tspll_bypass_mux_active_e825c(struct ice_hw *hw, u8 port, bool *active,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (active_clk == port % hw->ptp.ports_per_phy +
|
||||
ICE_CGU_BYPASS_MUX_OFFSET_E825C)
|
||||
if (active_clk == port + ICE_CGU_BYPASS_MUX_OFFSET_E825C)
|
||||
*active = true;
|
||||
else
|
||||
*active = false;
|
||||
@@ -792,7 +792,7 @@ int ice_tspll_bypass_mux_active_e825c(struct ice_hw *hw, u8 port, bool *active,
|
||||
*
|
||||
* Set reference clock source and output clock selection.
|
||||
*
|
||||
* Context: Called under pf->dplls.lock
|
||||
* Context: Called under pf->dplls.lock and adapter->cgu_synce_lock
|
||||
* Return:
|
||||
* * 0 - success
|
||||
* * negative - error
|
||||
@@ -898,7 +898,7 @@ static int ice_tspll_get_div_e825c(u16 link_speed, unsigned int *divider)
|
||||
*
|
||||
* Set the correct CGU divider for RCLKA or RCLKB.
|
||||
*
|
||||
* Context: Called under pf->dplls.lock
|
||||
* Context: Called under pf->dplls.lock and adapter->cgu_synce_lock
|
||||
* Return:
|
||||
* * 0 - success
|
||||
* * negative - error
|
||||
|
||||
@@ -493,6 +493,11 @@ static int ice_xmit_xdp_tx_zc(struct xdp_buff *xdp,
|
||||
tx_desc->cmd_type_offset_bsz |=
|
||||
cpu_to_le64(ICE_TX_DESC_CMD_EOP << ICE_TXD_QW1_CMD_S);
|
||||
|
||||
/* Each frag is now freed via its own Tx buffer. Completing the head
|
||||
* must not release what is on the pool's frag list at that time.
|
||||
*/
|
||||
xdp_buff_clear_frags_flag(head);
|
||||
|
||||
return ICE_XDP_TX;
|
||||
|
||||
busy:
|
||||
@@ -592,6 +597,7 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring,
|
||||
struct sk_buff *skb;
|
||||
u16 stat_err_bits;
|
||||
u16 vlan_tci;
|
||||
u32 xdp_len;
|
||||
|
||||
rx_desc = ICE_RX_DESC(rx_ring, ntc);
|
||||
|
||||
@@ -618,8 +624,11 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring,
|
||||
|
||||
if (!first) {
|
||||
first = xdp;
|
||||
} else if (likely(size) && !xsk_buff_add_frag(first, xdp)) {
|
||||
} else if (unlikely(!size)) {
|
||||
xsk_buff_free(xdp);
|
||||
} else if (!xsk_buff_add_frag(first, xdp)) {
|
||||
xsk_buff_free(first);
|
||||
xsk_buff_free(xdp);
|
||||
first = NULL;
|
||||
}
|
||||
|
||||
@@ -631,6 +640,7 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring,
|
||||
|
||||
((struct libeth_xdp_buff *)first)->desc = rx_desc;
|
||||
|
||||
xdp_len = xdp_get_buff_len(first);
|
||||
xdp_res = ice_run_xdp_zc(rx_ring, first, xdp_prog, xdp_ring,
|
||||
xsk_pool);
|
||||
if (likely(xdp_res & (ICE_XDP_TX | ICE_XDP_REDIR))) {
|
||||
@@ -645,7 +655,7 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring,
|
||||
goto construct_skb;
|
||||
}
|
||||
|
||||
total_rx_bytes += xdp_get_buff_len(first);
|
||||
total_rx_bytes += xdp_len;
|
||||
total_rx_packets++;
|
||||
|
||||
first = NULL;
|
||||
@@ -902,6 +912,11 @@ void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring)
|
||||
if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
|
||||
xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
|
||||
|
||||
if (rx_ring->xsk) {
|
||||
xsk_buff_free(&rx_ring->xsk->base);
|
||||
rx_ring->xsk = NULL;
|
||||
}
|
||||
|
||||
while (ntc != ntu) {
|
||||
struct xdp_buff *xdp = *ice_xdp_buf(rx_ring, ntc);
|
||||
|
||||
|
||||
@@ -134,6 +134,11 @@ void idpf_xsk_clear_queue(void *q, enum virtchnl2_queue_type type)
|
||||
if (!idpf_queue_has_clear(XSK, rxq))
|
||||
return;
|
||||
|
||||
if (rxq->xsk) {
|
||||
libeth_xsk_buff_free_slow(rxq->xsk);
|
||||
rxq->xsk = NULL;
|
||||
}
|
||||
|
||||
rxq->pool = NULL;
|
||||
break;
|
||||
case VIRTCHNL2_QUEUE_TYPE_RX_BUFFER:
|
||||
|
||||
@@ -76,8 +76,6 @@ static inline int rvu_pcifunc_pf_mask(struct pci_dev *pdev)
|
||||
|
||||
#define RVU_AFPF 25
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
struct dump_ctx {
|
||||
int lf;
|
||||
int id;
|
||||
@@ -112,7 +110,6 @@ struct rvu_debugfs {
|
||||
int npa_qsize_id;
|
||||
int nix_qsize_id;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct rvu_work {
|
||||
struct work_struct work;
|
||||
@@ -649,9 +646,7 @@ struct rvu {
|
||||
int mcs_blk_cnt;
|
||||
int cpt_pf_num;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
struct rvu_debugfs rvu_dbg;
|
||||
#endif
|
||||
struct rvu_devlink *rvu_dl;
|
||||
|
||||
/* RVU switch implementation over NPC with DMAC rules */
|
||||
|
||||
@@ -911,10 +911,11 @@ static void mlx5e_build_rx_cq_param(struct mlx5_core_dev *mdev,
|
||||
|
||||
static u8 rq_end_pad_mode(struct mlx5_core_dev *mdev, struct mlx5e_params *params)
|
||||
{
|
||||
bool lro_en = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO;
|
||||
bool no_pad = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO ||
|
||||
params->packet_merge.type == MLX5E_PACKET_MERGE_SHAMPO;
|
||||
bool ro = MLX5_CAP_GEN(mdev, relaxed_ordering_write);
|
||||
|
||||
return ro && lro_en ?
|
||||
return ro && no_pad ?
|
||||
MLX5_WQ_END_PAD_MODE_NONE : MLX5_WQ_END_PAD_MODE_ALIGN;
|
||||
}
|
||||
|
||||
|
||||
@@ -771,53 +771,72 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
|
||||
struct xfrm_state *x,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
bool is_acq = x->xso.flags & XFRM_DEV_OFFLOAD_FLAG_ACQ;
|
||||
struct mlx5e_ipsec_sa_entry *sa_entry = NULL;
|
||||
bool allow_tunnel_mode = false;
|
||||
struct mlx5_core_dev *mdev;
|
||||
struct mlx5e_ipsec *ipsec;
|
||||
struct mlx5e_priv *priv;
|
||||
gfp_t gfp;
|
||||
int err;
|
||||
|
||||
priv = netdev_priv(dev);
|
||||
if (!priv->ipsec)
|
||||
return -EOPNOTSUPP;
|
||||
/* Profile cleanup can memset an already NULL mdev. */
|
||||
mdev = data_race(READ_ONCE(priv->mdev));
|
||||
/* NULL only during a profile change, which is an eswitch operation. */
|
||||
if (!mdev) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Eswitch busy, can't add state");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (!is_acq) {
|
||||
err = mlx5_eswitch_block_mode(mdev, false);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
ipsec = priv->ipsec;
|
||||
gfp = (x->xso.flags & XFRM_DEV_OFFLOAD_FLAG_ACQ) ? GFP_ATOMIC : GFP_KERNEL;
|
||||
if (!ipsec) {
|
||||
err = -EOPNOTSUPP;
|
||||
goto unblock_mode;
|
||||
}
|
||||
|
||||
gfp = is_acq ? GFP_ATOMIC : GFP_KERNEL;
|
||||
sa_entry = kzalloc_obj(*sa_entry, gfp);
|
||||
if (!sa_entry)
|
||||
return -ENOMEM;
|
||||
if (!sa_entry) {
|
||||
err = -ENOMEM;
|
||||
goto unblock_mode;
|
||||
}
|
||||
|
||||
sa_entry->x = x;
|
||||
sa_entry->dev = dev;
|
||||
sa_entry->ipsec = ipsec;
|
||||
/* Check if this SA is originated from acquire flow temporary SA */
|
||||
if (x->xso.flags & XFRM_DEV_OFFLOAD_FLAG_ACQ) {
|
||||
if (is_acq) {
|
||||
x->xso.offload_handle = (unsigned long)sa_entry;
|
||||
return 0;
|
||||
}
|
||||
|
||||
err = mlx5e_xfrm_validate_state(priv->mdev, x, extack);
|
||||
err = mlx5e_xfrm_validate_state(mdev, x, extack);
|
||||
if (err)
|
||||
goto err_xfrm;
|
||||
|
||||
if (!mlx5_eswitch_block_ipsec(priv->mdev)) {
|
||||
if (!mlx5_eswitch_block_ipsec(mdev)) {
|
||||
err = -EBUSY;
|
||||
goto err_xfrm;
|
||||
}
|
||||
|
||||
err = mlx5_eswitch_block_mode(priv->mdev);
|
||||
if (err)
|
||||
goto unblock_ipsec;
|
||||
|
||||
if (x->props.mode == XFRM_MODE_TUNNEL &&
|
||||
x->xso.type == XFRM_DEV_OFFLOAD_PACKET) {
|
||||
allow_tunnel_mode = mlx5e_ipsec_fs_tunnel_allowed(sa_entry);
|
||||
err = mlx5e_ipsec_fs_tunnel_allowed(sa_entry);
|
||||
if (err < 0)
|
||||
goto unblock_ipsec;
|
||||
allow_tunnel_mode = err;
|
||||
if (!allow_tunnel_mode) {
|
||||
NL_SET_ERR_MSG_MOD(extack,
|
||||
"Packet offload tunnel mode is disabled due to encap settings");
|
||||
err = -EINVAL;
|
||||
goto unblock_mode;
|
||||
goto unblock_ipsec;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -874,9 +893,9 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
|
||||
|
||||
x->xso.offload_handle = (unsigned long)sa_entry;
|
||||
if (allow_tunnel_mode)
|
||||
mlx5_eswitch_unblock_encap(priv->mdev);
|
||||
mlx5_eswitch_unblock_encap(mdev);
|
||||
|
||||
mlx5_eswitch_unblock_mode(priv->mdev);
|
||||
mlx5_eswitch_unblock_mode(mdev);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -892,14 +911,15 @@ release_work:
|
||||
kfree(sa_entry->work);
|
||||
unblock_encap:
|
||||
if (allow_tunnel_mode)
|
||||
mlx5_eswitch_unblock_encap(priv->mdev);
|
||||
unblock_mode:
|
||||
mlx5_eswitch_unblock_mode(priv->mdev);
|
||||
mlx5_eswitch_unblock_encap(mdev);
|
||||
unblock_ipsec:
|
||||
mlx5_eswitch_unblock_ipsec(priv->mdev);
|
||||
mlx5_eswitch_unblock_ipsec(mdev);
|
||||
err_xfrm:
|
||||
kfree(sa_entry);
|
||||
NL_SET_ERR_MSG_WEAK_MOD(extack, "Device failed to offload this state");
|
||||
unblock_mode:
|
||||
if (!is_acq)
|
||||
mlx5_eswitch_unblock_mode(mdev);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1265,27 +1285,45 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x,
|
||||
{
|
||||
struct net_device *netdev = x->xdo.dev;
|
||||
struct mlx5e_ipsec_pol_entry *pol_entry;
|
||||
struct mlx5_core_dev *mdev;
|
||||
struct mlx5e_priv *priv;
|
||||
int err;
|
||||
|
||||
priv = netdev_priv(netdev);
|
||||
if (!priv->ipsec) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Device doesn't support IPsec packet offload");
|
||||
return -EOPNOTSUPP;
|
||||
/* Profile cleanup can memset an already NULL mdev. */
|
||||
mdev = data_race(READ_ONCE(priv->mdev));
|
||||
if (!mdev) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Eswitch busy, can't add policy");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
err = mlx5e_xfrm_validate_policy(priv->mdev, x, extack);
|
||||
if (err)
|
||||
/* Block esw mode changes until the policy holds its own block. */
|
||||
err = mlx5_eswitch_block_mode(mdev, false);
|
||||
if (err) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Eswitch busy, can't add policy");
|
||||
return err;
|
||||
}
|
||||
|
||||
if (!priv->ipsec) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Device doesn't support IPsec packet offload");
|
||||
err = -EOPNOTSUPP;
|
||||
goto unblock_mode;
|
||||
}
|
||||
|
||||
err = mlx5e_xfrm_validate_policy(mdev, x, extack);
|
||||
if (err)
|
||||
goto unblock_mode;
|
||||
|
||||
pol_entry = kzalloc_obj(*pol_entry);
|
||||
if (!pol_entry)
|
||||
return -ENOMEM;
|
||||
if (!pol_entry) {
|
||||
err = -ENOMEM;
|
||||
goto unblock_mode;
|
||||
}
|
||||
|
||||
pol_entry->x = x;
|
||||
pol_entry->ipsec = priv->ipsec;
|
||||
|
||||
if (!mlx5_eswitch_block_ipsec(priv->mdev)) {
|
||||
if (!mlx5_eswitch_block_ipsec(mdev)) {
|
||||
err = -EBUSY;
|
||||
goto ipsec_busy;
|
||||
}
|
||||
@@ -1296,13 +1334,16 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x,
|
||||
goto err_fs;
|
||||
|
||||
x->xdo.offload_handle = (unsigned long)pol_entry;
|
||||
mlx5_eswitch_unblock_mode(mdev);
|
||||
return 0;
|
||||
|
||||
err_fs:
|
||||
mlx5_eswitch_unblock_ipsec(priv->mdev);
|
||||
mlx5_eswitch_unblock_ipsec(mdev);
|
||||
ipsec_busy:
|
||||
kfree(pol_entry);
|
||||
NL_SET_ERR_MSG_MOD(extack, "Device failed to offload this policy");
|
||||
unblock_mode:
|
||||
mlx5_eswitch_unblock_mode(mdev);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ void mlx5e_accel_ipsec_fs_del_rule(struct mlx5e_ipsec_sa_entry *sa_entry);
|
||||
int mlx5e_accel_ipsec_fs_add_pol(struct mlx5e_ipsec_pol_entry *pol_entry);
|
||||
void mlx5e_accel_ipsec_fs_del_pol(struct mlx5e_ipsec_pol_entry *pol_entry);
|
||||
void mlx5e_accel_ipsec_fs_modify(struct mlx5e_ipsec_sa_entry *sa_entry);
|
||||
bool mlx5e_ipsec_fs_tunnel_allowed(struct mlx5e_ipsec_sa_entry *sa_entry);
|
||||
int mlx5e_ipsec_fs_tunnel_allowed(struct mlx5e_ipsec_sa_entry *sa_entry);
|
||||
|
||||
int mlx5_ipsec_create_sa_ctx(struct mlx5e_ipsec_sa_entry *sa_entry);
|
||||
void mlx5_ipsec_free_sa_ctx(struct mlx5e_ipsec_sa_entry *sa_entry);
|
||||
|
||||
@@ -720,6 +720,16 @@ static void ipsec_rx_sa_selector_destroy(struct mlx5_core_dev *mdev,
|
||||
mlx5_destroy_flow_table(rx->ft.sa_sel);
|
||||
}
|
||||
|
||||
static void
|
||||
ipsec_rx_status_pass_dest_put(struct mlx5e_ipsec *ipsec,
|
||||
struct mlx5e_ipsec_rx *rx,
|
||||
u32 family)
|
||||
{
|
||||
mlx5_ipsec_fs_roce_rx_destroy(ipsec->roce, family, ipsec->mdev);
|
||||
if (rx == ipsec->rx_esw)
|
||||
mlx5_esw_ipsec_rx_status_pass_dest_put(ipsec);
|
||||
}
|
||||
|
||||
static void rx_destroy(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
|
||||
struct mlx5e_ipsec_rx *rx, u32 family)
|
||||
{
|
||||
@@ -739,13 +749,7 @@ static void rx_destroy(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
|
||||
|
||||
ipsec_rx_policy_destroy(rx);
|
||||
|
||||
mlx5_ipsec_fs_roce_rx_destroy(ipsec->roce, family, mdev);
|
||||
|
||||
#ifdef CONFIG_MLX5_ESWITCH
|
||||
if (rx == ipsec->rx_esw)
|
||||
mlx5_chains_put_table(esw_chains(ipsec->mdev->priv.eswitch),
|
||||
0, 1, 0);
|
||||
#endif
|
||||
ipsec_rx_status_pass_dest_put(ipsec, rx, family);
|
||||
}
|
||||
|
||||
static void ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec,
|
||||
@@ -1068,9 +1072,12 @@ static int rx_create(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
|
||||
goto err_fs_ft_sa_sel;
|
||||
|
||||
/* Create FT */
|
||||
if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_TUNNEL)
|
||||
rx->allow_tunnel_mode =
|
||||
mlx5_eswitch_block_encap(mdev, rx == ipsec->rx_esw);
|
||||
if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_TUNNEL) {
|
||||
err = mlx5_eswitch_block_encap(mdev, rx == ipsec->rx_esw);
|
||||
if (err < 0)
|
||||
goto err_fs_ft;
|
||||
rx->allow_tunnel_mode = err;
|
||||
}
|
||||
|
||||
if (rx->allow_tunnel_mode)
|
||||
flags = MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
|
||||
@@ -1115,7 +1122,7 @@ err_fs_ft:
|
||||
err_fs_ft_sa_sel:
|
||||
mlx5_destroy_flow_table(rx->ft.status);
|
||||
err_fs_ft_status:
|
||||
mlx5_ipsec_fs_roce_rx_destroy(ipsec->roce, family, mdev);
|
||||
ipsec_rx_status_pass_dest_put(ipsec, rx, family);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1127,7 +1134,7 @@ static int rx_get(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
|
||||
if (rx->ft.refcnt)
|
||||
goto skip;
|
||||
|
||||
err = mlx5_eswitch_block_mode(mdev);
|
||||
err = mlx5_eswitch_block_mode(mdev, true);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1311,9 +1318,12 @@ static int tx_create(struct mlx5e_ipsec *ipsec, struct mlx5e_ipsec_tx *tx,
|
||||
if (err)
|
||||
goto err_status_rule;
|
||||
|
||||
if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_TUNNEL)
|
||||
tx->allow_tunnel_mode =
|
||||
mlx5_eswitch_block_encap(mdev, tx == ipsec->tx_esw);
|
||||
if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_TUNNEL) {
|
||||
err = mlx5_eswitch_block_encap(mdev, tx == ipsec->tx_esw);
|
||||
if (err < 0)
|
||||
goto err_encap;
|
||||
tx->allow_tunnel_mode = err;
|
||||
}
|
||||
|
||||
if (tx->allow_tunnel_mode)
|
||||
flags = MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
|
||||
@@ -1383,6 +1393,7 @@ err_sa_miss:
|
||||
err_sa_ft:
|
||||
if (tx->allow_tunnel_mode)
|
||||
mlx5_eswitch_unblock_encap(mdev);
|
||||
err_encap:
|
||||
mlx5_del_flow_rules(tx->status.rule);
|
||||
err_status_rule:
|
||||
mlx5_destroy_flow_table(tx->ft.status);
|
||||
@@ -1416,7 +1427,7 @@ static int tx_get(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
|
||||
if (tx->ft.refcnt)
|
||||
goto skip;
|
||||
|
||||
err = mlx5_eswitch_block_mode(mdev);
|
||||
err = mlx5_eswitch_block_mode(mdev, true);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -2183,7 +2194,6 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
|
||||
}
|
||||
|
||||
setup_fte_no_frags(spec);
|
||||
setup_fte_upper_proto_match(spec, &attrs->upspec);
|
||||
|
||||
switch (attrs->type) {
|
||||
case XFRM_DEV_OFFLOAD_CRYPTO:
|
||||
@@ -2196,6 +2206,7 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
|
||||
setup_fte_reg_a(spec);
|
||||
break;
|
||||
case XFRM_DEV_OFFLOAD_PACKET:
|
||||
setup_fte_upper_proto_match(spec, &attrs->upspec);
|
||||
setup_fte_reg_c4(spec, attrs->reqid);
|
||||
err = setup_pkt_reformat(ipsec, attrs, &flow_act);
|
||||
if (err)
|
||||
@@ -2574,45 +2585,26 @@ void mlx5e_accel_ipsec_fs_read_stats(struct mlx5e_priv *priv, void *ipsec_stats)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MLX5_ESWITCH
|
||||
static int mlx5e_ipsec_block_tc_offload(struct mlx5_core_dev *mdev)
|
||||
{
|
||||
struct mlx5_eswitch *esw = mdev->priv.eswitch;
|
||||
int err = 0;
|
||||
int ret = 0;
|
||||
|
||||
if (esw) {
|
||||
err = mlx5_esw_lock(esw);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
spin_lock_bh(&mdev->offload_block.lock);
|
||||
if (mdev->offload_block.num_block_ipsec)
|
||||
ret = -EBUSY;
|
||||
else
|
||||
mdev->offload_block.num_block_tc++;
|
||||
spin_unlock_bh(&mdev->offload_block.lock);
|
||||
|
||||
if (mdev->num_block_ipsec) {
|
||||
err = -EBUSY;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
mdev->num_block_tc++;
|
||||
|
||||
unlock:
|
||||
if (esw)
|
||||
mlx5_esw_unlock(esw);
|
||||
|
||||
return err;
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
static int mlx5e_ipsec_block_tc_offload(struct mlx5_core_dev *mdev)
|
||||
{
|
||||
if (mdev->num_block_ipsec)
|
||||
return -EBUSY;
|
||||
|
||||
mdev->num_block_tc++;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void mlx5e_ipsec_unblock_tc_offload(struct mlx5_core_dev *mdev)
|
||||
{
|
||||
mdev->num_block_tc--;
|
||||
spin_lock_bh(&mdev->offload_block.lock);
|
||||
if (!WARN_ON_ONCE(!mdev->offload_block.num_block_tc))
|
||||
mdev->offload_block.num_block_tc--;
|
||||
spin_unlock_bh(&mdev->offload_block.lock);
|
||||
}
|
||||
|
||||
int mlx5e_accel_ipsec_fs_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
|
||||
@@ -2850,7 +2842,7 @@ void mlx5e_accel_ipsec_fs_modify(struct mlx5e_ipsec_sa_entry *sa_entry)
|
||||
memcpy(sa_entry, &sa_entry_shadow, sizeof(*sa_entry));
|
||||
}
|
||||
|
||||
bool mlx5e_ipsec_fs_tunnel_allowed(struct mlx5e_ipsec_sa_entry *sa_entry)
|
||||
int mlx5e_ipsec_fs_tunnel_allowed(struct mlx5e_ipsec_sa_entry *sa_entry)
|
||||
{
|
||||
struct mlx5e_ipsec *ipsec = sa_entry->ipsec;
|
||||
struct xfrm_state *x = sa_entry->x;
|
||||
|
||||
@@ -139,7 +139,11 @@ int mlx5e_ktls_set_feature_rx(struct net_device *netdev, bool enable)
|
||||
err = mlx5e_accel_fs_tcp_create(priv->fs);
|
||||
if (!err && !priv->ktls_rx_was_enabled) {
|
||||
priv->ktls_rx_was_enabled = true;
|
||||
mlx5e_safe_reopen_channels(priv);
|
||||
err = mlx5e_safe_reopen_channels(priv);
|
||||
if (err) {
|
||||
priv->ktls_rx_was_enabled = false;
|
||||
mlx5e_accel_fs_tcp_destroy(priv->fs);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mlx5e_accel_fs_tcp_destroy(priv->fs);
|
||||
|
||||
@@ -5489,7 +5489,7 @@ static void mlx5e_get_queue_stats_rx(struct net_device *dev, int i,
|
||||
struct mlx5e_rq_stats *xskrq_stats;
|
||||
struct mlx5e_rq_stats *rq_stats;
|
||||
|
||||
if (mlx5e_is_uplink_rep(priv) || !mlx5e_stats_nch_read(priv))
|
||||
if (mlx5e_is_uplink_rep(priv) || i >= mlx5e_stats_nch_read(priv))
|
||||
return;
|
||||
|
||||
channel_stats = priv->channel_stats[i];
|
||||
@@ -5521,6 +5521,9 @@ static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
|
||||
* inactive sqs.
|
||||
*/
|
||||
sq_stats = priv->txq2sq_stats[i];
|
||||
if (!sq_stats)
|
||||
return;
|
||||
|
||||
stats->packets = sq_stats->packets;
|
||||
stats->bytes = sq_stats->bytes;
|
||||
|
||||
@@ -6038,9 +6041,7 @@ static int mlx5e_nic_init(struct mlx5_core_dev *mdev,
|
||||
priv->dfs_root = debugfs_create_dir("nic",
|
||||
mlx5_debugfs_get_dev_root(mdev));
|
||||
|
||||
fs = mlx5e_fs_init(priv->profile, mdev,
|
||||
!test_bit(MLX5E_STATE_DESTROYING, &priv->state),
|
||||
priv->dfs_root);
|
||||
fs = mlx5e_fs_init(priv->profile, mdev, false, priv->dfs_root);
|
||||
if (!fs) {
|
||||
err = -ENOMEM;
|
||||
mlx5_core_err(mdev, "FS initialization failed, %d\n", err);
|
||||
@@ -6382,7 +6383,7 @@ int mlx5e_priv_init(struct mlx5e_priv *priv,
|
||||
node = dev_to_node(mlx5_core_dma_dev(mdev));
|
||||
|
||||
/* priv init */
|
||||
priv->mdev = mdev;
|
||||
WRITE_ONCE(priv->mdev, mdev);
|
||||
priv->netdev = netdev;
|
||||
priv->max_nch = nch;
|
||||
priv->max_opened_tc = 1;
|
||||
@@ -6467,6 +6468,8 @@ void mlx5e_priv_cleanup(struct mlx5e_priv *priv)
|
||||
mlx5e_mqprio_rl_free(priv->mqprio_rl);
|
||||
}
|
||||
|
||||
/* Clear atomically before memset() for lockless XFRM readers. */
|
||||
WRITE_ONCE(priv->mdev, NULL);
|
||||
memset(priv, 0, sizeof(*priv));
|
||||
if (destroying) /* restore destroying bit, to allow unload */
|
||||
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
|
||||
@@ -6555,10 +6558,6 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
|
||||
int err;
|
||||
|
||||
clear_bit(MLX5E_STATE_DESTROYING, &priv->state);
|
||||
if (priv->fs)
|
||||
mlx5e_fs_set_rx_mode_active(priv->fs,
|
||||
!test_bit(MLX5E_STATE_DESTROYING,
|
||||
&priv->state));
|
||||
|
||||
/* Validate the max_wqe_size_sq capability. */
|
||||
if (WARN_ON_ONCE(mlx5e_get_max_sq_wqebbs(priv->mdev) < MLX5E_MAX_TX_WQEBBS)) {
|
||||
@@ -6619,6 +6618,9 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
|
||||
if (err)
|
||||
goto err_cleanup_tx;
|
||||
|
||||
if (priv->fs)
|
||||
mlx5e_fs_set_rx_mode_active(priv->fs, true);
|
||||
|
||||
if (profile->enable) {
|
||||
err = profile->enable(priv);
|
||||
if (err)
|
||||
@@ -6630,6 +6632,10 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
|
||||
return 0;
|
||||
|
||||
err_cleanup_rx:
|
||||
if (priv->fs) {
|
||||
mlx5e_fs_set_rx_mode_active(priv->fs, false);
|
||||
cancel_work_sync(&priv->set_rx_mode_work);
|
||||
}
|
||||
profile->cleanup_rx(priv);
|
||||
err_cleanup_tx:
|
||||
profile->cleanup_tx(priv);
|
||||
@@ -6637,10 +6643,6 @@ err_cleanup_tx:
|
||||
out:
|
||||
mlx5e_reset_channels(priv->netdev);
|
||||
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
|
||||
if (priv->fs)
|
||||
mlx5e_fs_set_rx_mode_active(priv->fs,
|
||||
!test_bit(MLX5E_STATE_DESTROYING,
|
||||
&priv->state));
|
||||
cancel_work_sync(&priv->update_stats_work);
|
||||
return err;
|
||||
}
|
||||
@@ -6651,9 +6653,7 @@ void mlx5e_detach_netdev(struct mlx5e_priv *priv)
|
||||
|
||||
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
|
||||
if (priv->fs)
|
||||
mlx5e_fs_set_rx_mode_active(priv->fs,
|
||||
!test_bit(MLX5E_STATE_DESTROYING,
|
||||
&priv->state));
|
||||
mlx5e_fs_set_rx_mode_active(priv->fs, false);
|
||||
|
||||
if (profile->disable)
|
||||
profile->disable(priv);
|
||||
|
||||
@@ -238,6 +238,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
|
||||
MLX5_GET_CTR(out, transmitted_ib_unicast.octets) +
|
||||
MLX5_GET_CTR(out, transmitted_eth_unicast.octets) +
|
||||
MLX5_GET_CTR(out, transmitted_ib_multicast.octets) +
|
||||
MLX5_GET_CTR(out, transmitted_eth_multicast.octets) +
|
||||
MLX5_GET_CTR(out, transmitted_eth_broadcast.octets);
|
||||
|
||||
rep_stats->vport_tx_bytes =
|
||||
|
||||
@@ -4005,6 +4005,7 @@ parse_branch_ctrl(struct flow_action_entry *act, struct mlx5e_tc_act *tc_act,
|
||||
|
||||
err_branch_false:
|
||||
free_branch_attr(flow, attr->branch_true);
|
||||
attr->branch_true = NULL;
|
||||
out_err:
|
||||
return err;
|
||||
}
|
||||
@@ -4836,16 +4837,19 @@ static bool is_tc_ipsec_order_check_needed(struct net_device *filter, struct mlx
|
||||
static int mlx5e_tc_block_ipsec_offload(struct net_device *filter, struct mlx5e_priv *priv)
|
||||
{
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
int ret = 0;
|
||||
|
||||
if (!is_tc_ipsec_order_check_needed(filter, priv))
|
||||
return 0;
|
||||
|
||||
if (mdev->num_block_tc)
|
||||
return -EBUSY;
|
||||
spin_lock_bh(&mdev->offload_block.lock);
|
||||
if (mdev->offload_block.num_block_tc)
|
||||
ret = -EBUSY;
|
||||
else
|
||||
mdev->offload_block.num_block_ipsec++;
|
||||
spin_unlock_bh(&mdev->offload_block.lock);
|
||||
|
||||
mdev->num_block_ipsec++;
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void mlx5e_tc_unblock_ipsec_offload(struct net_device *filter, struct mlx5e_priv *priv)
|
||||
@@ -4853,7 +4857,10 @@ static void mlx5e_tc_unblock_ipsec_offload(struct net_device *filter, struct mlx
|
||||
if (!is_tc_ipsec_order_check_needed(filter, priv))
|
||||
return;
|
||||
|
||||
priv->mdev->num_block_ipsec--;
|
||||
spin_lock_bh(&priv->mdev->offload_block.lock);
|
||||
if (!WARN_ON_ONCE(!priv->mdev->offload_block.num_block_ipsec))
|
||||
priv->mdev->offload_block.num_block_ipsec--;
|
||||
spin_unlock_bh(&priv->mdev->offload_block.lock);
|
||||
}
|
||||
|
||||
int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv,
|
||||
|
||||
@@ -1867,26 +1867,27 @@ int mlx5_esw_bridge_port_mdb_add(struct net_device *dev, u16 vport_num, u16 esw_
|
||||
|
||||
port = mlx5_esw_bridge_port_lookup(vport_num, esw_owner_vhca_id, br_offloads);
|
||||
if (!port) {
|
||||
esw_warn(br_offloads->esw->dev,
|
||||
/* MDB is added asynchronously from the switchdev deferred
|
||||
* queue while port might have been deleted concurrently.
|
||||
*/
|
||||
esw_info(br_offloads->esw->dev,
|
||||
"Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)\n",
|
||||
addr, vport_num);
|
||||
NL_SET_ERR_MSG_FMT_MOD(extack,
|
||||
"Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)",
|
||||
addr, vport_num);
|
||||
return -EINVAL;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
bridge = port->bridge;
|
||||
if (bridge->flags & MLX5_ESW_BRIDGE_VLAN_FILTERING_FLAG && vid) {
|
||||
vlan = mlx5_esw_bridge_vlan_lookup(vid, port);
|
||||
if (!vlan) {
|
||||
esw_warn(br_offloads->esw->dev,
|
||||
/* MDB is added asynchronously from the switchdev
|
||||
* deferred queue while vlan might have been deleted
|
||||
* concurrently.
|
||||
*/
|
||||
esw_info(br_offloads->esw->dev,
|
||||
"Failed to lookup bridge port vlan metadata to create MDB (MAC=%pM,vid=%u,vport=%u)\n",
|
||||
addr, vid, vport_num);
|
||||
NL_SET_ERR_MSG_FMT_MOD(extack,
|
||||
"Failed to lookup vlan metadata for MDB (MAC=%pM,vid=%u,vport=%u)",
|
||||
addr, vid, vport_num);
|
||||
return -EINVAL;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,12 +34,23 @@ void mlx5_esw_ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec,
|
||||
int mlx5_esw_ipsec_rx_status_pass_dest_get(struct mlx5e_ipsec *ipsec,
|
||||
struct mlx5_flow_destination *dest)
|
||||
{
|
||||
dest->type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
|
||||
dest->ft = mlx5_chains_get_table(esw_chains(ipsec->mdev->priv.eswitch), 0, 1, 0);
|
||||
struct mlx5_flow_table *ft;
|
||||
|
||||
ft = mlx5_chains_get_table(esw_chains(ipsec->mdev->priv.eswitch),
|
||||
0, 1, 0);
|
||||
if (IS_ERR(ft))
|
||||
return PTR_ERR(ft);
|
||||
|
||||
dest->type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
|
||||
dest->ft = ft;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mlx5_esw_ipsec_rx_status_pass_dest_put(struct mlx5e_ipsec *ipsec)
|
||||
{
|
||||
mlx5_chains_put_table(esw_chains(ipsec->mdev->priv.eswitch), 0, 1, 0);
|
||||
}
|
||||
|
||||
int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
|
||||
struct mlx5_flow_act *flow_act)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ void mlx5_esw_ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec,
|
||||
struct mlx5e_ipsec_rx_create_attr *attr);
|
||||
int mlx5_esw_ipsec_rx_status_pass_dest_get(struct mlx5e_ipsec *ipsec,
|
||||
struct mlx5_flow_destination *dest);
|
||||
void mlx5_esw_ipsec_rx_status_pass_dest_put(struct mlx5e_ipsec *ipsec);
|
||||
int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
|
||||
struct mlx5_flow_act *flow_act);
|
||||
void mlx5_esw_ipsec_rx_id_mapping_remove(struct mlx5e_ipsec_sa_entry *sa_entry);
|
||||
@@ -32,6 +33,11 @@ static inline int mlx5_esw_ipsec_rx_status_pass_dest_get(struct mlx5e_ipsec *ips
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline
|
||||
void mlx5_esw_ipsec_rx_status_pass_dest_put(struct mlx5e_ipsec *ipsec)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
|
||||
struct mlx5_flow_act *flow_act)
|
||||
{
|
||||
|
||||
@@ -1514,13 +1514,9 @@ int mlx5_esw_pf_enable_hca(struct mlx5_core_dev *dev, u16 vport_num)
|
||||
struct mlx5_vport *vport;
|
||||
int err;
|
||||
|
||||
if (!mlx5_core_is_ecpf(dev) || !mlx5_esw_allowed(esw))
|
||||
if (!mlx5_core_is_ecpf(dev))
|
||||
return 0;
|
||||
|
||||
vport = mlx5_eswitch_get_vport(esw, vport_num);
|
||||
if (IS_ERR(vport))
|
||||
return PTR_ERR(vport);
|
||||
|
||||
/* Once vport and representor are ready, take the PF out of
|
||||
* initializing state. Enabling HCA clears the iser->initializing
|
||||
* bit and PF driver loading can progress.
|
||||
@@ -1529,7 +1525,11 @@ int mlx5_esw_pf_enable_hca(struct mlx5_core_dev *dev, u16 vport_num)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
vport->pf_activated = true;
|
||||
if (mlx5_esw_allowed(esw)) {
|
||||
vport = mlx5_eswitch_get_vport(esw, vport_num);
|
||||
if (!IS_ERR(vport))
|
||||
vport->pf_activated = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1540,18 +1540,18 @@ int mlx5_esw_pf_disable_hca(struct mlx5_core_dev *dev, u16 vport_num)
|
||||
struct mlx5_vport *vport;
|
||||
int err;
|
||||
|
||||
if (!mlx5_core_is_ecpf(dev) || !mlx5_esw_allowed(esw))
|
||||
if (!mlx5_core_is_ecpf(dev))
|
||||
return 0;
|
||||
|
||||
vport = mlx5_eswitch_get_vport(esw, vport_num);
|
||||
if (IS_ERR(vport))
|
||||
return PTR_ERR(vport);
|
||||
|
||||
err = mlx5_cmd_pf_disable_hca(dev, vport_num);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
vport->pf_activated = false;
|
||||
if (mlx5_esw_allowed(esw)) {
|
||||
vport = mlx5_eswitch_get_vport(esw, vport_num);
|
||||
if (!IS_ERR(vport))
|
||||
vport->pf_activated = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3051,12 +3051,36 @@ int mlx5_esw_lock(struct mlx5_eswitch *esw)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void esw_mode_lock(struct mlx5_eswitch *esw)
|
||||
{
|
||||
down_write(&esw->mode_lock);
|
||||
}
|
||||
|
||||
static void esw_mode_unlock(struct mlx5_eswitch *esw)
|
||||
{
|
||||
up_write(&esw->mode_lock);
|
||||
}
|
||||
|
||||
/* Lock the eswitch and wait for an operation in progress to finish. */
|
||||
void mlx5_esw_lock_wait(struct mlx5_eswitch *esw)
|
||||
{
|
||||
down_write(&esw->mode_lock);
|
||||
wait_var_event_any_lock(&esw->eswitch_operation_in_progress,
|
||||
!esw->eswitch_operation_in_progress,
|
||||
esw, esw_mode, TASK_UNINTERRUPTIBLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* mlx5_esw_unlock() - Release write lock on esw mode lock
|
||||
* @esw: eswitch device.
|
||||
*
|
||||
* Also wakes up mlx5_esw_lock_wait() waiters, so it must be used to release
|
||||
* mode_lock after clearing eswitch_operation_in_progress.
|
||||
*/
|
||||
void mlx5_esw_unlock(struct mlx5_eswitch *esw)
|
||||
{
|
||||
wake_up_var_locked(&esw->eswitch_operation_in_progress,
|
||||
&esw->mode_lock);
|
||||
up_write(&esw->mode_lock);
|
||||
}
|
||||
|
||||
|
||||
@@ -948,6 +948,7 @@ void mlx5_esw_get(struct mlx5_core_dev *dev);
|
||||
void mlx5_esw_put(struct mlx5_core_dev *dev);
|
||||
int mlx5_esw_try_lock(struct mlx5_eswitch *esw);
|
||||
int mlx5_esw_lock(struct mlx5_eswitch *esw);
|
||||
void mlx5_esw_lock_wait(struct mlx5_eswitch *esw);
|
||||
void mlx5_esw_unlock(struct mlx5_eswitch *esw);
|
||||
|
||||
void esw_vport_change_handle_locked(struct mlx5_vport *vport);
|
||||
@@ -967,10 +968,10 @@ void mlx5_eswitch_unload_reps(struct mlx5_eswitch *esw);
|
||||
bool mlx5_eswitch_is_peer(struct mlx5_eswitch *esw,
|
||||
struct mlx5_eswitch *peer_esw);
|
||||
|
||||
bool mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb);
|
||||
int mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb);
|
||||
void mlx5_eswitch_unblock_encap(struct mlx5_core_dev *dev);
|
||||
|
||||
int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev);
|
||||
int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev, bool check_users);
|
||||
void mlx5_eswitch_unblock_mode(struct mlx5_core_dev *dev);
|
||||
|
||||
static inline int mlx5_eswitch_num_vfs(struct mlx5_eswitch *esw)
|
||||
@@ -1071,17 +1072,21 @@ mlx5_eswitch_reload_ib_reps(struct mlx5_eswitch *esw)
|
||||
static inline void
|
||||
mlx5_eswitch_unload_reps(struct mlx5_eswitch *esw) {}
|
||||
|
||||
static inline bool
|
||||
static inline int
|
||||
mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb)
|
||||
{
|
||||
return true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline void mlx5_eswitch_unblock_encap(struct mlx5_core_dev *dev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev) { return 0; }
|
||||
static inline int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev,
|
||||
bool check_users)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void mlx5_eswitch_unblock_mode(struct mlx5_core_dev *dev) {}
|
||||
static inline bool mlx5_eswitch_block_ipsec(struct mlx5_core_dev *dev)
|
||||
{
|
||||
|
||||
@@ -2457,8 +2457,8 @@ void mlx5_esw_reps_unblock(struct mlx5_eswitch *esw)
|
||||
|
||||
static void esw_mode_change(struct mlx5_eswitch *esw, u16 mode)
|
||||
{
|
||||
mlx5_devcom_comp_assert_locked(esw->dev->priv.hca_devcom_comp);
|
||||
mlx5_esw_reps_unblock(esw);
|
||||
mlx5_devcom_comp_lock(esw->dev->priv.hca_devcom_comp);
|
||||
if (esw->dev->priv.flags & MLX5_PRIV_FLAGS_DISABLE_IB_ADEV ||
|
||||
mlx5_core_mp_enabled(esw->dev)) {
|
||||
esw->mode = mode;
|
||||
@@ -2471,7 +2471,6 @@ static void esw_mode_change(struct mlx5_eswitch *esw, u16 mode)
|
||||
esw->dev->priv.flags &= ~MLX5_PRIV_FLAGS_DISABLE_IB_ADEV;
|
||||
out:
|
||||
mlx5_rescan_drivers_locked(esw->dev);
|
||||
mlx5_devcom_comp_unlock(esw->dev->priv.hca_devcom_comp);
|
||||
mlx5_esw_reps_block(esw);
|
||||
}
|
||||
|
||||
@@ -4366,7 +4365,7 @@ static int esw_inline_mode_to_devlink(u8 mlx5_mode, u8 *mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev)
|
||||
int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev, bool check_users)
|
||||
{
|
||||
struct mlx5_eswitch *esw = dev->priv.eswitch;
|
||||
int err;
|
||||
@@ -4374,8 +4373,11 @@ int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev)
|
||||
if (!mlx5_esw_allowed(esw))
|
||||
return 0;
|
||||
|
||||
/* Take TC into account */
|
||||
err = mlx5_esw_try_lock(esw);
|
||||
/* Temporary reservations may reuse tables while TC users exist. */
|
||||
if (check_users)
|
||||
err = mlx5_esw_try_lock(esw);
|
||||
else
|
||||
err = mlx5_esw_lock(esw);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@@ -4442,7 +4444,7 @@ static bool mlx5_devlink_switchdev_active_mode_change(struct mlx5_eswitch *esw,
|
||||
!esw->offloads_inactive)
|
||||
return false;
|
||||
|
||||
down_write(&esw->mode_lock);
|
||||
mlx5_esw_lock_wait(esw);
|
||||
esw->offloads_inactive = !esw->offloads_inactive;
|
||||
esw->eswitch_operation_in_progress = true;
|
||||
up_write(&esw->mode_lock);
|
||||
@@ -4454,34 +4456,30 @@ static bool mlx5_devlink_switchdev_active_mode_change(struct mlx5_eswitch *esw,
|
||||
|
||||
down_write(&esw->mode_lock);
|
||||
esw->eswitch_operation_in_progress = false;
|
||||
up_write(&esw->mode_lock);
|
||||
mlx5_esw_unlock(esw);
|
||||
return true;
|
||||
}
|
||||
|
||||
#define MLX5_ESW_HOLD_TIMEOUT_MS 7000
|
||||
#define MLX5_ESW_HOLD_RETRY_DELAY_MS 500
|
||||
|
||||
void mlx5_eswitch_safe_aux_devs_remove(struct mlx5_core_dev *dev)
|
||||
{
|
||||
unsigned long timeout;
|
||||
bool hold_esw = true;
|
||||
struct mlx5_eswitch *esw = dev->priv.eswitch;
|
||||
|
||||
/* Wait for any concurrent eswitch mode transition to complete. */
|
||||
if (!mlx5_esw_hold(dev)) {
|
||||
timeout = jiffies + msecs_to_jiffies(MLX5_ESW_HOLD_TIMEOUT_MS);
|
||||
while (!mlx5_esw_hold(dev)) {
|
||||
if (!time_before(jiffies, timeout)) {
|
||||
hold_esw = false;
|
||||
break;
|
||||
}
|
||||
msleep(MLX5_ESW_HOLD_RETRY_DELAY_MS);
|
||||
}
|
||||
}
|
||||
if (hold_esw) {
|
||||
if (mlx5_eswitch_mode(dev) == MLX5_ESWITCH_OFFLOADS)
|
||||
mlx5_core_reps_aux_devs_remove(dev);
|
||||
mlx5_esw_release(dev);
|
||||
}
|
||||
if (!mlx5_esw_allowed(esw))
|
||||
return;
|
||||
|
||||
/* Wait for any concurrent eswitch mode transition to complete.
|
||||
* Deadlock risk if ever called from within an operation in progress.
|
||||
*/
|
||||
mlx5_esw_lock_wait(esw);
|
||||
esw->eswitch_operation_in_progress = true;
|
||||
up_write(&esw->mode_lock);
|
||||
|
||||
if (mlx5_eswitch_mode(dev) == MLX5_ESWITCH_OFFLOADS)
|
||||
mlx5_core_reps_aux_devs_remove(dev);
|
||||
|
||||
down_write(&esw->mode_lock);
|
||||
esw->eswitch_operation_in_progress = false;
|
||||
mlx5_esw_unlock(esw);
|
||||
}
|
||||
|
||||
int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
|
||||
@@ -4508,10 +4506,11 @@ int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
|
||||
return 0;
|
||||
|
||||
mlx5_lag_disable_change(esw->dev);
|
||||
mlx5_devcom_comp_lock(esw->dev->priv.hca_devcom_comp);
|
||||
err = mlx5_esw_try_lock(esw);
|
||||
if (err < 0) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Can't change mode, E-Switch is busy");
|
||||
goto enable_lag;
|
||||
goto unlock_hca;
|
||||
}
|
||||
cur_mlx5_mode = err;
|
||||
err = 0;
|
||||
@@ -4574,7 +4573,8 @@ skip:
|
||||
esw->eswitch_operation_in_progress = false;
|
||||
unlock:
|
||||
mlx5_esw_unlock(esw);
|
||||
enable_lag:
|
||||
unlock_hca:
|
||||
mlx5_devcom_comp_unlock(esw->dev->priv.hca_devcom_comp);
|
||||
mlx5_lag_enable_change(esw->dev);
|
||||
/* Shared FDB activation is creating LAG which is changing reps. */
|
||||
if (!err)
|
||||
@@ -4655,7 +4655,7 @@ int mlx5_devlink_eswitch_inline_mode_set(struct devlink *devlink, u8 mode,
|
||||
if (IS_ERR(esw))
|
||||
return PTR_ERR(esw);
|
||||
|
||||
down_write(&esw->mode_lock);
|
||||
mlx5_esw_lock_wait(esw);
|
||||
|
||||
switch (MLX5_CAP_ETH(dev, wqe_inline_mode)) {
|
||||
case MLX5_CAP_INLINE_MODE_NOT_REQUIRED:
|
||||
@@ -4693,7 +4693,7 @@ int mlx5_devlink_eswitch_inline_mode_set(struct devlink *devlink, u8 mode,
|
||||
|
||||
down_write(&esw->mode_lock);
|
||||
esw->eswitch_operation_in_progress = false;
|
||||
up_write(&esw->mode_lock);
|
||||
mlx5_esw_unlock(esw);
|
||||
return 0;
|
||||
|
||||
out:
|
||||
@@ -4712,25 +4712,31 @@ int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8 *mode)
|
||||
return esw_inline_mode_to_devlink(esw->offloads.inline_mode, mode);
|
||||
}
|
||||
|
||||
bool mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb)
|
||||
/* Return 1 if allowed, 0 if disallowed by the configuration, or -EBUSY
|
||||
* if an eswitch operation is in progress.
|
||||
*/
|
||||
int mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb)
|
||||
{
|
||||
struct mlx5_eswitch *esw = dev->priv.eswitch;
|
||||
enum devlink_eswitch_encap_mode encap;
|
||||
bool allow_tunnel = false;
|
||||
int ret;
|
||||
|
||||
if (!mlx5_esw_allowed(esw))
|
||||
return true;
|
||||
return 1;
|
||||
|
||||
ret = mlx5_esw_lock(esw);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
down_write(&esw->mode_lock);
|
||||
encap = esw->offloads.encap;
|
||||
if (esw->mode == MLX5_ESWITCH_LEGACY ||
|
||||
(encap == DEVLINK_ESWITCH_ENCAP_MODE_NONE && !from_fdb)) {
|
||||
allow_tunnel = true;
|
||||
ret = 1;
|
||||
esw->offloads.num_block_encap++;
|
||||
}
|
||||
up_write(&esw->mode_lock);
|
||||
mlx5_esw_unlock(esw);
|
||||
|
||||
return allow_tunnel;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void mlx5_eswitch_unblock_encap(struct mlx5_core_dev *dev)
|
||||
@@ -4757,7 +4763,7 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
|
||||
if (IS_ERR(esw))
|
||||
return PTR_ERR(esw);
|
||||
|
||||
down_write(&esw->mode_lock);
|
||||
mlx5_esw_lock_wait(esw);
|
||||
|
||||
if (encap != DEVLINK_ESWITCH_ENCAP_MODE_NONE &&
|
||||
(!MLX5_CAP_ESW_FLOWTABLE_FDB(dev, reformat) ||
|
||||
@@ -4813,7 +4819,7 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
|
||||
esw->eswitch_operation_in_progress = false;
|
||||
|
||||
unlock:
|
||||
up_write(&esw->mode_lock);
|
||||
mlx5_esw_unlock(esw);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ void mlx5i_pkey_qpn_ht_cleanup(struct net_device *netdev);
|
||||
int mlx5i_pkey_add_qpn(struct net_device *netdev, u32 qpn);
|
||||
int mlx5i_pkey_del_qpn(struct net_device *netdev, u32 qpn);
|
||||
|
||||
/* Get the net-device corresponding to the given underlay QPN */
|
||||
/* Get the net-device for a QPN. Caller must hold rcu_read_lock(). */
|
||||
struct net_device *mlx5i_pkey_get_netdev(struct net_device *netdev, u32 qpn);
|
||||
|
||||
/* Shared ndo functions */
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/hash.h>
|
||||
#include <linux/rculist.h>
|
||||
#include "ipoib.h"
|
||||
|
||||
#define MLX5I_MAX_LOG_PKEY_SUP 7
|
||||
@@ -39,11 +40,12 @@ struct qpn_to_netdev {
|
||||
struct net_device *netdev;
|
||||
struct hlist_node hlist;
|
||||
u32 underlay_qpn;
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
struct mlx5i_pkey_qpn_ht {
|
||||
struct hlist_head buckets[1 << MLX5I_MAX_LOG_PKEY_SUP];
|
||||
spinlock_t ht_lock; /* Synchronise with NAPI */
|
||||
spinlock_t ht_lock; /* Serialize hash table updates */
|
||||
};
|
||||
|
||||
int mlx5i_pkey_qpn_ht_init(struct net_device *netdev)
|
||||
@@ -68,13 +70,14 @@ void mlx5i_pkey_qpn_ht_cleanup(struct net_device *netdev)
|
||||
kfree(ipriv->qpn_htbl);
|
||||
}
|
||||
|
||||
static struct qpn_to_netdev *mlx5i_find_qpn_to_netdev_node(struct hlist_head *buckets,
|
||||
u32 qpn)
|
||||
static struct qpn_to_netdev *
|
||||
mlx5i_find_qpn_to_netdev_node(struct mlx5i_pkey_qpn_ht *ht, u32 qpn)
|
||||
{
|
||||
struct hlist_head *h = &buckets[hash_32(qpn, MLX5I_MAX_LOG_PKEY_SUP)];
|
||||
struct hlist_head *h = &ht->buckets[hash_32(qpn, MLX5I_MAX_LOG_PKEY_SUP)];
|
||||
struct qpn_to_netdev *node;
|
||||
|
||||
hlist_for_each_entry(node, h, hlist) {
|
||||
hlist_for_each_entry_rcu(node, h, hlist,
|
||||
lockdep_is_held(&ht->ht_lock)) {
|
||||
if (node->underlay_qpn == qpn)
|
||||
return node;
|
||||
}
|
||||
@@ -96,7 +99,7 @@ int mlx5i_pkey_add_qpn(struct net_device *netdev, u32 qpn)
|
||||
new_node->netdev = netdev;
|
||||
new_node->underlay_qpn = qpn;
|
||||
spin_lock_bh(&ht->ht_lock);
|
||||
hlist_add_head(&new_node->hlist, &ht->buckets[key]);
|
||||
hlist_add_head_rcu(&new_node->hlist, &ht->buckets[key]);
|
||||
spin_unlock_bh(&ht->ht_lock);
|
||||
|
||||
return 0;
|
||||
@@ -109,16 +112,17 @@ int mlx5i_pkey_del_qpn(struct net_device *netdev, u32 qpn)
|
||||
struct mlx5i_pkey_qpn_ht *ht = ipriv->qpn_htbl;
|
||||
struct qpn_to_netdev *node;
|
||||
|
||||
node = mlx5i_find_qpn_to_netdev_node(ht->buckets, qpn);
|
||||
spin_lock_bh(&ht->ht_lock);
|
||||
node = mlx5i_find_qpn_to_netdev_node(ht, qpn);
|
||||
if (!node) {
|
||||
spin_unlock_bh(&ht->ht_lock);
|
||||
mlx5_core_warn(epriv->mdev, "QPN to netdev delete from HT failed\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
spin_lock_bh(&ht->ht_lock);
|
||||
hlist_del_init(&node->hlist);
|
||||
hlist_del_rcu(&node->hlist);
|
||||
spin_unlock_bh(&ht->ht_lock);
|
||||
kfree(node);
|
||||
kfree_rcu(node, rcu);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -128,7 +132,7 @@ struct net_device *mlx5i_pkey_get_netdev(struct net_device *netdev, u32 qpn)
|
||||
struct mlx5i_priv *ipriv = netdev_priv(netdev);
|
||||
struct qpn_to_netdev *node;
|
||||
|
||||
node = mlx5i_find_qpn_to_netdev_node(ipriv->qpn_htbl->buckets, qpn);
|
||||
node = mlx5i_find_qpn_to_netdev_node(ipriv->qpn_htbl, qpn);
|
||||
if (!node)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -1172,7 +1172,6 @@ int mlx5_deactivate_lag(struct mlx5_lag *ldev)
|
||||
"Failed to deactivate VF LAG; driver restart required\n"
|
||||
"Make sure all VFs are unbound prior to VF LAG activation or deactivation\n");
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
if (test_bit(MLX5_LAG_MODE_FLAG_HASH_BASED, &flags)) {
|
||||
@@ -1182,7 +1181,7 @@ int mlx5_deactivate_lag(struct mlx5_lag *ldev)
|
||||
if (mlx5_lag_has_drop_rule(ldev))
|
||||
mlx5_lag_drop_rule_cleanup(ldev);
|
||||
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
bool mlx5_lag_check_prereq(struct mlx5_lag *ldev)
|
||||
|
||||
@@ -227,7 +227,7 @@ static int mlx5_lag_mpesw_queue_work(struct mlx5_core_dev *dev,
|
||||
int err = 0;
|
||||
|
||||
if (!ldev)
|
||||
return 0;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
work = kzalloc_obj(*work);
|
||||
if (!work)
|
||||
|
||||
@@ -80,6 +80,7 @@ enum {
|
||||
};
|
||||
|
||||
struct mlx5_clock_dev_state {
|
||||
bool loaded;
|
||||
struct mlx5_core_dev *mdev;
|
||||
struct mlx5_devcom_comp_dev *compdev;
|
||||
struct mlx5_nb pps_nb;
|
||||
@@ -89,7 +90,7 @@ struct mlx5_clock_dev_state {
|
||||
struct mlx5_clock_priv {
|
||||
struct mlx5_clock clock;
|
||||
struct mlx5_core_dev *mdev;
|
||||
struct mutex lock; /* protect mdev and used in PTP callbacks */
|
||||
struct mutex lock; /* protect mdev and serialize hardware callbacks */
|
||||
struct mlx5_core_dev *event_mdev;
|
||||
};
|
||||
|
||||
@@ -100,9 +101,6 @@ static struct mlx5_clock_priv *clock_priv(struct mlx5_clock *clock)
|
||||
|
||||
static void mlx5_clock_lockdep_assert(struct mlx5_clock *clock)
|
||||
{
|
||||
if (!clock->shared)
|
||||
return;
|
||||
|
||||
lockdep_assert(lockdep_is_held(&clock_priv(clock)->lock));
|
||||
}
|
||||
|
||||
@@ -115,20 +113,24 @@ static struct mlx5_core_dev *mlx5_clock_mdev_get(struct mlx5_clock *clock)
|
||||
|
||||
static void mlx5_clock_lock(struct mlx5_clock *clock)
|
||||
{
|
||||
if (!clock->shared)
|
||||
return;
|
||||
|
||||
mutex_lock(&clock_priv(clock)->lock);
|
||||
}
|
||||
|
||||
static void mlx5_clock_unlock(struct mlx5_clock *clock)
|
||||
{
|
||||
if (!clock->shared)
|
||||
return;
|
||||
|
||||
mutex_unlock(&clock_priv(clock)->lock);
|
||||
}
|
||||
|
||||
static struct mlx5_core_dev *
|
||||
mlx5_clock_active_mdev_get(struct mlx5_clock *clock)
|
||||
{
|
||||
struct mlx5_clock_priv *cpriv = clock_priv(clock);
|
||||
|
||||
mlx5_clock_lockdep_assert(clock);
|
||||
|
||||
return cpriv->mdev->clock_state->loaded ? cpriv->mdev : NULL;
|
||||
}
|
||||
|
||||
static bool mlx5_real_time_mode(struct mlx5_core_dev *mdev)
|
||||
{
|
||||
return (mlx5_is_real_time_rq(mdev) || mlx5_is_real_time_sq(mdev));
|
||||
@@ -333,7 +335,11 @@ static int mlx5_ptp_getcrosststamp(struct ptp_clock_info *ptp,
|
||||
int err;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (!mlx5_is_ptm_source_time_available(mdev)) {
|
||||
err = -EBUSY;
|
||||
@@ -359,7 +365,11 @@ static int mlx5_ptp_getcrosscycles(struct ptp_clock_info *ptp,
|
||||
int err;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (!mlx5_is_ptm_source_time_available(mdev)) {
|
||||
err = -EBUSY;
|
||||
@@ -411,6 +421,12 @@ static u64 read_internal_timer(struct cyclecounter *cc)
|
||||
return mlx5_read_time(mdev, NULL, false) & cc->mask;
|
||||
}
|
||||
|
||||
static void mlx5_timer_snapshot(struct mlx5_timer *timer)
|
||||
{
|
||||
timer->saved_phc_ns = timer->tc.nsec;
|
||||
timer->saved_boot_ns = ktime_get_boottime_ns();
|
||||
}
|
||||
|
||||
static void mlx5_update_clock_info_page(struct mlx5_core_dev *mdev)
|
||||
{
|
||||
struct mlx5_ib_clock_info *clock_info = mdev->clock_info;
|
||||
@@ -418,6 +434,9 @@ static void mlx5_update_clock_info_page(struct mlx5_core_dev *mdev)
|
||||
struct mlx5_timer *timer;
|
||||
u32 sign;
|
||||
|
||||
timer = &clock->timer;
|
||||
mlx5_timer_snapshot(timer);
|
||||
|
||||
if (!clock_info)
|
||||
return;
|
||||
|
||||
@@ -425,7 +444,6 @@ static void mlx5_update_clock_info_page(struct mlx5_core_dev *mdev)
|
||||
smp_store_mb(clock_info->sign,
|
||||
sign | MLX5_IB_CLOCK_INFO_KERNEL_UPDATING);
|
||||
|
||||
timer = &clock->timer;
|
||||
clock_info->cycles = timer->tc.cycle_last;
|
||||
clock_info->mult = timer->cycles.mult;
|
||||
clock_info->nsec = timer->tc.nsec;
|
||||
@@ -471,10 +489,9 @@ static long mlx5_timestamp_overflow(struct ptp_clock_info *ptp_info)
|
||||
|
||||
clock = container_of(ptp_info, struct mlx5_clock, ptp_info);
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
timer = &clock->timer;
|
||||
|
||||
if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
|
||||
if (!mdev || mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
|
||||
goto out;
|
||||
|
||||
write_seqlock_irqsave(&clock->lock, flags);
|
||||
@@ -531,8 +548,13 @@ static int mlx5_ptp_settime(struct ptp_clock_info *ptp, const struct timespec64
|
||||
int err;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
err = mlx5_clock_settime(mdev, clock, ts);
|
||||
unlock:
|
||||
mlx5_clock_unlock(clock);
|
||||
|
||||
return err;
|
||||
@@ -550,26 +572,40 @@ struct timespec64 mlx5_ptp_gettimex_real_time(struct mlx5_core_dev *mdev,
|
||||
return ts;
|
||||
}
|
||||
|
||||
static int mlx5_ptp_gettimex(struct ptp_clock_info *ptp, struct timespec64 *ts,
|
||||
struct ptp_system_timestamp *sts)
|
||||
static void mlx5_clock_gettimex(struct mlx5_core_dev *mdev,
|
||||
struct mlx5_clock *clock, struct timespec64 *ts,
|
||||
struct ptp_system_timestamp *sts)
|
||||
{
|
||||
struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock, ptp_info);
|
||||
struct mlx5_core_dev *mdev;
|
||||
u64 cycles, ns;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
if (mlx5_real_time_mode(mdev)) {
|
||||
*ts = mlx5_ptp_gettimex_real_time(mdev, sts);
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
cycles = mlx5_read_time(mdev, sts, false);
|
||||
ns = mlx5_timecounter_cyc2time(clock, cycles);
|
||||
*ts = ns_to_timespec64(ns);
|
||||
out:
|
||||
}
|
||||
|
||||
static int mlx5_ptp_gettimex(struct ptp_clock_info *ptp, struct timespec64 *ts,
|
||||
struct ptp_system_timestamp *sts)
|
||||
{
|
||||
struct mlx5_clock *clock =
|
||||
container_of(ptp, struct mlx5_clock, ptp_info);
|
||||
struct mlx5_core_dev *mdev;
|
||||
int err = 0;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
mlx5_clock_gettimex(mdev, clock, ts, sts);
|
||||
unlock:
|
||||
mlx5_clock_unlock(clock);
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mlx5_ptp_getcyclesx(struct ptp_clock_info *ptp,
|
||||
@@ -580,14 +616,20 @@ static int mlx5_ptp_getcyclesx(struct ptp_clock_info *ptp,
|
||||
ptp_info);
|
||||
struct mlx5_core_dev *mdev;
|
||||
u64 cycles;
|
||||
int err = 0;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
cycles = mlx5_read_time(mdev, sts, false);
|
||||
*ts = ns_to_timespec64(cycles);
|
||||
unlock:
|
||||
mlx5_clock_unlock(clock);
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mlx5_ptp_adjtime_real_time(struct mlx5_core_dev *mdev, s64 delta)
|
||||
@@ -620,7 +662,11 @@ static int mlx5_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
|
||||
int err = 0;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (mlx5_modify_mtutc_allowed(mdev)) {
|
||||
err = mlx5_ptp_adjtime_real_time(mdev, delta);
|
||||
@@ -630,6 +676,7 @@ static int mlx5_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
|
||||
}
|
||||
|
||||
write_seqlock_irqsave(&clock->lock, flags);
|
||||
timecounter_read(&timer->tc);
|
||||
timecounter_adjtime(&timer->tc, delta);
|
||||
mlx5_update_clock_info_page(mdev);
|
||||
write_sequnlock_irqrestore(&clock->lock, flags);
|
||||
@@ -646,8 +693,13 @@ static int mlx5_ptp_adjphase(struct ptp_clock_info *ptp, s32 delta)
|
||||
int err;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
err = mlx5_ptp_adjtime_real_time(mdev, delta);
|
||||
unlock:
|
||||
mlx5_clock_unlock(clock);
|
||||
|
||||
return err;
|
||||
@@ -683,7 +735,11 @@ static int mlx5_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
|
||||
u32 mult;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (mlx5_modify_mtutc_allowed(mdev)) {
|
||||
err = mlx5_ptp_freq_adj_real_time(mdev, scaled_ppm);
|
||||
@@ -744,7 +800,11 @@ static int mlx5_extts_configure(struct ptp_clock_info *ptp,
|
||||
}
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (!MLX5_PPS_CAP(mdev)) {
|
||||
err = -EOPNOTSUPP;
|
||||
@@ -917,7 +977,11 @@ static int mlx5_perout_configure(struct ptp_clock_info *ptp,
|
||||
return -EBUSY;
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
mdev = mlx5_clock_mdev_get(clock);
|
||||
mdev = mlx5_clock_active_mdev_get(clock);
|
||||
if (!mdev) {
|
||||
err = -EAGAIN;
|
||||
goto unlock;
|
||||
}
|
||||
rt_mode = mlx5_real_time_mode(mdev);
|
||||
|
||||
if (!MLX5_PPS_CAP(mdev)) {
|
||||
@@ -1151,7 +1215,7 @@ static u64 perout_conf_next_event_timer(struct mlx5_core_dev *mdev,
|
||||
struct timespec64 ts;
|
||||
s64 target_ns;
|
||||
|
||||
mlx5_ptp_gettimex(&clock->ptp_info, &ts, NULL);
|
||||
mlx5_clock_gettimex(mdev, clock, &ts, NULL);
|
||||
ts_next_sec(&ts);
|
||||
target_ns = timespec64_to_ns(&ts);
|
||||
|
||||
@@ -1222,8 +1286,8 @@ static void mlx5_timecounter_init(struct mlx5_core_dev *mdev)
|
||||
timer->nominal_c_mult = timer->cycles.mult;
|
||||
timer->cycles.mask = CLOCKSOURCE_MASK(41);
|
||||
|
||||
timecounter_init(&timer->tc, &timer->cycles,
|
||||
ktime_to_ns(ktime_get_real()));
|
||||
timecounter_init(&timer->tc, &timer->cycles, ktime_get_real_ns());
|
||||
mlx5_timer_snapshot(timer);
|
||||
}
|
||||
|
||||
static void mlx5_init_overflow_period(struct mlx5_core_dev *mdev)
|
||||
@@ -1381,9 +1445,6 @@ static void mlx5_init_clock_dev(struct mlx5_core_dev *mdev)
|
||||
clock->ptp);
|
||||
clock->ptp = NULL;
|
||||
}
|
||||
|
||||
if (clock->ptp)
|
||||
ptp_schedule_worker(clock->ptp, 0);
|
||||
}
|
||||
|
||||
static void mlx5_destroy_clock_dev(struct mlx5_core_dev *mdev)
|
||||
@@ -1530,22 +1591,53 @@ static void mlx5_clock_arm_pps_in_event(struct mlx5_clock *clock,
|
||||
!clock->pps_info.pin_armed[i])
|
||||
continue;
|
||||
|
||||
if (new_mdev) {
|
||||
if (new_mdev)
|
||||
mlx5_set_mtppse(new_mdev, i, 0, MLX5_EVENT_MODE_REPETETIVE);
|
||||
cpriv->event_mdev = new_mdev;
|
||||
} else {
|
||||
cpriv->event_mdev = NULL;
|
||||
}
|
||||
|
||||
if (old_mdev)
|
||||
mlx5_set_mtppse(old_mdev, i, 0, MLX5_EVENT_MODE_DISABLE);
|
||||
}
|
||||
cpriv->event_mdev = new_mdev;
|
||||
}
|
||||
|
||||
static void mlx5_set_timecounter(struct mlx5_core_dev *mdev, u64 ns)
|
||||
{
|
||||
struct mlx5_clock *clock = mdev->clock;
|
||||
struct mlx5_timer *timer;
|
||||
unsigned long flags;
|
||||
|
||||
timer = &clock->timer;
|
||||
mlx5_clock_lockdep_assert(clock);
|
||||
|
||||
write_seqlock_irqsave(&clock->lock, flags);
|
||||
timecounter_init(&timer->tc, &timer->cycles, ns);
|
||||
mlx5_update_clock_info_page(mdev);
|
||||
write_sequnlock_irqrestore(&clock->lock, flags);
|
||||
}
|
||||
|
||||
static void mlx5_save_timecounter(struct mlx5_core_dev *mdev)
|
||||
{
|
||||
struct mlx5_clock *clock = mdev->clock;
|
||||
struct mlx5_timer *timer;
|
||||
unsigned long flags;
|
||||
|
||||
timer = &clock->timer;
|
||||
mlx5_clock_lockdep_assert(clock);
|
||||
|
||||
if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
|
||||
return;
|
||||
|
||||
write_seqlock_irqsave(&clock->lock, flags);
|
||||
timecounter_read(&timer->tc);
|
||||
mlx5_update_clock_info_page(mdev);
|
||||
write_sequnlock_irqrestore(&clock->lock, flags);
|
||||
}
|
||||
|
||||
void mlx5_clock_load(struct mlx5_core_dev *mdev)
|
||||
{
|
||||
struct mlx5_clock *clock = mdev->clock;
|
||||
struct mlx5_clock_priv *cpriv;
|
||||
bool start;
|
||||
|
||||
if (!MLX5_CAP_GEN(mdev, device_frequency_khz))
|
||||
return;
|
||||
@@ -1554,18 +1646,32 @@ void mlx5_clock_load(struct mlx5_core_dev *mdev)
|
||||
MLX5_NB_INIT(&mdev->clock_state->pps_nb, mlx5_pps_event, PPS_EVENT);
|
||||
mlx5_eq_notifier_register(mdev, &mdev->clock_state->pps_nb);
|
||||
|
||||
if (!clock->shared) {
|
||||
mlx5_clock_arm_pps_in_event(clock, mdev, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
cpriv = clock_priv(clock);
|
||||
mlx5_devcom_comp_lock(mdev->clock_state->compdev);
|
||||
if (clock->shared)
|
||||
mlx5_devcom_comp_lock(mdev->clock_state->compdev);
|
||||
mlx5_clock_lock(clock);
|
||||
if (mdev == cpriv->mdev && mdev != cpriv->event_mdev)
|
||||
start = !cpriv->mdev->clock_state->loaded;
|
||||
mdev->clock_state->loaded = true;
|
||||
if (start) {
|
||||
struct mlx5_timer *timer = &clock->timer;
|
||||
u64 ns;
|
||||
|
||||
cpriv->mdev = mdev;
|
||||
if (mlx5_real_time_mode(mdev))
|
||||
ns = mlx5_read_time(mdev, NULL, true);
|
||||
else
|
||||
ns = timer->saved_phc_ns +
|
||||
ktime_get_boottime_ns() - timer->saved_boot_ns;
|
||||
|
||||
mlx5_set_timecounter(mdev, ns);
|
||||
mlx5_clock_arm_pps_in_event(clock, mdev, cpriv->event_mdev);
|
||||
}
|
||||
mlx5_clock_unlock(clock);
|
||||
mlx5_devcom_comp_unlock(mdev->clock_state->compdev);
|
||||
|
||||
if (start && clock->ptp)
|
||||
ptp_schedule_worker(clock->ptp, 0);
|
||||
if (clock->shared)
|
||||
mlx5_devcom_comp_unlock(mdev->clock_state->compdev);
|
||||
}
|
||||
|
||||
void mlx5_clock_unload(struct mlx5_core_dev *mdev)
|
||||
@@ -1573,30 +1679,42 @@ void mlx5_clock_unload(struct mlx5_core_dev *mdev)
|
||||
struct mlx5_core_dev *peer_dev, *next = NULL;
|
||||
struct mlx5_clock *clock = mdev->clock;
|
||||
struct mlx5_devcom_comp_dev *pos;
|
||||
struct mlx5_clock_priv *cpriv;
|
||||
bool stop;
|
||||
|
||||
if (!MLX5_CAP_GEN(mdev, device_frequency_khz))
|
||||
return;
|
||||
|
||||
if (!clock->shared) {
|
||||
mlx5_clock_arm_pps_in_event(clock, NULL, mdev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
mlx5_devcom_comp_lock(mdev->clock_state->compdev);
|
||||
mlx5_devcom_for_each_peer_entry(mdev->clock_state->compdev, peer_dev, pos) {
|
||||
if (peer_dev->clock && peer_dev != mdev) {
|
||||
next = peer_dev;
|
||||
break;
|
||||
if (clock->shared) {
|
||||
mlx5_devcom_comp_lock(mdev->clock_state->compdev);
|
||||
mlx5_devcom_for_each_peer_entry(mdev->clock_state->compdev,
|
||||
peer_dev, pos) {
|
||||
if (peer_dev->clock == clock &&
|
||||
peer_dev->clock_state->loaded) {
|
||||
next = peer_dev;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mlx5_clock_lock(clock);
|
||||
if (mdev == clock_priv(clock)->event_mdev)
|
||||
cpriv = clock_priv(clock);
|
||||
mdev->clock_state->loaded = false;
|
||||
if (mdev == cpriv->mdev && next)
|
||||
cpriv->mdev = next;
|
||||
if (mdev == cpriv->event_mdev)
|
||||
mlx5_clock_arm_pps_in_event(clock, next, mdev);
|
||||
stop = !cpriv->mdev->clock_state->loaded;
|
||||
if (!mlx5_real_time_mode(cpriv->mdev))
|
||||
mlx5_save_timecounter(cpriv->mdev);
|
||||
mlx5_clock_unlock(clock);
|
||||
mlx5_devcom_comp_unlock(mdev->clock_state->compdev);
|
||||
|
||||
out:
|
||||
/* Keep devcom locked to prevent a peer from restarting the worker. */
|
||||
if (stop && clock->ptp)
|
||||
ptp_cancel_worker_sync(clock->ptp);
|
||||
if (clock->shared)
|
||||
mlx5_devcom_comp_unlock(mdev->clock_state->compdev);
|
||||
|
||||
mlx5_eq_notifier_unregister(mdev, &mdev->clock_state->pps_nb);
|
||||
cancel_work_sync(&mdev->clock_state->out_work);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ struct mlx5_timer {
|
||||
struct timecounter tc;
|
||||
u32 nominal_c_mult;
|
||||
unsigned long overflow_period;
|
||||
u64 saved_phc_ns;
|
||||
u64 saved_boot_ns;
|
||||
};
|
||||
|
||||
struct mlx5_clock {
|
||||
|
||||
@@ -764,13 +764,9 @@ err_alloc_dev:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void macsec_fs_tx_del_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
struct mlx5_macsec_tx_rule *tx_rule,
|
||||
void *macdev)
|
||||
static void macsec_fs_tx_free_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
struct mlx5_macsec_tx_rule *tx_rule)
|
||||
{
|
||||
macsec_fs_id_del(&macsec_fs->macsec_devices_list, tx_rule->fs_id, macdev,
|
||||
&macsec_fs->sci_hash, true);
|
||||
|
||||
if (tx_rule->rule) {
|
||||
mlx5_del_flow_rules(tx_rule->rule);
|
||||
tx_rule->rule = NULL;
|
||||
@@ -791,6 +787,15 @@ static void macsec_fs_tx_del_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
macsec_fs_tx_ft_put(macsec_fs);
|
||||
}
|
||||
|
||||
static void macsec_fs_tx_del_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
struct mlx5_macsec_tx_rule *tx_rule,
|
||||
void *macdev)
|
||||
{
|
||||
macsec_fs_id_del(&macsec_fs->macsec_devices_list, tx_rule->fs_id, macdev,
|
||||
&macsec_fs->sci_hash, true);
|
||||
macsec_fs_tx_free_rule(macsec_fs, tx_rule);
|
||||
}
|
||||
|
||||
#define MLX5_REFORMAT_PARAM_ADD_MACSEC_OFFSET_4_BYTES 1
|
||||
|
||||
static union mlx5_macsec_rule *
|
||||
@@ -883,7 +888,7 @@ macsec_fs_tx_add_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
goto out_spec;
|
||||
|
||||
err:
|
||||
macsec_fs_tx_del_rule(macsec_fs, tx_rule, macsec_ctx->secy->netdev);
|
||||
macsec_fs_tx_free_rule(macsec_fs, tx_rule);
|
||||
macsec_rule = NULL;
|
||||
out_spec:
|
||||
kvfree(spec);
|
||||
@@ -1648,15 +1653,11 @@ static void macsec_fs_rx_ft_put(struct mlx5_macsec_fs *macsec_fs)
|
||||
macsec_fs_rx_destroy(macsec_fs);
|
||||
}
|
||||
|
||||
static void macsec_fs_rx_del_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
struct mlx5_macsec_rx_rule *rx_rule,
|
||||
void *macdev, u32 fs_id)
|
||||
static void macsec_fs_rx_free_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
struct mlx5_macsec_rx_rule *rx_rule)
|
||||
{
|
||||
int i;
|
||||
|
||||
macsec_fs_id_del(&macsec_fs->macsec_devices_list, fs_id, macdev,
|
||||
&macsec_fs->fs_id_hash, false);
|
||||
|
||||
for (i = 0; i < RX_NUM_OF_RULES_PER_SA; ++i) {
|
||||
if (rx_rule->rule[i]) {
|
||||
mlx5_del_flow_rules(rx_rule->rule[i]);
|
||||
@@ -1674,6 +1675,15 @@ static void macsec_fs_rx_del_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
macsec_fs_rx_ft_put(macsec_fs);
|
||||
}
|
||||
|
||||
static void macsec_fs_rx_del_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
struct mlx5_macsec_rx_rule *rx_rule,
|
||||
void *macdev, u32 fs_id)
|
||||
{
|
||||
macsec_fs_id_del(&macsec_fs->macsec_devices_list, fs_id, macdev,
|
||||
&macsec_fs->fs_id_hash, false);
|
||||
macsec_fs_rx_free_rule(macsec_fs, rx_rule);
|
||||
}
|
||||
|
||||
static void macsec_fs_rx_setup_fte(struct mlx5_flow_spec *spec,
|
||||
struct mlx5_flow_act *flow_act,
|
||||
struct mlx5_macsec_rule_attrs *attrs,
|
||||
@@ -1833,7 +1843,7 @@ macsec_fs_rx_add_rule(struct mlx5_macsec_fs *macsec_fs,
|
||||
return macsec_rule;
|
||||
|
||||
err:
|
||||
macsec_fs_rx_del_rule(macsec_fs, rx_rule, macsec_ctx->secy->netdev, fs_id);
|
||||
macsec_fs_rx_free_rule(macsec_fs, rx_rule);
|
||||
macsec_rule = NULL;
|
||||
out_spec:
|
||||
kvfree(spec);
|
||||
|
||||
@@ -1814,6 +1814,7 @@ int mlx5_mdev_init(struct mlx5_core_dev *dev, int profile_idx)
|
||||
lockdep_register_key(&dev->lock_key);
|
||||
mutex_init(&dev->intf_state_mutex);
|
||||
lockdep_set_class(&dev->intf_state_mutex, &dev->lock_key);
|
||||
spin_lock_init(&dev->offload_block.lock);
|
||||
mutex_init(&dev->mlx5e_res.uplink_netdev_lock);
|
||||
mutex_init(&dev->wc_state_lock);
|
||||
|
||||
|
||||
@@ -523,13 +523,13 @@ mlx5_fs_get_action_aso_meter(struct mlx5_fs_hws_context *fs_ctx,
|
||||
}
|
||||
|
||||
static void mlx5_fs_put_action_aso_meter(struct mlx5_fs_hws_context *fs_ctx,
|
||||
struct mlx5_exe_aso *exe_aso)
|
||||
u32 base_id)
|
||||
{
|
||||
struct mlx5_fs_hws_data *meter_hws_data;
|
||||
struct xarray *meters_xa;
|
||||
|
||||
meters_xa = &fs_ctx->hws_pool.aso_meters;
|
||||
meter_hws_data = xa_load(meters_xa, exe_aso->base_id);
|
||||
meter_hws_data = xa_load(meters_xa, base_id);
|
||||
if (!meter_hws_data)
|
||||
return;
|
||||
return mlx5_fs_put_hws_action(meter_hws_data);
|
||||
@@ -704,7 +704,7 @@ static void mlx5_fs_destroy_fs_action(struct mlx5_flow_root_namespace *ns,
|
||||
mlx5_fc_put_hws_action(fs_action->counter);
|
||||
break;
|
||||
case MLX5HWS_ACTION_TYP_ASO_METER:
|
||||
mlx5_fs_put_action_aso_meter(fs_ctx, fs_action->exe_aso);
|
||||
mlx5_fs_put_action_aso_meter(fs_ctx, fs_action->aso_base_id);
|
||||
break;
|
||||
case MLX5HWS_ACTION_TYP_SAMPLER:
|
||||
mlx5_fs_put_dest_action_sampler(fs_ctx, fs_action->sampler_id);
|
||||
@@ -937,7 +937,7 @@ static int mlx5_fs_fte_get_hws_actions(struct mlx5_flow_root_namespace *ns,
|
||||
fte_action->exe_aso.flow_meter.init_color;
|
||||
(*ractions)[num_actions++].action = tmp_action;
|
||||
fs_actions[num_fs_actions].action = tmp_action;
|
||||
fs_actions[num_fs_actions++].exe_aso = &fte_action->exe_aso;
|
||||
fs_actions[num_fs_actions++].aso_base_id = fte_action->exe_aso.base_id;
|
||||
}
|
||||
|
||||
if (fte_action->action & MLX5_FLOW_CONTEXT_ACTION_DROP) {
|
||||
|
||||
@@ -57,7 +57,7 @@ struct mlx5_fs_hws_rule_action {
|
||||
struct mlx5hws_action *action;
|
||||
union {
|
||||
struct mlx5_fc *counter;
|
||||
struct mlx5_exe_aso *exe_aso;
|
||||
u32 aso_base_id;
|
||||
u32 sampler_id;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -441,6 +441,7 @@ enum {
|
||||
#define FBNIC_TMI_SOP_PROT_CTRL 0x04400 /* 0x11000 */
|
||||
#define FBNIC_TMI_DROP_CTRL 0x04401 /* 0x11004 */
|
||||
#define FBNIC_TMI_DROP_CTRL_EN CSR_BIT(0)
|
||||
#define FBNIC_TMI_DROP_CTRL_CMPL_DIS CSR_BIT(1)
|
||||
#define FBNIC_TMI_DROP_PKTS 0x04402 /* 0x11008 */
|
||||
#define FBNIC_TMI_DROP_BYTE_L 0x04403 /* 0x1100c */
|
||||
#define FBNIC_TMI_ILLEGAL_PTP_REQS 0x04409 /* 0x11024 */
|
||||
@@ -955,6 +956,10 @@ enum {
|
||||
|
||||
/* PUL User Registers */
|
||||
#define FBNIC_CSR_START_PUL_USER 0x31000 /* CSR section delimiter */
|
||||
#define FBNIC_PUL_USER_IP_LINK_RST_STATUS \
|
||||
0x31030 /* 0xc40c0 */
|
||||
#define FBNIC_PUL_USER_IP_LINK_RST_STATUS_AW_FLUSH_DONE CSR_BIT(7)
|
||||
#define FBNIC_PUL_USER_IP_LINK_RST_STATUS_AR_FLUSH_DONE CSR_BIT(8)
|
||||
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG 0x3103d /* 0xc40f4 */
|
||||
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH_MODE CSR_BIT(20)
|
||||
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH CSR_BIT(19)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <linux/dev_printk.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "fbnic.h"
|
||||
@@ -176,10 +177,25 @@ static void fbnic_mbx_unmap_and_free_msg(struct fbnic_dev *fbd, int mbx_idx,
|
||||
|
||||
static void fbnic_mbx_clean_desc_ring(struct fbnic_dev *fbd, int mbx_idx)
|
||||
{
|
||||
u32 flush_done, val;
|
||||
int i;
|
||||
|
||||
fbnic_mbx_reset_desc_ring(fbd, mbx_idx);
|
||||
|
||||
/* Arming the flush only starts it. Wait for the outbound path to
|
||||
* retire the requests it still holds before the buffers they may
|
||||
* target are unmapped and freed. A lost link reads back as all ones,
|
||||
* which ends the poll on the first pass.
|
||||
*/
|
||||
flush_done = mbx_idx == FBNIC_IPC_MBX_RX_IDX ?
|
||||
FBNIC_PUL_USER_IP_LINK_RST_STATUS_AW_FLUSH_DONE :
|
||||
FBNIC_PUL_USER_IP_LINK_RST_STATUS_AR_FLUSH_DONE;
|
||||
if (read_poll_timeout_atomic(fbnic_rd32, val, val & flush_done, 2,
|
||||
1000, false, fbd,
|
||||
FBNIC_PUL_USER_IP_LINK_RST_STATUS))
|
||||
dev_warn(fbd->dev, "Outbound flush did not complete: %08x\n",
|
||||
val);
|
||||
|
||||
for (i = FBNIC_IPC_MBX_DESC_LEN; i--;)
|
||||
fbnic_mbx_unmap_and_free_msg(fbd, mbx_idx, i);
|
||||
}
|
||||
|
||||
@@ -86,11 +86,11 @@ static int fbnic_stop(struct net_device *netdev)
|
||||
{
|
||||
struct fbnic_net *fbn = netdev_priv(netdev);
|
||||
|
||||
fbnic_down(fbn);
|
||||
|
||||
fbnic_mac_free_irq(fbn->fbd);
|
||||
phylink_suspend(fbn->phylink, fbnic_bmc_present(fbn->fbd));
|
||||
|
||||
fbnic_down(fbn);
|
||||
|
||||
fbnic_time_stop(fbn);
|
||||
fbnic_fw_xmit_ownership_msg(fbn->fbd, false);
|
||||
|
||||
|
||||
@@ -181,10 +181,15 @@ static int fbnic_fw_config_after_crash(struct fbnic_dev *fbd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* The rx mode work rewrites the same shadow under the instance lock
|
||||
* alone, and this runs from the service task under RTNL only.
|
||||
*/
|
||||
netdev_lock(fbd->netdev);
|
||||
fbnic_rpc_reset_valid_entries(fbd);
|
||||
netif_addr_lock_bh(fbd->netdev);
|
||||
__fbnic_set_rx_mode(fbd, &fbd->netdev->uc, &fbd->netdev->mc);
|
||||
netif_addr_unlock_bh(fbd->netdev);
|
||||
netdev_unlock(fbd->netdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -229,18 +234,25 @@ static void fbnic_service_task(struct work_struct *work)
|
||||
|
||||
fbnic_fw_check_heartbeat(fbd);
|
||||
|
||||
fbnic_health_check(fbd);
|
||||
|
||||
fbnic_bmc_rpc_check(fbd);
|
||||
|
||||
if (netif_carrier_ok(fbd->netdev)) {
|
||||
netdev_lock(fbd->netdev);
|
||||
fbnic_napi_depletion_check(fbd->netdev);
|
||||
netdev_unlock(fbd->netdev);
|
||||
}
|
||||
|
||||
if (netif_running(netdev))
|
||||
/* fbnic_service_task_stop() does not wait for a pass that is already
|
||||
* blocked on RTNL, so one can run after ndo_stop. Leave host state
|
||||
* alone in that case, and do not re-arm; __fbnic_open() reclaims and
|
||||
* rebuilds it. The PM path calls ndo_stop with the device detached but
|
||||
* still running; fbnic_up() starts the task again on resume.
|
||||
*/
|
||||
if (netif_running(netdev) && netif_device_present(netdev)) {
|
||||
fbnic_health_check(fbd);
|
||||
|
||||
fbnic_bmc_rpc_check(fbd);
|
||||
|
||||
schedule_delayed_work(&fbd->service_task, HZ);
|
||||
}
|
||||
|
||||
rtnl_unlock();
|
||||
}
|
||||
@@ -453,6 +465,12 @@ static int fbnic_pm_suspend(struct device *dev)
|
||||
netdev_unlock(netdev);
|
||||
rtnl_unlock();
|
||||
|
||||
/* ndo_stop could not wait for a pass already blocked on RTNL. That
|
||||
* pass no longer re-arms, but wait for it to finish before the
|
||||
* mailbox, IRQs and MMIO go away.
|
||||
*/
|
||||
cancel_delayed_work_sync(&fbd->service_task);
|
||||
|
||||
null_uc_addr:
|
||||
fbnic_fw_log_disable(fbd);
|
||||
|
||||
@@ -553,19 +571,26 @@ static void __fbnic_pm_attach(struct device *dev)
|
||||
struct net_device *netdev = fbd->netdev;
|
||||
struct fbnic_net *fbn;
|
||||
|
||||
rtnl_lock();
|
||||
fbnic_reset_hw_stats(fbd);
|
||||
rtnl_unlock();
|
||||
|
||||
if (fbnic_init_failure(fbd))
|
||||
return;
|
||||
|
||||
fbn = netdev_priv(netdev);
|
||||
|
||||
/* Hold RTNL until the device is attached, so the service task pass
|
||||
* fbnic_up() schedules cannot run until it will see it present.
|
||||
*/
|
||||
rtnl_lock();
|
||||
netdev_lock(netdev);
|
||||
|
||||
fbnic_reset_hw_stats(fbd);
|
||||
|
||||
if (netif_running(netdev))
|
||||
fbnic_up(fbn);
|
||||
|
||||
netif_device_attach(netdev);
|
||||
|
||||
netdev_unlock(netdev);
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
static int __maybe_unused fbnic_pm_resume(struct device *dev)
|
||||
|
||||
@@ -2349,15 +2349,19 @@ void fbnic_disable(struct fbnic_net *fbn)
|
||||
|
||||
static void fbnic_tx_flush(struct fbnic_dev *fbd)
|
||||
{
|
||||
u32 drop_ctrl = FBNIC_TMI_DROP_CTRL_EN | FBNIC_TMI_DROP_CTRL_CMPL_DIS;
|
||||
|
||||
netdev_warn(fbd->netdev, "triggering Tx flush\n");
|
||||
|
||||
fbnic_rmw32(fbd, FBNIC_TMI_DROP_CTRL, FBNIC_TMI_DROP_CTRL_EN,
|
||||
FBNIC_TMI_DROP_CTRL_EN);
|
||||
/* Drop packets and retire their PTP completions */
|
||||
fbnic_rmw32(fbd, FBNIC_TMI_DROP_CTRL, drop_ctrl, drop_ctrl);
|
||||
}
|
||||
|
||||
static void fbnic_tx_flush_off(struct fbnic_dev *fbd)
|
||||
{
|
||||
fbnic_rmw32(fbd, FBNIC_TMI_DROP_CTRL, FBNIC_TMI_DROP_CTRL_EN, 0);
|
||||
u32 drop_ctrl = FBNIC_TMI_DROP_CTRL_EN | FBNIC_TMI_DROP_CTRL_CMPL_DIS;
|
||||
|
||||
fbnic_rmw32(fbd, FBNIC_TMI_DROP_CTRL, drop_ctrl, 0);
|
||||
}
|
||||
|
||||
struct fbnic_idle_regs {
|
||||
|
||||
@@ -78,7 +78,8 @@ int mana_xdp_xmit(struct net_device *ndev, int n, struct xdp_frame **frames,
|
||||
}
|
||||
|
||||
u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq,
|
||||
struct xdp_buff *xdp, void *buf_va, uint pkt_len)
|
||||
struct xdp_buff *xdp, void *buf_va, bool from_pool,
|
||||
uint pkt_len)
|
||||
{
|
||||
struct mana_stats_rx *rx_stats;
|
||||
struct bpf_prog *prog;
|
||||
@@ -90,7 +91,11 @@ u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq,
|
||||
if (!prog)
|
||||
goto out;
|
||||
|
||||
xdp_init_buff(xdp, PAGE_SIZE, &rxq->xdp_rxq);
|
||||
/* A redirected buffer is freed by its memory model, so a buffer not
|
||||
* from the page pool must not claim MEM_TYPE_PAGE_POOL.
|
||||
*/
|
||||
xdp_init_buff(xdp, PAGE_SIZE,
|
||||
from_pool ? &rxq->xdp_rxq : &rxq->xdp_rxq_shared);
|
||||
xdp_prepare_buff(xdp, buf_va, rxq->headroom, pkt_len, true);
|
||||
|
||||
act = bpf_prog_run_xdp(prog, xdp);
|
||||
|
||||
@@ -2157,7 +2157,7 @@ static void mana_rx_skb(void *buf_va, bool from_pool,
|
||||
return;
|
||||
}
|
||||
|
||||
act = mana_run_xdp(ndev, rxq, &xdp, buf_va, pkt_len);
|
||||
act = mana_run_xdp(ndev, rxq, &xdp, buf_va, from_pool, pkt_len);
|
||||
|
||||
if (act == XDP_REDIRECT && !rxq->xdp_rc)
|
||||
return;
|
||||
@@ -2179,10 +2179,9 @@ static void mana_rx_skb(void *buf_va, bool from_pool,
|
||||
skb_checksum_none_assert(skb);
|
||||
skb_record_rx_queue(skb, rxq_idx);
|
||||
|
||||
if ((ndev->features & NETIF_F_RXCSUM) && cqe->rx_iphdr_csum_succeed) {
|
||||
if (cqe->rx_tcp_csum_succeed || cqe->rx_udp_csum_succeed)
|
||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||
}
|
||||
if ((ndev->features & NETIF_F_RXCSUM) &&
|
||||
(cqe->rx_tcp_csum_succeed || cqe->rx_udp_csum_succeed))
|
||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||
|
||||
if (cqe->rx_hashtype != 0 && (ndev->features & NETIF_F_RXHASH)) {
|
||||
if (cqe->rx_hashtype & MANA_HASH_L4)
|
||||
@@ -2957,6 +2956,9 @@ static void mana_destroy_rxq(struct mana_port_context *apc,
|
||||
if (xdp_rxq_info_is_reg(&rxq->xdp_rxq))
|
||||
xdp_rxq_info_unreg(&rxq->xdp_rxq);
|
||||
|
||||
if (xdp_rxq_info_is_reg(&rxq->xdp_rxq_shared))
|
||||
xdp_rxq_info_unreg(&rxq->xdp_rxq_shared);
|
||||
|
||||
if (rxq->rxobj != INVALID_MANA_HANDLE)
|
||||
mana_destroy_wq_obj(apc, GDMA_RQ, rxq->rxobj);
|
||||
|
||||
@@ -3241,6 +3243,12 @@ static struct mana_rxq *mana_create_rxq(struct mana_port_context *apc,
|
||||
WARN_ON(xdp_rxq_info_reg_mem_model(&rxq->xdp_rxq, MEM_TYPE_PAGE_POOL,
|
||||
rxq->page_pool));
|
||||
|
||||
/* The pre-allocated buffers (mana_pre_alloc_rxbufs) are plain pages */
|
||||
WARN_ON(xdp_rxq_info_reg(&rxq->xdp_rxq_shared, ndev, rxq_idx,
|
||||
cq->napi.napi_id));
|
||||
WARN_ON(xdp_rxq_info_reg_mem_model(&rxq->xdp_rxq_shared,
|
||||
MEM_TYPE_PAGE_SHARED, NULL));
|
||||
|
||||
/* Initialize the DIM work before enabling NAPI, so that a poll
|
||||
* cannot reach net_dim() with an uninitialized cq->dim.work.
|
||||
*/
|
||||
|
||||
@@ -5587,7 +5587,7 @@ static void stmmac_dispatch_skb_zc(struct stmmac_priv *priv, u32 queue,
|
||||
napi_gro_receive(&ch->rxtx_napi, skb);
|
||||
|
||||
u64_stats_update_begin(&rxq_stats->napi_syncp);
|
||||
u64_stats_inc(&rxq_stats->napi.rx_pkt_n);
|
||||
u64_stats_inc(&rxq_stats->napi.rx_packets);
|
||||
u64_stats_add(&rxq_stats->napi.rx_bytes, len);
|
||||
u64_stats_update_end(&rxq_stats->napi_syncp);
|
||||
}
|
||||
|
||||
@@ -277,6 +277,7 @@ const struct ptp_clock_info stmmac_ptp_clock_ops = {
|
||||
.n_per_out = 0, /* will be overwritten in stmmac_ptp_register */
|
||||
.n_pins = 0,
|
||||
.pps = 0,
|
||||
.supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
|
||||
.adjfine = stmmac_adjust_freq,
|
||||
.adjtime = stmmac_adjust_time,
|
||||
.gettimex64 = stmmac_get_timex,
|
||||
@@ -294,6 +295,7 @@ const struct ptp_clock_info dwmac1000_ptp_clock_ops = {
|
||||
.n_per_out = 0,
|
||||
.n_pins = 0,
|
||||
.pps = 0,
|
||||
.supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
|
||||
.adjfine = stmmac_adjust_freq,
|
||||
.adjtime = stmmac_adjust_time,
|
||||
.gettimex64 = stmmac_get_timex,
|
||||
|
||||
@@ -811,6 +811,28 @@ static struct ptp_clock_info am65_ptp_info = {
|
||||
.do_aux_work = am65_cpts_ts_work,
|
||||
};
|
||||
|
||||
/* The CPTS decodes the message type of an event using the PTPv2 header
|
||||
* layout. For PTPv1 that nibble is part of versionPTP and always reads 0,
|
||||
* while am65_skb_get_mtype_seqid() takes the message type from the PTPv1
|
||||
* control field. For PTPv1 take the message type from the skb, but keep
|
||||
* the event type, port number and sequence id of the event so that an
|
||||
* event only matches a packet of the same direction on the same port.
|
||||
*/
|
||||
static u32 am65_cpts_event_mtype_seqid(struct am65_cpts_event *event,
|
||||
u32 skb_mtype_seqid,
|
||||
unsigned int ptp_class)
|
||||
{
|
||||
u32 mtype_seqid = event->event1;
|
||||
|
||||
if (ptp_class & PTP_CLASS_V1) {
|
||||
mtype_seqid &= ~AM65_CPTS_EVENT_1_MESSAGE_TYPE_MASK;
|
||||
mtype_seqid |= skb_mtype_seqid &
|
||||
AM65_CPTS_EVENT_1_MESSAGE_TYPE_MASK;
|
||||
}
|
||||
|
||||
return mtype_seqid;
|
||||
}
|
||||
|
||||
static bool am65_cpts_match_tx_ts(struct am65_cpts *cpts,
|
||||
struct am65_cpts_event *event)
|
||||
{
|
||||
@@ -820,7 +842,6 @@ static bool am65_cpts_match_tx_ts(struct am65_cpts *cpts,
|
||||
bool found = false;
|
||||
u32 mtype_seqid;
|
||||
|
||||
mtype_seqid = event->event1;
|
||||
__skb_queue_head_init(&txq_list);
|
||||
|
||||
spin_lock_irqsave(&cpts->txq.lock, flags);
|
||||
@@ -833,11 +854,9 @@ static bool am65_cpts_match_tx_ts(struct am65_cpts *cpts,
|
||||
struct am65_cpts_skb_cb_data *skb_cb =
|
||||
(struct am65_cpts_skb_cb_data *)skb->cb;
|
||||
|
||||
if ((ptp_classify_raw(skb) & PTP_CLASS_V1) &&
|
||||
((mtype_seqid & AM65_CPTS_EVENT_1_SEQUENCE_ID_MASK) ==
|
||||
(skb_cb->skb_mtype_seqid & AM65_CPTS_EVENT_1_SEQUENCE_ID_MASK)))
|
||||
mtype_seqid = skb_cb->skb_mtype_seqid;
|
||||
|
||||
mtype_seqid = am65_cpts_event_mtype_seqid(event,
|
||||
skb_cb->skb_mtype_seqid,
|
||||
ptp_classify_raw(skb));
|
||||
if (mtype_seqid == skb_cb->skb_mtype_seqid) {
|
||||
u64 ns = event->timestamp;
|
||||
|
||||
|
||||
+14
-8
@@ -561,16 +561,19 @@ static int gtp0_handle_echo_resp(struct gtp_dev *gtp, struct sk_buff *skb)
|
||||
|
||||
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
|
||||
if (!msg)
|
||||
return -ENOMEM;
|
||||
return -1;
|
||||
|
||||
ret = gtp_genl_fill_echo(msg, 0, 0, 0, GTP_CMD_ECHOREQ, echo);
|
||||
if (ret < 0) {
|
||||
nlmsg_free(msg);
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return genlmsg_multicast_netns(>p_genl_family, dev_net(gtp->dev),
|
||||
msg, 0, GTP_GENL_MCGRP, GFP_ATOMIC);
|
||||
genlmsg_multicast_netns(>p_genl_family, dev_net(gtp->dev),
|
||||
msg, 0, GTP_GENL_MCGRP, GFP_ATOMIC);
|
||||
consume_skb(skb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gtp_proto_to_family(__u16 proto)
|
||||
@@ -748,16 +751,19 @@ static int gtp1u_handle_echo_resp(struct gtp_dev *gtp, struct sk_buff *skb)
|
||||
|
||||
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
|
||||
if (!msg)
|
||||
return -ENOMEM;
|
||||
return -1;
|
||||
|
||||
ret = gtp_genl_fill_echo(msg, 0, 0, 0, GTP_CMD_ECHOREQ, echo);
|
||||
if (ret < 0) {
|
||||
nlmsg_free(msg);
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return genlmsg_multicast_netns(>p_genl_family, dev_net(gtp->dev),
|
||||
msg, 0, GTP_GENL_MCGRP, GFP_ATOMIC);
|
||||
genlmsg_multicast_netns(>p_genl_family, dev_net(gtp->dev),
|
||||
msg, 0, GTP_GENL_MCGRP, GFP_ATOMIC);
|
||||
consume_skb(skb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gtp_parse_exthdrs(struct sk_buff *skb, unsigned int *hdrlen)
|
||||
|
||||
@@ -401,12 +401,12 @@ static inline void *rndis_get_ppi(struct net_device *ndev,
|
||||
/* Validate ppi_offset and ppi_size */
|
||||
if (ppi->size > len) {
|
||||
netdev_err(ndev, "Invalid ppi size: %u\n", ppi->size);
|
||||
continue;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ppi->ppi_offset >= ppi->size) {
|
||||
netdev_err(ndev, "Invalid ppi_offset: %u\n", ppi->ppi_offset);
|
||||
continue;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ppi->type == type && ppi->internal == internal) {
|
||||
@@ -414,7 +414,7 @@ static inline void *rndis_get_ppi(struct net_device *ndev,
|
||||
if (ppi->size - ppi->ppi_offset < ppi_size) {
|
||||
netdev_err(ndev, "Invalid ppi: size %u ppi_offset %u\n",
|
||||
ppi->size, ppi->ppi_offset);
|
||||
continue;
|
||||
return NULL;
|
||||
}
|
||||
return (void *)((ulong)ppi + ppi->ppi_offset);
|
||||
}
|
||||
|
||||
@@ -438,7 +438,8 @@ static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb)
|
||||
.flowi4_mark = skb->mark,
|
||||
};
|
||||
|
||||
if (!pskb_network_may_pull(skb, sizeof(struct iphdr)))
|
||||
if (!pskb_network_may_pull(skb, sizeof(struct iphdr)) ||
|
||||
skb_cow_head(skb, 0))
|
||||
goto err;
|
||||
|
||||
ip4h = ip_hdr(skb);
|
||||
@@ -504,7 +505,8 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
|
||||
struct net_device *dev = skb->dev;
|
||||
int err, ret = NET_XMIT_DROP;
|
||||
|
||||
if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr))) {
|
||||
if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr)) ||
|
||||
skb_cow_head(skb, 0)) {
|
||||
DEV_STATS_INC(dev, tx_errors);
|
||||
kfree_skb(skb);
|
||||
return ret;
|
||||
|
||||
+10
-5
@@ -408,8 +408,10 @@ static bool macsec_validate_skb(struct sk_buff *skb, u16 icv_len, bool xpn)
|
||||
int len = skb->len - 2 * ETH_ALEN;
|
||||
int extra_len = macsec_extra_len(!!(h->tci_an & MACSEC_TCI_SC)) + icv_len;
|
||||
|
||||
/* a) It comprises at least 17 octets */
|
||||
if (skb->len <= 16)
|
||||
/* a) It comprises at least 17 octets. The SecTAG and ICV must
|
||||
* also leave a complete Ethernet header.
|
||||
*/
|
||||
if (skb->len < ETH_HLEN + extra_len)
|
||||
return false;
|
||||
|
||||
/* b) MACsec EtherType: already checked */
|
||||
@@ -1331,9 +1333,12 @@ drop_direct:
|
||||
nosci:
|
||||
/* 10.6.1 if the SC is not found */
|
||||
cbit = !!(hdr->tci_an & MACSEC_TCI_C);
|
||||
if (!cbit)
|
||||
macsec_finalize_skb(skb, MACSEC_DEFAULT_ICV_LEN,
|
||||
macsec_extra_len(macsec_skb_cb(skb)->has_sci));
|
||||
if (!cbit) {
|
||||
len = macsec_extra_len(macsec_skb_cb(skb)->has_sci);
|
||||
if (skb->len < ETH_HLEN + len + MACSEC_DEFAULT_ICV_LEN)
|
||||
goto drop_nosc;
|
||||
macsec_finalize_skb(skb, MACSEC_DEFAULT_ICV_LEN, len);
|
||||
}
|
||||
|
||||
list_for_each_entry_rcu(macsec, &rxd->secys, secys) {
|
||||
struct sk_buff *nskb;
|
||||
|
||||
@@ -104,6 +104,36 @@ int genphy_c45_pma_baset1_setup_master_slave(struct phy_device *phydev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(genphy_c45_pma_baset1_setup_master_slave);
|
||||
|
||||
/* Type selection value for the BASE-T1 PMA/PMD control register (1.2100,
|
||||
* 802.3-2022 Table 45-178) matching the forced speed. 10 Mbit/s is ambiguous
|
||||
* between 10BASE-T1L and 10BASE-T1S, so the supported link modes decide.
|
||||
* 2.5G, 5G and 10GBASE-T1 are not handled as there are no link modes for them
|
||||
* yet.
|
||||
*/
|
||||
static int genphy_c45_baset1_type_sel(struct phy_device *phydev)
|
||||
{
|
||||
switch (phydev->speed) {
|
||||
case SPEED_10:
|
||||
if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT,
|
||||
phydev->supported))
|
||||
return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1L;
|
||||
if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_Full_BIT,
|
||||
phydev->supported) ||
|
||||
linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_Half_BIT,
|
||||
phydev->supported) ||
|
||||
linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT,
|
||||
phydev->supported))
|
||||
return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1S;
|
||||
return -EINVAL;
|
||||
case SPEED_100:
|
||||
return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_100BT1;
|
||||
case SPEED_1000:
|
||||
return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_1000BT1;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* genphy_c45_pma_setup_forced - configures a forced speed
|
||||
* @phydev: target phy_device struct
|
||||
@@ -166,6 +196,16 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Resolve the type before the first write, so a speed without a
|
||||
* matching type leaves the PHY untouched.
|
||||
*/
|
||||
bt1_ctrl = 0;
|
||||
if (genphy_c45_baset1_able(phydev)) {
|
||||
bt1_ctrl = genphy_c45_baset1_type_sel(phydev);
|
||||
if (bt1_ctrl < 0)
|
||||
return bt1_ctrl;
|
||||
}
|
||||
|
||||
ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL1, ctrl1);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -179,12 +219,8 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
bt1_ctrl = 0;
|
||||
if (phydev->speed == SPEED_1000)
|
||||
bt1_ctrl = MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000;
|
||||
|
||||
ret = phy_modify_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_PMD_BT1_CTRL,
|
||||
MDIO_PMA_PMD_BT1_CTRL_STRAP, bt1_ctrl);
|
||||
MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL, bt1_ctrl);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1365,11 +1365,8 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
|
||||
/* set allmulti level to new slave */
|
||||
if (dev->flags & IFF_ALLMULTI) {
|
||||
err = dev_set_allmulti(port_dev, 1);
|
||||
if (err) {
|
||||
if (dev->flags & IFF_PROMISC)
|
||||
dev_set_promiscuity(port_dev, -1);
|
||||
if (err)
|
||||
goto err_set_slave_allmulti;
|
||||
}
|
||||
}
|
||||
|
||||
err = team_dev_type_check_change(dev, port_dev);
|
||||
@@ -1397,7 +1394,11 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
|
||||
return 0;
|
||||
|
||||
err_set_dev_type:
|
||||
if (dev->flags & IFF_ALLMULTI)
|
||||
dev_set_allmulti(port_dev, -1);
|
||||
err_set_slave_allmulti:
|
||||
if (dev->flags & IFF_PROMISC)
|
||||
dev_set_promiscuity(port_dev, -1);
|
||||
err_set_slave_promisc:
|
||||
__team_option_inst_del_port(team, port);
|
||||
|
||||
|
||||
+18
-3
@@ -615,7 +615,7 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
|
||||
}
|
||||
|
||||
synchronize_net();
|
||||
tun_flow_delete_by_queue(tun, tun->numqueues + 1);
|
||||
tun_flow_delete_by_queue(tun, tun->numqueues);
|
||||
/* Drop read queue */
|
||||
tun_queue_purge(tfile);
|
||||
spin_lock_bh(&ntfile->tx_ring.consumer_lock);
|
||||
@@ -1500,6 +1500,12 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile,
|
||||
if (!skb)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
/* An skb recycled by napi_reuse_skb() keeps the protocol of a
|
||||
* previous frame. eth_type_trans() sets it after the virtio
|
||||
* header checks, which must not see a stale one.
|
||||
*/
|
||||
skb->protocol = 0;
|
||||
|
||||
linear = iov_iter_single_seg_count(it);
|
||||
err = __skb_grow(skb, linear);
|
||||
if (err)
|
||||
@@ -1944,7 +1950,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
|
||||
break;
|
||||
}
|
||||
|
||||
if (tun_vnet_hdr_tnl_to_skb(tun->flags, features, skb, &hdr)) {
|
||||
if (tun_vnet_hdr_tnl_to_skb(tun->flags, features, skb, &hdr,
|
||||
(tun->flags & TUN_TYPE_MASK) == IFF_TAP)) {
|
||||
atomic_long_inc(&tun->rx_frame_errors);
|
||||
err = -EINVAL;
|
||||
goto free_skb;
|
||||
@@ -2621,7 +2628,11 @@ build:
|
||||
tnl_hdr = (struct virtio_net_hdr_v1_hash_tunnel *)gso;
|
||||
skb->dev = tun->dev;
|
||||
skb_set_network_header(skb, ETH_HLEN);
|
||||
if (tun_vnet_hdr_tnl_to_skb(tun->flags, features, skb, tnl_hdr)) {
|
||||
/* Frames always start with an Ethernet header here, as the
|
||||
* eth_type_trans() call below expects.
|
||||
*/
|
||||
if (tun_vnet_hdr_tnl_to_skb(tun->flags, features, skb, tnl_hdr,
|
||||
true)) {
|
||||
atomic_long_inc(&tun->rx_frame_errors);
|
||||
kfree_skb(skb);
|
||||
ret = -EINVAL;
|
||||
@@ -3362,6 +3373,10 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
|
||||
netif_info(tun, drv, tun->dev,
|
||||
"Linktype set failed because interface is up\n");
|
||||
ret = -EBUSY;
|
||||
} else if ((unsigned short)arg == ARPHRD_IEEE802154 ||
|
||||
(unsigned short)arg == ARPHRD_IEEE802154_MONITOR ||
|
||||
(unsigned short)arg == ARPHRD_6LOWPAN) {
|
||||
ret = -EINVAL;
|
||||
} else {
|
||||
ret = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE,
|
||||
tun->dev);
|
||||
|
||||
@@ -197,9 +197,10 @@ static inline netdev_features_t tun_vnet_hdr_guest_features(int vnet_hdr_sz)
|
||||
static inline int
|
||||
tun_vnet_hdr_tnl_to_skb(unsigned int flags, netdev_features_t features,
|
||||
struct sk_buff *skb,
|
||||
const struct virtio_net_hdr_v1_hash_tunnel *hdr)
|
||||
const struct virtio_net_hdr_v1_hash_tunnel *hdr,
|
||||
bool has_eth)
|
||||
{
|
||||
return virtio_net_hdr_tnl_to_skb(skb, hdr,
|
||||
return virtio_net_hdr_tnl_to_skb(skb, hdr, has_eth,
|
||||
features & NETIF_F_GSO_UDP_TUNNEL,
|
||||
features & NETIF_F_GSO_UDP_TUNNEL_CSUM,
|
||||
tun_vnet_is_little_endian(flags));
|
||||
|
||||
@@ -1125,7 +1125,7 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm_ndp16(struct cdc_ncm_ctx *ctx, struct s
|
||||
cdc_ncm_align_tail(skb, ctx->tx_ndp_modulus, 0, ctx->tx_curr_size);
|
||||
|
||||
/* verify that there is room for the NDP and the datagram (reserve) */
|
||||
if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size)
|
||||
if (skb->len + reserve + ctx->max_ndp_size > ctx->tx_curr_size)
|
||||
return NULL;
|
||||
|
||||
/* link to it */
|
||||
@@ -1180,7 +1180,7 @@ static struct usb_cdc_ncm_ndp32 *cdc_ncm_ndp32(struct cdc_ncm_ctx *ctx, struct s
|
||||
cdc_ncm_align_tail(skb, ctx->tx_ndp_modulus, 0, ctx->tx_curr_size);
|
||||
|
||||
/* verify that there is room for the NDP and the datagram (reserve) */
|
||||
if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size)
|
||||
if (skb->len + reserve + ctx->max_ndp_size > ctx->tx_curr_size)
|
||||
return NULL;
|
||||
|
||||
/* link to it */
|
||||
|
||||
@@ -4593,13 +4593,12 @@ static void lan78xx_disconnect(struct usb_interface *intf)
|
||||
|
||||
net = dev->net;
|
||||
|
||||
unregister_netdev(net);
|
||||
|
||||
rtnl_lock();
|
||||
phylink_stop(dev->phylink);
|
||||
phylink_disconnect_phy(dev->phylink);
|
||||
rtnl_unlock();
|
||||
|
||||
unregister_netdev(net);
|
||||
|
||||
timer_shutdown_sync(&dev->stat_monitor);
|
||||
set_bit(EVENT_DEV_DISCONNECT, &dev->flags);
|
||||
cancel_delayed_work_sync(&dev->wq);
|
||||
@@ -5371,6 +5370,12 @@ static int lan78xx_resume(struct usb_interface *intf)
|
||||
out:
|
||||
mutex_unlock(&dev->dev_mutex);
|
||||
|
||||
if (!ret && dev_open) {
|
||||
rtnl_lock();
|
||||
phylink_resume(dev->phylink);
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5385,15 +5390,7 @@ static int lan78xx_reset_resume(struct usb_interface *intf)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = lan78xx_resume(intf);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
rtnl_lock();
|
||||
phylink_resume(dev->phylink);
|
||||
rtnl_unlock();
|
||||
|
||||
return 0;
|
||||
return lan78xx_resume(intf);
|
||||
}
|
||||
|
||||
static const struct usb_device_id products[] = {
|
||||
|
||||
@@ -2533,7 +2533,7 @@ static void virtnet_receive_done(struct virtnet_info *vi, struct receive_queue *
|
||||
|
||||
skb->dev = dev;
|
||||
skb_set_network_header(skb, ETH_HLEN);
|
||||
if (virtio_net_hdr_tnl_to_skb(skb, &hdr->tnl_hdr, vi->rx_tnl,
|
||||
if (virtio_net_hdr_tnl_to_skb(skb, &hdr->tnl_hdr, true, vi->rx_tnl,
|
||||
vi->rx_tnl_csum,
|
||||
virtio_is_little_endian(vi->vdev))) {
|
||||
net_warn_ratelimited("%s: bad gso: type: %x, size: %u, flags %x tunnel %d tnl csum %d\n",
|
||||
|
||||
@@ -2985,6 +2985,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
|
||||
clear_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags);
|
||||
|
||||
ar->running_fw = fw;
|
||||
ar->thermal.broken = false;
|
||||
|
||||
if (!test_bit(ATH10K_FW_FEATURE_NON_BMI,
|
||||
ar->running_fw->fw_file.fw_features)) {
|
||||
|
||||
@@ -75,6 +75,12 @@ static ssize_t ath10k_thermal_show_temp(struct device *dev,
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Don't stall every read on firmware that never answers */
|
||||
if (ar->thermal.broken) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto out;
|
||||
}
|
||||
|
||||
reinit_completion(&ar->thermal.wmi_sync);
|
||||
ret = ath10k_wmi_pdev_get_temperature(ar);
|
||||
if (ret) {
|
||||
@@ -90,7 +96,8 @@ static ssize_t ath10k_thermal_show_temp(struct device *dev,
|
||||
time_left = wait_for_completion_timeout(&ar->thermal.wmi_sync,
|
||||
ATH10K_THERMAL_SYNC_TIMEOUT_HZ);
|
||||
if (!time_left) {
|
||||
ath10k_warn(ar, "failed to synchronize thermal read\n");
|
||||
ath10k_warn(ar, "failed to synchronize thermal read, not asking again until the firmware restarts\n");
|
||||
ar->thermal.broken = true;
|
||||
ret = -ETIMEDOUT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ struct ath10k_thermal {
|
||||
/* protected by conf_mutex */
|
||||
u32 throttle_state;
|
||||
u32 quiet_period;
|
||||
/* the running firmware did not answer a temperature request */
|
||||
bool broken;
|
||||
/* temperature value in Celsius degree
|
||||
* protected by data_lock
|
||||
*/
|
||||
|
||||
@@ -602,8 +602,8 @@ static int ath12k_ahb_ext_grp_napi_poll(struct napi_struct *napi, int budget)
|
||||
|
||||
work_done = ath12k_dp_service_srng(dp, irq_grp, budget);
|
||||
if (work_done < budget) {
|
||||
napi_complete_done(napi, work_done);
|
||||
ath12k_ahb_ext_grp_enable(irq_grp);
|
||||
if (likely(napi_complete_done(napi, work_done)))
|
||||
ath12k_ahb_ext_grp_enable(irq_grp);
|
||||
}
|
||||
|
||||
if (work_done > budget)
|
||||
@@ -619,9 +619,10 @@ static irqreturn_t ath12k_ahb_ext_interrupt_handler(int irq, void *arg)
|
||||
/* last interrupt received for this group */
|
||||
irq_grp->timestamp = jiffies;
|
||||
|
||||
ath12k_ahb_ext_grp_disable(irq_grp);
|
||||
|
||||
napi_schedule(&irq_grp->napi);
|
||||
if (napi_schedule_prep(&irq_grp->napi)) {
|
||||
ath12k_ahb_ext_grp_disable(irq_grp);
|
||||
__napi_schedule(&irq_grp->napi);
|
||||
}
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
@@ -2062,7 +2062,8 @@ exit:
|
||||
goto invalid_group;
|
||||
}
|
||||
|
||||
ab->device_id = ag->num_probed++;
|
||||
ag->num_probed++;
|
||||
ab->device_id = wsi->index;
|
||||
ag->ab[ab->device_id] = ab;
|
||||
ab->ag = ag;
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ ath12k_dp_mon_fill_rx_rate(struct ath12k_pdev_dp *dp_pdev,
|
||||
}
|
||||
|
||||
static void ath12k_dp_mon_rx_msdus_set_payload(struct ath12k_base *ab,
|
||||
struct sk_buff *head_msdu,
|
||||
struct sk_buff *msdu,
|
||||
struct sk_buff *tail_msdu)
|
||||
{
|
||||
u32 rx_pkt_offset, l2_hdr_offset, total_offset;
|
||||
@@ -200,7 +200,7 @@ static void ath12k_dp_mon_rx_msdus_set_payload(struct ath12k_base *ab,
|
||||
else
|
||||
total_offset = rx_pkt_offset + l2_hdr_offset;
|
||||
|
||||
skb_pull(head_msdu, total_offset);
|
||||
skb_pull(msdu, total_offset);
|
||||
}
|
||||
|
||||
struct sk_buff *
|
||||
@@ -261,7 +261,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k_pdev_dp *dp_pdev,
|
||||
head_frag_list = NULL;
|
||||
|
||||
while (msdu) {
|
||||
ath12k_dp_mon_rx_msdus_set_payload(ab, head_msdu, tail_msdu);
|
||||
ath12k_dp_mon_rx_msdus_set_payload(ab, msdu, tail_msdu);
|
||||
|
||||
if (!head_frag_list)
|
||||
head_frag_list = msdu;
|
||||
@@ -296,7 +296,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k_pdev_dp *dp_pdev,
|
||||
msdu = head_msdu;
|
||||
|
||||
while (msdu) {
|
||||
ath12k_dp_mon_rx_msdus_set_payload(ab, head_msdu, tail_msdu);
|
||||
ath12k_dp_mon_rx_msdus_set_payload(ab, msdu, tail_msdu);
|
||||
if (qos_pkt) {
|
||||
dest = skb_push(msdu, sizeof(__le16));
|
||||
if (!dest)
|
||||
|
||||
@@ -3366,6 +3366,7 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar,
|
||||
u32 *rx_mcs, *tx_mcs;
|
||||
u16 *eht_mcs_mask;
|
||||
u8 max_nss = 0;
|
||||
u8 mcs15;
|
||||
|
||||
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
|
||||
|
||||
@@ -3416,6 +3417,16 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar,
|
||||
memcpy(arg->peer_eht_cap_phy, eht_cap->eht_cap_elem.phy_cap_info,
|
||||
sizeof(eht_cap->eht_cap_elem.phy_cap_info));
|
||||
|
||||
/*
|
||||
* Firmware rate control enables EHT-MCS15 based only on the peer's
|
||||
* MCS15 support bits, so keep only the ones we support ourselves.
|
||||
*/
|
||||
mcs15 = u8_get_bits(eht_cap->eht_cap_elem.phy_cap_info[6] &
|
||||
own_eht_cap->eht_cap_elem.phy_cap_info[6],
|
||||
IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK);
|
||||
u8p_replace_bits(&((u8 *)arg->peer_eht_cap_phy)[6], mcs15,
|
||||
IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK);
|
||||
|
||||
rx_mcs = arg->peer_eht_rx_mcs_set;
|
||||
tx_mcs = arg->peer_eht_tx_mcs_set;
|
||||
|
||||
@@ -7845,7 +7856,7 @@ int ath12k_mac_op_sta_state(struct ieee80211_hw *hw,
|
||||
ath12k_hw_warn(ah, "failed to verify assoc link setting with link id %u\n",
|
||||
link_id);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
goto free_unassign_link;
|
||||
}
|
||||
|
||||
arsta->is_assoc_link = true;
|
||||
@@ -7903,7 +7914,7 @@ int ath12k_mac_op_sta_state(struct ieee80211_hw *hw,
|
||||
|
||||
if (old_state == IEEE80211_STA_NOTEXIST &&
|
||||
new_state == IEEE80211_STA_NONE)
|
||||
goto peer_delete;
|
||||
goto free_unassign_link;
|
||||
else
|
||||
goto exit;
|
||||
}
|
||||
@@ -7943,6 +7954,8 @@ int ath12k_mac_op_sta_state(struct ieee80211_hw *hw,
|
||||
ret = 0;
|
||||
goto exit;
|
||||
|
||||
free_unassign_link:
|
||||
ath12k_mac_free_unassign_link_sta(ah, ahsta, link_id);
|
||||
peer_delete:
|
||||
ath12k_dp_peer_delete(&ah->dp_hw, sta->addr, sta);
|
||||
ml_peer_id_clear:
|
||||
|
||||
@@ -402,32 +402,32 @@ static void ath12k_hal_extract_rx_desc_data_qcc2072(struct hal_rx_desc_data *rx_
|
||||
rx_desc_data->is_last_msdu = ath12k_hal_rx_desc_get_last_msdu_qcc2072(ldesc);
|
||||
rx_desc_data->l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_qcc2072(ldesc);
|
||||
rx_desc_data->enctype = ath12k_hal_rx_desc_get_encrypt_type_qcc2072(rx_desc);
|
||||
rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_qcc2072(rx_desc);
|
||||
rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_qcc2072(ldesc);
|
||||
rx_desc_data->mesh_ctrl_present =
|
||||
ath12k_hal_rx_desc_get_mesh_ctl_qcc2072(rx_desc);
|
||||
ath12k_hal_rx_desc_get_mesh_ctl_qcc2072(ldesc);
|
||||
rx_desc_data->seq_ctl_valid =
|
||||
ath12k_hal_rx_desc_get_mpdu_seq_ctl_vld_qcc2072(rx_desc);
|
||||
rx_desc_data->fc_valid = ath12k_hal_rx_desc_get_mpdu_fc_valid_qcc2072(rx_desc);
|
||||
rx_desc_data->seq_no = ath12k_hal_rx_desc_get_mpdu_start_seq_no_qcc2072(rx_desc);
|
||||
rx_desc_data->msdu_len = ath12k_hal_rx_desc_get_msdu_len_qcc2072(ldesc);
|
||||
rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_qcc2072(rx_desc);
|
||||
rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_qcc2072(rx_desc);
|
||||
rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_qcc2072(rx_desc);
|
||||
rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_qcc2072(rx_desc);
|
||||
rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_qcc2072(rx_desc);
|
||||
rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_qcc2072(rx_desc);
|
||||
rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_qcc2072(rx_desc);
|
||||
rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_qcc2072(rx_desc));
|
||||
rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_qcc2072(ldesc);
|
||||
rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_qcc2072(ldesc);
|
||||
rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_qcc2072(ldesc);
|
||||
rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_qcc2072(ldesc);
|
||||
rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_qcc2072(ldesc);
|
||||
rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_qcc2072(ldesc);
|
||||
rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_qcc2072(ldesc);
|
||||
rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_qcc2072(ldesc));
|
||||
rx_desc_data->tid = ath12k_hal_rx_desc_get_mpdu_tid_qcc2072(rx_desc);
|
||||
rx_desc_data->peer_id = ath12k_hal_rx_desc_get_mpdu_peer_id_qcc2072(rx_desc);
|
||||
rx_desc_data->addr2_present = ath12k_hal_rx_desc_mac_addr2_valid_qcc2072(rx_desc);
|
||||
rx_desc_data->addr2 = ath12k_hal_rx_desc_mpdu_start_addr2_qcc2072(rx_desc);
|
||||
rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_qcc2072(rx_desc);
|
||||
rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_qcc2072(ldesc);
|
||||
rx_desc_data->msdu_done = ath12k_hal_rx_h_msdu_done_qcc2072(ldesc);
|
||||
rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_qcc2072(rx_desc);
|
||||
rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_qcc2072(rx_desc);
|
||||
rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_qcc2072(rx_desc);
|
||||
rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_qcc2072(rx_desc);
|
||||
rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_qcc2072(ldesc);
|
||||
rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_qcc2072(ldesc);
|
||||
rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_qcc2072(ldesc);
|
||||
rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_qcc2072(ldesc);
|
||||
}
|
||||
|
||||
static int ath12k_hal_srng_create_config_qcc2072(struct ath12k_hal *hal)
|
||||
|
||||
@@ -922,32 +922,32 @@ void ath12k_hal_extract_rx_desc_data_qcn9274(struct hal_rx_desc_data *rx_desc_da
|
||||
rx_desc_data->is_last_msdu = ath12k_hal_rx_desc_get_last_msdu_qcn9274(ldesc);
|
||||
rx_desc_data->l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_qcn9274(ldesc);
|
||||
rx_desc_data->enctype = ath12k_hal_rx_desc_get_encrypt_type_qcn9274(rx_desc);
|
||||
rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_qcn9274(rx_desc);
|
||||
rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_qcn9274(ldesc);
|
||||
rx_desc_data->mesh_ctrl_present =
|
||||
ath12k_hal_rx_desc_get_mesh_ctl_qcn9274(rx_desc);
|
||||
ath12k_hal_rx_desc_get_mesh_ctl_qcn9274(ldesc);
|
||||
rx_desc_data->seq_ctl_valid =
|
||||
ath12k_hal_rx_desc_get_mpdu_seq_ctl_vld_qcn9274(rx_desc);
|
||||
rx_desc_data->fc_valid = ath12k_hal_rx_desc_get_mpdu_fc_valid_qcn9274(rx_desc);
|
||||
rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_qcn9274(rx_desc);
|
||||
rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_qcn9274(rx_desc);
|
||||
rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_qcn9274(ldesc);
|
||||
rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_qcn9274(ldesc);
|
||||
rx_desc_data->seq_no = ath12k_hal_rx_desc_get_mpdu_start_seq_no_qcn9274(rx_desc);
|
||||
rx_desc_data->msdu_len = ath12k_hal_rx_desc_get_msdu_len_qcn9274(ldesc);
|
||||
rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_qcn9274(rx_desc);
|
||||
rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_qcn9274(rx_desc);
|
||||
rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_qcn9274(rx_desc);
|
||||
rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_qcn9274(rx_desc);
|
||||
rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_qcn9274(rx_desc);
|
||||
rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_qcn9274(rx_desc));
|
||||
rx_desc_data->tid = ath12k_hal_rx_desc_get_mpdu_tid_qcn9274(rx_desc);
|
||||
rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_qcn9274(ldesc);
|
||||
rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_qcn9274(ldesc);
|
||||
rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_qcn9274(ldesc);
|
||||
rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_qcn9274(ldesc);
|
||||
rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_qcn9274(ldesc);
|
||||
rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_qcn9274(ldesc));
|
||||
rx_desc_data->tid = ath12k_hal_rx_desc_get_mpdu_tid_qcn9274(ldesc);
|
||||
rx_desc_data->peer_id = ath12k_hal_rx_desc_get_mpdu_peer_id_qcn9274(rx_desc);
|
||||
rx_desc_data->addr2_present = ath12k_hal_rx_desc_mac_addr2_valid_qcn9274(rx_desc);
|
||||
rx_desc_data->addr2 = ath12k_hal_rx_desc_mpdu_start_addr2_qcn9274(rx_desc);
|
||||
rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_qcn9274(rx_desc);
|
||||
rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_qcn9274(ldesc);
|
||||
rx_desc_data->msdu_done = ath12k_hal_rx_h_msdu_done_qcn9274(ldesc);
|
||||
rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_qcn9274(rx_desc);
|
||||
rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_qcn9274(rx_desc);
|
||||
rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_qcn9274(rx_desc);
|
||||
rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_qcn9274(rx_desc);
|
||||
rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_qcn9274(ldesc);
|
||||
rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_qcn9274(ldesc);
|
||||
rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_qcn9274(ldesc);
|
||||
rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_qcn9274(ldesc);
|
||||
}
|
||||
|
||||
static u16 ath12k_hal_reo_status_dec_tlv_hdr_qcn9274(void *tlv, void **desc)
|
||||
|
||||
@@ -604,32 +604,32 @@ void ath12k_hal_extract_rx_desc_data_wcn7850(struct hal_rx_desc_data *rx_desc_da
|
||||
rx_desc_data->is_last_msdu = ath12k_hal_rx_desc_get_last_msdu_wcn7850(ldesc);
|
||||
rx_desc_data->l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_wcn7850(ldesc);
|
||||
rx_desc_data->enctype = ath12k_hal_rx_desc_get_encrypt_type_wcn7850(rx_desc);
|
||||
rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_wcn7850(rx_desc);
|
||||
rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_wcn7850(ldesc);
|
||||
rx_desc_data->mesh_ctrl_present =
|
||||
ath12k_hal_rx_desc_get_mesh_ctl_wcn7850(rx_desc);
|
||||
ath12k_hal_rx_desc_get_mesh_ctl_wcn7850(ldesc);
|
||||
rx_desc_data->seq_ctl_valid =
|
||||
ath12k_hal_rx_desc_get_mpdu_seq_ctl_vld_wcn7850(rx_desc);
|
||||
rx_desc_data->fc_valid = ath12k_hal_rx_desc_get_mpdu_fc_valid_wcn7850(rx_desc);
|
||||
rx_desc_data->seq_no = ath12k_hal_rx_desc_get_mpdu_start_seq_no_wcn7850(rx_desc);
|
||||
rx_desc_data->msdu_len = ath12k_hal_rx_desc_get_msdu_len_wcn7850(ldesc);
|
||||
rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_wcn7850(rx_desc);
|
||||
rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_wcn7850(rx_desc);
|
||||
rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_wcn7850(rx_desc);
|
||||
rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_wcn7850(rx_desc);
|
||||
rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_wcn7850(rx_desc);
|
||||
rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_wcn7850(rx_desc);
|
||||
rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_wcn7850(rx_desc);
|
||||
rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_wcn7850(rx_desc));
|
||||
rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_wcn7850(ldesc);
|
||||
rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_wcn7850(ldesc);
|
||||
rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_wcn7850(ldesc);
|
||||
rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_wcn7850(ldesc);
|
||||
rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_wcn7850(ldesc);
|
||||
rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_wcn7850(ldesc);
|
||||
rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_wcn7850(ldesc);
|
||||
rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_wcn7850(ldesc));
|
||||
rx_desc_data->tid = ath12k_hal_rx_desc_get_mpdu_tid_wcn7850(rx_desc);
|
||||
rx_desc_data->peer_id = ath12k_hal_rx_desc_get_mpdu_peer_id_wcn7850(rx_desc);
|
||||
rx_desc_data->addr2_present = ath12k_hal_rx_desc_mac_addr2_valid_wcn7850(rx_desc);
|
||||
rx_desc_data->addr2 = ath12k_hal_rx_desc_mpdu_start_addr2_wcn7850(rx_desc);
|
||||
rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_wcn7850(rx_desc);
|
||||
rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_wcn7850(ldesc);
|
||||
rx_desc_data->msdu_done = ath12k_hal_rx_h_msdu_done_wcn7850(ldesc);
|
||||
rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_wcn7850(rx_desc);
|
||||
rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_wcn7850(rx_desc);
|
||||
rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_wcn7850(rx_desc);
|
||||
rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_wcn7850(rx_desc);
|
||||
rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_wcn7850(ldesc);
|
||||
rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_wcn7850(ldesc);
|
||||
rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_wcn7850(ldesc);
|
||||
rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_wcn7850(ldesc);
|
||||
}
|
||||
|
||||
int ath12k_hal_srng_create_config_wcn7850(struct ath12k_hal *hal)
|
||||
|
||||
@@ -1098,11 +1098,8 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
|
||||
|
||||
ath9k_htc_set_opmode(priv);
|
||||
|
||||
if ((priv->ah->opmode == NL80211_IFTYPE_AP) &&
|
||||
!test_bit(ATH_OP_ANI_RUN, &common->op_flags)) {
|
||||
if (priv->ah->opmode == NL80211_IFTYPE_AP)
|
||||
ath9k_hw_set_tsfadjust(priv->ah, true);
|
||||
ath9k_htc_start_ani(priv);
|
||||
}
|
||||
|
||||
ath_dbg(common, CONFIG, "Attach a VIF of type: %d at idx: %d\n",
|
||||
vif->type, avp->index);
|
||||
@@ -1554,6 +1551,9 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
|
||||
ath9k_htc_set_tsfadjust(priv, vif);
|
||||
priv->cur_beacon_conf.enable_beacon = 1;
|
||||
ath9k_htc_beacon_config(priv, vif);
|
||||
if (priv->ah->opmode == NL80211_IFTYPE_AP &&
|
||||
!test_bit(ATH_OP_ANI_RUN, &common->op_flags))
|
||||
ath9k_htc_start_ani(priv);
|
||||
}
|
||||
|
||||
if ((changed & BSS_CHANGED_BEACON_ENABLED) && !bss_conf->enable_beacon) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
debugfs driver debugging code
|
||||
|
||||
Copyright (c) 2005-2007 Michael Buesch <m@bues.ch>
|
||||
Copyright (c) 2005-2007 Michael Buesch
|
||||
|
||||
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
DMA ringbuffer and descriptor allocation/management
|
||||
|
||||
Copyright (c) 2005, 2006 Michael Buesch <m@bues.ch>
|
||||
Copyright (c) 2005, 2006 Michael Buesch
|
||||
|
||||
Some code in this file is derived from the b44.c driver
|
||||
Copyright (C) 2002 David S. Miller
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
|
||||
Copyright (c) 2005 Stefano Brivio <stefano.brivio@polimi.it>
|
||||
Copyright (c) 2005-2007 Michael Buesch <m@bues.ch>
|
||||
Copyright (c) 2005-2007 Michael Buesch
|
||||
Copyright (c) 2005 Danny van Dyk <kugelfang@gentoo.org>
|
||||
Copyright (c) 2005 Andreas Jaggi <andreas.jaggi@waterwave.ch>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
|
||||
Copyright (c) 2005, 2006 Stefano Brivio <stefano.brivio@polimi.it>
|
||||
Copyright (c) 2005-2007 Michael Buesch <m@bues.ch>
|
||||
Copyright (c) 2005-2007 Michael Buesch
|
||||
Copyright (c) 2005, 2006 Danny van Dyk <kugelfang@gentoo.org>
|
||||
Copyright (c) 2005, 2006 Andreas Jaggi <andreas.jaggi@waterwave.ch>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>
|
||||
Copyright (c) 2005 Stefano Brivio <stefano.brivio@polimi.it>
|
||||
Copyright (c) 2005-2009 Michael Buesch <m@bues.ch>
|
||||
Copyright (c) 2005-2009 Michael Buesch
|
||||
Copyright (c) 2005 Danny van Dyk <kugelfang@gentoo.org>
|
||||
Copyright (c) 2005 Andreas Jaggi <andreas.jaggi@waterwave.ch>
|
||||
Copyright (c) 2010-2011 Rafał Miłecki <zajec5@gmail.com>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
|
||||
Stefano Brivio <stefano.brivio@polimi.it>
|
||||
Michael Buesch <m@bues.ch>
|
||||
Michael Buesch
|
||||
Danny van Dyk <kugelfang@gentoo.org>
|
||||
Andreas Jaggi <andreas.jaggi@waterwave.ch>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
|
||||
Copyright (c) 2005-2007 Stefano Brivio <stefano.brivio@polimi.it>
|
||||
Copyright (c) 2005-2008 Michael Buesch <m@bues.ch>
|
||||
Copyright (c) 2005-2008 Michael Buesch
|
||||
Copyright (c) 2005, 2006 Danny van Dyk <kugelfang@gentoo.org>
|
||||
Copyright (c) 2005, 2006 Andreas Jaggi <andreas.jaggi@waterwave.ch>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
|
||||
Copyright (c) 2005-2007 Stefano Brivio <stefano.brivio@polimi.it>
|
||||
Copyright (c) 2005-2008 Michael Buesch <m@bues.ch>
|
||||
Copyright (c) 2005-2008 Michael Buesch
|
||||
Copyright (c) 2005, 2006 Danny van Dyk <kugelfang@gentoo.org>
|
||||
Copyright (c) 2005, 2006 Andreas Jaggi <andreas.jaggi@waterwave.ch>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
Broadcom B43 wireless driver
|
||||
IEEE 802.11a/g LP-PHY driver
|
||||
|
||||
Copyright (c) 2008-2009 Michael Buesch <m@bues.ch>
|
||||
Copyright (c) 2008-2009 Michael Buesch
|
||||
Copyright (c) 2009 Gábor Stefanik <netrolller.3d@gmail.com>
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
Broadcom B43 wireless driver
|
||||
IEEE 802.11n PHY support
|
||||
|
||||
Copyright (c) 2008 Michael Buesch <m@bues.ch>
|
||||
Copyright (c) 2008 Michael Buesch
|
||||
Copyright (c) 2010-2011 Rafał Miłecki <zajec5@gmail.com>
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user