commit_title
stringlengths 13
124
| commit_body
stringlengths 0
1.9k
| release_summary
stringclasses 52
values | changes_summary
stringlengths 1
758
| release_affected_domains
stringclasses 33
values | release_affected_drivers
stringclasses 51
values | domain_of_changes
stringlengths 2
571
| language_set
stringclasses 983
values | diffstat_files
int64 1
300
| diffstat_insertions
int64 0
309k
| diffstat_deletions
int64 0
168k
| commit_diff
stringlengths 92
23.4M
| category
stringclasses 108
values | commit_hash
stringlengths 34
40
| related_people
stringlengths 0
370
| domain
stringclasses 21
values | subdomain
stringclasses 241
values | leaf_module
stringlengths 0
912
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ice: enable rss configure for avf
|
currently, rss hash input is not available to avf by ethtool, it is set by the pf directly.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
enable support in the ice driver to support virtchnl requests from the iavf to configure its own rss input set
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ice ']
|
['h', 'c']
| 4
| 486
| 1
|
--- diff --git a/drivers/net/ethernet/intel/ice/ice_flow.h b/drivers/net/ethernet/intel/ice/ice_flow.h --- a/drivers/net/ethernet/intel/ice/ice_flow.h +++ b/drivers/net/ethernet/intel/ice/ice_flow.h +#define ice_flow_hash_eth \ + (bit_ull(ice_flow_field_idx_eth_da) | \ + bit_ull(ice_flow_field_idx_eth_sa)) diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_allowlist.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_allowlist.c --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_allowlist.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_allowlist.c +/* virtchnl_vf_offload_adv_rss_pf */ +static const u32 adv_rss_pf_allowlist_opcodes[] = { + virtchnl_op_add_rss_cfg, virtchnl_op_del_rss_cfg, +}; + + allow_item(virtchnl_vf_offload_adv_rss_pf, adv_rss_pf_allowlist_opcodes), diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +#include "ice_flow.h" +#define field_selector(proto_hdr_field) \ + bit((proto_hdr_field) & proto_hdr_field_mask) + +struct ice_vc_hdr_match_type { + u32 vc_hdr; /* virtchnl headers (virtchnl_proto_hdr_xxx) */ + u32 ice_hdr; /* ice headers (ice_flow_seg_hdr_xxx) */ +}; + +static const struct ice_vc_hdr_match_type ice_vc_hdr_list_os[] = { + {virtchnl_proto_hdr_none, ice_flow_seg_hdr_none}, + {virtchnl_proto_hdr_ipv4, ice_flow_seg_hdr_ipv4 | + ice_flow_seg_hdr_ipv_other}, + {virtchnl_proto_hdr_ipv6, ice_flow_seg_hdr_ipv6 | + ice_flow_seg_hdr_ipv_other}, + {virtchnl_proto_hdr_tcp, ice_flow_seg_hdr_tcp}, + {virtchnl_proto_hdr_udp, ice_flow_seg_hdr_udp}, + {virtchnl_proto_hdr_sctp, ice_flow_seg_hdr_sctp}, +}; + +static const struct ice_vc_hdr_match_type ice_vc_hdr_list_comms[] = { + {virtchnl_proto_hdr_none, ice_flow_seg_hdr_none}, + {virtchnl_proto_hdr_eth, ice_flow_seg_hdr_eth}, + {virtchnl_proto_hdr_s_vlan, ice_flow_seg_hdr_vlan}, + {virtchnl_proto_hdr_c_vlan, ice_flow_seg_hdr_vlan}, + {virtchnl_proto_hdr_ipv4, ice_flow_seg_hdr_ipv4 | + ice_flow_seg_hdr_ipv_other}, + {virtchnl_proto_hdr_ipv6, ice_flow_seg_hdr_ipv6 | + ice_flow_seg_hdr_ipv_other}, + {virtchnl_proto_hdr_tcp, ice_flow_seg_hdr_tcp}, + {virtchnl_proto_hdr_udp, ice_flow_seg_hdr_udp}, + {virtchnl_proto_hdr_sctp, ice_flow_seg_hdr_sctp}, + {virtchnl_proto_hdr_pppoe, ice_flow_seg_hdr_pppoe}, + {virtchnl_proto_hdr_gtpu_ip, ice_flow_seg_hdr_gtpu_ip}, + {virtchnl_proto_hdr_gtpu_eh, ice_flow_seg_hdr_gtpu_eh}, + {virtchnl_proto_hdr_gtpu_eh_pdu_dwn, + ice_flow_seg_hdr_gtpu_dwn}, + {virtchnl_proto_hdr_gtpu_eh_pdu_up, + ice_flow_seg_hdr_gtpu_up}, + {virtchnl_proto_hdr_l2tpv3, ice_flow_seg_hdr_l2tpv3}, + {virtchnl_proto_hdr_esp, ice_flow_seg_hdr_esp}, + {virtchnl_proto_hdr_ah, ice_flow_seg_hdr_ah}, + {virtchnl_proto_hdr_pfcp, ice_flow_seg_hdr_pfcp_session}, +}; + +struct ice_vc_hash_field_match_type { + u32 vc_hdr; /* virtchnl headers + * (virtchnl_proto_hdr_xxx) + */ + u32 vc_hash_field; /* virtchnl hash fields selector + * field_selector((virtchnl_proto_hdr_eth_xxx)) + */ + u64 ice_hash_field; /* ice hash fields + * (bit_ull(ice_flow_field_idx_xxx)) + */ +}; + +static const struct +ice_vc_hash_field_match_type ice_vc_hash_field_list_os[] = { + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_src), + bit_ull(ice_flow_field_idx_ipv4_sa)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_dst), + bit_ull(ice_flow_field_idx_ipv4_da)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_src) | + field_selector(virtchnl_proto_hdr_ipv4_dst), + ice_flow_hash_ipv4}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_src) | + field_selector(virtchnl_proto_hdr_ipv4_prot), + bit_ull(ice_flow_field_idx_ipv4_sa) | + bit_ull(ice_flow_field_idx_ipv4_prot)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_dst) | + field_selector(virtchnl_proto_hdr_ipv4_prot), + bit_ull(ice_flow_field_idx_ipv4_da) | + bit_ull(ice_flow_field_idx_ipv4_prot)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_src) | + field_selector(virtchnl_proto_hdr_ipv4_dst) | + field_selector(virtchnl_proto_hdr_ipv4_prot), + ice_flow_hash_ipv4 | bit_ull(ice_flow_field_idx_ipv4_prot)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_prot), + bit_ull(ice_flow_field_idx_ipv4_prot)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_src), + bit_ull(ice_flow_field_idx_ipv6_sa)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_dst), + bit_ull(ice_flow_field_idx_ipv6_da)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_src) | + field_selector(virtchnl_proto_hdr_ipv6_dst), + ice_flow_hash_ipv6}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_src) | + field_selector(virtchnl_proto_hdr_ipv6_prot), + bit_ull(ice_flow_field_idx_ipv6_sa) | + bit_ull(ice_flow_field_idx_ipv6_prot)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_dst) | + field_selector(virtchnl_proto_hdr_ipv6_prot), + bit_ull(ice_flow_field_idx_ipv6_da) | + bit_ull(ice_flow_field_idx_ipv6_prot)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_src) | + field_selector(virtchnl_proto_hdr_ipv6_dst) | + field_selector(virtchnl_proto_hdr_ipv6_prot), + ice_flow_hash_ipv6 | bit_ull(ice_flow_field_idx_ipv6_prot)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_prot), + bit_ull(ice_flow_field_idx_ipv6_prot)}, + {virtchnl_proto_hdr_tcp, + field_selector(virtchnl_proto_hdr_tcp_src_port), + bit_ull(ice_flow_field_idx_tcp_src_port)}, + {virtchnl_proto_hdr_tcp, + field_selector(virtchnl_proto_hdr_tcp_dst_port), + bit_ull(ice_flow_field_idx_tcp_dst_port)}, + {virtchnl_proto_hdr_tcp, + field_selector(virtchnl_proto_hdr_tcp_src_port) | + field_selector(virtchnl_proto_hdr_tcp_dst_port), + ice_flow_hash_tcp_port}, + {virtchnl_proto_hdr_udp, + field_selector(virtchnl_proto_hdr_udp_src_port), + bit_ull(ice_flow_field_idx_udp_src_port)}, + {virtchnl_proto_hdr_udp, + field_selector(virtchnl_proto_hdr_udp_dst_port), + bit_ull(ice_flow_field_idx_udp_dst_port)}, + {virtchnl_proto_hdr_udp, + field_selector(virtchnl_proto_hdr_udp_src_port) | + field_selector(virtchnl_proto_hdr_udp_dst_port), + ice_flow_hash_udp_port}, + {virtchnl_proto_hdr_sctp, + field_selector(virtchnl_proto_hdr_sctp_src_port), + bit_ull(ice_flow_field_idx_sctp_src_port)}, + {virtchnl_proto_hdr_sctp, + field_selector(virtchnl_proto_hdr_sctp_dst_port), + bit_ull(ice_flow_field_idx_sctp_dst_port)}, + {virtchnl_proto_hdr_sctp, + field_selector(virtchnl_proto_hdr_sctp_src_port) | + field_selector(virtchnl_proto_hdr_sctp_dst_port), + ice_flow_hash_sctp_port}, +}; + +static const struct +ice_vc_hash_field_match_type ice_vc_hash_field_list_comms[] = { + {virtchnl_proto_hdr_eth, field_selector(virtchnl_proto_hdr_eth_src), + bit_ull(ice_flow_field_idx_eth_sa)}, + {virtchnl_proto_hdr_eth, field_selector(virtchnl_proto_hdr_eth_dst), + bit_ull(ice_flow_field_idx_eth_da)}, + {virtchnl_proto_hdr_eth, field_selector(virtchnl_proto_hdr_eth_src) | + field_selector(virtchnl_proto_hdr_eth_dst), + ice_flow_hash_eth}, + {virtchnl_proto_hdr_eth, + field_selector(virtchnl_proto_hdr_eth_ethertype), + bit_ull(ice_flow_field_idx_eth_type)}, + {virtchnl_proto_hdr_s_vlan, + field_selector(virtchnl_proto_hdr_s_vlan_id), + bit_ull(ice_flow_field_idx_s_vlan)}, + {virtchnl_proto_hdr_c_vlan, + field_selector(virtchnl_proto_hdr_c_vlan_id), + bit_ull(ice_flow_field_idx_c_vlan)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_src), + bit_ull(ice_flow_field_idx_ipv4_sa)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_dst), + bit_ull(ice_flow_field_idx_ipv4_da)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_src) | + field_selector(virtchnl_proto_hdr_ipv4_dst), + ice_flow_hash_ipv4}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_src) | + field_selector(virtchnl_proto_hdr_ipv4_prot), + bit_ull(ice_flow_field_idx_ipv4_sa) | + bit_ull(ice_flow_field_idx_ipv4_prot)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_dst) | + field_selector(virtchnl_proto_hdr_ipv4_prot), + bit_ull(ice_flow_field_idx_ipv4_da) | + bit_ull(ice_flow_field_idx_ipv4_prot)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_src) | + field_selector(virtchnl_proto_hdr_ipv4_dst) | + field_selector(virtchnl_proto_hdr_ipv4_prot), + ice_flow_hash_ipv4 | bit_ull(ice_flow_field_idx_ipv4_prot)}, + {virtchnl_proto_hdr_ipv4, field_selector(virtchnl_proto_hdr_ipv4_prot), + bit_ull(ice_flow_field_idx_ipv4_prot)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_src), + bit_ull(ice_flow_field_idx_ipv6_sa)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_dst), + bit_ull(ice_flow_field_idx_ipv6_da)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_src) | + field_selector(virtchnl_proto_hdr_ipv6_dst), + ice_flow_hash_ipv6}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_src) | + field_selector(virtchnl_proto_hdr_ipv6_prot), + bit_ull(ice_flow_field_idx_ipv6_sa) | + bit_ull(ice_flow_field_idx_ipv6_prot)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_dst) | + field_selector(virtchnl_proto_hdr_ipv6_prot), + bit_ull(ice_flow_field_idx_ipv6_da) | + bit_ull(ice_flow_field_idx_ipv6_prot)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_src) | + field_selector(virtchnl_proto_hdr_ipv6_dst) | + field_selector(virtchnl_proto_hdr_ipv6_prot), + ice_flow_hash_ipv6 | bit_ull(ice_flow_field_idx_ipv6_prot)}, + {virtchnl_proto_hdr_ipv6, field_selector(virtchnl_proto_hdr_ipv6_prot), + bit_ull(ice_flow_field_idx_ipv6_prot)}, + {virtchnl_proto_hdr_tcp, + field_selector(virtchnl_proto_hdr_tcp_src_port), + bit_ull(ice_flow_field_idx_tcp_src_port)}, + {virtchnl_proto_hdr_tcp, + field_selector(virtchnl_proto_hdr_tcp_dst_port), + bit_ull(ice_flow_field_idx_tcp_dst_port)}, + {virtchnl_proto_hdr_tcp, + field_selector(virtchnl_proto_hdr_tcp_src_port) | + field_selector(virtchnl_proto_hdr_tcp_dst_port), + ice_flow_hash_tcp_port}, + {virtchnl_proto_hdr_udp, + field_selector(virtchnl_proto_hdr_udp_src_port), + bit_ull(ice_flow_field_idx_udp_src_port)}, + {virtchnl_proto_hdr_udp, + field_selector(virtchnl_proto_hdr_udp_dst_port), + bit_ull(ice_flow_field_idx_udp_dst_port)}, + {virtchnl_proto_hdr_udp, + field_selector(virtchnl_proto_hdr_udp_src_port) | + field_selector(virtchnl_proto_hdr_udp_dst_port), + ice_flow_hash_udp_port}, + {virtchnl_proto_hdr_sctp, + field_selector(virtchnl_proto_hdr_sctp_src_port), + bit_ull(ice_flow_field_idx_sctp_src_port)}, + {virtchnl_proto_hdr_sctp, + field_selector(virtchnl_proto_hdr_sctp_dst_port), + bit_ull(ice_flow_field_idx_sctp_dst_port)}, + {virtchnl_proto_hdr_sctp, + field_selector(virtchnl_proto_hdr_sctp_src_port) | + field_selector(virtchnl_proto_hdr_sctp_dst_port), + ice_flow_hash_sctp_port}, + {virtchnl_proto_hdr_pppoe, + field_selector(virtchnl_proto_hdr_pppoe_sess_id), + bit_ull(ice_flow_field_idx_pppoe_sess_id)}, + {virtchnl_proto_hdr_gtpu_ip, + field_selector(virtchnl_proto_hdr_gtpu_ip_teid), + bit_ull(ice_flow_field_idx_gtpu_ip_teid)}, + {virtchnl_proto_hdr_l2tpv3, + field_selector(virtchnl_proto_hdr_l2tpv3_sess_id), + bit_ull(ice_flow_field_idx_l2tpv3_sess_id)}, + {virtchnl_proto_hdr_esp, field_selector(virtchnl_proto_hdr_esp_spi), + bit_ull(ice_flow_field_idx_esp_spi)}, + {virtchnl_proto_hdr_ah, field_selector(virtchnl_proto_hdr_ah_spi), + bit_ull(ice_flow_field_idx_ah_spi)}, + {virtchnl_proto_hdr_pfcp, field_selector(virtchnl_proto_hdr_pfcp_seid), + bit_ull(ice_flow_field_idx_pfcp_seid)}, +}; + + if (vf->driver_caps & virtchnl_vf_offload_adv_rss_pf) + vfres->vf_cap_flags |= virtchnl_vf_offload_adv_rss_pf; + +/** + * ice_vc_parse_rss_cfg - parses hash fields and headers from + * a specific virtchnl rss cfg + * @hw: pointer to the hardware + * @rss_cfg: pointer to the virtchnl rss cfg + * @addl_hdrs: pointer to the protocol header fields (ice_flow_seg_hdr_*) + * to configure + * @hash_flds: pointer to the hash bit fields (ice_flow_hash_*) to configure + * + * return true if all the protocol header and hash fields in the rss cfg could + * be parsed, else return false + * + * this function parses the virtchnl rss cfg to be the intended + * hash fields and the intended header for rss configuration + */ +static bool +ice_vc_parse_rss_cfg(struct ice_hw *hw, struct virtchnl_rss_cfg *rss_cfg, + u32 *addl_hdrs, u64 *hash_flds) +{ + const struct ice_vc_hash_field_match_type *hf_list; + const struct ice_vc_hdr_match_type *hdr_list; + int i, hf_list_len, hdr_list_len; + + if (!strncmp(hw->active_pkg_name, "ice comms package", + sizeof(hw->active_pkg_name))) { + hf_list = ice_vc_hash_field_list_comms; + hf_list_len = array_size(ice_vc_hash_field_list_comms); + hdr_list = ice_vc_hdr_list_comms; + hdr_list_len = array_size(ice_vc_hdr_list_comms); + } else { + hf_list = ice_vc_hash_field_list_os; + hf_list_len = array_size(ice_vc_hash_field_list_os); + hdr_list = ice_vc_hdr_list_os; + hdr_list_len = array_size(ice_vc_hdr_list_os); + } + + for (i = 0; i < rss_cfg->proto_hdrs.count; i++) { + struct virtchnl_proto_hdr *proto_hdr = + &rss_cfg->proto_hdrs.proto_hdr[i]; + bool hdr_found = false; + int j; + + /* find matched ice headers according to virtchnl headers. */ + for (j = 0; j < hdr_list_len; j++) { + struct ice_vc_hdr_match_type hdr_map = hdr_list[j]; + + if (proto_hdr->type == hdr_map.vc_hdr) { + *addl_hdrs |= hdr_map.ice_hdr; + hdr_found = true; + } + } + + if (!hdr_found) + return false; + + /* find matched ice hash fields according to + * virtchnl hash fields. + */ + for (j = 0; j < hf_list_len; j++) { + struct ice_vc_hash_field_match_type hf_map = hf_list[j]; + + if (proto_hdr->type == hf_map.vc_hdr && + proto_hdr->field_selector == hf_map.vc_hash_field) { + *hash_flds |= hf_map.ice_hash_field; + break; + } + } + } + + return true; +} + +/** + * ice_vf_adv_rss_offload_ena - determine if capabilities support advanced + * rss offloads + * @caps: vf driver negotiated capabilities + * + * return true if virtchnl_vf_offload_adv_rss_pf capability is set, + * else return false + */ +static bool ice_vf_adv_rss_offload_ena(u32 caps) +{ + return !!(caps & virtchnl_vf_offload_adv_rss_pf); +} + +/** + * ice_vc_handle_rss_cfg + * @vf: pointer to the vf info + * @msg: pointer to the message buffer + * @add: add a rss config if true, otherwise delete a rss config + * + * this function adds/deletes a rss config + */ +static int ice_vc_handle_rss_cfg(struct ice_vf *vf, u8 *msg, bool add) +{ + u32 v_opcode = add ? virtchnl_op_add_rss_cfg : virtchnl_op_del_rss_cfg; + struct virtchnl_rss_cfg *rss_cfg = (struct virtchnl_rss_cfg *)msg; + enum virtchnl_status_code v_ret = virtchnl_status_success; + struct device *dev = ice_pf_to_dev(vf->pf); + struct ice_hw *hw = &vf->pf->hw; + struct ice_vsi *vsi; + + if (!test_bit(ice_flag_rss_ena, vf->pf->flags)) { + dev_dbg(dev, "vf %d attempting to configure rss, but rss is not supported by the pf ", + vf->vf_id); + v_ret = virtchnl_status_err_not_supported; + goto error_param; + } + + if (!ice_vf_adv_rss_offload_ena(vf->driver_caps)) { + dev_dbg(dev, "vf %d attempting to configure rss, but advanced rss offload is not supported ", + vf->vf_id); + v_ret = virtchnl_status_err_param; + goto error_param; + } + + if (!test_bit(ice_vf_state_active, vf->vf_states)) { + v_ret = virtchnl_status_err_param; + goto error_param; + } + + if (rss_cfg->proto_hdrs.count > virtchnl_max_num_proto_hdrs || + rss_cfg->rss_algorithm < virtchnl_rss_alg_toeplitz_asymmetric || + rss_cfg->rss_algorithm > virtchnl_rss_alg_xor_symmetric) { + dev_dbg(dev, "vf %d attempting to configure rss, but rss configuration is not valid ", + vf->vf_id); + v_ret = virtchnl_status_err_param; + goto error_param; + } + + vsi = ice_get_vf_vsi(vf); + if (!vsi) { + v_ret = virtchnl_status_err_param; + goto error_param; + } + + if (rss_cfg->rss_algorithm == virtchnl_rss_alg_r_asymmetric) { + struct ice_vsi_ctx *ctx; + enum ice_status status; + u8 lut_type, hash_type; + + lut_type = ice_aq_vsi_q_opt_rss_lut_vsi; + hash_type = add ? ice_aq_vsi_q_opt_rss_xor : + ice_aq_vsi_q_opt_rss_tplz; + + ctx = kzalloc(sizeof(*ctx), gfp_kernel); + if (!ctx) { + v_ret = virtchnl_status_err_no_memory; + goto error_param; + } + + ctx->info.q_opt_rss = ((lut_type << + ice_aq_vsi_q_opt_rss_lut_s) & + ice_aq_vsi_q_opt_rss_lut_m) | + (hash_type & + ice_aq_vsi_q_opt_rss_hash_m); + + /* preserve existing queueing option setting */ + ctx->info.q_opt_rss |= (vsi->info.q_opt_rss & + ice_aq_vsi_q_opt_rss_gbl_lut_m); + ctx->info.q_opt_tc = vsi->info.q_opt_tc; + ctx->info.q_opt_flags = vsi->info.q_opt_rss; + + ctx->info.valid_sections = + cpu_to_le16(ice_aq_vsi_prop_q_opt_valid); + + status = ice_update_vsi(hw, vsi->idx, ctx, null); + if (status) { + dev_err(dev, "update vsi for rss failed, err %s aq_err %s ", + ice_stat_str(status), + ice_aq_str(hw->adminq.sq_last_status)); + v_ret = virtchnl_status_err_param; + } else { + vsi->info.q_opt_rss = ctx->info.q_opt_rss; + } + + kfree(ctx); + } else { + u32 addl_hdrs = ice_flow_seg_hdr_none; + u64 hash_flds = ice_hash_invalid; + + if (!ice_vc_parse_rss_cfg(hw, rss_cfg, &addl_hdrs, + &hash_flds)) { + v_ret = virtchnl_status_err_param; + goto error_param; + } + + if (add) { + if (ice_add_rss_cfg(hw, vsi->idx, hash_flds, + addl_hdrs)) { + v_ret = virtchnl_status_err_param; + dev_err(dev, "ice_add_rss_cfg failed for vsi = %d, v_ret = %d ", + vsi->vsi_num, v_ret); + } + } else { + v_ret = virtchnl_status_err_not_supported; + dev_err(dev, "rss removal not supported "); + } + } + +error_param: + return ice_vc_send_msg_to_vf(vf, v_opcode, v_ret, null, 0); +} + + case virtchnl_op_add_rss_cfg: + err = ice_vc_handle_rss_cfg(vf, msg, true); + break; + case virtchnl_op_del_rss_cfg: + err = ice_vc_handle_rss_cfg(vf, msg, false); + break; diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h --- a/include/linux/avf/virtchnl.h +++ b/include/linux/avf/virtchnl.h - /* opcode 34 - 46 are reserved */ + /* opcode 34 - 44 are reserved */ + virtchnl_op_add_rss_cfg = 45, + virtchnl_op_del_rss_cfg = 46, +#define virtchnl_vf_offload_adv_rss_pf 0x08000000 +/* type of rss algorithm */ +enum virtchnl_rss_algorithm { + virtchnl_rss_alg_toeplitz_asymmetric = 0, + virtchnl_rss_alg_r_asymmetric = 1, + virtchnl_rss_alg_toeplitz_symmetric = 2, + virtchnl_rss_alg_xor_symmetric = 3, +}; + +struct virtchnl_rss_cfg { + struct virtchnl_proto_hdrs proto_hdrs; /* protocol headers */ + enum virtchnl_rss_algorithm rss_algorithm; /* rss algorithm type */ + u8 reserved[128]; /* reserve for future */ +}; + +virtchnl_check_struct_len(2444, virtchnl_rss_cfg); + + case virtchnl_op_add_rss_cfg: + case virtchnl_op_del_rss_cfg: + valid_len = sizeof(struct virtchnl_rss_cfg); + break;
|
Networking
|
222a8ab01698148c00c271cda82d96f4e6e7b0a8
|
qi zhang
|
drivers
|
net
|
avf, ethernet, ice, intel
|
ice: support rss configure removal for avf
|
add the handler for virtchnl message virtchnl_op_del_rss_cfg to remove an existing rss configuration with matching hashed fields.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
enable support in the ice driver to support virtchnl requests from the iavf to configure its own rss input set
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ice ']
|
['h', 'c']
| 3
| 105
| 2
|
--- diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c --- a/drivers/net/ethernet/intel/ice/ice_flow.c +++ b/drivers/net/ethernet/intel/ice/ice_flow.c +/** + * ice_rem_rss_cfg_sync - remove an existing rss configuration + * @hw: pointer to the hardware structure + * @vsi_handle: software vsi handle + * @hashed_flds: packet hash types (ice_flow_hash_*) to remove + * @addl_hdrs: protocol header fields within a packet segment + * @segs_cnt: packet segment count + * + * assumption: lock has already been acquired for rss list + */ +static enum ice_status +ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds, + u32 addl_hdrs, u8 segs_cnt) +{ + const enum ice_block blk = ice_blk_rss; + struct ice_flow_seg_info *segs; + struct ice_flow_prof *prof; + enum ice_status status; + + segs = kcalloc(segs_cnt, sizeof(*segs), gfp_kernel); + if (!segs) + return ice_err_no_memory; + + /* construct the packet segment info from the hashed fields */ + status = ice_flow_set_rss_seg_info(&segs[segs_cnt - 1], hashed_flds, + addl_hdrs); + if (status) + goto out; + + prof = ice_flow_find_prof_conds(hw, blk, ice_flow_rx, segs, segs_cnt, + vsi_handle, + ice_flow_find_prof_chk_flds); + if (!prof) { + status = ice_err_does_not_exist; + goto out; + } + + status = ice_flow_disassoc_prof(hw, blk, prof, vsi_handle); + if (status) + goto out; + + /* remove rss configuration from vsi context before deleting + * the flow profile. + */ + ice_rem_rss_list(hw, vsi_handle, prof); + + if (bitmap_empty(prof->vsis, ice_max_vsi)) + status = ice_flow_rem_prof(hw, blk, prof->id); + +out: + kfree(segs); + return status; +} + +/** + * ice_rem_rss_cfg - remove an existing rss config with matching hashed fields + * @hw: pointer to the hardware structure + * @vsi_handle: software vsi handle + * @hashed_flds: packet hash types (ice_flow_hash_*) to remove + * @addl_hdrs: protocol header fields within a packet segment + * + * this function will lookup the flow profile based on the input + * hash field bitmap, iterate through the profile entry list of + * that profile and find entry associated with input vsi to be + * removed. calls are made to underlying flow s which will apis + * turn build or update buffers for rss xlt1 section. + */ +enum ice_status __maybe_unused +ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds, + u32 addl_hdrs) +{ + enum ice_status status; + + if (hashed_flds == ice_hash_invalid || + !ice_is_vsi_valid(hw, vsi_handle)) + return ice_err_param; + + mutex_lock(&hw->rss_locks); + status = ice_rem_rss_cfg_sync(hw, vsi_handle, hashed_flds, addl_hdrs, + ice_rss_outer_headers); + if (!status) + status = ice_rem_rss_cfg_sync(hw, vsi_handle, hashed_flds, + addl_hdrs, ice_rss_inner_headers); + mutex_unlock(&hw->rss_locks); + + return status; +} + diff --git a/drivers/net/ethernet/intel/ice/ice_flow.h b/drivers/net/ethernet/intel/ice/ice_flow.h --- a/drivers/net/ethernet/intel/ice/ice_flow.h +++ b/drivers/net/ethernet/intel/ice/ice_flow.h +enum ice_status +ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds, + u32 addl_hdrs); diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c - v_ret = virtchnl_status_err_not_supported; - dev_err(dev, "rss removal not supported "); + enum ice_status status; + + status = ice_rem_rss_cfg(hw, vsi->idx, hash_flds, + addl_hdrs); + /* we just ignore ice_err_does_not_exist, because + * if two configurations share the same profile remove + * one of them actually removes both, since the + * profile is deleted. + */ + if (status && status != ice_err_does_not_exist) { + v_ret = virtchnl_status_err_param; + dev_err(dev, "ice_rem_rss_cfg failed for vf id:%d, error:%s ", + vf->vf_id, ice_stat_str(status)); + }
|
Networking
|
ddd1f3cfed3f06906c25f917eb703d683c415e24
|
qi zhang bo chen box c chen intel com
|
drivers
|
net
|
ethernet, ice, intel
|
ice: enhanced ipv4 and ipv6 flow filter
|
separate ipv4 and ipv6 ptype bit mask table into 2 tables: with or without l4 protocols.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
enhanced ipv4 and ipv6 flow filter
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ice ']
|
['h', 'c']
| 2
| 53
| 5
|
--- diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c --- a/drivers/net/ethernet/intel/ice/ice_flow.c +++ b/drivers/net/ethernet/intel/ice/ice_flow.c -/* packet types for packets with an outer/first/single ipv4 header */ +/* packet types for packets with an outer/first/single ipv4 header, does not + * include ipv4 other ptypes + */ +}; + +/* packet types for packets with an outer/first/single ipv4 header, includes + * ipv4 other ptypes + */ +static const u32 ice_ptypes_ipv4_ofos_all[] = { + 0x1dc00000, 0x04000800, 0x00000000, 0x00000000, + 0x00000000, 0x00000155, 0x00000000, 0x00000000, + 0x00000000, 0x000fc000, 0x83e0f800, 0x00000101, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, -/* packet types for packets with an outer/first/single ipv6 header */ +/* packet types for packets with an outer/first/single ipv6 header, does not + * include ipv6 other ptypes + */ +}; + +/* packet types for packets with an outer/first/single ipv6 header, includes + * ipv6 other ptypes + */ +static const u32 ice_ptypes_ipv6_ofos_all[] = { + 0x00000000, 0x00000000, 0x77000000, 0x10002000, + 0x00000000, 0x000002aa, 0x00000000, 0x00000000, + 0x00080f00, 0x03f00000, 0x7c1f0000, 0x00000206, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +/* mask for l4 protocols that are not part of ipv4/6 other ptype groups */ +#define ice_flow_seg_hdrs_l4_mask_no_other \ + (ice_flow_seg_hdr_tcp | ice_flow_seg_hdr_udp | ice_flow_seg_hdr_sctp) + - !(hdrs & ice_flow_seg_hdrs_l4_mask)) { + (hdrs & ice_flow_seg_hdr_ipv_other)) { + src = i ? (const unsigned long *)ice_ptypes_ipv4_il : + (const unsigned long *)ice_ptypes_ipv4_ofos_all; + bitmap_and(params->ptypes, params->ptypes, src, + ice_flow_ptype_max); + } else if ((hdrs & ice_flow_seg_hdr_ipv6) && + (hdrs & ice_flow_seg_hdr_ipv_other)) { + src = i ? (const unsigned long *)ice_ptypes_ipv6_il : + (const unsigned long *)ice_ptypes_ipv6_ofos_all; + bitmap_and(params->ptypes, params->ptypes, src, + ice_flow_ptype_max); + } else if ((hdrs & ice_flow_seg_hdr_ipv4) && + !(hdrs & ice_flow_seg_hdrs_l4_mask_no_other)) { - !(hdrs & ice_flow_seg_hdrs_l4_mask)) { + !(hdrs & ice_flow_seg_hdrs_l4_mask_no_other)) { - ~ice_flow_rss_hdrs_inner_mask) + ~ice_flow_rss_hdrs_inner_mask & ~ice_flow_seg_hdr_ipv_other) diff --git a/drivers/net/ethernet/intel/ice/ice_flow.h b/drivers/net/ethernet/intel/ice/ice_flow.h --- a/drivers/net/ethernet/intel/ice/ice_flow.h +++ b/drivers/net/ethernet/intel/ice/ice_flow.h + /* the following is an additive bit for ice_flow_seg_hdr_ipv4 and + * ice_flow_seg_hdr_ipv6 which include the ipv4 other ptypes + */ + ice_flow_seg_hdr_ipv_other = 0x20000000,
|
Networking
|
7012dfd1afc335f5e972a1c38b43c01d4b8a4309
|
qi zhang
|
drivers
|
net
|
ethernet, ice, intel
|
ice: support to separate gtp-u uplink and downlink
|
to apply different input set for gtp-u packet with or without extend header as well as gtp-u uplink and downlink, we need to add tcam mask matching capability. this allows comprehending different ptype attributes by examining flags from the parser. using this method, different profiles can be used by examining flag values from the parser.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
support to separate gtp-u uplink and downlink
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ice ']
|
['h', 'c']
| 4
| 241
| 15
|
--- diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c --- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c +++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c + * @btm: true to allocate from bottom of table, false to allocate from top -ice_alloc_tcam_ent(struct ice_hw *hw, enum ice_block blk, u16 *tcam_idx) +ice_alloc_tcam_ent(struct ice_hw *hw, enum ice_block blk, bool btm, + u16 *tcam_idx) - return ice_alloc_hw_res(hw, res_type, 1, true, tcam_idx); + return ice_alloc_hw_res(hw, res_type, 1, btm, tcam_idx); +/* the entries here needs to match the order of enum ice_ptype_attrib */ +static const struct ice_ptype_attrib_info ice_ptype_attributes[] = { + { ice_gtp_pdu_eh, ice_gtp_pdu_flag_mask }, + { ice_gtp_session, ice_gtp_flags_mask }, + { ice_gtp_downlink, ice_gtp_flags_mask }, + { ice_gtp_uplink, ice_gtp_flags_mask }, +}; + +/** + * ice_get_ptype_attrib_info - get ptype attribute information + * @type: attribute type + * @info: pointer to variable to the attribute information + */ +static void +ice_get_ptype_attrib_info(enum ice_ptype_attrib_type type, + struct ice_ptype_attrib_info *info) +{ + *info = ice_ptype_attributes[type]; +} + +/** + * ice_add_prof_attrib - add any ptg with attributes to profile + * @prof: pointer to the profile to which ptg entries will be added + * @ptg: ptg to be added + * @ptype: ptype that needs to be looked up + * @attr: array of attributes that will be considered + * @attr_cnt: number of elements in the attribute array + */ +static enum ice_status +ice_add_prof_attrib(struct ice_prof_map *prof, u8 ptg, u16 ptype, + const struct ice_ptype_attributes *attr, u16 attr_cnt) +{ + bool found = false; + u16 i; + + for (i = 0; i < attr_cnt; i++) + if (attr[i].ptype == ptype) { + found = true; + + prof->ptg[prof->ptg_cnt] = ptg; + ice_get_ptype_attrib_info(attr[i].attrib, + &prof->attr[prof->ptg_cnt]); + + if (++prof->ptg_cnt >= ice_max_ptg_per_profile) + return ice_err_max_limit; + } + + if (!found) + return ice_err_does_not_exist; + + return 0; +} + + * @attr: array of attributes + * @attr_cnt: number of elements in attr array + const struct ice_ptype_attributes *attr, u16 attr_cnt, - u8 m; - prof->ptg[prof->ptg_cnt] = ptg; - - if (++prof->ptg_cnt >= ice_max_ptg_per_profile) + /* check to see there are any attributes for + * this ptype, and add them if found. + */ + status = ice_add_prof_attrib(prof, ptg, ptype, + attr, attr_cnt); + if (status == ice_err_max_limit) + if (status) { + /* this is simple a ptype/ptg with no + * attribute + */ + prof->ptg[prof->ptg_cnt] = ptg; + prof->attr[prof->ptg_cnt].flags = 0; + prof->attr[prof->ptg_cnt].mask = 0; - /* nothing left in byte, then exit */ - m = ~(u8)((1 << (bit + 1)) - 1); - if (!(ptypes[byte] & m)) - break; + if (++prof->ptg_cnt >= + ice_max_ptg_per_profile) + break; + } - status = ice_alloc_tcam_ent(hw, blk, &tcam->tcam_idx); + /* for entries with empty attribute masks, allocate entry from + * the bottom of the tcam table; otherwise, allocate from the + * top of the table in order to give it higher priority + */ + status = ice_alloc_tcam_ent(hw, blk, tcam->attr.mask == 0, + &tcam->tcam_idx); - tcam->ptg, vsig, 0, 0, vl_msk, dc_msk, - nm_msk); + tcam->ptg, vsig, 0, tcam->attr.flags, + vl_msk, dc_msk, nm_msk); - status = ice_alloc_tcam_ent(hw, blk, &tcam_idx); + /* for entries with empty attribute masks, allocate entry from + * the bottom of the tcam table; otherwise, allocate from the + * top of the table in order to give it higher priority + */ + status = ice_alloc_tcam_ent(hw, blk, map->attr[i].mask == 0, + &tcam_idx); + t->tcam[i].attr = map->attr[i]; diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.h b/drivers/net/ethernet/intel/ice/ice_flex_pipe.h --- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.h +++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.h + const struct ice_ptype_attributes *attr, u16 attr_cnt, diff --git a/drivers/net/ethernet/intel/ice/ice_flex_type.h b/drivers/net/ethernet/intel/ice/ice_flex_type.h --- a/drivers/net/ethernet/intel/ice/ice_flex_type.h +++ b/drivers/net/ethernet/intel/ice/ice_flex_type.h +#define ice_mac_ipv4_gtpu_ipv4_frag 331 +#define ice_mac_ipv4_gtpu_ipv4_pay 332 +#define ice_mac_ipv4_gtpu_ipv4_udp_pay 333 +#define ice_mac_ipv4_gtpu_ipv4_tcp 334 +#define ice_mac_ipv4_gtpu_ipv4_icmp 335 +#define ice_mac_ipv6_gtpu_ipv4_frag 336 +#define ice_mac_ipv6_gtpu_ipv4_pay 337 +#define ice_mac_ipv6_gtpu_ipv4_udp_pay 338 +#define ice_mac_ipv6_gtpu_ipv4_tcp 339 +#define ice_mac_ipv6_gtpu_ipv4_icmp 340 +#define ice_mac_ipv4_gtpu_ipv6_frag 341 +#define ice_mac_ipv4_gtpu_ipv6_pay 342 +#define ice_mac_ipv4_gtpu_ipv6_udp_pay 343 +#define ice_mac_ipv4_gtpu_ipv6_tcp 344 +#define ice_mac_ipv4_gtpu_ipv6_icmpv6 345 +#define ice_mac_ipv6_gtpu_ipv6_frag 346 +#define ice_mac_ipv6_gtpu_ipv6_pay 347 +#define ice_mac_ipv6_gtpu_ipv6_udp_pay 348 +#define ice_mac_ipv6_gtpu_ipv6_tcp 349 +#define ice_mac_ipv6_gtpu_ipv6_icmpv6 350 + +/* attributes that can modify ptype definitions. + * + * these values will represent special attributes for ptypes, which will + * resolve into metadata packet flags definitions that can be used in the tcam + * for identifying a ptype with specific characteristics. + */ +enum ice_ptype_attrib_type { + /* gtp ptypes */ + ice_ptype_attr_gtp_pdu_eh, + ice_ptype_attr_gtp_session, + ice_ptype_attr_gtp_downlink, + ice_ptype_attr_gtp_uplink, +}; + +struct ice_ptype_attrib_info { + u16 flags; + u16 mask; +}; + +/* tcam flag definitions */ +#define ice_gtp_pdu bit(14) +#define ice_gtp_pdu_link bit(13) + +/* gtp attributes */ +#define ice_gtp_pdu_flag_mask (ice_gtp_pdu) +#define ice_gtp_pdu_eh ice_gtp_pdu + +#define ice_gtp_flags_mask (ice_gtp_pdu | ice_gtp_pdu_link) +#define ice_gtp_session 0 +#define ice_gtp_downlink ice_gtp_pdu +#define ice_gtp_uplink (ice_gtp_pdu | ice_gtp_pdu_link) + +struct ice_ptype_attributes { + u16 ptype; + enum ice_ptype_attrib_type attrib; +}; + + struct ice_ptype_attrib_info attr[ice_max_ptg_per_profile]; + struct ice_ptype_attrib_info attr; + struct ice_ptype_attrib_info attr; diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c --- a/drivers/net/ethernet/intel/ice/ice_flow.c +++ b/drivers/net/ethernet/intel/ice/ice_flow.c +/* packet types for gtpu */ +static const struct ice_ptype_attributes ice_attr_gtpu_eh[] = { + { ice_mac_ipv4_gtpu_ipv4_frag, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv4_gtpu_ipv4_pay, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv4_gtpu_ipv4_udp_pay, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv4_gtpu_ipv4_tcp, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv4_gtpu_ipv4_icmp, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv4_frag, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv4_pay, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv4_udp_pay, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv4_tcp, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv4_icmp, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv4_gtpu_ipv6_frag, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv4_gtpu_ipv6_pay, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv4_gtpu_ipv6_udp_pay, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv4_gtpu_ipv6_tcp, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv4_gtpu_ipv6_icmpv6, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv6_frag, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv6_pay, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv6_udp_pay, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv6_tcp, ice_ptype_attr_gtp_pdu_eh }, + { ice_mac_ipv6_gtpu_ipv6_icmpv6, ice_ptype_attr_gtp_pdu_eh }, +}; + +static const struct ice_ptype_attributes ice_attr_gtpu_down[] = { + { ice_mac_ipv4_gtpu_ipv4_frag, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv4_gtpu_ipv4_pay, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv4_gtpu_ipv4_udp_pay, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv4_gtpu_ipv4_tcp, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv4_gtpu_ipv4_icmp, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv4_frag, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv4_pay, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv4_udp_pay, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv4_tcp, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv4_icmp, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv4_gtpu_ipv6_frag, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv4_gtpu_ipv6_pay, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv4_gtpu_ipv6_udp_pay, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv4_gtpu_ipv6_tcp, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv4_gtpu_ipv6_icmpv6, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv6_frag, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv6_pay, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv6_udp_pay, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv6_tcp, ice_ptype_attr_gtp_downlink }, + { ice_mac_ipv6_gtpu_ipv6_icmpv6, ice_ptype_attr_gtp_downlink }, +}; + +static const struct ice_ptype_attributes ice_attr_gtpu_up[] = { + { ice_mac_ipv4_gtpu_ipv4_frag, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv4_gtpu_ipv4_pay, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv4_gtpu_ipv4_udp_pay, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv4_gtpu_ipv4_tcp, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv4_gtpu_ipv4_icmp, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv4_frag, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv4_pay, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv4_udp_pay, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv4_tcp, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv4_icmp, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv4_gtpu_ipv6_frag, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv4_gtpu_ipv6_pay, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv4_gtpu_ipv6_udp_pay, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv4_gtpu_ipv6_tcp, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv4_gtpu_ipv6_icmpv6, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv6_frag, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv6_pay, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv6_udp_pay, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv6_tcp, ice_ptype_attr_gtp_uplink }, + { ice_mac_ipv6_gtpu_ipv6_icmpv6, ice_ptype_attr_gtp_uplink }, +}; + + /* attributes can be used to add attributes to a particular ptype */ + const struct ice_ptype_attributes *attr; + u16 attr_cnt; + + /* attributes for gtp packet with downlink */ + params->attr = ice_attr_gtpu_down; + params->attr_cnt = array_size(ice_attr_gtpu_down); + + /* attributes for gtp packet with uplink */ + params->attr = ice_attr_gtpu_up; + params->attr_cnt = array_size(ice_attr_gtpu_up); + + /* attributes for gtp packet with extension header */ + params->attr = ice_attr_gtpu_eh; + params->attr_cnt = array_size(ice_attr_gtpu_eh); - params->es, params->mask); + params->attr, params->attr_cnt, params->es, + params->mask);
|
Networking
|
cbad5db88aaf42ca3855c5c485fb5a900caaadc5
|
qi zhang chen bo box c chen intel com
|
drivers
|
net
|
ethernet, ice, intel
|
igc: remove unused argument from igc_tx_cmd_type()
|
the 'skb' argument from igc_tx_cmd_type() is not used so remove it.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add xdp support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['igc ']
|
['c']
| 1
| 2
| 2
|
--- diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c -static u32 igc_tx_cmd_type(struct sk_buff *skb, u32 tx_flags) +static u32 igc_tx_cmd_type(u32 tx_flags) - u32 cmd_type = igc_tx_cmd_type(skb, tx_flags); + u32 cmd_type = igc_tx_cmd_type(tx_flags);
|
Networking
|
2f019ebd5330c38e3c28fc8d35cc0bce6f4ddfe4
|
andre guedes maciej fijalkowski maciej fijalkowski intel com dvora fuxbrumer dvorax fuxbrumer linux intel com
|
drivers
|
net
|
ethernet, igc, intel
|
igc: introduce igc_rx_buffer_flip() helper
|
the igc driver implements the same page recycling scheme from other intel drivers which reuses the page by flipping the buffer. the code to handle buffer flips is duplicated in many locations so introduce the igc_rx_buffer_flip() helper and use it where applicable.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add xdp support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['igc ']
|
['c']
| 1
| 21
| 22
|
--- diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c +static void igc_rx_buffer_flip(struct igc_rx_buffer *buffer, + unsigned int truesize) +{ +#if (page_size < 8192) + buffer->page_offset ^= truesize; +#else + buffer->page_offset += truesize; +#endif +} + -#if (page_size < 8192) - unsigned int truesize = igc_rx_pg_size(rx_ring) / 2; + unsigned int truesize; - skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, rx_buffer->page, - rx_buffer->page_offset, size, truesize); - rx_buffer->page_offset ^= truesize; +#if (page_size < 8192) + truesize = igc_rx_pg_size(rx_ring) / 2; - unsigned int truesize = ring_uses_build_skb(rx_ring) ? - skb_data_align(igc_skb_pad + size) : - skb_data_align(size); + truesize = ring_uses_build_skb(rx_ring) ? + skb_data_align(igc_skb_pad + size) : + skb_data_align(size); +#endif - rx_buffer->page_offset += truesize; -#endif + + igc_rx_buffer_flip(rx_buffer, truesize); - /* update buffer offset */ -#if (page_size < 8192) - rx_buffer->page_offset ^= truesize; -#else - rx_buffer->page_offset += truesize; -#endif - + igc_rx_buffer_flip(rx_buffer, truesize); -#if (page_size < 8192) - rx_buffer->page_offset ^= truesize; -#else - rx_buffer->page_offset += truesize; -#endif + igc_rx_buffer_flip(rx_buffer, truesize);
|
Networking
|
613cf199fd10a610d46dd6b3a6eb3b14fe2b1104
|
andre guedes maciej fijalkowski maciej fijalkowski intel com dvora fuxbrumer dvorax fuxbrumer linux intel com
|
drivers
|
net
|
ethernet, igc, intel
|
igc: introduce igc_get_rx_frame_truesize() helper
|
the rx frame truesize calculation is scattered throughout the rx code. this patch creates the helper function igc_get_rx_frame_truesize() and uses it where applicable.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add xdp support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['igc ']
|
['c']
| 1
| 18
| 11
|
--- diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c +static unsigned int igc_get_rx_frame_truesize(struct igc_ring *ring, + unsigned int size) +{ + unsigned int truesize; + +#if (page_size < 8192) + truesize = igc_rx_pg_size(ring) / 2; +#else + truesize = ring_uses_build_skb(ring) ? + skb_data_align(sizeof(struct skb_shared_info)) + + skb_data_align(igc_skb_pad + size) : + skb_data_align(size); +#endif + return truesize; +} + -#if (page_size < 8192) - unsigned int truesize = igc_rx_pg_size(rx_ring) / 2; -#else - unsigned int truesize = skb_data_align(sizeof(struct skb_shared_info)) + - skb_data_align(igc_skb_pad + size); -#endif + unsigned int truesize = igc_get_rx_frame_truesize(rx_ring, size); -#if (page_size < 8192) - unsigned int truesize = igc_rx_pg_size(rx_ring) / 2; -#else - unsigned int truesize = skb_data_align(size); -#endif + unsigned int truesize = igc_get_rx_frame_truesize(rx_ring, size);
|
Networking
|
a39f5e530559e0e39ab26b28ce5fa9550fd3ec5b
|
andre guedes maciej fijalkowski maciej fijalkowski intel com dvora fuxbrumer dvorax fuxbrumer linux intel com
|
drivers
|
net
|
ethernet, igc, intel
|
igc: refactor rx timestamp handling
|
refactor the rx timestamp handling in preparation to land xdp support.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add xdp support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['igc ']
|
['h', 'c']
| 3
| 34
| 24
|
--- diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h -void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, __le32 *va, - struct sk_buff *skb); +ktime_t igc_ptp_rx_pktstamp(struct igc_adapter *adapter, __le32 *buf); diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c - union igc_adv_rx_desc *rx_desc, - unsigned int size) + unsigned int size, int pkt_offset, + ktime_t timestamp) - void *va = page_address(rx_buffer->page) + rx_buffer->page_offset; + void *va = page_address(rx_buffer->page) + rx_buffer->page_offset + + pkt_offset; - if (unlikely(igc_test_staterr(rx_desc, igc_rxdadv_stat_tsip))) { - igc_ptp_rx_pktstamp(rx_ring->q_vector, va, skb); - va += igc_ts_hdr_len; - size -= igc_ts_hdr_len; - } + if (timestamp) + skb_hwtstamps(skb)->hwtstamp = timestamp; + ktime_t timestamp = 0; + int pkt_offset = 0; + if (igc_test_staterr(rx_desc, igc_rxdadv_stat_tsip)) { + void *pktbuf = page_address(rx_buffer->page) + + rx_buffer->page_offset; + + timestamp = igc_ptp_rx_pktstamp(q_vector->adapter, + pktbuf); + pkt_offset = igc_ts_hdr_len; + size -= igc_ts_hdr_len; + } + - skb = igc_construct_skb(rx_ring, rx_buffer, - rx_desc, size); + skb = igc_construct_skb(rx_ring, rx_buffer, size, + pkt_offset, timestamp); diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c --- a/drivers/net/ethernet/intel/igc/igc_ptp.c +++ b/drivers/net/ethernet/intel/igc/igc_ptp.c - * @q_vector: pointer to interrupt specific structure - * @va: pointer to address containing rx buffer - * @skb: buffer containing timestamp and packet + * @adapter: pointer to adapter the packet buffer belongs to + * @buf: pointer to packet buffer + * + * returns timestamp value. -void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, __le32 *va, - struct sk_buff *skb) +ktime_t igc_ptp_rx_pktstamp(struct igc_adapter *adapter, __le32 *buf) - struct igc_adapter *adapter = q_vector->adapter; - u64 regval; + ktime_t timestamp; + u32 secs, nsecs; - regval = le32_to_cpu(va[2]); - regval |= (u64)le32_to_cpu(va[3]) << 32; - igc_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval); + nsecs = le32_to_cpu(buf[2]); + secs = le32_to_cpu(buf[3]); + + timestamp = ktime_set(secs, nsecs); - skb_hwtstamps(skb)->hwtstamp = - ktime_sub_ns(skb_hwtstamps(skb)->hwtstamp, adjust); + + return ktime_sub_ns(timestamp, adjust);
|
Networking
|
e1ed4f92a6256ec11445de51c2b5a7d89289f8d1
|
andre guedes
|
drivers
|
net
|
ethernet, igc, intel
|
igc: add set/clear large buffer helpers
|
while commit 13b5b7fd6a4a ("igc: add support for tx/rx rings") introduced code to handle larger packet buffers, it missed the set/clear helpers which enable/disable that feature. introduce the missing helpers which will be use in the next patch.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add xdp support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['igc ']
|
['h']
| 1
| 4
| 0
|
--- diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h +#define set_ring_uses_large_buffer(ring) \ + set_bit(igc_ring_flag_rx_3k_buffer, &(ring)->flags) +#define clear_ring_uses_large_buffer(ring) \ + clear_bit(igc_ring_flag_rx_3k_buffer, &(ring)->flags)
|
Networking
|
1bf33f71f9813688bf5ca5a4db0743bb4a4dd563
|
andre guedes maciej fijalkowski maciej fijalkowski intel com dvora fuxbrumer dvorax fuxbrumer linux intel com
|
drivers
|
net
|
ethernet, igc, intel
|
igc: add initial xdp support
|
add the initial xdp support to the igc driver. for now, only xdp_pass, xdp_drop, xdp_aborted actions are supported. upcoming patches will add support for the remaining xdp actions.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add xdp support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['igc ']
|
['h', 'c', 'makefile']
| 5
| 153
| 12
|
--- diff --git a/drivers/net/ethernet/intel/igc/makefile b/drivers/net/ethernet/intel/igc/makefile --- a/drivers/net/ethernet/intel/igc/makefile +++ b/drivers/net/ethernet/intel/igc/makefile -igc_diag.o igc_ethtool.o igc_ptp.o igc_dump.o igc_tsn.o +igc_diag.o igc_ethtool.o igc_ptp.o igc_dump.o igc_tsn.o igc_xdp.o diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h + + struct bpf_prog *xdp_prog; diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c +#include <linux/bpf_trace.h> +#include "igc_xdp.h" +#define igc_xdp_pass 0 +#define igc_xdp_consumed bit(0) + + clear_ring_uses_large_buffer(rx_ring); + +static bool igc_xdp_is_enabled(struct igc_adapter *adapter) +{ + return !!adapter->xdp_prog; +} + + if (igc_xdp_is_enabled(adapter)) + set_ring_uses_large_buffer(ring); + - unsigned int size, int pkt_offset, + struct xdp_buff *xdp, - void *va = page_address(rx_buffer->page) + rx_buffer->page_offset + - pkt_offset; + unsigned int size = xdp->data_end - xdp->data; + void *va = xdp->data; + /* xdp packets use error pointer so abort at this point */ + if (is_err(skb)) + return true; + - return ring_uses_build_skb(rx_ring) ? igc_skb_pad : 0; + struct igc_adapter *adapter = rx_ring->q_vector->adapter; + + if (ring_uses_build_skb(rx_ring)) + return igc_skb_pad; + if (igc_xdp_is_enabled(adapter)) + return xdp_packet_headroom; + + return 0; +static struct sk_buff *igc_xdp_run_prog(struct igc_adapter *adapter, + struct xdp_buff *xdp) +{ + struct bpf_prog *prog; + int res; + u32 act; + + rcu_read_lock(); + + prog = read_once(adapter->xdp_prog); + if (!prog) { + res = igc_xdp_pass; + goto unlock; + } + + act = bpf_prog_run_xdp(prog, xdp); + switch (act) { + case xdp_pass: + res = igc_xdp_pass; + break; + default: + bpf_warn_invalid_xdp_action(act); + fallthrough; + case xdp_aborted: + trace_xdp_exception(adapter->netdev, prog, act); + fallthrough; + case xdp_drop: + res = igc_xdp_consumed; + break; + } + +unlock: + rcu_read_unlock(); + return err_ptr(-res); +} + + struct xdp_buff xdp; + void *pktbuf; - if (igc_test_staterr(rx_desc, igc_rxdadv_stat_tsip)) { - void *pktbuf = page_address(rx_buffer->page) + - rx_buffer->page_offset; + pktbuf = page_address(rx_buffer->page) + rx_buffer->page_offset; + if (igc_test_staterr(rx_desc, igc_rxdadv_stat_tsip)) { - /* retrieve a buffer from the ring */ - if (skb) + if (!skb) { + struct igc_adapter *adapter = q_vector->adapter; + + xdp.data = pktbuf + pkt_offset; + xdp.data_end = xdp.data + size; + xdp.data_hard_start = pktbuf - igc_rx_offset(rx_ring); + xdp_set_data_meta_invalid(&xdp); + xdp.frame_sz = igc_get_rx_frame_truesize(rx_ring, size); + + skb = igc_xdp_run_prog(adapter, &xdp); + } + + if (is_err(skb)) { + rx_buffer->pagecnt_bias++; + total_packets++; + total_bytes += size; + } else if (skb) - skb = igc_construct_skb(rx_ring, rx_buffer, size, - pkt_offset, timestamp); + skb = igc_construct_skb(rx_ring, rx_buffer, &xdp, + timestamp); + if (igc_xdp_is_enabled(adapter) && new_mtu > eth_data_len) { + netdev_dbg(netdev, "jumbo frames not supported with xdp"); + return -einval; + } + +static int igc_bpf(struct net_device *dev, struct netdev_bpf *bpf) +{ + struct igc_adapter *adapter = netdev_priv(dev); + + switch (bpf->command) { + case xdp_setup_prog: + return igc_xdp_set_prog(adapter, bpf->prog, bpf->extack); + default: + return -eopnotsupp; + } +} + + .ndo_bpf = igc_bpf, diff --git a/drivers/net/ethernet/intel/igc/igc_xdp.c b/drivers/net/ethernet/intel/igc/igc_xdp.c --- /dev/null +++ b/drivers/net/ethernet/intel/igc/igc_xdp.c +// spdx-license-identifier: gpl-2.0 +/* copyright (c) 2020, intel corporation. */ + +#include "igc.h" +#include "igc_xdp.h" + +int igc_xdp_set_prog(struct igc_adapter *adapter, struct bpf_prog *prog, + struct netlink_ext_ack *extack) +{ + struct net_device *dev = adapter->netdev; + bool if_running = netif_running(dev); + struct bpf_prog *old_prog; + + if (dev->mtu > eth_data_len) { + /* for now, the driver doesn't support xdp functionality with + * jumbo frames so we return error. + */ + nl_set_err_msg_mod(extack, "jumbo frames not supported"); + return -eopnotsupp; + } + + if (if_running) + igc_close(dev); + + old_prog = xchg(&adapter->xdp_prog, prog); + if (old_prog) + bpf_prog_put(old_prog); + + if (if_running) + igc_open(dev); + + return 0; +} diff --git a/drivers/net/ethernet/intel/igc/igc_xdp.h b/drivers/net/ethernet/intel/igc/igc_xdp.h --- /dev/null +++ b/drivers/net/ethernet/intel/igc/igc_xdp.h +/* spdx-license-identifier: gpl-2.0 */ +/* copyright (c) 2020, intel corporation. */ + +#ifndef _igc_xdp_h_ +#define _igc_xdp_h_ + +int igc_xdp_set_prog(struct igc_adapter *adapter, struct bpf_prog *prog, + struct netlink_ext_ack *extack); + +#endif /* _igc_xdp_h_ */
|
Networking
|
26575105d6ed8e2a8e43bd008fc7d98b75b90d5c
|
andre guedes
|
drivers
|
net
|
ethernet, igc, intel
|
igc: add support for xdp_tx action
|
add support for xdp_tx action which enables xdp programs to transmit back receiving frames.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add xdp support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['igc ']
|
['h', 'c']
| 4
| 204
| 11
|
--- diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h + + struct xdp_rxq_info xdp_rxq; + + igc_tx_flags_xdp = 0x100, - struct sk_buff *skb; + union { + struct sk_buff *skb; + struct xdp_frame *xdpf; + }; diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c +#define igc_xdp_tx bit(1) - /* free all the tx ring sk_buffs */ - dev_kfree_skb_any(tx_buffer->skb); + if (tx_buffer->tx_flags & igc_tx_flags_xdp) + xdp_return_frame(tx_buffer->xdpf); + else + dev_kfree_skb_any(tx_buffer->skb); + igc_xdp_unregister_rxq_info(rx_ring); + - int size, desc_len; + int size, desc_len, res; + + res = igc_xdp_register_rxq_info(rx_ring); + if (res < 0) + return res; + igc_xdp_unregister_rxq_info(rx_ring); +static int igc_xdp_init_tx_buffer(struct igc_tx_buffer *buffer, + struct xdp_frame *xdpf, + struct igc_ring *ring) +{ + dma_addr_t dma; + + dma = dma_map_single(ring->dev, xdpf->data, xdpf->len, dma_to_device); + if (dma_mapping_error(ring->dev, dma)) { + netdev_err_once(ring->netdev, "failed to map dma for tx "); + return -enomem; + } + + buffer->xdpf = xdpf; + buffer->tx_flags = igc_tx_flags_xdp; + buffer->protocol = 0; + buffer->bytecount = xdpf->len; + buffer->gso_segs = 1; + buffer->time_stamp = jiffies; + dma_unmap_len_set(buffer, len, xdpf->len); + dma_unmap_addr_set(buffer, dma, dma); + return 0; +} + +/* this function requires __netif_tx_lock is held by the caller. */ +static int igc_xdp_init_tx_descriptor(struct igc_ring *ring, + struct xdp_frame *xdpf) +{ + struct igc_tx_buffer *buffer; + union igc_adv_tx_desc *desc; + u32 cmd_type, olinfo_status; + int err; + + if (!igc_desc_unused(ring)) + return -ebusy; + + buffer = &ring->tx_buffer_info[ring->next_to_use]; + err = igc_xdp_init_tx_buffer(buffer, xdpf, ring); + if (err) + return err; + + cmd_type = igc_advtxd_dtyp_data | igc_advtxd_dcmd_dext | + igc_advtxd_dcmd_ifcs | igc_txd_dcmd | + buffer->bytecount; + olinfo_status = buffer->bytecount << igc_advtxd_paylen_shift; + + desc = igc_tx_desc(ring, ring->next_to_use); + desc->read.cmd_type_len = cpu_to_le32(cmd_type); + desc->read.olinfo_status = cpu_to_le32(olinfo_status); + desc->read.buffer_addr = cpu_to_le64(dma_unmap_addr(buffer, dma)); + + netdev_tx_sent_queue(txring_txq(ring), buffer->bytecount); + + buffer->next_to_watch = desc; + + ring->next_to_use++; + if (ring->next_to_use == ring->count) + ring->next_to_use = 0; + + return 0; +} + +static struct igc_ring *igc_xdp_get_tx_ring(struct igc_adapter *adapter, + int cpu) +{ + int index = cpu; + + if (unlikely(index < 0)) + index = 0; + + while (index >= adapter->num_tx_queues) + index -= adapter->num_tx_queues; + + return adapter->tx_ring[index]; +} + +static int igc_xdp_xmit_back(struct igc_adapter *adapter, struct xdp_buff *xdp) +{ + struct xdp_frame *xdpf = xdp_convert_buff_to_frame(xdp); + int cpu = smp_processor_id(); + struct netdev_queue *nq; + struct igc_ring *ring; + int res; + + if (unlikely(!xdpf)) + return -efault; + + ring = igc_xdp_get_tx_ring(adapter, cpu); + nq = txring_txq(ring); + + __netif_tx_lock(nq, cpu); + res = igc_xdp_init_tx_descriptor(ring, xdpf); + __netif_tx_unlock(nq); + return res; +} + + case xdp_tx: + if (igc_xdp_xmit_back(adapter, xdp) < 0) + res = igc_xdp_consumed; + else + res = igc_xdp_tx; + break; +/* this function assumes __netif_tx_lock is held by the caller. */ +static void igc_flush_tx_descriptors(struct igc_ring *ring) +{ + /* once tail pointer is updated, hardware can fetch the descriptors + * any time so we issue a write membar here to ensure all memory + * writes are complete before the tail pointer is updated. + */ + wmb(); + writel(ring->next_to_use, ring->tail); +} + +static void igc_finalize_xdp(struct igc_adapter *adapter, int status) +{ + int cpu = smp_processor_id(); + struct netdev_queue *nq; + struct igc_ring *ring; + + if (status & igc_xdp_tx) { + ring = igc_xdp_get_tx_ring(adapter, cpu); + nq = txring_txq(ring); + + __netif_tx_lock(nq, cpu); + igc_flush_tx_descriptors(ring); + __netif_tx_unlock(nq); + } +} + + struct igc_adapter *adapter = q_vector->adapter; + int xdp_status = 0; + unsigned int size, truesize; - unsigned int size; + truesize = igc_get_rx_frame_truesize(rx_ring, size); - struct igc_adapter *adapter = q_vector->adapter; - - xdp.frame_sz = igc_get_rx_frame_truesize(rx_ring, size); + xdp.frame_sz = truesize; + xdp.rxq = &rx_ring->xdp_rxq; - rx_buffer->pagecnt_bias++; + unsigned int xdp_res = -ptr_err(skb); + + switch (xdp_res) { + case igc_xdp_consumed: + rx_buffer->pagecnt_bias++; + break; + case igc_xdp_tx: + igc_rx_buffer_flip(rx_buffer, truesize); + xdp_status |= xdp_res; + break; + } + + if (xdp_status) + igc_finalize_xdp(adapter, xdp_status); + - /* free the skb */ - napi_consume_skb(tx_buffer->skb, napi_budget); + if (tx_buffer->tx_flags & igc_tx_flags_xdp) + xdp_return_frame(tx_buffer->xdpf); + else + napi_consume_skb(tx_buffer->skb, napi_budget); diff --git a/drivers/net/ethernet/intel/igc/igc_xdp.c b/drivers/net/ethernet/intel/igc/igc_xdp.c --- a/drivers/net/ethernet/intel/igc/igc_xdp.c +++ b/drivers/net/ethernet/intel/igc/igc_xdp.c + +int igc_xdp_register_rxq_info(struct igc_ring *ring) +{ + struct net_device *dev = ring->netdev; + int err; + + err = xdp_rxq_info_reg(&ring->xdp_rxq, dev, ring->queue_index, 0); + if (err) { + netdev_err(dev, "failed to register xdp rxq info "); + return err; + } + + err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq, mem_type_page_shared, + null); + if (err) { + netdev_err(dev, "failed to register xdp rxq mem model "); + xdp_rxq_info_unreg(&ring->xdp_rxq); + return err; + } + + return 0; +} + +void igc_xdp_unregister_rxq_info(struct igc_ring *ring) +{ + xdp_rxq_info_unreg(&ring->xdp_rxq); +} diff --git a/drivers/net/ethernet/intel/igc/igc_xdp.h b/drivers/net/ethernet/intel/igc/igc_xdp.h --- a/drivers/net/ethernet/intel/igc/igc_xdp.h +++ b/drivers/net/ethernet/intel/igc/igc_xdp.h +int igc_xdp_register_rxq_info(struct igc_ring *ring); +void igc_xdp_unregister_rxq_info(struct igc_ring *ring); +
|
Networking
|
73f1071c1d2952b8c93cd6cd99744768c59ec840
|
andre guedes
|
drivers
|
net
|
ethernet, igc, intel
|
igc: add support for xdp_redirect action
|
add support for the xdp_redirect action which enables xdp programs to redirect packets arriving at i225 nic. it also implements the ndo_xdp_xmit ops, enabling the igc driver to transmit packets forwarded to it by xdp programs running on other interfaces.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add xdp support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['igc ']
|
['c']
| 1
| 73
| 11
|
--- diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c +#define igc_xdp_redirect bit(2) - const unsigned int size) + const unsigned int size, + int *rx_buffer_pgcnt) + *rx_buffer_pgcnt = +#if (page_size < 8192) + page_count(rx_buffer->page); +#else + 0; +#endif -static bool igc_can_reuse_rx_page(struct igc_rx_buffer *rx_buffer) +static bool igc_can_reuse_rx_page(struct igc_rx_buffer *rx_buffer, + int rx_buffer_pgcnt) - if (unlikely((page_ref_count(page) - pagecnt_bias) > 1)) + if (unlikely((rx_buffer_pgcnt - pagecnt_bias) > 1)) - if (unlikely(!pagecnt_bias)) { - page_ref_add(page, ushrt_max); + if (unlikely(pagecnt_bias == 1)) { + page_ref_add(page, ushrt_max - 1); - struct igc_rx_buffer *rx_buffer) + struct igc_rx_buffer *rx_buffer, + int rx_buffer_pgcnt) - if (igc_can_reuse_rx_page(rx_buffer)) { + if (igc_can_reuse_rx_page(rx_buffer, rx_buffer_pgcnt)) { - bi->pagecnt_bias = 1; + page_ref_add(page, ushrt_max - 1); + bi->pagecnt_bias = ushrt_max; + case xdp_redirect: + if (xdp_do_redirect(adapter->netdev, xdp, prog) < 0) + res = igc_xdp_consumed; + else + res = igc_xdp_redirect; + break; + + if (status & igc_xdp_redirect) + xdp_do_flush(); - int xdp_status = 0; + int xdp_status = 0, rx_buffer_pgcnt; - rx_buffer = igc_get_rx_buffer(rx_ring, size); + rx_buffer = igc_get_rx_buffer(rx_ring, size, &rx_buffer_pgcnt); + case igc_xdp_redirect: - igc_put_rx_buffer(rx_ring, rx_buffer); + igc_put_rx_buffer(rx_ring, rx_buffer, rx_buffer_pgcnt); +static int igc_xdp_xmit(struct net_device *dev, int num_frames, + struct xdp_frame **frames, u32 flags) +{ + struct igc_adapter *adapter = netdev_priv(dev); + int cpu = smp_processor_id(); + struct netdev_queue *nq; + struct igc_ring *ring; + int i, drops; + + if (unlikely(test_bit(__igc_down, &adapter->state))) + return -enetdown; + + if (unlikely(flags & ~xdp_xmit_flags_mask)) + return -einval; + + ring = igc_xdp_get_tx_ring(adapter, cpu); + nq = txring_txq(ring); + + __netif_tx_lock(nq, cpu); + + drops = 0; + for (i = 0; i < num_frames; i++) { + int err; + struct xdp_frame *xdpf = frames[i]; + + err = igc_xdp_init_tx_descriptor(ring, xdpf); + if (err) { + xdp_return_frame_rx_napi(xdpf); + drops++; + } + } + + if (flags & xdp_xmit_flush) + igc_flush_tx_descriptors(ring); + + __netif_tx_unlock(nq); + + return num_frames - drops; +} + + .ndo_xdp_xmit = igc_xdp_xmit,
|
Networking
|
4ff3203610928cac82d5627ce803559e78d61b91
|
andre guedes
|
drivers
|
net
|
ethernet, igc, intel
|
igc: expose lpi counters
|
expose eee tx and rx low power idle counters via ethtool a eee tx or rx lpi event occurs when the transmitter or the receiver enters eee (ieee802.3az) lpi state. ethtool --statistics <iface>
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
expose lpi counters
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['igc ']
|
['c']
| 1
| 2
| 0
|
--- diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c + igc_stat("tx_lpi_counter", stats.tlpic), + igc_stat("rx_lpi_counter", stats.rlpic),
|
Networking
|
1feaf60ff26086d4ae212c0fd61ff5755e1fd10c
|
sasha neftin dvora fuxbrumer dvorax fuxbrumer linux intel com
|
drivers
|
net
|
ethernet, igc, intel
|
ionic: add new queue features to interface
|
add queue feature extensions to prepare for features that can be queue specific, in addition to the general queue features already defined. while we're here, change the existing feature ids from #defines to enum.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['h', 'c']
| 3
| 25
| 6
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h + u64 features; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h --- a/drivers/net/ethernet/pensando/ionic/ionic_if.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h +/** + * enum ionic_q_feature - common features for most queue types + * + * common features use bits 0-15. per-queue-type features use higher bits. + * + * @ionic_qident_f_cq: queue has completion ring + * @ionic_qident_f_sg: queue has scatter/gather ring + * @ionic_qident_f_eq: queue can use event queue + * @ionic_qident_f_cmb: queue is in cmb bar + */ +enum ionic_q_feature { + ionic_qident_f_cq = bit_ull(0), + ionic_qident_f_sg = bit_ull(1), + ionic_qident_f_eq = bit_ull(2), + ionic_qident_f_cmb = bit_ull(3), +}; + - * @features: queue features + * @features: queue features (enum ionic_q_feature, etc) -#define ionic_qident_f_cq 0x01 /* queue has completion ring */ -#define ionic_qident_f_sg 0x02 /* queue has scatter/gather ring */ -#define ionic_qident_f_eq 0x04 /* queue can use event queue */ -#define ionic_qident_f_cmb 0x08 /* queue is in cmb bar */ + * @features: mask of queue features to enable, if not in the flags above. - u8 rsvd2[20]; + u8 rsvd2[12]; + __le64 features; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c + .features = cpu_to_le64(q->features), + .features = cpu_to_le64(q->features), + swap(a->q.features, b->q.features);
|
Networking
|
57a3a98d7c0ab17a264e30fdc166a0646f900b99
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: add handling of larger descriptors
|
in preparating for hardware timestamping, we need to support large tx and rx completion descriptors. here we add the new queue feature ids and handling for the completion descriptor sizes.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['h', 'c']
| 4
| 73
| 29
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h --- a/drivers/net/ethernet/pensando/ionic/ionic_if.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h + * @ionic_q_f_2x_desc: double main descriptor size + * @ionic_q_f_2x_cq_desc: double cq descriptor size + * @ionic_q_f_2x_sg_desc: double sg descriptor size + * @ionic_q_f_4x_desc: quadruple main descriptor size + * @ionic_q_f_4x_cq_desc: quadruple cq descriptor size + * @ionic_q_f_4x_sg_desc: quadruple sg descriptor size + ionic_q_f_2x_desc = bit_ull(4), + ionic_q_f_2x_cq_desc = bit_ull(5), + ionic_q_f_2x_sg_desc = bit_ull(6), + ionic_q_f_4x_desc = bit_ull(7), + ionic_q_f_4x_cq_desc = bit_ull(8), + ionic_q_f_4x_sg_desc = bit_ull(9), diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c - unsigned int sg_desc_sz; + unsigned int num_desc, desc_sz, comp_sz, sg_desc_sz; + num_desc = lif->ntxq_descs; + desc_sz = sizeof(struct ionic_txq_desc); + comp_sz = sizeof(struct ionic_txq_comp); + - lif->ntxq_descs, - sizeof(struct ionic_txq_desc), - sizeof(struct ionic_txq_comp), - sg_desc_sz, + num_desc, desc_sz, comp_sz, sg_desc_sz, + + num_desc = lif->nrxq_descs; + desc_sz = sizeof(struct ionic_rxq_desc); + comp_sz = sizeof(struct ionic_rxq_comp); + sg_desc_sz = sizeof(struct ionic_rxq_sg_desc); + + if (lif->rxq_features & ionic_q_f_2x_cq_desc) + comp_sz *= 2; + - lif->nrxq_descs, - sizeof(struct ionic_rxq_desc), - sizeof(struct ionic_rxq_comp), - sizeof(struct ionic_rxq_sg_desc), + num_desc, desc_sz, comp_sz, sg_desc_sz, + lif->rxqcqs[i]->q.features = lif->rxq_features; + + swap(a->q.desc_size, b->q.desc_size); + swap(a->q.sg_desc_size, b->q.sg_desc_size); + swap(a->cq.desc_size, b->cq.desc_size); + unsigned int num_desc, desc_sz, comp_sz, sg_desc_sz; - unsigned int sg_desc_sz; - if (qparam->nxqs != lif->nxqs || qparam->nrxq_descs != lif->nrxq_descs) { + if (qparam->nxqs != lif->nxqs || + qparam->nrxq_descs != lif->nrxq_descs || + qparam->rxq_features != lif->rxq_features) { - if (lif->qtype_info[ionic_qtype_txq].version >= 1 && - lif->qtype_info[ionic_qtype_txq].sg_desc_sz == - sizeof(struct ionic_txq_sg_desc_v1)) - sg_desc_sz = sizeof(struct ionic_txq_sg_desc_v1); - else - sg_desc_sz = sizeof(struct ionic_txq_sg_desc); - + num_desc = qparam->ntxq_descs; + desc_sz = sizeof(struct ionic_txq_desc); + comp_sz = sizeof(struct ionic_txq_comp); + + if (lif->qtype_info[ionic_qtype_txq].version >= 1 && + lif->qtype_info[ionic_qtype_txq].sg_desc_sz == + sizeof(struct ionic_txq_sg_desc_v1)) + sg_desc_sz = sizeof(struct ionic_txq_sg_desc_v1); + else + sg_desc_sz = sizeof(struct ionic_txq_sg_desc); + - qparam->ntxq_descs, - sizeof(struct ionic_txq_desc), - sizeof(struct ionic_txq_comp), - sg_desc_sz, + num_desc, desc_sz, comp_sz, sg_desc_sz, + num_desc = qparam->nrxq_descs; + desc_sz = sizeof(struct ionic_rxq_desc); + comp_sz = sizeof(struct ionic_rxq_comp); + sg_desc_sz = sizeof(struct ionic_rxq_sg_desc); + + if (qparam->rxq_features & ionic_q_f_2x_cq_desc) + comp_sz *= 2; + - qparam->nrxq_descs, - sizeof(struct ionic_rxq_desc), - sizeof(struct ionic_rxq_comp), - sizeof(struct ionic_rxq_sg_desc), + num_desc, desc_sz, comp_sz, sg_desc_sz, + + rx_qcqs[i]->q.features = qparam->rxq_features; + swap(lif->rxq_features, qparam->rxq_features); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h + u64 rxq_features; + u64 rxq_features; + qparam->rxq_features = lif->rxq_features; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c - struct ionic_rxq_comp *comp = cq_info->rxcq; + struct ionic_rxq_comp *comp; + comp = cq_info->cq_desc + qcq->cq.desc_size - sizeof(*comp); + - struct ionic_rxq_comp *comp = cq_info->rxcq; + struct ionic_rxq_comp *comp; + + comp = cq_info->cq_desc + cq->desc_size - sizeof(*comp); - struct ionic_txq_comp *comp = cq_info->txcq; + struct ionic_txq_comp *comp; + comp = cq_info->cq_desc + cq->desc_size - sizeof(*comp); +
|
Networking
|
0ec9f6669a7dc3041a0d9619489de05ac0146e3b
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: add hw timestamp structs to interface
|
the interface for hardware timestamping includes a new fw request, device identity fields, tx and rx queue feature bits, a new rx filter type, the beginnings of rx packet classifications, and hardware timestamp registers.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['h']
| 2
| 170
| 6
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h +static_assert(sizeof(struct ionic_lif_setphc_cmd) == 64); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h --- a/drivers/net/ethernet/pensando/ionic/ionic_if.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h + ionic_cmd_lif_setphc = 25, + * @hwstamp_mask: bitmask for subtraction of hardware tick values. + * @hwstamp_mult: hardware tick to nanosecond multiplier. + * @hwstamp_shift: hardware tick to nanosecond divisor (power of two). + __le64 hwstamp_mask; + __le32 hwstamp_mult; + __le32 hwstamp_shift; +/** + * enum ionic_rxq_feature - rxq-specific features + * + * per-queue-type features use bits 16 and higher. + * + * @ionic_rxq_f_hwstamp: queue supports hardware timestamping + */ +enum ionic_rxq_feature { + ionic_rxq_f_hwstamp = bit_ull(16), +}; + +/** + * enum ionic_txq_feature - txq-specific features + * + * per-queue-type features use bits 16 and higher. + * + * @ionic_txq_f_hwstamp: queue supports hardware timestamping + */ +enum ionic_txq_feature { + ionic_txq_f_hwstamp = bit(16), +}; + +/** + * struct ionic_hwstamp_bits - hardware timestamp decoding bits + * @ionic_hwstamp_invalid: invalid hardware timestamp value + * @ionic_hwstamp_cq_negoffset: timestamp field negative offset + * from the base cq descriptor. + */ +enum ionic_hwstamp_bits { + ionic_hwstamp_invalid = ~0ull, + ionic_hwstamp_cq_negoffset = 8, +}; + + * @hwstamp_tx_modes: bitmask of bit_ull(enum ionic_txstamp_mode) + * @hwstamp_rx_filters: bitmask of enum ionic_pkt_class - u8 rsvd2[106]; + u8 rsvd2[2]; + __le64 hwstamp_tx_modes; + __le64 hwstamp_rx_filters; + u8 rsvd3[88]; - ionic_eth_hw_tso_geneve = bit(19) + ionic_eth_hw_tso_geneve = bit(19), + ionic_eth_hw_timestamp = bit(20), +}; + +/** + * enum ionic_pkt_class - packet classification mask. + * + * used with rx steering filter, packets indicated by the mask can be steered + * toward a specific receive queue. + * + * @ionic_pkt_cls_ntp_all: all ntp packets. + * @ionic_pkt_cls_ptp1_sync: ptpv1 sync + * @ionic_pkt_cls_ptp1_dreq: ptpv1 delay-request + * @ionic_pkt_cls_ptp1_all: ptpv1 all packets + * @ionic_pkt_cls_ptp2_l4_sync: ptpv2-udp sync + * @ionic_pkt_cls_ptp2_l4_dreq: ptpv2-udp delay-request + * @ionic_pkt_cls_ptp2_l4_all: ptpv2-udp all packets + * @ionic_pkt_cls_ptp2_l2_sync: ptpv2-eth sync + * @ionic_pkt_cls_ptp2_l2_dreq: ptpv2-eth delay-request + * @ionic_pkt_cls_ptp2_l2_all: ptpv2-eth all packets + * @ionic_pkt_cls_ptp2_sync: ptpv2 sync + * @ionic_pkt_cls_ptp2_dreq: ptpv2 delay-request + * @ionic_pkt_cls_ptp2_all: ptpv2 all packets + * @ionic_pkt_cls_ptp_sync: ptp sync + * @ionic_pkt_cls_ptp_dreq: ptp delay-request + * @ionic_pkt_cls_ptp_all: ptp all packets + */ +enum ionic_pkt_class { + ionic_pkt_cls_ntp_all = bit(0), + + ionic_pkt_cls_ptp1_sync = bit(1), + ionic_pkt_cls_ptp1_dreq = bit(2), + ionic_pkt_cls_ptp1_all = bit(3) | + ionic_pkt_cls_ptp1_sync | ionic_pkt_cls_ptp1_dreq, + + ionic_pkt_cls_ptp2_l4_sync = bit(4), + ionic_pkt_cls_ptp2_l4_dreq = bit(5), + ionic_pkt_cls_ptp2_l4_all = bit(6) | + ionic_pkt_cls_ptp2_l4_sync | ionic_pkt_cls_ptp2_l4_dreq, + + ionic_pkt_cls_ptp2_l2_sync = bit(7), + ionic_pkt_cls_ptp2_l2_dreq = bit(8), + ionic_pkt_cls_ptp2_l2_all = bit(9) | + ionic_pkt_cls_ptp2_l2_sync | ionic_pkt_cls_ptp2_l2_dreq, + + ionic_pkt_cls_ptp2_sync = + ionic_pkt_cls_ptp2_l4_sync | ionic_pkt_cls_ptp2_l2_sync, + ionic_pkt_cls_ptp2_dreq = + ionic_pkt_cls_ptp2_l4_dreq | ionic_pkt_cls_ptp2_l2_dreq, + ionic_pkt_cls_ptp2_all = + ionic_pkt_cls_ptp2_l4_all | ionic_pkt_cls_ptp2_l2_all, + + ionic_pkt_cls_ptp_sync = + ionic_pkt_cls_ptp1_sync | ionic_pkt_cls_ptp2_sync, + ionic_pkt_cls_ptp_dreq = + ionic_pkt_cls_ptp1_dreq | ionic_pkt_cls_ptp2_dreq, + ionic_pkt_cls_ptp_all = + ionic_pkt_cls_ptp1_all | ionic_pkt_cls_ptp2_all, +/** + * enum ionic_txstamp_mode - list of tx timestamping modes + * @ionic_txstamp_off: disable tx hardware timetamping. + * @ionic_txstamp_on: enable local tx hardware timetamping. + * @ionic_txstamp_onestep_sync: modify tx ptp sync packets. + * @ionic_txstamp_onestep_p2p: modify tx ptp sync and pdelayresp. + */ +enum ionic_txstamp_mode { + ionic_txstamp_off = 0, + ionic_txstamp_on = 1, + ionic_txstamp_onestep_sync = 2, + ionic_txstamp_onestep_p2p = 3, +}; + + * @ionic_lif_attr_txstamp: lif tx timestamping mode + ionic_lif_attr_txstamp = 7, + * @txstamp: tx timestamping mode (enum ionic_txstamp_mode) + __le16 txstamp_mode; + * @txstamp: tx timestamping mode (enum ionic_txstamp_mode) + __le16 txstamp_mode; +/** + * struct ionic_lif_setphc_cmd - set lif ptp hardware clock + * @opcode: opcode + * @lif_index: lif index + * @tick: hardware stamp tick of an instant in time. + * @nsec: nanosecond stamp of the same instant. + * @frac: fractional nanoseconds at the same instant. + * @mult: cycle to nanosecond multiplier. + * @shift: cycle to nanosecond divisor (power of two). + */ +struct ionic_lif_setphc_cmd { + u8 opcode; + u8 rsvd1; + __le16 lif_index; + u8 rsvd2[4]; + __le64 tick; + __le64 nsec; + __le64 frac; + __le32 mult; + __le32 shift; + u8 rsvd3[24]; +}; + - ionic_rx_filter_match_vlan = 0, - ionic_rx_filter_match_mac, - ionic_rx_filter_match_mac_vlan, + ionic_rx_filter_match_vlan = 0x0, + ionic_rx_filter_match_mac = 0x1, + ionic_rx_filter_match_mac_vlan = 0x2, + ionic_rx_filter_steer_pktclass = 0x10, + * @pkt_class: packet classification filter + __le64 pkt_class; - }; + } __packed; +/** + * struct ionic_hwstamp_regs - hardware current timestamp registers + * @tick_low: low 32 bits of hardware timestamp + * @tick_high: high 32 bits of hardware timestamp + */ +struct ionic_hwstamp_regs { + u32 tick_low; + u32 tick_high; +}; + + * @hwstamp_regs: hardware current timestamp registers + u8 rsvd_pad1024[948]; + struct ionic_hwstamp_regs hwstamp; + struct ionic_lif_setphc_cmd lif_setphc; + struct ionic_admin_comp lif_setphc;
|
Networking
|
3da258439e89d03515e5bc4ff021012f2ec87260
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: split adminq post and wait calls
|
split the wait part out of adminq_post_wait() into a separate function so that a caller can have finer grain control over the sequencing of operations and locking.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['h', 'c']
| 2
| 13
| 4
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic.h b/drivers/net/ethernet/pensando/ionic/ionic.h --- a/drivers/net/ethernet/pensando/ionic/ionic.h +++ b/drivers/net/ethernet/pensando/ionic/ionic.h +int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx); +int ionic_adminq_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, int err); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c -static int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) +int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) -int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) +int ionic_adminq_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, int err) - int err; - err = ionic_adminq_post(lif, ctx); +int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) +{ + int err; + + err = ionic_adminq_post(lif, ctx); + + return ionic_adminq_wait(lif, ctx, err); +} +
|
Networking
|
4f1704faa0131ab70a097145a6f144c00051e46a
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: add hw timestamp support files
|
this adds the file of code for supporting tx and rx hardware timestamps and the raw clock interface, but does not yet link it in for compiling or use.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['c']
| 1
| 589
| 0
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c --- /dev/null +++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c +// spdx-license-identifier: gpl-2.0 +/* copyright(c) 2017 - 2021 pensando systems, inc */ + +#include <linux/netdevice.h> +#include <linux/etherdevice.h> + +#include "ionic.h" +#include "ionic_bus.h" +#include "ionic_lif.h" +#include "ionic_ethtool.h" + +static int ionic_hwstamp_tx_mode(int config_tx_type) +{ + switch (config_tx_type) { + case hwtstamp_tx_off: + return ionic_txstamp_off; + case hwtstamp_tx_on: + return ionic_txstamp_on; + case hwtstamp_tx_onestep_sync: + return ionic_txstamp_onestep_sync; +#ifdef have_hwstamp_tx_onestep_p2p + case hwtstamp_tx_onestep_p2p: + return ionic_txstamp_onestep_p2p; +#endif + default: + return -erange; + } +} + +static u64 ionic_hwstamp_rx_filt(int config_rx_filter) +{ + switch (config_rx_filter) { + case hwtstamp_filter_ptp_v1_l4_event: + return ionic_pkt_cls_ptp1_all; + case hwtstamp_filter_ptp_v1_l4_sync: + return ionic_pkt_cls_ptp1_sync; + case hwtstamp_filter_ptp_v1_l4_delay_req: + return ionic_pkt_cls_ptp1_sync | ionic_pkt_cls_ptp1_dreq; + + case hwtstamp_filter_ptp_v2_l4_event: + return ionic_pkt_cls_ptp2_l4_all; + case hwtstamp_filter_ptp_v2_l4_sync: + return ionic_pkt_cls_ptp2_l4_sync; + case hwtstamp_filter_ptp_v2_l4_delay_req: + return ionic_pkt_cls_ptp2_l4_sync | ionic_pkt_cls_ptp2_l4_dreq; + + case hwtstamp_filter_ptp_v2_l2_event: + return ionic_pkt_cls_ptp2_l2_all; + case hwtstamp_filter_ptp_v2_l2_sync: + return ionic_pkt_cls_ptp2_l2_sync; + case hwtstamp_filter_ptp_v2_l2_delay_req: + return ionic_pkt_cls_ptp2_l2_sync | ionic_pkt_cls_ptp2_l2_dreq; + + case hwtstamp_filter_ptp_v2_event: + return ionic_pkt_cls_ptp2_all; + case hwtstamp_filter_ptp_v2_sync: + return ionic_pkt_cls_ptp2_sync; + case hwtstamp_filter_ptp_v2_delay_req: + return ionic_pkt_cls_ptp2_sync | ionic_pkt_cls_ptp2_dreq; + + case hwtstamp_filter_ntp_all: + return ionic_pkt_cls_ntp_all; + + default: + return 0; + } +} + +int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) +{ + struct ionic *ionic = lif->ionic; + struct hwtstamp_config config; + int tx_mode = 0; + u64 rx_filt = 0; + int err, err2; + bool rx_all; + __le64 mask; + + if (!lif->phc || !lif->phc->ptp) + return -eopnotsupp; + + if (ifr) { + if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) + return -efault; + } else { + /* if called with ifr == null, behave as if called with the + * current ts_config from the initial cleared state. + */ + memcpy(&config, &lif->phc->ts_config, sizeof(config)); + memset(&lif->phc->ts_config, 0, sizeof(config)); + } + + tx_mode = ionic_hwstamp_tx_mode(config.tx_type); + if (tx_mode < 0) + return tx_mode; + + mask = cpu_to_le64(bit_ull(tx_mode)); + if ((ionic->ident.lif.eth.hwstamp_tx_modes & mask) != mask) + return -erange; + + rx_filt = ionic_hwstamp_rx_filt(config.rx_filter); + rx_all = config.rx_filter != hwtstamp_filter_none && !rx_filt; + + mask = cpu_to_le64(rx_filt); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) != mask) { + rx_filt = 0; + rx_all = true; + config.rx_filter = hwtstamp_filter_all; + } + + dev_dbg(ionic->dev, "config_rx_filter %d rx_filt %#llx rx_all %d ", + config.rx_filter, rx_filt, rx_all); + + mutex_lock(&lif->phc->config_lock); + + if (tx_mode) { + err = ionic_lif_create_hwstamp_txq(lif); + if (err) + goto err_queues; + } + + if (rx_filt) { + err = ionic_lif_create_hwstamp_rxq(lif); + if (err) + goto err_queues; + } + + if (tx_mode != lif->phc->ts_config_tx_mode) { + err = ionic_lif_set_hwstamp_txmode(lif, tx_mode); + if (err) + goto err_txmode; + } + + if (rx_filt != lif->phc->ts_config_rx_filt) { + err = ionic_lif_set_hwstamp_rxfilt(lif, rx_filt); + if (err) + goto err_rxfilt; + } + + if (rx_all != (lif->phc->ts_config.rx_filter == hwtstamp_filter_all)) { + err = ionic_lif_config_hwstamp_rxq_all(lif, rx_all); + if (err) + goto err_rxall; + } + + if (ifr) { + err = copy_to_user(ifr->ifr_data, &config, sizeof(config)); + if (err) { + err = -efault; + goto err_final; + } + } + + memcpy(&lif->phc->ts_config, &config, sizeof(config)); + lif->phc->ts_config_rx_filt = rx_filt; + lif->phc->ts_config_tx_mode = tx_mode; + + mutex_unlock(&lif->phc->config_lock); + + return 0; + +err_final: + if (rx_all != (lif->phc->ts_config.rx_filter == hwtstamp_filter_all)) { + rx_all = lif->phc->ts_config.rx_filter == hwtstamp_filter_all; + err2 = ionic_lif_config_hwstamp_rxq_all(lif, rx_all); + if (err2) + dev_err(ionic->dev, + "failed to revert all-rxq timestamp config: %d ", err2); + } +err_rxall: + if (rx_filt != lif->phc->ts_config_rx_filt) { + rx_filt = lif->phc->ts_config_rx_filt; + err2 = ionic_lif_set_hwstamp_rxfilt(lif, rx_filt); + if (err2) + dev_err(ionic->dev, + "failed to revert rx timestamp filter: %d ", err2); + } +err_rxfilt: + if (tx_mode != lif->phc->ts_config_tx_mode) { + tx_mode = lif->phc->ts_config_tx_mode; + err2 = ionic_lif_set_hwstamp_txmode(lif, tx_mode); + if (err2) + dev_err(ionic->dev, + "failed to revert tx timestamp mode: %d ", err2); + } +err_txmode: + /* special queues remain allocated, just unused */ +err_queues: + mutex_unlock(&lif->phc->config_lock); + return err; +} + +int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr) +{ + struct hwtstamp_config config; + + if (!lif->phc || !lif->phc->ptp) + return -eopnotsupp; + + mutex_lock(&lif->phc->config_lock); + memcpy(&config, &lif->phc->ts_config, sizeof(config)); + mutex_unlock(&lif->phc->config_lock); + + return copy_to_user(ifr->ifr_data, &config, sizeof(config)); +} + +static u64 ionic_hwstamp_read(struct ionic *ionic, + struct ptp_system_timestamp *sts) +{ + u32 tick_high_before, tick_high, tick_low; + + /* read and discard low part to defeat hw staging of high part */ + (void)ioread32(&ionic->idev.hwstamp_regs->tick_low); + + tick_high_before = ioread32(&ionic->idev.hwstamp_regs->tick_high); + + ptp_read_system_prets(sts); + tick_low = ioread32(&ionic->idev.hwstamp_regs->tick_low); + ptp_read_system_postts(sts); + + tick_high = ioread32(&ionic->idev.hwstamp_regs->tick_high); + + /* if tick_high changed, re-read tick_low once more. assume tick_high + * cannot change again so soon as in the span of re-reading tick_low. + */ + if (tick_high != tick_high_before) { + ptp_read_system_prets(sts); + tick_low = ioread32(&ionic->idev.hwstamp_regs->tick_low); + ptp_read_system_postts(sts); + } + + return (u64)tick_low | ((u64)tick_high << 32); +} + +static u64 ionic_cc_read(const struct cyclecounter *cc) +{ + struct ionic_phc *phc = container_of(cc, struct ionic_phc, cc); + struct ionic *ionic = phc->lif->ionic; + + return ionic_hwstamp_read(ionic, null); +} + +static int ionic_setphc_cmd(struct ionic_phc *phc, struct ionic_admin_ctx *ctx) +{ + ctx->work = completion_initializer_onstack(ctx->work); + + ctx->cmd.lif_setphc.opcode = ionic_cmd_lif_setphc; + ctx->cmd.lif_setphc.lif_index = cpu_to_le16(phc->lif->index); + + ctx->cmd.lif_setphc.tick = cpu_to_le64(phc->tc.cycle_last); + ctx->cmd.lif_setphc.nsec = cpu_to_le64(phc->tc.nsec); + ctx->cmd.lif_setphc.frac = cpu_to_le64(phc->tc.frac); + ctx->cmd.lif_setphc.mult = cpu_to_le32(phc->cc.mult); + ctx->cmd.lif_setphc.shift = cpu_to_le32(phc->cc.shift); + + return ionic_adminq_post(phc->lif, ctx); +} + +static int ionic_phc_adjfine(struct ptp_clock_info *info, long scaled_ppm) +{ + struct ionic_phc *phc = container_of(info, struct ionic_phc, ptp_info); + struct ionic_admin_ctx ctx = {}; + unsigned long irqflags; + s64 adj; + int err; + + /* reject phc adjustments during device upgrade */ + if (test_bit(ionic_lif_f_fw_reset, phc->lif->state)) + return -ebusy; + + /* adjustment value scaled by 2^16 million */ + adj = (s64)scaled_ppm * phc->init_cc_mult; + + /* adjustment value to scale */ + adj /= (s64)scaled_ppm; + + /* final adjusted multiplier */ + adj += phc->init_cc_mult; + + spin_lock_irqsave(&phc->lock, irqflags); + + /* update the point-in-time basis to now, before adjusting the rate */ + timecounter_read(&phc->tc); + phc->cc.mult = adj; + + /* setphc commands are posted in-order, sequenced by phc->lock. we + * need to drop the lock before waiting for the command to complete. + */ + err = ionic_setphc_cmd(phc, &ctx); + + spin_unlock_irqrestore(&phc->lock, irqflags); + + return ionic_adminq_wait(phc->lif, &ctx, err); +} + +static int ionic_phc_adjtime(struct ptp_clock_info *info, s64 delta) +{ + struct ionic_phc *phc = container_of(info, struct ionic_phc, ptp_info); + struct ionic_admin_ctx ctx = {}; + unsigned long irqflags; + int err; + + /* reject phc adjustments during device upgrade */ + if (test_bit(ionic_lif_f_fw_reset, phc->lif->state)) + return -ebusy; + + spin_lock_irqsave(&phc->lock, irqflags); + + timecounter_adjtime(&phc->tc, delta); + + /* setphc commands are posted in-order, sequenced by phc->lock. we + * need to drop the lock before waiting for the command to complete. + */ + err = ionic_setphc_cmd(phc, &ctx); + + spin_unlock_irqrestore(&phc->lock, irqflags); + + return ionic_adminq_wait(phc->lif, &ctx, err); +} + +static int ionic_phc_settime64(struct ptp_clock_info *info, + const struct timespec64 *ts) +{ + struct ionic_phc *phc = container_of(info, struct ionic_phc, ptp_info); + struct ionic_admin_ctx ctx = {}; + unsigned long irqflags; + int err; + u64 ns; + + /* reject phc adjustments during device upgrade */ + if (test_bit(ionic_lif_f_fw_reset, phc->lif->state)) + return -ebusy; + + ns = timespec64_to_ns(ts); + + spin_lock_irqsave(&phc->lock, irqflags); + + timecounter_init(&phc->tc, &phc->cc, ns); + + /* setphc commands are posted in-order, sequenced by phc->lock. we + * need to drop the lock before waiting for the command to complete. + */ + err = ionic_setphc_cmd(phc, &ctx); + + spin_unlock_irqrestore(&phc->lock, irqflags); + + return ionic_adminq_wait(phc->lif, &ctx, err); +} + +static int ionic_phc_gettimex64(struct ptp_clock_info *info, + struct timespec64 *ts, + struct ptp_system_timestamp *sts) +{ + struct ionic_phc *phc = container_of(info, struct ionic_phc, ptp_info); + struct ionic *ionic = phc->lif->ionic; + unsigned long irqflags; + u64 tick, ns; + + /* do not attempt to read device time during upgrade */ + if (test_bit(ionic_lif_f_fw_reset, phc->lif->state)) + return -ebusy; + + spin_lock_irqsave(&phc->lock, irqflags); + + tick = ionic_hwstamp_read(ionic, sts); + + ns = timecounter_cyc2time(&phc->tc, tick); + + spin_unlock_irqrestore(&phc->lock, irqflags); + + *ts = ns_to_timespec64(ns); + + return 0; +} + +static long ionic_phc_aux_work(struct ptp_clock_info *info) +{ + struct ionic_phc *phc = container_of(info, struct ionic_phc, ptp_info); + struct ionic_admin_ctx ctx = {}; + unsigned long irqflags; + int err; + + /* do not update phc during device upgrade, but keep polling to resume + * after upgrade. since we don't update the point in time basis, there + * is no expectation that we are maintaining the phc time during the + * upgrade. after upgrade, it will need to be readjusted back to the + * correct time by the ptp daemon. + */ + if (test_bit(ionic_lif_f_fw_reset, phc->lif->state)) + return phc->aux_work_delay; + + spin_lock_irqsave(&phc->lock, irqflags); + + /* update point-in-time basis to now */ + timecounter_read(&phc->tc); + + /* setphc commands are posted in-order, sequenced by phc->lock. we + * need to drop the lock before waiting for the command to complete. + */ + err = ionic_setphc_cmd(phc, &ctx); + + spin_unlock_irqrestore(&phc->lock, irqflags); + + ionic_adminq_wait(phc->lif, &ctx, err); + + return phc->aux_work_delay; +} + +ktime_t ionic_lif_phc_ktime(struct ionic_lif *lif, u64 tick) +{ + unsigned long irqflags; + u64 ns; + + if (!lif->phc) + return 0; + + spin_lock_irqsave(&lif->phc->lock, irqflags); + ns = timecounter_cyc2time(&lif->phc->tc, tick); + spin_unlock_irqrestore(&lif->phc->lock, irqflags); + + return ns_to_ktime(ns); +} + +static const struct ptp_clock_info ionic_ptp_info = { + .owner = this_module, + .name = "ionic_ptp", + .adjfine = ionic_phc_adjfine, + .adjtime = ionic_phc_adjtime, + .gettimex64 = ionic_phc_gettimex64, + .settime64 = ionic_phc_settime64, + .do_aux_work = ionic_phc_aux_work, +}; + +void ionic_lif_register_phc(struct ionic_lif *lif) +{ + if (!lif->phc || !(lif->hw_features & ionic_eth_hw_timestamp)) + return; + + lif->phc->ptp = ptp_clock_register(&lif->phc->ptp_info, lif->ionic->dev); + + if (is_err(lif->phc->ptp)) { + dev_warn(lif->ionic->dev, "cannot register phc device: %ld ", + ptr_err(lif->phc->ptp)); + + lif->phc->ptp = null; + } + + if (lif->phc->ptp) + ptp_schedule_worker(lif->phc->ptp, lif->phc->aux_work_delay); +} + +void ionic_lif_unregister_phc(struct ionic_lif *lif) +{ + if (!lif->phc || !lif->phc->ptp) + return; + + ptp_clock_unregister(lif->phc->ptp); + + lif->phc->ptp = null; +} + +void ionic_lif_alloc_phc(struct ionic_lif *lif) +{ + struct ionic *ionic = lif->ionic; + struct ionic_phc *phc; + u64 delay, diff, mult; + u64 frac = 0; + u64 features; + u32 shift; + + if (!ionic->idev.hwstamp_regs) + return; + + features = le64_to_cpu(ionic->ident.lif.eth.config.features); + if (!(features & ionic_eth_hw_timestamp)) + return; + + phc = devm_kzalloc(ionic->dev, sizeof(*phc), gfp_kernel); + if (!phc) + return; + + phc->lif = lif; + + phc->cc.read = ionic_cc_read; + phc->cc.mask = le64_to_cpu(ionic->ident.dev.hwstamp_mask); + phc->cc.mult = le32_to_cpu(ionic->ident.dev.hwstamp_mult); + phc->cc.shift = le32_to_cpu(ionic->ident.dev.hwstamp_shift); + + if (!phc->cc.mult) { + dev_err(lif->ionic->dev, + "invalid device phc mask multiplier %u, disabling hw timestamp support ", + phc->cc.mult); + devm_kfree(lif->ionic->dev, phc); + lif->phc = null; + return; + } + + dev_dbg(lif->ionic->dev, "device phc mask %#llx mult %u shift %u ", + phc->cc.mask, phc->cc.mult, phc->cc.shift); + + spin_lock_init(&phc->lock); + mutex_init(&phc->config_lock); + + /* max ticks is limited by the multiplier, or by the update period. */ + if (phc->cc.shift + 2 + ilog2(ionic_phc_update_ns) >= 64) { + /* max ticks that do not overflow when multiplied by max + * adjusted multiplier (twice the initial multiplier) + */ + diff = u64_max / phc->cc.mult / 2; + } else { + /* approx ticks at four times the update period */ + diff = (u64)ionic_phc_update_ns << (phc->cc.shift + 2); + diff = div_round_up(diff, phc->cc.mult); + } + + /* transform to bitmask */ + diff |= diff >> 1; + diff |= diff >> 2; + diff |= diff >> 4; + diff |= diff >> 8; + diff |= diff >> 16; + diff |= diff >> 32; + + /* constrain to the hardware bitmask, and use this as the bitmask */ + diff &= phc->cc.mask; + phc->cc.mask = diff; + + /* the wrap period is now defined by diff (or phc->cc.mask) + * + * we will update the time basis at about 1/4 the wrap period, so + * should not see a difference of more than +/- diff/4. + * + * this is sufficient not see a difference of more than +/- diff/2, as + * required by timecounter_cyc2time, to detect an old time stamp. + * + * adjust the initial multiplier, being careful to avoid overflow: + * - do not overflow 63 bits: init_cc_mult * scaled_ppm + * - do not overflow 64 bits: max_mult * (diff / 2) + * + * we want to increase the initial multiplier as much as possible, to + * allow for more precise adjustment in ionic_phc_adjfine. + * + * only adjust the multiplier if we can double it or more. + */ + mult = u64_max / 2 / max(diff / 2, scaled_ppm); + shift = mult / phc->cc.mult; + if (shift >= 2) { + /* initial multiplier will be 2^n of hardware cc.mult */ + shift = fls(shift); + /* increase cc.mult and cc.shift by the same 2^n and n. */ + phc->cc.mult <<= shift; + phc->cc.shift += shift; + } + + dev_dbg(lif->ionic->dev, "initial phc mask %#llx mult %u shift %u ", + phc->cc.mask, phc->cc.mult, phc->cc.shift); + + /* frequency adjustments are relative to the initial multiplier */ + phc->init_cc_mult = phc->cc.mult; + + timecounter_init(&phc->tc, &phc->cc, ktime_get_real_ns()); + + /* update cycle_last at 1/4 the wrap period, or ionic_phc_update_ns */ + delay = min_t(u64, ionic_phc_update_ns, + cyclecounter_cyc2ns(&phc->cc, diff / 4, 0, &frac)); + dev_dbg(lif->ionic->dev, "work delay %llu ms ", delay / nsec_per_msec); + + phc->aux_work_delay = nsecs_to_jiffies(delay); + + phc->ptp_info = ionic_ptp_info; + + /* we have allowed to adjust the multiplier up to +/- 1 part per 1. + * here expressed as normal_ppb (1 billion parts per billion). + */ + phc->ptp_info.max_adj = normal_ppb; + + lif->phc = phc; +} + +void ionic_lif_free_phc(struct ionic_lif *lif) +{ + if (!lif->phc) + return; + + mutex_destroy(&lif->phc->config_lock); + + devm_kfree(lif->ionic->dev, lif->phc); + lif->phc = null; +}
|
Networking
|
fee6efce565d1e1c45c31de8e05faed530d0a28c
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: link in the new hw timestamp code
|
these are changes to compile and link the new code, but no new feature support is available or advertised yet.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['h', 'c', 'makefile']
| 7
| 107
| 0
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/makefile b/drivers/net/ethernet/pensando/ionic/makefile --- a/drivers/net/ethernet/pensando/ionic/makefile +++ b/drivers/net/ethernet/pensando/ionic/makefile +ionic-$(config_ptp_1588_clock) += ionic_phc.o diff --git a/drivers/net/ethernet/pensando/ionic/ionic.h b/drivers/net/ethernet/pensando/ionic/ionic.h --- a/drivers/net/ethernet/pensando/ionic/ionic.h +++ b/drivers/net/ethernet/pensando/ionic/ionic.h +#define ionic_phc_update_ns 10000000000 /* 10s in nanoseconds */ +#define normal_ppb 1000000000 /* one billion parts per billion */ +#define scaled_ppm (1000000ull << 16) /* 2^16 million parts per 2^16 million */ + diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c + idev->hwstamp_regs = &idev->dev_info_regs->hwstamp; + diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h + struct ionic_hwstamp_regs __iomem *hwstamp_regs; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +int ionic_lif_create_hwstamp_txq(struct ionic_lif *lif) +{ + return 0; +} + +int ionic_lif_create_hwstamp_rxq(struct ionic_lif *lif) +{ + return 0; +} + +int ionic_lif_config_hwstamp_rxq_all(struct ionic_lif *lif, bool rx_all) +{ + return 0; +} + +int ionic_lif_set_hwstamp_txmode(struct ionic_lif *lif, u16 txstamp_mode) +{ + return 0; +} + +int ionic_lif_set_hwstamp_rxfilt(struct ionic_lif *lif, u64 pkt_class) +{ + return 0; +} + diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h +#include <linux/ptp_clock_kernel.h> +#include <linux/timecounter.h> +#include <uapi/linux/net_tstamp.h> + u64 hwstamp_valid; + u64 hwstamp_invalid; + u64 hwstamp_valid; + u64 hwstamp_invalid; + u64 tx_hwstamp_valid; + u64 tx_hwstamp_invalid; + u64 rx_hwstamp_valid; + u64 rx_hwstamp_invalid; +struct ionic_phc; + + struct ionic_qcq *hwstamp_txq; + struct ionic_qcq *hwstamp_rxq; + struct ionic_phc *phc; + +struct ionic_phc { + spinlock_t lock; /* lock for cc and tc */ + struct cyclecounter cc; + struct timecounter tc; + + struct mutex config_lock; /* lock for ts_config */ + struct hwtstamp_config ts_config; + u64 ts_config_rx_filt; + u32 ts_config_tx_mode; + + u32 init_cc_mult; + long aux_work_delay; + + struct ptp_clock_info ptp_info; + struct ptp_clock *ptp; + struct ionic_lif *lif; +}; + + +#if is_enabled(config_ptp_1588_clock) +int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr); +int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr); +ktime_t ionic_lif_phc_ktime(struct ionic_lif *lif, u64 counter); +void ionic_lif_register_phc(struct ionic_lif *lif); +void ionic_lif_unregister_phc(struct ionic_lif *lif); +void ionic_lif_alloc_phc(struct ionic_lif *lif); +void ionic_lif_free_phc(struct ionic_lif *lif); +#else +static inline int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) +{ + return -eopnotsupp; +} + +static inline int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr) +{ + return -eopnotsupp; +} + +static inline ktime_t ionic_lif_phc_ktime(struct ionic_lif *lif, u64 counter) +{ + return ns_to_ktime(0); +} + +static inline void ionic_lif_register_phc(struct ionic_lif *lif) {} +static inline void ionic_lif_unregister_phc(struct ionic_lif *lif) {} +static inline void ionic_lif_alloc_phc(struct ionic_lif *lif) {} +static inline void ionic_lif_free_phc(struct ionic_lif *lif) {} +#endif + +int ionic_lif_create_hwstamp_txq(struct ionic_lif *lif); +int ionic_lif_create_hwstamp_rxq(struct ionic_lif *lif); +int ionic_lif_config_hwstamp_rxq_all(struct ionic_lif *lif, bool rx_all); +int ionic_lif_set_hwstamp_txmode(struct ionic_lif *lif, u16 txstamp_mode); +int ionic_lif_set_hwstamp_rxfilt(struct ionic_lif *lif, u64 pkt_class); + diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c + case ionic_cmd_lif_setphc: + return "ionic_cmd_lif_setphc";
|
Networking
|
61db421da31b6fb3767df46c9963e87f2a1d2418
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: add rx filtering for hw timestamp steering
|
add handling of the new rx packet classification filter type. this simple bit of classification allows for steering packets to a separate rx queue for processing.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['h', 'c']
| 2
| 22
| 0
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c --- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c + case ionic_rx_filter_steer_pktclass: + key = 0; + break; + +struct ionic_rx_filter *ionic_rx_filter_rxsteer(struct ionic_lif *lif) +{ + struct ionic_rx_filter *f; + struct hlist_head *head; + unsigned int key; + + key = hash_32(0, ionic_rx_filter_hash_bits); + head = &lif->rx_filters.by_hash[key]; + + hlist_for_each_entry(f, head, by_hash) { + if (le16_to_cpu(f->cmd.match) != ionic_rx_filter_steer_pktclass) + continue; + return f; + } + + return null; +} diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.h b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.h --- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.h +struct ionic_rx_filter *ionic_rx_filter_rxsteer(struct ionic_lif *lif);
|
Networking
|
ab470bbe7aba1f9cbed52965ccdc41652951f110
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: set up hw timestamp queues
|
we do hardware timestamping through a separate tx queue, and optionally through a separate rx queue. these queues are allocated, freed, and tracked separately from the basic queue arrays.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['c']
| 1
| 261
| 5
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c - lif->txqstats = devm_kcalloc(dev, lif->ionic->ntxqs_per_lif, + lif->txqstats = devm_kcalloc(dev, lif->ionic->ntxqs_per_lif + 1, - lif->rxqstats = devm_kcalloc(dev, lif->ionic->nrxqs_per_lif, + lif->rxqstats = devm_kcalloc(dev, lif->ionic->nrxqs_per_lif + 1, + unsigned int num_desc, desc_sz, comp_sz, sg_desc_sz; + unsigned int txq_i, flags; + struct ionic_qcq *txq; + u64 features; + int err; + + mutex_lock(&lif->queue_lock); + + if (lif->hwstamp_txq) + goto out; + + features = ionic_q_f_2x_cq_desc | ionic_txq_f_hwstamp; + + num_desc = ionic_min_txrx_desc; + desc_sz = sizeof(struct ionic_txq_desc); + comp_sz = 2 * sizeof(struct ionic_txq_comp); + + if (lif->qtype_info[ionic_qtype_txq].version >= 1 && + lif->qtype_info[ionic_qtype_txq].sg_desc_sz == sizeof(struct ionic_txq_sg_desc_v1)) + sg_desc_sz = sizeof(struct ionic_txq_sg_desc_v1); + else + sg_desc_sz = sizeof(struct ionic_txq_sg_desc); + + txq_i = lif->ionic->ntxqs_per_lif; + flags = ionic_qcq_f_tx_stats | ionic_qcq_f_sg; + + err = ionic_qcq_alloc(lif, ionic_qtype_txq, txq_i, "hwstamp_tx", flags, + num_desc, desc_sz, comp_sz, sg_desc_sz, + lif->kern_pid, &txq); + if (err) + goto err_qcq_alloc; + + txq->q.features = features; + + ionic_link_qcq_interrupts(lif->adminqcq, txq); + ionic_debugfs_add_qcq(lif, txq); + + lif->hwstamp_txq = txq; + + if (netif_running(lif->netdev)) { + err = ionic_lif_txq_init(lif, txq); + if (err) + goto err_qcq_init; + + if (test_bit(ionic_lif_f_up, lif->state)) { + err = ionic_qcq_enable(txq); + if (err) + goto err_qcq_enable; + } + } + +out: + mutex_unlock(&lif->queue_lock); + + +err_qcq_enable: + ionic_lif_qcq_deinit(lif, txq); +err_qcq_init: + lif->hwstamp_txq = null; + ionic_debugfs_del_qcq(txq); + ionic_qcq_free(lif, txq); + devm_kfree(lif->ionic->dev, txq); +err_qcq_alloc: + mutex_unlock(&lif->queue_lock); + return err; + unsigned int num_desc, desc_sz, comp_sz, sg_desc_sz; + unsigned int rxq_i, flags; + struct ionic_qcq *rxq; + u64 features; + int err; + + mutex_lock(&lif->queue_lock); + + if (lif->hwstamp_rxq) + goto out; + + features = ionic_q_f_2x_cq_desc | ionic_rxq_f_hwstamp; + + num_desc = ionic_min_txrx_desc; + desc_sz = sizeof(struct ionic_rxq_desc); + comp_sz = 2 * sizeof(struct ionic_rxq_comp); + sg_desc_sz = sizeof(struct ionic_rxq_sg_desc); + + rxq_i = lif->ionic->nrxqs_per_lif; + flags = ionic_qcq_f_rx_stats | ionic_qcq_f_sg; + + err = ionic_qcq_alloc(lif, ionic_qtype_rxq, rxq_i, "hwstamp_rx", flags, + num_desc, desc_sz, comp_sz, sg_desc_sz, + lif->kern_pid, &rxq); + if (err) + goto err_qcq_alloc; + + rxq->q.features = features; + + ionic_link_qcq_interrupts(lif->adminqcq, rxq); + ionic_debugfs_add_qcq(lif, rxq); + + lif->hwstamp_rxq = rxq; + + if (netif_running(lif->netdev)) { + err = ionic_lif_rxq_init(lif, rxq); + if (err) + goto err_qcq_init; + + if (test_bit(ionic_lif_f_up, lif->state)) { + ionic_rx_fill(&rxq->q); + err = ionic_qcq_enable(rxq); + if (err) + goto err_qcq_enable; + } + } + +out: + mutex_unlock(&lif->queue_lock); + + +err_qcq_enable: + ionic_lif_qcq_deinit(lif, rxq); +err_qcq_init: + lif->hwstamp_rxq = null; + ionic_debugfs_del_qcq(rxq); + ionic_qcq_free(lif, rxq); + devm_kfree(lif->ionic->dev, rxq); +err_qcq_alloc: + mutex_unlock(&lif->queue_lock); + return err; - return 0; + struct ionic_queue_params qparam; + + ionic_init_queue_params(lif, &qparam); + + if (rx_all) + qparam.rxq_features = ionic_q_f_2x_cq_desc | ionic_rxq_f_hwstamp; + else + qparam.rxq_features = 0; + + /* if we're not running, just set the values and return */ + if (!netif_running(lif->netdev)) { + lif->rxq_features = qparam.rxq_features; + return 0; + } + + return ionic_reconfigure_queues(lif, &qparam); - return 0; + struct ionic_admin_ctx ctx = { + .work = completion_initializer_onstack(ctx.work), + .cmd.lif_setattr = { + .opcode = ionic_cmd_lif_setattr, + .index = cpu_to_le16(lif->index), + .attr = ionic_lif_attr_txstamp, + .txstamp_mode = cpu_to_le16(txstamp_mode), + }, + }; + + return ionic_adminq_post_wait(lif, &ctx); +} + +static void ionic_lif_del_hwstamp_rxfilt(struct ionic_lif *lif) +{ + struct ionic_admin_ctx ctx = { + .work = completion_initializer_onstack(ctx.work), + .cmd.rx_filter_del = { + .opcode = ionic_cmd_rx_filter_del, + .lif_index = cpu_to_le16(lif->index), + }, + }; + struct ionic_rx_filter *f; + u32 filter_id; + int err; + + spin_lock_bh(&lif->rx_filters.lock); + + f = ionic_rx_filter_rxsteer(lif); + if (!f) { + spin_unlock_bh(&lif->rx_filters.lock); + return; + } + + filter_id = f->filter_id; + ionic_rx_filter_free(lif, f); + + spin_unlock_bh(&lif->rx_filters.lock); + + netdev_dbg(lif->netdev, "rx_filter del rxsteer (id %d) ", filter_id); + + ctx.cmd.rx_filter_del.filter_id = cpu_to_le32(filter_id); + + err = ionic_adminq_post_wait(lif, &ctx); + if (err && err != -eexist) + netdev_dbg(lif->netdev, "failed to delete rx_filter rxsteer (id %d) ", filter_id); +} + +static int ionic_lif_add_hwstamp_rxfilt(struct ionic_lif *lif, u64 pkt_class) +{ + struct ionic_admin_ctx ctx = { + .work = completion_initializer_onstack(ctx.work), + .cmd.rx_filter_add = { + .opcode = ionic_cmd_rx_filter_add, + .lif_index = cpu_to_le16(lif->index), + .match = cpu_to_le16(ionic_rx_filter_steer_pktclass), + .pkt_class = cpu_to_le64(pkt_class), + }, + }; + u8 qtype; + u32 qid; + int err; + + if (!lif->hwstamp_rxq) + return -einval; + + qtype = lif->hwstamp_rxq->q.type; + ctx.cmd.rx_filter_add.qtype = qtype; + + qid = lif->hwstamp_rxq->q.index; + ctx.cmd.rx_filter_add.qid = cpu_to_le32(qid); + + netdev_dbg(lif->netdev, "rx_filter add rxsteer "); + err = ionic_adminq_post_wait(lif, &ctx); + if (err && err != -eexist) + return err; + + return ionic_rx_filter_save(lif, 0, qid, 0, &ctx); - return 0; + ionic_lif_del_hwstamp_rxfilt(lif); + + if (!pkt_class) + return 0; + + return ionic_lif_add_hwstamp_rxfilt(lif, pkt_class); + if (lif->hwstamp_txq) + err = ionic_qcq_disable(lif->hwstamp_txq, (err != -etimedout)); + + if (lif->hwstamp_rxq) + err = ionic_qcq_disable(lif->hwstamp_rxq, (err != -etimedout)); + + + if (lif->hwstamp_txq) { + ionic_qcq_free(lif, lif->hwstamp_txq); + devm_kfree(lif->ionic->dev, lif->hwstamp_txq); + lif->hwstamp_txq = null; + } + + if (lif->hwstamp_rxq) { + ionic_qcq_free(lif, lif->hwstamp_rxq); + devm_kfree(lif->ionic->dev, lif->hwstamp_rxq); + lif->hwstamp_rxq = null; + } + ionic_lif_alloc_phc(lif); + + ionic_lif_free_phc(lif); + + + /* reserve last queue id for hardware timestamping */ + if (lc->features & cpu_to_le64(ionic_eth_hw_timestamp)) { + if (ntxqs_per_lif <= 1 || nrxqs_per_lif <= 1) { + lc->features &= cpu_to_le64(~ionic_eth_hw_timestamp); + } else { + ntxqs_per_lif -= 1; + nrxqs_per_lif -= 1; + } + } +
|
Networking
|
f0790bcd36063f2850301982f167128139a51f62
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: add and enable tx and rx timestamp handling
|
the tx and rx timestamped packets are handled through separate queues. here we set them up, service them, and tear them down along with the normal tx and rx queues.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['h', 'c']
| 4
| 157
| 25
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h + u64 features; - u64 features; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c + int rx_work = 0; + int tx_work = 0; + int credits; - work_done = max(n_work, a_work); + if (lif->hwstamp_rxq) + rx_work = ionic_cq_service(&lif->hwstamp_rxq->cq, budget, + ionic_rx_service, null, null); + + if (lif->hwstamp_txq) + tx_work = ionic_cq_service(&lif->hwstamp_txq->cq, budget, + ionic_tx_service, null, null); + + work_done = max(max(n_work, a_work), max(rx_work, tx_work)); - ionic_intr_credits(idev->intr_ctrl, - intr->index, - n_work + a_work, flags); + credits = n_work + a_work + rx_work + tx_work; + ionic_intr_credits(idev->intr_ctrl, intr->index, credits, flags); + + + if (lif->hwstamp_txq) { + ionic_lif_qcq_deinit(lif, lif->hwstamp_txq); + ionic_tx_flush(&lif->hwstamp_txq->cq); + ionic_tx_empty(&lif->hwstamp_txq->q); + } + + if (lif->hwstamp_rxq) { + ionic_lif_qcq_deinit(lif, lif->hwstamp_rxq); + ionic_rx_empty(&lif->hwstamp_rxq->q); + } + if (lif->hwstamp_rxq) { + ionic_rx_fill(&lif->hwstamp_rxq->q); + err = ionic_qcq_enable(lif->hwstamp_rxq); + if (err) + goto err_out_hwstamp_rx; + } + + if (lif->hwstamp_txq) { + err = ionic_qcq_enable(lif->hwstamp_txq); + if (err) + goto err_out_hwstamp_tx; + } + +err_out_hwstamp_tx: + if (lif->hwstamp_rxq) + derr = ionic_qcq_disable(lif->hwstamp_rxq, (derr != -etimedout)); +err_out_hwstamp_rx: + i = lif->nxqs; + /* restore the hardware timestamping queues */ + ionic_lif_hwstamp_set(lif, null); + diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c -static bool ionic_tx_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info); - + if (unlikely(q->features & ionic_rxq_f_hwstamp)) { + __le64 *cq_desc_hwstamp; + u64 hwstamp; + + cq_desc_hwstamp = + cq_info->cq_desc + + qcq->cq.desc_size - + sizeof(struct ionic_rxq_comp) - + ionic_hwstamp_cq_negoffset; + + hwstamp = le64_to_cpu(*cq_desc_hwstamp); + + if (hwstamp != ionic_hwstamp_invalid) { + skb_hwtstamps(skb)->hwtstamp = ionic_lif_phc_ktime(q->lif, hwstamp); + stats->hwstamp_valid++; + } else { + stats->hwstamp_invalid++; + } + } + -static bool ionic_rx_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info) +bool ionic_rx_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info) + struct ionic_qcq *qcq = q_to_qcq(q); + struct sk_buff *skb = cb_arg; - u16 queue_index; + u16 qi; - if (cb_arg) { - struct sk_buff *skb = cb_arg; + if (!skb) + return; - queue_index = skb_get_queue_mapping(skb); - if (unlikely(__netif_subqueue_stopped(q->lif->netdev, - queue_index))) { - netif_wake_subqueue(q->lif->netdev, queue_index); - q->wake++; - } + qi = skb_get_queue_mapping(skb); + + if (unlikely(q->features & ionic_txq_f_hwstamp)) { + if (cq_info) { + struct skb_shared_hwtstamps hwts = {}; + __le64 *cq_desc_hwstamp; + u64 hwstamp; + + cq_desc_hwstamp = + cq_info->cq_desc + + qcq->cq.desc_size - + sizeof(struct ionic_txq_comp) - + ionic_hwstamp_cq_negoffset; + + hwstamp = le64_to_cpu(*cq_desc_hwstamp); - desc_info->bytes = skb->len; - stats->clean++; + if (hwstamp != ionic_hwstamp_invalid) { + hwts.hwtstamp = ionic_lif_phc_ktime(q->lif, hwstamp); - dev_consume_skb_any(skb); + skb_shinfo(skb)->tx_flags |= skbtx_in_progress; + skb_tstamp_tx(skb, &hwts); + + stats->hwstamp_valid++; + } else { + stats->hwstamp_invalid++; + } + } + + } else if (unlikely(__netif_subqueue_stopped(q->lif->netdev, qi))) { + netif_wake_subqueue(q->lif->netdev, qi); + q->wake++; + + desc_info->bytes = skb->len; + stats->clean++; + + dev_consume_skb_any(skb); -static bool ionic_tx_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info) +bool ionic_tx_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info) - if (pkts && bytes) + if (pkts && bytes && !unlikely(q->features & ionic_txq_f_hwstamp)) - if (pkts && bytes) + if (pkts && bytes && !unlikely(q->features & ionic_txq_f_hwstamp)) - netdev_tx_sent_queue(q_to_ndq(q), skb->len); + if (!unlikely(q->features & ionic_txq_f_hwstamp)) + netdev_tx_sent_queue(q_to_ndq(q), skb->len); - netdev_tx_sent_queue(q_to_ndq(q), skb->len); + if (!unlikely(q->features & ionic_txq_f_hwstamp)) + netdev_tx_sent_queue(q_to_ndq(q), skb->len); +static netdev_tx_t ionic_start_hwstamp_xmit(struct sk_buff *skb, + struct net_device *netdev) +{ + struct ionic_lif *lif = netdev_priv(netdev); + struct ionic_queue *q = &lif->hwstamp_txq->q; + int err, ndescs; + + /* does not stop/start txq, because we post to a separate tx queue + * for timestamping, and if a packet can't be posted immediately to + * the timestamping queue, it is dropped. + */ + + ndescs = ionic_tx_descs_needed(q, skb); + if (unlikely(ndescs < 0)) + goto err_out_drop; + + if (unlikely(!ionic_q_has_space(q, ndescs))) + goto err_out_drop; + + if (skb_is_gso(skb)) + err = ionic_tx_tso(q, skb); + else + err = ionic_tx(q, skb); + + if (err) + goto err_out_drop; + + return netdev_tx_ok; + +err_out_drop: + q->drop++; + dev_kfree_skb(skb); + return netdev_tx_ok; +} + + if (unlikely(skb_shinfo(skb)->tx_flags & skbtx_hw_tstamp)) + if (lif->hwstamp_txq) + return ionic_start_hwstamp_xmit(skb, netdev); + diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.h b/drivers/net/ethernet/pensando/ionic/ionic_txrx.h --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.h +bool ionic_rx_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info); +bool ionic_tx_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info); +
|
Networking
|
a8771bfe05549f3068532c60e3682441ff8159fd
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: add ethtool support for ptp
|
add the get_ts_info() callback for ethtool support of timestamping information.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['c']
| 1
| 93
| 0
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +static int ionic_get_ts_info(struct net_device *netdev, + struct ethtool_ts_info *info) +{ + struct ionic_lif *lif = netdev_priv(netdev); + struct ionic *ionic = lif->ionic; + __le64 mask; + + if (!lif->phc || !lif->phc->ptp) + return ethtool_op_get_ts_info(netdev, info); + + info->phc_index = ptp_clock_index(lif->phc->ptp); + + info->so_timestamping = sof_timestamping_tx_software | + sof_timestamping_rx_software | + sof_timestamping_software | + sof_timestamping_tx_hardware | + sof_timestamping_rx_hardware | + sof_timestamping_raw_hardware; + + /* tx modes */ + + info->tx_types = bit(hwtstamp_tx_off) | + bit(hwtstamp_tx_on); + + mask = cpu_to_le64(bit_ull(ionic_txstamp_onestep_sync)); + if (ionic->ident.lif.eth.hwstamp_tx_modes & mask) + info->tx_types |= bit(hwtstamp_tx_onestep_sync); + + mask = cpu_to_le64(bit_ull(ionic_txstamp_onestep_p2p)); + if (ionic->ident.lif.eth.hwstamp_tx_modes & mask) + info->tx_types |= bit(hwtstamp_tx_onestep_p2p); + + /* rx filters */ + + info->rx_filters = bit(hwtstamp_filter_none) | + bit(hwtstamp_filter_all); + + mask = cpu_to_le64(ionic_pkt_cls_ntp_all); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ntp_all; + + mask = cpu_to_le64(ionic_pkt_cls_ptp1_sync); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v1_l4_sync; + + mask = cpu_to_le64(ionic_pkt_cls_ptp1_dreq); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v1_l4_delay_req; + + mask = cpu_to_le64(ionic_pkt_cls_ptp1_all); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v1_l4_event; + + mask = cpu_to_le64(ionic_pkt_cls_ptp2_l4_sync); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v2_l4_sync; + + mask = cpu_to_le64(ionic_pkt_cls_ptp2_l4_dreq); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v2_l4_delay_req; + + mask = cpu_to_le64(ionic_pkt_cls_ptp2_l4_all); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v2_l4_event; + + mask = cpu_to_le64(ionic_pkt_cls_ptp2_l2_sync); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v2_l2_sync; + + mask = cpu_to_le64(ionic_pkt_cls_ptp2_l2_dreq); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v2_l2_delay_req; + + mask = cpu_to_le64(ionic_pkt_cls_ptp2_l2_all); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v2_l2_event; + + mask = cpu_to_le64(ionic_pkt_cls_ptp2_sync); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v2_sync; + + mask = cpu_to_le64(ionic_pkt_cls_ptp2_dreq); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v2_delay_req; + + mask = cpu_to_le64(ionic_pkt_cls_ptp2_all); + if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) == mask) + info->rx_filters |= hwtstamp_filter_ptp_v2_event; + + return 0; +} + + .get_ts_info = ionic_get_ts_info,
|
Networking
|
f8ba81da73fc56b693dc5d91c767c882618e0004
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: ethtool ptp stats
|
add the new hwstamp stats to our ethtool stats output.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['c']
| 1
| 34
| 4
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_stats.c b/drivers/net/ethernet/pensando/ionic/ionic_stats.c --- a/drivers/net/ethernet/pensando/ionic/ionic_stats.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_stats.c + ionic_tx_stat_desc(hwstamp_valid), + ionic_tx_stat_desc(hwstamp_invalid), + ionic_rx_stat_desc(hwstamp_valid), + ionic_rx_stat_desc(hwstamp_invalid), + stats->tx_hwstamp_valid += txstats->hwstamp_valid; + stats->tx_hwstamp_invalid += txstats->hwstamp_invalid; + stats->rx_hwstamp_valid += rxstats->hwstamp_valid; + stats->rx_hwstamp_invalid += rxstats->hwstamp_invalid; + if (lif->hwstamp_txq) + ionic_add_lif_txq_stats(lif, lif->hwstamp_txq->q.index, stats); + + if (lif->hwstamp_rxq) + ionic_add_lif_rxq_stats(lif, lif->hwstamp_rxq->q.index, stats); + - /* lif stats */ + if (lif->hwstamp_txq) + tx_queues += 1; + + if (lif->hwstamp_rxq) + rx_queues += 1; + + total += ionic_num_port_stats; + - /* port stats */ - total += ionic_num_port_stats; - + if (lif->hwstamp_txq) + ionic_sw_stats_get_tx_strings(lif, buf, lif->hwstamp_txq->q.index); + + + if (lif->hwstamp_rxq) + ionic_sw_stats_get_rx_strings(lif, buf, lif->hwstamp_rxq->q.index); + if (lif->hwstamp_txq) + ionic_sw_stats_get_txq_values(lif, buf, lif->hwstamp_txq->q.index); + + + if (lif->hwstamp_rxq) + ionic_sw_stats_get_rxq_values(lif, buf, lif->hwstamp_rxq->q.index);
|
Networking
|
196f56c07f91fb24d33c5026036d97d3d3154dd2
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: advertise support for hardware timestamps
|
let the network stack know we've got support for timestamping the packets.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add ptp and hw clock support
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['c']
| 1
| 25
| 0
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c + if (lif->phc) + ctx.cmd.lif_setattr.features |= cpu_to_le64(ionic_eth_hw_timestamp); + + if (lif->hw_features & ionic_eth_hw_timestamp) + dev_dbg(dev, "feature eth_hw_timestamp "); +static int ionic_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) +{ + struct ionic_lif *lif = netdev_priv(netdev); + + switch (cmd) { + case siocshwtstamp: + return ionic_lif_hwstamp_set(lif, ifr); + case siocghwtstamp: + return ionic_lif_hwstamp_get(lif, ifr); + default: + return -eopnotsupp; + } +} + + .ndo_do_ioctl = ionic_do_ioctl, + ionic_lif_register_phc(lif); + + ionic_lif_unregister_phc(lif); + ionic_lif_unregister_phc(lif); +
|
Networking
|
afeefec6773607552c450ad2eeb43f39173c2d5c
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
ionic: update ethtool support bits for baset
|
add support in get_link_ksettings for a couple of new baset connections.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
update ethtool support bits for baset
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ionic ']
|
['h', 'c']
| 2
| 10
| 0
|
--- diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c + case ionic_xcvr_pid_sfp_10gbase_t: + ethtool_link_ksettings_add_link_mode(ks, supported, + 10000baset_full); + break; + case ionic_xcvr_pid_sfp_1000base_t: + ethtool_link_ksettings_add_link_mode(ks, supported, + 1000baset_full); + break; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h --- a/drivers/net/ethernet/pensando/ionic/ionic_if.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h + ionic_xcvr_pid_sfp_10gbase_t = 72, + ionic_xcvr_pid_sfp_1000base_t = 73,
|
Networking
|
acc606d3e4cd8d03a368fb207a0ae868d8cbe9d7
|
shannon nelson
|
drivers
|
net
|
ethernet, ionic, pensando
|
dt-bindings: net: qcom,ipa: add some compatible strings
|
add existing supported platform "qcom,sc7180-ipa" to the set of ipa compatible strings. also add newly-supported "qcom,sdx55-ipa", "qcom,sc7280-ipa".
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
support two more platforms
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ipa ']
|
['yaml']
| 1
| 5
| 1
|
--- diff --git a/documentation/devicetree/bindings/net/qcom,ipa.yaml b/documentation/devicetree/bindings/net/qcom,ipa.yaml --- a/documentation/devicetree/bindings/net/qcom,ipa.yaml +++ b/documentation/devicetree/bindings/net/qcom,ipa.yaml - const: "qcom,sdm845-ipa" + oneof: + - const: "qcom,sc7180-ipa" + - const: "qcom,sc7280-ipa" + - const: "qcom,sdm845-ipa" + - const: "qcom,sdx55-ipa"
|
Networking
|
c3264fee72e7565ca5df2896a221672678d595b2
|
alex elder
|
documentation
|
devicetree
|
bindings, net
|
net: ipa: disable checksum offload for ipa v4.5+
|
checksum offload for ipa v4.5+ is implemented differently, using "inline" offload (which uses a common header format for both upload and download offload).
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
support two more platforms
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ipa ']
|
['c']
| 1
| 16
| 0
|
--- diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c + /* ipa v4.5+ uses checksum offload, not yet supported by rmnet */ + if (ipa->version >= ipa_version_4_5) + if (data->endpoint.config.checksum) + return false; + + const struct ipa_gsi_endpoint_data *dp = data; + enum ipa_endpoint_name name; + + if (ipa->version < ipa_version_4_5) + return true; + + /* ipa v4.5+ uses checksum offload, not yet supported by rmnet */ + for (name = 0; name < count; name++, dp++) + if (data->endpoint.config.checksum) + return false; +
|
Networking
|
c88c34fcf8f501d588c0a999aa7e51e18552c5f0
|
alex elder
|
drivers
|
net
|
ipa
|
net: ipa: add ipa v4.5 configuration data
|
add support for the sdx55 soc, which includes ipa version 4.5.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
support two more platforms
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ipa ']
|
['h', 'c', 'makefile']
| 5
| 447
| 4
|
- sdx55 uses a 32-bit linux kernel - sdx55 has four interconnects rather than three - sdx55 uses ipa v4.5, which uses inline checksum offload --- diff --git a/drivers/net/ipa/makefile b/drivers/net/ipa/makefile --- a/drivers/net/ipa/makefile +++ b/drivers/net/ipa/makefile -ipa-y += ipa_data-v3.5.1.o ipa_data-v4.2.o +ipa-y += ipa_data-v3.5.1.o ipa_data-v4.2.o \ + ipa_data-v4.5.o diff --git a/drivers/net/ipa/ipa_data-v4.5.c b/drivers/net/ipa/ipa_data-v4.5.c --- /dev/null +++ b/drivers/net/ipa/ipa_data-v4.5.c +// spdx-license-identifier: gpl-2.0 + +/* copyright (c) 2021 linaro ltd. */ + +#include <linux/log2.h> + +#include "gsi.h" +#include "ipa_data.h" +#include "ipa_endpoint.h" +#include "ipa_mem.h" + +/** enum ipa_resource_type - ipa resource types for an soc having ipa v4.5 */ +enum ipa_resource_type { + /* source resource types; first must have value 0 */ + ipa_resource_type_src_pkt_contexts = 0, + ipa_resource_type_src_descriptor_lists, + ipa_resource_type_src_descriptor_buff, + ipa_resource_type_src_hps_dmars, + ipa_resource_type_src_ack_entries, + + /* destination resource types; first must have value 0 */ + ipa_resource_type_dst_data_sectors = 0, + ipa_resource_type_dst_dps_dmars, +}; + +/* resource groups used for an soc having ipa v4.5 */ +enum ipa_rsrc_group_id { + /* source resource group identifiers */ + ipa_rsrc_group_src_unused_0 = 0, + ipa_rsrc_group_src_ul_dl, + ipa_rsrc_group_src_unused_2, + ipa_rsrc_group_src_unused_3, + ipa_rsrc_group_src_uc_rx_q, + ipa_rsrc_group_src_count, /* last in set; not a source group */ + + /* destination resource group identifiers */ + ipa_rsrc_group_dst_unused_0 = 0, + ipa_rsrc_group_dst_ul_dl_dpl, + ipa_rsrc_group_dst_unused_2, + ipa_rsrc_group_dst_unused_3, + ipa_rsrc_group_dst_uc, + ipa_rsrc_group_dst_count, /* last; not a destination group */ +}; + +/* qsb configuration data for an soc having ipa v4.5 */ +static const struct ipa_qsb_data ipa_qsb_data[] = { + [ipa_qsb_master_ddr] = { + .max_writes = 8, + .max_reads = 0, /* no limit (hardware max) */ + .max_reads_beats = 120, + }, + [ipa_qsb_master_pcie] = { + .max_writes = 8, + .max_reads = 12, + /* no outstanding read byte (beat) limit */ + }, +}; + +/* endpoint configuration data for an soc having ipa v4.5 */ +static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { + [ipa_endpoint_ap_command_tx] = { + .ee_id = gsi_ee_ap, + .channel_id = 9, + .endpoint_id = 7, + .toward_ipa = true, + .channel = { + .tre_count = 256, + .event_count = 256, + .tlv_count = 20, + }, + .endpoint = { + .config = { + .resource_group = ipa_rsrc_group_src_ul_dl, + .dma_mode = true, + .dma_endpoint = ipa_endpoint_ap_lan_rx, + .tx = { + .seq_type = ipa_seq_dma, + }, + }, + }, + }, + [ipa_endpoint_ap_lan_rx] = { + .ee_id = gsi_ee_ap, + .channel_id = 10, + .endpoint_id = 16, + .toward_ipa = false, + .channel = { + .tre_count = 256, + .event_count = 256, + .tlv_count = 9, + }, + .endpoint = { + .config = { + .resource_group = ipa_rsrc_group_dst_ul_dl_dpl, + .aggregation = true, + .status_enable = true, + .rx = { + .pad_align = ilog2(sizeof(u32)), + }, + }, + }, + }, + [ipa_endpoint_ap_modem_tx] = { + .ee_id = gsi_ee_ap, + .channel_id = 7, + .endpoint_id = 2, + .toward_ipa = true, + .channel = { + .tre_count = 512, + .event_count = 512, + .tlv_count = 16, + }, + .endpoint = { + .filter_support = true, + .config = { + .resource_group = ipa_rsrc_group_src_ul_dl, + .qmap = true, + .status_enable = true, + .tx = { + .seq_type = ipa_seq_2_pass_skip_last_uc, + .status_endpoint = + ipa_endpoint_modem_ap_rx, + }, + }, + }, + }, + [ipa_endpoint_ap_modem_rx] = { + .ee_id = gsi_ee_ap, + .channel_id = 1, + .endpoint_id = 14, + .toward_ipa = false, + .channel = { + .tre_count = 256, + .event_count = 256, + .tlv_count = 9, + }, + .endpoint = { + .config = { + .resource_group = ipa_rsrc_group_dst_ul_dl_dpl, + .qmap = true, + .aggregation = true, + .rx = { + .aggr_close_eof = true, + }, + }, + }, + }, + [ipa_endpoint_modem_ap_tx] = { + .ee_id = gsi_ee_modem, + .channel_id = 0, + .endpoint_id = 5, + .toward_ipa = true, + .endpoint = { + .filter_support = true, + }, + }, + [ipa_endpoint_modem_ap_rx] = { + .ee_id = gsi_ee_modem, + .channel_id = 7, + .endpoint_id = 21, + .toward_ipa = false, + }, + [ipa_endpoint_modem_dl_nlo_tx] = { + .ee_id = gsi_ee_modem, + .channel_id = 2, + .endpoint_id = 8, + .toward_ipa = true, + .endpoint = { + .filter_support = true, + }, + }, +}; + +/* source resource configuration data for an soc having ipa v4.5 */ +static const struct ipa_resource ipa_resource_src[] = { + [ipa_resource_type_src_pkt_contexts] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 1, .max = 11, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 1, .max = 63, + }, + }, + [ipa_resource_type_src_descriptor_lists] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 14, .max = 14, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 3, .max = 3, + }, + }, + [ipa_resource_type_src_descriptor_buff] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 18, .max = 18, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 8, .max = 8, + }, + }, + [ipa_resource_type_src_hps_dmars] = { + .limits[ipa_rsrc_group_src_unused_0] = { + .min = 0, .max = 63, + }, + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 0, .max = 63, + }, + .limits[ipa_rsrc_group_src_unused_2] = { + .min = 0, .max = 63, + }, + .limits[ipa_rsrc_group_src_unused_3] = { + .min = 0, .max = 63, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 0, .max = 63, + }, + }, + [ipa_resource_type_src_ack_entries] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 24, .max = 24, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 8, .max = 8, + }, + }, +}; + +/* destination resource configuration data for an soc having ipa v4.5 */ +static const struct ipa_resource ipa_resource_dst[] = { + [ipa_resource_type_dst_data_sectors] = { + .limits[ipa_rsrc_group_dst_ul_dl_dpl] = { + .min = 16, .max = 16, + }, + .limits[ipa_rsrc_group_dst_unused_2] = { + .min = 2, .max = 2, + }, + .limits[ipa_rsrc_group_dst_unused_3] = { + .min = 2, .max = 2, + }, + }, + [ipa_resource_type_dst_dps_dmars] = { + .limits[ipa_rsrc_group_dst_ul_dl_dpl] = { + .min = 2, .max = 63, + }, + .limits[ipa_rsrc_group_dst_unused_2] = { + .min = 1, .max = 2, + }, + .limits[ipa_rsrc_group_dst_unused_3] = { + .min = 1, .max = 2, + }, + .limits[ipa_rsrc_group_dst_uc] = { + .min = 0, .max = 2, + }, + }, +}; + +/* resource configuration data for an soc having ipa v4.5 */ +static const struct ipa_resource_data ipa_resource_data = { + .rsrc_group_src_count = ipa_rsrc_group_src_count, + .rsrc_group_dst_count = ipa_rsrc_group_dst_count, + .resource_src_count = array_size(ipa_resource_src), + .resource_src = ipa_resource_src, + .resource_dst_count = array_size(ipa_resource_dst), + .resource_dst = ipa_resource_dst, +}; + +/* ipa-resident memory region data for an soc having ipa v4.5 */ +static const struct ipa_mem ipa_mem_local_data[] = { + [ipa_mem_uc_shared] = { + .offset = 0x0000, + .size = 0x0080, + .canary_count = 0, + }, + [ipa_mem_uc_info] = { + .offset = 0x0080, + .size = 0x0200, + .canary_count = 0, + }, + [ipa_mem_v4_filter_hashed] = { + .offset = 0x0288, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v4_filter] = { + .offset = 0x0308, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_filter_hashed] = { + .offset = 0x0388, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_filter] = { + .offset = 0x0408, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v4_route_hashed] = { + .offset = 0x0488, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v4_route] = { + .offset = 0x0508, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_route_hashed] = { + .offset = 0x0588, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_route] = { + .offset = 0x0608, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_modem_header] = { + .offset = 0x0688, + .size = 0x0240, + .canary_count = 2, + }, + [ipa_mem_ap_header] = { + .offset = 0x08c8, + .size = 0x0200, + .canary_count = 0, + }, + [ipa_mem_modem_proc_ctx] = { + .offset = 0x0ad0, + .size = 0x0b20, + .canary_count = 2, + }, + [ipa_mem_ap_proc_ctx] = { + .offset = 0x15f0, + .size = 0x0200, + .canary_count = 0, + }, + [ipa_mem_nat_table] = { + .offset = 0x1800, + .size = 0x0d00, + .canary_count = 4, + }, + [ipa_mem_stats_quota_modem] = { + .offset = 0x2510, + .size = 0x0030, + .canary_count = 4, + }, + [ipa_mem_stats_quota_ap] = { + .offset = 0x2540, + .size = 0x0048, + .canary_count = 0, + }, + [ipa_mem_stats_tethering] = { + .offset = 0x2588, + .size = 0x0238, + .canary_count = 0, + }, + [ipa_mem_stats_filter_route] = { + .offset = 0x27c0, + .size = 0x0800, + .canary_count = 0, + }, + [ipa_mem_stats_drop] = { + .offset = 0x2fc0, + .size = 0x0020, + .canary_count = 0, + }, + [ipa_mem_modem] = { + .offset = 0x2fe8, + .size = 0x0800, + .canary_count = 2, + }, + [ipa_mem_uc_event_ring] = { + .offset = 0x3800, + .size = 0x1000, + .canary_count = 1, + }, + [ipa_mem_pdn_config] = { + .offset = 0x4800, + .size = 0x0050, + .canary_count = 0, + }, +}; + +/* memory configuration data for an soc having ipa v4.5 */ +static const struct ipa_mem_data ipa_mem_data = { + .local_count = array_size(ipa_mem_local_data), + .local = ipa_mem_local_data, + .imem_addr = 0x14688000, + .imem_size = 0x00003000, + .smem_id = 497, + .smem_size = 0x00009000, +}; + +/* interconnect rates are in 1000 byte/second units */ +static const struct ipa_interconnect_data ipa_interconnect_data[] = { + { + .name = "memory-a", + .peak_bandwidth = 600000, /* 600 mbps */ + .average_bandwidth = 150000, /* 150 mbps */ + }, + { + .name = "memory-b", + .peak_bandwidth = 1804000, /* 1.804 gbps */ + .average_bandwidth = 150000, /* 150 mbps */ + }, + /* average rate is unused for the next two interconnects */ + { + .name = "imem", + .peak_bandwidth = 450000, /* 450 mbps */ + .average_bandwidth = 75000, /* 75 mbps (unused?) */ + }, + { + .name = "config", + .peak_bandwidth = 171400, /* 171.4 mbps */ + .average_bandwidth = 0, /* unused */ + }, +}; + +/* clock and interconnect configuration data for an soc having ipa v4.5 */ +static const struct ipa_clock_data ipa_clock_data = { + .core_clock_rate = 150 * 1000 * 1000, /* hz (150? 60?) */ + .interconnect_count = array_size(ipa_interconnect_data), + .interconnect_data = ipa_interconnect_data, +}; + +/* configuration data for an soc having ipa v4.5 */ +const struct ipa_data ipa_data_v4_5 = { + .version = ipa_version_4_5, + .qsb_count = array_size(ipa_qsb_data), + .qsb_data = ipa_qsb_data, + .endpoint_count = array_size(ipa_gsi_endpoint_data), + .endpoint_data = ipa_gsi_endpoint_data, + .resource_data = &ipa_resource_data, + .mem_data = &ipa_mem_data, + .clock_data = &ipa_clock_data, +}; diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h +extern const struct ipa_data ipa_data_v4_5; diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c + { + .compatible = "qcom,sdx55-ipa", + .data = &ipa_data_v4_5, + }, diff --git a/drivers/net/ipa/ipa_mem.h b/drivers/net/ipa/ipa_mem.h --- a/drivers/net/ipa/ipa_mem.h +++ b/drivers/net/ipa/ipa_mem.h - ipa_mem_pdn_config, /* 2 canaries (ipa v4.0 and above) */ - ipa_mem_stats_quota_modem, /* 2 canaries (ipa v4.0 and above) */ + ipa_mem_pdn_config, /* 0/2 canaries (ipa v4.0 and above) */ + ipa_mem_stats_quota_modem, /* 2/4 canaries (ipa v4.0 and above) */ - ipa_mem_modem, /* 0 canaries */ + ipa_mem_modem, /* 0/2 canaries */
|
Networking
|
fbb763e7e7366c27848cbfb09d983802b6322709
|
alex elder
|
drivers
|
net
|
ipa
|
net: ipa: add ipa v4.11 configuration data
|
add support for the sc7280 soc, which includes ipa version 4.11.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
support two more platforms
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ipa ']
|
['h', 'c', 'makefile']
| 4
| 388
| 1
|
--- diff --git a/drivers/net/ipa/makefile b/drivers/net/ipa/makefile --- a/drivers/net/ipa/makefile +++ b/drivers/net/ipa/makefile - ipa_data-v4.5.o + ipa_data-v4.5.o ipa_data-v4.11.o diff --git a/drivers/net/ipa/ipa_data-v4.11.c b/drivers/net/ipa/ipa_data-v4.11.c --- /dev/null +++ b/drivers/net/ipa/ipa_data-v4.11.c +// spdx-license-identifier: gpl-2.0 + +/* copyright (c) 2021 linaro ltd. */ + +#include <linux/log2.h> + +#include "gsi.h" +#include "ipa_data.h" +#include "ipa_endpoint.h" +#include "ipa_mem.h" + +/** enum ipa_resource_type - ipa resource types for an soc having ipa v4.11 */ +enum ipa_resource_type { + /* source resource types; first must have value 0 */ + ipa_resource_type_src_pkt_contexts = 0, + ipa_resource_type_src_descriptor_lists, + ipa_resource_type_src_descriptor_buff, + ipa_resource_type_src_hps_dmars, + ipa_resource_type_src_ack_entries, + + /* destination resource types; first must have value 0 */ + ipa_resource_type_dst_data_sectors = 0, + ipa_resource_type_dst_dps_dmars, +}; + +/* resource groups used for an soc having ipa v4.11 */ +enum ipa_rsrc_group_id { + /* source resource group identifiers */ + ipa_rsrc_group_src_ul_dl = 0, + ipa_rsrc_group_src_uc_rx_q, + ipa_rsrc_group_src_unused_2, + ipa_rsrc_group_src_count, /* last in set; not a source group */ + + /* destination resource group identifiers */ + ipa_rsrc_group_dst_ul_dl_dpl = 0, + ipa_rsrc_group_dst_unused_1, + ipa_rsrc_group_dst_drb_ip, + ipa_rsrc_group_dst_count, /* last; not a destination group */ +}; + +/* qsb configuration data for an soc having ipa v4.11 */ +static const struct ipa_qsb_data ipa_qsb_data[] = { + [ipa_qsb_master_ddr] = { + .max_writes = 12, + .max_reads = 13, + .max_reads_beats = 120, + }, +}; + +/* endpoint configuration data for an soc having ipa v4.11 */ +static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { + [ipa_endpoint_ap_command_tx] = { + .ee_id = gsi_ee_ap, + .channel_id = 5, + .endpoint_id = 7, + .toward_ipa = true, + .channel = { + .tre_count = 256, + .event_count = 256, + .tlv_count = 20, + }, + .endpoint = { + .config = { + .resource_group = ipa_rsrc_group_src_ul_dl, + .dma_mode = true, + .dma_endpoint = ipa_endpoint_ap_lan_rx, + .tx = { + .seq_type = ipa_seq_dma, + }, + }, + }, + }, + [ipa_endpoint_ap_lan_rx] = { + .ee_id = gsi_ee_ap, + .channel_id = 14, + .endpoint_id = 9, + .toward_ipa = false, + .channel = { + .tre_count = 256, + .event_count = 256, + .tlv_count = 9, + }, + .endpoint = { + .config = { + .resource_group = ipa_rsrc_group_dst_ul_dl_dpl, + .aggregation = true, + .status_enable = true, + .rx = { + .pad_align = ilog2(sizeof(u32)), + }, + }, + }, + }, + [ipa_endpoint_ap_modem_tx] = { + .ee_id = gsi_ee_ap, + .channel_id = 2, + .endpoint_id = 2, + .toward_ipa = true, + .channel = { + .tre_count = 512, + .event_count = 512, + .tlv_count = 16, + }, + .endpoint = { + .filter_support = true, + .config = { + .resource_group = ipa_rsrc_group_src_ul_dl, + .qmap = true, + .status_enable = true, + .tx = { + .seq_type = ipa_seq_2_pass_skip_last_uc, + .status_endpoint = + ipa_endpoint_modem_ap_rx, + }, + }, + }, + }, + [ipa_endpoint_ap_modem_rx] = { + .ee_id = gsi_ee_ap, + .channel_id = 7, + .endpoint_id = 16, + .toward_ipa = false, + .channel = { + .tre_count = 256, + .event_count = 256, + .tlv_count = 9, + }, + .endpoint = { + .config = { + .resource_group = ipa_rsrc_group_dst_ul_dl_dpl, + .qmap = true, + .aggregation = true, + .rx = { + .aggr_close_eof = true, + }, + }, + }, + }, + [ipa_endpoint_modem_ap_tx] = { + .ee_id = gsi_ee_modem, + .channel_id = 0, + .endpoint_id = 5, + .toward_ipa = true, + .endpoint = { + .filter_support = true, + }, + }, + [ipa_endpoint_modem_ap_rx] = { + .ee_id = gsi_ee_modem, + .channel_id = 7, + .endpoint_id = 14, + .toward_ipa = false, + }, + [ipa_endpoint_modem_dl_nlo_tx] = { + .ee_id = gsi_ee_modem, + .channel_id = 2, + .endpoint_id = 8, + .toward_ipa = true, + .endpoint = { + .filter_support = true, + }, + }, +}; + +/* source resource configuration data for an soc having ipa v4.11 */ +static const struct ipa_resource ipa_resource_src[] = { + [ipa_resource_type_src_pkt_contexts] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 6, .max = 6, + }, + }, + [ipa_resource_type_src_descriptor_lists] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 8, .max = 8, + }, + }, + [ipa_resource_type_src_descriptor_buff] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 18, .max = 18, + }, + }, + [ipa_resource_type_src_hps_dmars] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 2, .max = 2, + }, + }, + [ipa_resource_type_src_ack_entries] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 15, .max = 15, + }, + }, +}; + +/* destination resource configuration data for an soc having ipa v4.11 */ +static const struct ipa_resource ipa_resource_dst[] = { + [ipa_resource_type_dst_data_sectors] = { + .limits[ipa_rsrc_group_dst_ul_dl_dpl] = { + .min = 3, .max = 3, + }, + .limits[ipa_rsrc_group_dst_drb_ip] = { + .min = 25, .max = 25, + }, + }, + [ipa_resource_type_dst_dps_dmars] = { + .limits[ipa_rsrc_group_dst_ul_dl_dpl] = { + .min = 2, .max = 2, + }, + }, +}; + +/* resource configuration data for an soc having ipa v4.11 */ +static const struct ipa_resource_data ipa_resource_data = { + .rsrc_group_src_count = ipa_rsrc_group_src_count, + .rsrc_group_dst_count = ipa_rsrc_group_dst_count, + .resource_src_count = array_size(ipa_resource_src), + .resource_src = ipa_resource_src, + .resource_dst_count = array_size(ipa_resource_dst), + .resource_dst = ipa_resource_dst, +}; + +/* ipa-resident memory region data for an soc having ipa v4.11 */ +static const struct ipa_mem ipa_mem_local_data[] = { + [ipa_mem_uc_shared] = { + .offset = 0x0000, + .size = 0x0080, + .canary_count = 0, + }, + [ipa_mem_uc_info] = { + .offset = 0x0080, + .size = 0x0200, + .canary_count = 0, + }, + [ipa_mem_v4_filter_hashed] = { + .offset = 0x0288, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v4_filter] = { + .offset = 0x0308, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_filter_hashed] = { + .offset = 0x0388, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_filter] = { + .offset = 0x0408, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v4_route_hashed] = { + .offset = 0x0488, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v4_route] = { + .offset = 0x0508, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_route_hashed] = { + .offset = 0x0588, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_route] = { + .offset = 0x0608, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_modem_header] = { + .offset = 0x0688, + .size = 0x0240, + .canary_count = 2, + }, + [ipa_mem_ap_header] = { + .offset = 0x08c8, + .size = 0x0200, + .canary_count = 0, + }, + [ipa_mem_modem_proc_ctx] = { + .offset = 0x0ad0, + .size = 0x0200, + .canary_count = 2, + }, + [ipa_mem_ap_proc_ctx] = { + .offset = 0x0cd0, + .size = 0x0200, + .canary_count = 0, + }, + [ipa_mem_nat_table] = { + .offset = 0x0ee0, + .size = 0x0d00, + .canary_count = 4, + }, + [ipa_mem_pdn_config] = { + .offset = 0x1be8, + .size = 0x0050, + .canary_count = 0, + }, + [ipa_mem_stats_quota_modem] = { + .offset = 0x1c40, + .size = 0x0030, + .canary_count = 4, + }, + [ipa_mem_stats_quota_ap] = { + .offset = 0x1c70, + .size = 0x0048, + .canary_count = 0, + }, + [ipa_mem_stats_tethering] = { + .offset = 0x1cb8, + .size = 0x0238, + .canary_count = 0, + }, + [ipa_mem_stats_drop] = { + .offset = 0x1ef0, + .size = 0x0020, + .canary_count = 0, + }, + [ipa_mem_modem] = { + .offset = 0x1f18, + .size = 0x100c, + .canary_count = 2, + }, + [ipa_mem_uc_event_ring] = { + .offset = 0x3000, + .size = 0x0000, + .canary_count = 1, + }, +}; + +/* memory configuration data for an soc having ipa v4.11 */ +static const struct ipa_mem_data ipa_mem_data = { + .local_count = array_size(ipa_mem_local_data), + .local = ipa_mem_local_data, + .imem_addr = 0x146a8000, + .imem_size = 0x00002000, + .smem_id = 497, + .smem_size = 0x00009000, +}; + +/* interconnect rates are in 1000 byte/second units */ +static const struct ipa_interconnect_data ipa_interconnect_data[] = { + { + .name = "memory", + .peak_bandwidth = 465000, /* 465 mbps */ + .average_bandwidth = 80000, /* 80 mbps */ + }, + /* average rate is unused for the next two interconnects */ + { + .name = "imem", + .peak_bandwidth = 68570, /* 68.57 mbps */ + .average_bandwidth = 80000, /* 80 mbps (unused?) */ + }, + { + .name = "config", + .peak_bandwidth = 30000, /* 30 mbps */ + .average_bandwidth = 0, /* unused */ + }, +}; + +/* clock and interconnect configuration data for an soc having ipa v4.11 */ +static const struct ipa_clock_data ipa_clock_data = { + .core_clock_rate = 60 * 1000 * 1000, /* hz */ + .interconnect_count = array_size(ipa_interconnect_data), + .interconnect_data = ipa_interconnect_data, +}; + +/* configuration data for an soc having ipa v4.11 */ +const struct ipa_data ipa_data_v4_11 = { + .version = ipa_version_4_11, + .qsb_count = array_size(ipa_qsb_data), + .qsb_data = ipa_qsb_data, + .endpoint_count = array_size(ipa_gsi_endpoint_data), + .endpoint_data = ipa_gsi_endpoint_data, + .resource_data = &ipa_resource_data, + .mem_data = &ipa_mem_data, + .clock_data = &ipa_clock_data, +}; diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h +extern const struct ipa_data ipa_data_v4_11; diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c + { + .compatible = "qcom,sc7280-ipa", + .data = &ipa_data_v4_11, + },
|
Networking
|
927c5043459ec613bad281074293f073599d2906
|
alex elder
|
drivers
|
net
|
ipa
|
net: ipa: add ipa v4.9 configuration data
|
add support for the sm8350 soc, which includes ipa version 4.9.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for the sm8350 soc
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ipa ']
|
['h', 'c', 'makefile']
| 4
| 437
| 1
|
--- diff --git a/drivers/net/ipa/makefile b/drivers/net/ipa/makefile --- a/drivers/net/ipa/makefile +++ b/drivers/net/ipa/makefile - ipa_data-v4.5.o ipa_data-v4.11.o + ipa_data-v4.5.o ipa_data-v4.9.o \ + ipa_data-v4.11.o diff --git a/drivers/net/ipa/ipa_data-v4.9.c b/drivers/net/ipa/ipa_data-v4.9.c --- /dev/null +++ b/drivers/net/ipa/ipa_data-v4.9.c +// spdx-license-identifier: gpl-2.0 + +/* copyright (c) 2021 linaro ltd. */ + +#include <linux/log2.h> + +#include "gsi.h" +#include "ipa_data.h" +#include "ipa_endpoint.h" +#include "ipa_mem.h" + +/** enum ipa_resource_type - ipa resource types for an soc having ipa v4.9 */ +enum ipa_resource_type { + /* source resource types; first must have value 0 */ + ipa_resource_type_src_pkt_contexts = 0, + ipa_resource_type_src_descriptor_lists, + ipa_resource_type_src_descriptor_buff, + ipa_resource_type_src_hps_dmars, + ipa_resource_type_src_ack_entries, + + /* destination resource types; first must have value 0 */ + ipa_resource_type_dst_data_sectors = 0, + ipa_resource_type_dst_dps_dmars, +}; + +/* resource groups used for an soc having ipa v4.9 */ +enum ipa_rsrc_group_id { + /* source resource group identifiers */ + ipa_rsrc_group_src_ul_dl = 0, + ipa_rsrc_group_src_dma, + ipa_rsrc_group_src_uc_rx_q, + ipa_rsrc_group_src_count, /* last in set; not a source group */ + + /* destination resource group identifiers */ + ipa_rsrc_group_dst_ul_dl_dpl = 0, + ipa_rsrc_group_dst_dma, + ipa_rsrc_group_dst_uc, + ipa_rsrc_group_dst_drb_ip, + ipa_rsrc_group_dst_count, /* last; not a destination group */ +}; + +/* qsb configuration data for an soc having ipa v4.9 */ +static const struct ipa_qsb_data ipa_qsb_data[] = { + [ipa_qsb_master_ddr] = { + .max_writes = 8, + .max_reads = 0, /* no limit (hardware max) */ + .max_reads_beats = 120, + }, +}; + +/* endpoint configuration data for an soc having ipa v4.9 */ +static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { + [ipa_endpoint_ap_command_tx] = { + .ee_id = gsi_ee_ap, + .channel_id = 6, + .endpoint_id = 7, + .toward_ipa = true, + .channel = { + .tre_count = 256, + .event_count = 256, + .tlv_count = 20, + }, + .endpoint = { + .config = { + .resource_group = ipa_rsrc_group_src_ul_dl, + .dma_mode = true, + .dma_endpoint = ipa_endpoint_ap_lan_rx, + .tx = { + .seq_type = ipa_seq_dma, + }, + }, + }, + }, + [ipa_endpoint_ap_lan_rx] = { + .ee_id = gsi_ee_ap, + .channel_id = 7, + .endpoint_id = 11, + .toward_ipa = false, + .channel = { + .tre_count = 256, + .event_count = 256, + .tlv_count = 9, + }, + .endpoint = { + .config = { + .resource_group = ipa_rsrc_group_dst_ul_dl_dpl, + .aggregation = true, + .status_enable = true, + .rx = { + .pad_align = ilog2(sizeof(u32)), + }, + }, + }, + }, + [ipa_endpoint_ap_modem_tx] = { + .ee_id = gsi_ee_ap, + .channel_id = 2, + .endpoint_id = 2, + .toward_ipa = true, + .channel = { + .tre_count = 512, + .event_count = 512, + .tlv_count = 16, + }, + .endpoint = { + .filter_support = true, + .config = { + .resource_group = ipa_rsrc_group_src_ul_dl, + .qmap = true, + .status_enable = true, + .tx = { + .seq_type = ipa_seq_2_pass_skip_last_uc, + .status_endpoint = + ipa_endpoint_modem_ap_rx, + }, + }, + }, + }, + [ipa_endpoint_ap_modem_rx] = { + .ee_id = gsi_ee_ap, + .channel_id = 12, + .endpoint_id = 20, + .toward_ipa = false, + .channel = { + .tre_count = 256, + .event_count = 256, + .tlv_count = 9, + }, + .endpoint = { + .config = { + .resource_group = ipa_rsrc_group_dst_ul_dl_dpl, + .qmap = true, + .aggregation = true, + .rx = { + .aggr_close_eof = true, + }, + }, + }, + }, + [ipa_endpoint_modem_ap_tx] = { + .ee_id = gsi_ee_modem, + .channel_id = 0, + .endpoint_id = 5, + .toward_ipa = true, + .endpoint = { + .filter_support = true, + }, + }, + [ipa_endpoint_modem_ap_rx] = { + .ee_id = gsi_ee_modem, + .channel_id = 7, + .endpoint_id = 16, + .toward_ipa = false, + }, + [ipa_endpoint_modem_dl_nlo_tx] = { + .ee_id = gsi_ee_modem, + .channel_id = 2, + .endpoint_id = 8, + .toward_ipa = true, + .endpoint = { + .filter_support = true, + }, + }, +}; + +/* source resource configuration data for an soc having ipa v4.9 */ +static const struct ipa_resource ipa_resource_src[] = { + [ipa_resource_type_src_pkt_contexts] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 1, .max = 12, + }, + .limits[ipa_rsrc_group_src_dma] = { + .min = 1, .max = 1, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 1, .max = 12, + }, + }, + [ipa_resource_type_src_descriptor_lists] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 20, .max = 20, + }, + .limits[ipa_rsrc_group_src_dma] = { + .min = 2, .max = 2, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 3, .max = 3, + }, + }, + [ipa_resource_type_src_descriptor_buff] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 38, .max = 38, + }, + .limits[ipa_rsrc_group_src_dma] = { + .min = 4, .max = 4, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 8, .max = 8, + }, + }, + [ipa_resource_type_src_hps_dmars] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 0, .max = 4, + }, + .limits[ipa_rsrc_group_src_dma] = { + .min = 0, .max = 4, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 0, .max = 4, + }, + }, + [ipa_resource_type_src_ack_entries] = { + .limits[ipa_rsrc_group_src_ul_dl] = { + .min = 30, .max = 30, + }, + .limits[ipa_rsrc_group_src_dma] = { + .min = 8, .max = 8, + }, + .limits[ipa_rsrc_group_src_uc_rx_q] = { + .min = 8, .max = 8, + }, + }, +}; + +/* destination resource configuration data for an soc having ipa v4.9 */ +static const struct ipa_resource ipa_resource_dst[] = { + [ipa_resource_type_dst_data_sectors] = { + .limits[ipa_rsrc_group_dst_ul_dl_dpl] = { + .min = 9, .max = 9, + }, + .limits[ipa_rsrc_group_dst_dma] = { + .min = 1, .max = 1, + }, + .limits[ipa_rsrc_group_dst_uc] = { + .min = 1, .max = 1, + }, + .limits[ipa_rsrc_group_dst_drb_ip] = { + .min = 39, .max = 39, + }, + }, + [ipa_resource_type_dst_dps_dmars] = { + .limits[ipa_rsrc_group_dst_ul_dl_dpl] = { + .min = 2, .max = 3, + }, + .limits[ipa_rsrc_group_dst_dma] = { + .min = 1, .max = 2, + }, + .limits[ipa_rsrc_group_dst_uc] = { + .min = 0, .max = 2, + }, + }, +}; + +/* resource configuration data for an soc having ipa v4.9 */ +static const struct ipa_resource_data ipa_resource_data = { + .rsrc_group_dst_count = ipa_rsrc_group_dst_count, + .rsrc_group_src_count = ipa_rsrc_group_src_count, + .resource_src_count = array_size(ipa_resource_src), + .resource_src = ipa_resource_src, + .resource_dst_count = array_size(ipa_resource_dst), + .resource_dst = ipa_resource_dst, +}; + +/* ipa-resident memory region data for an soc having ipa v4.9 */ +static const struct ipa_mem ipa_mem_local_data[] = { + [ipa_mem_uc_shared] = { + .offset = 0x0000, + .size = 0x0080, + .canary_count = 0, + }, + [ipa_mem_uc_info] = { + .offset = 0x0080, + .size = 0x0200, + .canary_count = 0, + }, + [ipa_mem_v4_filter_hashed] = { .offset = 0x0288, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v4_filter] = { + .offset = 0x0308, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_filter_hashed] = { + .offset = 0x0388, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_filter] = { + .offset = 0x0408, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v4_route_hashed] = { + .offset = 0x0488, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v4_route] = { + .offset = 0x0508, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_route_hashed] = { + .offset = 0x0588, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_v6_route] = { + .offset = 0x0608, + .size = 0x0078, + .canary_count = 2, + }, + [ipa_mem_modem_header] = { + .offset = 0x0688, + .size = 0x0240, + .canary_count = 2, + }, + [ipa_mem_ap_header] = { + .offset = 0x08c8, + .size = 0x0200, + .canary_count = 0, + }, + [ipa_mem_modem_proc_ctx] = { + .offset = 0x0ad0, + .size = 0x0b20, + .canary_count = 2, + }, + [ipa_mem_ap_proc_ctx] = { + .offset = 0x15f0, + .size = 0x0200, + .canary_count = 0, + }, + [ipa_mem_nat_table] = { + .offset = 0x1800, + .size = 0x0d00, + .canary_count = 4, + }, + [ipa_mem_stats_quota_modem] = { + .offset = 0x2510, + .size = 0x0030, + .canary_count = 4, + }, + [ipa_mem_stats_quota_ap] = { + .offset = 0x2540, + .size = 0x0048, + .canary_count = 0, + }, + [ipa_mem_stats_tethering] = { + .offset = 0x2588, + .size = 0x0238, + .canary_count = 0, + }, + [ipa_mem_stats_filter_route] = { + .offset = 0x27c0, + .size = 0x0800, + .canary_count = 0, + }, + [ipa_mem_stats_drop] = { + .offset = 0x2fc0, + .size = 0x0020, + .canary_count = 0, + }, + [ipa_mem_modem] = { + .offset = 0x2fe8, + .size = 0x0800, + .canary_count = 2, + }, + [ipa_mem_uc_event_ring] = { + .offset = 0x3800, + .size = 0x1000, + .canary_count = 1, + }, + [ipa_mem_pdn_config] = { + .offset = 0x4800, + .size = 0x0050, + .canary_count = 0, + }, +}; + +/* memory configuration data for an soc having ipa v4.9 */ +static const struct ipa_mem_data ipa_mem_data = { + .local_count = array_size(ipa_mem_local_data), + .local = ipa_mem_local_data, + .imem_addr = 0x146bd000, + .imem_size = 0x00002000, + .smem_id = 497, + .smem_size = 0x00009000, +}; + +/* interconnect rates are in 1000 byte/second units */ +static const struct ipa_interconnect_data ipa_interconnect_data[] = { + { + .name = "ipa_to_llcc", + .peak_bandwidth = 600000, /* 600 mbps */ + .average_bandwidth = 150000, /* 150 mbps */ + }, + { + .name = "llcc_to_ebi1", + .peak_bandwidth = 1804000, /* 1.804 gbps */ + .average_bandwidth = 150000, /* 150 mbps */ + }, + /* average rate is unused for the next interconnect */ + { + .name = "appss_to_ipa", + .peak_bandwidth = 74000, /* 74 mbps */ + .average_bandwidth = 0, /* unused */ + }, + +}; + +/* clock and interconnect configuration data for an soc having ipa v4.9 */ +static const struct ipa_clock_data ipa_clock_data = { + .core_clock_rate = 60 * 1000 * 1000, /* hz */ + .interconnect_count = array_size(ipa_interconnect_data), + .interconnect_data = ipa_interconnect_data, +}; + +/* configuration data for an soc having ipa v4.9. */ +const struct ipa_data ipa_data_v4_9 = { + .version = ipa_version_4_9, + .qsb_count = array_size(ipa_qsb_data), + .qsb_data = ipa_qsb_data, + .endpoint_count = array_size(ipa_gsi_endpoint_data), + .endpoint_data = ipa_gsi_endpoint_data, + .resource_data = &ipa_resource_data, + .mem_data = &ipa_mem_data, + .clock_data = &ipa_clock_data, +}; diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h +extern const struct ipa_data ipa_data_v4_9; diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c + { + .compatible = "qcom,sm8350-ipa", + .data = &ipa_data_v4_9, + },
|
Networking
|
e557dc82418d24a5fb035815dc57131b68239801
|
alex elder
|
drivers
|
net
|
ipa
|
iwlwifi: add new so-gf device
|
add new so-gf device to the driver.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add new so-gf device
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['iwlwifi ']
|
['c']
| 1
| 8
| 1
|
--- diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c - * copyright (c) 2005-2014, 2018-2020 intel corporation + * copyright (c) 2005-2014, 2018-2021 intel corporation +/* so with gf */ + _iwl_dev_info(iwl_cfg_any, iwl_cfg_any, + iwl_cfg_mac_type_so, iwl_cfg_any, + iwl_cfg_rf_type_gf, iwl_cfg_any, + iwl_cfg_160, iwl_cfg_any, iwl_cfg_no_cdb, + iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_name) +
|
Networking
|
9a0f28d8628ecf86841682784d4d34aac9b1d336
|
ybaruch
|
drivers
|
net
|
intel, iwlwifi, pcie, wireless
|
iwlwifi: mvm: add support for 6ghz passive scan
|
when doing scan while 6ghz channels are not enabled, the 6ghz band is not scanned. thus, if there are no aps on the 2ghz and 5ghz bands (that will allow discovery of geographic location etc. that would allow enabling the 6ghz channels) but there are non collocated aps on 6ghz psc channels these would never be discovered.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for 6ghz passive scan
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['iwlwifi ', 'mvm']
|
['h', 'c']
| 7
| 148
| 0
|
- 6ghz channels are supported but not enabled by regulatory. - station interface is not associated or less than a defined time - at least 4 channels are included in the scan request - the scan request includes the widlcard ssid. - at least 50 minutes passed from the last 6ghz passive scan. --- diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h --- a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h + * @iwl_umac_scan_gen_flags_v2_6ghz_passive_scan: at the end of 2.4ghz and 5ghz + * bands scan, if not aps were discovered, allow scan to conitnue and scan + * 6ghz psc channels in order to discover country information. + * @iwl_umac_scan_gen_flags_v2_6ghz_passive_scan_filter_in: in case + * &iwl_umac_scan_gen_flags_v2_6ghz_passive_scan is enabled and scan is + * activated over 6ghz psc channels, filter in beacons and probe responses. + iwl_umac_scan_gen_flags_v2_6ghz_passive_scan = bit(13), + iwl_umac_scan_gen_flags_v2_6ghz_passive_scan_filter_in = bit(14), diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h + * @iwl_ucode_tlv_capa_passive_6ghz_scan: support for passive scan on 6ghz psc + * channels even when these are not enabled. + iwl_ucode_tlv_capa_passive_6ghz_scan = (__force iwl_ucode_tlv_capa_t)58, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h --- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +#define iwl_mvm_6ghz_passive_scan_timeout 3000 /* in seconds */ +#define iwl_mvm_6ghz_passive_scan_assoc_timeout 60 /* in seconds */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c + mvm->last_reset_or_resume_time_jiffies = jiffies; + diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c + mvm->last_reset_or_resume_time_jiffies = jiffies; + diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h + + unsigned long last_6ghz_passive_scan_jiffies; + unsigned long last_reset_or_resume_time_jiffies; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +/* minimal number of 2ghz and 5ghz channels in the regular scan request */ +#define iwl_mvm_6ghz_passive_scan_min_chans 4 + + bool enable_6ghz_passive; +static void iwl_mvm_scan_6ghz_passive_scan(struct iwl_mvm *mvm, + struct iwl_mvm_scan_params *params, + struct ieee80211_vif *vif) +{ + struct ieee80211_supported_band *sband = + &mvm->nvm_data->bands[nl80211_band_6ghz]; + u32 n_disabled, i; + + params->enable_6ghz_passive = false; + + if (params->scan_6ghz) + return; + + if (!fw_has_capa(&mvm->fw->ucode_capa, + iwl_ucode_tlv_capa_passive_6ghz_scan)) { + iwl_debug_scan(mvm, + "6ghz passive scan: not supported by fw "); + return; + } + + /* 6ghz passive scan allowed only on station interface */ + if (vif->type != nl80211_iftype_station) { + iwl_debug_scan(mvm, + "6ghz passive scan: not station interface "); + return; + } + + /* + * 6ghz passive scan is allowed while associated in a defined time + * interval following hw reset or resume flow + */ + if (vif->bss_conf.assoc && + (time_before(mvm->last_reset_or_resume_time_jiffies + + (iwl_mvm_6ghz_passive_scan_assoc_timeout * hz), + jiffies))) { + iwl_debug_scan(mvm, "6ghz passive scan: associated "); + return; + } + + /* no need for 6ghz passive scan if not enough time elapsed */ + if (time_after(mvm->last_6ghz_passive_scan_jiffies + + (iwl_mvm_6ghz_passive_scan_timeout * hz), jiffies)) { + iwl_debug_scan(mvm, + "6ghz passive scan: timeout did not expire "); + return; + } + + /* not enough channels in the regular scan request */ + if (params->n_channels < iwl_mvm_6ghz_passive_scan_min_chans) { + iwl_debug_scan(mvm, + "6ghz passive scan: not enough channels "); + return; + } + + for (i = 0; i < params->n_ssids; i++) { + if (!params->ssids[i].ssid_len) + break; + } + + /* not a wildcard scan, so cannot enable passive 6ghz scan */ + if (i == params->n_ssids) { + iwl_debug_scan(mvm, + "6ghz passive scan: no wildcard ssid "); + return; + } + + if (!sband || !sband->n_channels) { + iwl_debug_scan(mvm, + "6ghz passive scan: no 6ghz channels "); + return; + } + + for (i = 0, n_disabled = 0; i < sband->n_channels; i++) { + if (sband->channels[i].flags & (ieee80211_chan_disabled)) + n_disabled++; + } + + /* + * not all the 6ghz channels are disabled, so no need for 6ghz passive + * scan + */ + if (n_disabled != sband->n_channels) { + iwl_debug_scan(mvm, + "6ghz passive scan: 6ghz channels enabled "); + return; + } + + /* all conditions to enable 6ghz passive scan are satisfied */ + iwl_debug_scan(mvm, "6ghz passive scan: can be enabled "); + params->enable_6ghz_passive = true; +} + + if (params->enable_6ghz_passive) + flags |= iwl_umac_scan_gen_flags_v2_6ghz_passive_scan; + + + if (params->enable_6ghz_passive) { + struct ieee80211_supported_band *sband = + &mvm->nvm_data->bands[nl80211_band_6ghz]; + u32 i; + + for (i = 0; i < sband->n_channels; i++) { + struct ieee80211_channel *channel = + &sband->channels[i]; + + struct iwl_scan_channel_cfg_umac *cfg = + &cp->channel_config[cp->count]; + + if (!cfg80211_channel_is_psc(channel)) + continue; + + cfg->flags = 0; + cfg->v2.channel_num = channel->hw_value; + cfg->v2.band = phy_band_6; + cfg->v2.iter_count = 1; + cfg->v2.iter_interval = 0; + cp->count++; + } + } + iwl_mvm_scan_6ghz_passive_scan(mvm, ¶ms, vif); + + if (params.enable_6ghz_passive) + mvm->last_6ghz_passive_scan_jiffies = jiffies; +
|
Networking
|
e8fe3b41c3a36c7a7aa88bdfec112b91530577e4
|
ilan peer
|
drivers
|
net
|
api, fw, intel, iwlwifi, mvm, wireless
|
iwlwifi: mvm: add support for version 3 of lari_config_change command.
|
add support for version 3 of the lari_config_change command. this is needed to support fw api change which is needed to support 11ax enablement in russia.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for version 3 of lari_config_change command
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['iwlwifi ', 'mvm']
|
['h', 'c']
| 3
| 29
| 16
|
--- diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c - * copyright (c) 2019-2020 intel corporation + * copyright (c) 2019-2021 intel corporation - /* - ** evaluate func 'dsm_func_11ax_enablement' - */ - ret = iwl_acpi_eval_dsm_func(fwrt->dev, dsm_func_11ax_enablement); - - config_bitmap |= - cpu_to_le32((ret &= iwl_11ax_ukraine_mask) << iwl_11ax_ukraine_shift); - diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h --- a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h - * copyright (c) 2012-2014, 2018-2020 intel corporation + * copyright (c) 2012-2014, 2018-2021 intel corporation +/** + * struct iwl_lari_config_change_cmd_v3 - change lari configuration + * @config_bitmap: bit map of the config commands. each bit will trigger a + * different predefined fw config operation + * @oem_uhb_allow_bitmap: bitmap of uhb enabled mcc sets + * @oem_11ax_allow_bitmap: bitmap of 11ax allowed mccs. + * for each supported country, a pair of regulatory override bit and 11ax mode exist + * in the bit field. + */ +struct iwl_lari_config_change_cmd_v3 { + __le32 config_bitmap; + __le32 oem_uhb_allow_bitmap; + __le32 oem_11ax_allow_bitmap; +} __packed; /* lari_change_conf_cmd_s_ver_3 */ + diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c - struct iwl_lari_config_change_cmd_v2 cmd = {}; + struct iwl_lari_config_change_cmd_v3 cmd = {}; - size_t cmd_size = iwl_fw_lookup_cmd_ver(mvm->fw, - regulatory_and_nvm_group, - lari_config_change, 1) == 2 ? - sizeof(struct iwl_lari_config_change_cmd_v2) : - sizeof(struct iwl_lari_config_change_cmd_v1); + size_t cmd_size; + u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, + regulatory_and_nvm_group, + lari_config_change, 1); + if (cmd_ver == 3) + cmd_size = sizeof(struct iwl_lari_config_change_cmd_v3); + else if (cmd_ver == 2) + cmd_size = sizeof(struct iwl_lari_config_change_cmd_v2); + else + cmd_size = sizeof(struct iwl_lari_config_change_cmd_v1); +
|
Networking
|
3c21990b0ccecf0e3679f82cd1931999bd78b261
|
miri korenblit
|
drivers
|
net
|
api, fw, intel, iwlwifi, mvm, wireless
|
iwlwifi: mvm: enable ppag in china
|
add support for ppag in china by reading revision 2 of the ppag table from acpi, and passing the data to the fw. this is needed to enable oems to control ppag enablement in china.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
enable ppag in china
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['iwlwifi ', 'mvm']
|
['h', 'c']
| 4
| 65
| 46
|
--- diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c - * (i.e. it is an integer smaller than 2, as we currently support only - * 2 revisions). + * (i.e. it is an integer (each caller has to check by itself + * if the returned revision is supported)). - data->package.elements[0].type != acpi_type_integer || - data->package.elements[0].integer.value > 1) { - iwl_debug_dev_radio(dev, "unsupported packages structure "); + data->package.elements[0].type != acpi_type_integer) { + iwl_debug_dev_radio(dev, "invalid packages structure "); diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h -#define acpi_ppag_wifi_data_size ((iwl_num_chain_limits * \ - iwl_num_sub_bands) + 2) +#define acpi_ppag_wifi_data_size_v1 ((iwl_num_chain_limits * \ + iwl_num_sub_bands_v1) + 2) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/power.h b/drivers/net/wireless/intel/iwlwifi/fw/api/power.h --- a/drivers/net/wireless/intel/iwlwifi/fw/api/power.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/power.h -#define iwl_num_sub_bands 5 +#define iwl_num_sub_bands_v1 5 - __le16 per_chain[iwl_num_chain_tables][iwl_num_chain_limits][iwl_num_sub_bands]; + __le16 per_chain[iwl_num_chain_tables][iwl_num_chain_limits][iwl_num_sub_bands_v1]; - __le16 per_chain[iwl_num_chain_tables][iwl_num_chain_limits][iwl_num_sub_bands]; + __le16 per_chain[iwl_num_chain_tables][iwl_num_chain_limits][iwl_num_sub_bands_v1]; - __le16 per_chain[iwl_num_chain_tables][iwl_num_chain_limits][iwl_num_sub_bands]; + __le16 per_chain[iwl_num_chain_tables][iwl_num_chain_limits][iwl_num_sub_bands_v1]; - * @v1: version 1, table revision = 0 - * @v2: version 2, table revision = 1 + * @v1: version 1 + * @v2: version 2 - * @enabled: 1 if ppag is enabled, 0 otherwise + * @flags: bit 0 - indicates enablement of ppag for etsi + * bit 1 - indicates enablement of ppag for china bios + * bit 1 can be used only in v3 (identical to v2) - __le32 enabled; - s8 gain[iwl_num_chain_limits][iwl_num_sub_bands]; + __le32 flags; + s8 gain[iwl_num_chain_limits][iwl_num_sub_bands_v1]; - __le32 enabled; + __le32 flags; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +#define iwl_ppag_mask 3 +#define iwl_ppag_etsi_mask bit(0) + - n_subbands = iwl_num_sub_bands; + n_subbands = iwl_num_sub_bands_v1; - n_subbands = iwl_num_sub_bands; + n_subbands = iwl_num_sub_bands_v1; - n_subbands = iwl_num_sub_bands; + n_subbands = iwl_num_sub_bands_v1; - union acpi_object *wifi_pkg, *data, *enabled; + union acpi_object *wifi_pkg, *data, *flags; - * the 'enabled' field is the same in v1 and v2 so we can just + * the 'flags' field is the same in v1 and in v2 so we can just - mvm->fwrt.ppag_table.v1.enabled = cpu_to_le32(0); + mvm->fwrt.ppag_table.v1.flags = cpu_to_le32(0); + - /* try to read ppag table revision 1 */ + /* try to read ppag table rev 2 or 1 (both have the same data size) */ - if (tbl_rev != 1) { + if (tbl_rev == 1 || tbl_rev == 2) { + num_sub_bands = iwl_num_sub_bands_v2; + gain = mvm->fwrt.ppag_table.v2.gain[0]; + mvm->fwrt.ppag_ver = tbl_rev; + iwl_debug_radio(mvm, + "reading ppag table v2 (tbl_rev=%d) ", + tbl_rev); + goto read_table; + } else { - num_sub_bands = iwl_num_sub_bands_v2; - gain = mvm->fwrt.ppag_table.v2.gain[0]; - mvm->fwrt.ppag_ver = 2; - iwl_debug_radio(mvm, "reading ppag table v2 (tbl_rev=1) "); - goto read_table; - acpi_ppag_wifi_data_size, &tbl_rev); + acpi_ppag_wifi_data_size_v1, &tbl_rev); - num_sub_bands = iwl_num_sub_bands; + num_sub_bands = iwl_num_sub_bands_v1; - mvm->fwrt.ppag_ver = 1; + mvm->fwrt.ppag_ver = 0; - enabled = &wifi_pkg->package.elements[1]; - if (enabled->type != acpi_type_integer || - (enabled->integer.value != 0 && enabled->integer.value != 1)) { + flags = &wifi_pkg->package.elements[1]; + + if (flags->type != acpi_type_integer) { - mvm->fwrt.ppag_table.v1.enabled = cpu_to_le32(enabled->integer.value); - if (!mvm->fwrt.ppag_table.v1.enabled) { + mvm->fwrt.ppag_table.v1.flags = cpu_to_le32(flags->integer.value & + iwl_ppag_mask); + + if (!mvm->fwrt.ppag_table.v1.flags) { - mvm->fwrt.ppag_table.v1.enabled = cpu_to_le32(0); + mvm->fwrt.ppag_table.v1.flags = cpu_to_le32(0); + - if (!mvm->fwrt.ppag_table.v1.enabled) { + if (!mvm->fwrt.ppag_table.v1.flags) { - num_sub_bands = iwl_num_sub_bands; + num_sub_bands = iwl_num_sub_bands_v1; - if (mvm->fwrt.ppag_ver == 2) { + if (mvm->fwrt.ppag_ver == 1 || mvm->fwrt.ppag_ver == 2) { - "ppag table is v2 but fw supports v1, sending truncated table "); + "ppag table rev is %d but fw supports v1, sending truncated table ", + mvm->fwrt.ppag_ver); + mvm->fwrt.ppag_table.v1.flags &= + cpu_to_le32(iwl_ppag_etsi_mask); - } else if (cmd_ver == 2) { + } else if (cmd_ver == 2 || cmd_ver == 3) { - if (mvm->fwrt.ppag_ver == 1) { + if (mvm->fwrt.ppag_ver == 0) { + } else if (cmd_ver == 2 && mvm->fwrt.ppag_ver == 2) { + iwl_debug_radio(mvm, + "ppag table is v3 but fw supports v2, sending partial bitmap. "); + mvm->fwrt.ppag_table.v1.flags &= + cpu_to_le32(iwl_ppag_etsi_mask); - mvm->fwrt.ppag_table.v1.enabled = cpu_to_le32(0); + mvm->fwrt.ppag_table.v1.flags = cpu_to_le32(0);
|
Networking
|
e12cfc7bbfd31c1be6567b296ea058e35fba91ab
|
miri korenblit
|
drivers
|
net
|
api, fw, intel, iwlwifi, mvm, wireless
|
iwlwifi: mvm: responder: support responder config command version 8
|
version 8 add ndp ranging parameters configuration, as well as enable/disable ndp ranging and lmr feedback.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
support responder config command version 8
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['iwlwifi ', 'mvm', 'responder']
|
['h', 'c']
| 3
| 90
| 6
|
--- diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h --- a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h + * @iwl_tof_responder_cmd_valid_ndp_support: enable/disable ndp ranging support + * is valid + * @iwl_tof_responder_cmd_valid_ndp_params: ndp parameters are valid + * @iwl_tof_responder_cmd_valid_lmr_feedback: lmr feedback support is valid + iwl_tof_responder_cmd_valid_ndp_support = bit(22), + iwl_tof_responder_cmd_valid_ndp_params = bit(23), + iwl_tof_responder_cmd_valid_lmr_feedback = bit(24), + * @iwl_tof_responder_flags_ndp_support: support ndp ranging + * @iwl_tof_responder_flags_lmr_feedback: request for lmr feedback if the + * initiator supports it + iwl_tof_responder_flags_ndp_support = bit(24), + iwl_tof_responder_flags_lmr_feedback = bit(25), - * struct iwl_tof_responder_config_cmd - tof ap mode (for debug) + * struct iwl_tof_responder_config_cmd_v7 - tof ap mode (for debug) -struct iwl_tof_responder_config_cmd { +struct iwl_tof_responder_config_cmd_v7 { -} __packed; /* tof_responder_config_cmd_api_s_ver_6 */ +} __packed; /* tof_responder_config_cmd_api_s_ver_7 */ + +#define iwl_responder_sts_pos 3 +#define iwl_responder_total_ltf_pos 6 + +/** + * struct iwl_tof_responder_config_cmd_v8 - tof ap mode (for debug) + * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field + * @responder_cfg_flags: &iwl_tof_responder_cfg_flags + * @format_bw: bits 0 - 3: &enum iwl_location_frame_format. + * bits 4 - 7: &enum iwl_location_bw. + * @rate: current ap rate + * @channel_num: current ap channel + * @ctrl_ch_position: coding of the control channel position relative to + * the center frequency, see iwl_mvm_get_ctrl_pos() + * @sta_id: index of the ap sta when in ap mode + * @reserved1: reserved + * @toa_offset: artificial addition [psec] for the toa - to be used for debug + * purposes, simulating station movement by adding various values + * to this field + * @common_calib: xvt: common calibration value + * @specific_calib: xvt: specific calibration value + * @bssid: current ap bssid + * @r2i_ndp_params: parameters for r2i ndp. + * bits 0 - 2: max number of ltf repetitions + * bits 3 - 5: max number of spatial streams (supported values are < 2) + * bits 6 - 7: max number of total ltfs + * (&enum ieee80211_range_params_max_total_ltf) + * @i2r_ndp_params: parameters for i2r ndp. + * bits 0 - 2: max number of ltf repetitions + * bits 3 - 5: max number of spatial streams + * bits 6 - 7: max number of total ltfs + * (&enum ieee80211_range_params_max_total_ltf) + */ +struct iwl_tof_responder_config_cmd_v8 { + __le32 cmd_valid_fields; + __le32 responder_cfg_flags; + u8 format_bw; + u8 rate; + u8 channel_num; + u8 ctrl_ch_position; + u8 sta_id; + u8 reserved1; + __le16 toa_offset; + __le16 common_calib; + __le16 specific_calib; + u8 bssid[eth_alen]; + u8 r2i_ndp_params; + u8 i2r_ndp_params; +} __packed; /* tof_responder_config_cmd_api_s_ver_8 */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h --- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +#define iwl_mvm_ftm_resp_ndp_support true +#define iwl_mvm_ftm_resp_lmr_feedback_support true diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c +static void +iwl_mvm_ftm_responder_set_ndp(struct iwl_mvm *mvm, + struct iwl_tof_responder_config_cmd_v8 *cmd) +{ + /* up to 2 r2i sts are allowed on the responder */ + u32 r2i_max_sts = iwl_mvm_ftm_r2i_max_sts < 2 ? + iwl_mvm_ftm_r2i_max_sts : 1; + + cmd->r2i_ndp_params = iwl_mvm_ftm_r2i_max_rep | + (r2i_max_sts << iwl_responder_sts_pos) | + (iwl_mvm_ftm_r2i_max_total_ltf << iwl_responder_total_ltf_pos); + cmd->i2r_ndp_params = iwl_mvm_ftm_i2r_max_rep | + (iwl_mvm_ftm_i2r_max_sts << iwl_responder_sts_pos) | + (iwl_mvm_ftm_i2r_max_total_ltf << iwl_responder_total_ltf_pos); + cmd->cmd_valid_fields |= + cpu_to_le32(iwl_tof_responder_cmd_valid_ndp_params); +} + - * the command structure is the same for versions 6 and 7, (only the + * the command structure is the same for versions 6, 7 and 8 (only the - struct iwl_tof_responder_config_cmd cmd = { + struct iwl_tof_responder_config_cmd_v8 cmd = { - if (cmd_ver == 7) +if (cmd_ver == 8) + iwl_mvm_ftm_responder_set_ndp(mvm, &cmd); + + if (cmd_ver >= 7)
|
Networking
|
20578872d503d5c211bdf334185ccd8afe4ae697
|
avraham stern
|
drivers
|
net
|
api, fw, intel, iwlwifi, mvm, wireless
|
iwlwifi: mvm: support bios enable/disable for 11ax in ukraine
|
read the new bios dsm and pass to fw if to disable\enable 11ax for ukraine according to the bios key. this is needed to enable oems to control enable/disable 11ax in ukraine
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
support bios enable/disable for 11ax in ukraine
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['iwlwifi ', 'mvm']
|
['h', 'c']
| 4
| 45
| 0
|
--- diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c + +u32 iwl_acpi_eval_dsm_11ax_enablement(struct device *dev) +{ + union acpi_object *obj; + u32 ret; + + obj = iwl_acpi_get_dsm_object(dev, 0, + dsm_func_11ax_enablement, null, + &iwl_guid); + if (is_err(obj)) + return 0; + + if (obj->type != acpi_type_integer) { + iwl_debug_dev_radio(dev, + "acpi: dsm method did not return a valid object, type=%d ", + obj->type); + ret = 0; + goto out; + } + + ret = obj->integer.value; + iwl_debug_dev_radio(dev, + "acpi: dsm method evaluated: func=dsm_func_11ax_enablement, ret=%d ", + ret); +out: + acpi_free(obj); + return ret; +} +iwl_export_symbol(iwl_acpi_eval_dsm_11ax_enablement); diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h + dsm_func_11ax_enablement = 6, +u32 iwl_acpi_eval_dsm_11ax_enablement(struct device *dev); + + +static inline u32 iwl_acpi_eval_dsm_11ax_enablement(struct device *dev) +{ + return 0; +} + diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h --- a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +#define iwl_11ax_ukraine_mask 3 +#define iwl_11ax_ukraine_shift 8 + diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c + ret = iwl_acpi_eval_dsm_11ax_enablement((&mvm->fwrt)->dev); + cmd.config_bitmap |= + cpu_to_le32((ret &= iwl_11ax_ukraine_mask) << iwl_11ax_ukraine_shift); +
|
Networking
|
d2bfda8addf9d78146c1ae3a39f4df3c845ea0d5
|
miri korenblit
|
drivers
|
net
|
api, fw, intel, iwlwifi, mvm, wireless
|
iwlwifi: mvm: support range request command version 12
|
version 12 adds configuration of ndp ranging parameters: - max number of ltf repetitions - max number of spatial streams - max total ltfs
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
support range request command version 12
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['iwlwifi ', 'mvm']
|
['h', 'c']
| 3
| 186
| 3
|
- max number of ltf repetitions - max number of spatial streams - max total ltfs --- diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h --- a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h - * @iwl_initiator_ap_flags_secured: request secured measurement + * @iwl_initiator_ap_flags_secured: request secure ltf measurement + * @iwl_initiator_ap_flags_pmf: request to protect the negotiation and lmr + * frames with protected management frames. + iwl_initiator_ap_flags_pmf = bit(14), +#define iwl_location_max_sts_pos 3 + +/** + * struct iwl_tof_range_req_ap_entry_v8 - ap configuration parameters + * @initiator_ap_flags: see &enum iwl_initiator_ap_flags. + * @channel_num: ap channel number + * @format_bw: bits 0 - 3: &enum iwl_location_frame_format. + * bits 4 - 7: &enum iwl_location_bw. + * @ctrl_ch_position: coding of the control channel position relative to the + * center frequency, see iwl_mvm_get_ctrl_pos(). + * @ftmr_max_retries: max number of retries to send the ftmr in case of no + * reply from the ap. + * @bssid: ap's bssid + * @burst_period: recommended value to be sent to the ap. measurement + * periodicity in units of 100ms. ignored if num_of_bursts_exp = 0 + * @samples_per_burst: the number of ftms pairs in single burst (1-31); + * @num_of_bursts: recommended value to be sent to the ap. 2s exponent of + * the number of measurement iterations (min 2^0 = 1, max 2^14) + * @sta_id: the station id of the ap. only relevant when associated to the ap, + * otherwise should be set to &iwl_mvm_invalid_sta. + * @cipher: pairwise cipher suite for secured measurement. + * &enum iwl_location_cipher. + * @hltk: hltk to be used for secured 11az measurement + * @tk: tk to be used for secured 11az measurement + * @calib: an array of calibration values per ftm rx bandwidth. + * if &iwl_initiator_ap_flags_use_calib is set, the fw will use the + * calibration value that corresponds to the rx bandwidth of the ftm + * frame. + * @beacon_interval: beacon interval of the ap in tus. only required if + * &iwl_initiator_ap_flags_tb is set. + * @rx_pn: the next expected pn for protected management frames rx. le byte + * order. only valid if &iwl_initiator_ap_flags_secured is set and sta_id + * is set to &iwl_mvm_invalid_sta. + * @tx_pn: the next pn to use for protected management frames tx. le byte + * order. only valid if &iwl_initiator_ap_flags_secured is set and sta_id + * is set to &iwl_mvm_invalid_sta. + * @r2i_ndp_params: parameters for r2i ndp ranging negotiation. + * bits 0 - 2: max ltf repetitions + * bits 3 - 5: max number of spatial streams + * bits 6 - 7: reserved + * @i2r_ndp_params: parameters for i2r ndp ranging negotiation. + * bits 0 - 2: max ltf repetitions + * bits 3 - 5: max number of spatial streams (supported values are < 2) + * bits 6 - 7: reserved + * @r2i_max_total_ltf: r2i max total ltfs for ndp ranging negotiation. + * one of &enum ieee80211_range_params_max_total_ltf. + * @i2r_max_total_ltf: i2r max total ltfs for ndp ranging negotiation. + * one of &enum ieee80211_range_params_max_total_ltf. + */ +struct iwl_tof_range_req_ap_entry_v8 { + __le32 initiator_ap_flags; + u8 channel_num; + u8 format_bw; + u8 ctrl_ch_position; + u8 ftmr_max_retries; + u8 bssid[eth_alen]; + __le16 burst_period; + u8 samples_per_burst; + u8 num_of_bursts; + u8 sta_id; + u8 cipher; + u8 hltk[hltk_11az_len]; + u8 tk[tk_11az_len]; + __le16 calib[iwl_tof_bw_num]; + __le16 beacon_interval; + u8 rx_pn[ieee80211_ccmp_pn_len]; + u8 tx_pn[ieee80211_ccmp_pn_len]; + u8 r2i_ndp_params; + u8 i2r_ndp_params; + u8 r2i_max_total_ltf; + u8 i2r_max_total_ltf; +} __packed; /* location_range_req_ap_entry_cmd_api_s_ver_8 */ + +/** + * struct iwl_tof_range_req_cmd_v12 - start measurement cmd + * @initiator_flags: see flags @ iwl_tof_initiator_flags + * @request_id: a token incremented per request. the same token will be + * sent back in the range response + * @num_of_ap: number of aps to measure (error if > iwl_mvm_tof_max_aps) + * @range_req_bssid: ranging request bssid + * @macaddr_mask: bits set to 0 shall be copied from the mac address template. + * bits set to 1 shall be randomized by the umac + * @macaddr_template: mac address template to use for non-randomized bits + * @req_timeout_ms: requested timeout of the response in units of milliseconds. + * this is the session time for completing the measurement. + * @tsf_mac_id: report the measurement start time for each ap in terms of the + * tsf of this mac id. 0xff to disable tsf reporting. + * @ap: per-ap request data, see &struct iwl_tof_range_req_ap_entry_v2. + */ +struct iwl_tof_range_req_cmd_v12 { + __le32 initiator_flags; + u8 request_id; + u8 num_of_ap; + u8 range_req_bssid[eth_alen]; + u8 macaddr_mask[eth_alen]; + u8 macaddr_template[eth_alen]; + __le32 req_timeout_ms; + __le32 tsf_mac_id; + struct iwl_tof_range_req_ap_entry_v8 ap[iwl_mvm_tof_max_aps]; +} __packed; /* location_range_req_cmd_api_s_ver_12 */ + diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h --- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +#define iwl_mvm_ftm_r2i_max_rep 7 +#define iwl_mvm_ftm_i2r_max_rep 7 +#define iwl_mvm_ftm_r2i_max_sts 1 +#define iwl_mvm_ftm_i2r_max_sts 1 +#define iwl_mvm_ftm_r2i_max_total_ltf 3 +#define iwl_mvm_ftm_i2r_max_total_ltf 3 +#define iwl_mvm_ftm_initiator_secure_ltf false diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +static int +iwl_mvm_ftm_put_target_v7(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct cfg80211_pmsr_request_peer *peer, + struct iwl_tof_range_req_ap_entry_v7 *target) +{ + int err = iwl_mvm_ftm_put_target(mvm, vif, peer, (void *)target); + if (err) + return err; + + iwl_mvm_ftm_set_secured_ranging(mvm, vif, target); + return err; +} + - err = iwl_mvm_ftm_put_target(mvm, vif, peer, (void *)target); + err = iwl_mvm_ftm_put_target_v7(mvm, vif, peer, target); + } - iwl_mvm_ftm_set_secured_ranging(mvm, vif, target); + return iwl_mvm_ftm_send_cmd(mvm, &hcmd); +} + +static void +iwl_mvm_ftm_set_ndp_params(struct iwl_mvm *mvm, + struct iwl_tof_range_req_ap_entry_v8 *target) +{ + /* only 2 sts are supported on tx */ + u32 i2r_max_sts = iwl_mvm_ftm_i2r_max_sts > 1 ? 1 : + iwl_mvm_ftm_i2r_max_sts; + + target->r2i_ndp_params = iwl_mvm_ftm_r2i_max_rep | + (iwl_mvm_ftm_r2i_max_sts << iwl_location_max_sts_pos); + target->i2r_ndp_params = iwl_mvm_ftm_i2r_max_rep | + (i2r_max_sts << iwl_location_max_sts_pos); + target->r2i_max_total_ltf = iwl_mvm_ftm_r2i_max_total_ltf; + target->i2r_max_total_ltf = iwl_mvm_ftm_i2r_max_total_ltf; +} + +static int iwl_mvm_ftm_start_v12(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, + struct cfg80211_pmsr_request *req) +{ + struct iwl_tof_range_req_cmd_v12 cmd; + struct iwl_host_cmd hcmd = { + .id = iwl_cmd_id(tof_range_req_cmd, location_group, 0), + .dataflags[0] = iwl_hcmd_dfl_dup, + .data[0] = &cmd, + .len[0] = sizeof(cmd), + }; + u8 i; + int err; + + iwl_mvm_ftm_cmd_common(mvm, vif, (void *)&cmd, req); + + for (i = 0; i < cmd.num_of_ap; i++) { + struct cfg80211_pmsr_request_peer *peer = &req->peers[i]; + struct iwl_tof_range_req_ap_entry_v8 *target = &cmd.ap[i]; + u32 flags; + + err = iwl_mvm_ftm_put_target_v7(mvm, vif, peer, (void *)target); + if (err) + return err; + + iwl_mvm_ftm_set_ndp_params(mvm, target); + + /* + * if secure ltf is turned off, replace the flag with pmf only + */ + flags = le32_to_cpu(target->initiator_ap_flags); + if ((flags & iwl_initiator_ap_flags_secured) && + !iwl_mvm_ftm_initiator_secure_ltf) { + flags &= ~iwl_initiator_ap_flags_secured; + flags |= iwl_initiator_ap_flags_pmf; + target->initiator_ap_flags = cpu_to_le32(flags); + } + case 12: + err = iwl_mvm_ftm_start_v12(mvm, vif, req); + break;
|
Networking
|
9896b0b904455ef5371327e0fa8de823d192c5a1
|
avraham stern
|
drivers
|
net
|
api, fw, intel, iwlwifi, mvm, wireless
|
iwlwifi: pcie: add support for bz family
|
add support for different combinations of bz and crfs.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for bz family
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['iwlwifi ', 'pcie']
|
['h', 'c']
| 3
| 88
| 0
|
--- diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c --- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c +#define iwl_bz_a_hr_b_fw_pre "iwlwifi-bz-a0-hr-b0-" +#define iwl_bz_a_gf_a_fw_pre "iwlwifi-bz-a0-gf-a0-" +#define iwl_bz_a_gf4_a_fw_pre "iwlwifi-bz-a0-gf4-a0-" +#define iwl_bz_a_mr_a_fw_pre "iwlwifi-bz-a0-mr-a0-" +#define iwl_bz_a_hr_b_module_firmware(api) \ + iwl_bz_a_hr_b_fw_pre __stringify(api) ".ucode" +#define iwl_bz_a_gf_a_module_firmware(api) \ + iwl_bz_a_gf_a_fw_pre __stringify(api) ".ucode" +#define iwl_bz_a_gf4_a_module_firmware(api) \ + iwl_bz_a_gf4_a_fw_pre __stringify(api) ".ucode" +#define iwl_bz_a_mr_a_module_firmware(api) \ + iwl_bz_a_mr_a_fw_pre __stringify(api) ".ucode" +const struct iwl_cfg_trans_params iwl_bz_trans_cfg = { + .device_family = iwl_device_family_ax210, + .base_params = &iwl_ax210_base_params, + .mq_rx_supported = true, + .use_tfh = true, + .rf_id = true, + .gen2 = true, + .integrated = true, + .umac_prph_offset = 0x300000, + .xtal_latency = 12000, + .low_latency_xtal = true, + .ltr_delay = iwl_cfg_trans_ltr_delay_2500us, +}; + +const struct iwl_cfg iwl_cfg_bz_a0_hr_b0 = { + .fw_name_pre = iwl_bz_a_hr_b_fw_pre, + .uhb_supported = true, + iwl_device_ax210, + .num_rbds = iwl_num_rbds_ax210_he, +}; + +const struct iwl_cfg iwl_cfg_bz_a0_gf_a0 = { + .fw_name_pre = iwl_bz_a_gf_a_fw_pre, + .uhb_supported = true, + iwl_device_ax210, + .num_rbds = iwl_num_rbds_ax210_he, +}; + +const struct iwl_cfg iwl_cfg_bz_a0_gf4_a0 = { + .fw_name_pre = iwl_bz_a_gf4_a_fw_pre, + .uhb_supported = true, + iwl_device_ax210, + .num_rbds = iwl_num_rbds_ax210_he, +}; + +const struct iwl_cfg iwl_cfg_bz_a0_mr_a0 = { + .fw_name_pre = iwl_bz_a_mr_a_fw_pre, + .uhb_supported = true, + iwl_device_ax210, + .num_rbds = iwl_num_rbds_ax210_he, +}; + +module_firmware(iwl_bz_a_hr_b_module_firmware(iwl_22000_ucode_api_max)); +module_firmware(iwl_bz_a_gf_a_module_firmware(iwl_22000_ucode_api_max)); +module_firmware(iwl_bz_a_gf4_a_module_firmware(iwl_22000_ucode_api_max)); +module_firmware(iwl_bz_a_mr_a_module_firmware(iwl_22000_ucode_api_max)); diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h --- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h +#define iwl_cfg_mac_type_bz 0x46 +extern const struct iwl_cfg_trans_params iwl_bz_trans_cfg; +extern const struct iwl_cfg iwl_cfg_bz_a0_hr_b0; +extern const struct iwl_cfg iwl_cfg_bz_a0_gf_a0; +extern const struct iwl_cfg iwl_cfg_bz_a0_gf4_a0; +extern const struct iwl_cfg iwl_cfg_bz_a0_mr_a0; diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +/* bz devices */ + {iwl_pci_device(0x2727, pci_any_id, iwl_bz_trans_cfg)}, +/* bz */ + _iwl_dev_info(iwl_cfg_any, iwl_cfg_any, + iwl_cfg_mac_type_bz, iwl_cfg_any, + iwl_cfg_rf_type_hr2, iwl_cfg_any, + iwl_cfg_any, iwl_cfg_any, iwl_cfg_no_cdb, + iwl_cfg_bz_a0_hr_b0, iwl_ax201_name), + _iwl_dev_info(iwl_cfg_any, iwl_cfg_any, + iwl_cfg_mac_type_bz, iwl_cfg_any, + iwl_cfg_rf_type_gf, iwl_cfg_any, + iwl_cfg_any, iwl_cfg_any, iwl_cfg_no_cdb, + iwl_cfg_bz_a0_gf_a0, iwl_ax211_name), + _iwl_dev_info(iwl_cfg_any, iwl_cfg_any, + iwl_cfg_mac_type_bz, iwl_cfg_any, + iwl_cfg_rf_type_gf, iwl_cfg_any, + iwl_cfg_any, iwl_cfg_any, iwl_cfg_cdb, + iwl_cfg_bz_a0_gf4_a0, iwl_ax211_name), + _iwl_dev_info(iwl_cfg_any, iwl_cfg_any, + iwl_cfg_mac_type_bz, iwl_cfg_any, + iwl_cfg_rf_type_mr, iwl_cfg_any, + iwl_cfg_any, iwl_cfg_any, iwl_cfg_no_cdb, + iwl_cfg_bz_a0_mr_a0, iwl_ma_name), +
|
Networking
|
2be05dfd9c3f86c66ebcfd7b2a01d07c7e0158dd
|
matti gottlieb
|
drivers
|
net
|
cfg, intel, iwlwifi, pcie, wireless
|
ixgbe: support external gbe serdes phy bcm54616s
|
the broadcom phy is used in switches, so add the id, and hook it up.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
support external gbe
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['ixgbe']
|
['h', 'c']
| 2
| 4
| 0
|
--- diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c + case bcm54616s_e_phy_id: + phy_type = ixgbe_phy_ext_1g_t; + break; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +#define bcm54616s_e_phy_id 0x03625d10
|
Networking
|
47222864c14bc10c7769378f7601e2a45bd52026
|
jostar yang
|
drivers
|
net
|
ethernet, intel, ixgbe
|
net: marvell: prestera: add support for ac3x 98dx3265 device
|
add pci match for ac3x 98dx3265 device which is supported by the current driver and firmware.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for ac3x 98dx3265 device
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['marvell', 'prestera']
|
['c']
| 1
| 1
| 0
|
--- diff --git a/drivers/net/ethernet/marvell/prestera/prestera_pci.c b/drivers/net/ethernet/marvell/prestera/prestera_pci.c --- a/drivers/net/ethernet/marvell/prestera/prestera_pci.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_pci.c + { pci_device(pci_vendor_id_marvell, 0xc80c) },
|
Networking
|
ced97eea3974e6eaa33e771d8790f4c0ada0d226
|
vadym kochan
|
drivers
|
net
|
ethernet, marvell, prestera
|
net: mdio: add bcm6368 mdio mux bus controller
|
this controller is present on bcm6318, bcm6328, bcm6362, bcm6368 and bcm63268 socs.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add bcm6368 mdio mux bus controller
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mdio']
|
['kconfig', 'c', 'makefile']
| 3
| 196
| 0
|
--- diff --git a/drivers/net/mdio/kconfig b/drivers/net/mdio/kconfig --- a/drivers/net/mdio/kconfig +++ b/drivers/net/mdio/kconfig +config mdio_bus_mux_bcm6368 + tristate "broadcom bcm6368 mdio bus multiplexers" + depends on of && of_mdio && (bmips_generic || compile_test) + select mdio_bus_mux + default bmips_generic + help + this module provides a driver for mdio bus multiplexers found in + bcm6368 based broadcom socs. this multiplexer connects one of several + child mdio bus to a parent bus. buses could be internal as well as + external and selection logic lies inside the same multiplexer. + diff --git a/drivers/net/mdio/makefile b/drivers/net/mdio/makefile --- a/drivers/net/mdio/makefile +++ b/drivers/net/mdio/makefile +obj-$(config_mdio_bus_mux_bcm6368) += mdio-mux-bcm6368.o diff --git a/drivers/net/mdio/mdio-mux-bcm6368.c b/drivers/net/mdio/mdio-mux-bcm6368.c --- /dev/null +++ b/drivers/net/mdio/mdio-mux-bcm6368.c +// spdx-license-identifier: gpl-2.0+ +/* + * broadcom bcm6368 mdiomux bus controller driver + * + * copyright (c) 2021 alvaro fernandez rojas <noltari@gmail.com> + */ + +#include <linux/delay.h> +#include <linux/io.h> +#include <linux/kernel.h> +#include <linux/mdio-mux.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_platform.h> +#include <linux/of_mdio.h> +#include <linux/phy.h> +#include <linux/platform_device.h> +#include <linux/sched.h> + +#define mdioc_reg 0x0 +#define mdioc_ext_mask bit(16) +#define mdioc_reg_shift 20 +#define mdioc_phyid_shift 25 +#define mdioc_rd_mask bit(30) +#define mdioc_wr_mask bit(31) + +#define mdiod_reg 0x4 + +struct bcm6368_mdiomux_desc { + void *mux_handle; + void __iomem *base; + struct device *dev; + struct mii_bus *mii_bus; + int ext_phy; +}; + +static int bcm6368_mdiomux_read(struct mii_bus *bus, int phy_id, int loc) +{ + struct bcm6368_mdiomux_desc *md = bus->priv; + uint32_t reg; + int ret; + + __raw_writel(0, md->base + mdioc_reg); + + reg = mdioc_rd_mask | + (phy_id << mdioc_phyid_shift) | + (loc << mdioc_reg_shift); + if (md->ext_phy) + reg |= mdioc_ext_mask; + + __raw_writel(reg, md->base + mdioc_reg); + udelay(50); + ret = __raw_readw(md->base + mdiod_reg); + + return ret; +} + +static int bcm6368_mdiomux_write(struct mii_bus *bus, int phy_id, int loc, + uint16_t val) +{ + struct bcm6368_mdiomux_desc *md = bus->priv; + uint32_t reg; + + __raw_writel(0, md->base + mdioc_reg); + + reg = mdioc_wr_mask | + (phy_id << mdioc_phyid_shift) | + (loc << mdioc_reg_shift); + if (md->ext_phy) + reg |= mdioc_ext_mask; + reg |= val; + + __raw_writel(reg, md->base + mdioc_reg); + udelay(50); + + return 0; +} + +static int bcm6368_mdiomux_switch_fn(int current_child, int desired_child, + void *data) +{ + struct bcm6368_mdiomux_desc *md = data; + + md->ext_phy = desired_child; + + return 0; +} + +static int bcm6368_mdiomux_probe(struct platform_device *pdev) +{ + struct bcm6368_mdiomux_desc *md; + struct mii_bus *bus; + struct resource *res; + int rc; + + md = devm_kzalloc(&pdev->dev, sizeof(*md), gfp_kernel); + if (!md) + return -enomem; + md->dev = &pdev->dev; + + res = platform_get_resource(pdev, ioresource_mem, 0); + if (!res) + return -einval; + + /* + * just ioremap, as this mdio block is usually integrated into an + * ethernet mac controller register range + */ + md->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!md->base) { + dev_err(&pdev->dev, "failed to ioremap register "); + return -enomem; + } + + md->mii_bus = devm_mdiobus_alloc(&pdev->dev); + if (!md->mii_bus) { + dev_err(&pdev->dev, "mdiomux bus alloc failed "); + return enomem; + } + + bus = md->mii_bus; + bus->priv = md; + bus->name = "bcm6368 mdio mux bus"; + snprintf(bus->id, mii_bus_id_size, "%s-%d", pdev->name, pdev->id); + bus->parent = &pdev->dev; + bus->read = bcm6368_mdiomux_read; + bus->write = bcm6368_mdiomux_write; + bus->phy_mask = 0x3f; + bus->dev.of_node = pdev->dev.of_node; + + rc = mdiobus_register(bus); + if (rc) { + dev_err(&pdev->dev, "mdiomux registration failed "); + return rc; + } + + platform_set_drvdata(pdev, md); + + rc = mdio_mux_init(md->dev, md->dev->of_node, + bcm6368_mdiomux_switch_fn, &md->mux_handle, md, + md->mii_bus); + if (rc) { + dev_info(md->dev, "mdiomux initialization failed "); + goto out_register; + } + + dev_info(&pdev->dev, "broadcom bcm6368 mdio mux bus "); + + return 0; + +out_register: + mdiobus_unregister(bus); + return rc; +} + +static int bcm6368_mdiomux_remove(struct platform_device *pdev) +{ + struct bcm6368_mdiomux_desc *md = platform_get_drvdata(pdev); + + mdio_mux_uninit(md->mux_handle); + mdiobus_unregister(md->mii_bus); + + return 0; +} + +static const struct of_device_id bcm6368_mdiomux_ids[] = { + { .compatible = "brcm,bcm6368-mdio-mux", }, + { /* sentinel */ } +}; +module_device_table(of, bcm6368_mdiomux_ids); + +static struct platform_driver bcm6368_mdiomux_driver = { + .driver = { + .name = "bcm6368-mdio-mux", + .of_match_table = bcm6368_mdiomux_ids, + }, + .probe = bcm6368_mdiomux_probe, + .remove = bcm6368_mdiomux_remove, +}; +module_platform_driver(bcm6368_mdiomux_driver); + +module_author("alvaro fernandez rojas <noltari@gmail.com>"); +module_description("bcm6368 mdiomux bus controller driver"); +module_license("gpl v2");
|
Networking
|
e239756717b5c866958823a1609e2ccf268435be
|
lvaro fern ndez rojas
|
drivers
|
net
|
mdio
|
net: mediatek: add flow offload for mt7623
|
mt7623 uses offload version 2 too
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add flow offload for mt7623
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mediatek']
|
['c']
| 1
| 1
| 0
|
--- diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c + .offload_version = 2,
|
Networking
|
917e2e6c57980e2255c5eb8ddd77ed670ae49752
|
frank wunderlich
|
drivers
|
net
|
ethernet, mediatek
|
net: mhi: add support for non-linear mbim skb processing
|
currently, if skb is non-linear, due to mhi skb chaining, it is linearized in mbim rx handler prior mbim decoding, causing extra allocation and copy that can be as large as the maximum mbim frame size (32k).
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for non-linear mbim skb processing
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mhi']
|
['c']
| 1
| 25
| 26
|
--- diff --git a/drivers/net/mhi/proto_mbim.c b/drivers/net/mhi/proto_mbim.c --- a/drivers/net/mhi/proto_mbim.c +++ b/drivers/net/mhi/proto_mbim.c -static int mbim_rx_verify_ndp16(struct sk_buff *skb, int ndpoffset) +static int mbim_rx_verify_ndp16(struct sk_buff *skb, struct usb_cdc_ncm_ndp16 *ndp16) - struct usb_cdc_ncm_ndp16 *ndp16; - if (ndpoffset + sizeof(struct usb_cdc_ncm_ndp16) > skb->len) { - netif_dbg(dev, rx_err, dev->ndev, "invalid ndp offset <%u> ", - ndpoffset); - return -einval; - } - - ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb->data + ndpoffset); - - if (skb_linearize(skb)) - goto error; - - struct usb_cdc_ncm_ndp16 *ndp16; - struct usb_cdc_ncm_dpe16 *dpe16; - int nframes, n; + struct usb_cdc_ncm_ndp16 ndp16; + struct usb_cdc_ncm_dpe16 dpe16; + int nframes, n, dpeoffset; + + if (skb_copy_bits(skb, ndpoffset, &ndp16, sizeof(ndp16))) { + net_err_ratelimited("%s: incorrect ndp offset (%u) ", + ndev->name, ndpoffset); + __mbim_length_errors_inc(mhi_netdev); + goto error; + } - nframes = mbim_rx_verify_ndp16(skb, ndpoffset); + nframes = mbim_rx_verify_ndp16(skb, &ndp16); - ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb->data + ndpoffset); - if ((ndp16->dwsignature & cpu_to_le32(mbim_ndp16_sign_mask)) + if ((ndp16.dwsignature & cpu_to_le32(mbim_ndp16_sign_mask)) - if (ndp16->dwsignature & ~cpu_to_le32(mbim_ndp16_sign_mask)) { + if (ndp16.dwsignature & ~cpu_to_le32(mbim_ndp16_sign_mask)) { - dpe16 = ndp16->dpe16; - for (n = 0; n < nframes; n++, dpe16++) { - u16 dgram_offset = le16_to_cpu(dpe16->wdatagramindex); - u16 dgram_len = le16_to_cpu(dpe16->wdatagramlength); + dpeoffset = ndpoffset + sizeof(struct usb_cdc_ncm_ndp16); + for (n = 0; n < nframes; n++, dpeoffset += sizeof(dpe16)) { + u16 dgram_offset, dgram_len; + if (skb_copy_bits(skb, dpeoffset, &dpe16, sizeof(dpe16))) + break; + + dgram_offset = le16_to_cpu(dpe16.wdatagramindex); + dgram_len = le16_to_cpu(dpe16.wdatagramlength); + - memcpy(skbn->data, skb->data + dgram_offset, dgram_len); + skb_copy_bits(skb, dgram_offset, skbn->data, dgram_len); - ndpoffset = (int)le16_to_cpu(ndp16->wnextndpindex); + ndpoffset = (int)le16_to_cpu(ndp16.wnextndpindex);
|
Networking
|
d9f0713c9217fdd31077f890c2e15232ad2f0772
|
loic poulain
|
drivers
|
net
|
mhi
|
mlxsw: spectrum_span: add span session identifier support
|
when packets are mirrored to the cpu, the trap identifier with which the packets are trapped is determined according to the session identifier of the span agent performing the mirroring. packets that are trapped for the same logical reason (e.g., buffer drops) should use the same session identifier.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
implement sampling using mirroring
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 3
| 22
| 2
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c - struct mlxsw_sp_span_agent_parms agent_parms = {}; + struct mlxsw_sp_span_agent_parms agent_parms = { + .session_id = mlxsw_sp_span_session_id_buffer, + }; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c + mlxsw_reg_mpat_session_id_set(mpat_pl, sparms.session_id); + mlxsw_reg_mpat_session_id_set(mpat_pl, span_entry->parms.session_id); - curr->parms.policer_id == sparms->policer_id) + curr->parms.policer_id == sparms->policer_id && + curr->parms.session_id == sparms->session_id) + sparms.session_id = parms->session_id; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h +/* span session identifiers that correspond to mlxsw_trap_id_mirror_session<i> + * trap identifiers. the session identifier is an attribute of the span agent, + * which determines the trap identifier of packets that are mirrored to the + * cpu. packets that are trapped to the cpu for the same logical reason (e.g., + * buffer drops) should use the same session identifier. + */ +enum mlxsw_sp_span_session_id { + mlxsw_sp_span_session_id_buffer, + + __mlxsw_sp_span_session_id_max = 8, +}; + + enum mlxsw_sp_span_session_id session_id; + enum mlxsw_sp_span_session_id session_id;
|
Networking
|
5c7659eba873df8929f4bffd352906f625d4cfec
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: reg: extend mirroring registers with probability rate field
|
the mpar and mpagr registers are used to configure the binding between the mirroring trigger (e.g., received packet) and the span agent. add probability rate field, which will allow us to support sampling by mirroring to the cpu.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
implement sampling using mirroring
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 2
| 17
| 2
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +#define mlxsw_reg_mpar_rate_max 3500000000ul + +/* reg_mpar_probability_rate + * sampling rate. + * valid values are: 1 to 3.5*10^9 + * value of 1 means "sample all". default is 1. + * reserved when spectrum-1. + * access: rw + */ +mlxsw_item32(reg, mpar, probability_rate, 0x08, 0, 32); + - bool enable, u8 pa_id) + bool enable, u8 pa_id, + u32 probability_rate) + mlxsw_reg_mpar_probability_rate_set(payload, probability_rate); +#define mlxsw_reg_mpagr_rate_max 3500000000ul + diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c - trigger_entry->parms.span_id); + trigger_entry->parms.span_id, 1);
|
Networking
|
fa3faeb7aedbfbd7e30eb25a25058a2cce1010fb
|
ido schimmel jiri pirko jiri nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_span: add span probability rate support
|
currently, every packet that matches a mirroring trigger (e.g., received packets, buffer dropped packets) is mirrored. spectrum-2 and later asics support mirroring with probability, where every 1 in n matched packets is mirrored.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
implement sampling using mirroring
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 4
| 15
| 3
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c + parms.probability_rate = 1; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c + trigger_parms.probability_rate = 1; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c + if (trigger_entry->parms.probability_rate > mlxsw_reg_mpar_rate_max) + return -einval; + - trigger_entry->parms.span_id, 1); + trigger_entry->parms.span_id, + trigger_entry->parms.probability_rate); + if (trigger_entry->parms.probability_rate > mlxsw_reg_mpagr_rate_max) + return -einval; + - 1); + trigger_entry->parms.probability_rate); - if (trigger_entry->parms.span_id != parms->span_id) + if (trigger_entry->parms.span_id != parms->span_id || + trigger_entry->parms.probability_rate != + parms->probability_rate) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h + u32 probability_rate;
|
Networking
|
2dcbd9207b3380c0efd89b2805dfc4e867470eb9
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_matchall: split sampling support between asics
|
sampling of ingress packets is supported using a dedicated sampling mechanism on all spectrum asics. however, spectrum-2 and later asics support more sophisticated sampling by mirroring packets to the cpu.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
implement sampling using mirroring
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 3
| 43
| 3
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c + mlxsw_sp->mall_ops = &mlxsw_sp1_mall_ops; + mlxsw_sp->mall_ops = &mlxsw_sp2_mall_ops; + mlxsw_sp->mall_ops = &mlxsw_sp2_mall_ops; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h + const struct mlxsw_sp_mall_ops *mall_ops; +struct mlxsw_sp_mall_ops { + int (*sample_add)(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_port *mlxsw_sp_port, u32 rate); + void (*sample_del)(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_port *mlxsw_sp_port); +}; + +extern const struct mlxsw_sp_mall_ops mlxsw_sp1_mall_ops; +extern const struct mlxsw_sp_mall_ops mlxsw_sp2_mall_ops; + diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c + struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; - err = mlxsw_sp_mall_port_sample_set(mlxsw_sp_port, true, - mall_entry->sample.rate); + err = mlxsw_sp->mall_ops->sample_add(mlxsw_sp, mlxsw_sp_port, + mall_entry->sample.rate); + struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; + - mlxsw_sp_mall_port_sample_set(mlxsw_sp_port, false, 1); + mlxsw_sp->mall_ops->sample_del(mlxsw_sp, mlxsw_sp_port); + +static int mlxsw_sp1_mall_sample_add(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_port *mlxsw_sp_port, + u32 rate) +{ + return mlxsw_sp_mall_port_sample_set(mlxsw_sp_port, true, rate); +} + +static void mlxsw_sp1_mall_sample_del(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_port *mlxsw_sp_port) +{ + mlxsw_sp_mall_port_sample_set(mlxsw_sp_port, false, 1); +} + +const struct mlxsw_sp_mall_ops mlxsw_sp1_mall_ops = { + .sample_add = mlxsw_sp1_mall_sample_add, + .sample_del = mlxsw_sp1_mall_sample_del, +}; + +const struct mlxsw_sp_mall_ops mlxsw_sp2_mall_ops = { + .sample_add = mlxsw_sp1_mall_sample_add, + .sample_del = mlxsw_sp1_mall_sample_del, +};
|
Networking
|
20afb9bc480d0bfe3d1abcb934d79b2cdc19acbf
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_trap: split sampling traps between asics
|
sampling of ingress packets is supported using a dedicated sampling mechanism on all spectrum asics. however, spectrum-2 and later asics support more sophisticated sampling by mirroring packets to the cpu.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
implement sampling using mirroring
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 26
| 13
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c - { - .group = devlink_trap_group_generic(acl_sample, 0), - .hw_group_id = mlxsw_reg_htgt_trap_group_sp_pkt_sample, - .priority = 0, - }, - { - .trap = mlxsw_sp_trap_control(flow_action_sample, acl_sample, - mirror), - .listeners_arr = { - mlxsw_rxl(mlxsw_sp_rx_sample_listener, pkt_sample, - mirror_to_cpu, false, sp_pkt_sample, discard), - }, - }, + { + .group = devlink_trap_group_generic(acl_sample, 0), + .hw_group_id = mlxsw_reg_htgt_trap_group_sp_pkt_sample, + .priority = 0, + }, + { + .trap = mlxsw_sp_trap_control(flow_action_sample, acl_sample, + mirror), + .listeners_arr = { + mlxsw_rxl(mlxsw_sp_rx_sample_listener, pkt_sample, + mirror_to_cpu, false, sp_pkt_sample, discard), + }, + }, + { + .group = devlink_trap_group_generic(acl_sample, 0), + .hw_group_id = mlxsw_reg_htgt_trap_group_sp_pkt_sample, + .priority = 0, + }, + { + .trap = mlxsw_sp_trap_control(flow_action_sample, acl_sample, + mirror), + .listeners_arr = { + mlxsw_rxl(mlxsw_sp_rx_sample_listener, pkt_sample, + mirror_to_cpu, false, sp_pkt_sample, discard), + }, + },
|
Networking
|
34a277212c67a395b47b715aa89c4b4e2c957d42
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_matchall: implement sampling using mirroring
|
spectrum-2 and later asics support sampling of packets by mirroring to the cpu with probability. there are several advantages compared to the legacy dedicated sampling mechanism:
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
implement sampling using mirroring
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 4
| 63
| 4
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h + int span_id; /* relevant for spectrum-2 onwards. */ diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +static int mlxsw_sp2_mall_sample_add(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_port *mlxsw_sp_port, + u32 rate) +{ + struct mlxsw_sp_span_trigger_parms trigger_parms = {}; + struct mlxsw_sp_span_agent_parms agent_parms = { + .to_dev = null, /* mirror to cpu. */ + .session_id = mlxsw_sp_span_session_id_sampling, + }; + struct mlxsw_sp_port_sample *sample; + int err; + + sample = rtnl_dereference(mlxsw_sp_port->sample); + + err = mlxsw_sp_span_agent_get(mlxsw_sp, &sample->span_id, &agent_parms); + if (err) + return err; + + err = mlxsw_sp_span_analyzed_port_get(mlxsw_sp_port, true); + if (err) + goto err_analyzed_port_get; + + trigger_parms.span_id = sample->span_id; + trigger_parms.probability_rate = rate; + err = mlxsw_sp_span_agent_bind(mlxsw_sp, mlxsw_sp_span_trigger_ingress, + mlxsw_sp_port, &trigger_parms); + if (err) + goto err_agent_bind; + + return 0; + +err_agent_bind: + mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, true); +err_analyzed_port_get: + mlxsw_sp_span_agent_put(mlxsw_sp, sample->span_id); + return err; +} + +static void mlxsw_sp2_mall_sample_del(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_port *mlxsw_sp_port) +{ + struct mlxsw_sp_span_trigger_parms trigger_parms = {}; + struct mlxsw_sp_port_sample *sample; + + sample = rtnl_dereference(mlxsw_sp_port->sample); + + trigger_parms.span_id = sample->span_id; + mlxsw_sp_span_agent_unbind(mlxsw_sp, mlxsw_sp_span_trigger_ingress, + mlxsw_sp_port, &trigger_parms); + mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, true); + mlxsw_sp_span_agent_put(mlxsw_sp, sample->span_id); +} + - .sample_add = mlxsw_sp1_mall_sample_add, - .sample_del = mlxsw_sp1_mall_sample_del, + .sample_add = mlxsw_sp2_mall_sample_add, + .sample_del = mlxsw_sp2_mall_sample_del, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h + mlxsw_sp_span_session_id_sampling, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c + /* packet was mirrored from ingress. */ + mlxsw_sp_mirror_reason_ingress = 1, + .fixed_policer = true, - mlxsw_rxl(mlxsw_sp_rx_sample_listener, pkt_sample, - mirror_to_cpu, false, sp_pkt_sample, discard), + mlxsw_rxl_mirror(mlxsw_sp_rx_sample_listener, 1, + sp_pkt_sample, + mlxsw_sp_mirror_reason_ingress),
|
Networking
|
cf31190ae0b788159a9874f0b28bbfde994741cd
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: remove rtnl assertion
|
remove the rtnl assertion in the nexthop notifier block. the assertion is not needed given rtnl is never assumed to be taken.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 0
| 2
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c - assert_rtnl(); -
|
Networking
|
08c99b92d76c5bb0208cf89cafd502bdb3b2c98c
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: consolidate nexthop helpers
|
the helper mlxsw_sp_nexthop_offload() is actually interested in finding out if the nexthop is both written to the adjacency table and forwarding packets (as opposed to discarding them).
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 3
| 9
| 18
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c - if (mlxsw_sp_nexthop_offload(nh) && - !mlxsw_sp_nexthop_group_has_ipip(nh) && - !mlxsw_sp_nexthop_is_discard(nh)) + if (mlxsw_sp_nexthop_is_forward(nh) && + !mlxsw_sp_nexthop_group_has_ipip(nh)) - if (!mlxsw_sp_nexthop_offload(nh) || - mlxsw_sp_nexthop_group_has_ipip(nh) || - mlxsw_sp_nexthop_is_discard(nh)) + if (!mlxsw_sp_nexthop_is_forward(nh) || + mlxsw_sp_nexthop_group_has_ipip(nh)) - if (!mlxsw_sp_nexthop_offload(nh) || - mlxsw_sp_nexthop_group_has_ipip(nh) || - mlxsw_sp_nexthop_is_discard(nh)) + if (!mlxsw_sp_nexthop_is_forward(nh) || + mlxsw_sp_nexthop_group_has_ipip(nh)) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c -bool mlxsw_sp_nexthop_offload(struct mlxsw_sp_nexthop *nh) +bool mlxsw_sp_nexthop_is_forward(const struct mlxsw_sp_nexthop *nh) - return nh->offloaded; + return nh->offloaded && !nh->discard; -bool mlxsw_sp_nexthop_is_discard(const struct mlxsw_sp_nexthop *nh) -{ - return nh->discard; -} - diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h -bool mlxsw_sp_nexthop_offload(struct mlxsw_sp_nexthop *nh); +bool mlxsw_sp_nexthop_is_forward(const struct mlxsw_sp_nexthop *nh); -bool mlxsw_sp_nexthop_is_discard(const struct mlxsw_sp_nexthop *nh);
|
Networking
|
26df5acc275b8b5fb14de1301feed6697f2433cf
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: only provide mac address for valid nexthops
|
the helper returns the mac address associated with the nexthop. it is only valid when the nexthop forwards packets and when it is an ethernet nexthop. reflect this in the checks the helper is performing.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 2
| 1
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c - if (!nh->offloaded) + if (nh->type != mlxsw_sp_nexthop_type_eth || + !mlxsw_sp_nexthop_is_forward(nh))
|
Networking
|
c6a5011bec0962cfddcce48065e29c65e9a6ec18
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: adjust comments on nexthop fields
|
the comments assume that nexthops are simple ethernet nexthops that are programmed to forward packets to the associated neighbour. this is no longer the case, as both ipinip and blackhole nexthops are now supported.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 6
| 6
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c - u8 should_offload:1, /* set indicates this neigh is connected and - * should be put to kvd linear area of this group. + u8 should_offload:1, /* set indicates this nexthop should be written + * to the adjacency table. - offloaded:1, /* set in case the neigh is actually put into - * kvd linear area of this group. + offloaded:1, /* set indicates this nexthop was written to the + * adjacency table. - update:1, /* set indicates that mac of this neigh should be - * updated in hw + update:1, /* set indicates this nexthop should be updated in the + * adjacency table (f.e., its mac changed).
|
Networking
|
248136fa251abfbd862194175977afd57ab5e760
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: introduce nexthop action field
|
currently, the action associated with the nexthop is assumed to be 'forward' unless the 'discard' bit is set.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 17
| 8
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +enum mlxsw_sp_nexthop_action { + /* nexthop forwards packets to an egress rif */ + mlxsw_sp_nexthop_action_forward, + /* nexthop discards packets */ + mlxsw_sp_nexthop_action_discard, +}; + - update:1, /* set indicates this nexthop should be updated in the + update:1; /* set indicates this nexthop should be updated in the - discard:1; /* nexthop is programmed to discard packets */ + enum mlxsw_sp_nexthop_action action; - return nh->offloaded && !nh->discard; + return nh->offloaded && nh->action == mlxsw_sp_nexthop_action_forward; - if (nh->discard) + if (nh->action == mlxsw_sp_nexthop_action_discard) - if (!removing) + if (!removing) { + nh->action = mlxsw_sp_nexthop_action_forward; - else + } else { + } - nh->discard = 1; + nh->action = mlxsw_sp_nexthop_action_discard; - if (nh->discard) + if (nh->action == mlxsw_sp_nexthop_action_discard)
|
Networking
|
031d5c16065606efc387aa6865690037c13cefc4
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: prepare for nexthops with trap action
|
nexthops that need to be programmed with a trap action might not have a valid router interface (rif) associated with them. therefore, use the loopback rif created during initialization to program them to the device.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 4
| 1
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c + u16 rif_index; + rif_index = nh->rif ? nh->rif->rif_index : + mlxsw_sp->router->lb_rif_index; - adj_index, nh->rif->rif_index); + adj_index, rif_index);
|
Networking
|
1be2361e3ca715cd9315c3c4ebede8cdcfcbf7d5
|
ido schimmel petr machata petrm nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: add nexthop trap action support
|
currently, nexthops are programmed with either forward or discard action (for blackhole nexthops). nexthops that do not have a valid mac address (neighbour) or router interface (rif) are simply not written to the adjacency table.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 29
| 13
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c + /* nexthop traps packets */ + mlxsw_sp_nexthop_action_trap, - if (nh->action == mlxsw_sp_nexthop_action_discard) + switch (nh->action) { + case mlxsw_sp_nexthop_action_forward: + mlxsw_reg_ratr_eth_entry_pack(ratr_pl, neigh_entry->ha); + break; + case mlxsw_sp_nexthop_action_discard: - else - mlxsw_reg_ratr_eth_entry_pack(ratr_pl, neigh_entry->ha); + break; + case mlxsw_sp_nexthop_action_trap: + mlxsw_reg_ratr_trap_action_set(ratr_pl, + mlxsw_reg_ratr_trap_action_trap); + mlxsw_reg_ratr_trap_id_set(ratr_pl, mlxsw_trap_id_rtr_egress0); + break; + default: + warn_on_once(1); + return -einval; + } - switch (nh->type) { - case mlxsw_sp_nexthop_type_eth: - err = mlxsw_sp_nexthop_update - (mlxsw_sp, adj_index, nh); - break; - case mlxsw_sp_nexthop_type_ipip: - err = mlxsw_sp_nexthop_ipip_update - (mlxsw_sp, adj_index, nh); - break; - } + /* when action is discard or trap, the nexthop must be + * programmed as an ethernet nexthop. + */ + if (nh->type == mlxsw_sp_nexthop_type_eth || + nh->action == mlxsw_sp_nexthop_action_discard || + nh->action == mlxsw_sp_nexthop_action_trap) + err = mlxsw_sp_nexthop_update(mlxsw_sp, + adj_index, nh); + else + err = mlxsw_sp_nexthop_ipip_update(mlxsw_sp, + adj_index, + nh);
|
Networking
|
fc199d7c08c837095083e4c77678d9de1546945c
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: rename nexthop update function to reflect its type
|
mlxsw_sp_nexthop_update() is used to update the configuration of ethernet-type nexthops, as opposed to mlxsw_sp_nexthop_ipip_update(), which is used to update ipinip-type nexthops.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 3
| 14
| 11
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c - mlxsw_sp_nexthop_update(mlxsw_sp, - adj_index + adj_hash_index, nh); + mlxsw_sp_nexthop_eth_update(mlxsw_sp, + adj_index + adj_hash_index, nh); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c -static int __mlxsw_sp_nexthop_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index, - struct mlxsw_sp_nexthop *nh) +static int __mlxsw_sp_nexthop_eth_update(struct mlxsw_sp *mlxsw_sp, + u32 adj_index, + struct mlxsw_sp_nexthop *nh) -int mlxsw_sp_nexthop_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index, - struct mlxsw_sp_nexthop *nh) +int mlxsw_sp_nexthop_eth_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index, + struct mlxsw_sp_nexthop *nh) - err = __mlxsw_sp_nexthop_update(mlxsw_sp, adj_index + i, nh); + err = __mlxsw_sp_nexthop_eth_update(mlxsw_sp, adj_index + i, + nh); - err = mlxsw_sp_nexthop_update(mlxsw_sp, - adj_index, nh); + err = mlxsw_sp_nexthop_eth_update(mlxsw_sp, + adj_index, + nh); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h -int mlxsw_sp_nexthop_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index, - struct mlxsw_sp_nexthop *nh); +int mlxsw_sp_nexthop_eth_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index, + struct mlxsw_sp_nexthop *nh);
|
Networking
|
424603ccdd5eb00725f9080d7e8c018039816d17
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: encapsulate nexthop update in a function
|
encapsulate this functionality in a separate function, so that it could be invoked by follow-up patches, when replacing a nexthop bucket that is part of a resilient nexthop group.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 15
| 13
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +static int mlxsw_sp_nexthop_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index, + struct mlxsw_sp_nexthop *nh) +{ + /* when action is discard or trap, the nexthop must be + * programmed as an ethernet nexthop. + */ + if (nh->type == mlxsw_sp_nexthop_type_eth || + nh->action == mlxsw_sp_nexthop_action_discard || + nh->action == mlxsw_sp_nexthop_action_trap) + return mlxsw_sp_nexthop_eth_update(mlxsw_sp, adj_index, nh); + else + return mlxsw_sp_nexthop_ipip_update(mlxsw_sp, adj_index, nh); +} + - /* when action is discard or trap, the nexthop must be - * programmed as an ethernet nexthop. - */ - if (nh->type == mlxsw_sp_nexthop_type_eth || - nh->action == mlxsw_sp_nexthop_action_discard || - nh->action == mlxsw_sp_nexthop_action_trap) - err = mlxsw_sp_nexthop_eth_update(mlxsw_sp, - adj_index, - nh); - else - err = mlxsw_sp_nexthop_ipip_update(mlxsw_sp, - adj_index, - nh); + err = mlxsw_sp_nexthop_update(mlxsw_sp, adj_index, nh);
|
Networking
|
29017c643476daf57495c2ccd1a5fdc8dc5186ea
|
ido schimmel petr machata petrm nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: break nexthop group entry validation to a separate function
|
the validation of a nexthop group entry is also necessary for resilient nexthop groups, so break the validation to a separate function to allow for code reuse in subsequent patches.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 25
| 11
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +static int +mlxsw_sp_nexthop_obj_group_entry_validate(struct mlxsw_sp *mlxsw_sp, + const struct nh_notifier_single_info *nh, + struct netlink_ext_ack *extack) +{ + int err; + + err = mlxsw_sp_nexthop_obj_single_validate(mlxsw_sp, nh, extack); + if (err) + return err; + + /* device only nexthops with an ipip device are programmed as + * encapsulating adjacency entries. + */ + if (!nh->gw_family && !nh->is_reject && + !mlxsw_sp_netdev_ipip_type(mlxsw_sp, nh->dev, null)) { + nl_set_err_msg_mod(extack, "nexthop group entry does not have a gateway"); + return -einval; + } + + return 0; +} + - err = mlxsw_sp_nexthop_obj_single_validate(mlxsw_sp, nh, - extack); + err = mlxsw_sp_nexthop_obj_group_entry_validate(mlxsw_sp, nh, + extack); - - /* device only nexthops with an ipip device are programmed as - * encapsulating adjacency entries. - */ - if (!nh->gw_family && !nh->is_reject && - !mlxsw_sp_netdev_ipip_type(mlxsw_sp, nh->dev, null)) { - nl_set_err_msg_mod(extack, "nexthop group entry does not have a gateway"); - return -einval; - }
|
Networking
|
40f5429fce693bfb79dd9ec78d60576f17f13c76
|
ido schimmel petr machata petrm nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: avoid unnecessary neighbour updates
|
avoid updating neighbour and adjacency entries in hardware when the neighbour is already connected and its mac address did not change. this can happen, for example, when neighbour transitions between valid states such as 'nud_reachable' and 'nud_delay'.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 4
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c + if (neigh_entry->connected && entry_connected && + !memcmp(neigh_entry->ha, ha, eth_alen)) + goto out; +
|
Networking
|
c1efd50002c00cbe51014ddf357d55162cd7d6d8
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: create per-asic router operations
|
there are several differences in the router module between spectrum-1 and spectrum-{2,3}. currently, this is only apparent in the router interface (rif) operations that are split between these asics.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 3
| 41
| 10
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c - mlxsw_sp->rif_ops_arr = mlxsw_sp1_rif_ops_arr; + mlxsw_sp->router_ops = &mlxsw_sp1_router_ops; - mlxsw_sp->rif_ops_arr = mlxsw_sp2_rif_ops_arr; + mlxsw_sp->router_ops = &mlxsw_sp2_router_ops; - mlxsw_sp->rif_ops_arr = mlxsw_sp2_rif_ops_arr; + mlxsw_sp->router_ops = &mlxsw_sp2_router_ops; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h -struct mlxsw_sp_rif_ops; +struct mlxsw_sp_router_ops; -extern const struct mlxsw_sp_rif_ops *mlxsw_sp1_rif_ops_arr[]; -extern const struct mlxsw_sp_rif_ops *mlxsw_sp2_rif_ops_arr[]; +extern const struct mlxsw_sp_router_ops mlxsw_sp1_router_ops; +extern const struct mlxsw_sp_router_ops mlxsw_sp2_router_ops; - const struct mlxsw_sp_rif_ops **rif_ops_arr; + const struct mlxsw_sp_router_ops *router_ops; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +struct mlxsw_sp_router_ops { + int (*init)(struct mlxsw_sp *mlxsw_sp); +}; + - ops = mlxsw_sp->rif_ops_arr[type]; + ops = mlxsw_sp->router->rif_ops_arr[type]; -const struct mlxsw_sp_rif_ops *mlxsw_sp1_rif_ops_arr[] = { +static const struct mlxsw_sp_rif_ops *mlxsw_sp1_rif_ops_arr[] = { -const struct mlxsw_sp_rif_ops *mlxsw_sp2_rif_ops_arr[] = { +static const struct mlxsw_sp_rif_ops *mlxsw_sp2_rif_ops_arr[] = { +static int mlxsw_sp1_router_init(struct mlxsw_sp *mlxsw_sp) +{ + mlxsw_sp->router->rif_ops_arr = mlxsw_sp1_rif_ops_arr; + + return 0; +} + +const struct mlxsw_sp_router_ops mlxsw_sp1_router_ops = { + .init = mlxsw_sp1_router_init, +}; + +static int mlxsw_sp2_router_init(struct mlxsw_sp *mlxsw_sp) +{ + mlxsw_sp->router->rif_ops_arr = mlxsw_sp2_rif_ops_arr; + + return 0; +} + +const struct mlxsw_sp_router_ops mlxsw_sp2_router_ops = { + .init = mlxsw_sp2_router_init, +}; + + err = mlxsw_sp->router_ops->init(mlxsw_sp); + if (err) + goto err_router_ops_init; + +err_router_ops_init:
|
Networking
|
d354fdd923e7a3dc2f5c34cfcfb0401bd8c56ea8
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: encode adjacency group size ranges in an array
|
the device supports a fixed set of adjacency group sizes. encode these sizes in an array, so that the next patch will be able to split it between spectrum-1 and spectrum-{2,3}, which support different size ranges.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 44
| 21
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +struct mlxsw_sp_adj_grp_size_range { + u16 start; /* inclusive */ + u16 end; /* inclusive */ +}; + +/* ordered by range start value */ +static const struct mlxsw_sp_adj_grp_size_range +mlxsw_sp_adj_grp_size_ranges[] = { + { .start = 1, .end = 64 }, + { .start = 512, .end = 512 }, + { .start = 1024, .end = 1024 }, + { .start = 2048, .end = 2048 }, + { .start = 4096, .end = 4096 }, +}; + - /* valid sizes for an adjacency group are: - * 1-64, 512, 1024, 2048 and 4096. - */ - if (*p_adj_grp_size <= 64) - return; - else if (*p_adj_grp_size <= 512) - *p_adj_grp_size = 512; - else if (*p_adj_grp_size <= 1024) - *p_adj_grp_size = 1024; - else if (*p_adj_grp_size <= 2048) - *p_adj_grp_size = 2048; - else - *p_adj_grp_size = 4096; + int i; + + for (i = 0; i < array_size(mlxsw_sp_adj_grp_size_ranges); i++) { + const struct mlxsw_sp_adj_grp_size_range *size_range; + + size_range = &mlxsw_sp_adj_grp_size_ranges[i]; + + if (*p_adj_grp_size >= size_range->start && + *p_adj_grp_size <= size_range->end) + return; + + if (*p_adj_grp_size <= size_range->end) { + *p_adj_grp_size = size_range->end; + return; + } + } - if (alloc_size >= 4096) - *p_adj_grp_size = 4096; - else if (alloc_size >= 2048) - *p_adj_grp_size = 2048; - else if (alloc_size >= 1024) - *p_adj_grp_size = 1024; - else if (alloc_size >= 512) - *p_adj_grp_size = 512; + size_t arr_size = array_size(mlxsw_sp_adj_grp_size_ranges); + int i; + + for (i = arr_size - 1; i >= 0; i--) { + const struct mlxsw_sp_adj_grp_size_range *size_range; + + size_range = &mlxsw_sp_adj_grp_size_ranges[i]; + + if (alloc_size >= size_range->end) { + *p_adj_grp_size = size_range->end; + return; + } + }
|
Networking
|
164fa130dd1671797c4249195bc7f5447a34a9c2
|
ido schimmel petr machata petrm nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: add spectrum-{2, 3} adjacency group size ranges
|
spectrum-{2,3} support different adjacency group size ranges compared to spectrum-1. add an array describing these ranges and change the common code to use the array which was set during the per-asic initialization.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
preparations for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 2
| 32
| 10
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c -mlxsw_sp_adj_grp_size_ranges[] = { +mlxsw_sp1_adj_grp_size_ranges[] = { -static void mlxsw_sp_adj_grp_size_round_up(u16 *p_adj_grp_size) +/* ordered by range start value */ +static const struct mlxsw_sp_adj_grp_size_range +mlxsw_sp2_adj_grp_size_ranges[] = { + { .start = 1, .end = 128 }, + { .start = 256, .end = 256 }, + { .start = 512, .end = 512 }, + { .start = 1024, .end = 1024 }, + { .start = 2048, .end = 2048 }, + { .start = 4096, .end = 4096 }, +}; + +static void mlxsw_sp_adj_grp_size_round_up(const struct mlxsw_sp *mlxsw_sp, + u16 *p_adj_grp_size) - for (i = 0; i < array_size(mlxsw_sp_adj_grp_size_ranges); i++) { + for (i = 0; i < mlxsw_sp->router->adj_grp_size_ranges_count; i++) { - size_range = &mlxsw_sp_adj_grp_size_ranges[i]; + size_range = &mlxsw_sp->router->adj_grp_size_ranges[i]; -static void mlxsw_sp_adj_grp_size_round_down(u16 *p_adj_grp_size, +static void mlxsw_sp_adj_grp_size_round_down(const struct mlxsw_sp *mlxsw_sp, + u16 *p_adj_grp_size, - size_t arr_size = array_size(mlxsw_sp_adj_grp_size_ranges); - for (i = arr_size - 1; i >= 0; i--) { + for (i = mlxsw_sp->router->adj_grp_size_ranges_count - 1; i >= 0; i--) { - size_range = &mlxsw_sp_adj_grp_size_ranges[i]; + size_range = &mlxsw_sp->router->adj_grp_size_ranges[i]; - mlxsw_sp_adj_grp_size_round_up(p_adj_grp_size); + mlxsw_sp_adj_grp_size_round_up(mlxsw_sp, p_adj_grp_size); - mlxsw_sp_adj_grp_size_round_down(p_adj_grp_size, alloc_size); + mlxsw_sp_adj_grp_size_round_down(mlxsw_sp, p_adj_grp_size, alloc_size); + size_t size_ranges_count = array_size(mlxsw_sp1_adj_grp_size_ranges); + + mlxsw_sp->router->adj_grp_size_ranges = mlxsw_sp1_adj_grp_size_ranges; + mlxsw_sp->router->adj_grp_size_ranges_count = size_ranges_count; + size_t size_ranges_count = array_size(mlxsw_sp2_adj_grp_size_ranges); + + mlxsw_sp->router->adj_grp_size_ranges = mlxsw_sp2_adj_grp_size_ranges; + mlxsw_sp->router->adj_grp_size_ranges_count = size_ranges_count; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h + const struct mlxsw_sp_adj_grp_size_range *adj_grp_size_ranges; + size_t adj_grp_size_ranges_count;
|
Networking
|
ea037b236a05822fba43b98ca68e91859e03bb64
|
ido schimmel petr machata petrm nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: add support for resilient nexthop groups
|
parse the configuration of resilient nexthop groups to existing mlxsw data structures. unlike non-resilient groups, nexthops without a valid mac or router interface (rif) are programmed with a trap action instead of not being programmed at all.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 25
| 1
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c - gateway:1; /* routes using the group use a gateway */ + gateway:1, /* routes using the group use a gateway */ + is_resilient:1; + } else if (nh->nhgi->is_resilient) { + nh->action = mlxsw_sp_nexthop_action_trap; + nh->should_offload = 1; + /* in a resilient nexthop group, all the nexthops must be written to + * the adjacency table. even if they do not have a valid neighbour or + * rif. + */ + if (nh_grp->nhgi->is_resilient && !nh->should_offload) { + nh->action = mlxsw_sp_nexthop_action_trap; + nh->should_offload = 1; + } + + nh->should_offload = 0; + bool is_resilient = false; + case nh_notifier_info_type_res_table: + nhs = info->nh_res_table->num_nh_buckets; + is_resilient = true; + break; + nhgi->is_resilient = is_resilient; + case nh_notifier_info_type_res_table: + nh_obj = &info->nh_res_table->nhs[i]; + weight = 1; + break;
|
Networking
|
c6fc65f48072c9c6144ea2d145c011317bd03441
|
ido schimmel petr machata petrm nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: add ability to overwrite adjacency entry only when inactive
|
allow the driver to instruct the device to only overwrite an adjacency entry if its activity is cleared. currently, adjacency entry is always overwritten, regardless of activity.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 5
| 32
| 19
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c - adj_index + adj_hash_index, nh); + adj_index + adj_hash_index, nh, + true); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c - struct mlxsw_sp_ipip_entry *ipip_entry) + struct mlxsw_sp_ipip_entry *ipip_entry, + bool force) + enum mlxsw_reg_ratr_op op; - mlxsw_reg_ratr_pack(ratr_pl, mlxsw_reg_ratr_op_write_write_entry, - true, mlxsw_reg_ratr_type_ipip, + op = force ? mlxsw_reg_ratr_op_write_write_entry : + mlxsw_reg_ratr_op_write_write_entry_on_activity; + mlxsw_reg_ratr_pack(ratr_pl, op, true, mlxsw_reg_ratr_type_ipip, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h - struct mlxsw_sp_ipip_entry *ipip_entry); + struct mlxsw_sp_ipip_entry *ipip_entry, + bool force); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c - struct mlxsw_sp_nexthop *nh) + struct mlxsw_sp_nexthop *nh, + bool force) + enum mlxsw_reg_ratr_op op; - mlxsw_reg_ratr_pack(ratr_pl, mlxsw_reg_ratr_op_write_write_entry, - true, mlxsw_reg_ratr_type_ethernet, + op = force ? mlxsw_reg_ratr_op_write_write_entry : + mlxsw_reg_ratr_op_write_write_entry_on_activity; + mlxsw_reg_ratr_pack(ratr_pl, op, true, mlxsw_reg_ratr_type_ethernet, - struct mlxsw_sp_nexthop *nh) + struct mlxsw_sp_nexthop *nh, bool force) - nh); + nh, force); - struct mlxsw_sp_nexthop *nh) + struct mlxsw_sp_nexthop *nh, + bool force) - return ipip_ops->nexthop_update(mlxsw_sp, adj_index, nh->ipip_entry); + return ipip_ops->nexthop_update(mlxsw_sp, adj_index, nh->ipip_entry, + force); - struct mlxsw_sp_nexthop *nh) + struct mlxsw_sp_nexthop *nh, bool force) - nh); + nh, force); - struct mlxsw_sp_nexthop *nh) + struct mlxsw_sp_nexthop *nh, bool force) - return mlxsw_sp_nexthop_eth_update(mlxsw_sp, adj_index, nh); + return mlxsw_sp_nexthop_eth_update(mlxsw_sp, adj_index, nh, + force); - return mlxsw_sp_nexthop_ipip_update(mlxsw_sp, adj_index, nh); + return mlxsw_sp_nexthop_ipip_update(mlxsw_sp, adj_index, nh, + force); - err = mlxsw_sp_nexthop_update(mlxsw_sp, adj_index, nh); + err = mlxsw_sp_nexthop_update(mlxsw_sp, adj_index, nh, + true); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h - struct mlxsw_sp_nexthop *nh); + struct mlxsw_sp_nexthop *nh, bool force);
|
Networking
|
62b67ff33bee9e1adf408ed3c708fdf3c69b15be
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: pass payload pointer to nexthop update function
|
have the caller pass a pointer to the payload of the ratr register to the function updating a single nexthop / adjacency entry.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 5
| 21
| 17
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c + char ratr_pl[mlxsw_reg_ratr_len]; - true); + true, ratr_pl); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c - bool force) + bool force, char *ratr_pl) - char ratr_pl[mlxsw_reg_ratr_len]; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h - bool force); + bool force, char *ratr_pl); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c - bool force) + bool force, char *ratr_pl) - char ratr_pl[mlxsw_reg_ratr_len]; - struct mlxsw_sp_nexthop *nh, bool force) + struct mlxsw_sp_nexthop *nh, bool force, + char *ratr_pl) - nh, force); + nh, force, ratr_pl); - bool force) + bool force, char *ratr_pl) - force); + force, ratr_pl); - struct mlxsw_sp_nexthop *nh, bool force) + struct mlxsw_sp_nexthop *nh, bool force, + char *ratr_pl) - nh, force); + nh, force, ratr_pl); - struct mlxsw_sp_nexthop *nh, bool force) + struct mlxsw_sp_nexthop *nh, bool force, + char *ratr_pl) - force); + force, ratr_pl); - force); + force, ratr_pl); + char ratr_pl[mlxsw_reg_ratr_len]; - true); + true, ratr_pl); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h - struct mlxsw_sp_nexthop *nh, bool force); + struct mlxsw_sp_nexthop *nh, bool force, + char *ratr_pl);
|
Networking
|
197fdfd107e30a59e96691273b0b175cbf2471b8
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: add nexthop bucket replacement support
|
replace a single nexthop bucket upon receiving a 'nexthop_event_bucket_replace' notification.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 134
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +#define mlxsw_sp_nh_grp_activity_update_interval 1000 /* ms */ + +static int mlxsw_sp_nexthop_obj_bucket_query(struct mlxsw_sp *mlxsw_sp, + u32 adj_index, char *ratr_pl) +{ + mlxsw_reg_zero(ratr, ratr_pl); + mlxsw_reg_ratr_op_set(ratr_pl, mlxsw_reg_ratr_op_query_read); + mlxsw_reg_ratr_adjacency_index_low_set(ratr_pl, adj_index); + mlxsw_reg_ratr_adjacency_index_high_set(ratr_pl, adj_index >> 16); + + return mlxsw_reg_query(mlxsw_sp->core, mlxsw_reg(ratr), ratr_pl); +} + +static int mlxsw_sp_nexthop_obj_bucket_compare(char *ratr_pl, char *ratr_pl_new) +{ + /* clear the opcode and activity on both the old and new payload as + * they are irrelevant for the comparison. + */ + mlxsw_reg_ratr_op_set(ratr_pl, mlxsw_reg_ratr_op_query_read); + mlxsw_reg_ratr_a_set(ratr_pl, 0); + mlxsw_reg_ratr_op_set(ratr_pl_new, mlxsw_reg_ratr_op_query_read); + mlxsw_reg_ratr_a_set(ratr_pl_new, 0); + + /* if the contents of the adjacency entry are consistent with the + * replacement request, then replacement was successful. + */ + if (!memcmp(ratr_pl, ratr_pl_new, mlxsw_reg_ratr_len)) + return 0; + + return -einval; +} + +static int +mlxsw_sp_nexthop_obj_bucket_adj_update(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_nexthop *nh, + struct nh_notifier_info *info) +{ + u16 bucket_index = info->nh_res_bucket->bucket_index; + struct netlink_ext_ack *extack = info->extack; + bool force = info->nh_res_bucket->force; + char ratr_pl_new[mlxsw_reg_ratr_len]; + char ratr_pl[mlxsw_reg_ratr_len]; + u32 adj_index; + int err; + + /* no point in trying an atomic replacement if the idle timer interval + * is smaller than the interval in which we query and clear activity. + */ + force = info->nh_res_bucket->idle_timer_ms < + mlxsw_sp_nh_grp_activity_update_interval; + + adj_index = nh->nhgi->adj_index + bucket_index; + err = mlxsw_sp_nexthop_update(mlxsw_sp, adj_index, nh, force, ratr_pl); + if (err) { + nl_set_err_msg_mod(extack, "failed to overwrite nexthop bucket"); + return err; + } + + if (!force) { + err = mlxsw_sp_nexthop_obj_bucket_query(mlxsw_sp, adj_index, + ratr_pl_new); + if (err) { + nl_set_err_msg_mod(extack, "failed to query nexthop bucket state after replacement. state might be inconsistent"); + return err; + } + + err = mlxsw_sp_nexthop_obj_bucket_compare(ratr_pl, ratr_pl_new); + if (err) { + nl_set_err_msg_mod(extack, "nexthop bucket was not replaced because it was active during replacement"); + return err; + } + } + + nh->update = 0; + nh->offloaded = 1; + + return 0; +} + +static int mlxsw_sp_nexthop_obj_bucket_replace(struct mlxsw_sp *mlxsw_sp, + struct nh_notifier_info *info) +{ + u16 bucket_index = info->nh_res_bucket->bucket_index; + struct netlink_ext_ack *extack = info->extack; + struct mlxsw_sp_nexthop_group_info *nhgi; + struct nh_notifier_single_info *nh_obj; + struct mlxsw_sp_nexthop_group *nh_grp; + struct mlxsw_sp_nexthop *nh; + int err; + + nh_grp = mlxsw_sp_nexthop_obj_group_lookup(mlxsw_sp, info->id); + if (!nh_grp) { + nl_set_err_msg_mod(extack, "nexthop group was not found"); + return -einval; + } + + nhgi = nh_grp->nhgi; + + if (bucket_index >= nhgi->count) { + nl_set_err_msg_mod(extack, "nexthop bucket index out of range"); + return -einval; + } + + nh = &nhgi->nexthops[bucket_index]; + mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh); + + nh_obj = &info->nh_res_bucket->new_nh; + err = mlxsw_sp_nexthop_obj_init(mlxsw_sp, nh_grp, nh, nh_obj, 1); + if (err) { + nl_set_err_msg_mod(extack, "failed to initialize nexthop object for nexthop bucket replacement"); + goto err_nexthop_obj_init; + } + + err = mlxsw_sp_nexthop_obj_bucket_adj_update(mlxsw_sp, nh, info); + if (err) + goto err_nexthop_obj_bucket_adj_update; + + return 0; + +err_nexthop_obj_bucket_adj_update: + mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh); +err_nexthop_obj_init: + nh_obj = &info->nh_res_bucket->old_nh; + mlxsw_sp_nexthop_obj_init(mlxsw_sp, nh_grp, nh, nh_obj, 1); + /* the old adjacency entry was not overwritten */ + nh->update = 0; + nh->offloaded = 1; + return err; +} + + case nexthop_event_bucket_replace: + err = mlxsw_sp_nexthop_obj_bucket_replace(router->mlxsw_sp, + info); + break;
|
Networking
|
617a77f044ed7a92bb0c01c939d816f870947d5a
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: update hardware flags on nexthop buckets
|
so far, mlxsw only updated hardware flags ('offload' / 'trap') on nexthop objects. for resilient nexthop groups, these flags need to be updated on individual nexthop buckets as well.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 37
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +static void +mlxsw_sp_nexthop_bucket_offload_refresh(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_nexthop *nh, + u16 bucket_index) +{ + struct mlxsw_sp_nexthop_group *nh_grp = nh->nhgi->nh_grp; + bool offload = false, trap = false; + + if (nh->offloaded) { + if (nh->action == mlxsw_sp_nexthop_action_trap) + trap = true; + else + offload = true; + } + nexthop_bucket_set_hw_flags(mlxsw_sp_net(mlxsw_sp), nh_grp->obj.id, + bucket_index, offload, trap); +} + + int i; + + + /* update flags of individual nexthop buckets in case of a resilient + * nexthop group. + */ + if (!nh_grp->nhgi->is_resilient) + return; + + for (i = 0; i < nh_grp->nhgi->count; i++) { + struct mlxsw_sp_nexthop *nh = &nh_grp->nhgi->nexthops[i]; + + mlxsw_sp_nexthop_bucket_offload_refresh(mlxsw_sp, nh, i); + } + /* flags of individual nexthop buckets might need to be + * updated. + */ + mlxsw_sp_nexthop_group_offload_refresh(mlxsw_sp, nh_grp); + mlxsw_sp_nexthop_bucket_offload_refresh(mlxsw_sp, nh, bucket_index);
|
Networking
|
d7761cb30374d5fcd45dd91ec015b9e7f7d5a120
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: reg: add router adjacency table activity dump register
|
the ratrad register is used to dump and optionally clear activity bits of router adjacency table entries. will be used by the next patch to query and clear the activity of nexthop buckets in a resilient nexthop group.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h']
| 1
| 55
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +/* ratrad - router adjacency table activity dump register + * ------------------------------------------------------ + * the ratrad register is used to dump and optionally clear activity bits of + * router adjacency table entries. + */ +#define mlxsw_reg_ratrad_id 0x8022 +#define mlxsw_reg_ratrad_len 0x210 + +mlxsw_reg_define(ratrad, mlxsw_reg_ratrad_id, mlxsw_reg_ratrad_len); + +enum { + /* read activity */ + mlxsw_reg_ratrad_op_read_activity, + /* read and clear activity */ + mlxsw_reg_ratrad_op_read_clear_activity, +}; + +/* reg_ratrad_op + * access: operation + */ +mlxsw_item32(reg, ratrad, op, 0x00, 30, 2); + +/* reg_ratrad_ecmp_size + * ecmp_size is the amount of sequential entries from adjacency_index. valid + * ranges: + * spectrum-1: 32-64, 512, 1024, 2048, 4096 + * spectrum-2/3: 32-128, 256, 512, 1024, 2048, 4096 + * access: index + */ +mlxsw_item32(reg, ratrad, ecmp_size, 0x00, 0, 13); + +/* reg_ratrad_adjacency_index + * index into the adjacency table. + * access: index + */ +mlxsw_item32(reg, ratrad, adjacency_index, 0x04, 0, 24); + +/* reg_ratrad_activity_vector + * activity bit per adjacency index. + * bits higher than ecmp_size are reserved. + * access: ro + */ +mlxsw_item_bit_array(reg, ratrad, activity_vector, 0x10, 0x200, 1); + +static inline void mlxsw_reg_ratrad_pack(char *payload, u32 adjacency_index, + u16 ecmp_size) +{ + mlxsw_reg_zero(ratrad, payload); + mlxsw_reg_ratrad_op_set(payload, + mlxsw_reg_ratrad_op_read_clear_activity); + mlxsw_reg_ratrad_ecmp_size_set(payload, ecmp_size); + mlxsw_reg_ratrad_adjacency_index_set(payload, adjacency_index); +} + + mlxsw_reg(ratrad),
|
Networking
|
75d495b02982f5fa7eeb3fec9d9616bb7ab958bd
|
ido schimmel petr machata petrm nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: periodically update activity of nexthop buckets
|
the kernel periodically checks the idle time of nexthop buckets to determine if they are idle and can be re-populated with a new nexthop.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 2
| 102
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c + struct list_head list; /* member in nh_res_grp_list */ +static void +mlxsw_sp_nh_grp_activity_get(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_nexthop_group *nh_grp, + unsigned long *activity) +{ + char *ratrad_pl; + int i, err; + + ratrad_pl = kmalloc(mlxsw_reg_ratrad_len, gfp_kernel); + if (!ratrad_pl) + return; + + mlxsw_reg_ratrad_pack(ratrad_pl, nh_grp->nhgi->adj_index, + nh_grp->nhgi->count); + err = mlxsw_reg_query(mlxsw_sp->core, mlxsw_reg(ratrad), ratrad_pl); + if (err) + goto out; + + for (i = 0; i < nh_grp->nhgi->count; i++) { + if (!mlxsw_reg_ratrad_activity_vector_get(ratrad_pl, i)) + continue; + bitmap_set(activity, i, 1); + } + +out: + kfree(ratrad_pl); +} + +static void +mlxsw_sp_nh_grp_activity_update(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_nexthop_group *nh_grp) +{ + unsigned long *activity; + + activity = bitmap_zalloc(nh_grp->nhgi->count, gfp_kernel); + if (!activity) + return; + + mlxsw_sp_nh_grp_activity_get(mlxsw_sp, nh_grp, activity); + nexthop_res_grp_activity_update(mlxsw_sp_net(mlxsw_sp), nh_grp->obj.id, + nh_grp->nhgi->count, activity); + + bitmap_free(activity); +} + +static void +mlxsw_sp_nh_grp_activity_work_schedule(struct mlxsw_sp *mlxsw_sp) +{ + unsigned int interval = mlxsw_sp_nh_grp_activity_update_interval; + + mlxsw_core_schedule_dw(&mlxsw_sp->router->nh_grp_activity_dw, + msecs_to_jiffies(interval)); +} + +static void mlxsw_sp_nh_grp_activity_work(struct work_struct *work) +{ + struct mlxsw_sp_nexthop_group_info *nhgi; + struct mlxsw_sp_router *router; + bool reschedule = false; + + router = container_of(work, struct mlxsw_sp_router, + nh_grp_activity_dw.work); + + mutex_lock(&router->lock); + + list_for_each_entry(nhgi, &router->nh_res_grp_list, list) { + mlxsw_sp_nh_grp_activity_update(router->mlxsw_sp, nhgi->nh_grp); + reschedule = true; + } + + mutex_unlock(&router->lock); + + if (!reschedule) + return; + mlxsw_sp_nh_grp_activity_work_schedule(router->mlxsw_sp); +} + + /* add resilient nexthop groups to a list so that the activity of their + * nexthop buckets will be periodically queried and cleared. + */ + if (nhgi->is_resilient) { + if (list_empty(&mlxsw_sp->router->nh_res_grp_list)) + mlxsw_sp_nh_grp_activity_work_schedule(mlxsw_sp); + list_add(&nhgi->list, &mlxsw_sp->router->nh_res_grp_list); + } + + struct mlxsw_sp_router *router = mlxsw_sp->router; + if (nhgi->is_resilient) { + list_del(&nhgi->list); + if (list_empty(&mlxsw_sp->router->nh_res_grp_list)) + cancel_delayed_work(&router->nh_grp_activity_dw); + } + + init_list_head(&mlxsw_sp->router->nh_res_grp_list); + init_delayed_work(&mlxsw_sp->router->nh_grp_activity_dw, + mlxsw_sp_nh_grp_activity_work); + + cancel_delayed_work_sync(&mlxsw_sp->router->nh_grp_activity_dw); + cancel_delayed_work_sync(&mlxsw_sp->router->nh_grp_activity_dw); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h + struct delayed_work nh_grp_activity_dw; + struct list_head nh_res_grp_list;
|
Networking
|
debd2b3bf5735ec935f53f01834df6dbec35c8d3
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_router: enable resilient nexthop groups to be programmed
|
now that mlxsw supports resilient nexthop groups, allow them to be programmed after validating that their configuration conforms to the device's limitations (e.g., number of buckets is within predefined range).
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 1
| 85
| 1
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +static int +mlxsw_sp_nexthop_obj_res_group_size_validate(struct mlxsw_sp *mlxsw_sp, + const struct nh_notifier_res_table_info *nh_res_table, + struct netlink_ext_ack *extack) +{ + unsigned int alloc_size; + bool valid_size = false; + int err, i; + + if (nh_res_table->num_nh_buckets < 32) { + nl_set_err_msg_mod(extack, "minimum number of buckets is 32"); + return -einval; + } + + for (i = 0; i < mlxsw_sp->router->adj_grp_size_ranges_count; i++) { + const struct mlxsw_sp_adj_grp_size_range *size_range; + + size_range = &mlxsw_sp->router->adj_grp_size_ranges[i]; + + if (nh_res_table->num_nh_buckets >= size_range->start && + nh_res_table->num_nh_buckets <= size_range->end) { + valid_size = true; + break; + } + } + + if (!valid_size) { + nl_set_err_msg_mod(extack, "invalid number of buckets"); + return -einval; + } + + err = mlxsw_sp_kvdl_alloc_count_query(mlxsw_sp, + mlxsw_sp_kvdl_entry_type_adj, + nh_res_table->num_nh_buckets, + &alloc_size); + if (err || nh_res_table->num_nh_buckets != alloc_size) { + nl_set_err_msg_mod(extack, "number of buckets does not fit allocation size of any kvdl partition"); + return -einval; + } + + return 0; +} + +static int +mlxsw_sp_nexthop_obj_res_group_validate(struct mlxsw_sp *mlxsw_sp, + const struct nh_notifier_res_table_info *nh_res_table, + struct netlink_ext_ack *extack) +{ + int err; + u16 i; + + err = mlxsw_sp_nexthop_obj_res_group_size_validate(mlxsw_sp, + nh_res_table, + extack); + if (err) + return err; + + for (i = 0; i < nh_res_table->num_nh_buckets; i++) { + const struct nh_notifier_single_info *nh; + int err; + + nh = &nh_res_table->nhs[i]; + err = mlxsw_sp_nexthop_obj_group_entry_validate(mlxsw_sp, nh, + extack); + if (err) + return err; + } + + return 0; +} + - if (event != nexthop_event_replace) + struct nh_notifier_single_info *nh; + + if (event != nexthop_event_replace && + event != nexthop_event_res_table_pre_replace && + event != nexthop_event_bucket_replace) + case nh_notifier_info_type_res_table: + return mlxsw_sp_nexthop_obj_res_group_validate(mlxsw_sp, + info->nh_res_table, + info->extack); + case nh_notifier_info_type_res_bucket: + nh = &info->nh_res_bucket->new_nh; + return mlxsw_sp_nexthop_obj_group_entry_validate(mlxsw_sp, nh, + info->extack); + case nh_notifier_info_type_res_table:
|
Networking
|
03490a8239156933366f5595250fe3dc5d0e18aa
|
ido schimmel petr machata petrm nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
selftests: mlxsw: test unresolved neigh trap with resilient nexthop groups
|
the number of nexthop buckets in a resilient nexthop group never changes, so when the gateway address of a nexthop cannot be resolved, the nexthop buckets are programmed to trap packets to the cpu in order to trigger resolution. for example:
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['sh']
| 1
| 31
| 0
|
--- diff --git a/tools/testing/selftests/drivers/net/mlxsw/devlink_trap_l3_exceptions.sh b/tools/testing/selftests/drivers/net/mlxsw/devlink_trap_l3_exceptions.sh --- a/tools/testing/selftests/drivers/net/mlxsw/devlink_trap_l3_exceptions.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/devlink_trap_l3_exceptions.sh +__invalid_nexthop_bucket_test() +{ + local desc=$1; shift + local dip=$1; shift + local via_add=$1; shift + local trap_name="unresolved_neigh" + + ret=0 + + # check that route to nexthop that does not exist triggers + # unresolved_neigh + ip nexthop add id 1 via $via_add dev $rp2 + ip nexthop add id 10 group 1 type resilient buckets 32 + ip route add $dip nhid 10 + + t0_packets=$(devlink_trap_rx_packets_get $trap_name) + ping_do $h1 $dip + t1_packets=$(devlink_trap_rx_packets_get $trap_name) + + if [[ $t0_packets -eq $t1_packets ]]; then + check_err 1 "trap counter did not increase" + fi + + ip route del $dip nhid 10 + ip nexthop del id 10 + ip nexthop del id 1 + log_test "unresolved neigh: nexthop bucket does not exist: $desc" +} + + __invalid_nexthop_bucket_test "ipv4" 198.51.100.1 198.51.100.4 + __invalid_nexthop_bucket_test "ipv6" 2001:db8:2::1 2001:db8:2::4
|
Networking
|
861584724c44e63bfb684090c70ade660dae6c69
|
ido schimmel
|
tools
|
testing
|
drivers, mlxsw, net, selftests
|
selftests: mlxsw: add resilient nexthop groups configuration tests
|
test that unsupported resilient nexthop group configurations are rejected and that offload / trap indication is correctly set on nexthop buckets in a resilient group.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for resilient nexthop groups
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['sh']
| 2
| 87
| 0
|
--- diff --git a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh --- a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh + nexthop_obj_bucket_offload_test + ip nexthop add id 3 via 192.0.2.3 dev $swp1 + ip nexthop add id 10 group 3 type resilient buckets 7 + check_fail $? "managed to configure a too small resilient nexthop group when should not" + + ip nexthop add id 10 group 3 type resilient buckets 129 + check_fail $? "managed to configure a resilient nexthop group with invalid number of buckets when should not" + + ip nexthop add id 10 group 1/2 type resilient buckets 32 + check_fail $? "managed to configure a resilient nexthop group with device-only nexthops when should not" + + ip nexthop add id 10 group 3 type resilient buckets 32 + check_err $? "failed to configure a valid resilient nexthop group" + ip nexthop replace id 3 dev $swp1 + check_fail $? "managed to populate a nexthop bucket with a device-only nexthop when should not" + + ip nexthop del id 10 + ip nexthop del id 3 +nexthop_obj_bucket_offload_test() +{ + # test offload indication of nexthop buckets + ret=0 + + simple_if_init $swp1 192.0.2.1/24 2001:db8:1::1/64 + simple_if_init $swp2 + setup_wait + + ip nexthop add id 1 via 192.0.2.2 dev $swp1 + ip nexthop add id 2 via 2001:db8:1::2 dev $swp1 + ip nexthop add id 10 group 1/2 type resilient buckets 32 idle_timer 0 + ip neigh replace 192.0.2.2 lladdr 00:11:22:33:44:55 nud reachable \ + dev $swp1 + ip neigh replace 192.0.2.3 lladdr 00:11:22:33:44:55 nud reachable \ + dev $swp1 + ip neigh replace 2001:db8:1::2 lladdr 00:11:22:33:44:55 nud reachable \ + dev $swp1 + + busywait "$timeout" wait_for_offload \ + ip nexthop bucket show nhid 1 + check_err $? "ipv4 nexthop buckets not marked as offloaded when should" + busywait "$timeout" wait_for_offload \ + ip nexthop bucket show nhid 2 + check_err $? "ipv6 nexthop buckets not marked as offloaded when should" + + # invalidate nexthop id 1 + ip neigh replace 192.0.2.2 nud failed dev $swp1 + busywait "$timeout" wait_for_trap \ + ip nexthop bucket show nhid 1 + check_err $? "ipv4 nexthop buckets not marked with trap when should" + + # invalidate nexthop id 2 + ip neigh replace 2001:db8:1::2 nud failed dev $swp1 + busywait "$timeout" wait_for_trap \ + ip nexthop bucket show nhid 2 + check_err $? "ipv6 nexthop buckets not marked with trap when should" + + # revalidate nexthop id 1 by changing its configuration + ip nexthop replace id 1 via 192.0.2.3 dev $swp1 + busywait "$timeout" wait_for_offload \ + ip nexthop bucket show nhid 1 + check_err $? "nexthop bucket not marked as offloaded after revalidating nexthop" + + # revalidate nexthop id 2 by changing its neighbour + ip neigh replace 2001:db8:1::2 lladdr 00:11:22:33:44:55 nud reachable \ + dev $swp1 + busywait "$timeout" wait_for_offload \ + ip nexthop bucket show nhid 2 + check_err $? "nexthop bucket not marked as offloaded after revalidating neighbour" + + log_test "nexthop bucket offload indication" + + ip neigh del 2001:db8:1::2 dev $swp1 + ip neigh del 192.0.2.3 dev $swp1 + ip neigh del 192.0.2.2 dev $swp1 + ip nexthop del id 10 + ip nexthop del id 2 + ip nexthop del id 1 + + simple_if_fini $swp2 + simple_if_fini $swp1 192.0.2.1/24 2001:db8:1::1/64 +} + diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh +wait_for_trap() +{ + "$@" | grep -q trap +} +
|
Networking
|
ffd3e9b07b9ee3242fa5f5bc76385b6a0e69437d
|
ido schimmel petr machata petrm nvidia com
|
tools
|
testing
|
drivers, forwarding, mlxsw, net, selftests
|
mlxsw: spectrum_matchall: propagate extack further
|
due to the differences between spectrum-1 and later asics, some of the checks currently performed at the common code (where extack is available) will need to be pushed to the per-asic operations.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 3
| 43
| 22
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h - struct mlxsw_sp_port *mlxsw_sp_port, u32 rate); + struct mlxsw_sp_port *mlxsw_sp_port, u32 rate, + struct netlink_ext_ack *extack); - struct mlxsw_sp_port *mlxsw_sp_port); + struct mlxsw_sp_port *mlxsw_sp_port, + struct netlink_ext_ack *extack); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c - err = mlxsw_sp_mall_port_bind(block, mlxsw_sp_port); + err = mlxsw_sp_mall_port_bind(block, mlxsw_sp_port, extack); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c - struct mlxsw_sp_mall_entry *mall_entry) + struct mlxsw_sp_mall_entry *mall_entry, + struct netlink_ext_ack *extack) - netdev_err(mlxsw_sp_port->dev, "could not find requested device "); + nl_set_err_msg(extack, "could not find requested device"); - if (err) + if (err) { + nl_set_err_msg(extack, "failed to get span agent"); + } - if (err) + if (err) { + nl_set_err_msg(extack, "failed to get analyzed port"); + } - if (err) + if (err) { + nl_set_err_msg(extack, "failed to bind span agent"); + } - struct mlxsw_sp_mall_entry *mall_entry) + struct mlxsw_sp_mall_entry *mall_entry, + struct netlink_ext_ack *extack) - netdev_err(mlxsw_sp_port->dev, "sample already active "); + nl_set_err_msg(extack, "sampling already active on port"); - mall_entry->sample.rate); + mall_entry->sample.rate, extack); - struct mlxsw_sp_mall_entry *mall_entry) + struct mlxsw_sp_mall_entry *mall_entry, + struct netlink_ext_ack *extack) - return mlxsw_sp_mall_port_mirror_add(mlxsw_sp_port, mall_entry); + return mlxsw_sp_mall_port_mirror_add(mlxsw_sp_port, mall_entry, + extack); - return mlxsw_sp_mall_port_sample_add(mlxsw_sp_port, mall_entry); + return mlxsw_sp_mall_port_sample_add(mlxsw_sp_port, mall_entry, + extack); - mall_entry); + mall_entry, f->common.extack); - struct mlxsw_sp_port *mlxsw_sp_port) + struct mlxsw_sp_port *mlxsw_sp_port, + struct netlink_ext_ack *extack) - err = mlxsw_sp_mall_port_rule_add(mlxsw_sp_port, mall_entry); + err = mlxsw_sp_mall_port_rule_add(mlxsw_sp_port, mall_entry, + extack); - u32 rate) + u32 rate, struct netlink_ext_ack *extack) - u32 rate) + u32 rate, struct netlink_ext_ack *extack) - if (err) + if (err) { + nl_set_err_msg(extack, "failed to get span agent"); + } - if (err) + if (err) { + nl_set_err_msg(extack, "failed to get analyzed port"); + } - if (err) + if (err) { + nl_set_err_msg(extack, "failed to bind span agent"); + }
|
Networking
|
6561df560833952fee3ff8dd11c3b6a2041b3b1a
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_matchall: push sampling checks to per-asic operations
|
push some sampling checks to the per-asic operations, as they are no longer relevant for all asics.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 2
| 22
| 14
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h - struct mlxsw_sp_port *mlxsw_sp_port, u32 rate, - struct netlink_ext_ack *extack); + struct mlxsw_sp_port *mlxsw_sp_port, bool ingress, + u32 rate, struct netlink_ext_ack *extack); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c + mall_entry->ingress, - if (!mall_entry->ingress) { - nl_set_err_msg(f->common.extack, "sample is not supported on egress"); - err = -eopnotsupp; - goto errout; - } - if (act->sample.rate > mlxsw_reg_mpsc_rate_max) { - nl_set_err_msg(f->common.extack, "sample rate not supported"); - err = -eopnotsupp; - goto errout; - } - u32 rate, struct netlink_ext_ack *extack) + bool ingress, u32 rate, + struct netlink_ext_ack *extack) + if (!ingress) { + nl_set_err_msg(extack, "sampling is not supported on egress"); + return -eopnotsupp; + } + + if (rate > mlxsw_reg_mpsc_rate_max) { + nl_set_err_msg(extack, "unsupported sampling rate"); + return -eopnotsupp; + } + - u32 rate, struct netlink_ext_ack *extack) + bool ingress, u32 rate, + struct netlink_ext_ack *extack) + if (!ingress) { + nl_set_err_msg(extack, "sampling is not supported on egress"); + return -eopnotsupp; + } +
|
Networking
|
559313b2cbb762ee4efa4ab6cd6f800c39984c20
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_matchall: pass matchall entry to sampling operations
|
the entry will be required by the next patches, so pass it. no functional changes intended.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 2
| 22
| 14
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +struct mlxsw_sp_mall_entry; - struct mlxsw_sp_port *mlxsw_sp_port, bool ingress, - u32 rate, struct netlink_ext_ack *extack); + struct mlxsw_sp_port *mlxsw_sp_port, + struct mlxsw_sp_mall_entry *mall_entry, + struct netlink_ext_ack *extack); - struct mlxsw_sp_port *mlxsw_sp_port); + struct mlxsw_sp_port *mlxsw_sp_port, + struct mlxsw_sp_mall_entry *mall_entry); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c - mall_entry->ingress, - mall_entry->sample.rate, extack); + mall_entry, extack); -mlxsw_sp_mall_port_sample_del(struct mlxsw_sp_port *mlxsw_sp_port) +mlxsw_sp_mall_port_sample_del(struct mlxsw_sp_port *mlxsw_sp_port, + struct mlxsw_sp_mall_entry *mall_entry) - mlxsw_sp->mall_ops->sample_del(mlxsw_sp, mlxsw_sp_port); + mlxsw_sp->mall_ops->sample_del(mlxsw_sp, mlxsw_sp_port, mall_entry); - mlxsw_sp_mall_port_sample_del(mlxsw_sp_port); + mlxsw_sp_mall_port_sample_del(mlxsw_sp_port, mall_entry); - bool ingress, u32 rate, + struct mlxsw_sp_mall_entry *mall_entry, - if (!ingress) { + u32 rate = mall_entry->sample.rate; + + if (!mall_entry->ingress) { - struct mlxsw_sp_port *mlxsw_sp_port) + struct mlxsw_sp_port *mlxsw_sp_port, + struct mlxsw_sp_mall_entry *mall_entry) - bool ingress, u32 rate, + struct mlxsw_sp_mall_entry *mall_entry, + u32 rate = mall_entry->sample.rate; - if (!ingress) { + if (!mall_entry->ingress) { - struct mlxsw_sp_port *mlxsw_sp_port) + struct mlxsw_sp_port *mlxsw_sp_port, + struct mlxsw_sp_mall_entry *mall_entry)
|
Networking
|
e09a59555a3028564f3cb0d10c24ab86f50cbb79
|
ido schimmel jiri pirko jiri nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum: track sampling triggers in a hash table
|
currently, mlxsw supports a single sampling trigger type (i.e., received packet). when sampling is configured on an ingress port, the sampling parameters (e.g., pointer to the psample group) are stored as an attribute of the port, so that they could be passed to psample_sample_packet() when a sampled packet is trapped to the cpu.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 2
| 178
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +#include <linux/refcount.h> +#include <linux/rhashtable.h> +struct mlxsw_sp_sample_trigger_node { + struct mlxsw_sp_sample_trigger trigger; + struct mlxsw_sp_sample_params params; + struct rhash_head ht_node; + struct rcu_head rcu; + refcount_t refcount; +}; + +static const struct rhashtable_params mlxsw_sp_sample_trigger_ht_params = { + .key_offset = offsetof(struct mlxsw_sp_sample_trigger_node, trigger), + .head_offset = offsetof(struct mlxsw_sp_sample_trigger_node, ht_node), + .key_len = sizeof(struct mlxsw_sp_sample_trigger), + .automatic_shrinking = true, +}; + +static void +mlxsw_sp_sample_trigger_key_init(struct mlxsw_sp_sample_trigger *key, + const struct mlxsw_sp_sample_trigger *trigger) +{ + memset(key, 0, sizeof(*key)); + key->type = trigger->type; + key->local_port = trigger->local_port; +} + +/* rcu read lock must be held */ +struct mlxsw_sp_sample_params * +mlxsw_sp_sample_trigger_params_lookup(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_sample_trigger *trigger) +{ + struct mlxsw_sp_sample_trigger_node *trigger_node; + struct mlxsw_sp_sample_trigger key; + + mlxsw_sp_sample_trigger_key_init(&key, trigger); + trigger_node = rhashtable_lookup(&mlxsw_sp->sample_trigger_ht, &key, + mlxsw_sp_sample_trigger_ht_params); + if (!trigger_node) + return null; + + return &trigger_node->params; +} + +static int +mlxsw_sp_sample_trigger_node_init(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_sample_trigger *trigger, + const struct mlxsw_sp_sample_params *params) +{ + struct mlxsw_sp_sample_trigger_node *trigger_node; + int err; + + trigger_node = kzalloc(sizeof(*trigger_node), gfp_kernel); + if (!trigger_node) + return -enomem; + + trigger_node->trigger = *trigger; + trigger_node->params = *params; + refcount_set(&trigger_node->refcount, 1); + + err = rhashtable_insert_fast(&mlxsw_sp->sample_trigger_ht, + &trigger_node->ht_node, + mlxsw_sp_sample_trigger_ht_params); + if (err) + goto err_rhashtable_insert; + + return 0; + +err_rhashtable_insert: + kfree(trigger_node); + return err; +} + +static void +mlxsw_sp_sample_trigger_node_fini(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_sample_trigger_node *trigger_node) +{ + rhashtable_remove_fast(&mlxsw_sp->sample_trigger_ht, + &trigger_node->ht_node, + mlxsw_sp_sample_trigger_ht_params); + kfree_rcu(trigger_node, rcu); +} + +int +mlxsw_sp_sample_trigger_params_set(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_sample_trigger *trigger, + const struct mlxsw_sp_sample_params *params, + struct netlink_ext_ack *extack) +{ + struct mlxsw_sp_sample_trigger_node *trigger_node; + struct mlxsw_sp_sample_trigger key; + + assert_rtnl(); + + mlxsw_sp_sample_trigger_key_init(&key, trigger); + + trigger_node = rhashtable_lookup_fast(&mlxsw_sp->sample_trigger_ht, + &key, + mlxsw_sp_sample_trigger_ht_params); + if (!trigger_node) + return mlxsw_sp_sample_trigger_node_init(mlxsw_sp, &key, + params); + + if (trigger_node->params.psample_group != params->psample_group || + trigger_node->params.truncate != params->truncate || + trigger_node->params.rate != params->rate || + trigger_node->params.trunc_size != params->trunc_size) { + nl_set_err_msg_mod(extack, "sampling parameters do not match for an existing sampling trigger"); + return -einval; + } + + refcount_inc(&trigger_node->refcount); + + return 0; +} + +void +mlxsw_sp_sample_trigger_params_unset(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_sample_trigger *trigger) +{ + struct mlxsw_sp_sample_trigger_node *trigger_node; + struct mlxsw_sp_sample_trigger key; + + assert_rtnl(); + + mlxsw_sp_sample_trigger_key_init(&key, trigger); + + trigger_node = rhashtable_lookup_fast(&mlxsw_sp->sample_trigger_ht, + &key, + mlxsw_sp_sample_trigger_ht_params); + if (!trigger_node) + return; + + if (!refcount_dec_and_test(&trigger_node->refcount)) + return; + + mlxsw_sp_sample_trigger_node_fini(mlxsw_sp, trigger_node); +} + + err = rhashtable_init(&mlxsw_sp->sample_trigger_ht, + &mlxsw_sp_sample_trigger_ht_params); + if (err) { + dev_err(mlxsw_sp->bus_info->dev, "failed to init sampling trigger hashtable "); + goto err_sample_trigger_init; + } + + rhashtable_destroy(&mlxsw_sp->sample_trigger_ht); +err_sample_trigger_init: + rhashtable_destroy(&mlxsw_sp->sample_trigger_ht); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +#include <linux/spinlock.h> + struct rhashtable sample_trigger_ht; +enum mlxsw_sp_sample_trigger_type { + mlxsw_sp_sample_trigger_type_ingress, + mlxsw_sp_sample_trigger_type_egress, +}; + +struct mlxsw_sp_sample_trigger { + enum mlxsw_sp_sample_trigger_type type; + u8 local_port; +}; + +struct mlxsw_sp_sample_params { + struct psample_group *psample_group; + u32 trunc_size; + u32 rate; + bool truncate; +}; + +struct mlxsw_sp_sample_params * +mlxsw_sp_sample_trigger_params_lookup(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_sample_trigger *trigger); +int +mlxsw_sp_sample_trigger_params_set(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_sample_trigger *trigger, + const struct mlxsw_sp_sample_params *params, + struct netlink_ext_ack *extack); +void +mlxsw_sp_sample_trigger_params_unset(struct mlxsw_sp *mlxsw_sp, + const struct mlxsw_sp_sample_trigger *trigger);
|
Networking
|
1b9fc42e46dfea0efa39165d906b0f6a05d6b558
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum: start using sampling triggers hash table
|
start using the previously introduced sampling triggers hash table to store sampling parameters instead of storing them as attributes of the sampled port.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 3
| 46
| 42
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h -struct mlxsw_sp_port_sample { - struct psample_group *psample_group; - u32 trunc_size; - u32 rate; - bool truncate; - int span_id; /* relevant for spectrum-2 onwards. */ -}; - - struct mlxsw_sp_port_sample __rcu *sample; +struct mlxsw_sp_mall_sample_entry { + struct mlxsw_sp_sample_params params; + int span_id; /* relevant for spectrum-2 onwards. */ +}; + - struct mlxsw_sp_port_sample sample; + struct mlxsw_sp_mall_sample_entry sample; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c + struct mlxsw_sp_sample_trigger trigger; - if (rtnl_dereference(mlxsw_sp_port->sample)) { - nl_set_err_msg(extack, "sampling already active on port"); - return -eexist; - } - rcu_assign_pointer(mlxsw_sp_port->sample, &mall_entry->sample); + if (mall_entry->ingress) + trigger.type = mlxsw_sp_sample_trigger_type_ingress; + else + trigger.type = mlxsw_sp_sample_trigger_type_egress; + trigger.local_port = mlxsw_sp_port->local_port; + err = mlxsw_sp_sample_trigger_params_set(mlxsw_sp, &trigger, + &mall_entry->sample.params, + extack); + if (err) + return err; - rcu_init_pointer(mlxsw_sp_port->sample, null); + mlxsw_sp_sample_trigger_params_unset(mlxsw_sp, &trigger); + struct mlxsw_sp_sample_trigger trigger; - if (!mlxsw_sp_port->sample) - return; + if (mall_entry->ingress) + trigger.type = mlxsw_sp_sample_trigger_type_ingress; + else + trigger.type = mlxsw_sp_sample_trigger_type_egress; + trigger.local_port = mlxsw_sp_port->local_port; - rcu_init_pointer(mlxsw_sp_port->sample, null); + mlxsw_sp_sample_trigger_params_unset(mlxsw_sp, &trigger); - mall_entry->sample.psample_group = act->sample.psample_group; - mall_entry->sample.truncate = act->sample.truncate; - mall_entry->sample.trunc_size = act->sample.trunc_size; - mall_entry->sample.rate = act->sample.rate; + mall_entry->sample.params.psample_group = act->sample.psample_group; + mall_entry->sample.params.truncate = act->sample.truncate; + mall_entry->sample.params.trunc_size = act->sample.trunc_size; + mall_entry->sample.params.rate = act->sample.rate; - u32 rate = mall_entry->sample.rate; + u32 rate = mall_entry->sample.params.rate; - struct mlxsw_sp_port_sample *sample; - u32 rate = mall_entry->sample.rate; + u32 rate = mall_entry->sample.params.rate; - sample = rtnl_dereference(mlxsw_sp_port->sample); - - err = mlxsw_sp_span_agent_get(mlxsw_sp, &sample->span_id, &agent_parms); + err = mlxsw_sp_span_agent_get(mlxsw_sp, &mall_entry->sample.span_id, + &agent_parms); - trigger_parms.span_id = sample->span_id; + trigger_parms.span_id = mall_entry->sample.span_id; - mlxsw_sp_span_agent_put(mlxsw_sp, sample->span_id); + mlxsw_sp_span_agent_put(mlxsw_sp, mall_entry->sample.span_id); - struct mlxsw_sp_port_sample *sample; - - sample = rtnl_dereference(mlxsw_sp_port->sample); - trigger_parms.span_id = sample->span_id; + trigger_parms.span_id = mall_entry->sample.span_id; - mlxsw_sp_span_agent_put(mlxsw_sp, sample->span_id); + mlxsw_sp_span_agent_put(mlxsw_sp, mall_entry->sample.span_id); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c + struct mlxsw_sp_sample_trigger trigger; + struct mlxsw_sp_sample_params *params; - struct mlxsw_sp_port_sample *sample; - sample = rcu_dereference(mlxsw_sp_port->sample); - if (!sample) + trigger.type = mlxsw_sp_sample_trigger_type_ingress; + trigger.local_port = local_port; + params = mlxsw_sp_sample_trigger_params_lookup(mlxsw_sp, &trigger); + if (!params) - mlxsw_sp_port->dev->ifindex, sample->truncate, - sample->trunc_size); - psample_sample_packet(sample->psample_group, skb, sample->rate, &md); + mlxsw_sp_port->dev->ifindex, params->truncate, + params->trunc_size); + psample_sample_packet(params->psample_group, skb, params->rate, &md);
|
Networking
|
90f53c53ec4acaa86055f4d2e98767eeb735b42d
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_matchall: add support for egress sampling
|
allow user space to install a matchall classifier with sample action on egress. this is only supported on spectrum-2 onwards, so spectrum-1 will continue to return an error.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['c']
| 2
| 69
| 12
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c + enum mlxsw_sp_span_trigger span_trigger; - if (!mall_entry->ingress) { - nl_set_err_msg(extack, "sampling is not supported on egress"); - return -eopnotsupp; - } - - err = mlxsw_sp_span_analyzed_port_get(mlxsw_sp_port, true); + err = mlxsw_sp_span_analyzed_port_get(mlxsw_sp_port, + mall_entry->ingress); + span_trigger = mall_entry->ingress ? mlxsw_sp_span_trigger_ingress : + mlxsw_sp_span_trigger_egress; - err = mlxsw_sp_span_agent_bind(mlxsw_sp, mlxsw_sp_span_trigger_ingress, - mlxsw_sp_port, &trigger_parms); + err = mlxsw_sp_span_agent_bind(mlxsw_sp, span_trigger, mlxsw_sp_port, + &trigger_parms); - mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, true); + mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, mall_entry->ingress); + enum mlxsw_sp_span_trigger span_trigger; + span_trigger = mall_entry->ingress ? mlxsw_sp_span_trigger_ingress : + mlxsw_sp_span_trigger_egress; - mlxsw_sp_span_agent_unbind(mlxsw_sp, mlxsw_sp_span_trigger_ingress, - mlxsw_sp_port, &trigger_parms); - mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, true); + mlxsw_sp_span_agent_unbind(mlxsw_sp, span_trigger, mlxsw_sp_port, + &trigger_parms); + mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, mall_entry->ingress); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c + /* packet was mirrored from egress. */ + mlxsw_sp_mirror_reason_egress = 14, +static void mlxsw_sp_rx_sample_tx_listener(struct sk_buff *skb, u8 local_port, + void *trap_ctx) +{ + struct mlxsw_rx_md_info *rx_md_info = &mlxsw_skb_cb(skb)->rx_md_info; + struct mlxsw_sp *mlxsw_sp = devlink_trap_ctx_priv(trap_ctx); + struct mlxsw_sp_port *mlxsw_sp_port, *mlxsw_sp_port_tx; + struct mlxsw_sp_sample_trigger trigger; + struct mlxsw_sp_sample_params *params; + struct psample_metadata md = {}; + int err; + + /* locally generated packets are not reported from the policy engine + * trigger, so do not report them from the egress trigger as well. + */ + if (local_port == mlxsw_port_cpu_port) + goto out; + + err = __mlxsw_sp_rx_no_mark_listener(skb, local_port, trap_ctx); + if (err) + return; + + mlxsw_sp_port = mlxsw_sp->ports[local_port]; + if (!mlxsw_sp_port) + goto out; + + /* packet was sampled from tx, so we need to retrieve the sample + * parameters based on the tx port and not the rx port. + */ + mlxsw_sp_port_tx = mlxsw_sp_sample_tx_port_get(mlxsw_sp, rx_md_info); + if (!mlxsw_sp_port_tx) + goto out; + + trigger.type = mlxsw_sp_sample_trigger_type_egress; + trigger.local_port = mlxsw_sp_port_tx->local_port; + params = mlxsw_sp_sample_trigger_params_lookup(mlxsw_sp, &trigger); + if (!params) + goto out; + + /* the psample module expects skb->data to point to the start of the + * ethernet header. + */ + skb_push(skb, eth_hlen); + mlxsw_sp_psample_md_init(mlxsw_sp, &md, skb, + mlxsw_sp_port->dev->ifindex, params->truncate, + params->trunc_size); + psample_sample_packet(params->psample_group, skb, params->rate, &md); +out: + consume_skb(skb); +} + + mlxsw_rxl_mirror(mlxsw_sp_rx_sample_tx_listener, 1, + sp_pkt_sample, + mlxsw_sp_mirror_reason_egress),
|
Networking
|
54d0e963f683362418424f9ce61884a6e1cced38
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: core_acl_flex_actions: add mirror sampler action
|
add core functionality required to support mirror sampler action in the policy engine. the switch driver (e.g., 'mlxsw_spectrum') is required to implement the sampler_add() / sampler_del() callbacks that perform the necessary configuration before the sampler action can be installed. the next patch will implement it for spectrum-{2,3}, while spectrum-1 will return an error, given it is not supported.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 2
| 142
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c --- a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c + +/* mirror sampler action + * --------------------- + * the sampler_action is used to mirror packets with a probability (sampling). + */ + +#define mlxsw_afa_sampler_code 0x13 +#define mlxsw_afa_sampler_size 1 + +/* afa_sampler_mirror_agent + * mirror (span) agent. + */ +mlxsw_item32(afa, sampler, mirror_agent, 0x04, 0, 3); + +#define mlxsw_afa_sampler_rate_max (bit(24) - 1) + +/* afa_sampler_mirror_probability_rate + * mirroring probability. + * valid values are 1 to 2^24 - 1 + */ +mlxsw_item32(afa, sampler, mirror_probability_rate, 0x08, 0, 24); + +static void mlxsw_afa_sampler_pack(char *payload, u8 mirror_agent, u32 rate) +{ + mlxsw_afa_sampler_mirror_agent_set(payload, mirror_agent); + mlxsw_afa_sampler_mirror_probability_rate_set(payload, rate); +} + +struct mlxsw_afa_sampler { + struct mlxsw_afa_resource resource; + int span_id; + u8 local_port; + bool ingress; +}; + +static void mlxsw_afa_sampler_destroy(struct mlxsw_afa_block *block, + struct mlxsw_afa_sampler *sampler) +{ + mlxsw_afa_resource_del(&sampler->resource); + block->afa->ops->sampler_del(block->afa->ops_priv, sampler->local_port, + sampler->span_id, sampler->ingress); + kfree(sampler); +} + +static void mlxsw_afa_sampler_destructor(struct mlxsw_afa_block *block, + struct mlxsw_afa_resource *resource) +{ + struct mlxsw_afa_sampler *sampler; + + sampler = container_of(resource, struct mlxsw_afa_sampler, resource); + mlxsw_afa_sampler_destroy(block, sampler); +} + +static struct mlxsw_afa_sampler * +mlxsw_afa_sampler_create(struct mlxsw_afa_block *block, u8 local_port, + struct psample_group *psample_group, u32 rate, + u32 trunc_size, bool truncate, bool ingress, + struct netlink_ext_ack *extack) +{ + struct mlxsw_afa_sampler *sampler; + int err; + + sampler = kzalloc(sizeof(*sampler), gfp_kernel); + if (!sampler) + return err_ptr(-enomem); + + err = block->afa->ops->sampler_add(block->afa->ops_priv, local_port, + psample_group, rate, trunc_size, + truncate, ingress, &sampler->span_id, + extack); + if (err) + goto err_sampler_add; + + sampler->ingress = ingress; + sampler->local_port = local_port; + sampler->resource.destructor = mlxsw_afa_sampler_destructor; + mlxsw_afa_resource_add(block, &sampler->resource); + return sampler; + +err_sampler_add: + kfree(sampler); + return err_ptr(err); +} + +static int +mlxsw_afa_block_append_allocated_sampler(struct mlxsw_afa_block *block, + u8 mirror_agent, u32 rate) +{ + char *act = mlxsw_afa_block_append_action(block, mlxsw_afa_sampler_code, + mlxsw_afa_sampler_size); + + if (is_err(act)) + return ptr_err(act); + mlxsw_afa_sampler_pack(act, mirror_agent, rate); + return 0; +} + +int mlxsw_afa_block_append_sampler(struct mlxsw_afa_block *block, u8 local_port, + struct psample_group *psample_group, + u32 rate, u32 trunc_size, bool truncate, + bool ingress, + struct netlink_ext_ack *extack) +{ + struct mlxsw_afa_sampler *sampler; + int err; + + if (rate > mlxsw_afa_sampler_rate_max) { + nl_set_err_msg_mod(extack, "sampling rate is too high"); + return -einval; + } + + sampler = mlxsw_afa_sampler_create(block, local_port, psample_group, + rate, trunc_size, truncate, ingress, + extack); + if (is_err(sampler)) + return ptr_err(sampler); + + err = mlxsw_afa_block_append_allocated_sampler(block, sampler->span_id, + rate); + if (err) { + nl_set_err_msg_mod(extack, "cannot append sampler action"); + goto err_append_allocated_sampler; + } + + return 0; + +err_append_allocated_sampler: + mlxsw_afa_sampler_destroy(block, sampler); + return err; +} +export_symbol(mlxsw_afa_block_append_sampler); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.h b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.h --- a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.h +++ b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.h + int (*sampler_add)(void *priv, u8 local_port, + struct psample_group *psample_group, u32 rate, + u32 trunc_size, bool truncate, bool ingress, + int *p_span_id, struct netlink_ext_ack *extack); + void (*sampler_del)(void *priv, u8 local_port, int span_id, + bool ingress); +int mlxsw_afa_block_append_sampler(struct mlxsw_afa_block *block, u8 local_port, + struct psample_group *psample_group, + u32 rate, u32 trunc_size, bool truncate, + bool ingress, + struct netlink_ext_ack *extack);
|
Networking
|
ca19ea63f739c7a4e5dad64951706fea789e1f1a
|
ido schimmel jiri pirko jiri nvidia com
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum_acl: offload flow_action_sample
|
implement support for action sample when used with a flower classifier by implementing the required sampler_add() / sampler_del() callbacks and registering an rx listener for the sampled packets.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 5
| 175
| 1
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h + mlxsw_sp_sample_trigger_type_policy_engine, - u8 local_port; + u8 local_port; /* reserved when trigger type is not ingress / egress. */ +int mlxsw_sp_acl_rulei_act_sample(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_rule_info *rulei, + struct mlxsw_sp_flow_block *block, + struct psample_group *psample_group, u32 rate, + u32 trunc_size, bool truncate, + struct netlink_ext_ack *extack); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c +int mlxsw_sp_acl_rulei_act_sample(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_rule_info *rulei, + struct mlxsw_sp_flow_block *block, + struct psample_group *psample_group, u32 rate, + u32 trunc_size, bool truncate, + struct netlink_ext_ack *extack) +{ + struct mlxsw_sp_flow_block_binding *binding; + struct mlxsw_sp_port *mlxsw_sp_port; + + if (!list_is_singular(&block->binding_list)) { + nl_set_err_msg_mod(extack, "only a single sampling source is allowed"); + return -eopnotsupp; + } + binding = list_first_entry(&block->binding_list, + struct mlxsw_sp_flow_block_binding, list); + mlxsw_sp_port = binding->mlxsw_sp_port; + + return mlxsw_afa_block_append_sampler(rulei->act_block, + mlxsw_sp_port->local_port, + psample_group, rate, trunc_size, + truncate, binding->ingress, + extack); +} + diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c +static int mlxsw_sp1_act_sampler_add(void *priv, u8 local_port, + struct psample_group *psample_group, + u32 rate, u32 trunc_size, bool truncate, + bool ingress, int *p_span_id, + struct netlink_ext_ack *extack) +{ + nl_set_err_msg_mod(extack, "sampling action is not supported on spectrum-1"); + return -eopnotsupp; +} + +static void mlxsw_sp1_act_sampler_del(void *priv, u8 local_port, int span_id, + bool ingress) +{ + warn_on_once(1); +} + + .sampler_add = mlxsw_sp1_act_sampler_add, + .sampler_del = mlxsw_sp1_act_sampler_del, +static int mlxsw_sp2_act_sampler_add(void *priv, u8 local_port, + struct psample_group *psample_group, + u32 rate, u32 trunc_size, bool truncate, + bool ingress, int *p_span_id, + struct netlink_ext_ack *extack) +{ + struct mlxsw_sp_span_agent_parms agent_parms = { + .session_id = mlxsw_sp_span_session_id_sampling, + }; + struct mlxsw_sp_sample_trigger trigger = { + .type = mlxsw_sp_sample_trigger_type_policy_engine, + }; + struct mlxsw_sp_sample_params params; + struct mlxsw_sp_port *mlxsw_sp_port; + struct mlxsw_sp *mlxsw_sp = priv; + int err; + + params.psample_group = psample_group; + params.trunc_size = trunc_size; + params.rate = rate; + params.truncate = truncate; + err = mlxsw_sp_sample_trigger_params_set(mlxsw_sp, &trigger, ¶ms, + extack); + if (err) + return err; + + err = mlxsw_sp_span_agent_get(mlxsw_sp, p_span_id, &agent_parms); + if (err) { + nl_set_err_msg_mod(extack, "failed to get span agent"); + goto err_span_agent_get; + } + + mlxsw_sp_port = mlxsw_sp->ports[local_port]; + err = mlxsw_sp_span_analyzed_port_get(mlxsw_sp_port, ingress); + if (err) { + nl_set_err_msg_mod(extack, "failed to get analyzed port"); + goto err_analyzed_port_get; + } + + return 0; + +err_analyzed_port_get: + mlxsw_sp_span_agent_put(mlxsw_sp, *p_span_id); +err_span_agent_get: + mlxsw_sp_sample_trigger_params_unset(mlxsw_sp, &trigger); + return err; +} + +static void mlxsw_sp2_act_sampler_del(void *priv, u8 local_port, int span_id, + bool ingress) +{ + struct mlxsw_sp_sample_trigger trigger = { + .type = mlxsw_sp_sample_trigger_type_policy_engine, + }; + struct mlxsw_sp_port *mlxsw_sp_port; + struct mlxsw_sp *mlxsw_sp = priv; + + mlxsw_sp_port = mlxsw_sp->ports[local_port]; + mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, ingress); + mlxsw_sp_span_agent_put(mlxsw_sp, span_id); + mlxsw_sp_sample_trigger_params_unset(mlxsw_sp, &trigger); +} + + .sampler_add = mlxsw_sp2_act_sampler_add, + .sampler_del = mlxsw_sp2_act_sampler_del, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c + int sample_act_count = 0; + case flow_action_sample: { + if (sample_act_count++) { + nl_set_err_msg_mod(extack, "multiple sample actions per rule are not supported"); + return -eopnotsupp; + } + + err = mlxsw_sp_acl_rulei_act_sample(mlxsw_sp, rulei, + block, + act->sample.psample_group, + act->sample.rate, + act->sample.trunc_size, + act->sample.truncate, + extack); + if (err) + return err; + break; + } diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c + /* packet was mirrored from policy engine. */ + mlxsw_sp_mirror_reason_policy_engine = 2, +static void mlxsw_sp_rx_sample_acl_listener(struct sk_buff *skb, u8 local_port, + void *trap_ctx) +{ + struct mlxsw_sp *mlxsw_sp = devlink_trap_ctx_priv(trap_ctx); + struct mlxsw_sp_sample_trigger trigger = { + .type = mlxsw_sp_sample_trigger_type_policy_engine, + }; + struct mlxsw_sp_sample_params *params; + struct mlxsw_sp_port *mlxsw_sp_port; + struct psample_metadata md = {}; + int err; + + err = __mlxsw_sp_rx_no_mark_listener(skb, local_port, trap_ctx); + if (err) + return; + + mlxsw_sp_port = mlxsw_sp->ports[local_port]; + if (!mlxsw_sp_port) + goto out; + + params = mlxsw_sp_sample_trigger_params_lookup(mlxsw_sp, &trigger); + if (!params) + goto out; + + /* the psample module expects skb->data to point to the start of the + * ethernet header. + */ + skb_push(skb, eth_hlen); + mlxsw_sp_psample_md_init(mlxsw_sp, &md, skb, + mlxsw_sp_port->dev->ifindex, params->truncate, + params->trunc_size); + psample_sample_packet(params->psample_group, skb, params->rate, &md); +out: + consume_skb(skb); +} + + mlxsw_rxl_mirror(mlxsw_sp_rx_sample_acl_listener, 1, + sp_pkt_sample, + mlxsw_sp_mirror_reason_policy_engine),
|
Networking
|
45aad0b7043da88244622a65773dae24fd1dd4da
|
ido schimmel
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
selftests: mlxsw: add tc sample tests for new triggers
|
test that packets are sampled when tc-sample is used with matchall egress binding and flower classifier. verify that when performing sampling on egress the end-to-end latency is reported as metadata.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['sh']
| 1
| 135
| 0
|
--- diff --git a/tools/testing/selftests/drivers/net/mlxsw/tc_sample.sh b/tools/testing/selftests/drivers/net/mlxsw/tc_sample.sh --- a/tools/testing/selftests/drivers/net/mlxsw/tc_sample.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/tc_sample.sh + tc_sample_md_latency_test + tc_sample_acl_group_conflict_test + tc_sample_acl_rate_test + tc_sample_acl_max_rate_test +tc_sample_md_latency_test() +{ + ret=0 + + # egress sampling not supported on spectrum-1. + [[ "$devlink_viddid" == "15b3:cb84" ]] && return + + tc filter add dev $rp2 egress protocol all pref 1 handle 101 matchall \ + skip_sw action sample rate 5 group 1 + check_err $? "failed to configure sampling rule" + + psample_capture_start + + ip vrf exec v$h1 $mz $h1 -c 3200 -d 1msec -p 64 -a 192.0.2.1 \ + -b 198.51.100.1 -t udp dp=52768,sp=42768 -q + + psample_capture_stop + + grep -q -e "latency " $capture_file + check_err $? "sampled packets do not have latency attribute" + + log_test "tc sample latency" + + tc filter del dev $rp2 egress protocol all pref 1 handle 101 matchall +} + +tc_sample_acl_group_conflict_test() +{ + ret=0 + + # test that two flower sampling rules cannot be configured on the same + # port with different groups. + + # policy-based sampling is not supported on spectrum-1. + [[ "$devlink_viddid" == "15b3:cb84" ]] && return + + tc filter add dev $rp1 ingress protocol ip pref 1 handle 101 flower \ + skip_sw action sample rate 1024 group 1 + check_err $? "failed to configure sampling rule" + + tc filter add dev $rp1 ingress protocol ip pref 2 handle 102 flower \ + skip_sw action sample rate 1024 group 1 + check_err $? "failed to configure sampling rule with same group" + + tc filter add dev $rp1 ingress protocol ip pref 3 handle 103 flower \ + skip_sw action sample rate 1024 group 2 &> /dev/null + check_fail $? "managed to configure sampling rule with conflicting group" + + log_test "tc sample (w/ flower) group conflict test" + + tc filter del dev $rp1 ingress protocol ip pref 2 handle 102 flower + tc filter del dev $rp1 ingress protocol ip pref 1 handle 101 flower +} + +__tc_sample_acl_rate_test() +{ + local bind=$1; shift + local port=$1; shift + local pkts pct + + ret=0 + + # policy-based sampling is not supported on spectrum-1. + [[ "$devlink_viddid" == "15b3:cb84" ]] && return + + tc filter add dev $port $bind protocol ip pref 1 handle 101 flower \ + skip_sw dst_ip 198.51.100.1 action sample rate 32 group 1 + check_err $? "failed to configure sampling rule" + + psample_capture_start + + ip vrf exec v$h1 $mz $h1 -c 3200 -d 1msec -p 64 -a 192.0.2.1 \ + -b 198.51.100.1 -t udp dp=52768,sp=42768 -q + + psample_capture_stop + + pkts=$(grep -e "group 1 " $capture_file | wc -l) + pct=$((100 * (pkts - 100) / 100)) + (( -25 <= pct && pct <= 25)) + check_err $? "expected 100 packets, got $pkts packets, which is $pct% off. required accuracy is +-25%" + + # setup a filter that should not match any packet and make sure packets + # are not sampled. + tc filter del dev $port $bind protocol ip pref 1 handle 101 flower + + tc filter add dev $port $bind protocol ip pref 1 handle 101 flower \ + skip_sw dst_ip 198.51.100.10 action sample rate 32 group 1 + check_err $? "failed to configure sampling rule" + + psample_capture_start + + ip vrf exec v$h1 $mz $h1 -c 3200 -d 1msec -p 64 -a 192.0.2.1 \ + -b 198.51.100.1 -t udp dp=52768,sp=42768 -q + + psample_capture_stop + + grep -q -e "group 1 " $capture_file + check_fail $? "sampled packets when should not" + + log_test "tc sample (w/ flower) rate ($bind)" + + tc filter del dev $port $bind protocol ip pref 1 handle 101 flower +} + +tc_sample_acl_rate_test() +{ + __tc_sample_acl_rate_test ingress $rp1 + __tc_sample_acl_rate_test egress $rp2 +} + +tc_sample_acl_max_rate_test() +{ + ret=0 + + # policy-based sampling is not supported on spectrum-1. + [[ "$devlink_viddid" == "15b3:cb84" ]] && return + + tc filter add dev $rp1 ingress protocol ip pref 1 handle 101 flower \ + skip_sw action sample rate $((2 ** 24 - 1)) group 1 + check_err $? "failed to configure sampling rule with max rate" + + tc filter del dev $rp1 ingress protocol ip pref 1 handle 101 flower + + tc filter add dev $rp1 ingress protocol ip pref 1 handle 101 flower \ + skip_sw action sample rate $((2 ** 24)) \ + group 1 &> /dev/null + check_fail $? "managed to configure sampling rate above maximum" + + log_test "tc sample (w/ flower) maximum rate" +} +
|
Networking
|
f0b692c4ee2fdd0d4291fe3cbde156792896895e
|
ido schimmel
|
tools
|
testing
|
drivers, mlxsw, net, selftests
|
selftests: mlxsw: test egress sampling limitation on spectrum-1 only
|
make sure egress sampling configuration only fails on spectrum-1, given that mlxsw now supports it on spectrum-{2,3}.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
add support for egress and policy-based sampling
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['sh']
| 1
| 3
| 1
|
--- diff --git a/tools/testing/selftests/drivers/net/mlxsw/tc_restrictions.sh b/tools/testing/selftests/drivers/net/mlxsw/tc_restrictions.sh --- a/tools/testing/selftests/drivers/net/mlxsw/tc_restrictions.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/tc_restrictions.sh +source $lib_dir/devlink_lib.sh - # bound on egress + # bound on egress. spectrum-1 specific restriction + [[ "$devlink_viddid" != "15b3:cb84" ]] && return
|
Networking
|
0f967d9e5a20aeee51bb004295e83c2c913cceda
|
ido schimmel jiri pirko jiri nvidia com
|
tools
|
testing
|
drivers, mlxsw, net, selftests
|
mlxsw: reg: add egr_et_set field to spvid
|
spvid.egr_et_set=1 means that when vlan is pushed at ingress (for untagged packets or for qinq push mode) then the ethertype is decided at the egress port.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow 802.1d and .1ad vxlan bridges to coexist on spectrum>=2
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h']
| 1
| 9
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +/* reg_spvid_egr_et_set + * when vlan is pushed at ingress (for untagged packets or for + * qinq push mode) then the ethertype is decided at the egress port. + * reserved when spectrum-1. + * access: rw + */ +mlxsw_item32(reg, spvid, egr_et_set, 0x04, 24, 1); + + * reserved when egr_et_set = 1.
|
Networking
|
1b35293b7afc5bdd6731502c6bba11a04a71512a
|
amit cohen
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: reg: add switch port egress vlan ethertype register
|
spevet configures which ethertype to push at egress for packets incoming through a local port for which 'spvid.egr_et_set' is set.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow 802.1d and .1ad vxlan bridges to coexist on spectrum>=2
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h']
| 1
| 36
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +/* spevet - switch port egress vlan ethertype + * ------------------------------------------ + * the switch port egress vlan ethertype configures which ethertype to push at + * egress for packets incoming through a local port for which 'spvid.egr_et_set' + * is set. + */ +#define mlxsw_reg_spevet_id 0x202a +#define mlxsw_reg_spevet_len 0x08 + +mlxsw_reg_define(spevet, mlxsw_reg_spevet_id, mlxsw_reg_spevet_len); + +/* reg_spevet_local_port + * egress local port number. + * not supported to cpu port. + * access: index + */ +mlxsw_item32(reg, spevet, local_port, 0x00, 16, 8); + +/* reg_spevet_et_vlan + * egress ethertype vlan to push when spvid.egr_et_set field set for the packet: + * 0: ether_type0 - (default) + * 1: ether_type1 + * 2: ether_type2 + * access: rw + */ +mlxsw_item32(reg, spevet, et_vlan, 0x04, 16, 2); + +static inline void mlxsw_reg_spevet_pack(char *payload, u8 local_port, + u8 et_vlan) +{ + mlxsw_reg_zero(spevet, payload); + mlxsw_reg_spevet_local_port_set(payload, local_port); + mlxsw_reg_spevet_et_vlan_set(payload, et_vlan); +} + + mlxsw_reg(spevet),
|
Networking
|
d8f4da73cea7438d95c6d6a54ec0a76dbccac02e
|
amit cohen
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: spectrum: add mlxsw_sp_port_egress_ethtype_set()
|
a subsequent patch will cause decapsulated packets to have their ethertype determined by the egress port. add mlxsw_sp_port_egress_ethtype_set() which will be called when a port joins an 802.1ad bridge, so that it will set an 802.1ad ethertype on decapsulated packets transmitted through it, instead of the default 802.1q ethertype.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow 802.1d and .1ad vxlan bridges to coexist on spectrum>=2
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 2
| 18
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +int mlxsw_sp_port_egress_ethtype_set(struct mlxsw_sp_port *mlxsw_sp_port, + u16 ethtype) +{ + struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; + char spevet_pl[mlxsw_reg_spevet_len]; + u8 sver_type; + int err; + + err = mlxsw_sp_ethtype_to_sver_type(ethtype, &sver_type); + if (err) + return err; + + mlxsw_reg_spevet_pack(spevet_pl, mlxsw_sp_port->local_port, sver_type); + return mlxsw_reg_write(mlxsw_sp->core, mlxsw_reg(spevet), spevet_pl); +} + diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +int mlxsw_sp_port_egress_ethtype_set(struct mlxsw_sp_port *mlxsw_sp_port, + u16 ethtype);
|
Networking
|
114a465d890a4fa2e3c0a49001cd47d3e804bf54
|
amit cohen
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: add struct mlxsw_sp_switchdev_ops per asic
|
a subsequent patch will need to implement different set of operations when a port joins / leaves an 802.1ad bridge, based on the asic type.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow 802.1d and .1ad vxlan bridges to coexist on spectrum>=2
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 3
| 31
| 0
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c + mlxsw_sp->switchdev_ops = &mlxsw_sp1_switchdev_ops; + mlxsw_sp->switchdev_ops = &mlxsw_sp2_switchdev_ops; + mlxsw_sp->switchdev_ops = &mlxsw_sp2_switchdev_ops; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +struct mlxsw_sp_switchdev_ops; + +extern const struct mlxsw_sp_switchdev_ops mlxsw_sp1_switchdev_ops; +extern const struct mlxsw_sp_switchdev_ops mlxsw_sp2_switchdev_ops; + + const struct mlxsw_sp_switchdev_ops *switchdev_ops; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +struct mlxsw_sp_switchdev_ops { + void (*init)(struct mlxsw_sp *mlxsw_sp); +}; + +static void mlxsw_sp1_switchdev_init(struct mlxsw_sp *mlxsw_sp) +{ +} + +const struct mlxsw_sp_switchdev_ops mlxsw_sp1_switchdev_ops = { + .init = mlxsw_sp1_switchdev_init, +}; + +static void mlxsw_sp2_switchdev_init(struct mlxsw_sp *mlxsw_sp) +{ +} + +const struct mlxsw_sp_switchdev_ops mlxsw_sp2_switchdev_ops = { + .init = mlxsw_sp2_switchdev_init, +}; + + mlxsw_sp->switchdev_ops->init(mlxsw_sp); +
|
Networking
|
0f74fa5617305aa555db7cbc8c19b8eff4806efe
|
amit cohen
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
mlxsw: allow 802.1d and .1ad vxlan bridges to coexist on spectrum>=2
|
currently only one ethertype can be configured for pushing in tunnels because ethertype is configured using spvid.et_vlan for tunnel port.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow 802.1d and .1ad vxlan bridges to coexist on spectrum>=2
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['h', 'c']
| 3
| 53
| 15
|
--- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.h --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.h - u16 ethertype; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c - config->ethertype = params->ethertype; -mlxsw_sp2_nve_decap_ethertype_set(struct mlxsw_sp *mlxsw_sp, u16 ethertype) +mlxsw_sp2_nve_decap_ethertype_set(struct mlxsw_sp *mlxsw_sp) - u8 sver_type; - int err; - err = mlxsw_sp_ethtype_to_sver_type(ethertype, &sver_type); - if (err) - return err; - - mlxsw_reg_spvid_et_vlan_set(spvid_pl, sver_type); + mlxsw_reg_spvid_egr_et_set_set(spvid_pl, true); - err = mlxsw_sp2_nve_decap_ethertype_set(mlxsw_sp, config->ethertype); + err = mlxsw_sp2_nve_decap_ethertype_set(mlxsw_sp); - /* set default ethertype */ - mlxsw_sp2_nve_decap_ethertype_set(mlxsw_sp, eth_p_8021q); diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c -static const struct mlxsw_sp_bridge_ops mlxsw_sp_bridge_8021ad_ops = { +static const struct mlxsw_sp_bridge_ops mlxsw_sp1_bridge_8021ad_ops = { +static int +mlxsw_sp2_bridge_8021ad_port_join(struct mlxsw_sp_bridge_device *bridge_device, + struct mlxsw_sp_bridge_port *bridge_port, + struct mlxsw_sp_port *mlxsw_sp_port, + struct netlink_ext_ack *extack) +{ + int err; + + /* the ethertype of decapsulated packets is determined at the egress + * port to allow 802.1d and 802.1ad bridges with vxlan devices to + * co-exist. + */ + err = mlxsw_sp_port_egress_ethtype_set(mlxsw_sp_port, eth_p_8021ad); + if (err) + return err; + + err = mlxsw_sp_bridge_8021ad_port_join(bridge_device, bridge_port, + mlxsw_sp_port, extack); + if (err) + goto err_bridge_8021ad_port_join; + + return 0; + +err_bridge_8021ad_port_join: + mlxsw_sp_port_egress_ethtype_set(mlxsw_sp_port, eth_p_8021q); + return err; +} + +static void +mlxsw_sp2_bridge_8021ad_port_leave(struct mlxsw_sp_bridge_device *bridge_device, + struct mlxsw_sp_bridge_port *bridge_port, + struct mlxsw_sp_port *mlxsw_sp_port) +{ + mlxsw_sp_bridge_8021ad_port_leave(bridge_device, bridge_port, + mlxsw_sp_port); + mlxsw_sp_port_egress_ethtype_set(mlxsw_sp_port, eth_p_8021q); +} + +static const struct mlxsw_sp_bridge_ops mlxsw_sp2_bridge_8021ad_ops = { + .port_join = mlxsw_sp2_bridge_8021ad_port_join, + .port_leave = mlxsw_sp2_bridge_8021ad_port_leave, + .vxlan_join = mlxsw_sp_bridge_8021ad_vxlan_join, + .fid_get = mlxsw_sp_bridge_8021q_fid_get, + .fid_lookup = mlxsw_sp_bridge_8021q_fid_lookup, + .fid_vid = mlxsw_sp_bridge_8021q_fid_vid, +}; + + mlxsw_sp->bridge->bridge_8021ad_ops = &mlxsw_sp1_bridge_8021ad_ops; + mlxsw_sp->bridge->bridge_8021ad_ops = &mlxsw_sp2_bridge_8021ad_ops; - bridge->bridge_8021ad_ops = &mlxsw_sp_bridge_8021ad_ops;
|
Networking
|
bf677bd25a9956bbeb9b4e13cb0c786c814d917e
|
amit cohen
|
drivers
|
net
|
ethernet, mellanox, mlxsw
|
selftests: forwarding: add test for dual vxlan bridge
|
configure vxlan with an 802.1ad bridge and vxlan with an 802.1d bridge at the same time in same switch, verify that traffic passed as expected.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow 802.1d and .1ad vxlan bridges to coexist on spectrum>=2
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['sh']
| 1
| 366
| 0
|
--- diff --git a/tools/testing/selftests/net/forwarding/dual_vxlan_bridge.sh b/tools/testing/selftests/net/forwarding/dual_vxlan_bridge.sh --- /dev/null +++ b/tools/testing/selftests/net/forwarding/dual_vxlan_bridge.sh +#!/bin/bash +# spdx-license-identifier: gpl-2.0 + +# +--------------------+ +----------------------+ +# | h1 (vrf) | | h2 (vrf) | +# | + h1.10 | | + h2.20 | +# | | 192.0.2.1/28 | | | 192.0.2.2/28 | +# | | | | | | +# | + $h1 | | + $h2 | +# | | | | | | +# +----|---------------+ +--|-------------------+ +# | | +# +----|--------------------------------------------------|--------------------+ +# | sw | | | +# | +--|-------------------------------+ +----------------|------------------+ | +# | | + $swp1 br1 (802.1ad) | | br2 (802.1d) + $swp2 | | +# | | vid 100 pvid untagged | | | | | +# | | | | + $swp2.20 | | +# | | | | | | +# | | + vx100 (vxlan) | | + vx200 (vxlan) | | +# | | local 192.0.2.17 | | local 192.0.2.17 | | +# | | remote 192.0.2.34 | | remote 192.0.2.50 | | +# | | id 1000 dstport $vxport | | id 2000 dstport $vxport | | +# | | vid 100 pvid untagged | | | | +# | +--------------------------------- + +-----------------------------------+ | +# | | +# | 192.0.2.32/28 via 192.0.2.18 | +# | 192.0.2.48/28 via 192.0.2.18 | +# | | +# | + $rp1 | +# | | 192.0.2.17/28 | +# +----|-----------------------------------------------------------------------+ +# | +# +----|--------------------------------------------------------+ +# | | vrp2 (vrf) | +# | + $rp2 | +# | 192.0.2.18/28 | +# | | (maybe) hw +# ============================================================================= +# | | (likely) sw +# | + v1 (veth) + v3 (veth) | +# | | 192.0.2.33/28 | 192.0.2.49/28 | +# +----|---------------------------------------|----------------+ +# | | +# +----|------------------------------+ +----|------------------------------+ +# | + v2 (veth) ns1 (netns) | | + v4 (veth) ns2 (netns) | +# | 192.0.2.34/28 | | 192.0.2.50/28 | +# | | | | +# | 192.0.2.16/28 via 192.0.2.33 | | 192.0.2.16/28 via 192.0.2.49 | +# | 192.0.2.50/32 via 192.0.2.33 | | 192.0.2.34/32 via 192.0.2.49 | +# | | | | +# | +-------------------------------+ | | +-------------------------------+ | +# | | br3 (802.1ad) | | | | br3 (802.1d) | | +# | | + vx100 (vxlan) | | | | + vx200 (vxlan) | | +# | | local 192.0.2.34 | | | | local 192.0.2.50 | | +# | | remote 192.0.2.17 | | | | remote 192.0.2.17 | | +# | | remote 192.0.2.50 | | | | remote 192.0.2.34 | | +# | | id 1000 dstport $vxport | | | | id 2000 dstport $vxport | | +# | | vid 100 pvid untagged | | | | | | +# | | | | | | + w1.20 | | +# | | | | | | | | | +# | | + w1 (veth) | | | | + w1 (veth) | | +# | | | vid 100 pvid untagged | | | | | | | +# | +--|----------------------------+ | | +--|----------------------------+ | +# | | | | | | +# | +--|----------------------------+ | | +--|----------------------------+ | +# | | | vw2 (vrf) | | | | | vw2 (vrf) | | +# | | + w2 (veth) | | | | + w2 (veth) | | +# | | | | | | | | | | +# | | | | | | | | | | +# | | + w2.10 | | | | + w2.20 | | +# | | 192.0.2.3/28 | | | | 192.0.2.4/28 | | +# | +-------------------------------+ | | +-------------------------------+ | +# +-----------------------------------+ +-----------------------------------+ + +: ${vxport:=4789} +export vxport + +: ${all_tests:=" + ping_ipv4 + "} + +num_netifs=6 +source lib.sh + +h1_create() +{ + simple_if_init $h1 + tc qdisc add dev $h1 clsact + vlan_create $h1 10 v$h1 192.0.2.1/28 +} + +h1_destroy() +{ + vlan_destroy $h1 10 + tc qdisc del dev $h1 clsact + simple_if_fini $h1 +} + +h2_create() +{ + simple_if_init $h2 + tc qdisc add dev $h2 clsact + vlan_create $h2 20 v$h2 192.0.2.2/28 +} + +h2_destroy() +{ + vlan_destroy $h2 20 + tc qdisc del dev $h2 clsact + simple_if_fini $h2 +} + +rp1_set_addr() +{ + ip address add dev $rp1 192.0.2.17/28 + + ip route add 192.0.2.32/28 nexthop via 192.0.2.18 + ip route add 192.0.2.48/28 nexthop via 192.0.2.18 +} + +rp1_unset_addr() +{ + ip route del 192.0.2.48/28 nexthop via 192.0.2.18 + ip route del 192.0.2.32/28 nexthop via 192.0.2.18 + + ip address del dev $rp1 192.0.2.17/28 +} + +switch_create() +{ + #### br1 #### + ip link add name br1 type bridge vlan_filtering 1 \ + vlan_protocol 802.1ad vlan_default_pvid 0 mcast_snooping 0 + # make sure the bridge uses the mac address of the local port and not + # that of the vxlan's device. + ip link set dev br1 address $(mac_get $swp1) + ip link set dev br1 up + + #### br2 #### + ip link add name br2 type bridge vlan_filtering 0 mcast_snooping 0 + # make sure the bridge uses the mac address of the local port and not + # that of the vxlan's device. + ip link set dev br2 address $(mac_get $swp2) + ip link set dev br2 up + + ip link set dev $rp1 up + rp1_set_addr + + #### vx100 #### + ip link add name vx100 type vxlan id 1000 local 192.0.2.17 \ + dstport "$vxport" nolearning noudpcsum tos inherit ttl 100 + ip link set dev vx100 up + + ip link set dev vx100 master br1 + bridge vlan add vid 100 dev vx100 pvid untagged + + ip link set dev $swp1 master br1 + ip link set dev $swp1 up + bridge vlan add vid 100 dev $swp1 pvid untagged + + #### vx200 #### + ip link add name vx200 type vxlan id 2000 local 192.0.2.17 \ + dstport "$vxport" nolearning noudpcsum tos inherit ttl 100 + ip link set dev vx200 up + + ip link set dev vx200 master br2 + + ip link set dev $swp2 up + ip link add name $swp2.20 link $swp2 type vlan id 20 + ip link set dev $swp2.20 master br2 + ip link set dev $swp2.20 up + + bridge fdb append dev vx100 00:00:00:00:00:00 dst 192.0.2.34 self + bridge fdb append dev vx200 00:00:00:00:00:00 dst 192.0.2.50 self +} + +switch_destroy() +{ + bridge fdb del dev vx200 00:00:00:00:00:00 dst 192.0.2.50 self + bridge fdb del dev vx100 00:00:00:00:00:00 dst 192.0.2.34 self + + ip link set dev vx200 nomaster + ip link set dev vx200 down + ip link del dev vx200 + + ip link del dev $swp2.20 + ip link set dev $swp2 down + ip link set dev $swp2 nomaster + + bridge vlan del vid 100 dev $swp1 + ip link set dev $swp1 down + ip link set dev $swp1 nomaster + + ip link set dev vx100 nomaster + ip link set dev vx100 down + ip link del dev vx100 + + rp1_unset_addr + ip link set dev $rp1 down + + ip link set dev br2 down + ip link del dev br2 + + ip link set dev br1 down + ip link del dev br1 +} + +vrp2_create() +{ + simple_if_init $rp2 192.0.2.18/28 + __simple_if_init v1 v$rp2 192.0.2.33/28 + __simple_if_init v3 v$rp2 192.0.2.49/28 + tc qdisc add dev v1 clsact +} + +vrp2_destroy() +{ + tc qdisc del dev v1 clsact + __simple_if_fini v3 192.0.2.49/28 + __simple_if_fini v1 192.0.2.33/28 + simple_if_fini $rp2 192.0.2.18/28 +} + +ns_init_common() +{ + local in_if=$1; shift + local in_addr=$1; shift + local other_in_addr=$1; shift + local vxlan_name=$1; shift + local vxlan_id=$1; shift + local vlan_id=$1; shift + local host_addr=$1; shift + local nh_addr=$1; shift + + ip link set dev $in_if up + ip address add dev $in_if $in_addr/28 + tc qdisc add dev $in_if clsact + + ip link add name br3 type bridge vlan_filtering 0 + ip link set dev br3 up + + ip link add name w1 type veth peer name w2 + + ip link set dev w1 master br3 + ip link set dev w1 up + + ip link add name $vxlan_name type vxlan id $vxlan_id local $in_addr \ + dstport "$vxport" + ip link set dev $vxlan_name up + bridge fdb append dev $vxlan_name 00:00:00:00:00:00 dst 192.0.2.17 self + bridge fdb append dev $vxlan_name 00:00:00:00:00:00 dst $other_in_addr self + + ip link set dev $vxlan_name master br3 + tc qdisc add dev $vxlan_name clsact + + simple_if_init w2 + vlan_create w2 $vlan_id vw2 $host_addr/28 + + ip route add 192.0.2.16/28 nexthop via $nh_addr + ip route add $other_in_addr/32 nexthop via $nh_addr +} +export -f ns_init_common + +ns1_create() +{ + ip netns add ns1 + ip link set dev v2 netns ns1 + in_ns ns1 \ + ns_init_common v2 192.0.2.34 192.0.2.50 vx100 1000 10 192.0.2.3 \ + 192.0.2.33 + + in_ns ns1 bridge vlan add vid 100 dev vx100 pvid untagged +} + +ns1_destroy() +{ + ip netns exec ns1 ip link set dev v2 netns 1 + ip netns del ns1 +} + +ns2_create() +{ + ip netns add ns2 + ip link set dev v4 netns ns2 + in_ns ns2 \ + ns_init_common v4 192.0.2.50 192.0.2.34 vx200 2000 20 192.0.2.4 \ + 192.0.2.49 + + in_ns ns2 ip link add name w1.20 link w1 type vlan id 20 + in_ns ns2 ip link set dev w1.20 master br3 + in_ns ns2 ip link set dev w1.20 up +} + +ns2_destroy() +{ + ip netns exec ns2 ip link set dev v4 netns 1 + ip netns del ns2 +} + +setup_prepare() +{ + h1=${netifs[p1]} + swp1=${netifs[p2]} + + swp2=${netifs[p3]} + h2=${netifs[p4]} + + rp1=${netifs[p5]} + rp2=${netifs[p6]} + + vrf_prepare + forwarding_enable + + h1_create + h2_create + switch_create + + ip link add name v1 type veth peer name v2 + ip link add name v3 type veth peer name v4 + vrp2_create + ns1_create + ns2_create + + r1_mac=$(in_ns ns1 mac_get w2) + r2_mac=$(in_ns ns2 mac_get w2) + h2_mac=$(mac_get $h2) +} + +cleanup() +{ + pre_cleanup + + ns2_destroy + ns1_destroy + vrp2_destroy + ip link del dev v3 + ip link del dev v1 + + switch_destroy + h2_destroy + h1_destroy + + forwarding_restore + vrf_cleanup +} + +ping_ipv4() +{ + ping_test $h1 192.0.2.3 ": local->remote 1 through vxlan with an 802.1ad bridge" + ping_test $h2 192.0.2.4 ": local->remote 2 through vxlan with an 802.1d bridge" +} + +test_all() +{ + echo "running tests with udp port $vxport" + tests_run +} + +trap cleanup exit + +setup_prepare +setup_wait +test_all + +exit $exit_status
|
Networking
|
35f15ab378fa7e1eaa25798076a457523b5ace75
|
amit cohen
|
tools
|
testing
|
forwarding, net, selftests
|
selftests: mlxsw: spectrum-2: remove q_in_vni_veto test
|
q_in_vni_veto.sh is not needed anymore because vxlan with an 802.1ad bridge and vxlan with an 802.1d bridge can coexist.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow 802.1d and .1ad vxlan bridges to coexist on spectrum>=2
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlxsw ']
|
['sh']
| 1
| 0
| 77
|
--- diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/q_in_vni_veto.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/q_in_vni_veto.sh --- a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/q_in_vni_veto.sh +++ /dev/null -#!/bin/bash -# spdx-license-identifier: gpl-2.0 - -lib_dir=$(dirname $0)/../../../../net/forwarding - -vxport=4789 - -all_tests=" - create_dot1d_and_dot1ad_vxlans -" -num_netifs=2 -source $lib_dir/lib.sh - -setup_prepare() -{ - swp1=${netifs[p1]} - swp2=${netifs[p2]} - - ip link set dev $swp1 up - ip link set dev $swp2 up -} - -cleanup() -{ - pre_cleanup - - ip link set dev $swp2 down - ip link set dev $swp1 down -} - -create_dot1d_and_dot1ad_vxlans() -{ - ret=0 - - ip link add dev br0 type bridge vlan_filtering 1 vlan_protocol 802.1ad \ - vlan_default_pvid 0 mcast_snooping 0 - ip link set dev br0 up - - ip link add name vx100 type vxlan id 1000 local 192.0.2.17 dstport \ - "$vxport" nolearning noudpcsum tos inherit ttl 100 - ip link set dev vx100 up - - ip link set dev $swp1 master br0 - ip link set dev vx100 master br0 - bridge vlan add vid 100 dev vx100 pvid untagged - - ip link add dev br1 type bridge vlan_filtering 0 mcast_snooping 0 - ip link set dev br1 up - - ip link add name vx200 type vxlan id 2000 local 192.0.2.17 dstport \ - "$vxport" nolearning noudpcsum tos inherit ttl 100 - ip link set dev vx200 up - - ip link set dev $swp2 master br1 - ip link set dev vx200 master br1 2>/dev/null - check_fail $? "802.1d and 802.1ad vxlans at the same time not rejected" - - ip link set dev vx200 master br1 2>&1 >/dev/null \ - | grep -q mlxsw_spectrum - check_err $? "802.1d and 802.1ad vxlans at the same time rejected without extack" - - log_test "create 802.1d and 802.1ad vxlans" - - ip link del dev vx200 - ip link del dev br1 - ip link del dev vx100 - ip link del dev br0 -} - -trap cleanup exit - -setup_prepare -setup_wait - -tests_run - -exit $exit_status
|
Networking
|
1724c97d2f9ddcfe2e372f9b02d6efde15b885b0
|
amit cohen
|
tools
|
testing
|
drivers, mlxsw, net, selftests, spectrum-2
|
net/mlx5e: add states to ptp channel
|
add ptp tx state to ptp channel, which indicates the corresponding sq is available. further patches in the set extend ptp channel to include rq. the ptp channel state will be used for separation and coexistence of rx and tx ptp. enhance conditions to verify the tx ptp state is set.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow both cqe compression and hw time-stamp ptp to co-exist
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlx5 ']
|
['h', 'c']
| 5
| 71
| 34
|
--- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c - for (i = 0; i < c->num_tc; i++) { - busy |= mlx5e_poll_tx_cq(&c->ptpsq[i].txqsq.cq, budget); - busy |= mlx5e_ptp_poll_ts_cq(&c->ptpsq[i].ts_cq, budget); + if (test_bit(mlx5e_ptp_state_tx, c->state)) { + for (i = 0; i < c->num_tc; i++) { + busy |= mlx5e_poll_tx_cq(&c->ptpsq[i].txqsq.cq, budget); + busy |= mlx5e_ptp_poll_ts_cq(&c->ptpsq[i].ts_cq, budget); + } - for (i = 0; i < c->num_tc; i++) { - mlx5e_cq_arm(&c->ptpsq[i].txqsq.cq); - mlx5e_cq_arm(&c->ptpsq[i].ts_cq); + if (test_bit(mlx5e_ptp_state_tx, c->state)) { + for (i = 0; i < c->num_tc; i++) { + mlx5e_cq_arm(&c->ptpsq[i].txqsq.cq); + mlx5e_cq_arm(&c->ptpsq[i].ts_cq); + } - params->log_sq_size = orig->log_sq_size; - - mlx5e_ptp_build_sq_param(c->mdev, params, &cparams->txq_sq_param); + if (test_bit(mlx5e_ptp_state_tx, c->state)) { + params->log_sq_size = orig->log_sq_size; + mlx5e_ptp_build_sq_param(c->mdev, params, &cparams->txq_sq_param); + } - err = mlx5e_ptp_open_cqs(c, cparams); - if (err) - return err; - - err = mlx5e_ptp_open_txqsqs(c, cparams); - if (err) - goto close_cqs; + if (test_bit(mlx5e_ptp_state_tx, c->state)) { + err = mlx5e_ptp_open_cqs(c, cparams); + if (err) + return err; + err = mlx5e_ptp_open_txqsqs(c, cparams); + if (err) + goto close_cqs; + } - mlx5e_ptp_close_cqs(c); + if (test_bit(mlx5e_ptp_state_tx, c->state)) + mlx5e_ptp_close_cqs(c); - mlx5e_ptp_close_txqsqs(c); - mlx5e_ptp_close_cqs(c); + if (test_bit(mlx5e_ptp_state_tx, c->state)) { + mlx5e_ptp_close_txqsqs(c); + mlx5e_ptp_close_cqs(c); + } +} + +static int mlx5e_ptp_set_state(struct mlx5e_ptp *c, struct mlx5e_params *params) +{ + if (mlx5e_get_pflag(params, mlx5e_pflag_tx_port_ts)) + __set_bit(mlx5e_ptp_state_tx, c->state); + + return bitmap_empty(c->state, mlx5e_ptp_state_num_states) ? -einval : 0; + err = mlx5e_ptp_set_state(c, params); + if (err) + goto err_free; + - +err_free: - for (tc = 0; tc < c->num_tc; tc++) - mlx5e_activate_txqsq(&c->ptpsq[tc].txqsq); + if (test_bit(mlx5e_ptp_state_tx, c->state)) { + for (tc = 0; tc < c->num_tc; tc++) + mlx5e_activate_txqsq(&c->ptpsq[tc].txqsq); + } - for (tc = 0; tc < c->num_tc; tc++) - mlx5e_deactivate_txqsq(&c->ptpsq[tc].txqsq); + if (test_bit(mlx5e_ptp_state_tx, c->state)) { + for (tc = 0; tc < c->num_tc; tc++) + mlx5e_deactivate_txqsq(&c->ptpsq[tc].txqsq); + } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h +enum { + mlx5e_ptp_state_tx, + mlx5e_ptp_state_num_states, +}; + + declare_bitmap(state, mlx5e_ptp_state_num_states); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c + struct mlx5e_ptp *ptp_ch = priv->channels.ptp; - generic_ptpsq = priv->channels.ptp ? - &priv->channels.ptp->ptpsq[0] : - null; - if (!generic_ptpsq) + if (!ptp_ch || !test_bit(mlx5e_ptp_state_tx, ptp_ch->state)) + generic_ptpsq = &ptp_ch->ptpsq[0]; + - if (!ptp_ch) + if (!ptp_ch || !test_bit(mlx5e_ptp_state_tx, ptp_ch->state)) - if (ptp_ch) { + if (ptp_ch && test_bit(mlx5e_ptp_state_tx, ptp_ch->state)) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c + if (!test_bit(mlx5e_ptp_state_tx, priv->channels.ptp->state)) + return; + diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c + struct mlx5e_ptp *ptp_channel; + - if (unlikely(priv->channels.ptp)) - if (unlikely(skb_shinfo(skb)->tx_flags & skbtx_hw_tstamp) && - mlx5e_use_ptpsq(skb)) - return mlx5e_select_ptpsq(dev, skb); + ptp_channel = read_once(priv->channels.ptp); + if (unlikely(ptp_channel) && + test_bit(mlx5e_ptp_state_tx, ptp_channel->state) && + mlx5e_use_ptpsq(skb)) + return mlx5e_select_ptpsq(dev, skb);
|
Networking
|
24c22dd0918bd136b7bea0f3a521ccf355fb432b
|
aya levin tariq toukan tariqt nvidia com
|
drivers
|
net
|
core, en, ethernet, mellanox, mlx5
|
net/mlx5e: add rq to ptp channel
|
enhance ptp channel to allow ptp without disabling cqe compression. add rq, tir and ptp_rx_state to ptp channel. when this bit is set, ptp channel manages its rq, and ptp traffic is directed to the ptp-rq which is not affected by compression.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow both cqe compression and hw time-stamp ptp to co-exist
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlx5 ']
|
['h', 'c']
| 3
| 118
| 8
|
--- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h + struct mlx5e_rq_stats rq; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c + struct mlx5e_rq_param rq_param; + struct mlx5e_rq *rq = &c->rq; + if (test_bit(mlx5e_ptp_state_rx, c->state) && likely(budget)) { + work_done = mlx5e_poll_rx_cq(&rq->cq, budget); + busy |= work_done == budget; + busy |= indirect_call_2(rq->post_wqes, + mlx5e_post_rx_mpwqes, + mlx5e_post_rx_wqes, + rq); + } + if (test_bit(mlx5e_ptp_state_rx, c->state)) + mlx5e_cq_arm(&rq->cq); -static int mlx5e_ptp_open_cqs(struct mlx5e_ptp *c, - struct mlx5e_ptp_params *cparams) +static int mlx5e_ptp_open_tx_cqs(struct mlx5e_ptp *c, + struct mlx5e_ptp_params *cparams) -static void mlx5e_ptp_close_cqs(struct mlx5e_ptp *c) +static int mlx5e_ptp_open_rx_cq(struct mlx5e_ptp *c, + struct mlx5e_ptp_params *cparams) +{ + struct mlx5e_create_cq_param ccp = {}; + struct dim_cq_moder ptp_moder = {}; + struct mlx5e_cq_param *cq_param; + struct mlx5e_cq *cq = &c->rq.cq; + + ccp.node = dev_to_node(mlx5_core_dma_dev(c->mdev)); + ccp.ch_stats = c->stats; + ccp.napi = &c->napi; + ccp.ix = mlx5e_ptp_channel_ix; + + cq_param = &cparams->rq_param.cqp; + + return mlx5e_open_cq(c->priv, ptp_moder, cq_param, &ccp, cq); +} + +static void mlx5e_ptp_close_tx_cqs(struct mlx5e_ptp *c) +static void mlx5e_ptp_build_rq_param(struct mlx5_core_dev *mdev, + struct net_device *netdev, + u16 q_counter, + struct mlx5e_ptp_params *ptp_params) +{ + struct mlx5e_rq_param *rq_params = &ptp_params->rq_param; + struct mlx5e_params *params = &ptp_params->params; + + params->rq_wq_type = mlx5_wq_type_cyclic; + mlx5e_init_rq_type_params(mdev, params); + params->sw_mtu = netdev->max_mtu; + mlx5e_build_rq_param(mdev, params, null, q_counter, rq_params); +} + + if (test_bit(mlx5e_ptp_state_rx, c->state)) + mlx5e_ptp_build_rq_param(c->mdev, c->netdev, c->priv->q_counter, cparams); +} + +static int mlx5e_init_ptp_rq(struct mlx5e_ptp *c, struct mlx5e_params *params, + struct mlx5e_rq *rq) +{ + struct mlx5_core_dev *mdev = c->mdev; + struct mlx5e_priv *priv = c->priv; + int err; + + rq->wq_type = params->rq_wq_type; + rq->pdev = mdev->device; + rq->netdev = priv->netdev; + rq->priv = priv; + rq->clock = &mdev->clock; + rq->tstamp = &priv->tstamp; + rq->mdev = mdev; + rq->hw_mtu = mlx5e_sw2hw_mtu(params, params->sw_mtu); + rq->stats = &c->priv->ptp_stats.rq; + rq->ptp_cyc2time = mlx5_rq_ts_translator(mdev); + err = mlx5e_rq_set_handlers(rq, params, false); + if (err) + return err; + + return xdp_rxq_info_reg(&rq->xdp_rxq, rq->netdev, rq->ix, 0); +} + +static int mlx5e_ptp_open_rq(struct mlx5e_ptp *c, struct mlx5e_params *params, + struct mlx5e_rq_param *rq_param) +{ + int node = dev_to_node(c->mdev->device); + int err; + + err = mlx5e_init_ptp_rq(c, params, &c->rq); + if (err) + return err; + + return mlx5e_open_rq(params, rq_param, null, node, &c->rq); - err = mlx5e_ptp_open_cqs(c, cparams); + err = mlx5e_ptp_open_tx_cqs(c, cparams); - goto close_cqs; + goto close_tx_cqs; + } + if (test_bit(mlx5e_ptp_state_rx, c->state)) { + err = mlx5e_ptp_open_rx_cq(c, cparams); + if (err) + goto close_txqsq; + + err = mlx5e_ptp_open_rq(c, &cparams->params, &cparams->rq_param); + if (err) + goto close_rx_cq; -close_cqs: +close_rx_cq: + if (test_bit(mlx5e_ptp_state_rx, c->state)) + mlx5e_close_cq(&c->rq.cq); +close_txqsq: + if (test_bit(mlx5e_ptp_state_tx, c->state)) + mlx5e_ptp_close_txqsqs(c); +close_tx_cqs: - mlx5e_ptp_close_cqs(c); + mlx5e_ptp_close_tx_cqs(c); + if (test_bit(mlx5e_ptp_state_rx, c->state)) { + mlx5e_close_rq(&c->rq); + mlx5e_close_cq(&c->rq.cq); + } - mlx5e_ptp_close_cqs(c); + mlx5e_ptp_close_tx_cqs(c); + if (test_bit(mlx5e_ptp_state_rx, c->state)) + mlx5e_activate_rq(&c->rq); + if (test_bit(mlx5e_ptp_state_rx, c->state)) + mlx5e_deactivate_rq(&c->rq); + diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h + mlx5e_ptp_state_rx, + struct mlx5e_rq rq;
|
Networking
|
a099da8ffcf6d4f6d41719bd41878ff529ab6b55
|
aya levin
|
drivers
|
net
|
core, en, ethernet, mellanox, mlx5
|
net/mlx5e: add ptp-rx statistics
|
like ptp-tx, once the ptp-rx is opened, corresponding statistics appear. add indication that ptp-rx was ever opened: rx_ptp_opened. if any of the ptp rx or tx were opened, display the ptp channel's statistics.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow both cqe compression and hw time-stamp ptp to co-exist
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlx5 ']
|
['h', 'c']
| 5
| 100
| 26
|
--- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h + bool rx_ptp_opened; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c + if (test_bit(mlx5e_ptp_state_rx, c->state)) + priv->rx_ptp_opened = true; + diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c + if (priv->rx_ptp_opened) { + struct mlx5e_rq_stats *rq_stats = &priv->ptp_stats.rq; + + s->rx_packets += rq_stats->packets; + s->rx_bytes += rq_stats->bytes; + s->multicast += rq_stats->mcast_packets; + } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c - if (!priv->tx_ptp_opened) + if (!priv->tx_ptp_opened && !priv->rx_ptp_opened) - for (i = 0; i < priv->max_opened_tc; i++) { - mlx5e_stats_grp_sw_update_stats_sq(s, &priv->ptp_stats.sq[i]); + if (priv->tx_ptp_opened) { + for (i = 0; i < priv->max_opened_tc; i++) { + mlx5e_stats_grp_sw_update_stats_sq(s, &priv->ptp_stats.sq[i]); + + /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92657 */ + barrier(); + } + } + if (priv->rx_ptp_opened) { + mlx5e_stats_grp_sw_update_stats_rq_stats(s, &priv->ptp_stats.rq); +static const struct counter_desc ptp_rq_stats_desc[] = { + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, packets) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, bytes) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, csum_complete) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, csum_complete_tail) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, csum_complete_tail_slow) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, csum_unnecessary) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, csum_unnecessary_inner) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, csum_none) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, xdp_drop) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, xdp_redirect) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, lro_packets) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, lro_bytes) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, ecn_mark) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, removed_vlan_packets) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, wqe_err) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, mpwqe_filler_cqes) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, mpwqe_filler_strides) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, oversize_pkts_sw_drop) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, buff_alloc_err) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, cqe_compress_blks) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, cqe_compress_pkts) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, cache_reuse) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, cache_full) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, cache_empty) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, cache_busy) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, cache_waive) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, congst_umr) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, arfs_err) }, + { mlx5e_declare_ptp_rq_stat(struct mlx5e_rq_stats, recover) }, +}; + +#define num_ptp_rq_stats array_size(ptp_rq_stats_desc) - return priv->tx_ptp_opened ? - num_ptp_ch_stats + - ((num_ptp_sq_stats + num_ptp_cq_stats) * priv->max_opened_tc) : - 0; + int num = num_ptp_ch_stats; + + if (!priv->tx_ptp_opened && !priv->rx_ptp_opened) + return 0; + + if (priv->tx_ptp_opened) + num += (num_ptp_sq_stats + num_ptp_cq_stats) * priv->max_opened_tc; + if (priv->rx_ptp_opened) + num += num_ptp_rq_stats; + + return num; - if (!priv->tx_ptp_opened) + if (!priv->tx_ptp_opened && !priv->rx_ptp_opened) - for (tc = 0; tc < priv->max_opened_tc; tc++) - for (i = 0; i < num_ptp_sq_stats; i++) - sprintf(data + (idx++) * eth_gstring_len, - ptp_sq_stats_desc[i].format, tc); + if (priv->tx_ptp_opened) { + for (tc = 0; tc < priv->max_opened_tc; tc++) + for (i = 0; i < num_ptp_sq_stats; i++) + sprintf(data + (idx++) * eth_gstring_len, + ptp_sq_stats_desc[i].format, tc); - for (tc = 0; tc < priv->max_opened_tc; tc++) - for (i = 0; i < num_ptp_cq_stats; i++) + for (tc = 0; tc < priv->max_opened_tc; tc++) + for (i = 0; i < num_ptp_cq_stats; i++) + sprintf(data + (idx++) * eth_gstring_len, + ptp_cq_stats_desc[i].format, tc); + } + if (priv->rx_ptp_opened) { + for (i = 0; i < num_ptp_rq_stats; i++) - ptp_cq_stats_desc[i].format, tc); + ptp_rq_stats_desc[i].format); + } - if (!priv->tx_ptp_opened) + if (!priv->tx_ptp_opened && !priv->rx_ptp_opened) - for (tc = 0; tc < priv->max_opened_tc; tc++) - for (i = 0; i < num_ptp_sq_stats; i++) - data[idx++] = - mlx5e_read_ctr64_cpu(&priv->ptp_stats.sq[tc], - ptp_sq_stats_desc, i); + if (priv->tx_ptp_opened) { + for (tc = 0; tc < priv->max_opened_tc; tc++) + for (i = 0; i < num_ptp_sq_stats; i++) + data[idx++] = + mlx5e_read_ctr64_cpu(&priv->ptp_stats.sq[tc], + ptp_sq_stats_desc, i); - for (tc = 0; tc < priv->max_opened_tc; tc++) - for (i = 0; i < num_ptp_cq_stats; i++) + for (tc = 0; tc < priv->max_opened_tc; tc++) + for (i = 0; i < num_ptp_cq_stats; i++) + data[idx++] = + mlx5e_read_ctr64_cpu(&priv->ptp_stats.cq[tc], + ptp_cq_stats_desc, i); + } + if (priv->rx_ptp_opened) { + for (i = 0; i < num_ptp_rq_stats; i++) - mlx5e_read_ctr64_cpu(&priv->ptp_stats.cq[tc], - ptp_cq_stats_desc, i); - + mlx5e_read_ctr64_cpu(&priv->ptp_stats.rq, + ptp_rq_stats_desc, i); + } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +#define mlx5e_declare_ptp_rq_stat(type, fld) "ptp_rq%d_"#fld, offsetof(type, fld)
|
Networking
|
a28359e922c681a23c01e4858175d9e98c5ff88a
|
aya levin
|
drivers
|
net
|
core, en, ethernet, mellanox, mlx5
|
net:mlx5e: add ptp-tir and ptp-rqt
|
add ptp-tir and initiate its rqt to allow ptp-rq to integrate into the safe-reopen flow on configuration change. add rx_ptp_support flag on a profile and turn it on for eth driver. with this flag set, create a redirect-rqt for ptp-rq.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow both cqe compression and hw time-stamp ptp to co-exist
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlx5 ']
|
['h', 'c']
| 7
| 52
| 4
|
--- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h + struct mlx5e_tir ptp_tir; + bool rx_ptp_support; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c + +int mlx5e_ptp_get_rqn(struct mlx5e_ptp *c, u32 *rqn) +{ + if (!c || !test_bit(mlx5e_ptp_state_rx, c->state)) + return -einval; + + *rqn = c->rq.rqn; + return 0; +} diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h +int mlx5e_ptp_get_rqn(struct mlx5e_ptp *c, u32 *rqn); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c - struct mlx5e_redirect_rqt_param rrp) + struct mlx5e_redirect_rqt_param rrp, + struct mlx5e_redirect_rqt_param *ptp_rrp) + if (ptp_rrp) { + rqtn = priv->ptp_tir.rqt.rqtn; + mlx5e_redirect_rqt(priv, rqtn, 1, *ptp_rrp); + } + bool rx_ptp_support = priv->profile->rx_ptp_support; + struct mlx5e_redirect_rqt_param *ptp_rrp_p = null; + struct mlx5e_redirect_rqt_param ptp_rrp; + + if (rx_ptp_support) { + u32 ptp_rqn; - mlx5e_redirect_rqts(priv, rrp); + ptp_rrp.is_rss = false; + ptp_rrp.rqn = mlx5e_ptp_get_rqn(priv->channels.ptp, &ptp_rqn) ? + priv->drop_rq.rqn : ptp_rqn; + ptp_rrp_p = &ptp_rrp; + } + mlx5e_redirect_rqts(priv, rrp, ptp_rrp_p); + bool rx_ptp_support = priv->profile->rx_ptp_support; - mlx5e_redirect_rqts(priv, drop_rrp); + mlx5e_redirect_rqts(priv, drop_rrp, rx_ptp_support ? &drop_rrp : null); + err = mlx5e_create_direct_rqts(priv, &priv->ptp_tir, 1); + if (err) + goto err_destroy_xsk_tirs; + + err = mlx5e_create_direct_tirs(priv, &priv->ptp_tir, 1); + if (err) + goto err_destroy_ptp_rqt; + - goto err_destroy_xsk_tirs; + goto err_destroy_ptp_direct_tir; +err_destroy_ptp_direct_tir: + mlx5e_destroy_direct_tirs(priv, &priv->ptp_tir, 1); +err_destroy_ptp_rqt: + mlx5e_destroy_direct_rqts(priv, &priv->ptp_tir, 1); + mlx5e_destroy_direct_tirs(priv, &priv->ptp_tir, 1); + mlx5e_destroy_direct_rqts(priv, &priv->ptp_tir, 1); + .rx_ptp_support = true, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c + .rx_ptp_support = false, + .rx_ptp_support = false, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c + .rx_ptp_support = false, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c + .rx_ptp_support = false,
|
Networking
|
3adb60b6a3ed9f233daa632d35cec79fe4781372
|
aya levin tariq toukan tariqt nvidia com
|
drivers
|
net
|
core, en, ethernet, ipoib, mellanox, mlx5
|
net/mlx5e: refactor rx reporter diagnostics
|
break rx diagnostics function into smaller helpers. this enables easier enhancement in the next patch in the set.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow both cqe compression and hw time-stamp ptp to co-exist
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlx5 ']
|
['c']
| 1
| 66
| 38
|
--- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c -static int mlx5e_rx_reporter_build_diagnose_output(struct mlx5e_rq *rq, - struct devlink_fmsg *fmsg) +static int +mlx5e_rx_reporter_build_diagnose_output_rq_common(struct mlx5e_rq *rq, + struct devlink_fmsg *fmsg) - err = devlink_fmsg_obj_nest_start(fmsg); - if (err) - return err; - - err = devlink_fmsg_u32_pair_put(fmsg, "channel ix", rq->ix); - if (err) - return err; - - err = devlink_fmsg_obj_nest_end(fmsg); + return 0; +} + +static int mlx5e_rx_reporter_build_diagnose_output(struct mlx5e_rq *rq, + struct devlink_fmsg *fmsg) +{ + int err; + + err = devlink_fmsg_obj_nest_start(fmsg); - return 0; + err = devlink_fmsg_u32_pair_put(fmsg, "channel ix", rq->ix); + if (err) + return err; + + err = mlx5e_rx_reporter_build_diagnose_output_rq_common(rq, fmsg); + if (err) + return err; + + return devlink_fmsg_obj_nest_end(fmsg); -static int mlx5e_rx_reporter_diagnose(struct devlink_health_reporter *reporter, - struct devlink_fmsg *fmsg, - struct netlink_ext_ack *extack) +static int mlx5e_rx_reporter_diagnose_generic_rq(struct mlx5e_rq *rq, + struct devlink_fmsg *fmsg) - struct mlx5e_priv *priv = devlink_health_reporter_priv(reporter); - struct mlx5e_params *params = &priv->channels.params; - struct mlx5e_rq *generic_rq; + struct mlx5e_priv *priv = rq->priv; + struct mlx5e_params *params; - int i, err = 0; - - mutex_lock(&priv->state_lock); - - if (!test_bit(mlx5e_state_opened, &priv->state)) - goto unlock; + int err; - generic_rq = &priv->channels.c[0]->rq; - rq_sz = mlx5e_rqwq_get_size(generic_rq); + params = &priv->channels.params; + rq_sz = mlx5e_rqwq_get_size(rq); - err = mlx5e_health_fmsg_named_obj_nest_start(fmsg, "common config"); - if (err) - goto unlock; - - goto unlock; + return err; - goto unlock; + return err; - goto unlock; + return err; - goto unlock; + return err; - err = mlx5e_health_cq_common_diag_fmsg(&generic_rq->cq, fmsg); + err = mlx5e_health_cq_common_diag_fmsg(&rq->cq, fmsg); - goto unlock; + return err; - err = mlx5e_health_fmsg_named_obj_nest_end(fmsg); + return mlx5e_health_fmsg_named_obj_nest_end(fmsg); +} + +static int +mlx5e_rx_reporter_diagnose_common_config(struct devlink_health_reporter *reporter, + struct devlink_fmsg *fmsg) +{ + struct mlx5e_priv *priv = devlink_health_reporter_priv(reporter); + struct mlx5e_rq *generic_rq = &priv->channels.c[0]->rq; + int err; + + err = mlx5e_health_fmsg_named_obj_nest_start(fmsg, "common config"); + return err; + + err = mlx5e_rx_reporter_diagnose_generic_rq(generic_rq, fmsg); + if (err) + return err; + + return mlx5e_health_fmsg_named_obj_nest_end(fmsg); +} + +static int mlx5e_rx_reporter_diagnose(struct devlink_health_reporter *reporter, + struct devlink_fmsg *fmsg, + struct netlink_ext_ack *extack) +{ + struct mlx5e_priv *priv = devlink_health_reporter_priv(reporter); + int i, err = 0; + + mutex_lock(&priv->state_lock); + + if (!test_bit(mlx5e_state_opened, &priv->state)) - err = mlx5e_health_fmsg_named_obj_nest_end(fmsg); + err = mlx5e_rx_reporter_diagnose_common_config(reporter, fmsg);
|
Networking
|
19cfa36b18d8dc76d72f74b5209875e31641e219
|
aya levin tariq toukan tariqt nvidia com
|
drivers
|
net
|
core, en, ethernet, mellanox, mlx5
|
net/mlx5e: add ptp rq to rx reporter
|
when present, add the ptp rq to the rx reporter.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow both cqe compression and hw time-stamp ptp to co-exist
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlx5 ']
|
['c']
| 1
| 66
| 2
|
--- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +#include "ptp.h" +static int +mlx5e_rx_reporter_diagnose_common_ptp_config(struct mlx5e_priv *priv, struct mlx5e_ptp *ptp_ch, + struct devlink_fmsg *fmsg) +{ + int err; + + err = mlx5e_health_fmsg_named_obj_nest_start(fmsg, "ptp"); + if (err) + return err; + + err = devlink_fmsg_u32_pair_put(fmsg, "filter_type", priv->tstamp.rx_filter); + if (err) + return err; + + err = mlx5e_rx_reporter_diagnose_generic_rq(&ptp_ch->rq, fmsg); + if (err) + return err; + + return mlx5e_health_fmsg_named_obj_nest_end(fmsg); +} + + struct mlx5e_ptp *ptp_ch = priv->channels.ptp; + if (ptp_ch && test_bit(mlx5e_ptp_state_rx, ptp_ch->state)) { + err = mlx5e_rx_reporter_diagnose_common_ptp_config(priv, ptp_ch, fmsg); + if (err) + return err; + } + +static int mlx5e_rx_reporter_build_diagnose_output_ptp_rq(struct mlx5e_rq *rq, + struct devlink_fmsg *fmsg) +{ + int err; + + err = devlink_fmsg_obj_nest_start(fmsg); + if (err) + return err; + + err = devlink_fmsg_string_pair_put(fmsg, "channel", "ptp"); + if (err) + return err; + + err = mlx5e_rx_reporter_build_diagnose_output_rq_common(rq, fmsg); + if (err) + return err; + + err = devlink_fmsg_obj_nest_end(fmsg); + if (err) + return err; + + return 0; +} + + struct mlx5e_ptp *ptp_ch = priv->channels.ptp; + if (ptp_ch && test_bit(mlx5e_ptp_state_rx, ptp_ch->state)) { + err = mlx5e_rx_reporter_build_diagnose_output_ptp_rq(&ptp_ch->rq, fmsg); + if (err) + goto unlock; + } - if (err) - goto unlock; + struct mlx5e_ptp *ptp_ch = priv->channels.ptp; + if (ptp_ch && test_bit(mlx5e_ptp_state_rx, ptp_ch->state)) { + err = mlx5e_health_queue_dump(priv, fmsg, ptp_ch->rq.rqn, "ptp rq"); + if (err) + return err; + } +
|
Networking
|
b8fb10939ff43be7599df3a264474c180ba7234c
|
aya levin tariq toukan tariqt nvidia com
|
drivers
|
net
|
core, en, ethernet, mellanox, mlx5
|
net/mlx5e: cleanup flow steering level
|
flow steering levels are used to determine the order between the tables. as of today, each one of these tables follows the ttc table, and hijacks its traffic, and cannot be combined together for now. putting them in the same layer better reflects the situation.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow both cqe compression and hw time-stamp ptp to co-exist
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlx5 ']
|
['h', 'c']
| 2
| 3
| 3
|
--- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h - mlx5e_accel_fs_tcp_ft_level, + mlx5e_accel_fs_tcp_ft_level = mlx5e_inner_ttc_ft_level + 1, - mlx5e_arfs_ft_level, + mlx5e_arfs_ft_level = mlx5e_inner_ttc_ft_level + 1, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c -/* promiscuous, vlan, mac, ttc, inner ttc, {arfs/accel and esp/esp_err} */ +/* promiscuous, vlan, mac, ttc, inner ttc, {arfs/accel/{esp, esp_err}} */
|
Networking
|
c809cf665e28449ba7fec93089718bc8751a52cc
|
aya levin tariq toukan tariqt nvidia com
|
drivers
|
net
|
core, en, ethernet, mellanox, mlx5
|
net/mlx5e: introduce flow steering udp api
|
add a new fs api which captures the udp traffic from the traffic classifier into a dedicated fs table. this api handles both udp over ipv4 and ipv6 in the same manner. the tables (one for udpv4 and another for udpv6) consist of a group matching the udp destination port and a must-be-last group which contains a default rule redirecting the unmatched packets back to the rss logic.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow both cqe compression and hw time-stamp ptp to co-exist
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlx5 ']
|
['h', 'c', 'makefile']
| 5
| 368
| 2
|
--- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/makefile b/drivers/net/ethernet/mellanox/mlx5/core/makefile --- a/drivers/net/ethernet/mellanox/mlx5/core/makefile +++ b/drivers/net/ethernet/mellanox/mlx5/core/makefile - en/qos.o en/trap.o + en/qos.o en/trap.o en/fs_tt_redirect.o diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h + mlx5e_fs_tt_udp_ft_level = mlx5e_inner_ttc_ft_level + 1, +struct mlx5e_fs_udp; + + struct mlx5e_fs_udp *udp; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c --- /dev/null +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c +// spdx-license-identifier: gpl-2.0 or linux-openib +/* copyright (c) 2021, mellanox technologies inc. all rights reserved. */ + +#include <linux/netdevice.h> +#include "en/fs_tt_redirect.h" +#include "fs_core.h" + +enum fs_udp_type { + fs_ipv4_udp, + fs_ipv6_udp, + fs_udp_num_types, +}; + +struct mlx5e_fs_udp { + struct mlx5e_flow_table tables[fs_udp_num_types]; + struct mlx5_flow_handle *default_rules[fs_udp_num_types]; + int ref_cnt; +}; + +static char *fs_udp_type2str(enum fs_udp_type i) +{ + switch (i) { + case fs_ipv4_udp: + return "udp v4"; + default: /* fs_ipv6_udp */ + return "udp v6"; + } +} + +static enum mlx5e_traffic_types fs_udp2tt(enum fs_udp_type i) +{ + switch (i) { + case fs_ipv4_udp: + return mlx5e_tt_ipv4_udp; + default: /* fs_ipv6_udp */ + return mlx5e_tt_ipv6_udp; + } +} + +static enum fs_udp_type tt2fs_udp(enum mlx5e_traffic_types i) +{ + switch (i) { + case mlx5e_tt_ipv4_udp: + return fs_ipv4_udp; + case mlx5e_tt_ipv6_udp: + return fs_ipv6_udp; + default: + return fs_udp_num_types; + } +} + +void mlx5e_fs_tt_redirect_del_rule(struct mlx5_flow_handle *rule) +{ + mlx5_del_flow_rules(rule); +} + +static void fs_udp_set_dport_flow(struct mlx5_flow_spec *spec, enum fs_udp_type type, + u16 udp_dport) +{ + spec->match_criteria_enable = mlx5_match_outer_headers; + mlx5_set_to_ones(fte_match_param, spec->match_criteria, outer_headers.ip_protocol); + mlx5_set(fte_match_param, spec->match_value, outer_headers.ip_protocol, ipproto_udp); + mlx5_set_to_ones(fte_match_param, spec->match_criteria, outer_headers.ip_version); + mlx5_set(fte_match_param, spec->match_value, outer_headers.ip_version, + type == fs_ipv4_udp ? 4 : 6); + mlx5_set_to_ones(fte_match_param, spec->match_criteria, outer_headers.udp_dport); + mlx5_set(fte_match_param, spec->match_value, outer_headers.udp_dport, udp_dport); +} + +struct mlx5_flow_handle * +mlx5e_fs_tt_redirect_udp_add_rule(struct mlx5e_priv *priv, + enum mlx5e_traffic_types ttc_type, + u32 tir_num, u16 d_port) +{ + enum fs_udp_type type = tt2fs_udp(ttc_type); + struct mlx5_flow_destination dest = {}; + struct mlx5_flow_table *ft = null; + mlx5_declare_flow_act(flow_act); + struct mlx5_flow_handle *rule; + struct mlx5_flow_spec *spec; + struct mlx5e_fs_udp *fs_udp; + int err; + + if (type == fs_udp_num_types) + return err_ptr(-einval); + + spec = kvzalloc(sizeof(*spec), gfp_kernel); + if (!spec) + return err_ptr(-enomem); + + fs_udp = priv->fs.udp; + ft = fs_udp->tables[type].t; + + fs_udp_set_dport_flow(spec, type, d_port); + dest.type = mlx5_flow_destination_type_tir; + dest.tir_num = tir_num; + + rule = mlx5_add_flow_rules(ft, spec, &flow_act, &dest, 1); + kvfree(spec); + + if (is_err(rule)) { + err = ptr_err(rule); + netdev_err(priv->netdev, "%s: add %s rule failed, err %d ", + __func__, fs_udp_type2str(type), err); + } + return rule; +} + +static int fs_udp_add_default_rule(struct mlx5e_priv *priv, enum fs_udp_type type) +{ + struct mlx5e_flow_table *fs_udp_t; + struct mlx5_flow_destination dest; + mlx5_declare_flow_act(flow_act); + struct mlx5_flow_handle *rule; + struct mlx5e_fs_udp *fs_udp; + int err; + + fs_udp = priv->fs.udp; + fs_udp_t = &fs_udp->tables[type]; + + dest = mlx5e_ttc_get_default_dest(priv, fs_udp2tt(type)); + rule = mlx5_add_flow_rules(fs_udp_t->t, null, &flow_act, &dest, 1); + if (is_err(rule)) { + err = ptr_err(rule); + netdev_err(priv->netdev, + "%s: add default rule failed, fs type=%d, err %d ", + __func__, type, err); + return err; + } + + fs_udp->default_rules[type] = rule; + return 0; +} + +#define mlx5e_fs_udp_num_groups (2) +#define mlx5e_fs_udp_group1_size (bit(16)) +#define mlx5e_fs_udp_group2_size (bit(0)) +#define mlx5e_fs_udp_table_size (mlx5e_fs_udp_group1_size +\ + mlx5e_fs_udp_group2_size) +static int fs_udp_create_groups(struct mlx5e_flow_table *ft, enum fs_udp_type type) +{ + int inlen = mlx5_st_sz_bytes(create_flow_group_in); + void *outer_headers_c; + int ix = 0; + u32 *in; + int err; + u8 *mc; + + ft->g = kcalloc(mlx5e_fs_udp_num_groups, sizeof(*ft->g), gfp_kernel); + in = kvzalloc(inlen, gfp_kernel); + if (!in || !ft->g) { + kfree(ft->g); + kvfree(in); + return -enomem; + } + + mc = mlx5_addr_of(create_flow_group_in, in, match_criteria); + outer_headers_c = mlx5_addr_of(fte_match_param, mc, outer_headers); + mlx5_set_to_ones(fte_match_set_lyr_2_4, outer_headers_c, ip_protocol); + mlx5_set_to_ones(fte_match_set_lyr_2_4, outer_headers_c, ip_version); + + switch (type) { + case fs_ipv4_udp: + case fs_ipv6_udp: + mlx5_set_to_ones(fte_match_set_lyr_2_4, outer_headers_c, udp_dport); + break; + default: + err = -einval; + goto out; + } + /* match on udp protocol, ipv4/6 and dport */ + mlx5_set_cfg(in, match_criteria_enable, mlx5_match_outer_headers); + mlx5_set_cfg(in, start_flow_index, ix); + ix += mlx5e_fs_udp_group1_size; + mlx5_set_cfg(in, end_flow_index, ix - 1); + ft->g[ft->num_groups] = mlx5_create_flow_group(ft->t, in); + if (is_err(ft->g[ft->num_groups])) + goto err; + ft->num_groups++; + + /* default flow group */ + memset(in, 0, inlen); + mlx5_set_cfg(in, start_flow_index, ix); + ix += mlx5e_fs_udp_group2_size; + mlx5_set_cfg(in, end_flow_index, ix - 1); + ft->g[ft->num_groups] = mlx5_create_flow_group(ft->t, in); + if (is_err(ft->g[ft->num_groups])) + goto err; + ft->num_groups++; + + kvfree(in); + return 0; + +err: + err = ptr_err(ft->g[ft->num_groups]); + ft->g[ft->num_groups] = null; +out: + kvfree(in); + + return err; +} + +static int fs_udp_create_table(struct mlx5e_priv *priv, enum fs_udp_type type) +{ + struct mlx5e_flow_table *ft = &priv->fs.udp->tables[type]; + struct mlx5_flow_table_attr ft_attr = {}; + int err; + + ft->num_groups = 0; + + ft_attr.max_fte = mlx5e_fs_udp_table_size; + ft_attr.level = mlx5e_fs_tt_udp_ft_level; + ft_attr.prio = mlx5e_nic_prio; + + ft->t = mlx5_create_flow_table(priv->fs.ns, &ft_attr); + if (is_err(ft->t)) { + err = ptr_err(ft->t); + ft->t = null; + return err; + } + + netdev_dbg(priv->netdev, "created fs %s table id %u level %u ", + fs_udp_type2str(type), ft->t->id, ft->t->level); + + err = fs_udp_create_groups(ft, type); + if (err) + goto err; + + err = fs_udp_add_default_rule(priv, type); + if (err) + goto err; + + return 0; + +err: + mlx5e_destroy_flow_table(ft); + return err; +} + +static void fs_udp_destroy_table(struct mlx5e_fs_udp *fs_udp, int i) +{ + if (is_err_or_null(fs_udp->tables[i].t)) + return; + + mlx5_del_flow_rules(fs_udp->default_rules[i]); + mlx5e_destroy_flow_table(&fs_udp->tables[i]); + fs_udp->tables[i].t = null; +} + +static int fs_udp_disable(struct mlx5e_priv *priv) +{ + int err, i; + + for (i = 0; i < fs_udp_num_types; i++) { + /* modify ttc rules destination to point back to the indir tirs */ + err = mlx5e_ttc_fwd_default_dest(priv, fs_udp2tt(i)); + if (err) { + netdev_err(priv->netdev, + "%s: modify ttc[%d] default destination failed, err(%d) ", + __func__, fs_udp2tt(i), err); + return err; + } + } + + return 0; +} + +static int fs_udp_enable(struct mlx5e_priv *priv) +{ + struct mlx5_flow_destination dest = {}; + int err, i; + + dest.type = mlx5_flow_destination_type_flow_table; + for (i = 0; i < fs_udp_num_types; i++) { + dest.ft = priv->fs.udp->tables[i].t; + + /* modify ttc rules destination to point on the accel_fs fts */ + err = mlx5e_ttc_fwd_dest(priv, fs_udp2tt(i), &dest); + if (err) { + netdev_err(priv->netdev, + "%s: modify ttc[%d] destination to accel failed, err(%d) ", + __func__, fs_udp2tt(i), err); + return err; + } + } + return 0; +} + +void mlx5e_fs_tt_redirect_udp_destroy(struct mlx5e_priv *priv) +{ + struct mlx5e_fs_udp *fs_udp = priv->fs.udp; + int i; + + if (!fs_udp) + return; + + if (--fs_udp->ref_cnt) + return; + + fs_udp_disable(priv); + + for (i = 0; i < fs_udp_num_types; i++) + fs_udp_destroy_table(fs_udp, i); + + kfree(fs_udp); + priv->fs.udp = null; +} + +int mlx5e_fs_tt_redirect_udp_create(struct mlx5e_priv *priv) +{ + int i, err; + + if (priv->fs.udp) { + priv->fs.udp->ref_cnt++; + return 0; + } + + priv->fs.udp = kzalloc(sizeof(*priv->fs.udp), gfp_kernel); + if (!priv->fs.udp) + return -enomem; + + for (i = 0; i < fs_udp_num_types; i++) { + err = fs_udp_create_table(priv, i); + if (err) + goto err_destroy_tables; + } + + err = fs_udp_enable(priv); + if (err) + goto err_destroy_tables; + + priv->fs.udp->ref_cnt = 1; + + return 0; + +err_destroy_tables: + while (--i >= 0) + fs_udp_destroy_table(priv->fs.udp, i); + + kfree(priv->fs.udp); + priv->fs.udp = null; + return err; +} diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.h --- /dev/null +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.h +/* spdx-license-identifier: gpl-2.0 or linux-openib */ +/* copyright (c) 2021 mellanox technologies. */ + +#ifndef __mlx5e_fs_tt_redirect_h__ +#define __mlx5e_fs_tt_redirect_h__ + +#include "en.h" +#include "en/fs.h" + +void mlx5e_fs_tt_redirect_del_rule(struct mlx5_flow_handle *rule); + +/* udp traffic type redirect */ +struct mlx5_flow_handle * +mlx5e_fs_tt_redirect_udp_add_rule(struct mlx5e_priv *priv, + enum mlx5e_traffic_types ttc_type, + u32 tir_num, u16 d_port); +void mlx5e_fs_tt_redirect_udp_destroy(struct mlx5e_priv *priv); +int mlx5e_fs_tt_redirect_udp_create(struct mlx5e_priv *priv); +#endif diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c -/* promiscuous, vlan, mac, ttc, inner ttc, {arfs/accel/{esp, esp_err}} */ +/* promiscuous, vlan, mac, ttc, inner ttc, {udp/arfs/accel/{esp, esp_err}} */
|
Networking
|
1c80bd6843881fbef7d198981ea0decc184954fd
|
aya levin tariq toukan tariqt nvidia com
|
drivers
|
net
|
core, en, ethernet, mellanox, mlx5
|
net/mlx5e: introduce flow steering any api
|
add a new fs api which captures the any traffic from the traffic classifier into a dedicated fs table. the table consists of a group matching the ethertype and a must-be-last group which contains a default rule redirecting the unmatched packets back to the rss logic.
|
this release includes the landlock security module, which aims to make easier to sandbox applications; support for the clang control flow integrity, which aims to abort the program upon detecting certain forms of undefined behavior; support for randomising the stack address offset in each syscall; support for concurrent tbl flushing; preparatory apple m1 support; support for incoming amd and intel graphics chips; bpf support for calling kernel functions directly; a virtio sound driver for improved sound experience on virtualized guests; io_uring support for multi shot mode and a misc cgroup for miscellaneous resources. as always, there are many other features, new drivers, improvements and fixes.
|
allow both cqe compression and hw time-stamp ptp to co-exist
|
['core (various)', 'file systems', 'memory management', 'block layer', 'tracing, perf and bpf', 'virtualization', 'security', 'networking', 'architectures arm x86 mips powerpc riscv s390 ia64 xtensa']
|
['graphics', 'power management', 'storage', 'drivers in the staging area', 'networking', 'audio', 'tablets, touch screens, keyboards, mouses', 'tv tuners, webcams, video capturers', 'universal serial bus', 'serial peripheral interface (spi)', 'watchdog', 'serial', 'cpu frequency scaling', 'voltage, current regulators, power capping, power supply', 'real time clock (rtc)', 'pin controllers (pinctrl)', 'multi media card (mmc)', 'memory technology devices (mtd)', 'industrial i/o (iio)', 'multi function devices (mfd)', 'pulse-width modulation (pwm)', 'inter-integrated circuit (i2c + i3c)', 'hardware monitoring (hwmon)', 'general purpose i/o (gpio)', 'leds', 'dma engines', 'cryptography hardware acceleration', 'pci', 'remote processors', 'clock', 'phy ("physical layer" framework)', 'various']
|
['mlx5 ']
|
['h', 'c']
| 4
| 273
| 1
|
--- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h + mlx5e_fs_tt_any_ft_level = mlx5e_inner_ttc_ft_level + 1, +struct mlx5e_fs_any; + struct mlx5e_fs_any *any; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c --- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c +struct mlx5e_fs_any { + struct mlx5e_flow_table table; + struct mlx5_flow_handle *default_rule; + int ref_cnt; +}; + + +static void fs_any_set_ethertype_flow(struct mlx5_flow_spec *spec, u16 ether_type) +{ + spec->match_criteria_enable = mlx5_match_outer_headers; + mlx5_set_to_ones(fte_match_param, spec->match_criteria, outer_headers.ethertype); + mlx5_set(fte_match_param, spec->match_value, outer_headers.ethertype, ether_type); +} + +struct mlx5_flow_handle * +mlx5e_fs_tt_redirect_any_add_rule(struct mlx5e_priv *priv, + u32 tir_num, u16 ether_type) +{ + struct mlx5_flow_destination dest = {}; + struct mlx5_flow_table *ft = null; + mlx5_declare_flow_act(flow_act); + struct mlx5_flow_handle *rule; + struct mlx5_flow_spec *spec; + struct mlx5e_fs_any *fs_any; + int err; + + spec = kvzalloc(sizeof(*spec), gfp_kernel); + if (!spec) + return err_ptr(-enomem); + + fs_any = priv->fs.any; + ft = fs_any->table.t; + + fs_any_set_ethertype_flow(spec, ether_type); + dest.type = mlx5_flow_destination_type_tir; + dest.tir_num = tir_num; + + rule = mlx5_add_flow_rules(ft, spec, &flow_act, &dest, 1); + kvfree(spec); + + if (is_err(rule)) { + err = ptr_err(rule); + netdev_err(priv->netdev, "%s: add any rule failed, err %d ", + __func__, err); + } + return rule; +} + +static int fs_any_add_default_rule(struct mlx5e_priv *priv) +{ + struct mlx5e_flow_table *fs_any_t; + struct mlx5_flow_destination dest; + mlx5_declare_flow_act(flow_act); + struct mlx5_flow_handle *rule; + struct mlx5e_fs_any *fs_any; + int err; + + fs_any = priv->fs.any; + fs_any_t = &fs_any->table; + + dest = mlx5e_ttc_get_default_dest(priv, mlx5e_tt_any); + rule = mlx5_add_flow_rules(fs_any_t->t, null, &flow_act, &dest, 1); + if (is_err(rule)) { + err = ptr_err(rule); + netdev_err(priv->netdev, + "%s: add default rule failed, fs type=any, err %d ", + __func__, err); + return err; + } + + fs_any->default_rule = rule; + return 0; +} + +#define mlx5e_fs_any_num_groups (2) +#define mlx5e_fs_any_group1_size (bit(16)) +#define mlx5e_fs_any_group2_size (bit(0)) +#define mlx5e_fs_any_table_size (mlx5e_fs_any_group1_size +\ + mlx5e_fs_any_group2_size) + +static int fs_any_create_groups(struct mlx5e_flow_table *ft) +{ + int inlen = mlx5_st_sz_bytes(create_flow_group_in); + void *outer_headers_c; + int ix = 0; + u32 *in; + int err; + u8 *mc; + + ft->g = kcalloc(mlx5e_fs_udp_num_groups, sizeof(*ft->g), gfp_kernel); + in = kvzalloc(inlen, gfp_kernel); + if (!in || !ft->g) { + kfree(ft->g); + kvfree(in); + return -enomem; + } + + /* match on ethertype */ + mc = mlx5_addr_of(create_flow_group_in, in, match_criteria); + outer_headers_c = mlx5_addr_of(fte_match_param, mc, outer_headers); + mlx5_set_to_ones(fte_match_set_lyr_2_4, outer_headers_c, ethertype); + mlx5_set_cfg(in, match_criteria_enable, mlx5_match_outer_headers); + mlx5_set_cfg(in, start_flow_index, ix); + ix += mlx5e_fs_any_group1_size; + mlx5_set_cfg(in, end_flow_index, ix - 1); + ft->g[ft->num_groups] = mlx5_create_flow_group(ft->t, in); + if (is_err(ft->g[ft->num_groups])) + goto err; + ft->num_groups++; + + /* default flow group */ + memset(in, 0, inlen); + mlx5_set_cfg(in, start_flow_index, ix); + ix += mlx5e_fs_any_group2_size; + mlx5_set_cfg(in, end_flow_index, ix - 1); + ft->g[ft->num_groups] = mlx5_create_flow_group(ft->t, in); + if (is_err(ft->g[ft->num_groups])) + goto err; + ft->num_groups++; + + kvfree(in); + return 0; + +err: + err = ptr_err(ft->g[ft->num_groups]); + ft->g[ft->num_groups] = null; + kvfree(in); + + return err; +} + +static int fs_any_create_table(struct mlx5e_priv *priv) +{ + struct mlx5e_flow_table *ft = &priv->fs.any->table; + struct mlx5_flow_table_attr ft_attr = {}; + int err; + + ft->num_groups = 0; + + ft_attr.max_fte = mlx5e_fs_udp_table_size; + ft_attr.level = mlx5e_fs_tt_any_ft_level; + ft_attr.prio = mlx5e_nic_prio; + + ft->t = mlx5_create_flow_table(priv->fs.ns, &ft_attr); + if (is_err(ft->t)) { + err = ptr_err(ft->t); + ft->t = null; + return err; + } + + netdev_dbg(priv->netdev, "created fs any table id %u level %u ", + ft->t->id, ft->t->level); + + err = fs_any_create_groups(ft); + if (err) + goto err; + + err = fs_any_add_default_rule(priv); + if (err) + goto err; + + return 0; + +err: + mlx5e_destroy_flow_table(ft); + return err; +} + +static int fs_any_disable(struct mlx5e_priv *priv) +{ + int err; + + /* modify ttc rules destination to point back to the indir tirs */ + err = mlx5e_ttc_fwd_default_dest(priv, mlx5e_tt_any); + if (err) { + netdev_err(priv->netdev, + "%s: modify ttc[%d] default destination failed, err(%d) ", + __func__, mlx5e_tt_any, err); + return err; + } + return 0; +} + +static int fs_any_enable(struct mlx5e_priv *priv) +{ + struct mlx5_flow_destination dest = {}; + int err; + + dest.type = mlx5_flow_destination_type_flow_table; + dest.ft = priv->fs.any->table.t; + + /* modify ttc rules destination to point on the accel_fs fts */ + err = mlx5e_ttc_fwd_dest(priv, mlx5e_tt_any, &dest); + if (err) { + netdev_err(priv->netdev, + "%s: modify ttc[%d] destination to accel failed, err(%d) ", + __func__, mlx5e_tt_any, err); + return err; + } + return 0; +} + +static void fs_any_destroy_table(struct mlx5e_fs_any *fs_any) +{ + if (is_err_or_null(fs_any->table.t)) + return; + + mlx5_del_flow_rules(fs_any->default_rule); + mlx5e_destroy_flow_table(&fs_any->table); + fs_any->table.t = null; +} + +void mlx5e_fs_tt_redirect_any_destroy(struct mlx5e_priv *priv) +{ + struct mlx5e_fs_any *fs_any = priv->fs.any; + + if (!fs_any) + return; + + if (--fs_any->ref_cnt) + return; + + fs_any_disable(priv); + + fs_any_destroy_table(fs_any); + + kfree(fs_any); + priv->fs.any = null; +} + +int mlx5e_fs_tt_redirect_any_create(struct mlx5e_priv *priv) +{ + int err; + + if (priv->fs.any) { + priv->fs.any->ref_cnt++; + return 0; + } + + priv->fs.any = kzalloc(sizeof(*priv->fs.any), gfp_kernel); + if (!priv->fs.any) + return -enomem; + + err = fs_any_create_table(priv); + if (err) + return err; + + err = fs_any_enable(priv); + if (err) + goto err_destroy_table; + + priv->fs.any->ref_cnt = 1; + + return 0; + +err_destroy_table: + fs_any_destroy_table(priv->fs.any); + + kfree(priv->fs.any); + priv->fs.any = null; + return err; +} diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.h --- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.h + +/* any traffic type redirect*/ +struct mlx5_flow_handle * +mlx5e_fs_tt_redirect_any_add_rule(struct mlx5e_priv *priv, + u32 tir_num, u16 ether_type); +void mlx5e_fs_tt_redirect_any_destroy(struct mlx5e_priv *priv); +int mlx5e_fs_tt_redirect_any_create(struct mlx5e_priv *priv); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c -/* promiscuous, vlan, mac, ttc, inner ttc, {udp/arfs/accel/{esp, esp_err}} */ +/* promiscuous, vlan, mac, ttc, inner ttc, {udp/any/arfs/accel/{esp, esp_err}} */
|
Networking
|
0f575c20bf0686caf3d82d6c626c2e1e4a4c36e6
|
aya levin tariq toukan tariqt nvidia com
|
drivers
|
net
|
core, en, ethernet, mellanox, mlx5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.