mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
kernel: bump 5.15 to 5.15.143
This commit is contained in:
parent
783f460c97
commit
67dcd38678
@ -1,2 +1,2 @@
|
|||||||
LINUX_VERSION-5.15 = .142
|
LINUX_VERSION-5.15 = .143
|
||||||
LINUX_KERNEL_HASH-5.15.142 = 8d76c95277dc5ab0a6cd0069432af2ceb759d0ac2b6f5401330d390196095676
|
LINUX_KERNEL_HASH-5.15.143 = 096bb16ec07232f27f6a07998c41b655883a8d0a6bb613d39bf524a9ffd99e02
|
||||||
|
899
target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch
Normal file
899
target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch
Normal file
@ -0,0 +1,899 @@
|
|||||||
|
From: Felix Fietkau <nbd@openwrt.org>
|
||||||
|
Subject: [PATCH] ar71xx: fix unaligned access in a few more places
|
||||||
|
|
||||||
|
SVN-Revision: 35130
|
||||||
|
---
|
||||||
|
arch/mips/include/asm/checksum.h | 83 +++---------------
|
||||||
|
include/uapi/linux/ip.h | 2 +-
|
||||||
|
include/uapi/linux/ipv6.h | 2 +-
|
||||||
|
include/uapi/linux/tcp.h | 4 ++--
|
||||||
|
include/uapi/linux/udp.h | 2 +-
|
||||||
|
net/netfilter/nf_conntrack_core.c | 4 ++--
|
||||||
|
include/uapi/linux/icmp.h | 2 +-
|
||||||
|
include/uapi/linux/in6.h | 2 +-
|
||||||
|
net/ipv6/tcp_ipv6.c | 9 +++--
|
||||||
|
net/ipv6/datagram.c | 6 ++--
|
||||||
|
net/ipv6/exthdrs.c | 2 +-
|
||||||
|
include/linux/types.h | 5 +++
|
||||||
|
net/ipv4/af_inet.c | 4 ++--
|
||||||
|
net/ipv4/tcp_output.c | 69 +++++++++--------
|
||||||
|
include/uapi/linux/igmp.h | 8 +++---
|
||||||
|
net/core/flow_dissector.c | 2 +-
|
||||||
|
include/uapi/linux/icmpv6.h | 2 +-
|
||||||
|
include/net/ndisc.h | 10 ++++----
|
||||||
|
net/sched/cls_u32.c | 6 +++---
|
||||||
|
net/ipv6/ip6_offload.c | 2 +-
|
||||||
|
include/net/addrconf.h | 2 +-
|
||||||
|
include/net/inet_ecn.h | 4 ++--
|
||||||
|
include/net/ipv6.h | 23 +++++----
|
||||||
|
include/net/secure_seq.h | 1 +
|
||||||
|
include/uapi/linux/in.h | 2 +-
|
||||||
|
net/ipv6/ip6_fib.h | 2 +-
|
||||||
|
net/netfilter/nf_conntrack_proto_tcp.c | 2 +-
|
||||||
|
net/xfrm/xfrm_input.c | 4 ++--
|
||||||
|
net/ipv4/tcp_input.c | 12 ++++---
|
||||||
|
include/uapi/linux/if_pppox.h | 1 +
|
||||||
|
net/ipv6/netfilter/nf_log_ipv6.c | 4 ++--
|
||||||
|
include/net/neighbour.h | 6 +++--
|
||||||
|
include/uapi/linux/netfilter_arp/arp_tables.h | 2 +-
|
||||||
|
net/core/utils.c | 10 +++++--
|
||||||
|
include/linux/etherdevice.h | 11 ++++---
|
||||||
|
net/ipv4/tcp_offload.c | 6 +++---
|
||||||
|
net/ipv6/netfilter/ip6table_mangle.c | 4 ++--
|
||||||
|
37 file changed, 171 insertions(+), 141 deletions(-)
|
||||||
|
|
||||||
|
--- a/arch/mips/include/asm/checksum.h
|
||||||
|
+++ b/arch/mips/include/asm/checksum.h
|
||||||
|
@@ -100,26 +100,30 @@ static inline __sum16 ip_fast_csum(const
|
||||||
|
const unsigned int *stop = word + ihl;
|
||||||
|
unsigned int csum;
|
||||||
|
int carry;
|
||||||
|
+ unsigned int w;
|
||||||
|
|
||||||
|
- csum = word[0];
|
||||||
|
- csum += word[1];
|
||||||
|
- carry = (csum < word[1]);
|
||||||
|
+ csum = net_hdr_word(word++);
|
||||||
|
+
|
||||||
|
+ w = net_hdr_word(word++);
|
||||||
|
+ csum += w;
|
||||||
|
+ carry = (csum < w);
|
||||||
|
csum += carry;
|
||||||
|
|
||||||
|
- csum += word[2];
|
||||||
|
- carry = (csum < word[2]);
|
||||||
|
+ w = net_hdr_word(word++);
|
||||||
|
+ csum += w;
|
||||||
|
+ carry = (csum < w);
|
||||||
|
csum += carry;
|
||||||
|
|
||||||
|
- csum += word[3];
|
||||||
|
- carry = (csum < word[3]);
|
||||||
|
+ w = net_hdr_word(word++);
|
||||||
|
+ csum += w;
|
||||||
|
+ carry = (csum < w);
|
||||||
|
csum += carry;
|
||||||
|
|
||||||
|
- word += 4;
|
||||||
|
do {
|
||||||
|
- csum += *word;
|
||||||
|
- carry = (csum < *word);
|
||||||
|
+ w = net_hdr_word(word++);
|
||||||
|
+ csum += w;
|
||||||
|
+ carry = (csum < w);
|
||||||
|
csum += carry;
|
||||||
|
- word++;
|
||||||
|
} while (word != stop);
|
||||||
|
|
||||||
|
return csum_fold(csum);
|
||||||
|
@@ -182,73 +186,6 @@ static inline __sum16 ip_compute_csum(co
|
||||||
|
return csum_fold(csum_partial(buff, len, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
-#define _HAVE_ARCH_IPV6_CSUM
|
||||||
|
-static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||||
|
- const struct in6_addr *daddr,
|
||||||
|
- __u32 len, __u8 proto,
|
||||||
|
- __wsum sum)
|
||||||
|
-{
|
||||||
|
- __wsum tmp;
|
||||||
|
-
|
||||||
|
- __asm__(
|
||||||
|
- " .set push # csum_ipv6_magic\n"
|
||||||
|
- " .set noreorder \n"
|
||||||
|
- " .set noat \n"
|
||||||
|
- " addu %0, %5 # proto (long in network byte order)\n"
|
||||||
|
- " sltu $1, %0, %5 \n"
|
||||||
|
- " addu %0, $1 \n"
|
||||||
|
-
|
||||||
|
- " addu %0, %6 # csum\n"
|
||||||
|
- " sltu $1, %0, %6 \n"
|
||||||
|
- " lw %1, 0(%2) # four words source address\n"
|
||||||
|
- " addu %0, $1 \n"
|
||||||
|
- " addu %0, %1 \n"
|
||||||
|
- " sltu $1, %0, %1 \n"
|
||||||
|
-
|
||||||
|
- " lw %1, 4(%2) \n"
|
||||||
|
- " addu %0, $1 \n"
|
||||||
|
- " addu %0, %1 \n"
|
||||||
|
- " sltu $1, %0, %1 \n"
|
||||||
|
-
|
||||||
|
- " lw %1, 8(%2) \n"
|
||||||
|
- " addu %0, $1 \n"
|
||||||
|
- " addu %0, %1 \n"
|
||||||
|
- " sltu $1, %0, %1 \n"
|
||||||
|
-
|
||||||
|
- " lw %1, 12(%2) \n"
|
||||||
|
- " addu %0, $1 \n"
|
||||||
|
- " addu %0, %1 \n"
|
||||||
|
- " sltu $1, %0, %1 \n"
|
||||||
|
-
|
||||||
|
- " lw %1, 0(%3) \n"
|
||||||
|
- " addu %0, $1 \n"
|
||||||
|
- " addu %0, %1 \n"
|
||||||
|
- " sltu $1, %0, %1 \n"
|
||||||
|
-
|
||||||
|
- " lw %1, 4(%3) \n"
|
||||||
|
- " addu %0, $1 \n"
|
||||||
|
- " addu %0, %1 \n"
|
||||||
|
- " sltu $1, %0, %1 \n"
|
||||||
|
-
|
||||||
|
- " lw %1, 8(%3) \n"
|
||||||
|
- " addu %0, $1 \n"
|
||||||
|
- " addu %0, %1 \n"
|
||||||
|
- " sltu $1, %0, %1 \n"
|
||||||
|
-
|
||||||
|
- " lw %1, 12(%3) \n"
|
||||||
|
- " addu %0, $1 \n"
|
||||||
|
- " addu %0, %1 \n"
|
||||||
|
- " sltu $1, %0, %1 \n"
|
||||||
|
-
|
||||||
|
- " addu %0, $1 # Add final carry\n"
|
||||||
|
- " .set pop"
|
||||||
|
- : "=&r" (sum), "=&r" (tmp)
|
||||||
|
- : "r" (saddr), "r" (daddr),
|
||||||
|
- "0" (htonl(len)), "r" (htonl(proto)), "r" (sum));
|
||||||
|
-
|
||||||
|
- return csum_fold(sum);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
#include <asm-generic/checksum.h>
|
||||||
|
#endif /* CONFIG_GENERIC_CSUM */
|
||||||
|
|
||||||
|
--- a/include/uapi/linux/ip.h
|
||||||
|
+++ b/include/uapi/linux/ip.h
|
||||||
|
@@ -106,7 +106,7 @@ struct iphdr {
|
||||||
|
__be32 daddr;
|
||||||
|
);
|
||||||
|
/*The options start here. */
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
|
||||||
|
struct ip_auth_hdr {
|
||||||
|
--- a/include/uapi/linux/ipv6.h
|
||||||
|
+++ b/include/uapi/linux/ipv6.h
|
||||||
|
@@ -135,7 +135,7 @@ struct ipv6hdr {
|
||||||
|
struct in6_addr saddr;
|
||||||
|
struct in6_addr daddr;
|
||||||
|
);
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
|
||||||
|
/* index values for the variables in ipv6_devconf */
|
||||||
|
--- a/include/uapi/linux/tcp.h
|
||||||
|
+++ b/include/uapi/linux/tcp.h
|
||||||
|
@@ -55,7 +55,7 @@ struct tcphdr {
|
||||||
|
__be16 window;
|
||||||
|
__sum16 check;
|
||||||
|
__be16 urg_ptr;
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The union cast uses a gcc extension to avoid aliasing problems
|
||||||
|
@@ -65,7 +65,7 @@ struct tcphdr {
|
||||||
|
union tcp_word_hdr {
|
||||||
|
struct tcphdr hdr;
|
||||||
|
__be32 words[5];
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
#define tcp_flag_word(tp) (((union tcp_word_hdr *)(tp))->words[3])
|
||||||
|
|
||||||
|
--- a/include/uapi/linux/udp.h
|
||||||
|
+++ b/include/uapi/linux/udp.h
|
||||||
|
@@ -25,7 +25,7 @@ struct udphdr {
|
||||||
|
__be16 dest;
|
||||||
|
__be16 len;
|
||||||
|
__sum16 check;
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
/* UDP socket options */
|
||||||
|
#define UDP_CORK 1 /* Never send partially complete segments */
|
||||||
|
--- a/net/netfilter/nf_conntrack_core.c
|
||||||
|
+++ b/net/netfilter/nf_conntrack_core.c
|
||||||
|
@@ -308,8 +308,8 @@ nf_ct_get_tuple(const struct sk_buff *sk
|
||||||
|
|
||||||
|
switch (l3num) {
|
||||||
|
case NFPROTO_IPV4:
|
||||||
|
- tuple->src.u3.ip = ap[0];
|
||||||
|
- tuple->dst.u3.ip = ap[1];
|
||||||
|
+ tuple->src.u3.ip = net_hdr_word(ap++);
|
||||||
|
+ tuple->dst.u3.ip = net_hdr_word(ap);
|
||||||
|
break;
|
||||||
|
case NFPROTO_IPV6:
|
||||||
|
memcpy(tuple->src.u3.ip6, ap, sizeof(tuple->src.u3.ip6));
|
||||||
|
--- a/include/uapi/linux/icmp.h
|
||||||
|
+++ b/include/uapi/linux/icmp.h
|
||||||
|
@@ -102,7 +102,7 @@ struct icmphdr {
|
||||||
|
} frag;
|
||||||
|
__u8 reserved[4];
|
||||||
|
} un;
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
--- a/include/uapi/linux/in6.h
|
||||||
|
+++ b/include/uapi/linux/in6.h
|
||||||
|
@@ -43,7 +43,7 @@ struct in6_addr {
|
||||||
|
#define s6_addr16 in6_u.u6_addr16
|
||||||
|
#define s6_addr32 in6_u.u6_addr32
|
||||||
|
#endif
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
#endif /* __UAPI_DEF_IN6_ADDR */
|
||||||
|
|
||||||
|
#if __UAPI_DEF_SOCKADDR_IN6
|
||||||
|
--- a/net/ipv6/tcp_ipv6.c
|
||||||
|
+++ b/net/ipv6/tcp_ipv6.c
|
||||||
|
@@ -35,6 +35,7 @@
|
||||||
|
#include <linux/ipsec.h>
|
||||||
|
#include <linux/times.h>
|
||||||
|
#include <linux/slab.h>
|
||||||
|
+#include <asm/unaligned.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
#include <linux/ipv6.h>
|
||||||
|
#include <linux/icmpv6.h>
|
||||||
|
@@ -944,10 +945,10 @@ static void tcp_v6_send_response(const s
|
||||||
|
topt = (__be32 *)(t1 + 1);
|
||||||
|
|
||||||
|
if (tsecr) {
|
||||||
|
- *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
||||||
|
- (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP);
|
||||||
|
- *topt++ = htonl(tsval);
|
||||||
|
- *topt++ = htonl(tsecr);
|
||||||
|
+ put_unaligned_be32((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
||||||
|
+ (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP, topt++);
|
||||||
|
+ put_unaligned_be32(tsval, topt++);
|
||||||
|
+ put_unaligned_be32(tsecr, topt++);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mrst)
|
||||||
|
--- a/include/linux/ipv6.h
|
||||||
|
+++ b/include/linux/ipv6.h
|
||||||
|
@@ -6,6 +6,7 @@
|
||||||
|
|
||||||
|
#define ipv6_optlen(p) (((p)->hdrlen+1) << 3)
|
||||||
|
#define ipv6_authlen(p) (((p)->hdrlen+2) << 2)
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* This structure contains configuration options per IPv6 link.
|
||||||
|
*/
|
||||||
|
--- a/net/ipv6/datagram.c
|
||||||
|
+++ b/net/ipv6/datagram.c
|
||||||
|
@@ -492,7 +492,7 @@ int ipv6_recv_error(struct sock *sk, str
|
||||||
|
ipv6_iface_scope_id(&sin->sin6_addr,
|
||||||
|
IP6CB(skb)->iif);
|
||||||
|
} else {
|
||||||
|
- ipv6_addr_set_v4mapped(*(__be32 *)(nh + serr->addr_offset),
|
||||||
|
+ ipv6_addr_set_v4mapped(net_hdr_word(nh + serr->addr_offset),
|
||||||
|
&sin->sin6_addr);
|
||||||
|
sin->sin6_scope_id = 0;
|
||||||
|
}
|
||||||
|
@@ -846,12 +846,12 @@ int ip6_datagram_send_ctl(struct net *ne
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fl6->flowlabel&IPV6_FLOWINFO_MASK) {
|
||||||
|
- if ((fl6->flowlabel^*(__be32 *)CMSG_DATA(cmsg))&~IPV6_FLOWINFO_MASK) {
|
||||||
|
+ if ((fl6->flowlabel^net_hdr_word(CMSG_DATA(cmsg)))&~IPV6_FLOWINFO_MASK) {
|
||||||
|
err = -EINVAL;
|
||||||
|
goto exit_f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- fl6->flowlabel = IPV6_FLOWINFO_MASK & *(__be32 *)CMSG_DATA(cmsg);
|
||||||
|
+ fl6->flowlabel = IPV6_FLOWINFO_MASK & net_hdr_word(CMSG_DATA(cmsg));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case IPV6_2292HOPOPTS:
|
||||||
|
--- a/net/ipv6/exthdrs.c
|
||||||
|
+++ b/net/ipv6/exthdrs.c
|
||||||
|
@@ -1002,7 +1002,7 @@ static bool ipv6_hop_jumbo(struct sk_buf
|
||||||
|
goto drop;
|
||||||
|
}
|
||||||
|
|
||||||
|
- pkt_len = ntohl(*(__be32 *)(nh + optoff + 2));
|
||||||
|
+ pkt_len = ntohl(net_hdr_word(nh + optoff + 2));
|
||||||
|
if (pkt_len <= IPV6_MAXPLEN) {
|
||||||
|
__IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
|
||||||
|
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);
|
||||||
|
--- a/include/linux/types.h
|
||||||
|
+++ b/include/linux/types.h
|
||||||
|
@@ -231,5 +231,11 @@ typedef void (*swap_func_t)(void *a, voi
|
||||||
|
typedef int (*cmp_r_func_t)(const void *a, const void *b, const void *priv);
|
||||||
|
typedef int (*cmp_func_t)(const void *a, const void *b);
|
||||||
|
|
||||||
|
+struct net_hdr_word {
|
||||||
|
+ u32 words[1];
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
+
|
||||||
|
+#define net_hdr_word(_p) (((struct net_hdr_word *) (_p))->words[0])
|
||||||
|
+
|
||||||
|
#endif /* __ASSEMBLY__ */
|
||||||
|
#endif /* _LINUX_TYPES_H */
|
||||||
|
--- a/net/ipv4/af_inet.c
|
||||||
|
+++ b/net/ipv4/af_inet.c
|
||||||
|
@@ -1477,8 +1477,8 @@ struct sk_buff *inet_gro_receive(struct
|
||||||
|
if (unlikely(ip_fast_csum((u8 *)iph, 5)))
|
||||||
|
goto out_unlock;
|
||||||
|
|
||||||
|
- id = ntohl(*(__be32 *)&iph->id);
|
||||||
|
- flush = (u16)((ntohl(*(__be32 *)iph) ^ skb_gro_len(skb)) | (id & ~IP_DF));
|
||||||
|
+ id = ntohl(net_hdr_word(&iph->id));
|
||||||
|
+ flush = (u16)((ntohl(net_hdr_word(iph)) ^ skb_gro_len(skb)) | (id & ~IP_DF));
|
||||||
|
id >>= 16;
|
||||||
|
|
||||||
|
list_for_each_entry(p, head, list) {
|
||||||
|
--- a/net/ipv4/tcp_output.c
|
||||||
|
+++ b/net/ipv4/tcp_output.c
|
||||||
|
@@ -609,48 +609,53 @@ static void tcp_options_write(__be32 *pt
|
||||||
|
u16 options = opts->options; /* mungable copy */
|
||||||
|
|
||||||
|
if (unlikely(OPTION_MD5 & options)) {
|
||||||
|
- *ptr++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
||||||
|
- (TCPOPT_MD5SIG << 8) | TCPOLEN_MD5SIG);
|
||||||
|
+ net_hdr_word(ptr++) =
|
||||||
|
+ htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
||||||
|
+ (TCPOPT_MD5SIG << 8) | TCPOLEN_MD5SIG);
|
||||||
|
/* overload cookie hash location */
|
||||||
|
opts->hash_location = (__u8 *)ptr;
|
||||||
|
ptr += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unlikely(opts->mss)) {
|
||||||
|
- *ptr++ = htonl((TCPOPT_MSS << 24) |
|
||||||
|
- (TCPOLEN_MSS << 16) |
|
||||||
|
- opts->mss);
|
||||||
|
+ net_hdr_word(ptr++) =
|
||||||
|
+ htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) |
|
||||||
|
+ opts->mss);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (likely(OPTION_TS & options)) {
|
||||||
|
if (unlikely(OPTION_SACK_ADVERTISE & options)) {
|
||||||
|
- *ptr++ = htonl((TCPOPT_SACK_PERM << 24) |
|
||||||
|
- (TCPOLEN_SACK_PERM << 16) |
|
||||||
|
- (TCPOPT_TIMESTAMP << 8) |
|
||||||
|
- TCPOLEN_TIMESTAMP);
|
||||||
|
+ net_hdr_word(ptr++) =
|
||||||
|
+ htonl((TCPOPT_SACK_PERM << 24) |
|
||||||
|
+ (TCPOLEN_SACK_PERM << 16) |
|
||||||
|
+ (TCPOPT_TIMESTAMP << 8) |
|
||||||
|
+ TCPOLEN_TIMESTAMP);
|
||||||
|
options &= ~OPTION_SACK_ADVERTISE;
|
||||||
|
} else {
|
||||||
|
- *ptr++ = htonl((TCPOPT_NOP << 24) |
|
||||||
|
- (TCPOPT_NOP << 16) |
|
||||||
|
- (TCPOPT_TIMESTAMP << 8) |
|
||||||
|
- TCPOLEN_TIMESTAMP);
|
||||||
|
+ net_hdr_word(ptr++) =
|
||||||
|
+ htonl((TCPOPT_NOP << 24) |
|
||||||
|
+ (TCPOPT_NOP << 16) |
|
||||||
|
+ (TCPOPT_TIMESTAMP << 8) |
|
||||||
|
+ TCPOLEN_TIMESTAMP);
|
||||||
|
}
|
||||||
|
- *ptr++ = htonl(opts->tsval);
|
||||||
|
- *ptr++ = htonl(opts->tsecr);
|
||||||
|
+ net_hdr_word(ptr++) = htonl(opts->tsval);
|
||||||
|
+ net_hdr_word(ptr++) = htonl(opts->tsecr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unlikely(OPTION_SACK_ADVERTISE & options)) {
|
||||||
|
- *ptr++ = htonl((TCPOPT_NOP << 24) |
|
||||||
|
- (TCPOPT_NOP << 16) |
|
||||||
|
- (TCPOPT_SACK_PERM << 8) |
|
||||||
|
- TCPOLEN_SACK_PERM);
|
||||||
|
+ net_hdr_word(ptr++) =
|
||||||
|
+ htonl((TCPOPT_NOP << 24) |
|
||||||
|
+ (TCPOPT_NOP << 16) |
|
||||||
|
+ (TCPOPT_SACK_PERM << 8) |
|
||||||
|
+ TCPOLEN_SACK_PERM);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unlikely(OPTION_WSCALE & options)) {
|
||||||
|
- *ptr++ = htonl((TCPOPT_NOP << 24) |
|
||||||
|
- (TCPOPT_WINDOW << 16) |
|
||||||
|
- (TCPOLEN_WINDOW << 8) |
|
||||||
|
- opts->ws);
|
||||||
|
+ net_hdr_word(ptr++) =
|
||||||
|
+ htonl((TCPOPT_NOP << 24) |
|
||||||
|
+ (TCPOPT_WINDOW << 16) |
|
||||||
|
+ (TCPOLEN_WINDOW << 8) |
|
||||||
|
+ opts->ws);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unlikely(opts->num_sack_blocks)) {
|
||||||
|
@@ -658,16 +663,17 @@ static void tcp_options_write(__be32 *pt
|
||||||
|
tp->duplicate_sack : tp->selective_acks;
|
||||||
|
int this_sack;
|
||||||
|
|
||||||
|
- *ptr++ = htonl((TCPOPT_NOP << 24) |
|
||||||
|
- (TCPOPT_NOP << 16) |
|
||||||
|
- (TCPOPT_SACK << 8) |
|
||||||
|
- (TCPOLEN_SACK_BASE + (opts->num_sack_blocks *
|
||||||
|
+ net_hdr_word(ptr++) =
|
||||||
|
+ htonl((TCPOPT_NOP << 24) |
|
||||||
|
+ (TCPOPT_NOP << 16) |
|
||||||
|
+ (TCPOPT_SACK << 8) |
|
||||||
|
+ (TCPOLEN_SACK_BASE + (opts->num_sack_blocks *
|
||||||
|
TCPOLEN_SACK_PERBLOCK)));
|
||||||
|
|
||||||
|
for (this_sack = 0; this_sack < opts->num_sack_blocks;
|
||||||
|
++this_sack) {
|
||||||
|
- *ptr++ = htonl(sp[this_sack].start_seq);
|
||||||
|
- *ptr++ = htonl(sp[this_sack].end_seq);
|
||||||
|
+ net_hdr_word(ptr++) = htonl(sp[this_sack].start_seq);
|
||||||
|
+ net_hdr_word(ptr++) = htonl(sp[this_sack].end_seq);
|
||||||
|
}
|
||||||
|
|
||||||
|
tp->rx_opt.dsack = 0;
|
||||||
|
@@ -680,13 +686,14 @@ static void tcp_options_write(__be32 *pt
|
||||||
|
|
||||||
|
if (foc->exp) {
|
||||||
|
len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len;
|
||||||
|
- *ptr = htonl((TCPOPT_EXP << 24) | (len << 16) |
|
||||||
|
+ net_hdr_word(ptr) =
|
||||||
|
+ htonl((TCPOPT_EXP << 24) | (len << 16) |
|
||||||
|
TCPOPT_FASTOPEN_MAGIC);
|
||||||
|
p += TCPOLEN_EXP_FASTOPEN_BASE;
|
||||||
|
} else {
|
||||||
|
len = TCPOLEN_FASTOPEN_BASE + foc->len;
|
||||||
|
- *p++ = TCPOPT_FASTOPEN;
|
||||||
|
- *p++ = len;
|
||||||
|
+ net_hdr_word(p++) = TCPOPT_FASTOPEN;
|
||||||
|
+ net_hdr_word(p++) = len;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(p, foc->val, foc->len);
|
||||||
|
--- a/include/uapi/linux/igmp.h
|
||||||
|
+++ b/include/uapi/linux/igmp.h
|
||||||
|
@@ -33,7 +33,7 @@ struct igmphdr {
|
||||||
|
__u8 code; /* For newer IGMP */
|
||||||
|
__sum16 csum;
|
||||||
|
__be32 group;
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
/* V3 group record types [grec_type] */
|
||||||
|
#define IGMPV3_MODE_IS_INCLUDE 1
|
||||||
|
@@ -49,7 +49,7 @@ struct igmpv3_grec {
|
||||||
|
__be16 grec_nsrcs;
|
||||||
|
__be32 grec_mca;
|
||||||
|
__be32 grec_src[0];
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
struct igmpv3_report {
|
||||||
|
__u8 type;
|
||||||
|
@@ -58,7 +58,7 @@ struct igmpv3_report {
|
||||||
|
__be16 resv2;
|
||||||
|
__be16 ngrec;
|
||||||
|
struct igmpv3_grec grec[0];
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
struct igmpv3_query {
|
||||||
|
__u8 type;
|
||||||
|
@@ -79,7 +79,7 @@ struct igmpv3_query {
|
||||||
|
__u8 qqic;
|
||||||
|
__be16 nsrcs;
|
||||||
|
__be32 srcs[0];
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
|
||||||
|
#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */
|
||||||
|
--- a/net/core/flow_dissector.c
|
||||||
|
+++ b/net/core/flow_dissector.c
|
||||||
|
@@ -129,7 +129,7 @@ __be32 __skb_flow_get_ports(const struct
|
||||||
|
ports = __skb_header_pointer(skb, thoff + poff,
|
||||||
|
sizeof(_ports), data, hlen, &_ports);
|
||||||
|
if (ports)
|
||||||
|
- return *ports;
|
||||||
|
+ return (__be32)net_hdr_word(ports);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
--- a/include/uapi/linux/icmpv6.h
|
||||||
|
+++ b/include/uapi/linux/icmpv6.h
|
||||||
|
@@ -78,7 +78,7 @@ struct icmp6hdr {
|
||||||
|
#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
|
||||||
|
#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
|
||||||
|
#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
|
||||||
|
#define ICMPV6_ROUTER_PREF_LOW 0x3
|
||||||
|
--- a/include/net/ndisc.h
|
||||||
|
+++ b/include/net/ndisc.h
|
||||||
|
@@ -93,7 +93,7 @@ struct ra_msg {
|
||||||
|
struct icmp6hdr icmph;
|
||||||
|
__be32 reachable_time;
|
||||||
|
__be32 retrans_timer;
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
struct rd_msg {
|
||||||
|
struct icmp6hdr icmph;
|
||||||
|
@@ -372,10 +372,10 @@ static inline u32 ndisc_hashfn(const voi
|
||||||
|
{
|
||||||
|
const u32 *p32 = pkey;
|
||||||
|
|
||||||
|
- return (((p32[0] ^ hash32_ptr(dev)) * hash_rnd[0]) +
|
||||||
|
- (p32[1] * hash_rnd[1]) +
|
||||||
|
- (p32[2] * hash_rnd[2]) +
|
||||||
|
- (p32[3] * hash_rnd[3]));
|
||||||
|
+ return (((net_hdr_word(&p32[0]) ^ hash32_ptr(dev)) * hash_rnd[0]) +
|
||||||
|
+ (net_hdr_word(&p32[1]) * hash_rnd[1]) +
|
||||||
|
+ (net_hdr_word(&p32[2]) * hash_rnd[2]) +
|
||||||
|
+ (net_hdr_word(&p32[3]) * hash_rnd[3]));
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline struct neighbour *__ipv6_neigh_lookup_noref(struct net_device *dev, const void *pkey)
|
||||||
|
--- a/net/sched/cls_u32.c
|
||||||
|
+++ b/net/sched/cls_u32.c
|
||||||
|
@@ -155,7 +155,7 @@ next_knode:
|
||||||
|
data = skb_header_pointer(skb, toff, 4, &hdata);
|
||||||
|
if (!data)
|
||||||
|
goto out;
|
||||||
|
- if ((*data ^ key->val) & key->mask) {
|
||||||
|
+ if ((net_hdr_word(data) ^ key->val) & key->mask) {
|
||||||
|
n = rcu_dereference_bh(n->next);
|
||||||
|
goto next_knode;
|
||||||
|
}
|
||||||
|
@@ -206,8 +206,8 @@ check_terminal:
|
||||||
|
&hdata);
|
||||||
|
if (!data)
|
||||||
|
goto out;
|
||||||
|
- sel = ht->divisor & u32_hash_fold(*data, &n->sel,
|
||||||
|
- n->fshift);
|
||||||
|
+ sel = ht->divisor & u32_hash_fold(net_hdr_word(data),
|
||||||
|
+ &n->sel, n->fshift);
|
||||||
|
}
|
||||||
|
if (!(n->sel.flags & (TC_U32_VAROFFSET | TC_U32_OFFSET | TC_U32_EAT)))
|
||||||
|
goto next_ht;
|
||||||
|
--- a/net/ipv6/ip6_offload.c
|
||||||
|
+++ b/net/ipv6/ip6_offload.c
|
||||||
|
@@ -241,7 +241,7 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
|
||||||
|
continue;
|
||||||
|
|
||||||
|
iph2 = (struct ipv6hdr *)(p->data + off);
|
||||||
|
- first_word = *(__be32 *)iph ^ *(__be32 *)iph2;
|
||||||
|
+ first_word = net_hdr_word(iph) ^ net_hdr_word(iph2);
|
||||||
|
|
||||||
|
/* All fields must match except length and Traffic Class.
|
||||||
|
* XXX skbs on the gro_list have all been parsed and pulled
|
||||||
|
--- a/include/net/addrconf.h
|
||||||
|
+++ b/include/net/addrconf.h
|
||||||
|
@@ -47,7 +47,7 @@ struct prefix_info {
|
||||||
|
__be32 reserved2;
|
||||||
|
|
||||||
|
struct in6_addr prefix;
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
#include <linux/ipv6.h>
|
||||||
|
#include <linux/netdevice.h>
|
||||||
|
--- a/include/net/inet_ecn.h
|
||||||
|
+++ b/include/net/inet_ecn.h
|
||||||
|
@@ -138,9 +138,9 @@ static inline int IP6_ECN_set_ce(struct
|
||||||
|
if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
- from = *(__be32 *)iph;
|
||||||
|
+ from = net_hdr_word(iph);
|
||||||
|
to = from | htonl(INET_ECN_CE << 20);
|
||||||
|
- *(__be32 *)iph = to;
|
||||||
|
+ net_hdr_word(iph) = to;
|
||||||
|
if (skb->ip_summed == CHECKSUM_COMPLETE)
|
||||||
|
skb->csum = csum_add(csum_sub(skb->csum, (__force __wsum)from),
|
||||||
|
(__force __wsum)to);
|
||||||
|
--- a/include/net/ipv6.h
|
||||||
|
+++ b/include/net/ipv6.h
|
||||||
|
@@ -147,7 +147,7 @@ struct frag_hdr {
|
||||||
|
__u8 reserved;
|
||||||
|
__be16 frag_off;
|
||||||
|
__be32 identification;
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
|
#define IP6_MF 0x0001
|
||||||
|
#define IP6_OFFSET 0xFFF8
|
||||||
|
@@ -561,8 +561,8 @@ static inline void __ipv6_addr_set_half(
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
- addr[0] = wh;
|
||||||
|
- addr[1] = wl;
|
||||||
|
+ net_hdr_word(&addr[0]) = wh;
|
||||||
|
+ net_hdr_word(&addr[1]) = wl;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void ipv6_addr_set(struct in6_addr *addr,
|
||||||
|
@@ -621,6 +621,8 @@ static inline bool ipv6_prefix_equal(con
|
||||||
|
const __be32 *a1 = addr1->s6_addr32;
|
||||||
|
const __be32 *a2 = addr2->s6_addr32;
|
||||||
|
unsigned int pdw, pbi;
|
||||||
|
+ /* Used for last <32-bit fraction of prefix */
|
||||||
|
+ u32 pbia1, pbia2;
|
||||||
|
|
||||||
|
/* check complete u32 in prefix */
|
||||||
|
pdw = prefixlen >> 5;
|
||||||
|
@@ -629,7 +631,9 @@ static inline bool ipv6_prefix_equal(con
|
||||||
|
|
||||||
|
/* check incomplete u32 in prefix */
|
||||||
|
pbi = prefixlen & 0x1f;
|
||||||
|
- if (pbi && ((a1[pdw] ^ a2[pdw]) & htonl((0xffffffff) << (32 - pbi))))
|
||||||
|
+ pbia1 = net_hdr_word(&a1[pdw]);
|
||||||
|
+ pbia2 = net_hdr_word(&a2[pdw]);
|
||||||
|
+ if (pbi && ((pbia1 ^ pbia2) & htonl((0xffffffff) << (32 - pbi))))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
@@ -746,13 +750,13 @@ static inline void ipv6_addr_set_v4mappe
|
||||||
|
*/
|
||||||
|
static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen)
|
||||||
|
{
|
||||||
|
- const __be32 *a1 = token1, *a2 = token2;
|
||||||
|
+ const struct in6_addr *a1 = token1, *a2 = token2;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
addrlen >>= 2;
|
||||||
|
|
||||||
|
for (i = 0; i < addrlen; i++) {
|
||||||
|
- __be32 xb = a1[i] ^ a2[i];
|
||||||
|
+ __be32 xb = a1->s6_addr32[i] ^ a2->s6_addr32[i];
|
||||||
|
if (xb)
|
||||||
|
return i * 32 + 31 - __fls(ntohl(xb));
|
||||||
|
}
|
||||||
|
@@ -946,17 +950,18 @@ static inline u32 ip6_multipath_hash_fie
|
||||||
|
static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
|
||||||
|
__be32 flowlabel)
|
||||||
|
{
|
||||||
|
- *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | flowlabel;
|
||||||
|
+ net_hdr_word((__be32 *)hdr) =
|
||||||
|
+ htonl(0x60000000 | (tclass << 20)) | flowlabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr)
|
||||||
|
{
|
||||||
|
- return *(__be32 *)hdr & IPV6_FLOWINFO_MASK;
|
||||||
|
+ return net_hdr_word((__be32 *)hdr) & IPV6_FLOWINFO_MASK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr)
|
||||||
|
{
|
||||||
|
- return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK;
|
||||||
|
+ return net_hdr_word((__be32 *)hdr) & IPV6_FLOWLABEL_MASK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline u8 ip6_tclass(__be32 flowinfo)
|
||||||
|
--- a/include/net/secure_seq.h
|
||||||
|
+++ b/include/net/secure_seq.h
|
||||||
|
@@ -3,6 +3,7 @@
|
||||||
|
#define _NET_SECURE_SEQ
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
+#include <linux/in6.h>
|
||||||
|
|
||||||
|
u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
|
||||||
|
u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
|
||||||
|
--- a/include/uapi/linux/in.h
|
||||||
|
+++ b/include/uapi/linux/in.h
|
||||||
|
@@ -88,7 +88,7 @@ enum {
|
||||||
|
/* Internet address. */
|
||||||
|
struct in_addr {
|
||||||
|
__be32 s_addr;
|
||||||
|
-};
|
||||||
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define IP_TOS 1
|
||||||
|
--- a/net/ipv6/ip6_fib.c
|
||||||
|
+++ b/net/ipv6/ip6_fib.c
|
||||||
|
@@ -141,7 +141,7 @@ static __be32 addr_bit_set(const void *t
|
||||||
|
* See include/asm-generic/bitops/le.h.
|
||||||
|
*/
|
||||||
|
return (__force __be32)(1 << ((~fn_bit ^ BITOP_BE32_SWIZZLE) & 0x1f)) &
|
||||||
|
- addr[fn_bit >> 5];
|
||||||
|
+ net_hdr_word(&addr[fn_bit >> 5]);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct fib6_info *fib6_info_alloc(gfp_t gfp_flags, bool with_fib6_nh)
|
||||||
|
--- a/net/netfilter/nf_conntrack_proto_tcp.c
|
||||||
|
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
|
||||||
|
@@ -400,7 +400,7 @@ static void tcp_sack(const struct sk_buf
|
||||||
|
|
||||||
|
/* Fast path for timestamp-only option */
|
||||||
|
if (length == TCPOLEN_TSTAMP_ALIGNED
|
||||||
|
- && *(__be32 *)ptr == htonl((TCPOPT_NOP << 24)
|
||||||
|
+ && net_hdr_word(ptr) == htonl((TCPOPT_NOP << 24)
|
||||||
|
| (TCPOPT_NOP << 16)
|
||||||
|
| (TCPOPT_TIMESTAMP << 8)
|
||||||
|
| TCPOLEN_TIMESTAMP))
|
||||||
|
--- a/net/xfrm/xfrm_input.c
|
||||||
|
+++ b/net/xfrm/xfrm_input.c
|
||||||
|
@@ -167,8 +167,8 @@ int xfrm_parse_spi(struct sk_buff *skb,
|
||||||
|
if (!pskb_may_pull(skb, hlen))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
- *spi = *(__be32 *)(skb_transport_header(skb) + offset);
|
||||||
|
- *seq = *(__be32 *)(skb_transport_header(skb) + offset_seq);
|
||||||
|
+ *spi = net_hdr_word(skb_transport_header(skb) + offset);
|
||||||
|
+ *seq = net_hdr_word(skb_transport_header(skb) + offset_seq);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(xfrm_parse_spi);
|
||||||
|
--- a/net/ipv4/tcp_input.c
|
||||||
|
+++ b/net/ipv4/tcp_input.c
|
||||||
|
@@ -4175,14 +4175,16 @@ static bool tcp_parse_aligned_timestamp(
|
||||||
|
{
|
||||||
|
const __be32 *ptr = (const __be32 *)(th + 1);
|
||||||
|
|
||||||
|
- if (*ptr == htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16)
|
||||||
|
- | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) {
|
||||||
|
+ if (net_hdr_word(ptr) ==
|
||||||
|
+ htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
||||||
|
+ (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) {
|
||||||
|
tp->rx_opt.saw_tstamp = 1;
|
||||||
|
++ptr;
|
||||||
|
- tp->rx_opt.rcv_tsval = ntohl(*ptr);
|
||||||
|
+ tp->rx_opt.rcv_tsval = get_unaligned_be32(ptr);
|
||||||
|
++ptr;
|
||||||
|
- if (*ptr)
|
||||||
|
- tp->rx_opt.rcv_tsecr = ntohl(*ptr) - tp->tsoffset;
|
||||||
|
+ if (net_hdr_word(ptr))
|
||||||
|
+ tp->rx_opt.rcv_tsecr = get_unaligned_be32(ptr) -
|
||||||
|
+ tp->tsoffset;
|
||||||
|
else
|
||||||
|
tp->rx_opt.rcv_tsecr = 0;
|
||||||
|
return true;
|
||||||
|
--- a/include/uapi/linux/if_pppox.h
|
||||||
|
+++ b/include/uapi/linux/if_pppox.h
|
||||||
|
@@ -51,6 +51,7 @@ struct pppoe_addr {
|
||||||
|
*/
|
||||||
|
struct pptp_addr {
|
||||||
|
__u16 call_id;
|
||||||
|
+ __u16 pad;
|
||||||
|
struct in_addr sin_addr;
|
||||||
|
};
|
||||||
|
|
||||||
|
--- a/include/net/neighbour.h
|
||||||
|
+++ b/include/net/neighbour.h
|
||||||
|
@@ -270,8 +270,10 @@ static inline bool neigh_key_eq128(const
|
||||||
|
const u32 *n32 = (const u32 *)n->primary_key;
|
||||||
|
const u32 *p32 = pkey;
|
||||||
|
|
||||||
|
- return ((n32[0] ^ p32[0]) | (n32[1] ^ p32[1]) |
|
||||||
|
- (n32[2] ^ p32[2]) | (n32[3] ^ p32[3])) == 0;
|
||||||
|
+ return ((n32[0] ^ net_hdr_word(&p32[0])) |
|
||||||
|
+ (n32[1] ^ net_hdr_word(&p32[1])) |
|
||||||
|
+ (n32[2] ^ net_hdr_word(&p32[2])) |
|
||||||
|
+ (n32[3] ^ net_hdr_word(&p32[3]))) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline struct neighbour *___neigh_lookup_noref(
|
||||||
|
--- a/include/uapi/linux/netfilter_arp/arp_tables.h
|
||||||
|
+++ b/include/uapi/linux/netfilter_arp/arp_tables.h
|
||||||
|
@@ -70,7 +70,7 @@ struct arpt_arp {
|
||||||
|
__u8 flags;
|
||||||
|
/* Inverse flags */
|
||||||
|
__u16 invflags;
|
||||||
|
-};
|
||||||
|
+} __attribute__((aligned(4)));
|
||||||
|
|
||||||
|
/* Values for "flag" field in struct arpt_ip (general arp structure).
|
||||||
|
* No flags defined yet.
|
||||||
|
--- a/net/core/utils.c
|
||||||
|
+++ b/net/core/utils.c
|
||||||
|
@@ -460,8 +460,14 @@ void inet_proto_csum_replace16(__sum16 *
|
||||||
|
bool pseudohdr)
|
||||||
|
{
|
||||||
|
__be32 diff[] = {
|
||||||
|
- ~from[0], ~from[1], ~from[2], ~from[3],
|
||||||
|
- to[0], to[1], to[2], to[3],
|
||||||
|
+ ~net_hdr_word(&from[0]),
|
||||||
|
+ ~net_hdr_word(&from[1]),
|
||||||
|
+ ~net_hdr_word(&from[2]),
|
||||||
|
+ ~net_hdr_word(&from[3]),
|
||||||
|
+ net_hdr_word(&to[0]),
|
||||||
|
+ net_hdr_word(&to[1]),
|
||||||
|
+ net_hdr_word(&to[2]),
|
||||||
|
+ net_hdr_word(&to[3]),
|
||||||
|
};
|
||||||
|
if (skb->ip_summed != CHECKSUM_PARTIAL) {
|
||||||
|
*sum = csum_fold(csum_partial(diff, sizeof(diff),
|
||||||
|
--- a/include/linux/etherdevice.h
|
||||||
|
+++ b/include/linux/etherdevice.h
|
||||||
|
@@ -525,7 +525,7 @@ static inline bool is_etherdev_addr(cons
|
||||||
|
* @b: Pointer to Ethernet header
|
||||||
|
*
|
||||||
|
* Compare two Ethernet headers, returns 0 if equal.
|
||||||
|
- * This assumes that the network header (i.e., IP header) is 4-byte
|
||||||
|
+ * This assumes that the network header (i.e., IP header) is 2-byte
|
||||||
|
* aligned OR the platform can handle unaligned access. This is the
|
||||||
|
* case for all packets coming into netif_receive_skb or similar
|
||||||
|
* entry points.
|
||||||
|
@@ -548,11 +548,12 @@ static inline unsigned long compare_ethe
|
||||||
|
fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6);
|
||||||
|
return fold;
|
||||||
|
#else
|
||||||
|
- u32 *a32 = (u32 *)((u8 *)a + 2);
|
||||||
|
- u32 *b32 = (u32 *)((u8 *)b + 2);
|
||||||
|
+ const u16 *a16 = a;
|
||||||
|
+ const u16 *b16 = b;
|
||||||
|
|
||||||
|
- return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) |
|
||||||
|
- (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]);
|
||||||
|
+ return (a16[0] ^ b16[0]) | (a16[1] ^ b16[1]) | (a16[2] ^ b16[2]) |
|
||||||
|
+ (a16[3] ^ b16[3]) | (a16[4] ^ b16[4]) | (a16[5] ^ b16[5]) |
|
||||||
|
+ (a16[6] ^ b16[6]);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
--- a/net/ipv4/tcp_offload.c
|
||||||
|
+++ b/net/ipv4/tcp_offload.c
|
||||||
|
@@ -223,7 +223,7 @@ struct sk_buff *tcp_gro_receive(struct l
|
||||||
|
|
||||||
|
th2 = tcp_hdr(p);
|
||||||
|
|
||||||
|
- if (*(u32 *)&th->source ^ *(u32 *)&th2->source) {
|
||||||
|
+ if (net_hdr_word(&th->source) ^ net_hdr_word(&th2->source)) {
|
||||||
|
NAPI_GRO_CB(p)->same_flow = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
@@ -241,8 +241,8 @@ found:
|
||||||
|
~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH));
|
||||||
|
flush |= (__force int)(th->ack_seq ^ th2->ack_seq);
|
||||||
|
for (i = sizeof(*th); i < thlen; i += 4)
|
||||||
|
- flush |= *(u32 *)((u8 *)th + i) ^
|
||||||
|
- *(u32 *)((u8 *)th2 + i);
|
||||||
|
+ flush |= net_hdr_word((u8 *)th + i) ^
|
||||||
|
+ net_hdr_word((u8 *)th2 + i);
|
||||||
|
|
||||||
|
/* When we receive our second frame we can made a decision on if we
|
||||||
|
* continue this flow as an atomic flow with a fixed ID or if we use
|
||||||
|
--- a/net/ipv6/netfilter/ip6table_mangle.c
|
||||||
|
+++ b/net/ipv6/netfilter/ip6table_mangle.c
|
||||||
|
@@ -44,7 +44,7 @@ ip6t_mangle_out(struct sk_buff *skb, con
|
||||||
|
hop_limit = ipv6_hdr(skb)->hop_limit;
|
||||||
|
|
||||||
|
/* flowlabel and prio (includes version, which shouldn't change either */
|
||||||
|
- flowlabel = *((u_int32_t *)ipv6_hdr(skb));
|
||||||
|
+ flowlabel = net_hdr_word(ipv6_hdr(skb));
|
||||||
|
|
||||||
|
ret = ip6t_do_table(skb, state, priv);
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ ip6t_mangle_out(struct sk_buff *skb, con
|
||||||
|
!ipv6_addr_equal(&ipv6_hdr(skb)->daddr, &daddr) ||
|
||||||
|
skb->mark != mark ||
|
||||||
|
ipv6_hdr(skb)->hop_limit != hop_limit ||
|
||||||
|
- flowlabel != *((u_int32_t *)ipv6_hdr(skb)))) {
|
||||||
|
+ flowlabel != net_hdr_word(ipv6_hdr(skb)))) {
|
||||||
|
err = ip6_route_me_harder(state->net, state->sk, skb);
|
||||||
|
if (err < 0)
|
||||||
|
ret = NF_DROP_ERR(err);
|
@ -747,7 +747,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
static void mvpp2_xlg_config(struct mvpp2_port *port, unsigned int mode,
|
static void mvpp2_xlg_config(struct mvpp2_port *port, unsigned int mode,
|
||||||
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
|
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
|
||||||
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
|
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
|
||||||
@@ -1168,9 +1168,8 @@ static int otx2_set_link_ksettings(struc
|
@@ -1172,9 +1172,8 @@ static int otx2_set_link_ksettings(struc
|
||||||
otx2_get_link_ksettings(netdev, &cur_ks);
|
otx2_get_link_ksettings(netdev, &cur_ks);
|
||||||
|
|
||||||
/* Check requested modes against supported modes by hardware */
|
/* Check requested modes against supported modes by hardware */
|
||||||
|
@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue);
|
static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue);
|
||||||
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue);
|
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue);
|
||||||
|
|
||||||
@@ -1712,9 +1715,6 @@ static int __init_dma_rx_desc_rings(stru
|
@@ -1713,9 +1716,6 @@ static int __init_dma_rx_desc_rings(stru
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
/* Setup the chained descriptor addresses */
|
/* Setup the chained descriptor addresses */
|
||||||
if (priv->mode == STMMAC_CHAIN_MODE) {
|
if (priv->mode == STMMAC_CHAIN_MODE) {
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1820,12 +1820,6 @@ static int __init_dma_tx_desc_rings(stru
|
@@ -1821,12 +1821,6 @@ static int __init_dma_tx_desc_rings(stru
|
||||||
tx_q->tx_skbuff[i] = NULL;
|
tx_q->tx_skbuff[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2694,10 +2688,7 @@ static void stmmac_tx_err(struct stmmac_
|
@@ -2695,10 +2689,7 @@ static void stmmac_tx_err(struct stmmac_
|
||||||
stmmac_stop_tx_dma(priv, chan);
|
stmmac_stop_tx_dma(priv, chan);
|
||||||
dma_free_tx_skbufs(priv, chan);
|
dma_free_tx_skbufs(priv, chan);
|
||||||
stmmac_clear_tx_descriptors(priv, chan);
|
stmmac_clear_tx_descriptors(priv, chan);
|
||||||
@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, chan);
|
tx_q->dma_tx_phy, chan);
|
||||||
stmmac_start_tx_dma(priv, chan);
|
stmmac_start_tx_dma(priv, chan);
|
||||||
@@ -3781,6 +3772,8 @@ static int stmmac_open(struct net_device
|
@@ -3782,6 +3773,8 @@ static int stmmac_open(struct net_device
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
ret = stmmac_hw_setup(dev, true);
|
ret = stmmac_hw_setup(dev, true);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
|
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
|
||||||
@@ -6430,6 +6423,7 @@ void stmmac_enable_rx_queue(struct stmma
|
@@ -6432,6 +6425,7 @@ void stmmac_enable_rx_queue(struct stmma
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
stmmac_clear_rx_descriptors(priv, queue);
|
stmmac_clear_rx_descriptors(priv, queue);
|
||||||
|
|
||||||
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
@@ -6491,6 +6485,7 @@ void stmmac_enable_tx_queue(struct stmma
|
@@ -6493,6 +6487,7 @@ void stmmac_enable_tx_queue(struct stmma
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
stmmac_clear_tx_descriptors(priv, queue);
|
stmmac_clear_tx_descriptors(priv, queue);
|
||||||
|
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
@@ -7411,6 +7406,25 @@ int stmmac_suspend(struct device *dev)
|
@@ -7417,6 +7412,25 @@ int stmmac_suspend(struct device *dev)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(stmmac_suspend);
|
EXPORT_SYMBOL_GPL(stmmac_suspend);
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
/**
|
/**
|
||||||
* stmmac_reset_queues_param - reset queue parameters
|
* stmmac_reset_queues_param - reset queue parameters
|
||||||
* @priv: device pointer
|
* @priv: device pointer
|
||||||
@@ -7421,22 +7435,11 @@ static void stmmac_reset_queues_param(st
|
@@ -7427,22 +7441,11 @@ static void stmmac_reset_queues_param(st
|
||||||
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
||||||
u32 queue;
|
u32 queue;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -3833,8 +3833,6 @@ static int stmmac_release(struct net_dev
|
@@ -3834,8 +3834,6 @@ static int stmmac_release(struct net_dev
|
||||||
struct stmmac_priv *priv = netdev_priv(dev);
|
struct stmmac_priv *priv = netdev_priv(dev);
|
||||||
u32 chan;
|
u32 chan;
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (device_may_wakeup(priv->device))
|
if (device_may_wakeup(priv->device))
|
||||||
phylink_speed_down(priv->phylink, false);
|
phylink_speed_down(priv->phylink, false);
|
||||||
/* Stop and disconnect the PHY */
|
/* Stop and disconnect the PHY */
|
||||||
@@ -3846,6 +3844,8 @@ static int stmmac_release(struct net_dev
|
@@ -3847,6 +3845,8 @@ static int stmmac_release(struct net_dev
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
hrtimer_cancel(&priv->tx_queue[chan].txtimer);
|
hrtimer_cancel(&priv->tx_queue[chan].txtimer);
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (tx_q->dirty_tx != tx_q->cur_tx)
|
if (tx_q->dirty_tx != tx_q->cur_tx)
|
||||||
return -EBUSY; /* still unfinished work */
|
return -EBUSY; /* still unfinished work */
|
||||||
@@ -1309,7 +1309,7 @@ static void stmmac_display_rx_rings(stru
|
@@ -1310,7 +1310,7 @@ static void stmmac_display_rx_rings(stru
|
||||||
|
|
||||||
/* Display RX rings */
|
/* Display RX rings */
|
||||||
for (queue = 0; queue < rx_cnt; queue++) {
|
for (queue = 0; queue < rx_cnt; queue++) {
|
||||||
@ -198,7 +198,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
pr_info("\tRX Queue %u rings\n", queue);
|
pr_info("\tRX Queue %u rings\n", queue);
|
||||||
|
|
||||||
@@ -1322,7 +1322,7 @@ static void stmmac_display_rx_rings(stru
|
@@ -1323,7 +1323,7 @@ static void stmmac_display_rx_rings(stru
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display RX ring */
|
/* Display RX ring */
|
||||||
@ -207,7 +207,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
rx_q->dma_rx_phy, desc_size);
|
rx_q->dma_rx_phy, desc_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1336,7 +1336,7 @@ static void stmmac_display_tx_rings(stru
|
@@ -1337,7 +1337,7 @@ static void stmmac_display_tx_rings(stru
|
||||||
|
|
||||||
/* Display TX rings */
|
/* Display TX rings */
|
||||||
for (queue = 0; queue < tx_cnt; queue++) {
|
for (queue = 0; queue < tx_cnt; queue++) {
|
||||||
@ -216,7 +216,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
pr_info("\tTX Queue %d rings\n", queue);
|
pr_info("\tTX Queue %d rings\n", queue);
|
||||||
|
|
||||||
@@ -1351,7 +1351,7 @@ static void stmmac_display_tx_rings(stru
|
@@ -1352,7 +1352,7 @@ static void stmmac_display_tx_rings(stru
|
||||||
desc_size = sizeof(struct dma_desc);
|
desc_size = sizeof(struct dma_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
tx_q->dma_tx_phy, desc_size);
|
tx_q->dma_tx_phy, desc_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1392,21 +1392,21 @@ static int stmmac_set_bfsize(int mtu, in
|
@@ -1393,21 +1393,21 @@ static int stmmac_set_bfsize(int mtu, in
|
||||||
*/
|
*/
|
||||||
static void stmmac_clear_rx_descriptors(struct stmmac_priv *priv, u32 queue)
|
static void stmmac_clear_rx_descriptors(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -253,7 +253,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1418,12 +1418,12 @@ static void stmmac_clear_rx_descriptors(
|
@@ -1419,12 +1419,12 @@ static void stmmac_clear_rx_descriptors(
|
||||||
*/
|
*/
|
||||||
static void stmmac_clear_tx_descriptors(struct stmmac_priv *priv, u32 queue)
|
static void stmmac_clear_tx_descriptors(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -269,7 +269,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1471,7 +1471,7 @@ static void stmmac_clear_descriptors(str
|
@@ -1472,7 +1472,7 @@ static void stmmac_clear_descriptors(str
|
||||||
static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p,
|
static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p,
|
||||||
int i, gfp_t flags, u32 queue)
|
int i, gfp_t flags, u32 queue)
|
||||||
{
|
{
|
||||||
@ -278,7 +278,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (!buf->page) {
|
if (!buf->page) {
|
||||||
@@ -1496,7 +1496,7 @@ static int stmmac_init_rx_buffers(struct
|
@@ -1497,7 +1497,7 @@ static int stmmac_init_rx_buffers(struct
|
||||||
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
|
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
|
||||||
|
|
||||||
stmmac_set_desc_addr(priv, p, buf->addr);
|
stmmac_set_desc_addr(priv, p, buf->addr);
|
||||||
@ -287,7 +287,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
stmmac_init_desc3(priv, p);
|
stmmac_init_desc3(priv, p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1510,7 +1510,7 @@ static int stmmac_init_rx_buffers(struct
|
@@ -1511,7 +1511,7 @@ static int stmmac_init_rx_buffers(struct
|
||||||
*/
|
*/
|
||||||
static void stmmac_free_rx_buffer(struct stmmac_priv *priv, u32 queue, int i)
|
static void stmmac_free_rx_buffer(struct stmmac_priv *priv, u32 queue, int i)
|
||||||
{
|
{
|
||||||
@ -296,7 +296,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (buf->page)
|
if (buf->page)
|
||||||
@@ -1530,7 +1530,7 @@ static void stmmac_free_rx_buffer(struct
|
@@ -1531,7 +1531,7 @@ static void stmmac_free_rx_buffer(struct
|
||||||
*/
|
*/
|
||||||
static void stmmac_free_tx_buffer(struct stmmac_priv *priv, u32 queue, int i)
|
static void stmmac_free_tx_buffer(struct stmmac_priv *priv, u32 queue, int i)
|
||||||
{
|
{
|
||||||
@ -305,7 +305,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (tx_q->tx_skbuff_dma[i].buf &&
|
if (tx_q->tx_skbuff_dma[i].buf &&
|
||||||
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
|
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
|
||||||
@@ -1575,17 +1575,17 @@ static void dma_free_rx_skbufs(struct st
|
@@ -1576,17 +1576,17 @@ static void dma_free_rx_skbufs(struct st
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -1612,10 +1612,10 @@ static int stmmac_alloc_rx_buffers(struc
|
@@ -1613,10 +1613,10 @@ static int stmmac_alloc_rx_buffers(struc
|
||||||
*/
|
*/
|
||||||
static void dma_free_rx_xskbufs(struct stmmac_priv *priv, u32 queue)
|
static void dma_free_rx_xskbufs(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -339,7 +339,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (!buf->xdp)
|
if (!buf->xdp)
|
||||||
@@ -1628,10 +1628,10 @@ static void dma_free_rx_xskbufs(struct s
|
@@ -1629,10 +1629,10 @@ static void dma_free_rx_xskbufs(struct s
|
||||||
|
|
||||||
static int stmmac_alloc_rx_buffers_zc(struct stmmac_priv *priv, u32 queue)
|
static int stmmac_alloc_rx_buffers_zc(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -352,7 +352,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_rx_buffer *buf;
|
struct stmmac_rx_buffer *buf;
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
@@ -1674,7 +1674,7 @@ static struct xsk_buff_pool *stmmac_get_
|
@@ -1675,7 +1675,7 @@ static struct xsk_buff_pool *stmmac_get_
|
||||||
*/
|
*/
|
||||||
static int __init_dma_rx_desc_rings(struct stmmac_priv *priv, u32 queue, gfp_t flags)
|
static int __init_dma_rx_desc_rings(struct stmmac_priv *priv, u32 queue, gfp_t flags)
|
||||||
{
|
{
|
||||||
@ -361,7 +361,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
netif_dbg(priv, probe, priv->dev,
|
netif_dbg(priv, probe, priv->dev,
|
||||||
@@ -1720,11 +1720,11 @@ static int __init_dma_rx_desc_rings(stru
|
@@ -1721,11 +1721,11 @@ static int __init_dma_rx_desc_rings(stru
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
stmmac_mode_init(priv, rx_q->dma_erx,
|
stmmac_mode_init(priv, rx_q->dma_erx,
|
||||||
rx_q->dma_rx_phy,
|
rx_q->dma_rx_phy,
|
||||||
@ -375,7 +375,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1751,7 +1751,7 @@ static int init_dma_rx_desc_rings(struct
|
@@ -1752,7 +1752,7 @@ static int init_dma_rx_desc_rings(struct
|
||||||
|
|
||||||
err_init_rx_buffers:
|
err_init_rx_buffers:
|
||||||
while (queue >= 0) {
|
while (queue >= 0) {
|
||||||
@ -384,7 +384,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (rx_q->xsk_pool)
|
if (rx_q->xsk_pool)
|
||||||
dma_free_rx_xskbufs(priv, queue);
|
dma_free_rx_xskbufs(priv, queue);
|
||||||
@@ -1780,7 +1780,7 @@ err_init_rx_buffers:
|
@@ -1781,7 +1781,7 @@ err_init_rx_buffers:
|
||||||
*/
|
*/
|
||||||
static int __init_dma_tx_desc_rings(struct stmmac_priv *priv, u32 queue)
|
static int __init_dma_tx_desc_rings(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -393,7 +393,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
netif_dbg(priv, probe, priv->dev,
|
netif_dbg(priv, probe, priv->dev,
|
||||||
@@ -1792,16 +1792,16 @@ static int __init_dma_tx_desc_rings(stru
|
@@ -1793,16 +1793,16 @@ static int __init_dma_tx_desc_rings(stru
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
stmmac_mode_init(priv, tx_q->dma_etx,
|
stmmac_mode_init(priv, tx_q->dma_etx,
|
||||||
tx_q->dma_tx_phy,
|
tx_q->dma_tx_phy,
|
||||||
@ -413,7 +413,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1871,12 +1871,12 @@ static int init_dma_desc_rings(struct ne
|
@@ -1872,12 +1872,12 @@ static int init_dma_desc_rings(struct ne
|
||||||
*/
|
*/
|
||||||
static void dma_free_tx_skbufs(struct stmmac_priv *priv, u32 queue)
|
static void dma_free_tx_skbufs(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -428,7 +428,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
stmmac_free_tx_buffer(priv, queue, i);
|
stmmac_free_tx_buffer(priv, queue, i);
|
||||||
|
|
||||||
if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
|
if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
|
||||||
@@ -1906,7 +1906,7 @@ static void stmmac_free_tx_skbufs(struct
|
@@ -1907,7 +1907,7 @@ static void stmmac_free_tx_skbufs(struct
|
||||||
*/
|
*/
|
||||||
static void __free_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
static void __free_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -437,7 +437,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Release the DMA RX socket buffers */
|
/* Release the DMA RX socket buffers */
|
||||||
if (rx_q->xsk_pool)
|
if (rx_q->xsk_pool)
|
||||||
@@ -1919,11 +1919,11 @@ static void __free_dma_rx_desc_resources
|
@@ -1920,11 +1920,11 @@ static void __free_dma_rx_desc_resources
|
||||||
|
|
||||||
/* Free DMA regions of consistent memory previously allocated */
|
/* Free DMA regions of consistent memory previously allocated */
|
||||||
if (!priv->extend_desc)
|
if (!priv->extend_desc)
|
||||||
@ -451,7 +451,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(struct dma_extended_desc),
|
sizeof(struct dma_extended_desc),
|
||||||
rx_q->dma_erx, rx_q->dma_rx_phy);
|
rx_q->dma_erx, rx_q->dma_rx_phy);
|
||||||
|
|
||||||
@@ -1952,7 +1952,7 @@ static void free_dma_rx_desc_resources(s
|
@@ -1953,7 +1953,7 @@ static void free_dma_rx_desc_resources(s
|
||||||
*/
|
*/
|
||||||
static void __free_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
static void __free_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -460,7 +460,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
size_t size;
|
size_t size;
|
||||||
void *addr;
|
void *addr;
|
||||||
|
|
||||||
@@ -1970,7 +1970,7 @@ static void __free_dma_tx_desc_resources
|
@@ -1971,7 +1971,7 @@ static void __free_dma_tx_desc_resources
|
||||||
addr = tx_q->dma_tx;
|
addr = tx_q->dma_tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,7 +469,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
|
dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
|
||||||
|
|
||||||
@@ -1999,7 +1999,7 @@ static void free_dma_tx_desc_resources(s
|
@@ -2000,7 +2000,7 @@ static void free_dma_tx_desc_resources(s
|
||||||
*/
|
*/
|
||||||
static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -478,7 +478,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_channel *ch = &priv->channel[queue];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
bool xdp_prog = stmmac_xdp_is_enabled(priv);
|
bool xdp_prog = stmmac_xdp_is_enabled(priv);
|
||||||
struct page_pool_params pp_params = { 0 };
|
struct page_pool_params pp_params = { 0 };
|
||||||
@@ -2011,8 +2011,8 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2012,8 +2012,8 @@ static int __alloc_dma_rx_desc_resources
|
||||||
rx_q->priv_data = priv;
|
rx_q->priv_data = priv;
|
||||||
|
|
||||||
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
|
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
|
||||||
@ -489,7 +489,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
pp_params.order = ilog2(num_pages);
|
pp_params.order = ilog2(num_pages);
|
||||||
pp_params.nid = dev_to_node(priv->device);
|
pp_params.nid = dev_to_node(priv->device);
|
||||||
pp_params.dev = priv->device;
|
pp_params.dev = priv->device;
|
||||||
@@ -2027,7 +2027,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2028,7 +2028,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,7 +498,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(*rx_q->buf_pool),
|
sizeof(*rx_q->buf_pool),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!rx_q->buf_pool)
|
if (!rx_q->buf_pool)
|
||||||
@@ -2035,7 +2035,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2036,7 +2036,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
|
|
||||||
if (priv->extend_desc) {
|
if (priv->extend_desc) {
|
||||||
rx_q->dma_erx = dma_alloc_coherent(priv->device,
|
rx_q->dma_erx = dma_alloc_coherent(priv->device,
|
||||||
@ -507,7 +507,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(struct dma_extended_desc),
|
sizeof(struct dma_extended_desc),
|
||||||
&rx_q->dma_rx_phy,
|
&rx_q->dma_rx_phy,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
@@ -2044,7 +2044,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2045,7 +2045,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
rx_q->dma_rx = dma_alloc_coherent(priv->device,
|
rx_q->dma_rx = dma_alloc_coherent(priv->device,
|
||||||
@ -516,7 +516,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(struct dma_desc),
|
sizeof(struct dma_desc),
|
||||||
&rx_q->dma_rx_phy,
|
&rx_q->dma_rx_phy,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
@@ -2101,20 +2101,20 @@ err_dma:
|
@@ -2102,20 +2102,20 @@ err_dma:
|
||||||
*/
|
*/
|
||||||
static int __alloc_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
static int __alloc_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -540,7 +540,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(struct sk_buff *),
|
sizeof(struct sk_buff *),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!tx_q->tx_skbuff)
|
if (!tx_q->tx_skbuff)
|
||||||
@@ -2127,7 +2127,7 @@ static int __alloc_dma_tx_desc_resources
|
@@ -2128,7 +2128,7 @@ static int __alloc_dma_tx_desc_resources
|
||||||
else
|
else
|
||||||
size = sizeof(struct dma_desc);
|
size = sizeof(struct dma_desc);
|
||||||
|
|
||||||
@ -549,7 +549,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
addr = dma_alloc_coherent(priv->device, size,
|
addr = dma_alloc_coherent(priv->device, size,
|
||||||
&tx_q->dma_tx_phy, GFP_KERNEL);
|
&tx_q->dma_tx_phy, GFP_KERNEL);
|
||||||
@@ -2371,7 +2371,7 @@ static void stmmac_dma_operation_mode(st
|
@@ -2372,7 +2372,7 @@ static void stmmac_dma_operation_mode(st
|
||||||
|
|
||||||
/* configure all channels */
|
/* configure all channels */
|
||||||
for (chan = 0; chan < rx_channels_count; chan++) {
|
for (chan = 0; chan < rx_channels_count; chan++) {
|
||||||
@ -558,7 +558,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
u32 buf_size;
|
u32 buf_size;
|
||||||
|
|
||||||
qmode = priv->plat->rx_queues_cfg[chan].mode_to_use;
|
qmode = priv->plat->rx_queues_cfg[chan].mode_to_use;
|
||||||
@@ -2386,7 +2386,7 @@ static void stmmac_dma_operation_mode(st
|
@@ -2387,7 +2387,7 @@ static void stmmac_dma_operation_mode(st
|
||||||
chan);
|
chan);
|
||||||
} else {
|
} else {
|
||||||
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
||||||
@ -567,7 +567,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
chan);
|
chan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2402,7 +2402,7 @@ static void stmmac_dma_operation_mode(st
|
@@ -2403,7 +2403,7 @@ static void stmmac_dma_operation_mode(st
|
||||||
static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
|
static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
|
||||||
{
|
{
|
||||||
struct netdev_queue *nq = netdev_get_tx_queue(priv->dev, queue);
|
struct netdev_queue *nq = netdev_get_tx_queue(priv->dev, queue);
|
||||||
@ -576,7 +576,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct xsk_buff_pool *pool = tx_q->xsk_pool;
|
struct xsk_buff_pool *pool = tx_q->xsk_pool;
|
||||||
unsigned int entry = tx_q->cur_tx;
|
unsigned int entry = tx_q->cur_tx;
|
||||||
struct dma_desc *tx_desc = NULL;
|
struct dma_desc *tx_desc = NULL;
|
||||||
@@ -2477,7 +2477,7 @@ static bool stmmac_xdp_xmit_zc(struct st
|
@@ -2478,7 +2478,7 @@ static bool stmmac_xdp_xmit_zc(struct st
|
||||||
|
|
||||||
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
entry = tx_q->cur_tx;
|
entry = tx_q->cur_tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2503,7 +2503,7 @@ static bool stmmac_xdp_xmit_zc(struct st
|
@@ -2504,7 +2504,7 @@ static bool stmmac_xdp_xmit_zc(struct st
|
||||||
*/
|
*/
|
||||||
static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)
|
static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)
|
||||||
{
|
{
|
||||||
@ -594,7 +594,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
unsigned int bytes_compl = 0, pkts_compl = 0;
|
unsigned int bytes_compl = 0, pkts_compl = 0;
|
||||||
unsigned int entry, xmits = 0, count = 0;
|
unsigned int entry, xmits = 0, count = 0;
|
||||||
|
|
||||||
@@ -2516,7 +2516,7 @@ static int stmmac_tx_clean(struct stmmac
|
@@ -2517,7 +2517,7 @@ static int stmmac_tx_clean(struct stmmac
|
||||||
entry = tx_q->dirty_tx;
|
entry = tx_q->dirty_tx;
|
||||||
|
|
||||||
/* Try to clean all TX complete frame in 1 shot */
|
/* Try to clean all TX complete frame in 1 shot */
|
||||||
@ -603,7 +603,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct xdp_frame *xdpf;
|
struct xdp_frame *xdpf;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
@@ -2616,7 +2616,7 @@ static int stmmac_tx_clean(struct stmmac
|
@@ -2617,7 +2617,7 @@ static int stmmac_tx_clean(struct stmmac
|
||||||
|
|
||||||
stmmac_release_tx_desc(priv, p, priv->mode);
|
stmmac_release_tx_desc(priv, p, priv->mode);
|
||||||
|
|
||||||
@ -612,7 +612,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
tx_q->dirty_tx = entry;
|
tx_q->dirty_tx = entry;
|
||||||
|
|
||||||
@@ -2681,7 +2681,7 @@ static int stmmac_tx_clean(struct stmmac
|
@@ -2682,7 +2682,7 @@ static int stmmac_tx_clean(struct stmmac
|
||||||
*/
|
*/
|
||||||
static void stmmac_tx_err(struct stmmac_priv *priv, u32 chan)
|
static void stmmac_tx_err(struct stmmac_priv *priv, u32 chan)
|
||||||
{
|
{
|
||||||
@ -621,7 +621,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
|
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
|
||||||
|
|
||||||
@@ -2748,8 +2748,8 @@ static int stmmac_napi_check(struct stmm
|
@@ -2749,8 +2749,8 @@ static int stmmac_napi_check(struct stmm
|
||||||
{
|
{
|
||||||
int status = stmmac_dma_interrupt_status(priv, priv->ioaddr,
|
int status = stmmac_dma_interrupt_status(priv, priv->ioaddr,
|
||||||
&priv->xstats, chan, dir);
|
&priv->xstats, chan, dir);
|
||||||
@ -632,7 +632,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_channel *ch = &priv->channel[chan];
|
struct stmmac_channel *ch = &priv->channel[chan];
|
||||||
struct napi_struct *rx_napi;
|
struct napi_struct *rx_napi;
|
||||||
struct napi_struct *tx_napi;
|
struct napi_struct *tx_napi;
|
||||||
@@ -2925,7 +2925,7 @@ static int stmmac_init_dma_engine(struct
|
@@ -2926,7 +2926,7 @@ static int stmmac_init_dma_engine(struct
|
||||||
|
|
||||||
/* DMA RX Channel Configuration */
|
/* DMA RX Channel Configuration */
|
||||||
for (chan = 0; chan < rx_channels_count; chan++) {
|
for (chan = 0; chan < rx_channels_count; chan++) {
|
||||||
@ -641,7 +641,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
rx_q->dma_rx_phy, chan);
|
rx_q->dma_rx_phy, chan);
|
||||||
@@ -2939,7 +2939,7 @@ static int stmmac_init_dma_engine(struct
|
@@ -2940,7 +2940,7 @@ static int stmmac_init_dma_engine(struct
|
||||||
|
|
||||||
/* DMA TX Channel Configuration */
|
/* DMA TX Channel Configuration */
|
||||||
for (chan = 0; chan < tx_channels_count; chan++) {
|
for (chan = 0; chan < tx_channels_count; chan++) {
|
||||||
@ -650,7 +650,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, chan);
|
tx_q->dma_tx_phy, chan);
|
||||||
@@ -2954,7 +2954,7 @@ static int stmmac_init_dma_engine(struct
|
@@ -2955,7 +2955,7 @@ static int stmmac_init_dma_engine(struct
|
||||||
|
|
||||||
static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
|
static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -659,7 +659,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
hrtimer_start(&tx_q->txtimer,
|
hrtimer_start(&tx_q->txtimer,
|
||||||
STMMAC_COAL_TIMER(priv->tx_coal_timer[queue]),
|
STMMAC_COAL_TIMER(priv->tx_coal_timer[queue]),
|
||||||
@@ -3004,7 +3004,7 @@ static void stmmac_init_coalesce(struct
|
@@ -3005,7 +3005,7 @@ static void stmmac_init_coalesce(struct
|
||||||
u32 chan;
|
u32 chan;
|
||||||
|
|
||||||
for (chan = 0; chan < tx_channel_count; chan++) {
|
for (chan = 0; chan < tx_channel_count; chan++) {
|
||||||
@ -668,7 +668,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
priv->tx_coal_frames[chan] = STMMAC_TX_FRAMES;
|
priv->tx_coal_frames[chan] = STMMAC_TX_FRAMES;
|
||||||
priv->tx_coal_timer[chan] = STMMAC_COAL_TX_TIMER;
|
priv->tx_coal_timer[chan] = STMMAC_COAL_TX_TIMER;
|
||||||
@@ -3026,12 +3026,12 @@ static void stmmac_set_rings_length(stru
|
@@ -3027,12 +3027,12 @@ static void stmmac_set_rings_length(stru
|
||||||
/* set TX ring length */
|
/* set TX ring length */
|
||||||
for (chan = 0; chan < tx_channels_count; chan++)
|
for (chan = 0; chan < tx_channels_count; chan++)
|
||||||
stmmac_set_tx_ring_len(priv, priv->ioaddr,
|
stmmac_set_tx_ring_len(priv, priv->ioaddr,
|
||||||
@ -683,7 +683,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3366,7 +3366,7 @@ static int stmmac_hw_setup(struct net_de
|
@@ -3367,7 +3367,7 @@ static int stmmac_hw_setup(struct net_de
|
||||||
/* Enable TSO */
|
/* Enable TSO */
|
||||||
if (priv->tso) {
|
if (priv->tso) {
|
||||||
for (chan = 0; chan < tx_cnt; chan++) {
|
for (chan = 0; chan < tx_cnt; chan++) {
|
||||||
@ -692,7 +692,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* TSO and TBS cannot co-exist */
|
/* TSO and TBS cannot co-exist */
|
||||||
if (tx_q->tbs & STMMAC_TBS_AVAIL)
|
if (tx_q->tbs & STMMAC_TBS_AVAIL)
|
||||||
@@ -3388,7 +3388,7 @@ static int stmmac_hw_setup(struct net_de
|
@@ -3389,7 +3389,7 @@ static int stmmac_hw_setup(struct net_de
|
||||||
|
|
||||||
/* TBS */
|
/* TBS */
|
||||||
for (chan = 0; chan < tx_cnt; chan++) {
|
for (chan = 0; chan < tx_cnt; chan++) {
|
||||||
@ -701,7 +701,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
int enable = tx_q->tbs & STMMAC_TBS_AVAIL;
|
int enable = tx_q->tbs & STMMAC_TBS_AVAIL;
|
||||||
|
|
||||||
stmmac_enable_tbs(priv, priv->ioaddr, enable, chan);
|
stmmac_enable_tbs(priv, priv->ioaddr, enable, chan);
|
||||||
@@ -3432,7 +3432,7 @@ static void stmmac_free_irq(struct net_d
|
@@ -3433,7 +3433,7 @@ static void stmmac_free_irq(struct net_d
|
||||||
for (j = irq_idx - 1; j >= 0; j--) {
|
for (j = irq_idx - 1; j >= 0; j--) {
|
||||||
if (priv->tx_irq[j] > 0) {
|
if (priv->tx_irq[j] > 0) {
|
||||||
irq_set_affinity_hint(priv->tx_irq[j], NULL);
|
irq_set_affinity_hint(priv->tx_irq[j], NULL);
|
||||||
@ -710,7 +710,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
irq_idx = priv->plat->rx_queues_to_use;
|
irq_idx = priv->plat->rx_queues_to_use;
|
||||||
@@ -3441,7 +3441,7 @@ static void stmmac_free_irq(struct net_d
|
@@ -3442,7 +3442,7 @@ static void stmmac_free_irq(struct net_d
|
||||||
for (j = irq_idx - 1; j >= 0; j--) {
|
for (j = irq_idx - 1; j >= 0; j--) {
|
||||||
if (priv->rx_irq[j] > 0) {
|
if (priv->rx_irq[j] > 0) {
|
||||||
irq_set_affinity_hint(priv->rx_irq[j], NULL);
|
irq_set_affinity_hint(priv->rx_irq[j], NULL);
|
||||||
@ -719,7 +719,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3574,7 +3574,7 @@ static int stmmac_request_irq_multi_msi(
|
@@ -3575,7 +3575,7 @@ static int stmmac_request_irq_multi_msi(
|
||||||
sprintf(int_name, "%s:%s-%d", dev->name, "rx", i);
|
sprintf(int_name, "%s:%s-%d", dev->name, "rx", i);
|
||||||
ret = request_irq(priv->rx_irq[i],
|
ret = request_irq(priv->rx_irq[i],
|
||||||
stmmac_msi_intr_rx,
|
stmmac_msi_intr_rx,
|
||||||
@ -728,7 +728,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (unlikely(ret < 0)) {
|
if (unlikely(ret < 0)) {
|
||||||
netdev_err(priv->dev,
|
netdev_err(priv->dev,
|
||||||
"%s: alloc rx-%d MSI %d (error: %d)\n",
|
"%s: alloc rx-%d MSI %d (error: %d)\n",
|
||||||
@@ -3597,7 +3597,7 @@ static int stmmac_request_irq_multi_msi(
|
@@ -3598,7 +3598,7 @@ static int stmmac_request_irq_multi_msi(
|
||||||
sprintf(int_name, "%s:%s-%d", dev->name, "tx", i);
|
sprintf(int_name, "%s:%s-%d", dev->name, "tx", i);
|
||||||
ret = request_irq(priv->tx_irq[i],
|
ret = request_irq(priv->tx_irq[i],
|
||||||
stmmac_msi_intr_tx,
|
stmmac_msi_intr_tx,
|
||||||
@ -737,7 +737,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (unlikely(ret < 0)) {
|
if (unlikely(ret < 0)) {
|
||||||
netdev_err(priv->dev,
|
netdev_err(priv->dev,
|
||||||
"%s: alloc tx-%d MSI %d (error: %d)\n",
|
"%s: alloc tx-%d MSI %d (error: %d)\n",
|
||||||
@@ -3728,21 +3728,21 @@ static int stmmac_open(struct net_device
|
@@ -3729,21 +3729,21 @@ static int stmmac_open(struct net_device
|
||||||
bfsize = 0;
|
bfsize = 0;
|
||||||
|
|
||||||
if (bfsize < BUF_SIZE_16KiB)
|
if (bfsize < BUF_SIZE_16KiB)
|
||||||
@ -766,7 +766,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
int tbs_en = priv->plat->tx_queues_cfg[chan].tbs_en;
|
int tbs_en = priv->plat->tx_queues_cfg[chan].tbs_en;
|
||||||
|
|
||||||
/* Setup per-TXQ tbs flag before TX descriptor alloc */
|
/* Setup per-TXQ tbs flag before TX descriptor alloc */
|
||||||
@@ -3800,7 +3800,7 @@ irq_error:
|
@@ -3801,7 +3801,7 @@ irq_error:
|
||||||
phylink_stop(priv->phylink);
|
phylink_stop(priv->phylink);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
@ -775,7 +775,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_hw_teardown(dev);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
@@ -3842,7 +3842,7 @@ static int stmmac_release(struct net_dev
|
@@ -3843,7 +3843,7 @@ static int stmmac_release(struct net_dev
|
||||||
stmmac_disable_all_queues(priv);
|
stmmac_disable_all_queues(priv);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
@ -784,7 +784,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
netif_tx_disable(dev);
|
netif_tx_disable(dev);
|
||||||
|
|
||||||
@@ -3906,7 +3906,7 @@ static bool stmmac_vlan_insert(struct st
|
@@ -3907,7 +3907,7 @@ static bool stmmac_vlan_insert(struct st
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stmmac_set_tx_owner(priv, p);
|
stmmac_set_tx_owner(priv, p);
|
||||||
@ -793,7 +793,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3924,7 +3924,7 @@ static bool stmmac_vlan_insert(struct st
|
@@ -3925,7 +3925,7 @@ static bool stmmac_vlan_insert(struct st
|
||||||
static void stmmac_tso_allocator(struct stmmac_priv *priv, dma_addr_t des,
|
static void stmmac_tso_allocator(struct stmmac_priv *priv, dma_addr_t des,
|
||||||
int total_len, bool last_segment, u32 queue)
|
int total_len, bool last_segment, u32 queue)
|
||||||
{
|
{
|
||||||
@ -802,7 +802,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct dma_desc *desc;
|
struct dma_desc *desc;
|
||||||
u32 buff_size;
|
u32 buff_size;
|
||||||
int tmp_len;
|
int tmp_len;
|
||||||
@@ -3935,7 +3935,7 @@ static void stmmac_tso_allocator(struct
|
@@ -3936,7 +3936,7 @@ static void stmmac_tso_allocator(struct
|
||||||
dma_addr_t curr_addr;
|
dma_addr_t curr_addr;
|
||||||
|
|
||||||
tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
|
tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
|
||||||
@ -811,7 +811,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
|
WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
|
||||||
|
|
||||||
if (tx_q->tbs & STMMAC_TBS_AVAIL)
|
if (tx_q->tbs & STMMAC_TBS_AVAIL)
|
||||||
@@ -3963,7 +3963,7 @@ static void stmmac_tso_allocator(struct
|
@@ -3964,7 +3964,7 @@ static void stmmac_tso_allocator(struct
|
||||||
|
|
||||||
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue)
|
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue)
|
||||||
{
|
{
|
||||||
@ -820,7 +820,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
int desc_size;
|
int desc_size;
|
||||||
|
|
||||||
if (likely(priv->extend_desc))
|
if (likely(priv->extend_desc))
|
||||||
@@ -4025,7 +4025,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
@@ -4026,7 +4026,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
||||||
dma_addr_t des;
|
dma_addr_t des;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -829,7 +829,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
first_tx = tx_q->cur_tx;
|
first_tx = tx_q->cur_tx;
|
||||||
|
|
||||||
/* Compute header lengths */
|
/* Compute header lengths */
|
||||||
@@ -4065,7 +4065,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
@@ -4066,7 +4066,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
||||||
stmmac_set_mss(priv, mss_desc, mss);
|
stmmac_set_mss(priv, mss_desc, mss);
|
||||||
tx_q->mss = mss;
|
tx_q->mss = mss;
|
||||||
tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
|
tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
|
||||||
@ -838,7 +838,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
|
WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4177,7 +4177,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
@@ -4178,7 +4178,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
|
||||||
* ndo_start_xmit will fill this descriptor the next time it's
|
* ndo_start_xmit will fill this descriptor the next time it's
|
||||||
* called and stmmac_tx_clean may clean up to this descriptor.
|
* called and stmmac_tx_clean may clean up to this descriptor.
|
||||||
*/
|
*/
|
||||||
@ -847,7 +847,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (unlikely(stmmac_tx_avail(priv, queue) <= (MAX_SKB_FRAGS + 1))) {
|
if (unlikely(stmmac_tx_avail(priv, queue) <= (MAX_SKB_FRAGS + 1))) {
|
||||||
netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n",
|
netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n",
|
||||||
@@ -4265,7 +4265,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
@@ -4266,7 +4266,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
||||||
int entry, first_tx;
|
int entry, first_tx;
|
||||||
dma_addr_t des;
|
dma_addr_t des;
|
||||||
|
|
||||||
@ -856,7 +856,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
first_tx = tx_q->cur_tx;
|
first_tx = tx_q->cur_tx;
|
||||||
|
|
||||||
if (priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en)
|
if (priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en)
|
||||||
@@ -4328,7 +4328,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
@@ -4329,7 +4329,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
||||||
int len = skb_frag_size(frag);
|
int len = skb_frag_size(frag);
|
||||||
bool last_segment = (i == (nfrags - 1));
|
bool last_segment = (i == (nfrags - 1));
|
||||||
|
|
||||||
@ -865,7 +865,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
WARN_ON(tx_q->tx_skbuff[entry]);
|
WARN_ON(tx_q->tx_skbuff[entry]);
|
||||||
|
|
||||||
if (likely(priv->extend_desc))
|
if (likely(priv->extend_desc))
|
||||||
@@ -4399,7 +4399,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
@@ -4400,7 +4400,7 @@ static netdev_tx_t stmmac_xmit(struct sk
|
||||||
* ndo_start_xmit will fill this descriptor the next time it's
|
* ndo_start_xmit will fill this descriptor the next time it's
|
||||||
* called and stmmac_tx_clean may clean up to this descriptor.
|
* called and stmmac_tx_clean may clean up to this descriptor.
|
||||||
*/
|
*/
|
||||||
@ -874,7 +874,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
tx_q->cur_tx = entry;
|
tx_q->cur_tx = entry;
|
||||||
|
|
||||||
if (netif_msg_pktdata(priv)) {
|
if (netif_msg_pktdata(priv)) {
|
||||||
@@ -4514,7 +4514,7 @@ static void stmmac_rx_vlan(struct net_de
|
@@ -4515,7 +4515,7 @@ static void stmmac_rx_vlan(struct net_de
|
||||||
*/
|
*/
|
||||||
static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
|
static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -883,7 +883,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
int dirty = stmmac_rx_dirty(priv, queue);
|
int dirty = stmmac_rx_dirty(priv, queue);
|
||||||
unsigned int entry = rx_q->dirty_rx;
|
unsigned int entry = rx_q->dirty_rx;
|
||||||
|
|
||||||
@@ -4564,7 +4564,7 @@ static inline void stmmac_rx_refill(stru
|
@@ -4565,7 +4565,7 @@ static inline void stmmac_rx_refill(stru
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
stmmac_set_rx_owner(priv, p, use_rx_wd);
|
stmmac_set_rx_owner(priv, p, use_rx_wd);
|
||||||
|
|
||||||
@ -892,7 +892,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
rx_q->dirty_rx = entry;
|
rx_q->dirty_rx = entry;
|
||||||
rx_q->rx_tail_addr = rx_q->dma_rx_phy +
|
rx_q->rx_tail_addr = rx_q->dma_rx_phy +
|
||||||
@@ -4592,12 +4592,12 @@ static unsigned int stmmac_rx_buf1_len(s
|
@@ -4593,12 +4593,12 @@ static unsigned int stmmac_rx_buf1_len(s
|
||||||
|
|
||||||
/* First descriptor, not last descriptor and not split header */
|
/* First descriptor, not last descriptor and not split header */
|
||||||
if (status & rx_not_ls)
|
if (status & rx_not_ls)
|
||||||
@ -907,7 +907,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int stmmac_rx_buf2_len(struct stmmac_priv *priv,
|
static unsigned int stmmac_rx_buf2_len(struct stmmac_priv *priv,
|
||||||
@@ -4613,7 +4613,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
@@ -4614,7 +4614,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
||||||
|
|
||||||
/* Not last descriptor */
|
/* Not last descriptor */
|
||||||
if (status & rx_not_ls)
|
if (status & rx_not_ls)
|
||||||
@ -916,7 +916,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
plen = stmmac_get_rx_frame_len(priv, p, coe);
|
plen = stmmac_get_rx_frame_len(priv, p, coe);
|
||||||
|
|
||||||
@@ -4624,7 +4624,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
@@ -4625,7 +4625,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
||||||
static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
|
static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
|
||||||
struct xdp_frame *xdpf, bool dma_map)
|
struct xdp_frame *xdpf, bool dma_map)
|
||||||
{
|
{
|
||||||
@ -925,7 +925,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
unsigned int entry = tx_q->cur_tx;
|
unsigned int entry = tx_q->cur_tx;
|
||||||
struct dma_desc *tx_desc;
|
struct dma_desc *tx_desc;
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
@@ -4687,7 +4687,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
|
@@ -4688,7 +4688,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
|
||||||
|
|
||||||
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
||||||
|
|
||||||
@ -934,7 +934,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
tx_q->cur_tx = entry;
|
tx_q->cur_tx = entry;
|
||||||
|
|
||||||
return STMMAC_XDP_TX;
|
return STMMAC_XDP_TX;
|
||||||
@@ -4861,7 +4861,7 @@ static void stmmac_dispatch_skb_zc(struc
|
@@ -4862,7 +4862,7 @@ static void stmmac_dispatch_skb_zc(struc
|
||||||
|
|
||||||
static bool stmmac_rx_refill_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
|
static bool stmmac_rx_refill_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
|
||||||
{
|
{
|
||||||
@ -943,7 +943,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
unsigned int entry = rx_q->dirty_rx;
|
unsigned int entry = rx_q->dirty_rx;
|
||||||
struct dma_desc *rx_desc = NULL;
|
struct dma_desc *rx_desc = NULL;
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
@@ -4904,7 +4904,7 @@ static bool stmmac_rx_refill_zc(struct s
|
@@ -4905,7 +4905,7 @@ static bool stmmac_rx_refill_zc(struct s
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
stmmac_set_rx_owner(priv, rx_desc, use_rx_wd);
|
stmmac_set_rx_owner(priv, rx_desc, use_rx_wd);
|
||||||
|
|
||||||
@ -952,7 +952,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rx_desc) {
|
if (rx_desc) {
|
||||||
@@ -4919,7 +4919,7 @@ static bool stmmac_rx_refill_zc(struct s
|
@@ -4920,7 +4920,7 @@ static bool stmmac_rx_refill_zc(struct s
|
||||||
|
|
||||||
static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
|
static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
|
||||||
{
|
{
|
||||||
@ -961,7 +961,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
unsigned int count = 0, error = 0, len = 0;
|
unsigned int count = 0, error = 0, len = 0;
|
||||||
int dirty = stmmac_rx_dirty(priv, queue);
|
int dirty = stmmac_rx_dirty(priv, queue);
|
||||||
unsigned int next_entry = rx_q->cur_rx;
|
unsigned int next_entry = rx_q->cur_rx;
|
||||||
@@ -4941,7 +4941,7 @@ static int stmmac_rx_zc(struct stmmac_pr
|
@@ -4942,7 +4942,7 @@ static int stmmac_rx_zc(struct stmmac_pr
|
||||||
desc_size = sizeof(struct dma_desc);
|
desc_size = sizeof(struct dma_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -970,7 +970,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
rx_q->dma_rx_phy, desc_size);
|
rx_q->dma_rx_phy, desc_size);
|
||||||
}
|
}
|
||||||
while (count < limit) {
|
while (count < limit) {
|
||||||
@@ -4988,7 +4988,7 @@ read_again:
|
@@ -4989,7 +4989,7 @@ read_again:
|
||||||
|
|
||||||
/* Prefetch the next RX descriptor */
|
/* Prefetch the next RX descriptor */
|
||||||
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
||||||
@ -979,7 +979,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
next_entry = rx_q->cur_rx;
|
next_entry = rx_q->cur_rx;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -5109,7 +5109,7 @@ read_again:
|
@@ -5110,7 +5110,7 @@ read_again:
|
||||||
*/
|
*/
|
||||||
static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
||||||
{
|
{
|
||||||
@ -988,7 +988,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_channel *ch = &priv->channel[queue];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
unsigned int count = 0, error = 0, len = 0;
|
unsigned int count = 0, error = 0, len = 0;
|
||||||
int status = 0, coe = priv->hw->rx_csum;
|
int status = 0, coe = priv->hw->rx_csum;
|
||||||
@@ -5122,7 +5122,7 @@ static int stmmac_rx(struct stmmac_priv
|
@@ -5123,7 +5123,7 @@ static int stmmac_rx(struct stmmac_priv
|
||||||
int buf_sz;
|
int buf_sz;
|
||||||
|
|
||||||
dma_dir = page_pool_get_dma_dir(rx_q->page_pool);
|
dma_dir = page_pool_get_dma_dir(rx_q->page_pool);
|
||||||
@ -997,7 +997,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (netif_msg_rx_status(priv)) {
|
if (netif_msg_rx_status(priv)) {
|
||||||
void *rx_head;
|
void *rx_head;
|
||||||
@@ -5136,7 +5136,7 @@ static int stmmac_rx(struct stmmac_priv
|
@@ -5137,7 +5137,7 @@ static int stmmac_rx(struct stmmac_priv
|
||||||
desc_size = sizeof(struct dma_desc);
|
desc_size = sizeof(struct dma_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1006,7 +1006,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
rx_q->dma_rx_phy, desc_size);
|
rx_q->dma_rx_phy, desc_size);
|
||||||
}
|
}
|
||||||
while (count < limit) {
|
while (count < limit) {
|
||||||
@@ -5180,7 +5180,7 @@ read_again:
|
@@ -5181,7 +5181,7 @@ read_again:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
||||||
@ -1015,7 +1015,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
next_entry = rx_q->cur_rx;
|
next_entry = rx_q->cur_rx;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -5314,7 +5314,7 @@ read_again:
|
@@ -5315,7 +5315,7 @@ read_again:
|
||||||
buf1_len, dma_dir);
|
buf1_len, dma_dir);
|
||||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||||
buf->page, buf->page_offset, buf1_len,
|
buf->page, buf->page_offset, buf1_len,
|
||||||
@ -1024,7 +1024,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Data payload appended into SKB */
|
/* Data payload appended into SKB */
|
||||||
page_pool_release_page(rx_q->page_pool, buf->page);
|
page_pool_release_page(rx_q->page_pool, buf->page);
|
||||||
@@ -5326,7 +5326,7 @@ read_again:
|
@@ -5327,7 +5327,7 @@ read_again:
|
||||||
buf2_len, dma_dir);
|
buf2_len, dma_dir);
|
||||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||||
buf->sec_page, 0, buf2_len,
|
buf->sec_page, 0, buf2_len,
|
||||||
@ -1033,7 +1033,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Data payload appended into SKB */
|
/* Data payload appended into SKB */
|
||||||
page_pool_release_page(rx_q->page_pool, buf->sec_page);
|
page_pool_release_page(rx_q->page_pool, buf->sec_page);
|
||||||
@@ -5768,11 +5768,13 @@ static irqreturn_t stmmac_safety_interru
|
@@ -5770,11 +5770,13 @@ static irqreturn_t stmmac_safety_interru
|
||||||
static irqreturn_t stmmac_msi_intr_tx(int irq, void *data)
|
static irqreturn_t stmmac_msi_intr_tx(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)data;
|
struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)data;
|
||||||
@ -1048,7 +1048,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (unlikely(!data)) {
|
if (unlikely(!data)) {
|
||||||
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
||||||
@@ -5812,10 +5814,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
|
@@ -5814,10 +5816,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
|
||||||
static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
|
static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)data;
|
struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)data;
|
||||||
@ -1062,7 +1062,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (unlikely(!data)) {
|
if (unlikely(!data)) {
|
||||||
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
||||||
@@ -5846,10 +5850,10 @@ static void stmmac_poll_controller(struc
|
@@ -5848,10 +5852,10 @@ static void stmmac_poll_controller(struc
|
||||||
|
|
||||||
if (priv->plat->multi_msi_en) {
|
if (priv->plat->multi_msi_en) {
|
||||||
for (i = 0; i < priv->plat->rx_queues_to_use; i++)
|
for (i = 0; i < priv->plat->rx_queues_to_use; i++)
|
||||||
@ -1075,7 +1075,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
} else {
|
} else {
|
||||||
disable_irq(dev->irq);
|
disable_irq(dev->irq);
|
||||||
stmmac_interrupt(dev->irq, dev);
|
stmmac_interrupt(dev->irq, dev);
|
||||||
@@ -6030,34 +6034,34 @@ static int stmmac_rings_status_show(stru
|
@@ -6032,34 +6036,34 @@ static int stmmac_rings_status_show(stru
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (queue = 0; queue < rx_count; queue++) {
|
for (queue = 0; queue < rx_count; queue++) {
|
||||||
@ -1116,7 +1116,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6404,7 +6408,7 @@ void stmmac_disable_rx_queue(struct stmm
|
@@ -6406,7 +6410,7 @@ void stmmac_disable_rx_queue(struct stmm
|
||||||
|
|
||||||
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -1125,7 +1125,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_channel *ch = &priv->channel[queue];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u32 buf_size;
|
u32 buf_size;
|
||||||
@@ -6441,7 +6445,7 @@ void stmmac_enable_rx_queue(struct stmma
|
@@ -6443,7 +6447,7 @@ void stmmac_enable_rx_queue(struct stmma
|
||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
} else {
|
} else {
|
||||||
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
||||||
@ -1134,7 +1134,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6467,7 +6471,7 @@ void stmmac_disable_tx_queue(struct stmm
|
@@ -6469,7 +6473,7 @@ void stmmac_disable_tx_queue(struct stmm
|
||||||
|
|
||||||
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -1143,7 +1143,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_channel *ch = &priv->channel[queue];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -6517,7 +6521,7 @@ void stmmac_xdp_release(struct net_devic
|
@@ -6519,7 +6523,7 @@ void stmmac_xdp_release(struct net_devic
|
||||||
stmmac_disable_all_queues(priv);
|
stmmac_disable_all_queues(priv);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
@ -1152,7 +1152,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Free the IRQ lines */
|
/* Free the IRQ lines */
|
||||||
stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0);
|
stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0);
|
||||||
@@ -6576,7 +6580,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6578,7 +6582,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
|
|
||||||
/* DMA RX Channel Configuration */
|
/* DMA RX Channel Configuration */
|
||||||
for (chan = 0; chan < rx_cnt; chan++) {
|
for (chan = 0; chan < rx_cnt; chan++) {
|
||||||
@ -1161,7 +1161,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
rx_q->dma_rx_phy, chan);
|
rx_q->dma_rx_phy, chan);
|
||||||
@@ -6594,7 +6598,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6596,7 +6600,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
} else {
|
} else {
|
||||||
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
||||||
@ -1170,7 +1170,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6603,7 +6607,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6605,7 +6609,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
|
|
||||||
/* DMA TX Channel Configuration */
|
/* DMA TX Channel Configuration */
|
||||||
for (chan = 0; chan < tx_cnt; chan++) {
|
for (chan = 0; chan < tx_cnt; chan++) {
|
||||||
@ -1179,7 +1179,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, chan);
|
tx_q->dma_tx_phy, chan);
|
||||||
@@ -6636,7 +6640,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6638,7 +6642,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
|
|
||||||
irq_error:
|
irq_error:
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
@ -1188,7 +1188,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_hw_teardown(dev);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
@@ -6663,8 +6667,8 @@ int stmmac_xsk_wakeup(struct net_device
|
@@ -6665,8 +6669,8 @@ int stmmac_xsk_wakeup(struct net_device
|
||||||
queue >= priv->plat->tx_queues_to_use)
|
queue >= priv->plat->tx_queues_to_use)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -1199,7 +1199,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
ch = &priv->channel[queue];
|
ch = &priv->channel[queue];
|
||||||
|
|
||||||
if (!rx_q->xsk_pool && !tx_q->xsk_pool)
|
if (!rx_q->xsk_pool && !tx_q->xsk_pool)
|
||||||
@@ -6924,8 +6928,8 @@ int stmmac_reinit_ringparam(struct net_d
|
@@ -6926,8 +6930,8 @@ int stmmac_reinit_ringparam(struct net_d
|
||||||
if (netif_running(dev))
|
if (netif_running(dev))
|
||||||
stmmac_release(dev);
|
stmmac_release(dev);
|
||||||
|
|
||||||
@ -1210,7 +1210,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (netif_running(dev))
|
if (netif_running(dev))
|
||||||
ret = stmmac_open(dev);
|
ret = stmmac_open(dev);
|
||||||
@@ -7357,7 +7361,7 @@ int stmmac_suspend(struct device *dev)
|
@@ -7362,7 +7366,7 @@ int stmmac_suspend(struct device *dev)
|
||||||
stmmac_disable_all_queues(priv);
|
stmmac_disable_all_queues(priv);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
@ -1219,7 +1219,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (priv->eee_enabled) {
|
if (priv->eee_enabled) {
|
||||||
priv->tx_path_in_lpi_mode = false;
|
priv->tx_path_in_lpi_mode = false;
|
||||||
@@ -7408,7 +7412,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
|
@@ -7414,7 +7418,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
|
||||||
|
|
||||||
static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue)
|
static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -1228,7 +1228,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
rx_q->cur_rx = 0;
|
rx_q->cur_rx = 0;
|
||||||
rx_q->dirty_rx = 0;
|
rx_q->dirty_rx = 0;
|
||||||
@@ -7416,7 +7420,7 @@ static void stmmac_reset_rx_queue(struct
|
@@ -7422,7 +7426,7 @@ static void stmmac_reset_rx_queue(struct
|
||||||
|
|
||||||
static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue)
|
static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -1270,7 +1270,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (i >= priv->plat->tx_queues_to_use)
|
if (i >= priv->plat->tx_queues_to_use)
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
|
||||||
@@ -970,13 +970,13 @@ static int tc_setup_etf(struct stmmac_pr
|
@@ -971,13 +971,13 @@ static int tc_setup_etf(struct stmmac_pr
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
if (qopt->queue >= priv->plat->tx_queues_to_use)
|
if (qopt->queue >= priv->plat->tx_queues_to_use)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -1300,7 +1300,8 @@ static int stmmac_phy_setup(struct stmma
|
@@ -1301,7 +1301,8 @@ static int stmmac_phy_setup(struct stmma
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
{
|
{
|
||||||
u32 rx_cnt = priv->plat->rx_queues_to_use;
|
u32 rx_cnt = priv->plat->rx_queues_to_use;
|
||||||
unsigned int desc_size;
|
unsigned int desc_size;
|
||||||
@@ -1309,7 +1310,7 @@ static void stmmac_display_rx_rings(stru
|
@@ -1310,7 +1311,7 @@ static void stmmac_display_rx_rings(stru
|
||||||
|
|
||||||
/* Display RX rings */
|
/* Display RX rings */
|
||||||
for (queue = 0; queue < rx_cnt; queue++) {
|
for (queue = 0; queue < rx_cnt; queue++) {
|
||||||
@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
pr_info("\tRX Queue %u rings\n", queue);
|
pr_info("\tRX Queue %u rings\n", queue);
|
||||||
|
|
||||||
@@ -1322,12 +1323,13 @@ static void stmmac_display_rx_rings(stru
|
@@ -1323,12 +1324,13 @@ static void stmmac_display_rx_rings(stru
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display RX ring */
|
/* Display RX ring */
|
||||||
@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
{
|
{
|
||||||
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
||||||
unsigned int desc_size;
|
unsigned int desc_size;
|
||||||
@@ -1336,7 +1338,7 @@ static void stmmac_display_tx_rings(stru
|
@@ -1337,7 +1339,7 @@ static void stmmac_display_tx_rings(stru
|
||||||
|
|
||||||
/* Display TX rings */
|
/* Display TX rings */
|
||||||
for (queue = 0; queue < tx_cnt; queue++) {
|
for (queue = 0; queue < tx_cnt; queue++) {
|
||||||
@ -61,7 +61,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
pr_info("\tTX Queue %d rings\n", queue);
|
pr_info("\tTX Queue %d rings\n", queue);
|
||||||
|
|
||||||
@@ -1351,18 +1353,19 @@ static void stmmac_display_tx_rings(stru
|
@@ -1352,18 +1354,19 @@ static void stmmac_display_tx_rings(stru
|
||||||
desc_size = sizeof(struct dma_desc);
|
desc_size = sizeof(struct dma_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int stmmac_set_bfsize(int mtu, int bufsize)
|
static int stmmac_set_bfsize(int mtu, int bufsize)
|
||||||
@@ -1386,44 +1389,50 @@ static int stmmac_set_bfsize(int mtu, in
|
@@ -1387,44 +1390,50 @@ static int stmmac_set_bfsize(int mtu, in
|
||||||
/**
|
/**
|
||||||
* stmmac_clear_rx_descriptors - clear RX descriptors
|
* stmmac_clear_rx_descriptors - clear RX descriptors
|
||||||
* @priv: driver private structure
|
* @priv: driver private structure
|
||||||
@ -147,7 +147,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1440,10 +1449,12 @@ static void stmmac_clear_tx_descriptors(
|
@@ -1441,10 +1450,12 @@ static void stmmac_clear_tx_descriptors(
|
||||||
/**
|
/**
|
||||||
* stmmac_clear_descriptors - clear descriptors
|
* stmmac_clear_descriptors - clear descriptors
|
||||||
* @priv: driver private structure
|
* @priv: driver private structure
|
||||||
@ -161,7 +161,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
{
|
{
|
||||||
u32 rx_queue_cnt = priv->plat->rx_queues_to_use;
|
u32 rx_queue_cnt = priv->plat->rx_queues_to_use;
|
||||||
u32 tx_queue_cnt = priv->plat->tx_queues_to_use;
|
u32 tx_queue_cnt = priv->plat->tx_queues_to_use;
|
||||||
@@ -1451,16 +1462,17 @@ static void stmmac_clear_descriptors(str
|
@@ -1452,16 +1463,17 @@ static void stmmac_clear_descriptors(str
|
||||||
|
|
||||||
/* Clear the RX descriptors */
|
/* Clear the RX descriptors */
|
||||||
for (queue = 0; queue < rx_queue_cnt; queue++)
|
for (queue = 0; queue < rx_queue_cnt; queue++)
|
||||||
@ -181,7 +181,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
* @p: descriptor pointer
|
* @p: descriptor pointer
|
||||||
* @i: descriptor index
|
* @i: descriptor index
|
||||||
* @flags: gfp flag
|
* @flags: gfp flag
|
||||||
@@ -1468,10 +1480,12 @@ static void stmmac_clear_descriptors(str
|
@@ -1469,10 +1481,12 @@ static void stmmac_clear_descriptors(str
|
||||||
* Description: this function is called to allocate a receive buffer, perform
|
* Description: this function is called to allocate a receive buffer, perform
|
||||||
* the DMA mapping and init the descriptor.
|
* the DMA mapping and init the descriptor.
|
||||||
*/
|
*/
|
||||||
@ -196,7 +196,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (!buf->page) {
|
if (!buf->page) {
|
||||||
@@ -1496,7 +1510,7 @@ static int stmmac_init_rx_buffers(struct
|
@@ -1497,7 +1511,7 @@ static int stmmac_init_rx_buffers(struct
|
||||||
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
|
buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
|
||||||
|
|
||||||
stmmac_set_desc_addr(priv, p, buf->addr);
|
stmmac_set_desc_addr(priv, p, buf->addr);
|
||||||
@ -205,7 +205,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
stmmac_init_desc3(priv, p);
|
stmmac_init_desc3(priv, p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1505,12 +1519,13 @@ static int stmmac_init_rx_buffers(struct
|
@@ -1506,12 +1520,13 @@ static int stmmac_init_rx_buffers(struct
|
||||||
/**
|
/**
|
||||||
* stmmac_free_rx_buffer - free RX dma buffers
|
* stmmac_free_rx_buffer - free RX dma buffers
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
@ -222,7 +222,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (buf->page)
|
if (buf->page)
|
||||||
@@ -1525,12 +1540,15 @@ static void stmmac_free_rx_buffer(struct
|
@@ -1526,12 +1541,15 @@ static void stmmac_free_rx_buffer(struct
|
||||||
/**
|
/**
|
||||||
* stmmac_free_tx_buffer - free RX dma buffers
|
* stmmac_free_tx_buffer - free RX dma buffers
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (tx_q->tx_skbuff_dma[i].buf &&
|
if (tx_q->tx_skbuff_dma[i].buf &&
|
||||||
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
|
tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
|
||||||
@@ -1569,23 +1587,28 @@ static void stmmac_free_tx_buffer(struct
|
@@ -1570,23 +1588,28 @@ static void stmmac_free_tx_buffer(struct
|
||||||
/**
|
/**
|
||||||
* dma_free_rx_skbufs - free RX dma buffers
|
* dma_free_rx_skbufs - free RX dma buffers
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
@ -276,7 +276,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -1594,7 +1617,7 @@ static int stmmac_alloc_rx_buffers(struc
|
@@ -1595,7 +1618,7 @@ static int stmmac_alloc_rx_buffers(struc
|
||||||
else
|
else
|
||||||
p = rx_q->dma_rx + i;
|
p = rx_q->dma_rx + i;
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
queue);
|
queue);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1608,14 +1631,17 @@ static int stmmac_alloc_rx_buffers(struc
|
@@ -1609,14 +1632,17 @@ static int stmmac_alloc_rx_buffers(struc
|
||||||
/**
|
/**
|
||||||
* dma_free_rx_xskbufs - free RX dma buffers from XSK pool
|
* dma_free_rx_xskbufs - free RX dma buffers from XSK pool
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
@ -306,7 +306,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
|
||||||
|
|
||||||
if (!buf->xdp)
|
if (!buf->xdp)
|
||||||
@@ -1626,12 +1652,14 @@ static void dma_free_rx_xskbufs(struct s
|
@@ -1627,12 +1653,14 @@ static void dma_free_rx_xskbufs(struct s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_rx_buffer *buf;
|
struct stmmac_rx_buffer *buf;
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
@@ -1666,22 +1694,25 @@ static struct xsk_buff_pool *stmmac_get_
|
@@ -1667,22 +1695,25 @@ static struct xsk_buff_pool *stmmac_get_
|
||||||
/**
|
/**
|
||||||
* __init_dma_rx_desc_rings - init the RX descriptor ring (per queue)
|
* __init_dma_rx_desc_rings - init the RX descriptor ring (per queue)
|
||||||
* @priv: driver private structure
|
* @priv: driver private structure
|
||||||
@ -353,7 +353,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
xdp_rxq_info_unreg_mem_model(&rx_q->xdp_rxq);
|
xdp_rxq_info_unreg_mem_model(&rx_q->xdp_rxq);
|
||||||
|
|
||||||
@@ -1708,9 +1739,9 @@ static int __init_dma_rx_desc_rings(stru
|
@@ -1709,9 +1740,9 @@ static int __init_dma_rx_desc_rings(stru
|
||||||
/* RX XDP ZC buffer pool may not be populated, e.g.
|
/* RX XDP ZC buffer pool may not be populated, e.g.
|
||||||
* xdpsock TX-only.
|
* xdpsock TX-only.
|
||||||
*/
|
*/
|
||||||
@ -365,7 +365,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@@ -1720,17 +1751,19 @@ static int __init_dma_rx_desc_rings(stru
|
@@ -1721,17 +1752,19 @@ static int __init_dma_rx_desc_rings(stru
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
stmmac_mode_init(priv, rx_q->dma_erx,
|
stmmac_mode_init(priv, rx_q->dma_erx,
|
||||||
rx_q->dma_rx_phy,
|
rx_q->dma_rx_phy,
|
||||||
@ -388,7 +388,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
{
|
{
|
||||||
struct stmmac_priv *priv = netdev_priv(dev);
|
struct stmmac_priv *priv = netdev_priv(dev);
|
||||||
u32 rx_count = priv->plat->rx_queues_to_use;
|
u32 rx_count = priv->plat->rx_queues_to_use;
|
||||||
@@ -1742,7 +1775,7 @@ static int init_dma_rx_desc_rings(struct
|
@@ -1743,7 +1776,7 @@ static int init_dma_rx_desc_rings(struct
|
||||||
"SKB addresses:\nskb\t\tskb data\tdma data\n");
|
"SKB addresses:\nskb\t\tskb data\tdma data\n");
|
||||||
|
|
||||||
for (queue = 0; queue < rx_count; queue++) {
|
for (queue = 0; queue < rx_count; queue++) {
|
||||||
@ -397,7 +397,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err_init_rx_buffers;
|
goto err_init_rx_buffers;
|
||||||
}
|
}
|
||||||
@@ -1751,12 +1784,12 @@ static int init_dma_rx_desc_rings(struct
|
@@ -1752,12 +1785,12 @@ static int init_dma_rx_desc_rings(struct
|
||||||
|
|
||||||
err_init_rx_buffers:
|
err_init_rx_buffers:
|
||||||
while (queue >= 0) {
|
while (queue >= 0) {
|
||||||
@ -413,7 +413,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
rx_q->buf_alloc_num = 0;
|
rx_q->buf_alloc_num = 0;
|
||||||
rx_q->xsk_pool = NULL;
|
rx_q->xsk_pool = NULL;
|
||||||
@@ -1773,14 +1806,17 @@ err_init_rx_buffers:
|
@@ -1774,14 +1807,17 @@ err_init_rx_buffers:
|
||||||
/**
|
/**
|
||||||
* __init_dma_tx_desc_rings - init the TX descriptor ring (per queue)
|
* __init_dma_tx_desc_rings - init the TX descriptor ring (per queue)
|
||||||
* @priv: driver private structure
|
* @priv: driver private structure
|
||||||
@ -434,7 +434,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
netif_dbg(priv, probe, priv->dev,
|
netif_dbg(priv, probe, priv->dev,
|
||||||
@@ -1792,16 +1828,16 @@ static int __init_dma_tx_desc_rings(stru
|
@@ -1793,16 +1829,16 @@ static int __init_dma_tx_desc_rings(stru
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
stmmac_mode_init(priv, tx_q->dma_etx,
|
stmmac_mode_init(priv, tx_q->dma_etx,
|
||||||
tx_q->dma_tx_phy,
|
tx_q->dma_tx_phy,
|
||||||
@ -454,7 +454,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct dma_desc *p;
|
struct dma_desc *p;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -1823,7 +1859,8 @@ static int __init_dma_tx_desc_rings(stru
|
@@ -1824,7 +1860,8 @@ static int __init_dma_tx_desc_rings(stru
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
{
|
{
|
||||||
struct stmmac_priv *priv = netdev_priv(dev);
|
struct stmmac_priv *priv = netdev_priv(dev);
|
||||||
u32 tx_queue_cnt;
|
u32 tx_queue_cnt;
|
||||||
@@ -1832,7 +1869,7 @@ static int init_dma_tx_desc_rings(struct
|
@@ -1833,7 +1870,7 @@ static int init_dma_tx_desc_rings(struct
|
||||||
tx_queue_cnt = priv->plat->tx_queues_to_use;
|
tx_queue_cnt = priv->plat->tx_queues_to_use;
|
||||||
|
|
||||||
for (queue = 0; queue < tx_queue_cnt; queue++)
|
for (queue = 0; queue < tx_queue_cnt; queue++)
|
||||||
@ -473,7 +473,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1840,26 +1877,29 @@ static int init_dma_tx_desc_rings(struct
|
@@ -1841,26 +1878,29 @@ static int init_dma_tx_desc_rings(struct
|
||||||
/**
|
/**
|
||||||
* init_dma_desc_rings - init the RX/TX descriptor rings
|
* init_dma_desc_rings - init the RX/TX descriptor rings
|
||||||
* @dev: net device structure
|
* @dev: net device structure
|
||||||
@ -508,7 +508,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1867,17 +1907,20 @@ static int init_dma_desc_rings(struct ne
|
@@ -1868,17 +1908,20 @@ static int init_dma_desc_rings(struct ne
|
||||||
/**
|
/**
|
||||||
* dma_free_tx_skbufs - free TX dma buffers
|
* dma_free_tx_skbufs - free TX dma buffers
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
@ -533,7 +533,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
|
if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
|
||||||
xsk_tx_completed(tx_q->xsk_pool, tx_q->xsk_frames_done);
|
xsk_tx_completed(tx_q->xsk_pool, tx_q->xsk_frames_done);
|
||||||
@@ -1896,34 +1939,37 @@ static void stmmac_free_tx_skbufs(struct
|
@@ -1897,34 +1940,37 @@ static void stmmac_free_tx_skbufs(struct
|
||||||
u32 queue;
|
u32 queue;
|
||||||
|
|
||||||
for (queue = 0; queue < tx_queue_cnt; queue++)
|
for (queue = 0; queue < tx_queue_cnt; queue++)
|
||||||
@ -578,7 +578,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(struct dma_extended_desc),
|
sizeof(struct dma_extended_desc),
|
||||||
rx_q->dma_erx, rx_q->dma_rx_phy);
|
rx_q->dma_erx, rx_q->dma_rx_phy);
|
||||||
|
|
||||||
@@ -1935,29 +1981,33 @@ static void __free_dma_rx_desc_resources
|
@@ -1936,29 +1982,33 @@ static void __free_dma_rx_desc_resources
|
||||||
page_pool_destroy(rx_q->page_pool);
|
page_pool_destroy(rx_q->page_pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -617,7 +617,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (priv->extend_desc) {
|
if (priv->extend_desc) {
|
||||||
size = sizeof(struct dma_extended_desc);
|
size = sizeof(struct dma_extended_desc);
|
||||||
@@ -1970,7 +2020,7 @@ static void __free_dma_tx_desc_resources
|
@@ -1971,7 +2021,7 @@ static void __free_dma_tx_desc_resources
|
||||||
addr = tx_q->dma_tx;
|
addr = tx_q->dma_tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
|
dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
|
||||||
|
|
||||||
@@ -1978,28 +2028,32 @@ static void __free_dma_tx_desc_resources
|
@@ -1979,28 +2029,32 @@ static void __free_dma_tx_desc_resources
|
||||||
kfree(tx_q->tx_skbuff);
|
kfree(tx_q->tx_skbuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -663,7 +663,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_channel *ch = &priv->channel[queue];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
bool xdp_prog = stmmac_xdp_is_enabled(priv);
|
bool xdp_prog = stmmac_xdp_is_enabled(priv);
|
||||||
struct page_pool_params pp_params = { 0 };
|
struct page_pool_params pp_params = { 0 };
|
||||||
@@ -2011,8 +2065,8 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2012,8 +2066,8 @@ static int __alloc_dma_rx_desc_resources
|
||||||
rx_q->priv_data = priv;
|
rx_q->priv_data = priv;
|
||||||
|
|
||||||
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
|
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
|
||||||
@ -674,7 +674,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
pp_params.order = ilog2(num_pages);
|
pp_params.order = ilog2(num_pages);
|
||||||
pp_params.nid = dev_to_node(priv->device);
|
pp_params.nid = dev_to_node(priv->device);
|
||||||
pp_params.dev = priv->device;
|
pp_params.dev = priv->device;
|
||||||
@@ -2027,7 +2081,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2028,7 +2082,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -683,7 +683,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(*rx_q->buf_pool),
|
sizeof(*rx_q->buf_pool),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!rx_q->buf_pool)
|
if (!rx_q->buf_pool)
|
||||||
@@ -2035,7 +2089,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2036,7 +2090,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
|
|
||||||
if (priv->extend_desc) {
|
if (priv->extend_desc) {
|
||||||
rx_q->dma_erx = dma_alloc_coherent(priv->device,
|
rx_q->dma_erx = dma_alloc_coherent(priv->device,
|
||||||
@ -692,7 +692,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(struct dma_extended_desc),
|
sizeof(struct dma_extended_desc),
|
||||||
&rx_q->dma_rx_phy,
|
&rx_q->dma_rx_phy,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
@@ -2044,7 +2098,7 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2045,7 +2099,7 @@ static int __alloc_dma_rx_desc_resources
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
rx_q->dma_rx = dma_alloc_coherent(priv->device,
|
rx_q->dma_rx = dma_alloc_coherent(priv->device,
|
||||||
@ -701,7 +701,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(struct dma_desc),
|
sizeof(struct dma_desc),
|
||||||
&rx_q->dma_rx_phy,
|
&rx_q->dma_rx_phy,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
@@ -2069,7 +2123,8 @@ static int __alloc_dma_rx_desc_resources
|
@@ -2070,7 +2124,8 @@ static int __alloc_dma_rx_desc_resources
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -711,7 +711,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
{
|
{
|
||||||
u32 rx_count = priv->plat->rx_queues_to_use;
|
u32 rx_count = priv->plat->rx_queues_to_use;
|
||||||
u32 queue;
|
u32 queue;
|
||||||
@@ -2077,7 +2132,7 @@ static int alloc_dma_rx_desc_resources(s
|
@@ -2078,7 +2133,7 @@ static int alloc_dma_rx_desc_resources(s
|
||||||
|
|
||||||
/* RX queues buffers and DMA */
|
/* RX queues buffers and DMA */
|
||||||
for (queue = 0; queue < rx_count; queue++) {
|
for (queue = 0; queue < rx_count; queue++) {
|
||||||
@ -720,7 +720,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err_dma;
|
goto err_dma;
|
||||||
}
|
}
|
||||||
@@ -2085,7 +2140,7 @@ static int alloc_dma_rx_desc_resources(s
|
@@ -2086,7 +2141,7 @@ static int alloc_dma_rx_desc_resources(s
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_dma:
|
err_dma:
|
||||||
@ -729,7 +729,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -2093,28 +2148,31 @@ err_dma:
|
@@ -2094,28 +2149,31 @@ err_dma:
|
||||||
/**
|
/**
|
||||||
* __alloc_dma_tx_desc_resources - alloc TX resources (per queue).
|
* __alloc_dma_tx_desc_resources - alloc TX resources (per queue).
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
@ -765,7 +765,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
sizeof(struct sk_buff *),
|
sizeof(struct sk_buff *),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!tx_q->tx_skbuff)
|
if (!tx_q->tx_skbuff)
|
||||||
@@ -2127,7 +2185,7 @@ static int __alloc_dma_tx_desc_resources
|
@@ -2128,7 +2186,7 @@ static int __alloc_dma_tx_desc_resources
|
||||||
else
|
else
|
||||||
size = sizeof(struct dma_desc);
|
size = sizeof(struct dma_desc);
|
||||||
|
|
||||||
@ -774,7 +774,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
addr = dma_alloc_coherent(priv->device, size,
|
addr = dma_alloc_coherent(priv->device, size,
|
||||||
&tx_q->dma_tx_phy, GFP_KERNEL);
|
&tx_q->dma_tx_phy, GFP_KERNEL);
|
||||||
@@ -2144,7 +2202,8 @@ static int __alloc_dma_tx_desc_resources
|
@@ -2145,7 +2203,8 @@ static int __alloc_dma_tx_desc_resources
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -784,7 +784,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
{
|
{
|
||||||
u32 tx_count = priv->plat->tx_queues_to_use;
|
u32 tx_count = priv->plat->tx_queues_to_use;
|
||||||
u32 queue;
|
u32 queue;
|
||||||
@@ -2152,7 +2211,7 @@ static int alloc_dma_tx_desc_resources(s
|
@@ -2153,7 +2212,7 @@ static int alloc_dma_tx_desc_resources(s
|
||||||
|
|
||||||
/* TX queues buffers and DMA */
|
/* TX queues buffers and DMA */
|
||||||
for (queue = 0; queue < tx_count; queue++) {
|
for (queue = 0; queue < tx_count; queue++) {
|
||||||
@ -793,7 +793,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err_dma;
|
goto err_dma;
|
||||||
}
|
}
|
||||||
@@ -2160,27 +2219,29 @@ static int alloc_dma_tx_desc_resources(s
|
@@ -2161,27 +2220,29 @@ static int alloc_dma_tx_desc_resources(s
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_dma:
|
err_dma:
|
||||||
@ -827,7 +827,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -2188,16 +2249,18 @@ static int alloc_dma_desc_resources(stru
|
@@ -2189,16 +2250,18 @@ static int alloc_dma_desc_resources(stru
|
||||||
/**
|
/**
|
||||||
* free_dma_desc_resources - free dma desc resources
|
* free_dma_desc_resources - free dma desc resources
|
||||||
* @priv: private structure
|
* @priv: private structure
|
||||||
@ -849,7 +849,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2686,8 +2749,8 @@ static void stmmac_tx_err(struct stmmac_
|
@@ -2687,8 +2750,8 @@ static void stmmac_tx_err(struct stmmac_
|
||||||
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
|
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
|
||||||
|
|
||||||
stmmac_stop_tx_dma(priv, chan);
|
stmmac_stop_tx_dma(priv, chan);
|
||||||
@ -860,7 +860,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
stmmac_reset_tx_queue(priv, chan);
|
stmmac_reset_tx_queue(priv, chan);
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, chan);
|
tx_q->dma_tx_phy, chan);
|
||||||
@@ -3684,19 +3747,93 @@ static int stmmac_request_irq(struct net
|
@@ -3685,19 +3748,93 @@ static int stmmac_request_irq(struct net
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -957,7 +957,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
u32 chan;
|
u32 chan;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -3723,45 +3860,10 @@ static int stmmac_open(struct net_device
|
@@ -3724,45 +3861,10 @@ static int stmmac_open(struct net_device
|
||||||
memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats));
|
memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats));
|
||||||
priv->xstats.threshold = tc;
|
priv->xstats.threshold = tc;
|
||||||
|
|
||||||
@ -1005,7 +1005,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (priv->plat->serdes_powerup) {
|
if (priv->plat->serdes_powerup) {
|
||||||
ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
|
ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
|
||||||
@@ -3804,14 +3906,28 @@ irq_error:
|
@@ -3805,14 +3907,28 @@ irq_error:
|
||||||
|
|
||||||
stmmac_hw_teardown(dev);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
@ -1036,7 +1036,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
static void stmmac_fpe_stop_wq(struct stmmac_priv *priv)
|
static void stmmac_fpe_stop_wq(struct stmmac_priv *priv)
|
||||||
{
|
{
|
||||||
set_bit(__FPE_REMOVING, &priv->fpe_task_state);
|
set_bit(__FPE_REMOVING, &priv->fpe_task_state);
|
||||||
@@ -3858,7 +3974,7 @@ static int stmmac_release(struct net_dev
|
@@ -3859,7 +3975,7 @@ static int stmmac_release(struct net_dev
|
||||||
stmmac_stop_all_dma(priv);
|
stmmac_stop_all_dma(priv);
|
||||||
|
|
||||||
/* Release and free the Rx/Tx resources */
|
/* Release and free the Rx/Tx resources */
|
||||||
@ -1045,7 +1045,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Disable the MAC Rx/Tx */
|
/* Disable the MAC Rx/Tx */
|
||||||
stmmac_mac_set(priv, priv->ioaddr, false);
|
stmmac_mac_set(priv, priv->ioaddr, false);
|
||||||
@@ -6403,7 +6519,7 @@ void stmmac_disable_rx_queue(struct stmm
|
@@ -6405,7 +6521,7 @@ void stmmac_disable_rx_queue(struct stmm
|
||||||
spin_unlock_irqrestore(&ch->lock, flags);
|
spin_unlock_irqrestore(&ch->lock, flags);
|
||||||
|
|
||||||
stmmac_stop_rx_dma(priv, queue);
|
stmmac_stop_rx_dma(priv, queue);
|
||||||
@ -1054,7 +1054,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
@@ -6414,21 +6530,21 @@ void stmmac_enable_rx_queue(struct stmma
|
@@ -6416,21 +6532,21 @@ void stmmac_enable_rx_queue(struct stmma
|
||||||
u32 buf_size;
|
u32 buf_size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1080,7 +1080,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
rx_q->dma_rx_phy, rx_q->queue_index);
|
rx_q->dma_rx_phy, rx_q->queue_index);
|
||||||
@@ -6466,7 +6582,7 @@ void stmmac_disable_tx_queue(struct stmm
|
@@ -6468,7 +6584,7 @@ void stmmac_disable_tx_queue(struct stmm
|
||||||
spin_unlock_irqrestore(&ch->lock, flags);
|
spin_unlock_irqrestore(&ch->lock, flags);
|
||||||
|
|
||||||
stmmac_stop_tx_dma(priv, queue);
|
stmmac_stop_tx_dma(priv, queue);
|
||||||
@ -1089,7 +1089,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
@@ -6476,21 +6592,21 @@ void stmmac_enable_tx_queue(struct stmma
|
@@ -6478,21 +6594,21 @@ void stmmac_enable_tx_queue(struct stmma
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1115,7 +1115,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, tx_q->queue_index);
|
tx_q->dma_tx_phy, tx_q->queue_index);
|
||||||
@@ -6530,7 +6646,7 @@ void stmmac_xdp_release(struct net_devic
|
@@ -6532,7 +6648,7 @@ void stmmac_xdp_release(struct net_devic
|
||||||
stmmac_stop_all_dma(priv);
|
stmmac_stop_all_dma(priv);
|
||||||
|
|
||||||
/* Release and free the Rx/Tx resources */
|
/* Release and free the Rx/Tx resources */
|
||||||
@ -1124,7 +1124,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Disable the MAC Rx/Tx */
|
/* Disable the MAC Rx/Tx */
|
||||||
stmmac_mac_set(priv, priv->ioaddr, false);
|
stmmac_mac_set(priv, priv->ioaddr, false);
|
||||||
@@ -6555,14 +6671,14 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6557,14 +6673,14 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
u32 chan;
|
u32 chan;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1141,7 +1141,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
netdev_err(dev, "%s: DMA descriptors initialization failed\n",
|
netdev_err(dev, "%s: DMA descriptors initialization failed\n",
|
||||||
__func__);
|
__func__);
|
||||||
@@ -6644,7 +6760,7 @@ irq_error:
|
@@ -6646,7 +6762,7 @@ irq_error:
|
||||||
|
|
||||||
stmmac_hw_teardown(dev);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
@ -1150,7 +1150,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
dma_desc_error:
|
dma_desc_error:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -7503,7 +7619,7 @@ int stmmac_resume(struct device *dev)
|
@@ -7509,7 +7625,7 @@ int stmmac_resume(struct device *dev)
|
||||||
stmmac_reset_queues_param(priv);
|
stmmac_reset_queues_param(priv);
|
||||||
|
|
||||||
stmmac_free_tx_skbufs(priv);
|
stmmac_free_tx_skbufs(priv);
|
||||||
|
@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -5626,18 +5626,15 @@ static int stmmac_change_mtu(struct net_
|
@@ -5627,18 +5627,15 @@ static int stmmac_change_mtu(struct net_
|
||||||
{
|
{
|
||||||
struct stmmac_priv *priv = netdev_priv(dev);
|
struct stmmac_priv *priv = netdev_priv(dev);
|
||||||
int txfifosz = priv->plat->tx_fifo_size;
|
int txfifosz = priv->plat->tx_fifo_size;
|
||||||
@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (stmmac_xdp_is_enabled(priv) && new_mtu > ETH_DATA_LEN) {
|
if (stmmac_xdp_is_enabled(priv) && new_mtu > ETH_DATA_LEN) {
|
||||||
netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
|
netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -5649,8 +5646,29 @@ static int stmmac_change_mtu(struct net_
|
@@ -5650,8 +5647,29 @@ static int stmmac_change_mtu(struct net_
|
||||||
if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
|
if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
--- a/drivers/net/usb/r8152.c
|
||||||
+++ b/drivers/net/usb/r8152.c
|
+++ b/drivers/net/usb/r8152.c
|
||||||
@@ -9625,6 +9625,9 @@ static int rtl8152_probe(struct usb_inte
|
@@ -9639,6 +9639,9 @@ static int rtl8152_probe(struct usb_inte
|
||||||
if (version == RTL_VER_UNKNOWN)
|
if (version == RTL_VER_UNKNOWN)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
if (!rtl_vendor_mode(intf))
|
if (!rtl_vendor_mode(intf))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -9834,43 +9837,35 @@ static void rtl8152_disconnect(struct us
|
@@ -9848,43 +9851,35 @@ static void rtl8152_disconnect(struct us
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -9890,7 +9885,61 @@ static struct usb_driver rtl8152_driver
|
@@ -9904,7 +9899,61 @@ static struct usb_driver rtl8152_driver
|
||||||
.disable_hub_initiated_lpm = 1,
|
.disable_hub_initiated_lpm = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
--- a/drivers/net/usb/r8152.c
|
||||||
+++ b/drivers/net/usb/r8152.c
|
+++ b/drivers/net/usb/r8152.c
|
||||||
@@ -9531,9 +9531,8 @@ static int rtl_fw_init(struct r8152 *tp)
|
@@ -9545,9 +9545,8 @@ static int rtl_fw_init(struct r8152 *tp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
u32 ocp_data = 0;
|
u32 ocp_data = 0;
|
||||||
__le32 *tmp;
|
__le32 *tmp;
|
||||||
u8 version;
|
u8 version;
|
||||||
@@ -9603,10 +9602,19 @@ u8 rtl8152_get_version(struct usb_interf
|
@@ -9617,10 +9616,19 @@ u8 rtl8152_get_version(struct usb_interf
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
version = RTL_VER_UNKNOWN;
|
version = RTL_VER_UNKNOWN;
|
||||||
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
dev_dbg(&intf->dev, "Detected version 0x%04x\n", version);
|
dev_dbg(&intf->dev, "Detected version 0x%04x\n", version);
|
||||||
|
|
||||||
return version;
|
return version;
|
||||||
@@ -9890,6 +9898,12 @@ static int rtl8152_cfgselector_probe(str
|
@@ -9904,6 +9912,12 @@ static int rtl8152_cfgselector_probe(str
|
||||||
struct usb_host_config *c;
|
struct usb_host_config *c;
|
||||||
int i, num_configs;
|
int i, num_configs;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
--- a/drivers/net/usb/r8152.c
|
||||||
+++ b/drivers/net/usb/r8152.c
|
+++ b/drivers/net/usb/r8152.c
|
||||||
@@ -8267,43 +8267,6 @@ static bool rtl_check_vendor_ok(struct u
|
@@ -8281,43 +8281,6 @@ static bool rtl_check_vendor_ok(struct u
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
static int rtl8152_pre_reset(struct usb_interface *intf)
|
static int rtl8152_pre_reset(struct usb_interface *intf)
|
||||||
{
|
{
|
||||||
struct r8152 *tp = usb_get_intfdata(intf);
|
struct r8152 *tp = usb_get_intfdata(intf);
|
||||||
@@ -9636,7 +9599,7 @@ static int rtl8152_probe(struct usb_inte
|
@@ -9650,7 +9613,7 @@ static int rtl8152_probe(struct usb_inte
|
||||||
if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
|
if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
--- a/drivers/net/usb/r8152.c
|
||||||
+++ b/drivers/net/usb/r8152.c
|
+++ b/drivers/net/usb/r8152.c
|
||||||
@@ -9588,20 +9588,21 @@ static int rtl8152_probe(struct usb_inte
|
@@ -9602,20 +9602,21 @@ static int rtl8152_probe(struct usb_inte
|
||||||
const struct usb_device_id *id)
|
const struct usb_device_id *id)
|
||||||
{
|
{
|
||||||
struct usb_device *udev = interface_to_usbdev(intf);
|
struct usb_device *udev = interface_to_usbdev(intf);
|
||||||
|
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
--- a/drivers/net/usb/r8152.c
|
||||||
+++ b/drivers/net/usb/r8152.c
|
+++ b/drivers/net/usb/r8152.c
|
||||||
@@ -9898,6 +9898,7 @@ static struct usb_device_driver rtl8152_
|
@@ -9912,6 +9912,7 @@ static struct usb_device_driver rtl8152_
|
||||||
.probe = rtl8152_cfgselector_probe,
|
.probe = rtl8152_cfgselector_probe,
|
||||||
.id_table = rtl8152_table,
|
.id_table = rtl8152_table,
|
||||||
.generic_subclass = 1,
|
.generic_subclass = 1,
|
||||||
|
@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
--- a/drivers/net/usb/r8152.c
|
||||||
+++ b/drivers/net/usb/r8152.c
|
+++ b/drivers/net/usb/r8152.c
|
||||||
@@ -3977,29 +3977,10 @@ static void rtl_reset_bmu(struct r8152 *
|
@@ -3983,29 +3983,10 @@ static void rtl_reset_bmu(struct r8152 *
|
||||||
/* Clear the bp to stop the firmware before loading a new one */
|
/* Clear the bp to stop the firmware before loading a new one */
|
||||||
static void rtl_clear_bp(struct r8152 *tp, u16 type)
|
static void rtl_clear_bp(struct r8152 *tp, u16 type)
|
||||||
{
|
{
|
||||||
@ -48,7 +48,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
case RTL_VER_08:
|
case RTL_VER_08:
|
||||||
case RTL_VER_09:
|
case RTL_VER_09:
|
||||||
case RTL_VER_10:
|
case RTL_VER_10:
|
||||||
@@ -4007,32 +3988,31 @@ static void rtl_clear_bp(struct r8152 *t
|
@@ -4013,32 +3994,31 @@ static void rtl_clear_bp(struct r8152 *t
|
||||||
case RTL_VER_12:
|
case RTL_VER_12:
|
||||||
case RTL_VER_13:
|
case RTL_VER_13:
|
||||||
case RTL_VER_15:
|
case RTL_VER_15:
|
||||||
@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* wait 3 ms to make sure the firmware is stopped */
|
/* wait 3 ms to make sure the firmware is stopped */
|
||||||
usleep_range(3000, 6000);
|
usleep_range(3000, 6000);
|
||||||
@@ -5009,10 +4989,9 @@ static void rtl8152_fw_phy_nc_apply(stru
|
@@ -5015,10 +4995,9 @@ static void rtl8152_fw_phy_nc_apply(stru
|
||||||
|
|
||||||
static void rtl8152_fw_mac_apply(struct r8152 *tp, struct fw_mac *mac)
|
static void rtl8152_fw_mac_apply(struct r8152 *tp, struct fw_mac *mac)
|
||||||
{
|
{
|
||||||
@ -112,7 +112,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
switch (__le32_to_cpu(mac->blk_hdr.type)) {
|
switch (__le32_to_cpu(mac->blk_hdr.type)) {
|
||||||
case RTL_FW_PLA:
|
case RTL_FW_PLA:
|
||||||
@@ -5054,12 +5033,8 @@ static void rtl8152_fw_mac_apply(struct
|
@@ -5060,12 +5039,8 @@ static void rtl8152_fw_mac_apply(struct
|
||||||
ocp_write_word(tp, type, __le16_to_cpu(mac->bp_ba_addr),
|
ocp_write_word(tp, type, __le16_to_cpu(mac->bp_ba_addr),
|
||||||
__le16_to_cpu(mac->bp_ba_value));
|
__le16_to_cpu(mac->bp_ba_value));
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
extern u8 rtl8152_get_version(struct usb_interface *intf);
|
extern u8 rtl8152_get_version(struct usb_interface *intf);
|
||||||
--- a/drivers/net/usb/r8152.c
|
--- a/drivers/net/usb/r8152.c
|
||||||
+++ b/drivers/net/usb/r8152.c
|
+++ b/drivers/net/usb/r8152.c
|
||||||
@@ -9820,6 +9820,7 @@ static const struct usb_device_id rtl815
|
@@ -9834,6 +9834,7 @@ static const struct usb_device_id rtl815
|
||||||
{ USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) },
|
{ USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) },
|
||||||
{ USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) },
|
{ USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) },
|
||||||
{ USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) },
|
{ USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) },
|
||||||
|
@ -1,447 +0,0 @@
|
|||||||
From 715f67f33af45ce2cc3a5b1ef133cc8c8e7787b0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Douglas Anderson <dianders@chromium.org>
|
|
||||||
Date: Fri, 20 Oct 2023 14:06:58 -0700
|
|
||||||
Subject: [PATCH] r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE
|
|
||||||
|
|
||||||
Whenever the RTL8152_UNPLUG is set that just tells the driver that all
|
|
||||||
accesses will fail and we should just immediately bail. A future patch
|
|
||||||
will use this same concept at a time when the driver hasn't actually
|
|
||||||
been unplugged but is about to be reset. Rename the flag in
|
|
||||||
preparation for the future patch.
|
|
||||||
|
|
||||||
This is a no-op change and just a search and replace.
|
|
||||||
|
|
||||||
Signed-off-by: Douglas Anderson <dianders@chromium.org>
|
|
||||||
Reviewed-by: Grant Grundler <grundler@chromium.org>
|
|
||||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
||||||
---
|
|
||||||
drivers/net/usb/r8152.c | 96 ++++++++++++++++++++---------------------
|
|
||||||
1 file changed, 48 insertions(+), 48 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
|
||||||
+++ b/drivers/net/usb/r8152.c
|
|
||||||
@@ -763,7 +763,7 @@ enum rtl_register_content {
|
|
||||||
|
|
||||||
/* rtl8152 flags */
|
|
||||||
enum rtl8152_flags {
|
|
||||||
- RTL8152_UNPLUG = 0,
|
|
||||||
+ RTL8152_INACCESSIBLE = 0,
|
|
||||||
RTL8152_SET_RX_MODE,
|
|
||||||
WORK_ENABLE,
|
|
||||||
RTL8152_LINK_CHG,
|
|
||||||
@@ -1241,7 +1241,7 @@ int set_registers(struct r8152 *tp, u16
|
|
||||||
static void rtl_set_unplug(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
if (tp->udev->state == USB_STATE_NOTATTACHED) {
|
|
||||||
- set_bit(RTL8152_UNPLUG, &tp->flags);
|
|
||||||
+ set_bit(RTL8152_INACCESSIBLE, &tp->flags);
|
|
||||||
smp_mb__after_atomic();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1252,7 +1252,7 @@ static int generic_ocp_read(struct r8152
|
|
||||||
u16 limit = 64;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
/* both size and indix must be 4 bytes align */
|
|
||||||
@@ -1296,7 +1296,7 @@ static int generic_ocp_write(struct r815
|
|
||||||
u16 byteen_start, byteen_end, byen;
|
|
||||||
u16 limit = 512;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
/* both size and indix must be 4 bytes align */
|
|
||||||
@@ -1533,7 +1533,7 @@ static int read_mii_word(struct net_devi
|
|
||||||
struct r8152 *tp = netdev_priv(netdev);
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
if (phy_id != R8152_PHY_ID)
|
|
||||||
@@ -1549,7 +1549,7 @@ void write_mii_word(struct net_device *n
|
|
||||||
{
|
|
||||||
struct r8152 *tp = netdev_priv(netdev);
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (phy_id != R8152_PHY_ID)
|
|
||||||
@@ -1754,7 +1754,7 @@ static void read_bulk_callback(struct ur
|
|
||||||
if (!tp)
|
|
||||||
return;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!test_bit(WORK_ENABLE, &tp->flags))
|
|
||||||
@@ -1846,7 +1846,7 @@ static void write_bulk_callback(struct u
|
|
||||||
if (!test_bit(WORK_ENABLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!skb_queue_empty(&tp->tx_queue))
|
|
||||||
@@ -1867,7 +1867,7 @@ static void intr_callback(struct urb *ur
|
|
||||||
if (!test_bit(WORK_ENABLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (status) {
|
|
||||||
@@ -2611,7 +2611,7 @@ static void bottom_half(struct tasklet_s
|
|
||||||
{
|
|
||||||
struct r8152 *tp = from_tasklet(tp, t, tx_tl);
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!test_bit(WORK_ENABLE, &tp->flags))
|
|
||||||
@@ -2654,7 +2654,7 @@ int r8152_submit_rx(struct r8152 *tp, st
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* The rx would be stopped, so skip submitting */
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags) ||
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) ||
|
|
||||||
!test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
@@ -3050,7 +3050,7 @@ static int rtl_enable(struct r8152 *tp)
|
|
||||||
|
|
||||||
static int rtl8152_enable(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
set_tx_qlen(tp);
|
|
||||||
@@ -3137,7 +3137,7 @@ static int rtl8153_enable(struct r8152 *
|
|
||||||
{
|
|
||||||
u32 ocp_data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
set_tx_qlen(tp);
|
|
||||||
@@ -3169,7 +3169,7 @@ static void rtl_disable(struct r8152 *tp
|
|
||||||
u32 ocp_data;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
|
||||||
rtl_drop_queued_tx(tp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
@@ -3623,7 +3623,7 @@ static u16 r8153_phy_status(struct r8152
|
|
||||||
}
|
|
||||||
|
|
||||||
msleep(20);
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -3655,7 +3655,7 @@ static void r8153b_ups_en(struct r8152 *
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 500; i++) {
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) &
|
|
||||||
AUTOLOAD_DONE)
|
|
||||||
@@ -3697,7 +3697,7 @@ static void r8153c_ups_en(struct r8152 *
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 500; i++) {
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) &
|
|
||||||
AUTOLOAD_DONE)
|
|
||||||
@@ -4042,8 +4042,8 @@ static int rtl_phy_patch_request(struct
|
|
||||||
for (i = 0; wait && i < 5000; i++) {
|
|
||||||
u32 ocp_data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
- break;
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
+ return -ENODEV;
|
|
||||||
|
|
||||||
usleep_range(1000, 2000);
|
|
||||||
ocp_data = ocp_reg_read(tp, OCP_PHY_PATCH_STAT);
|
|
||||||
@@ -6001,7 +6001,7 @@ static int rtl8156_enable(struct r8152 *
|
|
||||||
u32 ocp_data;
|
|
||||||
u16 speed;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
r8156_fc_parameter(tp);
|
|
||||||
@@ -6059,7 +6059,7 @@ static int rtl8156b_enable(struct r8152
|
|
||||||
u32 ocp_data;
|
|
||||||
u16 speed;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
set_tx_qlen(tp);
|
|
||||||
@@ -6245,7 +6245,7 @@ out:
|
|
||||||
|
|
||||||
static void rtl8152_up(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8152_aldps_en(tp, false);
|
|
||||||
@@ -6255,7 +6255,7 @@ static void rtl8152_up(struct r8152 *tp)
|
|
||||||
|
|
||||||
static void rtl8152_down(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
|
||||||
rtl_drop_queued_tx(tp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
@@ -6270,7 +6270,7 @@ static void rtl8153_up(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
u32 ocp_data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8153_u1u2en(tp, false);
|
|
||||||
@@ -6310,7 +6310,7 @@ static void rtl8153_down(struct r8152 *t
|
|
||||||
{
|
|
||||||
u32 ocp_data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
|
||||||
rtl_drop_queued_tx(tp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
@@ -6331,7 +6331,7 @@ static void rtl8153b_up(struct r8152 *tp
|
|
||||||
{
|
|
||||||
u32 ocp_data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8153b_u1u2en(tp, false);
|
|
||||||
@@ -6355,7 +6355,7 @@ static void rtl8153b_down(struct r8152 *
|
|
||||||
{
|
|
||||||
u32 ocp_data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
|
||||||
rtl_drop_queued_tx(tp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
@@ -6392,7 +6392,7 @@ static void rtl8153c_up(struct r8152 *tp
|
|
||||||
{
|
|
||||||
u32 ocp_data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8153b_u1u2en(tp, false);
|
|
||||||
@@ -6473,7 +6473,7 @@ static void rtl8156_up(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
u32 ocp_data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8153b_u1u2en(tp, false);
|
|
||||||
@@ -6546,7 +6546,7 @@ static void rtl8156_down(struct r8152 *t
|
|
||||||
{
|
|
||||||
u32 ocp_data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
|
||||||
rtl_drop_queued_tx(tp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
@@ -6684,7 +6684,7 @@ static void rtl_work_func_t(struct work_
|
|
||||||
/* If the device is unplugged or !netif_running(), the workqueue
|
|
||||||
* doesn't need to wake the device, and could return directly.
|
|
||||||
*/
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags) || !netif_running(tp->netdev))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || !netif_running(tp->netdev))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (usb_autopm_get_interface(tp->intf) < 0)
|
|
||||||
@@ -6723,7 +6723,7 @@ static void rtl_hw_phy_work_func_t(struc
|
|
||||||
{
|
|
||||||
struct r8152 *tp = container_of(work, struct r8152, hw_phy_work.work);
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (usb_autopm_get_interface(tp->intf) < 0)
|
|
||||||
@@ -6850,7 +6850,7 @@ static int rtl8152_close(struct net_devi
|
|
||||||
netif_stop_queue(netdev);
|
|
||||||
|
|
||||||
res = usb_autopm_get_interface(tp->intf);
|
|
||||||
- if (res < 0 || test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
|
||||||
+ if (res < 0 || test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
|
||||||
rtl_drop_queued_tx(tp);
|
|
||||||
rtl_stop_rx(tp);
|
|
||||||
} else {
|
|
||||||
@@ -6883,7 +6883,7 @@ static void r8152b_init(struct r8152 *tp
|
|
||||||
u32 ocp_data;
|
|
||||||
u16 data;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
data = r8152_mdio_read(tp, MII_BMCR);
|
|
||||||
@@ -6927,7 +6927,7 @@ static void r8153_init(struct r8152 *tp)
|
|
||||||
u16 data;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8153_u1u2en(tp, false);
|
|
||||||
@@ -6938,7 +6938,7 @@ static void r8153_init(struct r8152 *tp)
|
|
||||||
break;
|
|
||||||
|
|
||||||
msleep(20);
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -7067,7 +7067,7 @@ static void r8153b_init(struct r8152 *tp
|
|
||||||
u16 data;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8153b_u1u2en(tp, false);
|
|
||||||
@@ -7078,7 +7078,7 @@ static void r8153b_init(struct r8152 *tp
|
|
||||||
break;
|
|
||||||
|
|
||||||
msleep(20);
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -7149,7 +7149,7 @@ static void r8153c_init(struct r8152 *tp
|
|
||||||
u16 data;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8153b_u1u2en(tp, false);
|
|
||||||
@@ -7169,7 +7169,7 @@ static void r8153c_init(struct r8152 *tp
|
|
||||||
break;
|
|
||||||
|
|
||||||
msleep(20);
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -7998,7 +7998,7 @@ static void r8156_init(struct r8152 *tp)
|
|
||||||
u16 data;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP);
|
|
||||||
@@ -8019,7 +8019,7 @@ static void r8156_init(struct r8152 *tp)
|
|
||||||
break;
|
|
||||||
|
|
||||||
msleep(20);
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -8094,7 +8094,7 @@ static void r8156b_init(struct r8152 *tp
|
|
||||||
u16 data;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP);
|
|
||||||
@@ -8128,7 +8128,7 @@ static void r8156b_init(struct r8152 *tp
|
|
||||||
break;
|
|
||||||
|
|
||||||
msleep(20);
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -9153,7 +9153,7 @@ static int rtl8152_ioctl(struct net_devi
|
|
||||||
struct mii_ioctl_data *data = if_mii(rq);
|
|
||||||
int res;
|
|
||||||
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
res = usb_autopm_get_interface(tp->intf);
|
|
||||||
@@ -9255,7 +9255,7 @@ static const struct net_device_ops rtl81
|
|
||||||
|
|
||||||
static void rtl8152_unload(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (tp->version != RTL_VER_01)
|
|
||||||
@@ -9264,7 +9264,7 @@ static void rtl8152_unload(struct r8152
|
|
||||||
|
|
||||||
static void rtl8153_unload(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8153_power_cut_en(tp, false);
|
|
||||||
@@ -9272,7 +9272,7 @@ static void rtl8153_unload(struct r8152
|
|
||||||
|
|
||||||
static void rtl8153b_unload(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
- if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
|
||||||
+ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
|
||||||
return;
|
|
||||||
|
|
||||||
r8153b_power_cut_en(tp, false);
|
|
@ -232,7 +232,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
|
static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
|
||||||
@@ -8254,7 +8348,7 @@ static int rtl8152_pre_reset(struct usb_
|
@@ -8268,7 +8362,7 @@ static int rtl8152_pre_reset(struct usb_
|
||||||
struct r8152 *tp = usb_get_intfdata(intf);
|
struct r8152 *tp = usb_get_intfdata(intf);
|
||||||
struct net_device *netdev;
|
struct net_device *netdev;
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
netdev = tp->netdev;
|
netdev = tp->netdev;
|
||||||
@@ -8269,7 +8363,9 @@ static int rtl8152_pre_reset(struct usb_
|
@@ -8283,7 +8377,9 @@ static int rtl8152_pre_reset(struct usb_
|
||||||
napi_disable(&tp->napi);
|
napi_disable(&tp->napi);
|
||||||
if (netif_carrier_ok(netdev)) {
|
if (netif_carrier_ok(netdev)) {
|
||||||
mutex_lock(&tp->control);
|
mutex_lock(&tp->control);
|
||||||
@ -251,7 +251,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
mutex_unlock(&tp->control);
|
mutex_unlock(&tp->control);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8282,9 +8378,11 @@ static int rtl8152_post_reset(struct usb
|
@@ -8296,9 +8392,11 @@ static int rtl8152_post_reset(struct usb
|
||||||
struct net_device *netdev;
|
struct net_device *netdev;
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
/* reset the MAC address in case of policy change */
|
/* reset the MAC address in case of policy change */
|
||||||
if (determine_ethernet_addr(tp, &sa) >= 0) {
|
if (determine_ethernet_addr(tp, &sa) >= 0) {
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
@@ -9482,17 +9580,29 @@ static u8 __rtl_get_hw_ver(struct usb_de
|
@@ -9496,17 +9594,29 @@ static u8 __rtl_get_hw_ver(struct usb_de
|
||||||
__le32 *tmp;
|
__le32 *tmp;
|
||||||
u8 version;
|
u8 version;
|
||||||
int ret;
|
int ret;
|
||||||
@ -300,7 +300,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
kfree(tmp);
|
kfree(tmp);
|
||||||
|
|
||||||
@@ -9566,25 +9676,14 @@ u8 rtl8152_get_version(struct usb_interf
|
@@ -9580,25 +9690,14 @@ u8 rtl8152_get_version(struct usb_interf
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(rtl8152_get_version);
|
EXPORT_SYMBOL_GPL(rtl8152_get_version);
|
||||||
|
|
||||||
@ -328,7 +328,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
usb_reset_device(udev);
|
usb_reset_device(udev);
|
||||||
netdev = alloc_etherdev(sizeof(struct r8152));
|
netdev = alloc_etherdev(sizeof(struct r8152));
|
||||||
if (!netdev) {
|
if (!netdev) {
|
||||||
@@ -9757,10 +9856,20 @@ static int rtl8152_probe(struct usb_inte
|
@@ -9771,10 +9870,20 @@ static int rtl8152_probe(struct usb_inte
|
||||||
else
|
else
|
||||||
device_set_wakeup_enable(&udev->dev, false);
|
device_set_wakeup_enable(&udev->dev, false);
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
out1:
|
out1:
|
||||||
tasklet_kill(&tp->tx_tl);
|
tasklet_kill(&tp->tx_tl);
|
||||||
cancel_delayed_work_sync(&tp->hw_phy_work);
|
cancel_delayed_work_sync(&tp->hw_phy_work);
|
||||||
@@ -9769,10 +9878,46 @@ out1:
|
@@ -9783,10 +9892,46 @@ out1:
|
||||||
rtl8152_release_firmware(tp);
|
rtl8152_release_firmware(tp);
|
||||||
usb_set_intfdata(intf, NULL);
|
usb_set_intfdata(intf, NULL);
|
||||||
out:
|
out:
|
||||||
|
@ -22,7 +22,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
|||||||
#include <linux/crc32.h>
|
#include <linux/crc32.h>
|
||||||
#include <linux/if_vlan.h>
|
#include <linux/if_vlan.h>
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
@@ -6980,6 +6981,22 @@ static void rtl_tally_reset(struct r8152
|
@@ -6994,6 +6995,22 @@ static void rtl_tally_reset(struct r8152
|
||||||
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
|
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
|||||||
static void r8152b_init(struct r8152 *tp)
|
static void r8152b_init(struct r8152 *tp)
|
||||||
{
|
{
|
||||||
u32 ocp_data;
|
u32 ocp_data;
|
||||||
@@ -7021,6 +7038,8 @@ static void r8152b_init(struct r8152 *tp
|
@@ -7035,6 +7052,8 @@ static void r8152b_init(struct r8152 *tp
|
||||||
ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
|
ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
|
||||||
ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
|
ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
|
||||||
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
|
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
|
||||||
@ -54,7 +54,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void r8153_init(struct r8152 *tp)
|
static void r8153_init(struct r8152 *tp)
|
||||||
@@ -7161,6 +7180,8 @@ static void r8153_init(struct r8152 *tp)
|
@@ -7175,6 +7194,8 @@ static void r8153_init(struct r8152 *tp)
|
||||||
tp->coalesce = COALESCE_SLOW;
|
tp->coalesce = COALESCE_SLOW;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void r8153b_init(struct r8152 *tp)
|
static void r8153b_init(struct r8152 *tp)
|
||||||
@@ -7243,6 +7264,8 @@ static void r8153b_init(struct r8152 *tp
|
@@ -7257,6 +7278,8 @@ static void r8153b_init(struct r8152 *tp
|
||||||
rtl_tally_reset(tp);
|
rtl_tally_reset(tp);
|
||||||
|
|
||||||
tp->coalesce = 15000; /* 15 us */
|
tp->coalesce = 15000; /* 15 us */
|
||||||
|
@ -129,7 +129,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
|
|||||||
{
|
{
|
||||||
--- a/drivers/gpio/gpiolib-sysfs.c
|
--- a/drivers/gpio/gpiolib-sysfs.c
|
||||||
+++ b/drivers/gpio/gpiolib-sysfs.c
|
+++ b/drivers/gpio/gpiolib-sysfs.c
|
||||||
@@ -561,7 +561,7 @@ static struct class gpio_class = {
|
@@ -564,7 +564,7 @@ static struct class gpio_class = {
|
||||||
*
|
*
|
||||||
* Returns zero on success, else an error.
|
* Returns zero on success, else an error.
|
||||||
*/
|
*/
|
||||||
@ -138,7 +138,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
|
|||||||
{
|
{
|
||||||
struct gpio_chip *chip;
|
struct gpio_chip *chip;
|
||||||
struct gpio_device *gdev;
|
struct gpio_device *gdev;
|
||||||
@@ -623,6 +623,8 @@ int gpiod_export(struct gpio_desc *desc,
|
@@ -626,6 +626,8 @@ int gpiod_export(struct gpio_desc *desc,
|
||||||
offset = gpio_chip_hwgpio(desc);
|
offset = gpio_chip_hwgpio(desc);
|
||||||
if (chip->names && chip->names[offset])
|
if (chip->names && chip->names[offset])
|
||||||
ioname = chip->names[offset];
|
ioname = chip->names[offset];
|
||||||
@ -147,7 +147,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
|
|||||||
|
|
||||||
dev = device_create_with_groups(&gpio_class, &gdev->dev,
|
dev = device_create_with_groups(&gpio_class, &gdev->dev,
|
||||||
MKDEV(0, 0), data, gpio_groups,
|
MKDEV(0, 0), data, gpio_groups,
|
||||||
@@ -644,6 +646,12 @@ err_unlock:
|
@@ -647,6 +649,12 @@ err_unlock:
|
||||||
gpiod_dbg(desc, "%s: status %d\n", __func__, status);
|
gpiod_dbg(desc, "%s: status %d\n", __func__, status);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ Acked-by: Rob Landley <rob@landley.net>
|
|||||||
---
|
---
|
||||||
--- a/arch/mips/Kconfig
|
--- a/arch/mips/Kconfig
|
||||||
+++ b/arch/mips/Kconfig
|
+++ b/arch/mips/Kconfig
|
||||||
@@ -1102,9 +1102,6 @@ config FW_ARC
|
@@ -1103,9 +1103,6 @@ config FW_ARC
|
||||||
config ARCH_MAY_HAVE_PC_FDC
|
config ARCH_MAY_HAVE_PC_FDC
|
||||||
bool
|
bool
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ Acked-by: Rob Landley <rob@landley.net>
|
|||||||
config CEVT_BCM1480
|
config CEVT_BCM1480
|
||||||
bool
|
bool
|
||||||
|
|
||||||
@@ -3184,6 +3181,18 @@ choice
|
@@ -3186,6 +3183,18 @@ choice
|
||||||
bool "Extend builtin kernel arguments with bootloader arguments"
|
bool "Extend builtin kernel arguments with bootloader arguments"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
From: Felix Fietkau <nbd@nbd.name>
|
||||||
|
Date: Thu, 31 Aug 2023 21:48:38 +0200
|
||||||
|
Subject: [PATCH] netfilter: nf_tables: ignore -EOPNOTSUPP on flowtable device
|
||||||
|
offload setup
|
||||||
|
|
||||||
|
On many embedded devices, it is common to configure flowtable offloading for
|
||||||
|
a mix of different devices, some of which have hardware offload support and
|
||||||
|
some of which don't.
|
||||||
|
The current code limits the ability of user space to properly set up such a
|
||||||
|
configuration by only allowing adding devices with hardware offload support to
|
||||||
|
a offload-enabled flowtable.
|
||||||
|
Given that offload-enabled flowtables also imply fallback to pure software
|
||||||
|
offloading, this limitation makes little sense.
|
||||||
|
Fix it by not bailing out when the offload setup returns -EOPNOTSUPP
|
||||||
|
|
||||||
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/net/netfilter/nf_tables_api.c
|
||||||
|
+++ b/net/netfilter/nf_tables_api.c
|
||||||
|
@@ -7709,7 +7709,7 @@ static int nft_register_flowtable_net_ho
|
||||||
|
err = flowtable->data.type->setup(&flowtable->data,
|
||||||
|
hook->ops.dev,
|
||||||
|
FLOW_BLOCK_BIND);
|
||||||
|
- if (err < 0)
|
||||||
|
+ if (err < 0 && err != -EOPNOTSUPP)
|
||||||
|
goto err_unregister_net_hooks;
|
||||||
|
|
||||||
|
err = nf_register_net_hook(net, &hook->ops);
|
@ -40,7 +40,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
memory {
|
memory@40000000 {
|
||||||
- reg = <0 0x40000000 0 0x20000000>;
|
- reg = <0 0x40000000 0 0x20000000>;
|
||||||
+ reg = <0 0x40000000 0 0x40000000>;
|
+ reg = <0 0x40000000 0 0x40000000>;
|
||||||
};
|
};
|
||||||
|
@ -53,4 +53,4 @@
|
|||||||
+ */
|
+ */
|
||||||
};
|
};
|
||||||
|
|
||||||
memory {
|
memory@40000000 {
|
||||||
|
@ -179,7 +179,7 @@ Signed-off-by: hmz007 <hmz007@gmail.com>
|
|||||||
GATE(0, "clk_ddrupctl", "clk_ddr", CLK_IGNORE_UNUSED,
|
GATE(0, "clk_ddrupctl", "clk_ddr", CLK_IGNORE_UNUSED,
|
||||||
--- a/drivers/clk/rockchip/clk.h
|
--- a/drivers/clk/rockchip/clk.h
|
||||||
+++ b/drivers/clk/rockchip/clk.h
|
+++ b/drivers/clk/rockchip/clk.h
|
||||||
@@ -399,7 +399,8 @@ struct clk *rockchip_clk_register_mmc(co
|
@@ -418,7 +418,8 @@ struct clk *rockchip_clk_register_mmc(co
|
||||||
* DDRCLK flags, including method of setting the rate
|
* DDRCLK flags, including method of setting the rate
|
||||||
* ROCKCHIP_DDRCLK_SIP: use SIP call to bl31 to change ddrclk rate.
|
* ROCKCHIP_DDRCLK_SIP: use SIP call to bl31 to change ddrclk rate.
|
||||||
*/
|
*/
|
||||||
|
@ -557,12 +557,11 @@ Signed-off-by: hmz007 <hmz007@gmail.com>
|
|||||||
|
|
||||||
data->regs = devm_platform_ioremap_resource(pdev, 0);
|
data->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (IS_ERR(data->regs))
|
if (IS_ERR(data->regs))
|
||||||
@@ -202,21 +582,97 @@ static int rockchip_dfi_probe(struct pla
|
@@ -202,21 +582,95 @@ static int rockchip_dfi_probe(struct pla
|
||||||
if (IS_ERR(data->regmap_pmu))
|
if (IS_ERR(data->regmap_pmu))
|
||||||
return PTR_ERR(data->regmap_pmu);
|
return PTR_ERR(data->regmap_pmu);
|
||||||
}
|
|
||||||
- data->dev = dev;
|
- data->dev = dev;
|
||||||
+
|
|
||||||
+ regmap_read(data->regmap_pmu, PMUGRF_OS_REG2, &val);
|
+ regmap_read(data->regmap_pmu, PMUGRF_OS_REG2, &val);
|
||||||
+ data->dram_type = READ_DRAMTYPE_INFO(val);
|
+ data->dram_type = READ_DRAMTYPE_INFO(val);
|
||||||
+ data->ch_msk = READ_CH_INFO(val);
|
+ data->ch_msk = READ_CH_INFO(val);
|
||||||
@ -645,7 +644,6 @@ Signed-off-by: hmz007 <hmz007@gmail.com>
|
|||||||
+ } else {
|
+ } else {
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
desc->driver_data = data;
|
desc->driver_data = data;
|
||||||
desc->name = np->name;
|
desc->name = np->name;
|
||||||
data->desc = desc;
|
data->desc = desc;
|
||||||
|
Loading…
Reference in New Issue
Block a user