History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next

Pull networking updates from David Miller: 1) Add WireGuard 2) Add HE and TWT support to ath11k driver, from John Crispin. 3) Add ESP in TCP encapsulation support, from Sabrina Dubroca. 4) Add variable window congestion control to TIPC, from Jon Maloy. 5) Add BCM84881 PHY driver, from Russell King. 6) Start adding netlink support for ethtool operations, from Michal Kubecek. 7) Add XDP drop and TX action support to ena driver, from Sameeh Jubran. 8) Add new ipv4 route notifications so that mlxsw driver does not have to handle identical routes itself. From Ido Schimmel. 9) Add BPF dynamic program extensions, from Alexei Starovoitov. 10) Support RX and TX timestamping in igc, from Vinicius Costa Gomes. 11) Add support for macsec HW offloading, from Antoine Tenart. 12) Add initial support for MPTCP protocol, from Christoph Paasch, Matthieu Baerts, Florian Westphal, Peter Krystad, and many others. 13) Add Octeontx2 PF support, from Sunil Goutham, Geetha sowjanya, Linu Cherian, and others. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1469 commits) net: phy: add default ARCH_BCM_IPROC for MDIO_BCM_IPROC udp: segment looped gso packets correctly netem: change mailing list qed: FW 8.42.2.0 debug features qed: rt init valid initialization changed qed: Debug feature: ilt and mdump qed: FW 8.42.2.0 Add fw overlay feature qed: FW 8.42.2.0 HSI changes qed: FW 8.42.2.0 iscsi/fcoe changes qed: Add abstraction for different hsi values per chip qed: FW 8.42.2.0 Additional ll2 type qed: Use dmae to write to widebus registers in fw_funcs qed: FW 8.42.2.0 Parser offsets modified qed: FW 8.42.2.0 Queue Manager changes qed: FW 8.42.2.0 Expose new registers and change windows qed: FW 8.42.2.0 Internal ram offsets modifications MAINTAINERS: Add entry for Marvell OcteonTX2 Physical Function driver Documentation: net: octeontx2: Add RVU HW and drivers overview octeontx2-pf: ethtool RSS config support octeontx2-pf: Add basic ethtool support ...

Linus Torvalds committed 6 years ago

Commit bd2463a2 parents a78208e f76e4c11827 files · +157546 −32784Browse files

Showing the changes to include/linux (40 of 1827 files). Show all

Unified · Split

40 files
  1. include/linux/bitmap.h +4 −0
  2. include/linux/bpf-cgroup.h +3 −1
  3. include/linux/bpf.h +206 −8
  4. include/linux/bpf_types.h +9 −0
  5. include/linux/bpf_verifier.h +8 −2
  6. include/linux/btf.h +52 −0
  7. include/linux/dsa/sja1105.h +3 −3
  8. include/linux/etherdevice.h +0 −1
  9. include/linux/ethtool_netlink.h +17 −0
  10. include/linux/filter.h +34 −19
  11. include/linux/fsl/enetc_mdio.h +55 −0
  12. include/linux/fsl/ptp_qoriq.h +1 −0
  13. include/linux/mii.h +50 −0
  14. include/linux/mii_timestamper.h +121 −0
  15. include/linux/mlx4/device.h +1 −1
  16. include/linux/mlx5/device.h +22 −1
  17. include/linux/mlx5/driver.h +3 −3
  18. include/linux/mlx5/fs.h +12 −8
  19. include/linux/mlx5/mlx5_ifc.h +230 −7
  20. include/linux/mmc/sdio_ids.h +2 −0
  21. include/linux/net.h +1 −0
  22. include/linux/netdev_features.h +8 −1
  23. include/linux/netdevice.h +88 −26
  24. include/linux/phy.h +96 −27
  25. include/linux/phylink.h +2 −0
  26. include/linux/platform_data/eth_ixp4xx.h +19 −0
  27. include/linux/platform_data/wan_ixp4xx_hss.h +17 −0
  28. include/linux/ptp_clock_kernel.h +9 −0
  29. include/linux/ptr_ring.h +1 −0
  30. include/linux/qed/common_hsi.h +29 −15
  31. include/linux/qed/eth_common.h +56 −22
  32. include/linux/qed/iscsi_common.h +24 −40
  33. include/linux/qed/qed_if.h +13 −1
  34. include/linux/qed/qed_ll2_if.h +7 −0
  35. include/linux/qed/storage_common.h +2 −1
  36. include/linux/sfp.h +66 −29
  37. include/linux/skbuff.h +23 −3
  38. include/linux/stmmac.h +14 −0
  39. include/linux/tcp.h +37 −0
  40. include/linux/usb/usbnet.h +1 −1
include/linux/bitmap.h+4−0
@@ -53,6 +53,7 @@ · 52 unmodified lines
53 * bitmap_find_next_zero_area_off(buf, len, pos, n, mask) as above53 * bitmap_find_next_zero_area_off(buf, len, pos, n, mask) as above
54 * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n54 * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n
55 * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n55 * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n
56 * bitmap_cut(dst, src, first, n, nbits) Cut n bits from first, copy rest
56 * bitmap_replace(dst, old, new, mask, nbits) *dst = (*old & ~(*mask)) | (*new & *mask)57 * bitmap_replace(dst, old, new, mask, nbits) *dst = (*old & ~(*mask)) | (*new & *mask)
57 * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src)58 * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src)
58 * bitmap_bitremap(oldbit, old, new, nbits) newbit = map(old, new)(oldbit)59 * bitmap_bitremap(oldbit, old, new, nbits) newbit = map(old, new)(oldbit)
@@ -133,6 +134,9 @@ extern void __bitmap_shift_right(unsigned long *dst, const unsigned long *src, · 74 unmodified lines
133 unsigned int shift, unsigned int nbits);134 unsigned int shift, unsigned int nbits);
134extern void __bitmap_shift_left(unsigned long *dst, const unsigned long *src,135extern void __bitmap_shift_left(unsigned long *dst, const unsigned long *src,
135 unsigned int shift, unsigned int nbits);136 unsigned int shift, unsigned int nbits);
137extern void bitmap_cut(unsigned long *dst, const unsigned long *src,
138 unsigned int first, unsigned int cut,
139 unsigned int nbits);
136extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,140extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
137 const unsigned long *bitmap2, unsigned int nbits);141 const unsigned long *bitmap2, unsigned int nbits);
138extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,142extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
include/linux/bpf-cgroup.h+3−1
@@ -85,6 +85,7 @@ int cgroup_bpf_inherit(struct cgroup *cgrp); · 84 unmodified lines
85void cgroup_bpf_offline(struct cgroup *cgrp);85void cgroup_bpf_offline(struct cgroup *cgrp);
86 86
87int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,87int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,
88 struct bpf_prog *replace_prog,
88 enum bpf_attach_type type, u32 flags);89 enum bpf_attach_type type, u32 flags);
89int __cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog,90int __cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog,
90 enum bpf_attach_type type);91 enum bpf_attach_type type);
@@ -93,7 +94,8 @@ int __cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr, · 2 unmodified lines
93 94
94/* Wrapper for __cgroup_bpf_*() protected by cgroup_mutex */95/* Wrapper for __cgroup_bpf_*() protected by cgroup_mutex */
95int cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,96int cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,
96 enum bpf_attach_type type, u32 flags);97 struct bpf_prog *replace_prog, enum bpf_attach_type type,
98 u32 flags);
97int cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog,99int cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog,
98 enum bpf_attach_type type, u32 flags);100 enum bpf_attach_type type, u32 flags);
99int cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr,101int cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr,
include/linux/bpf.h+206−8
@@ -17,6 +17,7 @@ · 16 unmodified lines
17#include <linux/u64_stats_sync.h>17#include <linux/u64_stats_sync.h>
18#include <linux/refcount.h>18#include <linux/refcount.h>
19#include <linux/mutex.h>19#include <linux/mutex.h>
20#include <linux/module.h>
20 21
21struct bpf_verifier_env;22struct bpf_verifier_env;
22struct bpf_verifier_log;23struct bpf_verifier_log;
@@ -43,6 +44,15 @@ struct bpf_map_ops { · 20 unmodified lines
43 int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key);44 int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key);
44 void (*map_release_uref)(struct bpf_map *map);45 void (*map_release_uref)(struct bpf_map *map);
45 void *(*map_lookup_elem_sys_only)(struct bpf_map *map, void *key);46 void *(*map_lookup_elem_sys_only)(struct bpf_map *map, void *key);
47 int (*map_lookup_batch)(struct bpf_map *map, const union bpf_attr *attr,
48 union bpf_attr __user *uattr);
49 int (*map_lookup_and_delete_batch)(struct bpf_map *map,
50 const union bpf_attr *attr,
51 union bpf_attr __user *uattr);
52 int (*map_update_batch)(struct bpf_map *map, const union bpf_attr *attr,
53 union bpf_attr __user *uattr);
54 int (*map_delete_batch)(struct bpf_map *map, const union bpf_attr *attr,
55 union bpf_attr __user *uattr);
46 56
47 /* funcs callable from userspace and from eBPF programs */57 /* funcs callable from userspace and from eBPF programs */
48 void *(*map_lookup_elem)(struct bpf_map *map, void *key);58 void *(*map_lookup_elem)(struct bpf_map *map, void *key);
@@ -106,6 +116,7 @@ struct bpf_map { · 57 unmodified lines
106 struct btf *btf;116 struct btf *btf;
107 struct bpf_map_memory memory;117 struct bpf_map_memory memory;
108 char name[BPF_OBJ_NAME_LEN];118 char name[BPF_OBJ_NAME_LEN];
119 u32 btf_vmlinux_value_type_id;
109 bool unpriv_array;120 bool unpriv_array;
110 bool frozen; /* write-once; write-protected by freeze_mutex */121 bool frozen; /* write-once; write-protected by freeze_mutex */
111 /* 22 bytes hole */122 /* 22 bytes hole */
@@ -183,7 +194,8 @@ static inline bool bpf_map_offload_neutral(const struct bpf_map *map) · 71 unmodified lines
183 194
184static inline bool bpf_map_support_seq_show(const struct bpf_map *map)195static inline bool bpf_map_support_seq_show(const struct bpf_map *map)
185{196{
186 return map->btf && map->ops->map_seq_show_elem;197 return (map->btf_value_type_id || map->btf_vmlinux_value_type_id) &&
198 map->ops->map_seq_show_elem;
187}199}
188 200
189int map_check_no_btf(const struct bpf_map *map,201int map_check_no_btf(const struct bpf_map *map,
@@ -349,6 +361,10 @@ struct bpf_verifier_ops { · 159 unmodified lines
349 const struct bpf_insn *src,361 const struct bpf_insn *src,
350 struct bpf_insn *dst,362 struct bpf_insn *dst,
351 struct bpf_prog *prog, u32 *target_size);363 struct bpf_prog *prog, u32 *target_size);
364 int (*btf_struct_access)(struct bpf_verifier_log *log,
365 const struct btf_type *t, int off, int size,
366 enum bpf_access_type atype,
367 u32 *next_btf_id);
352};368};
353 369
354struct bpf_prog_offload_ops {370struct bpf_prog_offload_ops {
@@ -437,7 +453,8 @@ struct btf_func_model { · 82 unmodified lines
437 * fentry = a set of program to run before calling original function453 * fentry = a set of program to run before calling original function
438 * fexit = a set of program to run after original function454 * fexit = a set of program to run after original function
439 */455 */
440int arch_prepare_bpf_trampoline(void *image, struct btf_func_model *m, u32 flags,456int arch_prepare_bpf_trampoline(void *image, void *image_end,
457 const struct btf_func_model *m, u32 flags,
441 struct bpf_prog **fentry_progs, int fentry_cnt,458 struct bpf_prog **fentry_progs, int fentry_cnt,
442 struct bpf_prog **fexit_progs, int fexit_cnt,459 struct bpf_prog **fexit_progs, int fexit_cnt,
443 void *orig_call);460 void *orig_call);
@@ -448,7 +465,8 @@ void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start); · 4 unmodified lines
448enum bpf_tramp_prog_type {465enum bpf_tramp_prog_type {
449 BPF_TRAMP_FENTRY,466 BPF_TRAMP_FENTRY,
450 BPF_TRAMP_FEXIT,467 BPF_TRAMP_FEXIT,
451 BPF_TRAMP_MAX468 BPF_TRAMP_MAX,
469 BPF_TRAMP_REPLACE, /* more than MAX */
452};470};
453 471
454struct bpf_trampoline {472struct bpf_trampoline {
@@ -463,6 +481,11 @@ struct bpf_trampoline { · 8 unmodified lines
463 void *addr;481 void *addr;
464 bool ftrace_managed;482 bool ftrace_managed;
465 } func;483 } func;
484 /* if !NULL this is BPF_PROG_TYPE_EXT program that extends another BPF
485 * program by replacing one of its functions. func.addr is the address
486 * of the function it replaced.
487 */
488 struct bpf_prog *extension_prog;
466 /* list of BPF programs using this trampoline */489 /* list of BPF programs using this trampoline */
467 struct hlist_head progs_hlist[BPF_TRAMP_MAX];490 struct hlist_head progs_hlist[BPF_TRAMP_MAX];
468 /* Number of attached programs. A counter per kind. */491 /* Number of attached programs. A counter per kind. */
@@ -471,11 +494,75 @@ struct bpf_trampoline { · 2 unmodified lines
471 void *image;494 void *image;
472 u64 selector;495 u64 selector;
473};496};
497
498#define BPF_DISPATCHER_MAX 48 /* Fits in 2048B */
499
500struct bpf_dispatcher_prog {
501 struct bpf_prog *prog;
502 refcount_t users;
503};
504
505struct bpf_dispatcher {
506 /* dispatcher mutex */
507 struct mutex mutex;
508 void *func;
509 struct bpf_dispatcher_prog progs[BPF_DISPATCHER_MAX];
510 int num_progs;
511 void *image;
512 u32 image_off;
513};
514
515static __always_inline unsigned int bpf_dispatcher_nopfunc(
516 const void *ctx,
517 const struct bpf_insn *insnsi,
518 unsigned int (*bpf_func)(const void *,
519 const struct bpf_insn *))
520{
521 return bpf_func(ctx, insnsi);
522}
474#ifdef CONFIG_BPF_JIT523#ifdef CONFIG_BPF_JIT
475struct bpf_trampoline *bpf_trampoline_lookup(u64 key);524struct bpf_trampoline *bpf_trampoline_lookup(u64 key);
476int bpf_trampoline_link_prog(struct bpf_prog *prog);525int bpf_trampoline_link_prog(struct bpf_prog *prog);
477int bpf_trampoline_unlink_prog(struct bpf_prog *prog);526int bpf_trampoline_unlink_prog(struct bpf_prog *prog);
478void bpf_trampoline_put(struct bpf_trampoline *tr);527void bpf_trampoline_put(struct bpf_trampoline *tr);
528#define BPF_DISPATCHER_INIT(name) { \
529 .mutex = __MUTEX_INITIALIZER(name.mutex), \
530 .func = &name##func, \
531 .progs = {}, \
532 .num_progs = 0, \
533 .image = NULL, \
534 .image_off = 0 \
535}
536
537#define DEFINE_BPF_DISPATCHER(name) \
538 noinline unsigned int name##func( \
539 const void *ctx, \
540 const struct bpf_insn *insnsi, \
541 unsigned int (*bpf_func)(const void *, \
542 const struct bpf_insn *)) \
543 { \
544 return bpf_func(ctx, insnsi); \
545 } \
546 EXPORT_SYMBOL(name##func); \
547 struct bpf_dispatcher name = BPF_DISPATCHER_INIT(name);
548#define DECLARE_BPF_DISPATCHER(name) \
549 unsigned int name##func( \
550 const void *ctx, \
551 const struct bpf_insn *insnsi, \
552 unsigned int (*bpf_func)(const void *, \
553 const struct bpf_insn *)); \
554 extern struct bpf_dispatcher name;
555#define BPF_DISPATCHER_FUNC(name) name##func
556#define BPF_DISPATCHER_PTR(name) (&name)
557void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from,
558 struct bpf_prog *to);
559struct bpf_image {
560 struct latch_tree_node tnode;
561 unsigned char data[];
562};
563#define BPF_IMAGE_SIZE (PAGE_SIZE - sizeof(struct bpf_image))
564bool is_bpf_image_address(unsigned long address);
565void *bpf_image_alloc(void);
479#else566#else
480static inline struct bpf_trampoline *bpf_trampoline_lookup(u64 key)567static inline struct bpf_trampoline *bpf_trampoline_lookup(u64 key)
481{568{
@@ -490,9 +577,21 @@ static inline int bpf_trampoline_unlink_prog(struct bpf_prog *prog) · 8 unmodified lines
490 return -ENOTSUPP;577 return -ENOTSUPP;
491}578}
492static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {}579static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {}
580#define DEFINE_BPF_DISPATCHER(name)
581#define DECLARE_BPF_DISPATCHER(name)
582#define BPF_DISPATCHER_FUNC(name) bpf_dispatcher_nopfunc
583#define BPF_DISPATCHER_PTR(name) NULL
584static inline void bpf_dispatcher_change_prog(struct bpf_dispatcher *d,
585 struct bpf_prog *from,
586 struct bpf_prog *to) {}
587static inline bool is_bpf_image_address(unsigned long address)
588{
589 return false;
590}
493#endif591#endif
494 592
495struct bpf_func_info_aux {593struct bpf_func_info_aux {
594 u16 linkage;
496 bool unreliable;595 bool unreliable;
497};596};
498 597
@@ -603,6 +702,73 @@ struct bpf_array_aux { · 104 unmodified lines
603 struct work_struct work;702 struct work_struct work;
604};703};
605 704
705struct bpf_struct_ops_value;
706struct btf_type;
707struct btf_member;
708
709#define BPF_STRUCT_OPS_MAX_NR_MEMBERS 64
710struct bpf_struct_ops {
711 const struct bpf_verifier_ops *verifier_ops;
712 int (*init)(struct btf *btf);
713 int (*check_member)(const struct btf_type *t,
714 const struct btf_member *member);
715 int (*init_member)(const struct btf_type *t,
716 const struct btf_member *member,
717 void *kdata, const void *udata);
718 int (*reg)(void *kdata);
719 void (*unreg)(void *kdata);
720 const struct btf_type *type;
721 const struct btf_type *value_type;
722 const char *name;
723 struct btf_func_model func_models[BPF_STRUCT_OPS_MAX_NR_MEMBERS];
724 u32 type_id;
725 u32 value_id;
726};
727
728#if defined(CONFIG_BPF_JIT) && defined(CONFIG_BPF_SYSCALL)
729#define BPF_MODULE_OWNER ((void *)((0xeB9FUL << 2) + POISON_POINTER_DELTA))
730const struct bpf_struct_ops *bpf_struct_ops_find(u32 type_id);
731void bpf_struct_ops_init(struct btf *btf);
732bool bpf_struct_ops_get(const void *kdata);
733void bpf_struct_ops_put(const void *kdata);
734int bpf_struct_ops_map_sys_lookup_elem(struct bpf_map *map, void *key,
735 void *value);
736static inline bool bpf_try_module_get(const void *data, struct module *owner)
737{
738 if (owner == BPF_MODULE_OWNER)
739 return bpf_struct_ops_get(data);
740 else
741 return try_module_get(owner);
742}
743static inline void bpf_module_put(const void *data, struct module *owner)
744{
745 if (owner == BPF_MODULE_OWNER)
746 bpf_struct_ops_put(data);
747 else
748 module_put(owner);
749}
750#else
751static inline const struct bpf_struct_ops *bpf_struct_ops_find(u32 type_id)
752{
753 return NULL;
754}
755static inline void bpf_struct_ops_init(struct btf *btf) { }
756static inline bool bpf_try_module_get(const void *data, struct module *owner)
757{
758 return try_module_get(owner);
759}
760static inline void bpf_module_put(const void *data, struct module *owner)
761{
762 module_put(owner);
763}
764static inline int bpf_struct_ops_map_sys_lookup_elem(struct bpf_map *map,
765 void *key,
766 void *value)
767{
768 return -EINVAL;
769}
770#endif
771
606struct bpf_array {772struct bpf_array {
607 struct bpf_map map;773 struct bpf_map map;
608 u32 elem_size;774 u32 elem_size;
@@ -841,6 +1007,15 @@ void *bpf_map_area_alloc(u64 size, int numa_node); · 232 unmodified lines
841void *bpf_map_area_mmapable_alloc(u64 size, int numa_node);1007void *bpf_map_area_mmapable_alloc(u64 size, int numa_node);
842void bpf_map_area_free(void *base);1008void bpf_map_area_free(void *base);
843void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr);1009void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr);
1010int generic_map_lookup_batch(struct bpf_map *map,
1011 const union bpf_attr *attr,
1012 union bpf_attr __user *uattr);
1013int generic_map_update_batch(struct bpf_map *map,
1014 const union bpf_attr *attr,
1015 union bpf_attr __user *uattr);
1016int generic_map_delete_batch(struct bpf_map *map,
1017 const union bpf_attr *attr,
1018 union bpf_attr __user *uattr);
844 1019
845extern int sysctl_unprivileged_bpf_disabled;1020extern int sysctl_unprivileged_bpf_disabled;
846 1021
@@ -897,14 +1072,16 @@ struct sk_buff; · 50 unmodified lines
897 1072
898struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key);1073struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key);
899struct bpf_dtab_netdev *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key);1074struct bpf_dtab_netdev *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key);
900void __dev_map_flush(struct bpf_map *map);1075void __dev_flush(void);
1076int dev_xdp_enqueue(struct net_device *dev, struct xdp_buff *xdp,
1077 struct net_device *dev_rx);
901int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,1078int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
902 struct net_device *dev_rx);1079 struct net_device *dev_rx);
903int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb,1080int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb,
904 struct bpf_prog *xdp_prog);1081 struct bpf_prog *xdp_prog);
905 1082
906struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key);1083struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key);
907void __cpu_map_flush(struct bpf_map *map);1084void __cpu_map_flush(void);
908int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp,1085int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp,
909 struct net_device *dev_rx);1086 struct net_device *dev_rx);
910 1087
@@ -941,7 +1118,15 @@ int btf_distill_func_proto(struct bpf_verifier_log *log, · 30 unmodified lines
941 const char *func_name,1118 const char *func_name,
942 struct btf_func_model *m);1119 struct btf_func_model *m);
943 1120
944int btf_check_func_arg_match(struct bpf_verifier_env *env, int subprog);1121struct bpf_reg_state;
1122int btf_check_func_arg_match(struct bpf_verifier_env *env, int subprog,
1123 struct bpf_reg_state *regs);
1124int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog,
1125 struct bpf_reg_state *reg);
1126int btf_check_type_match(struct bpf_verifier_env *env, struct bpf_prog *prog,
1127 struct btf *btf, const struct btf_type *t);
1128
1129struct bpf_prog *bpf_prog_by_id(u32 id);
945 1130
946#else /* !CONFIG_BPF_SYSCALL */1131#else /* !CONFIG_BPF_SYSCALL */
947static inline struct bpf_prog *bpf_prog_get(u32 ufd)1132static inline struct bpf_prog *bpf_prog_get(u32 ufd)
@@ -1004,13 +1189,20 @@ static inline struct net_device *__dev_map_hash_lookup_elem(struct bpf_map *map · 56 unmodified lines
1004 return NULL;1189 return NULL;
1005}1190}
1006 1191
1007static inline void __dev_map_flush(struct bpf_map *map)1192static inline void __dev_flush(void)
1008{1193{
1009}1194}
1010 1195
1011struct xdp_buff;1196struct xdp_buff;
1012struct bpf_dtab_netdev;1197struct bpf_dtab_netdev;
1013 1198
1199static inline
1200int dev_xdp_enqueue(struct net_device *dev, struct xdp_buff *xdp,
1201 struct net_device *dev_rx)
1202{
1203 return 0;
1204}
1205
1014static inline1206static inline
1015int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,1207int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
1016 struct net_device *dev_rx)1208 struct net_device *dev_rx)
@@ -1033,7 +1225,7 @@ struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key) · 16 unmodified lines
1033 return NULL;1225 return NULL;
1034}1226}
1035 1227
1036static inline void __cpu_map_flush(struct bpf_map *map)1228static inline void __cpu_map_flush(void)
1037{1229{
1038}1230}
1039 1231
@@ -1074,6 +1266,11 @@ static inline int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog, · 34 unmodified lines
1074static inline void bpf_map_put(struct bpf_map *map)1266static inline void bpf_map_put(struct bpf_map *map)
1075{1267{
1076}1268}
1269
1270static inline struct bpf_prog *bpf_prog_by_id(u32 id)
1271{
1272 return ERR_PTR(-ENOTSUPP);
1273}
1077#endif /* CONFIG_BPF_SYSCALL */1274#endif /* CONFIG_BPF_SYSCALL */
1078 1275
1079static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,1276static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,
@@ -1227,6 +1424,7 @@ extern const struct bpf_func_proto bpf_get_local_storage_proto; · 147 unmodified lines
1227extern const struct bpf_func_proto bpf_strtol_proto;1424extern const struct bpf_func_proto bpf_strtol_proto;
1228extern const struct bpf_func_proto bpf_strtoul_proto;1425extern const struct bpf_func_proto bpf_strtoul_proto;
1229extern const struct bpf_func_proto bpf_tcp_sock_proto;1426extern const struct bpf_func_proto bpf_tcp_sock_proto;
1427extern const struct bpf_func_proto bpf_jiffies64_proto;
1230 1428
1231/* Shared helpers among cBPF and eBPF. */1429/* Shared helpers among cBPF and eBPF. */
1232void bpf_user_rnd_init_once(void);1430void bpf_user_rnd_init_once(void);
include/linux/bpf_types.h+9−0
@@ -65,6 +65,12 @@ BPF_PROG_TYPE(BPF_PROG_TYPE_LIRC_MODE2, lirc_mode2, · 64 unmodified lines
65BPF_PROG_TYPE(BPF_PROG_TYPE_SK_REUSEPORT, sk_reuseport,65BPF_PROG_TYPE(BPF_PROG_TYPE_SK_REUSEPORT, sk_reuseport,
66 struct sk_reuseport_md, struct sk_reuseport_kern)66 struct sk_reuseport_md, struct sk_reuseport_kern)
67#endif67#endif
68#if defined(CONFIG_BPF_JIT)
69BPF_PROG_TYPE(BPF_PROG_TYPE_STRUCT_OPS, bpf_struct_ops,
70 void *, void *)
71BPF_PROG_TYPE(BPF_PROG_TYPE_EXT, bpf_extension,
72 void *, void *)
73#endif
68 74
69BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops)75BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops)
70BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops)76BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops)
@@ -105,3 +111,6 @@ BPF_MAP_TYPE(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, reuseport_array_ops) · 34 unmodified lines
105#endif111#endif
106BPF_MAP_TYPE(BPF_MAP_TYPE_QUEUE, queue_map_ops)112BPF_MAP_TYPE(BPF_MAP_TYPE_QUEUE, queue_map_ops)
107BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops)113BPF_MAP_TYPE(BPF_MAP_TYPE_STACK, stack_map_ops)
114#if defined(CONFIG_BPF_JIT)
115BPF_MAP_TYPE(BPF_MAP_TYPE_STRUCT_OPS, bpf_struct_ops_map_ops)
116#endif
include/linux/bpf_verifier.h+8−2
@@ -304,11 +304,13 @@ struct bpf_insn_aux_data { · 303 unmodified lines
304 u64 map_key_state; /* constant (32 bit) key tracking for maps */304 u64 map_key_state; /* constant (32 bit) key tracking for maps */
305 int ctx_field_size; /* the ctx field size for load insn, maybe 0 */305 int ctx_field_size; /* the ctx field size for load insn, maybe 0 */
306 int sanitize_stack_off; /* stack slot to be cleared */306 int sanitize_stack_off; /* stack slot to be cleared */
307 bool seen; /* this insn was processed by the verifier */307 u32 seen; /* this insn was processed by the verifier at env->pass_cnt */
308 bool zext_dst; /* this insn zero extends dst reg */308 bool zext_dst; /* this insn zero extends dst reg */
309 u8 alu_state; /* used in combination with alu_limit */309 u8 alu_state; /* used in combination with alu_limit */
310 bool prune_point;310
311 /* below fields are initialized once */
311 unsigned int orig_idx; /* original instruction index */312 unsigned int orig_idx; /* original instruction index */
313 bool prune_point;
312};314};
313 315
314#define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */316#define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */
@@ -379,6 +381,7 @@ struct bpf_verifier_env { · 64 unmodified lines
379 int *insn_stack;381 int *insn_stack;
380 int cur_stack;382 int cur_stack;
381 } cfg;383 } cfg;
384 u32 pass_cnt; /* number of times do_check() was called */
382 u32 subprog_cnt;385 u32 subprog_cnt;
383 /* number of instructions analyzed by the verifier */386 /* number of instructions analyzed by the verifier */
384 u32 prev_insn_processed, insn_processed;387 u32 prev_insn_processed, insn_processed;
@@ -428,4 +431,7 @@ bpf_prog_offload_replace_insn(struct bpf_verifier_env *env, u32 off, · 43 unmodified lines
428void431void
429bpf_prog_offload_remove_insns(struct bpf_verifier_env *env, u32 off, u32 cnt);432bpf_prog_offload_remove_insns(struct bpf_verifier_env *env, u32 off, u32 cnt);
430 433
434int check_ctx_reg(struct bpf_verifier_env *env,
435 const struct bpf_reg_state *reg, int regno);
436
431#endif /* _LINUX_BPF_VERIFIER_H */437#endif /* _LINUX_BPF_VERIFIER_H */
include/linux/btf.h+52−0
@@ -7,6 +7,8 @@ · 6 unmodified lines
7#include <linux/types.h>7#include <linux/types.h>
8#include <uapi/linux/btf.h>8#include <uapi/linux/btf.h>
9 9
10#define BTF_TYPE_EMIT(type) ((void)(type *)0)
11
10struct btf;12struct btf;
11struct btf_member;13struct btf_member;
12struct btf_type;14struct btf_type;
@@ -53,6 +55,22 @@ bool btf_member_is_reg_int(const struct btf *btf, const struct btf_type *s, · 40 unmodified lines
53 u32 expected_offset, u32 expected_size);55 u32 expected_offset, u32 expected_size);
54int btf_find_spin_lock(const struct btf *btf, const struct btf_type *t);56int btf_find_spin_lock(const struct btf *btf, const struct btf_type *t);
55bool btf_type_is_void(const struct btf_type *t);57bool btf_type_is_void(const struct btf_type *t);
58s32 btf_find_by_name_kind(const struct btf *btf, const char *name, u8 kind);
59const struct btf_type *btf_type_skip_modifiers(const struct btf *btf,
60 u32 id, u32 *res_id);
61const struct btf_type *btf_type_resolve_ptr(const struct btf *btf,
62 u32 id, u32 *res_id);
63const struct btf_type *btf_type_resolve_func_ptr(const struct btf *btf,
64 u32 id, u32 *res_id);
65const struct btf_type *
66btf_resolve_size(const struct btf *btf, const struct btf_type *type,
67 u32 *type_size, const struct btf_type **elem_type,
68 u32 *total_nelems);
69
70#define for_each_member(i, struct_type, member) \
71 for (i = 0, member = btf_type_member(struct_type); \
72 i < btf_type_vlen(struct_type); \
73 i++, member++)
56 74
57static inline bool btf_type_is_ptr(const struct btf_type *t)75static inline bool btf_type_is_ptr(const struct btf_type *t)
58{76{
@@ -84,6 +102,40 @@ static inline bool btf_type_is_func_proto(const struct btf_type *t) · 25 unmodified lines
84 return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC_PROTO;102 return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC_PROTO;
85}103}
86 104
105static inline u16 btf_type_vlen(const struct btf_type *t)
106{
107 return BTF_INFO_VLEN(t->info);
108}
109
110static inline u16 btf_func_linkage(const struct btf_type *t)
111{
112 return BTF_INFO_VLEN(t->info);
113}
114
115static inline bool btf_type_kflag(const struct btf_type *t)
116{
117 return BTF_INFO_KFLAG(t->info);
118}
119
120static inline u32 btf_member_bit_offset(const struct btf_type *struct_type,
121 const struct btf_member *member)
122{
123 return btf_type_kflag(struct_type) ? BTF_MEMBER_BIT_OFFSET(member->offset)
124 : member->offset;
125}
126
127static inline u32 btf_member_bitfield_size(const struct btf_type *struct_type,
128 const struct btf_member *member)
129{
130 return btf_type_kflag(struct_type) ? BTF_MEMBER_BITFIELD_SIZE(member->offset)
131 : 0;
132}
133
134static inline const struct btf_member *btf_type_member(const struct btf_type *t)
135{
136 return (const struct btf_member *)(t + 1);
137}
138
87#ifdef CONFIG_BPF_SYSCALL139#ifdef CONFIG_BPF_SYSCALL
88const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id);140const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id);
89const char *btf_name_by_offset(const struct btf *btf, u32 offset);141const char *btf_name_by_offset(const struct btf *btf, u32 offset);
include/linux/dsa/sja1105.h+3−3
@@ -37,8 +37,6 @@ · 36 unmodified lines
37 * the structure defined in struct sja1105_private.37 * the structure defined in struct sja1105_private.
38 */38 */
39struct sja1105_tagger_data {39struct sja1105_tagger_data {
40 struct sk_buff_head skb_rxtstamp_queue;
41 struct work_struct rxtstamp_work;
42 struct sk_buff *stampable_skb;40 struct sk_buff *stampable_skb;
43 /* Protects concurrent access to the meta state machine41 /* Protects concurrent access to the meta state machine
44 * from taggers running on multiple ports on SMP systems42 * from taggers running on multiple ports on SMP systems
@@ -55,10 +53,12 @@ struct sja1105_skb_cb { · 10 unmodified lines
55 ((struct sja1105_skb_cb *)DSA_SKB_CB_PRIV(skb))53 ((struct sja1105_skb_cb *)DSA_SKB_CB_PRIV(skb))
56 54
57struct sja1105_port {55struct sja1105_port {
56 struct kthread_worker *xmit_worker;
57 struct kthread_work xmit_work;
58 struct sk_buff_head xmit_queue;
58 struct sja1105_tagger_data *data;59 struct sja1105_tagger_data *data;
59 struct dsa_port *dp;60 struct dsa_port *dp;
60 bool hwts_tx_en;61 bool hwts_tx_en;
61 int mgmt_slot;
62};62};
63 63
64#endif /* _NET_DSA_SJA1105_H */64#endif /* _NET_DSA_SJA1105_H */
include/linux/etherdevice.h+0−1
@@ -43,7 +43,6 @@ __be16 eth_header_parse_protocol(const struct sk_buff *skb); · 42 unmodified lines
43int eth_prepare_mac_addr_change(struct net_device *dev, void *p);43int eth_prepare_mac_addr_change(struct net_device *dev, void *p);
44void eth_commit_mac_addr_change(struct net_device *dev, void *p);44void eth_commit_mac_addr_change(struct net_device *dev, void *p);
45int eth_mac_addr(struct net_device *dev, void *p);45int eth_mac_addr(struct net_device *dev, void *p);
46int eth_change_mtu(struct net_device *dev, int new_mtu);
47int eth_validate_addr(struct net_device *dev);46int eth_validate_addr(struct net_device *dev);
48 47
49struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,48struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
include/linux/ethtool_netlink.h+17−0
@@ -0,0 +1,17 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3#ifndef _LINUX_ETHTOOL_NETLINK_H_
4#define _LINUX_ETHTOOL_NETLINK_H_
5
6#include <uapi/linux/ethtool_netlink.h>
7#include <linux/ethtool.h>
8#include <linux/netdevice.h>
9
10#define __ETHTOOL_LINK_MODE_MASK_NWORDS \
11 DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
12
13enum ethtool_multicast_groups {
14 ETHNL_MCGRP_MONITOR,
15};
16
17#endif /* _LINUX_ETHTOOL_NETLINK_H_ */
include/linux/filter.h+34−19
@@ -559,23 +559,26 @@ struct sk_filter { · 558 unmodified lines
559 559
560DECLARE_STATIC_KEY_FALSE(bpf_stats_enabled_key);560DECLARE_STATIC_KEY_FALSE(bpf_stats_enabled_key);
561 561
562#define BPF_PROG_RUN(prog, ctx) ({ \562#define __BPF_PROG_RUN(prog, ctx, dfunc) ({ \
563 u32 ret; \563 u32 ret; \
564 cant_sleep(); \564 cant_sleep(); \
565 if (static_branch_unlikely(&bpf_stats_enabled_key)) { \565 if (static_branch_unlikely(&bpf_stats_enabled_key)) { \
566 struct bpf_prog_stats *stats; \566 struct bpf_prog_stats *stats; \
567 u64 start = sched_clock(); \567 u64 start = sched_clock(); \
568 ret = (*(prog)->bpf_func)(ctx, (prog)->insnsi); \568 ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \
569 stats = this_cpu_ptr(prog->aux->stats); \569 stats = this_cpu_ptr(prog->aux->stats); \
570 u64_stats_update_begin(&stats->syncp); \570 u64_stats_update_begin(&stats->syncp); \
571 stats->cnt++; \571 stats->cnt++; \
572 stats->nsecs += sched_clock() - start; \572 stats->nsecs += sched_clock() - start; \
573 u64_stats_update_end(&stats->syncp); \573 u64_stats_update_end(&stats->syncp); \
574 } else { \574 } else { \
575 ret = (*(prog)->bpf_func)(ctx, (prog)->insnsi); \575 ret = dfunc(ctx, (prog)->insnsi, (prog)->bpf_func); \
576 } \576 } \
577 ret; })577 ret; })
578 578
579#define BPF_PROG_RUN(prog, ctx) __BPF_PROG_RUN(prog, ctx, \
580 bpf_dispatcher_nopfunc)
581
579#define BPF_SKB_CB_LEN QDISC_CB_PRIV_LEN582#define BPF_SKB_CB_LEN QDISC_CB_PRIV_LEN
580 583
581struct bpf_skb_data_end {584struct bpf_skb_data_end {
@@ -589,7 +592,6 @@ struct bpf_redirect_info { · 7 unmodified lines
589 u32 tgt_index;592 u32 tgt_index;
590 void *tgt_value;593 void *tgt_value;
591 struct bpf_map *map;594 struct bpf_map *map;
592 struct bpf_map *map_to_flush;
593 u32 kern_flags;595 u32 kern_flags;
594};596};
595 597
@@ -699,6 +701,8 @@ static inline u32 bpf_prog_run_clear_cb(const struct bpf_prog *prog, · 103 unmodified lines
699 return res;701 return res;
700}702}
701 703
704DECLARE_BPF_DISPATCHER(bpf_dispatcher_xdp)
705
702static __always_inline u32 bpf_prog_run_xdp(const struct bpf_prog *prog,706static __always_inline u32 bpf_prog_run_xdp(const struct bpf_prog *prog,
703 struct xdp_buff *xdp)707 struct xdp_buff *xdp)
704{708{
@@ -708,9 +712,12 @@ static __always_inline u32 bpf_prog_run_xdp(const struct bpf_prog *prog, · 3 unmodified lines
708 * already takes rcu_read_lock() when fetching the program, so712 * already takes rcu_read_lock() when fetching the program, so
709 * it's not necessary here anymore.713 * it's not necessary here anymore.
710 */714 */
711 return BPF_PROG_RUN(prog, xdp);715 return __BPF_PROG_RUN(prog, xdp,
716 BPF_DISPATCHER_FUNC(bpf_dispatcher_xdp));
712}717}
713 718
719void bpf_prog_change_xdp(struct bpf_prog *prev_prog, struct bpf_prog *prog);
720
714static inline u32 bpf_prog_insn_size(const struct bpf_prog *prog)721static inline u32 bpf_prog_insn_size(const struct bpf_prog *prog)
715{722{
716 return prog->len * sizeof(struct bpf_insn);723 return prog->len * sizeof(struct bpf_insn);
@@ -836,6 +843,8 @@ int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog); · 119 unmodified lines
836int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog,843int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog,
837 bpf_aux_classic_check_t trans, bool save_orig);844 bpf_aux_classic_check_t trans, bool save_orig);
838void bpf_prog_destroy(struct bpf_prog *fp);845void bpf_prog_destroy(struct bpf_prog *fp);
846const struct bpf_func_proto *
847bpf_base_func_proto(enum bpf_func_id func_id);
839 848
840int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);849int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
841int sk_attach_bpf(u32 ufd, struct sock *sk);850int sk_attach_bpf(u32 ufd, struct sock *sk);
@@ -909,7 +918,7 @@ static inline int xdp_ok_fwd_dev(const struct net_device *fwd, · 67 unmodified lines
909 return 0;918 return 0;
910}919}
911 920
912/* The pair of xdp_do_redirect and xdp_do_flush_map MUST be called in the921/* The pair of xdp_do_redirect and xdp_do_flush MUST be called in the
913 * same cpu context. Further for best results no more than a single map922 * same cpu context. Further for best results no more than a single map
914 * for the do_redirect/do_flush pair should be used. This limitation is923 * for the do_redirect/do_flush pair should be used. This limitation is
915 * because we only track one map and force a flush when the map changes.924 * because we only track one map and force a flush when the map changes.
@@ -920,7 +929,13 @@ int xdp_do_generic_redirect(struct net_device *dev, struct sk_buff *skb, · 4 unmodified lines
920int xdp_do_redirect(struct net_device *dev,929int xdp_do_redirect(struct net_device *dev,
921 struct xdp_buff *xdp,930 struct xdp_buff *xdp,
922 struct bpf_prog *prog);931 struct bpf_prog *prog);
923void xdp_do_flush_map(void);932void xdp_do_flush(void);
933
934/* The xdp_do_flush_map() helper has been renamed to drop the _map suffix, as
935 * it is no longer only flushing maps. Keep this define for compatibility
936 * until all drivers are updated - do not use xdp_do_flush_map() in new code!
937 */
938#define xdp_do_flush_map xdp_do_flush
924 939
925void bpf_warn_invalid_xdp_action(u32 act);940void bpf_warn_invalid_xdp_action(u32 act);
926 941
include/linux/fsl/enetc_mdio.h+55−0
@@ -0,0 +1,55 @@
1/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
2/* Copyright 2019 NXP */
3
4#ifndef _FSL_ENETC_MDIO_H_
5#define _FSL_ENETC_MDIO_H_
6
7#include <linux/phy.h>
8
9/* PCS registers */
10#define ENETC_PCS_LINK_TIMER1 0x12
11#define ENETC_PCS_LINK_TIMER1_VAL 0x06a0
12#define ENETC_PCS_LINK_TIMER2 0x13
13#define ENETC_PCS_LINK_TIMER2_VAL 0x0003
14#define ENETC_PCS_IF_MODE 0x14
15#define ENETC_PCS_IF_MODE_SGMII_EN BIT(0)
16#define ENETC_PCS_IF_MODE_USE_SGMII_AN BIT(1)
17#define ENETC_PCS_IF_MODE_SGMII_SPEED(x) (((x) << 2) & GENMASK(3, 2))
18
19/* Not a mistake, the SerDes PLL needs to be set at 3.125 GHz by Reset
20 * Configuration Word (RCW, outside Linux control) for 2.5G SGMII mode. The PCS
21 * still thinks it's at gigabit.
22 */
23enum enetc_pcs_speed {
24 ENETC_PCS_SPEED_10 = 0,
25 ENETC_PCS_SPEED_100 = 1,
26 ENETC_PCS_SPEED_1000 = 2,
27 ENETC_PCS_SPEED_2500 = 2,
28};
29
30struct enetc_hw;
31
32struct enetc_mdio_priv {
33 struct enetc_hw *hw;
34 int mdio_base;
35};
36
37#if IS_REACHABLE(CONFIG_FSL_ENETC_MDIO)
38
39int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum);
40int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value);
41struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs);
42
43#else
44
45static inline int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
46{ return -EINVAL; }
47static inline int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum,
48 u16 value)
49{ return -EINVAL; }
50struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs)
51{ return ERR_PTR(-EINVAL); }
52
53#endif
54
55#endif
include/linux/fsl/ptp_qoriq.h+1−0
@@ -192,6 +192,7 @@ int ptp_qoriq_settime(struct ptp_clock_info *ptp, · 191 unmodified lines
192 const struct timespec64 *ts);192 const struct timespec64 *ts);
193int ptp_qoriq_enable(struct ptp_clock_info *ptp,193int ptp_qoriq_enable(struct ptp_clock_info *ptp,
194 struct ptp_clock_request *rq, int on);194 struct ptp_clock_request *rq, int on);
195int extts_clean_up(struct ptp_qoriq *ptp_qoriq, int index, bool update_event);
195#ifdef CONFIG_DEBUG_FS196#ifdef CONFIG_DEBUG_FS
196void ptp_qoriq_create_debugfs(struct ptp_qoriq *ptp_qoriq);197void ptp_qoriq_create_debugfs(struct ptp_qoriq *ptp_qoriq);
197void ptp_qoriq_remove_debugfs(struct ptp_qoriq *ptp_qoriq);198void ptp_qoriq_remove_debugfs(struct ptp_qoriq *ptp_qoriq);
include/linux/mii.h+50−0
@@ -372,6 +372,56 @@ static inline u32 mii_lpa_to_ethtool_lpa_x(u32 lpa) · 371 unmodified lines
372 return result | mii_adv_to_ethtool_adv_x(lpa);372 return result | mii_adv_to_ethtool_adv_x(lpa);
373}373}
374 374
375/**
376 * mii_lpa_mod_linkmode_adv_sgmii
377 * @lp_advertising: pointer to destination link mode.
378 * @lpa: value of the MII_LPA register
379 *
380 * A small helper function that translates MII_LPA bits to
381 * linkmode advertisement settings for SGMII.
382 * Leaves other bits unchanged.
383 */
384static inline void
385mii_lpa_mod_linkmode_lpa_sgmii(unsigned long *lp_advertising, u32 lpa)
386{
387 u32 speed_duplex = lpa & LPA_SGMII_DPX_SPD_MASK;
388
389 linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, lp_advertising,
390 speed_duplex == LPA_SGMII_1000HALF);
391
392 linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, lp_advertising,
393 speed_duplex == LPA_SGMII_1000FULL);
394
395 linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, lp_advertising,
396 speed_duplex == LPA_SGMII_100HALF);
397
398 linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, lp_advertising,
399 speed_duplex == LPA_SGMII_100FULL);
400
401 linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, lp_advertising,
402 speed_duplex == LPA_SGMII_10HALF);
403
404 linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, lp_advertising,
405 speed_duplex == LPA_SGMII_10FULL);
406}
407
408/**
409 * mii_lpa_to_linkmode_adv_sgmii
410 * @advertising: pointer to destination link mode.
411 * @lpa: value of the MII_LPA register
412 *
413 * A small helper function that translates MII_ADVERTISE bits
414 * to linkmode advertisement settings when in SGMII mode.
415 * Clears the old value of advertising.
416 */
417static inline void mii_lpa_to_linkmode_lpa_sgmii(unsigned long *lp_advertising,
418 u32 lpa)
419{
420 linkmode_zero(lp_advertising);
421
422 mii_lpa_mod_linkmode_lpa_sgmii(lp_advertising, lpa);
423}
424
375/**425/**
376 * mii_adv_mod_linkmode_adv_t426 * mii_adv_mod_linkmode_adv_t
377 * @advertising:pointer to destination link mode.427 * @advertising:pointer to destination link mode.
include/linux/mii_timestamper.h+121−0
@@ -0,0 +1,121 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Support for generic time stamping devices on MII buses.
4 * Copyright (C) 2018 Richard Cochran <richardcochran@gmail.com>
5 */
6#ifndef _LINUX_MII_TIMESTAMPER_H
7#define _LINUX_MII_TIMESTAMPER_H
8
9#include <linux/device.h>
10#include <linux/ethtool.h>
11#include <linux/skbuff.h>
12
13struct phy_device;
14
15/**
16 * struct mii_timestamper - Callback interface to MII time stamping devices.
17 *
18 * @rxtstamp: Requests a Rx timestamp for 'skb'. If the skb is accepted,
19 * the MII time stamping device promises to deliver it using
20 * netif_rx() as soon as a timestamp becomes available. One of
21 * the PTP_CLASS_ values is passed in 'type'. The function
22 * must return true if the skb is accepted for delivery.
23 *
24 * @txtstamp: Requests a Tx timestamp for 'skb'. The MII time stamping
25 * device promises to deliver it using skb_complete_tx_timestamp()
26 * as soon as a timestamp becomes available. One of the PTP_CLASS_
27 * values is passed in 'type'.
28 *
29 * @hwtstamp: Handles SIOCSHWTSTAMP ioctl for hardware time stamping.
30 *
31 * @link_state: Allows the device to respond to changes in the link
32 * state. The caller invokes this function while holding
33 * the phy_device mutex.
34 *
35 * @ts_info: Handles ethtool queries for hardware time stamping.
36 * @device: Remembers the device to which the instance belongs.
37 *
38 * Drivers for PHY time stamping devices should embed their
39 * mii_timestamper within a private structure, obtaining a reference
40 * to it using container_of().
41 *
42 * Drivers for non-PHY time stamping devices should return a pointer
43 * to a mii_timestamper from the probe_channel() callback of their
44 * mii_timestamping_ctrl interface.
45 */
46struct mii_timestamper {
47 bool (*rxtstamp)(struct mii_timestamper *mii_ts,
48 struct sk_buff *skb, int type);
49
50 void (*txtstamp)(struct mii_timestamper *mii_ts,
51 struct sk_buff *skb, int type);
52
53 int (*hwtstamp)(struct mii_timestamper *mii_ts,
54 struct ifreq *ifreq);
55
56 void (*link_state)(struct mii_timestamper *mii_ts,
57 struct phy_device *phydev);
58
59 int (*ts_info)(struct mii_timestamper *mii_ts,
60 struct ethtool_ts_info *ts_info);
61
62 struct device *device;
63};
64
65/**
66 * struct mii_timestamping_ctrl - MII time stamping controller interface.
67 *
68 * @probe_channel: Callback into the controller driver announcing the
69 * presence of the 'port' channel. The 'device' field
70 * had been passed to register_mii_tstamp_controller().
71 * The driver must return either a pointer to a valid
72 * MII timestamper instance or PTR_ERR.
73 *
74 * @release_channel: Releases an instance obtained via .probe_channel.
75 */
76struct mii_timestamping_ctrl {
77 struct mii_timestamper *(*probe_channel)(struct device *device,
78 unsigned int port);
79 void (*release_channel)(struct device *device,
80 struct mii_timestamper *mii_ts);
81};
82
83#ifdef CONFIG_NETWORK_PHY_TIMESTAMPING
84
85int register_mii_tstamp_controller(struct device *device,
86 struct mii_timestamping_ctrl *ctrl);
87
88void unregister_mii_tstamp_controller(struct device *device);
89
90struct mii_timestamper *register_mii_timestamper(struct device_node *node,
91 unsigned int port);
92
93void unregister_mii_timestamper(struct mii_timestamper *mii_ts);
94
95#else
96
97static inline
98int register_mii_tstamp_controller(struct device *device,
99 struct mii_timestamping_ctrl *ctrl)
100{
101 return -EOPNOTSUPP;
102}
103
104static inline void unregister_mii_tstamp_controller(struct device *device)
105{
106}
107
108static inline
109struct mii_timestamper *register_mii_timestamper(struct device_node *node,
110 unsigned int port)
111{
112 return NULL;
113}
114
115static inline void unregister_mii_timestamper(struct mii_timestamper *mii_ts)
116{
117}
118
119#endif
120
121#endif
include/linux/mlx4/device.h+1−1
@@ -47,7 +47,7 @@ · 46 unmodified lines
47#define DEFAULT_UAR_PAGE_SHIFT 1247#define DEFAULT_UAR_PAGE_SHIFT 12
48 48
49#define MAX_MSIX_P_PORT 1749#define MAX_MSIX_P_PORT 17
50#define MAX_MSIX 6450#define MAX_MSIX 128
51#define MIN_MSIX_P_PORT 551#define MIN_MSIX_P_PORT 5
52#define MLX4_IS_LEGACY_EQ_MODE(dev_cap) ((dev_cap).num_comp_vectors < \52#define MLX4_IS_LEGACY_EQ_MODE(dev_cap) ((dev_cap).num_comp_vectors < \
53 (dev_cap).num_ports * MIN_MSIX_P_PORT)53 (dev_cap).num_ports * MIN_MSIX_P_PORT)
include/linux/mlx5/device.h+22−1
@@ -1105,6 +1105,7 @@ enum mlx5_cap_type { · 1104 unmodified lines
1105 MLX5_CAP_DEV_MEM,1105 MLX5_CAP_DEV_MEM,
1106 MLX5_CAP_RESERVED_16,1106 MLX5_CAP_RESERVED_16,
1107 MLX5_CAP_TLS,1107 MLX5_CAP_TLS,
1108 MLX5_CAP_VDPA_EMULATION = 0x13,
1108 MLX5_CAP_DEV_EVENT = 0x14,1109 MLX5_CAP_DEV_EVENT = 0x14,
1109 /* NUM OF CAP Types */1110 /* NUM OF CAP Types */
1110 MLX5_CAP_NUM1111 MLX5_CAP_NUM
@@ -1120,6 +1121,9 @@ enum mlx5_pcam_feature_groups { · 9 unmodified lines
1120 1121
1121enum mlx5_mcam_reg_groups {1122enum mlx5_mcam_reg_groups {
1122 MLX5_MCAM_REGS_FIRST_128 = 0x0,1123 MLX5_MCAM_REGS_FIRST_128 = 0x0,
1124 MLX5_MCAM_REGS_0x9080_0x90FF = 0x1,
1125 MLX5_MCAM_REGS_0x9100_0x917F = 0x2,
1126 MLX5_MCAM_REGS_NUM = 0x3,
1123};1127};
1124 1128
1125enum mlx5_mcam_feature_groups {1129enum mlx5_mcam_feature_groups {
@@ -1268,7 +1272,16 @@ enum mlx5_qcam_feature_groups { · 142 unmodified lines
1268 MLX5_GET(pcam_reg, (mdev)->caps.pcam, port_access_reg_cap_mask.regs_5000_to_507f.reg)1272 MLX5_GET(pcam_reg, (mdev)->caps.pcam, port_access_reg_cap_mask.regs_5000_to_507f.reg)
1269 1273
1270#define MLX5_CAP_MCAM_REG(mdev, reg) \1274#define MLX5_CAP_MCAM_REG(mdev, reg) \
1271 MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_access_reg_cap_mask.access_regs.reg)1275 MLX5_GET(mcam_reg, (mdev)->caps.mcam[MLX5_MCAM_REGS_FIRST_128], \
1276 mng_access_reg_cap_mask.access_regs.reg)
1277
1278#define MLX5_CAP_MCAM_REG1(mdev, reg) \
1279 MLX5_GET(mcam_reg, (mdev)->caps.mcam[MLX5_MCAM_REGS_0x9080_0x90FF], \
1280 mng_access_reg_cap_mask.access_regs1.reg)
1281
1282#define MLX5_CAP_MCAM_REG2(mdev, reg) \
1283 MLX5_GET(mcam_reg, (mdev)->caps.mcam[MLX5_MCAM_REGS_0x9100_0x917F], \
1284 mng_access_reg_cap_mask.access_regs2.reg)
1272 1285
1273#define MLX5_CAP_MCAM_FEATURE(mdev, fld) \1286#define MLX5_CAP_MCAM_FEATURE(mdev, fld) \
1274 MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_feature_cap_mask.enhanced_features.fld)1287 MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_feature_cap_mask.enhanced_features.fld)
@@ -1297,6 +1310,14 @@ enum mlx5_qcam_feature_groups { · 22 unmodified lines
1297#define MLX5_CAP_DEV_EVENT(mdev, cap)\1310#define MLX5_CAP_DEV_EVENT(mdev, cap)\
1298 MLX5_ADDR_OF(device_event_cap, (mdev)->caps.hca_cur[MLX5_CAP_DEV_EVENT], cap)1311 MLX5_ADDR_OF(device_event_cap, (mdev)->caps.hca_cur[MLX5_CAP_DEV_EVENT], cap)
1299 1312
1313#define MLX5_CAP_DEV_VDPA_EMULATION(mdev, cap)\
1314 MLX5_GET(device_virtio_emulation_cap, \
1315 (mdev)->caps.hca_cur[MLX5_CAP_VDPA_EMULATION], cap)
1316
1317#define MLX5_CAP64_DEV_VDPA_EMULATION(mdev, cap)\
1318 MLX5_GET64(device_virtio_emulation_cap, \
1319 (mdev)->caps.hca_cur[MLX5_CAP_VDPA_EMULATION], cap)
1320
1300enum {1321enum {
1301 MLX5_CMD_STAT_OK = 0x0,1322 MLX5_CMD_STAT_OK = 0x0,
1302 MLX5_CMD_STAT_INT_ERR = 0x1,1323 MLX5_CMD_STAT_INT_ERR = 0x1,
include/linux/mlx5/driver.h+3−3
@@ -145,6 +145,8 @@ enum { · 144 unmodified lines
145 MLX5_REG_MCC = 0x9062,145 MLX5_REG_MCC = 0x9062,
146 MLX5_REG_MCDA = 0x9063,146 MLX5_REG_MCDA = 0x9063,
147 MLX5_REG_MCAM = 0x907f,147 MLX5_REG_MCAM = 0x907f,
148 MLX5_REG_MIRC = 0x9162,
149 MLX5_REG_RESOURCE_DUMP = 0xC000,
148};150};
149 151
150enum mlx5_qpts_trust_state {152enum mlx5_qpts_trust_state {
@@ -684,7 +686,7 @@ struct mlx5_core_dev { · 533 unmodified lines
684 u32 hca_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)];686 u32 hca_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)];
685 u32 hca_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)];687 u32 hca_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)];
686 u32 pcam[MLX5_ST_SZ_DW(pcam_reg)];688 u32 pcam[MLX5_ST_SZ_DW(pcam_reg)];
687 u32 mcam[MLX5_ST_SZ_DW(mcam_reg)];689 u32 mcam[MLX5_MCAM_REGS_NUM][MLX5_ST_SZ_DW(mcam_reg)];
688 u32 fpga[MLX5_ST_SZ_DW(fpga_cap)];690 u32 fpga[MLX5_ST_SZ_DW(fpga_cap)];
689 u32 qcam[MLX5_ST_SZ_DW(qcam_reg)];691 u32 qcam[MLX5_ST_SZ_DW(qcam_reg)];
690 u8 embedded_cpu;692 u8 embedded_cpu;
@@ -928,8 +930,6 @@ void mlx5_start_health_poll(struct mlx5_core_dev *dev); · 237 unmodified lines
928void mlx5_stop_health_poll(struct mlx5_core_dev *dev, bool disable_health);930void mlx5_stop_health_poll(struct mlx5_core_dev *dev, bool disable_health);
929void mlx5_drain_health_wq(struct mlx5_core_dev *dev);931void mlx5_drain_health_wq(struct mlx5_core_dev *dev);
930void mlx5_trigger_health_work(struct mlx5_core_dev *dev);932void mlx5_trigger_health_work(struct mlx5_core_dev *dev);
931int mlx5_buf_alloc_node(struct mlx5_core_dev *dev, int size,
932 struct mlx5_frag_buf *buf, int node);
933int mlx5_buf_alloc(struct mlx5_core_dev *dev,933int mlx5_buf_alloc(struct mlx5_core_dev *dev,
934 int size, struct mlx5_frag_buf *buf);934 int size, struct mlx5_frag_buf *buf);
935void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_frag_buf *buf);935void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_frag_buf *buf);
include/linux/mlx5/fs.h+12−8
@@ -48,6 +48,7 @@ enum { · 47 unmodified lines
48 MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT = BIT(0),48 MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT = BIT(0),
49 MLX5_FLOW_TABLE_TUNNEL_EN_DECAP = BIT(1),49 MLX5_FLOW_TABLE_TUNNEL_EN_DECAP = BIT(1),
50 MLX5_FLOW_TABLE_TERMINATION = BIT(2),50 MLX5_FLOW_TABLE_TERMINATION = BIT(2),
51 MLX5_FLOW_TABLE_UNMANAGED = BIT(3),
51};52};
52 53
53#define LEFTOVERS_RULE_NUM 254#define LEFTOVERS_RULE_NUM 2
@@ -145,25 +146,27 @@ mlx5_get_flow_vport_acl_namespace(struct mlx5_core_dev *dev, · 91 unmodified lines
145 enum mlx5_flow_namespace_type type,146 enum mlx5_flow_namespace_type type,
146 int vport);147 int vport);
147 148
148struct mlx5_flow_table *
149mlx5_create_auto_grouped_flow_table(struct mlx5_flow_namespace *ns,
150 int prio,
151 int num_flow_table_entries,
152 int max_num_groups,
153 u32 level,
154 u32 flags);
155
156struct mlx5_flow_table_attr {149struct mlx5_flow_table_attr {
157 int prio;150 int prio;
158 int max_fte;151 int max_fte;
159 u32 level;152 u32 level;
160 u32 flags;153 u32 flags;
154 struct mlx5_flow_table *next_ft;
155
156 struct {
157 int max_num_groups;
158 int num_reserved_entries;
159 } autogroup;
161};160};
162 161
163struct mlx5_flow_table *162struct mlx5_flow_table *
164mlx5_create_flow_table(struct mlx5_flow_namespace *ns,163mlx5_create_flow_table(struct mlx5_flow_namespace *ns,
165 struct mlx5_flow_table_attr *ft_attr);164 struct mlx5_flow_table_attr *ft_attr);
166 165
166struct mlx5_flow_table *
167mlx5_create_auto_grouped_flow_table(struct mlx5_flow_namespace *ns,
168 struct mlx5_flow_table_attr *ft_attr);
169
167struct mlx5_flow_table *170struct mlx5_flow_table *
168mlx5_create_vport_flow_table(struct mlx5_flow_namespace *ns,171mlx5_create_vport_flow_table(struct mlx5_flow_namespace *ns,
169 int prio,172 int prio,
@@ -194,6 +197,7 @@ struct mlx5_fs_vlan { · 24 unmodified lines
194 197
195enum {198enum {
196 FLOW_ACT_NO_APPEND = BIT(0),199 FLOW_ACT_NO_APPEND = BIT(0),
200 FLOW_ACT_IGNORE_FLOW_LEVEL = BIT(1),
197};201};
198 202
199struct mlx5_flow_act {203struct mlx5_flow_act {
include/linux/mlx5/mlx5_ifc.h+230−7
@@ -87,6 +87,7 @@ enum { · 86 unmodified lines
87enum {87enum {
88 MLX5_GENERAL_OBJ_TYPES_CAP_SW_ICM = (1ULL << MLX5_OBJ_TYPE_SW_ICM),88 MLX5_GENERAL_OBJ_TYPES_CAP_SW_ICM = (1ULL << MLX5_OBJ_TYPE_SW_ICM),
89 MLX5_GENERAL_OBJ_TYPES_CAP_GENEVE_TLV_OPT = (1ULL << 11),89 MLX5_GENERAL_OBJ_TYPES_CAP_GENEVE_TLV_OPT = (1ULL << 11),
90 MLX5_GENERAL_OBJ_TYPES_CAP_VIRTIO_NET_Q = (1ULL << 13),
90};91};
91 92
92enum {93enum {
@@ -374,8 +375,17 @@ struct mlx5_ifc_flow_table_fields_supported_bits { · 281 unmodified lines
374 u8 outer_esp_spi[0x1];375 u8 outer_esp_spi[0x1];
375 u8 reserved_at_58[0x2];376 u8 reserved_at_58[0x2];
376 u8 bth_dst_qp[0x1];377 u8 bth_dst_qp[0x1];
378 u8 reserved_at_5b[0x5];
377 379
378 u8 reserved_at_5b[0x25];380 u8 reserved_at_60[0x18];
381 u8 metadata_reg_c_7[0x1];
382 u8 metadata_reg_c_6[0x1];
383 u8 metadata_reg_c_5[0x1];
384 u8 metadata_reg_c_4[0x1];
385 u8 metadata_reg_c_3[0x1];
386 u8 metadata_reg_c_2[0x1];
387 u8 metadata_reg_c_1[0x1];
388 u8 metadata_reg_c_0[0x1];
379};389};
380 390
381struct mlx5_ifc_flow_table_prop_layout_bits {391struct mlx5_ifc_flow_table_prop_layout_bits {
@@ -400,7 +410,8 @@ struct mlx5_ifc_flow_table_prop_layout_bits { · 18 unmodified lines
400 u8 reformat_l3_tunnel_to_l2[0x1];410 u8 reformat_l3_tunnel_to_l2[0x1];
401 u8 reformat_l2_to_l3_tunnel[0x1];411 u8 reformat_l2_to_l3_tunnel[0x1];
402 u8 reformat_and_modify_action[0x1];412 u8 reformat_and_modify_action[0x1];
403 u8 reserved_at_15[0x2];413 u8 ignore_flow_level[0x1];
414 u8 reserved_at_16[0x1];
404 u8 table_miss_action_domain[0x1];415 u8 table_miss_action_domain[0x1];
405 u8 termination_table[0x1];416 u8 termination_table[0x1];
406 u8 reserved_at_19[0x7];417 u8 reserved_at_19[0x7];
@@ -721,7 +732,9 @@ enum { · 314 unmodified lines
721 732
722struct mlx5_ifc_flow_table_eswitch_cap_bits {733struct mlx5_ifc_flow_table_eswitch_cap_bits {
723 u8 fdb_to_vport_reg_c_id[0x8];734 u8 fdb_to_vport_reg_c_id[0x8];
724 u8 reserved_at_8[0xf];735 u8 reserved_at_8[0xd];
736 u8 fdb_modify_header_fwd_to_table[0x1];
737 u8 reserved_at_16[0x1];
725 u8 flow_source[0x1];738 u8 flow_source[0x1];
726 u8 reserved_at_18[0x2];739 u8 reserved_at_18[0x2];
727 u8 multi_fdb_encap[0x1];740 u8 multi_fdb_encap[0x1];
@@ -822,7 +835,9 @@ struct mlx5_ifc_qos_cap_bits { · 94 unmodified lines
822struct mlx5_ifc_debug_cap_bits {835struct mlx5_ifc_debug_cap_bits {
823 u8 core_dump_general[0x1];836 u8 core_dump_general[0x1];
824 u8 core_dump_qp[0x1];837 u8 core_dump_qp[0x1];
825 u8 reserved_at_2[0x1e];838 u8 reserved_at_2[0x7];
839 u8 resource_dump[0x1];
840 u8 reserved_at_a[0x16];
826 841
827 u8 reserved_at_20[0x2];842 u8 reserved_at_20[0x2];
828 u8 stall_detect[0x1];843 u8 stall_detect[0x1];
@@ -953,6 +968,19 @@ struct mlx5_ifc_device_event_cap_bits { · 124 unmodified lines
953 u8 user_unaffiliated_events[4][0x40];968 u8 user_unaffiliated_events[4][0x40];
954};969};
955 970
971struct mlx5_ifc_device_virtio_emulation_cap_bits {
972 u8 reserved_at_0[0x20];
973
974 u8 reserved_at_20[0x13];
975 u8 log_doorbell_stride[0x5];
976 u8 reserved_at_38[0x3];
977 u8 log_doorbell_bar_size[0x5];
978
979 u8 doorbell_bar_offset[0x40];
980
981 u8 reserved_at_80[0x780];
982};
983
956enum {984enum {
957 MLX5_ATOMIC_CAPS_ATOMIC_SIZE_QP_1_BYTE = 0x0,985 MLX5_ATOMIC_CAPS_ATOMIC_SIZE_QP_1_BYTE = 0x0,
958 MLX5_ATOMIC_CAPS_ATOMIC_SIZE_QP_2_BYTES = 0x2,986 MLX5_ATOMIC_CAPS_ATOMIC_SIZE_QP_2_BYTES = 0x2,
@@ -1753,6 +1781,132 @@ struct mlx5_ifc_resize_field_select_bits { · 794 unmodified lines
1753 u8 resize_field_select[0x20];1781 u8 resize_field_select[0x20];
1754};1782};
1755 1783
1784struct mlx5_ifc_resource_dump_bits {
1785 u8 more_dump[0x1];
1786 u8 inline_dump[0x1];
1787 u8 reserved_at_2[0xa];
1788 u8 seq_num[0x4];
1789 u8 segment_type[0x10];
1790
1791 u8 reserved_at_20[0x10];
1792 u8 vhca_id[0x10];
1793
1794 u8 index1[0x20];
1795
1796 u8 index2[0x20];
1797
1798 u8 num_of_obj1[0x10];
1799 u8 num_of_obj2[0x10];
1800
1801 u8 reserved_at_a0[0x20];
1802
1803 u8 device_opaque[0x40];
1804
1805 u8 mkey[0x20];
1806
1807 u8 size[0x20];
1808
1809 u8 address[0x40];
1810
1811 u8 inline_data[52][0x20];
1812};
1813
1814struct mlx5_ifc_resource_dump_menu_record_bits {
1815 u8 reserved_at_0[0x4];
1816 u8 num_of_obj2_supports_active[0x1];
1817 u8 num_of_obj2_supports_all[0x1];
1818 u8 must_have_num_of_obj2[0x1];
1819 u8 support_num_of_obj2[0x1];
1820 u8 num_of_obj1_supports_active[0x1];
1821 u8 num_of_obj1_supports_all[0x1];
1822 u8 must_have_num_of_obj1[0x1];
1823 u8 support_num_of_obj1[0x1];
1824 u8 must_have_index2[0x1];
1825 u8 support_index2[0x1];
1826 u8 must_have_index1[0x1];
1827 u8 support_index1[0x1];
1828 u8 segment_type[0x10];
1829
1830 u8 segment_name[4][0x20];
1831
1832 u8 index1_name[4][0x20];
1833
1834 u8 index2_name[4][0x20];
1835};
1836
1837struct mlx5_ifc_resource_dump_segment_header_bits {
1838 u8 length_dw[0x10];
1839 u8 segment_type[0x10];
1840};
1841
1842struct mlx5_ifc_resource_dump_command_segment_bits {
1843 struct mlx5_ifc_resource_dump_segment_header_bits segment_header;
1844
1845 u8 segment_called[0x10];
1846 u8 vhca_id[0x10];
1847
1848 u8 index1[0x20];
1849
1850 u8 index2[0x20];
1851
1852 u8 num_of_obj1[0x10];
1853 u8 num_of_obj2[0x10];
1854};
1855
1856struct mlx5_ifc_resource_dump_error_segment_bits {
1857 struct mlx5_ifc_resource_dump_segment_header_bits segment_header;
1858
1859 u8 reserved_at_20[0x10];
1860 u8 syndrome_id[0x10];
1861
1862 u8 reserved_at_40[0x40];
1863
1864 u8 error[8][0x20];
1865};
1866
1867struct mlx5_ifc_resource_dump_info_segment_bits {
1868 struct mlx5_ifc_resource_dump_segment_header_bits segment_header;
1869
1870 u8 reserved_at_20[0x18];
1871 u8 dump_version[0x8];
1872
1873 u8 hw_version[0x20];
1874
1875 u8 fw_version[0x20];
1876};
1877
1878struct mlx5_ifc_resource_dump_menu_segment_bits {
1879 struct mlx5_ifc_resource_dump_segment_header_bits segment_header;
1880
1881 u8 reserved_at_20[0x10];
1882 u8 num_of_records[0x10];
1883
1884 struct mlx5_ifc_resource_dump_menu_record_bits record[0];
1885};
1886
1887struct mlx5_ifc_resource_dump_resource_segment_bits {
1888 struct mlx5_ifc_resource_dump_segment_header_bits segment_header;
1889
1890 u8 reserved_at_20[0x20];
1891
1892 u8 index1[0x20];
1893
1894 u8 index2[0x20];
1895
1896 u8 payload[0][0x20];
1897};
1898
1899struct mlx5_ifc_resource_dump_terminate_segment_bits {
1900 struct mlx5_ifc_resource_dump_segment_header_bits segment_header;
1901};
1902
1903struct mlx5_ifc_menu_resource_dump_response_bits {
1904 struct mlx5_ifc_resource_dump_info_segment_bits info;
1905 struct mlx5_ifc_resource_dump_command_segment_bits cmd;
1906 struct mlx5_ifc_resource_dump_menu_segment_bits menu;
1907 struct mlx5_ifc_resource_dump_terminate_segment_bits terminate;
1908};
1909
1756enum {1910enum {
1757 MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_PERIOD = 0x1,1911 MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_PERIOD = 0x1,
1758 MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_MAX_COUNT = 0x2,1912 MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_MAX_COUNT = 0x2,
@@ -2026,7 +2180,9 @@ struct mlx5_ifc_eth_per_prio_grp_data_layout_bits { · 267 unmodified lines
2026 2180
2027 u8 rx_pause_transition_low[0x20];2181 u8 rx_pause_transition_low[0x20];
2028 2182
2029 u8 reserved_at_3c0[0x40];2183 u8 rx_discards_high[0x20];
2184
2185 u8 rx_discards_low[0x20];
2030 2186
2031 u8 device_stall_minor_watermark_cnt_high[0x20];2187 u8 device_stall_minor_watermark_cnt_high[0x20];
2032 2188
@@ -2751,6 +2907,7 @@ union mlx5_ifc_hca_cap_union_bits { · 718 unmodified lines
2751 struct mlx5_ifc_fpga_cap_bits fpga_cap;2907 struct mlx5_ifc_fpga_cap_bits fpga_cap;
2752 struct mlx5_ifc_tls_cap_bits tls_cap;2908 struct mlx5_ifc_tls_cap_bits tls_cap;
2753 struct mlx5_ifc_device_mem_cap_bits device_mem_cap;2909 struct mlx5_ifc_device_mem_cap_bits device_mem_cap;
2910 struct mlx5_ifc_device_virtio_emulation_cap_bits virtio_emulation_cap;
2754 u8 reserved_at_0[0x8000];2911 u8 reserved_at_0[0x8000];
2755};2912};
2756 2913
@@ -3998,7 +4155,8 @@ struct mlx5_ifc_set_fte_in_bits { · 1241 unmodified lines
3998 u8 reserved_at_a0[0x8];4155 u8 reserved_at_a0[0x8];
3999 u8 table_id[0x18];4156 u8 table_id[0x18];
4000 4157
4001 u8 reserved_at_c0[0x18];4158 u8 ignore_flow_level[0x1];
4159 u8 reserved_at_c1[0x17];
4002 u8 modify_enable_mask[0x8];4160 u8 modify_enable_mask[0x8];
4003 4161
4004 u8 reserved_at_e0[0x20];4162 u8 reserved_at_e0[0x20];
@@ -5466,15 +5624,32 @@ struct mlx5_ifc_add_action_in_bits { · 1461 unmodified lines
5466 u8 data[0x20];5624 u8 data[0x20];
5467};5625};
5468 5626
5627struct mlx5_ifc_copy_action_in_bits {
5628 u8 action_type[0x4];
5629 u8 src_field[0xc];
5630 u8 reserved_at_10[0x3];
5631 u8 src_offset[0x5];
5632 u8 reserved_at_18[0x3];
5633 u8 length[0x5];
5634
5635 u8 reserved_at_20[0x4];
5636 u8 dst_field[0xc];
5637 u8 reserved_at_30[0x3];
5638 u8 dst_offset[0x5];
5639 u8 reserved_at_38[0x8];
5640};
5641
5469union mlx5_ifc_set_action_in_add_action_in_auto_bits {5642union mlx5_ifc_set_action_in_add_action_in_auto_bits {
5470 struct mlx5_ifc_set_action_in_bits set_action_in;5643 struct mlx5_ifc_set_action_in_bits set_action_in;
5471 struct mlx5_ifc_add_action_in_bits add_action_in;5644 struct mlx5_ifc_add_action_in_bits add_action_in;
5645 struct mlx5_ifc_copy_action_in_bits copy_action_in;
5472 u8 reserved_at_0[0x40];5646 u8 reserved_at_0[0x40];
5473};5647};
5474 5648
5475enum {5649enum {
5476 MLX5_ACTION_TYPE_SET = 0x1,5650 MLX5_ACTION_TYPE_SET = 0x1,
5477 MLX5_ACTION_TYPE_ADD = 0x2,5651 MLX5_ACTION_TYPE_ADD = 0x2,
5652 MLX5_ACTION_TYPE_COPY = 0x3,
5478};5653};
5479 5654
5480enum {5655enum {
@@ -5510,6 +5685,8 @@ enum { · 29 unmodified lines
5510 MLX5_ACTION_IN_FIELD_METADATA_REG_C_3 = 0x54,5685 MLX5_ACTION_IN_FIELD_METADATA_REG_C_3 = 0x54,
5511 MLX5_ACTION_IN_FIELD_METADATA_REG_C_4 = 0x55,5686 MLX5_ACTION_IN_FIELD_METADATA_REG_C_4 = 0x55,
5512 MLX5_ACTION_IN_FIELD_METADATA_REG_C_5 = 0x56,5687 MLX5_ACTION_IN_FIELD_METADATA_REG_C_5 = 0x56,
5688 MLX5_ACTION_IN_FIELD_METADATA_REG_C_6 = 0x57,
5689 MLX5_ACTION_IN_FIELD_METADATA_REG_C_7 = 0x58,
5513 MLX5_ACTION_IN_FIELD_OUT_TCP_SEQ_NUM = 0x59,5690 MLX5_ACTION_IN_FIELD_OUT_TCP_SEQ_NUM = 0x59,
5514 MLX5_ACTION_IN_FIELD_OUT_TCP_ACK_NUM = 0x5B,5691 MLX5_ACTION_IN_FIELD_OUT_TCP_ACK_NUM = 0x5B,
5515};5692};
@@ -8406,6 +8583,18 @@ struct mlx5_ifc_pplm_reg_bits { · 2890 unmodified lines
8406 u8 fec_override_admin_50g[0x4];8583 u8 fec_override_admin_50g[0x4];
8407 u8 fec_override_admin_25g[0x4];8584 u8 fec_override_admin_25g[0x4];
8408 u8 fec_override_admin_10g_40g[0x4];8585 u8 fec_override_admin_10g_40g[0x4];
8586
8587 u8 fec_override_cap_400g_8x[0x10];
8588 u8 fec_override_cap_200g_4x[0x10];
8589
8590 u8 fec_override_cap_100g_2x[0x10];
8591 u8 fec_override_cap_50g_1x[0x10];
8592
8593 u8 fec_override_admin_400g_8x[0x10];
8594 u8 fec_override_admin_200g_4x[0x10];
8595
8596 u8 fec_override_admin_100g_2x[0x10];
8597 u8 fec_override_admin_50g_1x[0x10];
8409};8598};
8410 8599
8411struct mlx5_ifc_ppcnt_reg_bits {8600struct mlx5_ifc_ppcnt_reg_bits {
@@ -8732,7 +8921,9 @@ struct mlx5_ifc_mpegc_reg_bits { · 320 unmodified lines
8732};8921};
8733 8922
8734struct mlx5_ifc_pcam_enhanced_features_bits {8923struct mlx5_ifc_pcam_enhanced_features_bits {
8735 u8 reserved_at_0[0x6d];8924 u8 reserved_at_0[0x68];
8925 u8 fec_50G_per_lane_in_pplm[0x1];
8926 u8 reserved_at_69[0x4];
8736 u8 rx_icrc_encapsulated_counter[0x1];8927 u8 rx_icrc_encapsulated_counter[0x1];
8737 u8 reserved_at_6e[0x4];8928 u8 reserved_at_6e[0x4];
8738 u8 ptys_extended_ethernet[0x1];8929 u8 ptys_extended_ethernet[0x1];
@@ -8817,6 +9008,28 @@ struct mlx5_ifc_mcam_access_reg_bits { · 78 unmodified lines
8817 u8 regs_31_to_0[0x20];9008 u8 regs_31_to_0[0x20];
8818};9009};
8819 9010
9011struct mlx5_ifc_mcam_access_reg_bits1 {
9012 u8 regs_127_to_96[0x20];
9013
9014 u8 regs_95_to_64[0x20];
9015
9016 u8 regs_63_to_32[0x20];
9017
9018 u8 regs_31_to_0[0x20];
9019};
9020
9021struct mlx5_ifc_mcam_access_reg_bits2 {
9022 u8 regs_127_to_99[0x1d];
9023 u8 mirc[0x1];
9024 u8 regs_97_to_96[0x2];
9025
9026 u8 regs_95_to_64[0x20];
9027
9028 u8 regs_63_to_32[0x20];
9029
9030 u8 regs_31_to_0[0x20];
9031};
9032
8820struct mlx5_ifc_mcam_reg_bits {9033struct mlx5_ifc_mcam_reg_bits {
8821 u8 reserved_at_0[0x8];9034 u8 reserved_at_0[0x8];
8822 u8 feature_group[0x8];9035 u8 feature_group[0x8];
@@ -8827,6 +9040,8 @@ struct mlx5_ifc_mcam_reg_bits { · 4 unmodified lines
8827 9040
8828 union {9041 union {
8829 struct mlx5_ifc_mcam_access_reg_bits access_regs;9042 struct mlx5_ifc_mcam_access_reg_bits access_regs;
9043 struct mlx5_ifc_mcam_access_reg_bits1 access_regs1;
9044 struct mlx5_ifc_mcam_access_reg_bits2 access_regs2;
8830 u8 reserved_at_0[0x80];9045 u8 reserved_at_0[0x80];
8831 } mng_access_reg_cap_mask;9046 } mng_access_reg_cap_mask;
8832 9047
@@ -9432,6 +9647,13 @@ struct mlx5_ifc_mcda_reg_bits { · 599 unmodified lines
9432 u8 data[0][0x20];9647 u8 data[0][0x20];
9433};9648};
9434 9649
9650struct mlx5_ifc_mirc_reg_bits {
9651 u8 reserved_at_0[0x18];
9652 u8 status_code[0x8];
9653
9654 u8 reserved_at_20[0x20];
9655};
9656
9435union mlx5_ifc_ports_control_registers_document_bits {9657union mlx5_ifc_ports_control_registers_document_bits {
9436 struct mlx5_ifc_bufferx_reg_bits bufferx_reg;9658 struct mlx5_ifc_bufferx_reg_bits bufferx_reg;
9437 struct mlx5_ifc_eth_2819_cntrs_grp_data_layout_bits eth_2819_cntrs_grp_data_layout;9659 struct mlx5_ifc_eth_2819_cntrs_grp_data_layout_bits eth_2819_cntrs_grp_data_layout;
@@ -9487,6 +9709,7 @@ union mlx5_ifc_ports_control_registers_document_bits { · 49 unmodified lines
9487 struct mlx5_ifc_mcqi_reg_bits mcqi_reg;9709 struct mlx5_ifc_mcqi_reg_bits mcqi_reg;
9488 struct mlx5_ifc_mcc_reg_bits mcc_reg;9710 struct mlx5_ifc_mcc_reg_bits mcc_reg;
9489 struct mlx5_ifc_mcda_reg_bits mcda_reg;9711 struct mlx5_ifc_mcda_reg_bits mcda_reg;
9712 struct mlx5_ifc_mirc_reg_bits mirc_reg;
9490 u8 reserved_at_0[0x60e0];9713 u8 reserved_at_0[0x60e0];
9491};9714};
9492 9715
include/linux/mmc/sdio_ids.h+2−0
@@ -41,8 +41,10 @@ · 40 unmodified lines
41#define SDIO_DEVICE_ID_BROADCOM_43455 0xa9bf41#define SDIO_DEVICE_ID_BROADCOM_43455 0xa9bf
42#define SDIO_DEVICE_ID_BROADCOM_4354 0x435442#define SDIO_DEVICE_ID_BROADCOM_4354 0x4354
43#define SDIO_DEVICE_ID_BROADCOM_4356 0x435643#define SDIO_DEVICE_ID_BROADCOM_4356 0x4356
44#define SDIO_DEVICE_ID_BROADCOM_4359 0x4359
44#define SDIO_DEVICE_ID_CYPRESS_4373 0x437345#define SDIO_DEVICE_ID_CYPRESS_4373 0x4373
45#define SDIO_DEVICE_ID_CYPRESS_43012 4301246#define SDIO_DEVICE_ID_CYPRESS_43012 43012
47#define SDIO_DEVICE_ID_CYPRESS_89359 0x4355
46 48
47#define SDIO_VENDOR_ID_INTEL 0x008949#define SDIO_VENDOR_ID_INTEL 0x0089
48#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x140250#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402
include/linux/net.h+1−0
@@ -171,6 +171,7 @@ struct proto_ops { · 170 unmodified lines
171 int (*compat_getsockopt)(struct socket *sock, int level,171 int (*compat_getsockopt)(struct socket *sock, int level,
172 int optname, char __user *optval, int __user *optlen);172 int optname, char __user *optval, int __user *optlen);
173#endif173#endif
174 void (*show_fdinfo)(struct seq_file *m, struct socket *sock);
174 int (*sendmsg) (struct socket *sock, struct msghdr *m,175 int (*sendmsg) (struct socket *sock, struct msghdr *m,
175 size_t total_len);176 size_t total_len);
176 /* Notes for implementing recvmsg:177 /* Notes for implementing recvmsg:
include/linux/netdev_features.h+8−1
@@ -53,8 +53,9 @@ enum { · 52 unmodified lines
53 NETIF_F_GSO_ESP_BIT, /* ... ESP with TSO */53 NETIF_F_GSO_ESP_BIT, /* ... ESP with TSO */
54 NETIF_F_GSO_UDP_BIT, /* ... UFO, deprecated except tuntap */54 NETIF_F_GSO_UDP_BIT, /* ... UFO, deprecated except tuntap */
55 NETIF_F_GSO_UDP_L4_BIT, /* ... UDP payload GSO (not UFO) */55 NETIF_F_GSO_UDP_L4_BIT, /* ... UDP payload GSO (not UFO) */
56 NETIF_F_GSO_FRAGLIST_BIT, /* ... Fraglist GSO */
56 /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */57 /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */
57 NETIF_F_GSO_UDP_L4_BIT,58 NETIF_F_GSO_FRAGLIST_BIT,
58 59
59 NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */60 NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */
60 NETIF_F_SCTP_CRC_BIT, /* SCTP checksum offload */61 NETIF_F_SCTP_CRC_BIT, /* SCTP checksum offload */
@@ -80,6 +81,7 @@ enum { · 19 unmodified lines
80 81
81 NETIF_F_GRO_HW_BIT, /* Hardware Generic receive offload */82 NETIF_F_GRO_HW_BIT, /* Hardware Generic receive offload */
82 NETIF_F_HW_TLS_RECORD_BIT, /* Offload TLS record */83 NETIF_F_HW_TLS_RECORD_BIT, /* Offload TLS record */
84 NETIF_F_GRO_FRAGLIST_BIT, /* Fraglist GRO */
83 85
84 /*86 /*
85 * Add your fresh new feature above and remember to update87 * Add your fresh new feature above and remember to update
@@ -150,6 +152,8 @@ enum { · 64 unmodified lines
150#define NETIF_F_GSO_UDP_L4 __NETIF_F(GSO_UDP_L4)152#define NETIF_F_GSO_UDP_L4 __NETIF_F(GSO_UDP_L4)
151#define NETIF_F_HW_TLS_TX __NETIF_F(HW_TLS_TX)153#define NETIF_F_HW_TLS_TX __NETIF_F(HW_TLS_TX)
152#define NETIF_F_HW_TLS_RX __NETIF_F(HW_TLS_RX)154#define NETIF_F_HW_TLS_RX __NETIF_F(HW_TLS_RX)
155#define NETIF_F_GRO_FRAGLIST __NETIF_F(GRO_FRAGLIST)
156#define NETIF_F_GSO_FRAGLIST __NETIF_F(GSO_FRAGLIST)
153 157
154/* Finds the next feature with the highest number of the range of start till 0.158/* Finds the next feature with the highest number of the range of start till 0.
155 */159 */
@@ -226,6 +230,9 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start) · 70 unmodified lines
226/* changeable features with no special hardware requirements */230/* changeable features with no special hardware requirements */
227#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)231#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
228 232
233/* Changeable features with no special hardware requirements that defaults to off. */
234#define NETIF_F_SOFT_FEATURES_OFF NETIF_F_GRO_FRAGLIST
235
229#define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \236#define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \
230 NETIF_F_HW_VLAN_CTAG_RX | \237 NETIF_F_HW_VLAN_CTAG_RX | \
231 NETIF_F_HW_VLAN_CTAG_TX | \238 NETIF_F_HW_VLAN_CTAG_TX | \
include/linux/netdevice.h+88−26
@@ -849,6 +849,8 @@ enum tc_setup_type { · 848 unmodified lines
849 TC_SETUP_QDISC_GRED,849 TC_SETUP_QDISC_GRED,
850 TC_SETUP_QDISC_TAPRIO,850 TC_SETUP_QDISC_TAPRIO,
851 TC_SETUP_FT,851 TC_SETUP_FT,
852 TC_SETUP_QDISC_ETS,
853 TC_SETUP_QDISC_TBF,
852};854};
853 855
854/* These structures hold the attributes of bpf state that are being passed856/* These structures hold the attributes of bpf state that are being passed
@@ -875,6 +877,7 @@ enum bpf_netdev_command { · 20 unmodified lines
875struct bpf_prog_offload_ops;877struct bpf_prog_offload_ops;
876struct netlink_ext_ack;878struct netlink_ext_ack;
877struct xdp_umem;879struct xdp_umem;
880struct xdp_dev_bulk_queue;
878 881
879struct netdev_bpf {882struct netdev_bpf {
880 enum bpf_netdev_command command;883 enum bpf_netdev_command command;
@@ -936,6 +939,11 @@ struct netdev_name_node { · 55 unmodified lines
936int netdev_name_node_alt_create(struct net_device *dev, const char *name);939int netdev_name_node_alt_create(struct net_device *dev, const char *name);
937int netdev_name_node_alt_destroy(struct net_device *dev, const char *name);940int netdev_name_node_alt_destroy(struct net_device *dev, const char *name);
938 941
942struct netdev_net_notifier {
943 struct list_head list;
944 struct notifier_block *nb;
945};
946
939/*947/*
940 * This structure defines the management hooks for network devices.948 * This structure defines the management hooks for network devices.
941 * The following hooks can be defined; unless noted otherwise, they are949 * The following hooks can be defined; unless noted otherwise, they are
@@ -1014,7 +1022,7 @@ int netdev_name_node_alt_destroy(struct net_device *dev, const char *name); · 72 unmodified lines
1014 * Called when a user wants to change the Maximum Transfer Unit1022 * Called when a user wants to change the Maximum Transfer Unit
1015 * of a device.1023 * of a device.
1016 *1024 *
1017 * void (*ndo_tx_timeout)(struct net_device *dev);1025 * void (*ndo_tx_timeout)(struct net_device *dev, unsigned int txqueue);
1018 * Callback used when the transmitter has not made any progress1026 * Callback used when the transmitter has not made any progress
1019 * for dev->watchdog ticks.1027 * for dev->watchdog ticks.
1020 *1028 *
@@ -1281,7 +1289,8 @@ struct net_device_ops { · 260 unmodified lines
1281 int new_mtu);1289 int new_mtu);
1282 int (*ndo_neigh_setup)(struct net_device *dev,1290 int (*ndo_neigh_setup)(struct net_device *dev,
1283 struct neigh_parms *);1291 struct neigh_parms *);
1284 void (*ndo_tx_timeout) (struct net_device *dev);1292 void (*ndo_tx_timeout) (struct net_device *dev,
1293 unsigned int txqueue);
1285 1294
1286 void (*ndo_get_stats64)(struct net_device *dev,1295 void (*ndo_get_stats64)(struct net_device *dev,
1287 struct rtnl_link_stats64 *storage);1296 struct rtnl_link_stats64 *storage);
@@ -1707,6 +1716,7 @@ enum netdev_priv_flags { · 419 unmodified lines
1707 * @miniq_ingress: ingress/clsact qdisc specific data for1716 * @miniq_ingress: ingress/clsact qdisc specific data for
1708 * ingress processing1717 * ingress processing
1709 * @ingress_queue: XXX: need comments on this one1718 * @ingress_queue: XXX: need comments on this one
1719 * @nf_hooks_ingress: netfilter hooks executed for ingress packets
1710 * @broadcast: hw bcast address1720 * @broadcast: hw bcast address
1711 *1721 *
1712 * @rx_cpu_rmap: CPU reverse-mapping for RX completion interrupts,1722 * @rx_cpu_rmap: CPU reverse-mapping for RX completion interrupts,
@@ -1788,6 +1798,10 @@ enum netdev_priv_flags { · 75 unmodified lines
1788 *1798 *
1789 * @wol_enabled: Wake-on-LAN is enabled1799 * @wol_enabled: Wake-on-LAN is enabled
1790 *1800 *
1801 * @net_notifier_list: List of per-net netdev notifier block
1802 * that follow this device when it is moved
1803 * to another network namespace.
1804 *
1791 * FIXME: cleanup struct net_device such that network protocol info1805 * FIXME: cleanup struct net_device such that network protocol info
1792 * moves out.1806 * moves out.
1793 */1807 */
@@ -1983,12 +1997,10 @@ struct net_device { · 189 unmodified lines
1983 unsigned int num_tx_queues;1997 unsigned int num_tx_queues;
1984 unsigned int real_num_tx_queues;1998 unsigned int real_num_tx_queues;
1985 struct Qdisc *qdisc;1999 struct Qdisc *qdisc;
1986#ifdef CONFIG_NET_SCHED
1987 DECLARE_HASHTABLE (qdisc_hash, 4);
1988#endif
1989 unsigned int tx_queue_len;2000 unsigned int tx_queue_len;
1990 spinlock_t tx_global_lock;2001 spinlock_t tx_global_lock;
1991 int watchdog_timeo;2002
2003 struct xdp_dev_bulk_queue __percpu *xdp_bulkq;
1992 2004
1993#ifdef CONFIG_XPS2005#ifdef CONFIG_XPS
1994 struct xps_dev_maps __rcu *xps_cpus_map;2006 struct xps_dev_maps __rcu *xps_cpus_map;
@@ -1998,11 +2010,15 @@ struct net_device { · 3 unmodified lines
1998 struct mini_Qdisc __rcu *miniq_egress;2010 struct mini_Qdisc __rcu *miniq_egress;
1999#endif2011#endif
2000 2012
2013#ifdef CONFIG_NET_SCHED
2014 DECLARE_HASHTABLE (qdisc_hash, 4);
2015#endif
2001 /* These may be needed for future network-power-down code. */2016 /* These may be needed for future network-power-down code. */
2002 struct timer_list watchdog_timer;2017 struct timer_list watchdog_timer;
2018 int watchdog_timeo;
2003 2019
2004 int __percpu *pcpu_refcnt;
2005 struct list_head todo_list;2020 struct list_head todo_list;
2021 int __percpu *pcpu_refcnt;
2006 2022
2007 struct list_head link_watch_list;2023 struct list_head link_watch_list;
2008 2024
@@ -2078,6 +2094,8 @@ struct net_device { · 69 unmodified lines
2078 struct lock_class_key addr_list_lock_key;2094 struct lock_class_key addr_list_lock_key;
2079 bool proto_down;2095 bool proto_down;
2080 unsigned wol_enabled:1;2096 unsigned wol_enabled:1;
2097
2098 struct list_head net_notifier_list;
2081};2099};
2082#define to_net_dev(d) container_of(d, struct net_device, dev)2100#define to_net_dev(d) container_of(d, struct net_device, dev)
2083 2101
@@ -2319,7 +2337,8 @@ struct napi_gro_cb { · 235 unmodified lines
2319 /* Number of gro_receive callbacks this packet already went through */2337 /* Number of gro_receive callbacks this packet already went through */
2320 u8 recursion_counter:4;2338 u8 recursion_counter:4;
2321 2339
2322 /* 1 bit hole */2340 /* GRO is done by frag_list pointer chaining. */
2341 u8 is_flist:1;
2323 2342
2324 /* used to support CHECKSUM_COMPLETE for tunneling protocols */2343 /* used to support CHECKSUM_COMPLETE for tunneling protocols */
2325 __wsum csum;2344 __wsum csum;
@@ -2521,6 +2540,12 @@ int unregister_netdevice_notifier(struct notifier_block *nb); · 195 unmodified lines
2521int register_netdevice_notifier_net(struct net *net, struct notifier_block *nb);2540int register_netdevice_notifier_net(struct net *net, struct notifier_block *nb);
2522int unregister_netdevice_notifier_net(struct net *net,2541int unregister_netdevice_notifier_net(struct net *net,
2523 struct notifier_block *nb);2542 struct notifier_block *nb);
2543int register_netdevice_notifier_dev_net(struct net_device *dev,
2544 struct notifier_block *nb,
2545 struct netdev_net_notifier *nn);
2546int unregister_netdevice_notifier_dev_net(struct net_device *dev,
2547 struct notifier_block *nb,
2548 struct netdev_net_notifier *nn);
2524 2549
2525struct netdev_notifier_info {2550struct netdev_notifier_info {
2526 struct net_device *dev;2551 struct net_device *dev;
@@ -2687,6 +2712,7 @@ struct net_device *dev_get_by_napi_id(unsigned int napi_id); · 160 unmodified lines
2687int netdev_get_name(struct net *net, char *name, int ifindex);2712int netdev_get_name(struct net *net, char *name, int ifindex);
2688int dev_restart(struct net_device *dev);2713int dev_restart(struct net_device *dev);
2689int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb);2714int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb);
2715int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb);
2690 2716
2691static inline unsigned int skb_gro_offset(const struct sk_buff *skb)2717static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
2692{2718{
@@ -2823,16 +2849,16 @@ static inline bool __skb_gro_checksum_convert_check(struct sk_buff *skb) · 130 unmodified lines
2823}2849}
2824 2850
2825static inline void __skb_gro_checksum_convert(struct sk_buff *skb,2851static inline void __skb_gro_checksum_convert(struct sk_buff *skb,
2826 __sum16 check, __wsum pseudo)2852 __wsum pseudo)
2827{2853{
2828 NAPI_GRO_CB(skb)->csum = ~pseudo;2854 NAPI_GRO_CB(skb)->csum = ~pseudo;
2829 NAPI_GRO_CB(skb)->csum_valid = 1;2855 NAPI_GRO_CB(skb)->csum_valid = 1;
2830}2856}
2831 2857
2832#define skb_gro_checksum_try_convert(skb, proto, check, compute_pseudo) \2858#define skb_gro_checksum_try_convert(skb, proto, compute_pseudo) \
2833do { \2859do { \
2834 if (__skb_gro_checksum_convert_check(skb)) \2860 if (__skb_gro_checksum_convert_check(skb)) \
2835 __skb_gro_checksum_convert(skb, check, \2861 __skb_gro_checksum_convert(skb, \
2836 compute_pseudo(skb, proto)); \2862 compute_pseudo(skb, proto)); \
2837} while (0)2863} while (0)
2838 2864
@@ -3887,22 +3913,48 @@ void netif_device_attach(struct net_device *dev); · 1048 unmodified lines
3887 */3913 */
3888 3914
3889enum {3915enum {
3890 NETIF_MSG_DRV = 0x0001,3916 NETIF_MSG_DRV_BIT,
3891 NETIF_MSG_PROBE = 0x0002,3917 NETIF_MSG_PROBE_BIT,
3892 NETIF_MSG_LINK = 0x0004,3918 NETIF_MSG_LINK_BIT,
3893 NETIF_MSG_TIMER = 0x0008,3919 NETIF_MSG_TIMER_BIT,
3894 NETIF_MSG_IFDOWN = 0x0010,3920 NETIF_MSG_IFDOWN_BIT,
3895 NETIF_MSG_IFUP = 0x0020,3921 NETIF_MSG_IFUP_BIT,
3896 NETIF_MSG_RX_ERR = 0x0040,3922 NETIF_MSG_RX_ERR_BIT,
3897 NETIF_MSG_TX_ERR = 0x0080,3923 NETIF_MSG_TX_ERR_BIT,
3898 NETIF_MSG_TX_QUEUED = 0x0100,3924 NETIF_MSG_TX_QUEUED_BIT,
3899 NETIF_MSG_INTR = 0x0200,3925 NETIF_MSG_INTR_BIT,
3900 NETIF_MSG_TX_DONE = 0x0400,3926 NETIF_MSG_TX_DONE_BIT,
3901 NETIF_MSG_RX_STATUS = 0x0800,3927 NETIF_MSG_RX_STATUS_BIT,
3902 NETIF_MSG_PKTDATA = 0x1000,3928 NETIF_MSG_PKTDATA_BIT,
3903 NETIF_MSG_HW = 0x2000,3929 NETIF_MSG_HW_BIT,
3904 NETIF_MSG_WOL = 0x4000,3930 NETIF_MSG_WOL_BIT,
3931
3932 /* When you add a new bit above, update netif_msg_class_names array
3933 * in net/ethtool/common.c
3934 */
3935 NETIF_MSG_CLASS_COUNT,
3905};3936};
3937/* Both ethtool_ops interface and internal driver implementation use u32 */
3938static_assert(NETIF_MSG_CLASS_COUNT <= 32);
3939
3940#define __NETIF_MSG_BIT(bit) ((u32)1 << (bit))
3941#define __NETIF_MSG(name) __NETIF_MSG_BIT(NETIF_MSG_ ## name ## _BIT)
3942
3943#define NETIF_MSG_DRV __NETIF_MSG(DRV)
3944#define NETIF_MSG_PROBE __NETIF_MSG(PROBE)
3945#define NETIF_MSG_LINK __NETIF_MSG(LINK)
3946#define NETIF_MSG_TIMER __NETIF_MSG(TIMER)
3947#define NETIF_MSG_IFDOWN __NETIF_MSG(IFDOWN)
3948#define NETIF_MSG_IFUP __NETIF_MSG(IFUP)
3949#define NETIF_MSG_RX_ERR __NETIF_MSG(RX_ERR)
3950#define NETIF_MSG_TX_ERR __NETIF_MSG(TX_ERR)
3951#define NETIF_MSG_TX_QUEUED __NETIF_MSG(TX_QUEUED)
3952#define NETIF_MSG_INTR __NETIF_MSG(INTR)
3953#define NETIF_MSG_TX_DONE __NETIF_MSG(TX_DONE)
3954#define NETIF_MSG_RX_STATUS __NETIF_MSG(RX_STATUS)
3955#define NETIF_MSG_PKTDATA __NETIF_MSG(PKTDATA)
3956#define NETIF_MSG_HW __NETIF_MSG(HW)
3957#define NETIF_MSG_WOL __NETIF_MSG(WOL)
3906 3958
3907#define netif_msg_drv(p) ((p)->msg_enable & NETIF_MSG_DRV)3959#define netif_msg_drv(p) ((p)->msg_enable & NETIF_MSG_DRV)
3908#define netif_msg_probe(p) ((p)->msg_enable & NETIF_MSG_PROBE)3960#define netif_msg_probe(p) ((p)->msg_enable & NETIF_MSG_PROBE)
@@ -4393,6 +4445,15 @@ struct netdev_notifier_bonding_info { · 484 unmodified lines
4393void netdev_bonding_info_change(struct net_device *dev,4445void netdev_bonding_info_change(struct net_device *dev,
4394 struct netdev_bonding_info *bonding_info);4446 struct netdev_bonding_info *bonding_info);
4395 4447
4448#if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
4449void ethtool_notify(struct net_device *dev, unsigned int cmd, const void *data);
4450#else
4451static inline void ethtool_notify(struct net_device *dev, unsigned int cmd,
4452 const void *data)
4453{
4454}
4455#endif
4456
4396static inline4457static inline
4397struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features)4458struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features)
4398{4459{
@@ -4554,6 +4615,7 @@ static inline bool net_gso_ok(netdev_features_t features, int gso_type) · 155 unmodified lines
4554 BUILD_BUG_ON(SKB_GSO_ESP != (NETIF_F_GSO_ESP >> NETIF_F_GSO_SHIFT));4615 BUILD_BUG_ON(SKB_GSO_ESP != (NETIF_F_GSO_ESP >> NETIF_F_GSO_SHIFT));
4555 BUILD_BUG_ON(SKB_GSO_UDP != (NETIF_F_GSO_UDP >> NETIF_F_GSO_SHIFT));4616 BUILD_BUG_ON(SKB_GSO_UDP != (NETIF_F_GSO_UDP >> NETIF_F_GSO_SHIFT));
4556 BUILD_BUG_ON(SKB_GSO_UDP_L4 != (NETIF_F_GSO_UDP_L4 >> NETIF_F_GSO_SHIFT));4617 BUILD_BUG_ON(SKB_GSO_UDP_L4 != (NETIF_F_GSO_UDP_L4 >> NETIF_F_GSO_SHIFT));
4618 BUILD_BUG_ON(SKB_GSO_FRAGLIST != (NETIF_F_GSO_FRAGLIST >> NETIF_F_GSO_SHIFT));
4557 4619
4558 return (features & feature) == feature;4620 return (features & feature) == feature;
4559}4621}
include/linux/phy.h+96−27
@@ -17,10 +17,12 @@ · 16 unmodified lines
17#include <linux/linkmode.h>17#include <linux/linkmode.h>
18#include <linux/mdio.h>18#include <linux/mdio.h>
19#include <linux/mii.h>19#include <linux/mii.h>
20#include <linux/mii_timestamper.h>
20#include <linux/module.h>21#include <linux/module.h>
21#include <linux/timer.h>22#include <linux/timer.h>
22#include <linux/workqueue.h>23#include <linux/workqueue.h>
23#include <linux/mod_devicetable.h>24#include <linux/mod_devicetable.h>
25#include <linux/u64_stats_sync.h>
24 26
25#include <linux/atomic.h>27#include <linux/atomic.h>
26 28
@@ -99,9 +101,11 @@ typedef enum { · 72 unmodified lines
99 PHY_INTERFACE_MODE_2500BASEX,101 PHY_INTERFACE_MODE_2500BASEX,
100 PHY_INTERFACE_MODE_RXAUI,102 PHY_INTERFACE_MODE_RXAUI,
101 PHY_INTERFACE_MODE_XAUI,103 PHY_INTERFACE_MODE_XAUI,
102 /* 10GBASE-KR, XFI, SFI - single lane 10G Serdes */104 /* 10GBASE-R, XFI, SFI - single lane 10G Serdes */
103 PHY_INTERFACE_MODE_10GKR,105 PHY_INTERFACE_MODE_10GBASER,
104 PHY_INTERFACE_MODE_USXGMII,106 PHY_INTERFACE_MODE_USXGMII,
107 /* 10GBASE-KR - with Clause 73 AN */
108 PHY_INTERFACE_MODE_10GKR,
105 PHY_INTERFACE_MODE_MAX,109 PHY_INTERFACE_MODE_MAX,
106} phy_interface_t;110} phy_interface_t;
107 111
@@ -175,10 +179,12 @@ static inline const char *phy_modes(phy_interface_t interface) · 67 unmodified lines
175 return "rxaui";179 return "rxaui";
176 case PHY_INTERFACE_MODE_XAUI:180 case PHY_INTERFACE_MODE_XAUI:
177 return "xaui";181 return "xaui";
178 case PHY_INTERFACE_MODE_10GKR:182 case PHY_INTERFACE_MODE_10GBASER:
179 return "10gbase-kr";183 return "10gbase-r";
180 case PHY_INTERFACE_MODE_USXGMII:184 case PHY_INTERFACE_MODE_USXGMII:
181 return "usxgmii";185 return "usxgmii";
186 case PHY_INTERFACE_MODE_10GKR:
187 return "10gbase-kr";
182 default:188 default:
183 return "unknown";189 return "unknown";
184 }190 }
@@ -207,6 +213,15 @@ struct sfp_bus; · 22 unmodified lines
207struct sfp_upstream_ops;213struct sfp_upstream_ops;
208struct sk_buff;214struct sk_buff;
209 215
216struct mdio_bus_stats {
217 u64_stats_t transfers;
218 u64_stats_t errors;
219 u64_stats_t writes;
220 u64_stats_t reads;
221 /* Must be last, add new statistics above */
222 struct u64_stats_sync syncp;
223};
224
210/*225/*
211 * The Bus class for PHYs. Devices which provide access to226 * The Bus class for PHYs. Devices which provide access to
212 * PHYs should register using this structure227 * PHYs should register using this structure
@@ -219,6 +234,7 @@ struct mii_bus { · 6 unmodified lines
219 int (*read)(struct mii_bus *bus, int addr, int regnum);234 int (*read)(struct mii_bus *bus, int addr, int regnum);
220 int (*write)(struct mii_bus *bus, int addr, int regnum, u16 val);235 int (*write)(struct mii_bus *bus, int addr, int regnum, u16 val);
221 int (*reset)(struct mii_bus *bus);236 int (*reset)(struct mii_bus *bus);
237 struct mdio_bus_stats stats[PHY_MAX_ADDR];
222 238
223 /*239 /*
224 * A lock to ensure that only one thing can read/write240 * A lock to ensure that only one thing can read/write
@@ -327,6 +343,9 @@ struct phy_c45_device_ids { · 102 unmodified lines
327 u32 device_ids[8];343 u32 device_ids[8];
328};344};
329 345
346struct macsec_context;
347struct macsec_ops;
348
330/* phy_device: An instance of a PHY349/* phy_device: An instance of a PHY
331 *350 *
332 * drv: Pointer to the driver for this PHY instance351 * drv: Pointer to the driver for this PHY instance
@@ -349,6 +368,7 @@ struct phy_c45_device_ids { · 16 unmodified lines
349 * attached_dev: The attached enet driver's device instance ptr368 * attached_dev: The attached enet driver's device instance ptr
350 * adjust_link: Callback for the enet controller to respond to369 * adjust_link: Callback for the enet controller to respond to
351 * changes in the link state.370 * changes in the link state.
371 * macsec_ops: MACsec offloading ops.
352 *372 *
353 * speed, duplex, pause, supported, advertising, lp_advertising,373 * speed, duplex, pause, supported, advertising, lp_advertising,
354 * and autoneg are used like in mii_if_info374 * and autoneg are used like in mii_if_info
@@ -441,12 +461,18 @@ struct phy_device { · 86 unmodified lines
441 struct sfp_bus *sfp_bus;461 struct sfp_bus *sfp_bus;
442 struct phylink *phylink;462 struct phylink *phylink;
443 struct net_device *attached_dev;463 struct net_device *attached_dev;
464 struct mii_timestamper *mii_ts;
444 465
445 u8 mdix;466 u8 mdix;
446 u8 mdix_ctrl;467 u8 mdix_ctrl;
447 468
448 void (*phy_link_change)(struct phy_device *, bool up, bool do_carrier);469 void (*phy_link_change)(struct phy_device *, bool up, bool do_carrier);
449 void (*adjust_link)(struct net_device *dev);470 void (*adjust_link)(struct net_device *dev);
471
472#if IS_ENABLED(CONFIG_MACSEC)
473 /* MACsec management functions */
474 const struct macsec_ops *macsec_ops;
475#endif
450};476};
451#define to_phy_device(d) container_of(to_mdio_device(d), \477#define to_phy_device(d) container_of(to_mdio_device(d), \
452 struct phy_device, mdio)478 struct phy_device, mdio)
@@ -546,29 +572,6 @@ struct phy_driver { · 93 unmodified lines
546 */572 */
547 int (*match_phy_device)(struct phy_device *phydev);573 int (*match_phy_device)(struct phy_device *phydev);
548 574
549 /* Handles ethtool queries for hardware time stamping. */
550 int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti);
551
552 /* Handles SIOCSHWTSTAMP ioctl for hardware time stamping. */
553 int (*hwtstamp)(struct phy_device *phydev, struct ifreq *ifr);
554
555 /*
556 * Requests a Rx timestamp for 'skb'. If the skb is accepted,
557 * the phy driver promises to deliver it using netif_rx() as
558 * soon as a timestamp becomes available. One of the
559 * PTP_CLASS_ values is passed in 'type'. The function must
560 * return true if the skb is accepted for delivery.
561 */
562 bool (*rxtstamp)(struct phy_device *dev, struct sk_buff *skb, int type);
563
564 /*
565 * Requests a Tx timestamp for 'skb'. The phy driver promises
566 * to deliver it using skb_complete_tx_timestamp() as soon as a
567 * timestamp becomes available. One of the PTP_CLASS_ values
568 * is passed in 'type'.
569 */
570 void (*txtstamp)(struct phy_device *dev, struct sk_buff *skb, int type);
571
572 /* Some devices (e.g. qnap TS-119P II) require PHY register changes to575 /* Some devices (e.g. qnap TS-119P II) require PHY register changes to
573 * enable Wake on LAN, so set_wol is provided to be called in the576 * enable Wake on LAN, so set_wol is provided to be called in the
574 * ethernet driver's set_wol function. */577 * ethernet driver's set_wol function. */
@@ -936,6 +939,66 @@ static inline bool phy_polling_mode(struct phy_device *phydev) · 361 unmodified lines
936 return phydev->irq == PHY_POLL;939 return phydev->irq == PHY_POLL;
937}940}
938 941
942/**
943 * phy_has_hwtstamp - Tests whether a PHY time stamp configuration.
944 * @phydev: the phy_device struct
945 */
946static inline bool phy_has_hwtstamp(struct phy_device *phydev)
947{
948 return phydev && phydev->mii_ts && phydev->mii_ts->hwtstamp;
949}
950
951/**
952 * phy_has_rxtstamp - Tests whether a PHY supports receive time stamping.
953 * @phydev: the phy_device struct
954 */
955static inline bool phy_has_rxtstamp(struct phy_device *phydev)
956{
957 return phydev && phydev->mii_ts && phydev->mii_ts->rxtstamp;
958}
959
960/**
961 * phy_has_tsinfo - Tests whether a PHY reports time stamping and/or
962 * PTP hardware clock capabilities.
963 * @phydev: the phy_device struct
964 */
965static inline bool phy_has_tsinfo(struct phy_device *phydev)
966{
967 return phydev && phydev->mii_ts && phydev->mii_ts->ts_info;
968}
969
970/**
971 * phy_has_txtstamp - Tests whether a PHY supports transmit time stamping.
972 * @phydev: the phy_device struct
973 */
974static inline bool phy_has_txtstamp(struct phy_device *phydev)
975{
976 return phydev && phydev->mii_ts && phydev->mii_ts->txtstamp;
977}
978
979static inline int phy_hwtstamp(struct phy_device *phydev, struct ifreq *ifr)
980{
981 return phydev->mii_ts->hwtstamp(phydev->mii_ts, ifr);
982}
983
984static inline bool phy_rxtstamp(struct phy_device *phydev, struct sk_buff *skb,
985 int type)
986{
987 return phydev->mii_ts->rxtstamp(phydev->mii_ts, skb, type);
988}
989
990static inline int phy_ts_info(struct phy_device *phydev,
991 struct ethtool_ts_info *tsinfo)
992{
993 return phydev->mii_ts->ts_info(phydev->mii_ts, tsinfo);
994}
995
996static inline void phy_txtstamp(struct phy_device *phydev, struct sk_buff *skb,
997 int type)
998{
999 phydev->mii_ts->txtstamp(phydev->mii_ts, skb, type);
1000}
1001
939/**1002/**
940 * phy_is_internal - Convenience function for testing if a PHY is internal1003 * phy_is_internal - Convenience function for testing if a PHY is internal
941 * @phydev: the phy_device struct1004 * @phydev: the phy_device struct
@@ -1088,17 +1151,21 @@ static inline void phy_unlock_mdio_bus(struct phy_device *phydev) · 146 unmodified lines
1088 1151
1089void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)1152void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
1090 __printf(2, 3);1153 __printf(2, 3);
1154char *phy_attached_info_irq(struct phy_device *phydev)
1155 __malloc;
1091void phy_attached_info(struct phy_device *phydev);1156void phy_attached_info(struct phy_device *phydev);
1092 1157
1093/* Clause 22 PHY */1158/* Clause 22 PHY */
1094int genphy_read_abilities(struct phy_device *phydev);1159int genphy_read_abilities(struct phy_device *phydev);
1095int genphy_setup_forced(struct phy_device *phydev);1160int genphy_setup_forced(struct phy_device *phydev);
1096int genphy_restart_aneg(struct phy_device *phydev);1161int genphy_restart_aneg(struct phy_device *phydev);
1162int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart);
1097int genphy_config_eee_advert(struct phy_device *phydev);1163int genphy_config_eee_advert(struct phy_device *phydev);
1098int __genphy_config_aneg(struct phy_device *phydev, bool changed);1164int __genphy_config_aneg(struct phy_device *phydev, bool changed);
1099int genphy_aneg_done(struct phy_device *phydev);1165int genphy_aneg_done(struct phy_device *phydev);
1100int genphy_update_link(struct phy_device *phydev);1166int genphy_update_link(struct phy_device *phydev);
1101int genphy_read_lpa(struct phy_device *phydev);1167int genphy_read_lpa(struct phy_device *phydev);
1168int genphy_read_status_fixed(struct phy_device *phydev);
1102int genphy_read_status(struct phy_device *phydev);1169int genphy_read_status(struct phy_device *phydev);
1103int genphy_suspend(struct phy_device *phydev);1170int genphy_suspend(struct phy_device *phydev);
1104int genphy_resume(struct phy_device *phydev);1171int genphy_resume(struct phy_device *phydev);
@@ -1175,6 +1242,8 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev, · 70 unmodified lines
1175int phy_ethtool_ksettings_set(struct phy_device *phydev,1242int phy_ethtool_ksettings_set(struct phy_device *phydev,
1176 const struct ethtool_link_ksettings *cmd);1243 const struct ethtool_link_ksettings *cmd);
1177int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);1244int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
1245int phy_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
1246int phy_do_ioctl_running(struct net_device *dev, struct ifreq *ifr, int cmd);
1178void phy_request_interrupt(struct phy_device *phydev);1247void phy_request_interrupt(struct phy_device *phydev);
1179void phy_free_interrupt(struct phy_device *phydev);1248void phy_free_interrupt(struct phy_device *phydev);
1180void phy_print_status(struct phy_device *phydev);1249void phy_print_status(struct phy_device *phydev);
include/linux/phylink.h+2−0
@@ -63,10 +63,12 @@ enum phylink_op_type { · 62 unmodified lines
63 * struct phylink_config - PHYLINK configuration structure63 * struct phylink_config - PHYLINK configuration structure
64 * @dev: a pointer to a struct device associated with the MAC64 * @dev: a pointer to a struct device associated with the MAC
65 * @type: operation type of PHYLINK instance65 * @type: operation type of PHYLINK instance
66 * @pcs_poll: MAC PCS cannot provide link change interrupt
66 */67 */
67struct phylink_config {68struct phylink_config {
68 struct device *dev;69 struct device *dev;
69 enum phylink_op_type type;70 enum phylink_op_type type;
71 bool pcs_poll;
70};72};
71 73
72/**74/**
include/linux/platform_data/eth_ixp4xx.h+19−0
@@ -0,0 +1,19 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __PLATFORM_DATA_ETH_IXP4XX
3#define __PLATFORM_DATA_ETH_IXP4XX
4
5#include <linux/types.h>
6
7#define IXP4XX_ETH_NPEA 0x00
8#define IXP4XX_ETH_NPEB 0x10
9#define IXP4XX_ETH_NPEC 0x20
10
11/* Information about built-in Ethernet MAC interfaces */
12struct eth_plat_info {
13 u8 phy; /* MII PHY ID, 0 - 31 */
14 u8 rxq; /* configurable, currently 0 - 31 only */
15 u8 txreadyq;
16 u8 hwaddr[6];
17};
18
19#endif
include/linux/platform_data/wan_ixp4xx_hss.h+17−0
@@ -0,0 +1,17 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __PLATFORM_DATA_WAN_IXP4XX_HSS_H
3#define __PLATFORM_DATA_WAN_IXP4XX_HSS_H
4
5#include <linux/types.h>
6
7/* Information about built-in HSS (synchronous serial) interfaces */
8struct hss_plat_info {
9 int (*set_clock)(int port, unsigned int clock_type);
10 int (*open)(int port, void *pdev,
11 void (*set_carrier_cb)(void *pdev, int carrier));
12 void (*close)(int port, void *pdev);
13 u8 txreadyq;
14 u32 timer_freq;
15};
16
17#endif
include/linux/ptp_clock_kernel.h+9−0
@@ -243,6 +243,13 @@ int ptp_find_pin(struct ptp_clock *ptp, · 242 unmodified lines
243 243
244int ptp_schedule_worker(struct ptp_clock *ptp, unsigned long delay);244int ptp_schedule_worker(struct ptp_clock *ptp, unsigned long delay);
245 245
246/**
247 * ptp_cancel_worker_sync() - cancel ptp auxiliary clock
248 *
249 * @ptp: The clock obtained from ptp_clock_register().
250 */
251void ptp_cancel_worker_sync(struct ptp_clock *ptp);
252
246#else253#else
247static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,254static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
248 struct device *parent)255 struct device *parent)
@@ -260,6 +267,8 @@ static inline int ptp_find_pin(struct ptp_clock *ptp, · 11 unmodified lines
260static inline int ptp_schedule_worker(struct ptp_clock *ptp,267static inline int ptp_schedule_worker(struct ptp_clock *ptp,
261 unsigned long delay)268 unsigned long delay)
262{ return -EOPNOTSUPP; }269{ return -EOPNOTSUPP; }
270static inline void ptp_cancel_worker_sync(struct ptp_clock *ptp)
271{ }
263 272
264#endif273#endif
265 274
include/linux/ptr_ring.h+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
23#include <linux/types.h>23#include <linux/types.h>
24#include <linux/compiler.h>24#include <linux/compiler.h>
25#include <linux/slab.h>25#include <linux/slab.h>
26#include <linux/mm.h>
26#include <asm/errno.h>27#include <asm/errno.h>
27#endif28#endif
28 29
include/linux/qed/common_hsi.h+29−15
@@ -76,7 +76,6 @@ · 75 unmodified lines
76 76
77#define FW_ASSERT_GENERAL_ATTN_IDX 3277#define FW_ASSERT_GENERAL_ATTN_IDX 32
78 78
79#define MAX_PINNED_CCFC 32
80 79
81/* Queue Zone sizes in bytes */80/* Queue Zone sizes in bytes */
82#define TSTORM_QZONE_SIZE 881#define TSTORM_QZONE_SIZE 8
@@ -105,12 +104,19 @@ · 22 unmodified lines
105 104
106#define CORE_SPQE_PAGE_SIZE_BYTES 4096105#define CORE_SPQE_PAGE_SIZE_BYTES 4096
107 106
108#define MAX_NUM_LL2_RX_QUEUES 48107/* Number of LL2 RAM based queues */
109#define MAX_NUM_LL2_TX_STATS_COUNTERS 48108#define MAX_NUM_LL2_RX_RAM_QUEUES 32
109
110/* Number of LL2 context based queues */
111#define MAX_NUM_LL2_RX_CTX_QUEUES 208
112#define MAX_NUM_LL2_RX_QUEUES \
113 (MAX_NUM_LL2_RX_RAM_QUEUES + MAX_NUM_LL2_RX_CTX_QUEUES)
114
115#define MAX_NUM_LL2_TX_STATS_COUNTERS 48
110 116
111#define FW_MAJOR_VERSION 8117#define FW_MAJOR_VERSION 8
112#define FW_MINOR_VERSION 37118#define FW_MINOR_VERSION 42
113#define FW_REVISION_VERSION 7119#define FW_REVISION_VERSION 2
114#define FW_ENGINEERING_VERSION 0120#define FW_ENGINEERING_VERSION 0
115 121
116/***********************/122/***********************/
@@ -132,10 +138,10 @@ · 15 unmodified lines
132#define MAX_NUM_VFS (MAX_NUM_VFS_K2)138#define MAX_NUM_VFS (MAX_NUM_VFS_K2)
133 139
134#define MAX_NUM_FUNCTIONS_BB (MAX_NUM_PFS_BB + MAX_NUM_VFS_BB)140#define MAX_NUM_FUNCTIONS_BB (MAX_NUM_PFS_BB + MAX_NUM_VFS_BB)
135#define MAX_NUM_FUNCTIONS (MAX_NUM_PFS + MAX_NUM_VFS)
136 141
137#define MAX_FUNCTION_NUMBER_BB (MAX_NUM_PFS + MAX_NUM_VFS_BB)142#define MAX_FUNCTION_NUMBER_BB (MAX_NUM_PFS + MAX_NUM_VFS_BB)
138#define MAX_FUNCTION_NUMBER (MAX_NUM_PFS + MAX_NUM_VFS)143#define MAX_FUNCTION_NUMBER_K2 (MAX_NUM_PFS + MAX_NUM_VFS_K2)
144#define MAX_NUM_FUNCTIONS (MAX_FUNCTION_NUMBER_K2)
139 145
140#define MAX_NUM_VPORTS_K2 (208)146#define MAX_NUM_VPORTS_K2 (208)
141#define MAX_NUM_VPORTS_BB (160)147#define MAX_NUM_VPORTS_BB (160)
@@ -222,6 +228,7 @@ · 80 unmodified lines
222#define DQ_XCM_TOE_TX_BD_PROD_CMD DQ_XCM_AGG_VAL_SEL_WORD4228#define DQ_XCM_TOE_TX_BD_PROD_CMD DQ_XCM_AGG_VAL_SEL_WORD4
223#define DQ_XCM_TOE_MORE_TO_SEND_SEQ_CMD DQ_XCM_AGG_VAL_SEL_REG3229#define DQ_XCM_TOE_MORE_TO_SEND_SEQ_CMD DQ_XCM_AGG_VAL_SEL_REG3
224#define DQ_XCM_TOE_LOCAL_ADV_WND_SEQ_CMD DQ_XCM_AGG_VAL_SEL_REG4230#define DQ_XCM_TOE_LOCAL_ADV_WND_SEQ_CMD DQ_XCM_AGG_VAL_SEL_REG4
231#define DQ_XCM_ROCE_ACK_EDPM_DORQ_SEQ_CMD DQ_XCM_AGG_VAL_SEL_WORD5
225 232
226/* UCM agg val selection (HW) */233/* UCM agg val selection (HW) */
227#define DQ_UCM_AGG_VAL_SEL_WORD0 0234#define DQ_UCM_AGG_VAL_SEL_WORD0 0
@@ -340,6 +347,10 @@ · 112 unmodified lines
340#define DQ_PWM_OFFSET_TCM_ROCE_RQ_PROD (DQ_PWM_OFFSET_TCM16_BASE + 1)347#define DQ_PWM_OFFSET_TCM_ROCE_RQ_PROD (DQ_PWM_OFFSET_TCM16_BASE + 1)
341#define DQ_PWM_OFFSET_TCM_IWARP_RQ_PROD (DQ_PWM_OFFSET_TCM16_BASE + 3)348#define DQ_PWM_OFFSET_TCM_IWARP_RQ_PROD (DQ_PWM_OFFSET_TCM16_BASE + 3)
342 349
350/* DQ_DEMS_AGG_VAL_BASE */
351#define DQ_PWM_OFFSET_TCM_LL2_PROD_UPDATE \
352 (DQ_PWM_OFFSET_TCM32_BASE + DQ_TCM_AGG_VAL_SEL_REG9 - 4)
353
343#define DQ_REGION_SHIFT (12)354#define DQ_REGION_SHIFT (12)
344 355
345/* DPM */356/* DPM */
@@ -395,6 +406,7 @@ · 49 unmodified lines
395 406
396/* Number of Protocol Indices per Status Block */407/* Number of Protocol Indices per Status Block */
397#define PIS_PER_SB_E4 12408#define PIS_PER_SB_E4 12
409#define MAX_PIS_PER_SB PIS_PER_SB
398 410
399#define CAU_HC_STOPPED_STATE 3411#define CAU_HC_STOPPED_STATE 3
400#define CAU_HC_DISABLE_STATE 4412#define CAU_HC_DISABLE_STATE 4
@@ -425,8 +437,6 @@ · 24 unmodified lines
425#define IGU_MEM_PBA_MSIX_RESERVED_UPPER 0x03ff437#define IGU_MEM_PBA_MSIX_RESERVED_UPPER 0x03ff
426 438
427#define IGU_CMD_INT_ACK_BASE 0x0400439#define IGU_CMD_INT_ACK_BASE 0x0400
428#define IGU_CMD_INT_ACK_UPPER (IGU_CMD_INT_ACK_BASE + \
429 MAX_TOT_SB_PER_PATH - 1)
430#define IGU_CMD_INT_ACK_RESERVED_UPPER 0x05ff440#define IGU_CMD_INT_ACK_RESERVED_UPPER 0x05ff
431 441
432#define IGU_CMD_ATTN_BIT_UPD_UPPER 0x05f0442#define IGU_CMD_ATTN_BIT_UPD_UPPER 0x05f0
@@ -439,8 +449,6 @@ · 6 unmodified lines
439#define IGU_REG_SISR_MDPC_WOMASK_UPPER 0x05f6449#define IGU_REG_SISR_MDPC_WOMASK_UPPER 0x05f6
440 450
441#define IGU_CMD_PROD_UPD_BASE 0x0600451#define IGU_CMD_PROD_UPD_BASE 0x0600
442#define IGU_CMD_PROD_UPD_UPPER (IGU_CMD_PROD_UPD_BASE +\
443 MAX_TOT_SB_PER_PATH - 1)
444#define IGU_CMD_PROD_UPD_RESERVED_UPPER 0x07ff452#define IGU_CMD_PROD_UPD_RESERVED_UPPER 0x07ff
445 453
446/*****************/454/*****************/
@@ -652,8 +660,8 @@ · 205 unmodified lines
652#define PBF_MAX_CMD_LINES 3328660#define PBF_MAX_CMD_LINES 3328
653 661
654/* Number of BTB blocks. Each block is 256B. */662/* Number of BTB blocks. Each block is 256B. */
655#define BTB_MAX_BLOCKS 1440663#define BTB_MAX_BLOCKS_BB 1440
656 664#define BTB_MAX_BLOCKS_K2 1840
657/*****************/665/*****************/
658/* PRS CONSTANTS */666/* PRS CONSTANTS */
659/*****************/667/*****************/
@@ -730,6 +738,8 @@ enum protocol_type { · 70 unmodified lines
730 PROTOCOLID_PREROCE,738 PROTOCOLID_PREROCE,
731 PROTOCOLID_COMMON,739 PROTOCOLID_COMMON,
732 PROTOCOLID_RESERVED1,740 PROTOCOLID_RESERVED1,
741 PROTOCOLID_RDMA,
742 PROTOCOLID_SCSI,
733 MAX_PROTOCOL_TYPE743 MAX_PROTOCOL_TYPE
734};744};
735 745
@@ -750,6 +760,10 @@ union rdma_eqe_data { · 14 unmodified lines
750 struct rdma_eqe_destroy_qp rdma_destroy_qp_data;760 struct rdma_eqe_destroy_qp rdma_destroy_qp_data;
751};761};
752 762
763struct tstorm_queue_zone {
764 __le32 reserved[2];
765};
766
753/* Ustorm Queue Zone */767/* Ustorm Queue Zone */
754struct ustorm_eth_queue_zone {768struct ustorm_eth_queue_zone {
755 struct coalescing_timeset int_coalescing_timeset;769 struct coalescing_timeset int_coalescing_timeset;
@@ -872,8 +886,8 @@ struct db_l2_dpm_data { · 116 unmodified lines
872#define DB_L2_DPM_DATA_RESERVED0_SHIFT 27886#define DB_L2_DPM_DATA_RESERVED0_SHIFT 27
873#define DB_L2_DPM_DATA_SGE_NUM_MASK 0x7887#define DB_L2_DPM_DATA_SGE_NUM_MASK 0x7
874#define DB_L2_DPM_DATA_SGE_NUM_SHIFT 28888#define DB_L2_DPM_DATA_SGE_NUM_SHIFT 28
875#define DB_L2_DPM_DATA_GFS_SRC_EN_MASK 0x1889#define DB_L2_DPM_DATA_TGFS_SRC_EN_MASK 0x1
876#define DB_L2_DPM_DATA_GFS_SRC_EN_SHIFT 31890#define DB_L2_DPM_DATA_TGFS_SRC_EN_SHIFT 31
877};891};
878 892
879/* Structure for SGE in a DPM doorbell of type DPM_L2_BD */893/* Structure for SGE in a DPM doorbell of type DPM_L2_BD */
include/linux/qed/eth_common.h+56−22
@@ -38,9 +38,11 @@ · 37 unmodified lines
38/********************/38/********************/
39 39
40#define ETH_HSI_VER_MAJOR 340#define ETH_HSI_VER_MAJOR 3
41#define ETH_HSI_VER_MINOR 1041#define ETH_HSI_VER_MINOR 11
42 42
43#define ETH_HSI_VER_NO_PKT_LEN_TUNN 543#define ETH_HSI_VER_NO_PKT_LEN_TUNN 5
44/* Maximum number of pinned L2 connections (CIDs) */
45#define ETH_PINNED_CONN_MAX_NUM 32
44 46
45#define ETH_CACHE_LINE_SIZE 6447#define ETH_CACHE_LINE_SIZE 64
46#define ETH_RX_CQE_GAP 3248#define ETH_RX_CQE_GAP 32
@@ -61,6 +63,7 @@ · 14 unmodified lines
61#define ETH_TX_MIN_BDS_PER_TUNN_IPV6_WITH_EXT_PKT 363#define ETH_TX_MIN_BDS_PER_TUNN_IPV6_WITH_EXT_PKT 3
62#define ETH_TX_MIN_BDS_PER_IPV6_WITH_EXT_PKT 264#define ETH_TX_MIN_BDS_PER_IPV6_WITH_EXT_PKT 2
63#define ETH_TX_MIN_BDS_PER_PKT_W_LOOPBACK_MODE 265#define ETH_TX_MIN_BDS_PER_PKT_W_LOOPBACK_MODE 2
66#define ETH_TX_MIN_BDS_PER_PKT_W_VPORT_FORWARDING 4
64#define ETH_TX_MAX_NON_LSO_PKT_LEN (9700 - (4 + 4 + 12 + 8))67#define ETH_TX_MAX_NON_LSO_PKT_LEN (9700 - (4 + 4 + 12 + 8))
65#define ETH_TX_MAX_LSO_HDR_BYTES 51068#define ETH_TX_MAX_LSO_HDR_BYTES 510
66#define ETH_TX_LSO_WINDOW_BDS_NUM (18 - 1)69#define ETH_TX_LSO_WINDOW_BDS_NUM (18 - 1)
@@ -75,9 +78,8 @@ · 8 unmodified lines
75#define ETH_NUM_STATISTIC_COUNTERS_QUAD_VF_ZONE \78#define ETH_NUM_STATISTIC_COUNTERS_QUAD_VF_ZONE \
76 (ETH_NUM_STATISTIC_COUNTERS - 3 * MAX_NUM_VFS / 4)79 (ETH_NUM_STATISTIC_COUNTERS - 3 * MAX_NUM_VFS / 4)
77 80
78/* Maximum number of buffers, used for RX packet placement */
79#define ETH_RX_MAX_BUFF_PER_PKT 581#define ETH_RX_MAX_BUFF_PER_PKT 5
80#define ETH_RX_BD_THRESHOLD 1282#define ETH_RX_BD_THRESHOLD 16
81 83
82/* Num of MAC/VLAN filters */84/* Num of MAC/VLAN filters */
83#define ETH_NUM_MAC_FILTERS 51285#define ETH_NUM_MAC_FILTERS 512
@@ -96,24 +98,24 @@ · 12 unmodified lines
96#define ETH_RSS_ENGINE_NUM_BB 12798#define ETH_RSS_ENGINE_NUM_BB 127
97 99
98/* TPA constants */100/* TPA constants */
99#define ETH_TPA_MAX_AGGS_NUM 64101#define ETH_TPA_MAX_AGGS_NUM 64
100#define ETH_TPA_CQE_START_LEN_LIST_SIZE ETH_RX_MAX_BUFF_PER_PKT102#define ETH_TPA_CQE_START_BW_LEN_LIST_SIZE 2
101#define ETH_TPA_CQE_CONT_LEN_LIST_SIZE 6103#define ETH_TPA_CQE_CONT_LEN_LIST_SIZE 6
102#define ETH_TPA_CQE_END_LEN_LIST_SIZE 4104#define ETH_TPA_CQE_END_LEN_LIST_SIZE 4
103 105
104/* Control frame check constants */106/* Control frame check constants */
105#define ETH_CTL_FRAME_ETH_TYPE_NUM 4107#define ETH_CTL_FRAME_ETH_TYPE_NUM 4
106 108
107/* GFS constants */109/* GFS constants */
108#define ETH_GFT_TRASHCAN_VPORT 0x1FF /* GFT drop flow vport number */110#define ETH_GFT_TRASHCAN_VPORT 0x1FF /* GFT drop flow vport number */
109 111
110/* Destination port mode */112/* Destination port mode */
111enum dest_port_mode {113enum dst_port_mode {
112 DEST_PORT_PHY,114 DST_PORT_PHY,
113 DEST_PORT_LOOPBACK,115 DST_PORT_LOOPBACK,
114 DEST_PORT_PHY_LOOPBACK,116 DST_PORT_PHY_LOOPBACK,
115 DEST_PORT_DROP,117 DST_PORT_DROP,
116 MAX_DEST_PORT_MODE118 MAX_DST_PORT_MODE
117};119};
118 120
119/* Ethernet address type */121/* Ethernet address type */
@@ -167,8 +169,8 @@ struct eth_tx_data_2nd_bd { · 47 unmodified lines
167#define ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_SHIFT 0169#define ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_SHIFT 0
168#define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_MASK 0x3170#define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_MASK 0x3
169#define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_SHIFT 4171#define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_SHIFT 4
170#define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_MASK 0x3172#define ETH_TX_DATA_2ND_BD_DST_PORT_MODE_MASK 0x3
171#define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_SHIFT 6173#define ETH_TX_DATA_2ND_BD_DST_PORT_MODE_SHIFT 6
172#define ETH_TX_DATA_2ND_BD_START_BD_MASK 0x1174#define ETH_TX_DATA_2ND_BD_START_BD_MASK 0x1
173#define ETH_TX_DATA_2ND_BD_START_BD_SHIFT 8175#define ETH_TX_DATA_2ND_BD_START_BD_SHIFT 8
174#define ETH_TX_DATA_2ND_BD_TUNN_TYPE_MASK 0x3176#define ETH_TX_DATA_2ND_BD_TUNN_TYPE_MASK 0x3
@@ -244,8 +246,9 @@ struct eth_fast_path_rx_reg_cqe { · 69 unmodified lines
244 struct eth_tunnel_parsing_flags tunnel_pars_flags;246 struct eth_tunnel_parsing_flags tunnel_pars_flags;
245 u8 bd_num;247 u8 bd_num;
246 u8 reserved;248 u8 reserved;
247 __le16 flow_id;249 __le16 reserved2;
248 u8 reserved1[11];250 __le32 flow_id_or_resource_id;
251 u8 reserved1[7];
249 struct eth_pmd_flow_flags pmd_flags;252 struct eth_pmd_flow_flags pmd_flags;
250};253};
251 254
@@ -296,9 +299,10 @@ struct eth_fast_path_rx_tpa_start_cqe { · 44 unmodified lines
296 struct eth_tunnel_parsing_flags tunnel_pars_flags;299 struct eth_tunnel_parsing_flags tunnel_pars_flags;
297 u8 tpa_agg_index;300 u8 tpa_agg_index;
298 u8 header_len;301 u8 header_len;
299 __le16 ext_bd_len_list[ETH_TPA_CQE_START_LEN_LIST_SIZE];302 __le16 bw_ext_bd_len_list[ETH_TPA_CQE_START_BW_LEN_LIST_SIZE];
300 __le16 flow_id;303 __le16 reserved2;
301 u8 reserved;304 __le32 flow_id_or_resource_id;
305 u8 reserved[3];
302 struct eth_pmd_flow_flags pmd_flags;306 struct eth_pmd_flow_flags pmd_flags;
303};307};
304 308
@@ -407,6 +411,29 @@ struct eth_tx_3rd_bd { · 102 unmodified lines
407 struct eth_tx_data_3rd_bd data;411 struct eth_tx_data_3rd_bd data;
408};412};
409 413
414/* The parsing information data for the forth tx bd of a given packet. */
415struct eth_tx_data_4th_bd {
416 u8 dst_vport_id;
417 u8 reserved4;
418 __le16 bitfields;
419#define ETH_TX_DATA_4TH_BD_DST_VPORT_ID_VALID_MASK 0x1
420#define ETH_TX_DATA_4TH_BD_DST_VPORT_ID_VALID_SHIFT 0
421#define ETH_TX_DATA_4TH_BD_RESERVED1_MASK 0x7F
422#define ETH_TX_DATA_4TH_BD_RESERVED1_SHIFT 1
423#define ETH_TX_DATA_4TH_BD_START_BD_MASK 0x1
424#define ETH_TX_DATA_4TH_BD_START_BD_SHIFT 8
425#define ETH_TX_DATA_4TH_BD_RESERVED2_MASK 0x7F
426#define ETH_TX_DATA_4TH_BD_RESERVED2_SHIFT 9
427 __le16 reserved3;
428};
429
430/* The forth tx bd of a given packet */
431struct eth_tx_4th_bd {
432 struct regpair addr; /* Single continuous buffer */
433 __le16 nbytes; /* Number of bytes in this BD */
434 struct eth_tx_data_4th_bd data; /* Parsing information data */
435};
436
410/* Complementary information for the regular tx bd of a given packet */437/* Complementary information for the regular tx bd of a given packet */
411struct eth_tx_data_bd {438struct eth_tx_data_bd {
412 __le16 reserved0;439 __le16 reserved0;
@@ -431,6 +458,7 @@ union eth_tx_bd_types { · 18 unmodified lines
431 struct eth_tx_1st_bd first_bd;458 struct eth_tx_1st_bd first_bd;
432 struct eth_tx_2nd_bd second_bd;459 struct eth_tx_2nd_bd second_bd;
433 struct eth_tx_3rd_bd third_bd;460 struct eth_tx_3rd_bd third_bd;
461 struct eth_tx_4th_bd fourth_bd;
434 struct eth_tx_bd reg_bd;462 struct eth_tx_bd reg_bd;
435};463};
436 464
@@ -443,6 +471,12 @@ enum eth_tx_tunn_type { · 6 unmodified lines
443 MAX_ETH_TX_TUNN_TYPE471 MAX_ETH_TX_TUNN_TYPE
444};472};
445 473
474/* Mstorm Queue Zone */
475struct mstorm_eth_queue_zone {
476 struct eth_rx_prod_data rx_producers;
477 __le32 reserved[3];
478};
479
446/* Ystorm Queue Zone */480/* Ystorm Queue Zone */
447struct xstorm_eth_queue_zone {481struct xstorm_eth_queue_zone {
448 struct coalescing_timeset int_coalescing_timeset;482 struct coalescing_timeset int_coalescing_timeset;
include/linux/qed/iscsi_common.h+24−40
@@ -999,7 +999,6 @@ struct iscsi_conn_offload_params { · 998 unmodified lines
999 struct regpair r2tq_pbl_addr;999 struct regpair r2tq_pbl_addr;
1000 struct regpair xhq_pbl_addr;1000 struct regpair xhq_pbl_addr;
1001 struct regpair uhq_pbl_addr;1001 struct regpair uhq_pbl_addr;
1002 __le32 initial_ack;
1003 __le16 physical_q0;1002 __le16 physical_q0;
1004 __le16 physical_q1;1003 __le16 physical_q1;
1005 u8 flags;1004 u8 flags;
@@ -1011,10 +1010,10 @@ struct iscsi_conn_offload_params { · 5 unmodified lines
1011#define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_SHIFT 21010#define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_SHIFT 2
1012#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_MASK 0x1F1011#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_MASK 0x1F
1013#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_SHIFT 31012#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_SHIFT 3
1014 u8 pbl_page_size_log;
1015 u8 pbe_page_size_log;
1016 u8 default_cq;1013 u8 default_cq;
1014 __le16 reserved0;
1017 __le32 stat_sn;1015 __le32 stat_sn;
1016 __le32 initial_ack;
1018};1017};
1019 1018
1020/* iSCSI connection statistics */1019/* iSCSI connection statistics */
@@ -1029,25 +1028,14 @@ struct iscsi_conn_stats_params { · 8 unmodified lines
1029 __le32 reserved;1028 __le32 reserved;
1030};1029};
1031 1030
1032/* spe message header */
1033struct iscsi_slow_path_hdr {
1034 u8 op_code;
1035 u8 flags;
1036#define ISCSI_SLOW_PATH_HDR_RESERVED0_MASK 0xF
1037#define ISCSI_SLOW_PATH_HDR_RESERVED0_SHIFT 0
1038#define ISCSI_SLOW_PATH_HDR_LAYER_CODE_MASK 0x7
1039#define ISCSI_SLOW_PATH_HDR_LAYER_CODE_SHIFT 4
1040#define ISCSI_SLOW_PATH_HDR_RESERVED1_MASK 0x1
1041#define ISCSI_SLOW_PATH_HDR_RESERVED1_SHIFT 7
1042};
1043 1031
1044/* iSCSI connection update params passed by driver to FW in ISCSI update1032/* iSCSI connection update params passed by driver to FW in ISCSI update
1045 *ramrod.1033 *ramrod.
1046 */1034 */
1047struct iscsi_conn_update_ramrod_params {1035struct iscsi_conn_update_ramrod_params {
1048 struct iscsi_slow_path_hdr hdr;1036 __le16 reserved0;
1049 __le16 conn_id;1037 __le16 conn_id;
1050 __le32 fw_cid;1038 __le32 reserved1;
1051 u8 flags;1039 u8 flags;
1052#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_MASK 0x11040#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_MASK 0x1
1053#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_SHIFT 01041#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_SHIFT 0
@@ -1065,7 +1053,7 @@ struct iscsi_conn_update_ramrod_params { · 11 unmodified lines
1065#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_SHIFT 61053#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_SHIFT 6
1066#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_MASK 0x11054#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_MASK 0x1
1067#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_SHIFT 71055#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_SHIFT 7
1068 u8 reserved0[3];1056 u8 reserved3[3];
1069 __le32 max_seq_size;1057 __le32 max_seq_size;
1070 __le32 max_send_pdu_length;1058 __le32 max_send_pdu_length;
1071 __le32 max_recv_pdu_length;1059 __le32 max_recv_pdu_length;
@@ -1251,22 +1239,22 @@ enum iscsi_ramrod_cmd_id { · 179 unmodified lines
1251 1239
1252/* iSCSI connection termination request */1240/* iSCSI connection termination request */
1253struct iscsi_spe_conn_mac_update {1241struct iscsi_spe_conn_mac_update {
1254 struct iscsi_slow_path_hdr hdr;1242 __le16 reserved0;
1255 __le16 conn_id;1243 __le16 conn_id;
1256 __le32 fw_cid;1244 __le32 reserved1;
1257 __le16 remote_mac_addr_lo;1245 __le16 remote_mac_addr_lo;
1258 __le16 remote_mac_addr_mid;1246 __le16 remote_mac_addr_mid;
1259 __le16 remote_mac_addr_hi;1247 __le16 remote_mac_addr_hi;
1260 u8 reserved0[2];1248 u8 reserved2[2];
1261};1249};
1262 1250
1263/* iSCSI and TCP connection (Option 1) offload params passed by driver to FW in1251/* iSCSI and TCP connection (Option 1) offload params passed by driver to FW in
1264 * iSCSI offload ramrod.1252 * iSCSI offload ramrod.
1265 */1253 */
1266struct iscsi_spe_conn_offload {1254struct iscsi_spe_conn_offload {
1267 struct iscsi_slow_path_hdr hdr;1255 __le16 reserved0;
1268 __le16 conn_id;1256 __le16 conn_id;
1269 __le32 fw_cid;1257 __le32 reserved1;
1270 struct iscsi_conn_offload_params iscsi;1258 struct iscsi_conn_offload_params iscsi;
1271 struct tcp_offload_params tcp;1259 struct tcp_offload_params tcp;
1272};1260};
@@ -1275,44 +1263,36 @@ struct iscsi_spe_conn_offload { · 2 unmodified lines
1275 * iSCSI offload ramrod.1263 * iSCSI offload ramrod.
1276 */1264 */
1277struct iscsi_spe_conn_offload_option2 {1265struct iscsi_spe_conn_offload_option2 {
1278 struct iscsi_slow_path_hdr hdr;1266 __le16 reserved0;
1279 __le16 conn_id;1267 __le16 conn_id;
1280 __le32 fw_cid;1268 __le32 reserved1;
1281 struct iscsi_conn_offload_params iscsi;1269 struct iscsi_conn_offload_params iscsi;
1282 struct tcp_offload_params_opt2 tcp;1270 struct tcp_offload_params_opt2 tcp;
1283};1271};
1284 1272
1285/* iSCSI collect connection statistics request */1273/* iSCSI collect connection statistics request */
1286struct iscsi_spe_conn_statistics {1274struct iscsi_spe_conn_statistics {
1287 struct iscsi_slow_path_hdr hdr;1275 __le16 reserved0;
1288 __le16 conn_id;1276 __le16 conn_id;
1289 __le32 fw_cid;1277 __le32 reserved1;
1290 u8 reset_stats;1278 u8 reset_stats;
1291 u8 reserved0[7];1279 u8 reserved2[7];
1292 struct regpair stats_cnts_addr;1280 struct regpair stats_cnts_addr;
1293};1281};
1294 1282
1295/* iSCSI connection termination request */1283/* iSCSI connection termination request */
1296struct iscsi_spe_conn_termination {1284struct iscsi_spe_conn_termination {
1297 struct iscsi_slow_path_hdr hdr;1285 __le16 reserved0;
1298 __le16 conn_id;1286 __le16 conn_id;
1299 __le32 fw_cid;1287 __le32 reserved1;
1300 u8 abortive;1288 u8 abortive;
1301 u8 reserved0[7];1289 u8 reserved2[7];
1302 struct regpair queue_cnts_addr;1290 struct regpair queue_cnts_addr;
1303 struct regpair query_params_addr;1291 struct regpair query_params_addr;
1304};1292};
1305 1293
1306/* iSCSI firmware function destroy parameters */
1307struct iscsi_spe_func_dstry {
1308 struct iscsi_slow_path_hdr hdr;
1309 __le16 reserved0;
1310 __le32 reserved1;
1311};
1312
1313/* iSCSI firmware function init parameters */1294/* iSCSI firmware function init parameters */
1314struct iscsi_spe_func_init {1295struct iscsi_spe_func_init {
1315 struct iscsi_slow_path_hdr hdr;
1316 __le16 half_way_close_timeout;1296 __le16 half_way_close_timeout;
1317 u8 num_sq_pages_in_ring;1297 u8 num_sq_pages_in_ring;
1318 u8 num_r2tq_pages_in_ring;1298 u8 num_r2tq_pages_in_ring;
@@ -1324,8 +1304,12 @@ struct iscsi_spe_func_init { · 5 unmodified lines
1324#define ISCSI_SPE_FUNC_INIT_RESERVED0_MASK 0x7F1304#define ISCSI_SPE_FUNC_INIT_RESERVED0_MASK 0x7F
1325#define ISCSI_SPE_FUNC_INIT_RESERVED0_SHIFT 11305#define ISCSI_SPE_FUNC_INIT_RESERVED0_SHIFT 1
1326 struct iscsi_debug_modes debug_mode;1306 struct iscsi_debug_modes debug_mode;
1327 __le16 reserved1;1307 u8 params;
1328 __le32 reserved2;1308#define ISCSI_SPE_FUNC_INIT_MAX_SYN_RT_MASK 0xF
1309#define ISCSI_SPE_FUNC_INIT_MAX_SYN_RT_SHIFT 0
1310#define ISCSI_SPE_FUNC_INIT_RESERVED1_MASK 0xF
1311#define ISCSI_SPE_FUNC_INIT_RESERVED1_SHIFT 4
1312 u8 reserved2[7];
1329 struct scsi_init_func_params func_params;1313 struct scsi_init_func_params func_params;
1330 struct scsi_init_func_queues q_params;1314 struct scsi_init_func_queues q_params;
1331};1315};
include/linux/qed/qed_if.h+13−1
@@ -159,6 +159,7 @@ struct qed_dcbx_get { · 158 unmodified lines
159enum qed_nvm_images {159enum qed_nvm_images {
160 QED_NVM_IMAGE_ISCSI_CFG,160 QED_NVM_IMAGE_ISCSI_CFG,
161 QED_NVM_IMAGE_FCOE_CFG,161 QED_NVM_IMAGE_FCOE_CFG,
162 QED_NVM_IMAGE_MDUMP,
162 QED_NVM_IMAGE_NVM_CFG1,163 QED_NVM_IMAGE_NVM_CFG1,
163 QED_NVM_IMAGE_DEFAULT_CFG,164 QED_NVM_IMAGE_DEFAULT_CFG,
164 QED_NVM_IMAGE_NVM_META,165 QED_NVM_IMAGE_NVM_META,
@@ -463,7 +464,7 @@ enum qed_db_rec_space { · 298 unmodified lines
463 464
464#define DIRECT_REG_RD(reg_addr) readl((void __iomem *)(reg_addr))465#define DIRECT_REG_RD(reg_addr) readl((void __iomem *)(reg_addr))
465 466
466#define DIRECT_REG_WR64(reg_addr, val) writeq((u32)val, \467#define DIRECT_REG_WR64(reg_addr, val) writeq((u64)val, \
467 (void __iomem *)(reg_addr))468 (void __iomem *)(reg_addr))
468 469
469#define QED_COALESCE_MAX 0x1FF470#define QED_COALESCE_MAX 0x1FF
@@ -1177,6 +1178,17 @@ struct qed_common_ops { · 707 unmodified lines
1177#define GET_FIELD(value, name) \1178#define GET_FIELD(value, name) \
1178 (((value) >> (name ## _SHIFT)) & name ## _MASK)1179 (((value) >> (name ## _SHIFT)) & name ## _MASK)
1179 1180
1181#define GET_MFW_FIELD(name, field) \
1182 (((name) & (field ## _MASK)) >> (field ## _OFFSET))
1183
1184#define SET_MFW_FIELD(name, field, value) \
1185 do { \
1186 (name) &= ~(field ## _MASK); \
1187 (name) |= (((value) << (field ## _OFFSET)) & (field ## _MASK));\
1188 } while (0)
1189
1190#define DB_ADDR_SHIFT(addr) ((addr) << DB_PWM_ADDR_OFFSET_SHIFT)
1191
1180/* Debug print definitions */1192/* Debug print definitions */
1181#define DP_ERR(cdev, fmt, ...) \1193#define DP_ERR(cdev, fmt, ...) \
1182 do { \1194 do { \
include/linux/qed/qed_ll2_if.h+7−0
@@ -52,6 +52,12 @@ enum qed_ll2_conn_type { · 51 unmodified lines
52 QED_LL2_TYPE_ROCE,52 QED_LL2_TYPE_ROCE,
53 QED_LL2_TYPE_IWARP,53 QED_LL2_TYPE_IWARP,
54 QED_LL2_TYPE_RESERVED3,54 QED_LL2_TYPE_RESERVED3,
55 MAX_QED_LL2_CONN_TYPE
56};
57
58enum qed_ll2_rx_conn_type {
59 QED_LL2_RX_TYPE_LEGACY,
60 QED_LL2_RX_TYPE_CTX,
55 MAX_QED_LL2_RX_CONN_TYPE61 MAX_QED_LL2_RX_CONN_TYPE
56};62};
57 63
@@ -165,6 +171,7 @@ struct qed_ll2_cbs { · 107 unmodified lines
165};171};
166 172
167struct qed_ll2_acquire_data_inputs {173struct qed_ll2_acquire_data_inputs {
174 enum qed_ll2_rx_conn_type rx_conn_type;
168 enum qed_ll2_conn_type conn_type;175 enum qed_ll2_conn_type conn_type;
169 u16 mtu;176 u16 mtu;
170 u16 rx_num_desc;177 u16 rx_num_desc;
include/linux/qed/storage_common.h+2−1
@@ -107,8 +107,9 @@ struct scsi_drv_cmdq { · 106 unmodified lines
107struct scsi_init_func_params {107struct scsi_init_func_params {
108 __le16 num_tasks;108 __le16 num_tasks;
109 u8 log_page_size;109 u8 log_page_size;
110 u8 log_page_size_conn;
110 u8 debug_mode;111 u8 debug_mode;
111 u8 reserved2[12];112 u8 reserved2[11];
112};113};
113 114
114/* SCSI RQ/CQ/CMDQ firmware function init parameters */115/* SCSI RQ/CQ/CMDQ firmware function init parameters */
include/linux/sfp.h+66−29
@@ -275,6 +275,61 @@ struct sfp_diag { · 274 unmodified lines
275 __be16 cal_v_offset;275 __be16 cal_v_offset;
276} __packed;276} __packed;
277 277
278/* SFF8024 defined constants */
279enum {
280 SFF8024_ID_UNK = 0x00,
281 SFF8024_ID_SFF_8472 = 0x02,
282 SFF8024_ID_SFP = 0x03,
283 SFF8024_ID_DWDM_SFP = 0x0b,
284 SFF8024_ID_QSFP_8438 = 0x0c,
285 SFF8024_ID_QSFP_8436_8636 = 0x0d,
286 SFF8024_ID_QSFP28_8636 = 0x11,
287
288 SFF8024_ENCODING_UNSPEC = 0x00,
289 SFF8024_ENCODING_8B10B = 0x01,
290 SFF8024_ENCODING_4B5B = 0x02,
291 SFF8024_ENCODING_NRZ = 0x03,
292 SFF8024_ENCODING_8472_MANCHESTER= 0x04,
293 SFF8024_ENCODING_8472_SONET = 0x05,
294 SFF8024_ENCODING_8472_64B66B = 0x06,
295 SFF8024_ENCODING_8436_MANCHESTER= 0x06,
296 SFF8024_ENCODING_8436_SONET = 0x04,
297 SFF8024_ENCODING_8436_64B66B = 0x05,
298 SFF8024_ENCODING_256B257B = 0x07,
299 SFF8024_ENCODING_PAM4 = 0x08,
300
301 SFF8024_CONNECTOR_UNSPEC = 0x00,
302 /* codes 01-05 not supportable on SFP, but some modules have single SC */
303 SFF8024_CONNECTOR_SC = 0x01,
304 SFF8024_CONNECTOR_FIBERJACK = 0x06,
305 SFF8024_CONNECTOR_LC = 0x07,
306 SFF8024_CONNECTOR_MT_RJ = 0x08,
307 SFF8024_CONNECTOR_MU = 0x09,
308 SFF8024_CONNECTOR_SG = 0x0a,
309 SFF8024_CONNECTOR_OPTICAL_PIGTAIL= 0x0b,
310 SFF8024_CONNECTOR_MPO_1X12 = 0x0c,
311 SFF8024_CONNECTOR_MPO_2X16 = 0x0d,
312 SFF8024_CONNECTOR_HSSDC_II = 0x20,
313 SFF8024_CONNECTOR_COPPER_PIGTAIL= 0x21,
314 SFF8024_CONNECTOR_RJ45 = 0x22,
315 SFF8024_CONNECTOR_NOSEPARATE = 0x23,
316 SFF8024_CONNECTOR_MXC_2X16 = 0x24,
317
318 SFF8024_ECC_UNSPEC = 0x00,
319 SFF8024_ECC_100G_25GAUI_C2M_AOC = 0x01,
320 SFF8024_ECC_100GBASE_SR4_25GBASE_SR = 0x02,
321 SFF8024_ECC_100GBASE_LR4_25GBASE_LR = 0x03,
322 SFF8024_ECC_100GBASE_ER4_25GBASE_ER = 0x04,
323 SFF8024_ECC_100GBASE_SR10 = 0x05,
324 SFF8024_ECC_100GBASE_CR4 = 0x0b,
325 SFF8024_ECC_25GBASE_CR_S = 0x0c,
326 SFF8024_ECC_25GBASE_CR_N = 0x0d,
327 SFF8024_ECC_10GBASE_T_SFI = 0x16,
328 SFF8024_ECC_10GBASE_T_SR = 0x1c,
329 SFF8024_ECC_5GBASE_T = 0x1d,
330 SFF8024_ECC_2_5GBASE_T = 0x1e,
331};
332
278/* SFP EEPROM registers */333/* SFP EEPROM registers */
279enum {334enum {
280 SFP_PHYS_ID = 0x00,335 SFP_PHYS_ID = 0x00,
@@ -309,34 +364,7 @@ enum { · 28 unmodified lines
309 SFP_SFF8472_COMPLIANCE = 0x5e,364 SFP_SFF8472_COMPLIANCE = 0x5e,
310 SFP_CC_EXT = 0x5f,365 SFP_CC_EXT = 0x5f,
311 366
312 SFP_PHYS_ID_SFF = 0x02,
313 SFP_PHYS_ID_SFP = 0x03,
314 SFP_PHYS_EXT_ID_SFP = 0x04,367 SFP_PHYS_EXT_ID_SFP = 0x04,
315 SFP_CONNECTOR_UNSPEC = 0x00,
316 /* codes 01-05 not supportable on SFP, but some modules have single SC */
317 SFP_CONNECTOR_SC = 0x01,
318 SFP_CONNECTOR_FIBERJACK = 0x06,
319 SFP_CONNECTOR_LC = 0x07,
320 SFP_CONNECTOR_MT_RJ = 0x08,
321 SFP_CONNECTOR_MU = 0x09,
322 SFP_CONNECTOR_SG = 0x0a,
323 SFP_CONNECTOR_OPTICAL_PIGTAIL = 0x0b,
324 SFP_CONNECTOR_MPO_1X12 = 0x0c,
325 SFP_CONNECTOR_MPO_2X16 = 0x0d,
326 SFP_CONNECTOR_HSSDC_II = 0x20,
327 SFP_CONNECTOR_COPPER_PIGTAIL = 0x21,
328 SFP_CONNECTOR_RJ45 = 0x22,
329 SFP_CONNECTOR_NOSEPARATE = 0x23,
330 SFP_CONNECTOR_MXC_2X16 = 0x24,
331 SFP_ENCODING_UNSPEC = 0x00,
332 SFP_ENCODING_8B10B = 0x01,
333 SFP_ENCODING_4B5B = 0x02,
334 SFP_ENCODING_NRZ = 0x03,
335 SFP_ENCODING_8472_MANCHESTER = 0x04,
336 SFP_ENCODING_8472_SONET = 0x05,
337 SFP_ENCODING_8472_64B66B = 0x06,
338 SFP_ENCODING_256B257B = 0x07,
339 SFP_ENCODING_PAM4 = 0x08,
340 SFP_OPTIONS_HIGH_POWER_LEVEL = BIT(13),368 SFP_OPTIONS_HIGH_POWER_LEVEL = BIT(13),
341 SFP_OPTIONS_PAGING_A2 = BIT(12),369 SFP_OPTIONS_PAGING_A2 = BIT(12),
342 SFP_OPTIONS_RETIMER = BIT(11),370 SFP_OPTIONS_RETIMER = BIT(11),
@@ -479,6 +507,8 @@ struct sfp_bus; · 136 unmodified lines
479 * @module_insert: called after a module has been detected to determine507 * @module_insert: called after a module has been detected to determine
480 * whether the module is supported for the upstream device.508 * whether the module is supported for the upstream device.
481 * @module_remove: called after the module has been removed.509 * @module_remove: called after the module has been removed.
510 * @module_start: called after the PHY probe step
511 * @module_stop: called before the PHY is removed
482 * @link_down: called when the link is non-operational for whatever512 * @link_down: called when the link is non-operational for whatever
483 * reason.513 * reason.
484 * @link_up: called when the link is operational.514 * @link_up: called when the link is operational.
@@ -492,6 +522,8 @@ struct sfp_upstream_ops { · 7 unmodified lines
492 void (*detach)(void *priv, struct sfp_bus *bus);522 void (*detach)(void *priv, struct sfp_bus *bus);
493 int (*module_insert)(void *priv, const struct sfp_eeprom_id *id);523 int (*module_insert)(void *priv, const struct sfp_eeprom_id *id);
494 void (*module_remove)(void *priv);524 void (*module_remove)(void *priv);
525 int (*module_start)(void *priv);
526 void (*module_stop)(void *priv);
495 void (*link_down)(void *priv);527 void (*link_down)(void *priv);
496 void (*link_up)(void *priv);528 void (*link_up)(void *priv);
497 int (*connect_phy)(void *priv, struct phy_device *);529 int (*connect_phy)(void *priv, struct phy_device *);
@@ -501,10 +533,10 @@ struct sfp_upstream_ops { · 3 unmodified lines
501#if IS_ENABLED(CONFIG_SFP)533#if IS_ENABLED(CONFIG_SFP)
502int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id,534int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
503 unsigned long *support);535 unsigned long *support);
536bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id);
504void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,537void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
505 unsigned long *support);538 unsigned long *support);
506phy_interface_t sfp_select_interface(struct sfp_bus *bus,539phy_interface_t sfp_select_interface(struct sfp_bus *bus,
507 const struct sfp_eeprom_id *id,
508 unsigned long *link_modes);540 unsigned long *link_modes);
509 541
510int sfp_get_module_info(struct sfp_bus *bus, struct ethtool_modinfo *modinfo);542int sfp_get_module_info(struct sfp_bus *bus, struct ethtool_modinfo *modinfo);
@@ -525,6 +557,12 @@ static inline int sfp_parse_port(struct sfp_bus *bus, · 14 unmodified lines
525 return PORT_OTHER;557 return PORT_OTHER;
526}558}
527 559
560static inline bool sfp_may_have_phy(struct sfp_bus *bus,
561 const struct sfp_eeprom_id *id)
562{
563 return false;
564}
565
528static inline void sfp_parse_support(struct sfp_bus *bus,566static inline void sfp_parse_support(struct sfp_bus *bus,
529 const struct sfp_eeprom_id *id,567 const struct sfp_eeprom_id *id,
530 unsigned long *support)568 unsigned long *support)
@@ -532,7 +570,6 @@ static inline void sfp_parse_support(struct sfp_bus *bus, · 1 unmodified line
532}570}
533 571
534static inline phy_interface_t sfp_select_interface(struct sfp_bus *bus,572static inline phy_interface_t sfp_select_interface(struct sfp_bus *bus,
535 const struct sfp_eeprom_id *id,
536 unsigned long *link_modes)573 unsigned long *link_modes)
537{574{
538 return PHY_INTERFACE_MODE_NA;575 return PHY_INTERFACE_MODE_NA;
include/linux/skbuff.h+23−3
@@ -592,6 +592,8 @@ enum { · 591 unmodified lines
592 SKB_GSO_UDP = 1 << 16,592 SKB_GSO_UDP = 1 << 16,
593 593
594 SKB_GSO_UDP_L4 = 1 << 17,594 SKB_GSO_UDP_L4 = 1 << 17,
595
596 SKB_GSO_FRAGLIST = 1 << 18,
595};597};
596 598
597#if BITS_PER_LONG > 32599#if BITS_PER_LONG > 32
@@ -1478,6 +1480,11 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb) · 880 unmodified lines
1478 skb->next = NULL;1480 skb->next = NULL;
1479}1481}
1480 1482
1483/* Iterate through singly-linked GSO fragments of an skb. */
1484#define skb_list_walk_safe(first, skb, next_skb) \
1485 for ((skb) = (first), (next_skb) = (skb) ? (skb)->next : NULL; (skb); \
1486 (skb) = (next_skb), (next_skb) = (skb) ? (skb)->next : NULL)
1487
1481static inline void skb_list_del_init(struct sk_buff *skb)1488static inline void skb_list_del_init(struct sk_buff *skb)
1482{1489{
1483 __list_del_entry(&skb->list);1490 __list_del_entry(&skb->list);
@@ -3459,7 +3466,8 @@ static inline void skb_frag_list_init(struct sk_buff *skb) · 1975 unmodified lines
3459 for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)3466 for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)
3460 3467
3461 3468
3462int __skb_wait_for_more_packets(struct sock *sk, int *err, long *timeo_p,3469int __skb_wait_for_more_packets(struct sock *sk, struct sk_buff_head *queue,
3470 int *err, long *timeo_p,
3463 const struct sk_buff *skb);3471 const struct sk_buff *skb);
3464struct sk_buff *__skb_try_recv_from_queue(struct sock *sk,3472struct sk_buff *__skb_try_recv_from_queue(struct sock *sk,
3465 struct sk_buff_head *queue,3473 struct sk_buff_head *queue,
@@ -3468,12 +3476,16 @@ struct sk_buff *__skb_try_recv_from_queue(struct sock *sk, · 2 unmodified lines
3468 struct sk_buff *skb),3476 struct sk_buff *skb),
3469 int *off, int *err,3477 int *off, int *err,
3470 struct sk_buff **last);3478 struct sk_buff **last);
3471struct sk_buff *__skb_try_recv_datagram(struct sock *sk, unsigned flags,3479struct sk_buff *__skb_try_recv_datagram(struct sock *sk,
3480 struct sk_buff_head *queue,
3481 unsigned int flags,
3472 void (*destructor)(struct sock *sk,3482 void (*destructor)(struct sock *sk,
3473 struct sk_buff *skb),3483 struct sk_buff *skb),
3474 int *off, int *err,3484 int *off, int *err,
3475 struct sk_buff **last);3485 struct sk_buff **last);
3476struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,3486struct sk_buff *__skb_recv_datagram(struct sock *sk,
3487 struct sk_buff_head *sk_queue,
3488 unsigned int flags,
3477 void (*destructor)(struct sock *sk,3489 void (*destructor)(struct sock *sk,
3478 struct sk_buff *skb),3490 struct sk_buff *skb),
3479 int *off, int *err);3491 int *off, int *err);
@@ -3523,6 +3535,8 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet); · 43 unmodified lines
3523bool skb_gso_validate_network_len(const struct sk_buff *skb, unsigned int mtu);3535bool skb_gso_validate_network_len(const struct sk_buff *skb, unsigned int mtu);
3524bool skb_gso_validate_mac_len(const struct sk_buff *skb, unsigned int len);3536bool skb_gso_validate_mac_len(const struct sk_buff *skb, unsigned int len);
3525struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);3537struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
3538struct sk_buff *skb_segment_list(struct sk_buff *skb, netdev_features_t features,
3539 unsigned int offset);
3526struct sk_buff *skb_vlan_untag(struct sk_buff *skb);3540struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
3527int skb_ensure_writable(struct sk_buff *skb, int write_len);3541int skb_ensure_writable(struct sk_buff *skb, int write_len);
3528int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci);3542int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci);
@@ -4091,6 +4105,9 @@ enum skb_ext_id { · 562 unmodified lines
4091#endif4105#endif
4092#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT)4106#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
4093 TC_SKB_EXT,4107 TC_SKB_EXT,
4108#endif
4109#if IS_ENABLED(CONFIG_MPTCP)
4110 SKB_EXT_MPTCP,
4094#endif4111#endif
4095 SKB_EXT_NUM, /* must be last */4112 SKB_EXT_NUM, /* must be last */
4096};4113};
@@ -4112,6 +4129,9 @@ struct skb_ext { · 15 unmodified lines
4112 char data[0] __aligned(8);4129 char data[0] __aligned(8);
4113};4130};
4114 4131
4132struct skb_ext *__skb_ext_alloc(void);
4133void *__skb_ext_set(struct sk_buff *skb, enum skb_ext_id id,
4134 struct skb_ext *ext);
4115void *skb_ext_add(struct sk_buff *skb, enum skb_ext_id id);4135void *skb_ext_add(struct sk_buff *skb, enum skb_ext_id id);
4116void __skb_ext_del(struct sk_buff *skb, enum skb_ext_id id);4136void __skb_ext_del(struct sk_buff *skb, enum skb_ext_id id);
4117void __skb_ext_put(struct skb_ext *ext);4137void __skb_ext_put(struct skb_ext *ext);
include/linux/stmmac.h+14−0
@@ -109,6 +109,18 @@ struct stmmac_axi { · 108 unmodified lines
109 bool axi_rb;109 bool axi_rb;
110};110};
111 111
112#define EST_GCL 1024
113struct stmmac_est {
114 int enable;
115 u32 btr_offset[2];
116 u32 btr[2];
117 u32 ctr[2];
118 u32 ter;
119 u32 gcl_unaligned[EST_GCL];
120 u32 gcl[EST_GCL];
121 u32 gcl_size;
122};
123
112struct stmmac_rxq_cfg {124struct stmmac_rxq_cfg {
113 u8 mode_to_use;125 u8 mode_to_use;
114 u32 chan;126 u32 chan;
@@ -127,6 +139,7 @@ struct stmmac_txq_cfg { · 12 unmodified lines
127 u32 low_credit;139 u32 low_credit;
128 bool use_prio;140 bool use_prio;
129 u32 prio;141 u32 prio;
142 int tbs_en;
130};143};
131 144
132struct plat_stmmacenet_data {145struct plat_stmmacenet_data {
@@ -139,6 +152,7 @@ struct plat_stmmacenet_data { · 6 unmodified lines
139 struct device_node *phylink_node;152 struct device_node *phylink_node;
140 struct device_node *mdio_node;153 struct device_node *mdio_node;
141 struct stmmac_dma_cfg *dma_cfg;154 struct stmmac_dma_cfg *dma_cfg;
155 struct stmmac_est *est;
142 int clk_csr;156 int clk_csr;
143 int has_gmac;157 int has_gmac;
144 int enh_desc;158 int enh_desc;
include/linux/tcp.h+37−0
@@ -78,6 +78,27 @@ struct tcp_sack_block { · 77 unmodified lines
78#define TCP_SACK_SEEN (1 << 0) /*1 = peer is SACK capable, */78#define TCP_SACK_SEEN (1 << 0) /*1 = peer is SACK capable, */
79#define TCP_DSACK_SEEN (1 << 2) /*1 = DSACK was received from peer*/79#define TCP_DSACK_SEEN (1 << 2) /*1 = DSACK was received from peer*/
80 80
81#if IS_ENABLED(CONFIG_MPTCP)
82struct mptcp_options_received {
83 u64 sndr_key;
84 u64 rcvr_key;
85 u64 data_ack;
86 u64 data_seq;
87 u32 subflow_seq;
88 u16 data_len;
89 u8 mp_capable : 1,
90 mp_join : 1,
91 dss : 1;
92 u8 use_map:1,
93 dsn64:1,
94 data_fin:1,
95 use_ack:1,
96 ack64:1,
97 mpc_map:1,
98 __unused:2;
99};
100#endif
101
81struct tcp_options_received {102struct tcp_options_received {
82/* PAWS/RTTM data */103/* PAWS/RTTM data */
83 int ts_recent_stamp;/* Time we stored ts_recent (for aging) */104 int ts_recent_stamp;/* Time we stored ts_recent (for aging) */
@@ -95,6 +116,9 @@ struct tcp_options_received { · 11 unmodified lines
95 u8 num_sacks; /* Number of SACK blocks */116 u8 num_sacks; /* Number of SACK blocks */
96 u16 user_mss; /* mss requested by user in ioctl */117 u16 user_mss; /* mss requested by user in ioctl */
97 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */118 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
119#if IS_ENABLED(CONFIG_MPTCP)
120 struct mptcp_options_received mptcp;
121#endif
98};122};
99 123
100static inline void tcp_clear_options(struct tcp_options_received *rx_opt)124static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
@@ -104,6 +128,11 @@ static inline void tcp_clear_options(struct tcp_options_received *rx_opt) · 3 unmodified lines
104#if IS_ENABLED(CONFIG_SMC)128#if IS_ENABLED(CONFIG_SMC)
105 rx_opt->smc_ok = 0;129 rx_opt->smc_ok = 0;
106#endif130#endif
131#if IS_ENABLED(CONFIG_MPTCP)
132 rx_opt->mptcp.mp_capable = 0;
133 rx_opt->mptcp.mp_join = 0;
134 rx_opt->mptcp.dss = 0;
135#endif
107}136}
108 137
109/* This is the max number of SACKS that we'll generate and process. It's safe138/* This is the max number of SACKS that we'll generate and process. It's safe
@@ -119,6 +148,9 @@ struct tcp_request_sock { · 9 unmodified lines
119 const struct tcp_request_sock_ops *af_specific;148 const struct tcp_request_sock_ops *af_specific;
120 u64 snt_synack; /* first SYNACK sent time */149 u64 snt_synack; /* first SYNACK sent time */
121 bool tfo_listener;150 bool tfo_listener;
151#if IS_ENABLED(CONFIG_MPTCP)
152 bool is_mptcp;
153#endif
122 u32 txhash;154 u32 txhash;
123 u32 rcv_isn;155 u32 rcv_isn;
124 u32 snt_isn;156 u32 snt_isn;
@@ -354,6 +386,8 @@ struct tcp_sock { · 229 unmodified lines
354#define BPF_SOCK_OPS_TEST_FLAG(TP, ARG) 0386#define BPF_SOCK_OPS_TEST_FLAG(TP, ARG) 0
355#endif387#endif
356 388
389 u16 timeout_rehash; /* Timeout-triggered rehash attempts */
390
357 u32 rcv_ooopack; /* Received out-of-order packets, for tcpinfo */391 u32 rcv_ooopack; /* Received out-of-order packets, for tcpinfo */
358 392
359/* Receiver side RTT estimation */393/* Receiver side RTT estimation */
@@ -379,6 +413,9 @@ struct tcp_sock { · 19 unmodified lines
379 u32 mtu_info; /* We received an ICMP_FRAG_NEEDED / ICMPV6_PKT_TOOBIG413 u32 mtu_info; /* We received an ICMP_FRAG_NEEDED / ICMPV6_PKT_TOOBIG
380 * while socket was owned by user.414 * while socket was owned by user.
381 */415 */
416#if IS_ENABLED(CONFIG_MPTCP)
417 bool is_mptcp;
418#endif
382 419
383#ifdef CONFIG_TCP_MD5SIG420#ifdef CONFIG_TCP_MD5SIG
384/* TCP AF-Specific parts; only used by MD5 Signature support so far */421/* TCP AF-Specific parts; only used by MD5 Signature support so far */
include/linux/usb/usbnet.h+1−1
@@ -253,7 +253,7 @@ extern int usbnet_open(struct net_device *net); · 252 unmodified lines
253extern int usbnet_stop(struct net_device *net);253extern int usbnet_stop(struct net_device *net);
254extern netdev_tx_t usbnet_start_xmit(struct sk_buff *skb,254extern netdev_tx_t usbnet_start_xmit(struct sk_buff *skb,
255 struct net_device *net);255 struct net_device *net);
256extern void usbnet_tx_timeout(struct net_device *net);256extern void usbnet_tx_timeout(struct net_device *net, unsigned int txqueue);
257extern int usbnet_change_mtu(struct net_device *net, int new_mtu);257extern int usbnet_change_mtu(struct net_device *net, int new_mtu);
258 258
259extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *);259extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *);