* Re: [PATCH] Documentation: Add HOWTO Korean translation into BPF and XDP Reference Guide.
From: Chang-an Song @ 2018-09-30 2:12 UTC (permalink / raw)
To: daniel; +Cc: Jonathan Corbet, tj, netdev, davem
In-Reply-To: <b668ce1e-3a2a-cd2a-da37-2e7c90a48cbe@iogearbox.net>
Hello Daniel, Jon
Thank you very much for review.
>That is a bit of a problem, since Apache v2 is not compatible with GPLv2.
>If the license of the document cannot be changed, I don't think we can
>accept it into the kernel tree.
Thank you for sharing information, Jon. I will check the rst file format
and the license of the document when I submit document at next time.
If I miss something, Please let me know and I will check the checklist, first.
>Alternative option could also be to integrate it into Cilium's doc given the
>original document is present there as well, so it could link to the Korean
>version from there.
Thank you for sharing about other ways, Daniel.
I will check the information you have provided, and then I am investigating
how to put the Korean version page, and I will proceed as soon as it
is completed.
BR/Leo
2018년 9월 27일 (목) 오전 6:19, Daniel Borkmann <daniel@iogearbox.net>님이 작성:
>
> On 09/26/2018 09:44 PM, Jonathan Corbet wrote:
> > On Wed, 26 Sep 2018 18:11:42 +0900
> > Chang-an Song <csongxdp@gmail.com> wrote:
> >
> >>> - The original document has a copyright assertion but no associated
> >>> license. Do we know what the license is? I assume it's something
> >>> that is free and GPL-compatible, but that would be good to know for
> >>> sure.
> >>
> >> 3. I asked to main author Daniel that apache 2.0 license for this document.
> >
> > That is a bit of a problem, since Apache v2 is not compatible with GPLv2.
> > If the license of the document cannot be changed, I don't think we can
> > accept it into the kernel tree.
>
> Alternative option could also be to integrate it into Cilium's doc given the
> original document is present there as well, so it could link to the Korean
> version from there.
^ permalink raw reply
* [PATCH net-next] tls: Add support for inplace records encryption
From: Vakul Garg @ 2018-09-30 2:34 UTC (permalink / raw)
To: netdev; +Cc: borisp, aviadye, davejwatson, davem, doronrk, Vakul Garg
Presently, for non-zero copy case, separate pages are allocated for
storing plaintext and encrypted text of records. These pages are stored
in sg_plaintext_data and sg_encrypted_data scatterlists inside record
structure. Further, sg_plaintext_data & sg_encrypted_data are passed
to cryptoapis for record encryption. Allocating separate pages for
plaintext and encrypted text is inefficient from both required memory
and performance point of view.
This patch adds support of inplace encryption of records. For non-zero
copy case, we reuse the pages from sg_encrypted_data scatterlist to
copy the application's plaintext data. For the movement of pages from
sg_encrypted_data to sg_plaintext_data scatterlists, we introduce a new
function move_to_plaintext_sg(). This function add pages into
sg_plaintext_data from sg_encrypted_data scatterlists.
tls_do_encryption() is modified to pass the same scatterlist as both
source and destination into aead_request_set_crypt() if inplace crypto
has been enabled. A new ariable 'inplace_crypto' has been introduced in
record structure to signify whether the same scatterlist can be used.
By default, the inplace_crypto is enabled in get_rec(). If zero-copy is
used (i.e. plaintext data is not copied), inplace_crypto is set to '0'.
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
---
include/net/tls.h | 1 +
net/tls/tls_sw.c | 91 ++++++++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 74 insertions(+), 18 deletions(-)
diff --git a/include/net/tls.h b/include/net/tls.h
index 262420cdad10..5e853835597e 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -101,6 +101,7 @@ struct tls_rec {
struct list_head list;
int tx_ready;
int tx_flags;
+ int inplace_crypto;
/* AAD | sg_plaintext_data | sg_tag */
struct scatterlist sg_plaintext_data[MAX_SKB_FRAGS + 1];
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 1d4c354d5516..aa9fdce272b6 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -281,24 +281,72 @@ static int alloc_encrypted_sg(struct sock *sk, int len)
return rc;
}
-static int alloc_plaintext_sg(struct sock *sk, int len)
+static int move_to_plaintext_sg(struct sock *sk, int required_size)
{
struct tls_context *tls_ctx = tls_get_ctx(sk);
struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
struct tls_rec *rec = ctx->open_rec;
- int rc = 0;
+ struct scatterlist *plain_sg = &rec->sg_plaintext_data[1];
+ struct scatterlist *enc_sg = &rec->sg_encrypted_data[1];
+ int enc_sg_idx = 0;
+ int skip, len;
- rc = sk_alloc_sg(sk, len,
- &rec->sg_plaintext_data[1], 0,
- &rec->sg_plaintext_num_elem,
- &rec->sg_plaintext_size,
- tls_ctx->pending_open_record_frags);
+ if (rec->sg_plaintext_num_elem == MAX_SKB_FRAGS)
+ return -ENOSPC;
- if (rc == -ENOSPC)
- rec->sg_plaintext_num_elem =
- ARRAY_SIZE(rec->sg_plaintext_data) - 1;
+ /* We add page references worth len bytes from enc_sg at the
+ * end of plain_sg. It is guaranteed that sg_encrypted_data
+ * has enough required room (ensured by caller).
+ */
+ len = required_size - rec->sg_plaintext_size;
- return rc;
+ /* Skip initial bytes in sg_encrypted_data to be able
+ * to use same offset of both plain and encrypted data.
+ */
+ skip = tls_ctx->tx.prepend_size + rec->sg_plaintext_size;
+
+ while (enc_sg_idx < rec->sg_encrypted_num_elem) {
+ if (enc_sg[enc_sg_idx].length > skip)
+ break;
+
+ skip -= enc_sg[enc_sg_idx].length;
+ enc_sg_idx++;
+ }
+
+ /* unmark the end of plain_sg*/
+ sg_unmark_end(plain_sg + rec->sg_plaintext_num_elem - 1);
+
+ while (len) {
+ struct page *page = sg_page(&enc_sg[enc_sg_idx]);
+ int bytes = enc_sg[enc_sg_idx].length - skip;
+ int offset = enc_sg[enc_sg_idx].offset + skip;
+
+ if (bytes > len)
+ bytes = len;
+ else
+ enc_sg_idx++;
+
+ /* Skipping is required only one time */
+ skip = 0;
+
+ /* Increment page reference */
+ get_page(page);
+
+ sg_set_page(&plain_sg[rec->sg_plaintext_num_elem], page,
+ bytes, offset);
+
+ sk_mem_charge(sk, bytes);
+
+ len -= bytes;
+ rec->sg_plaintext_size += bytes;
+
+ rec->sg_plaintext_num_elem++;
+
+ if (rec->sg_plaintext_num_elem == MAX_SKB_FRAGS)
+ return -ENOSPC;
+ }
+
+ return 0;
}
static void free_sg(struct sock *sk, struct scatterlist *sg,
@@ -459,16 +507,21 @@ static int tls_do_encryption(struct sock *sk,
size_t data_len)
{
struct tls_rec *rec = ctx->open_rec;
+ struct scatterlist *plain_sg = rec->sg_plaintext_data;
+ struct scatterlist *enc_sg = rec->sg_encrypted_data;
int rc;
/* Skip the first index as it contains AAD data */
rec->sg_encrypted_data[1].offset += tls_ctx->tx.prepend_size;
rec->sg_encrypted_data[1].length -= tls_ctx->tx.prepend_size;
+ /* If it is inplace crypto, then pass same SG list as both src, dst */
+ if (rec->inplace_crypto)
+ plain_sg = enc_sg;
+
aead_request_set_tfm(aead_req, ctx->aead_send);
aead_request_set_ad(aead_req, TLS_AAD_SPACE_SIZE);
- aead_request_set_crypt(aead_req, rec->sg_plaintext_data,
- rec->sg_encrypted_data,
+ aead_request_set_crypt(aead_req, plain_sg, enc_sg,
data_len, tls_ctx->tx.iv);
aead_request_set_callback(aead_req, CRYPTO_TFM_REQ_MAY_BACKLOG,
@@ -666,6 +719,7 @@ static struct tls_rec *get_rec(struct sock *sk)
sizeof(rec->aad_space));
ctx->open_rec = rec;
+ rec->inplace_crypto = 1;
return rec;
}
@@ -763,6 +817,8 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
if (ret)
goto fallback_to_reg_send;
+ rec->inplace_crypto = 0;
+
num_zc++;
copied += try_to_copy;
ret = tls_push_record(sk, msg->msg_flags, record_type);
@@ -782,11 +838,11 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
}
required_size = rec->sg_plaintext_size + try_to_copy;
-alloc_plaintext:
- ret = alloc_plaintext_sg(sk, required_size);
+
+ ret = move_to_plaintext_sg(sk, required_size);
if (ret) {
if (ret != -ENOSPC)
- goto wait_for_memory;
+ goto send_end;
/* Adjust try_to_copy according to the amount that was
* actually allocated. The difference is due
@@ -831,8 +887,6 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
if (rec->sg_encrypted_size < required_size)
goto alloc_encrypted;
-
- goto alloc_plaintext;
}
if (!num_async) {
@@ -958,6 +1012,7 @@ int tls_sw_sendpage(struct sock *sk, struct page *page,
if (full_record || eor ||
rec->sg_plaintext_num_elem ==
ARRAY_SIZE(rec->sg_plaintext_data) - 1) {
+ rec->inplace_crypto = 0;
ret = tls_push_record(sk, flags, record_type);
if (ret) {
if (ret == -EINPROGRESS)
--
2.13.6
^ permalink raw reply related
* [PATCH iproute2 net-next] ipneigh: update man page and help for router
From: Roopa Prabhu @ 2018-09-30 2:48 UTC (permalink / raw)
To: dsahern; +Cc: netdev
From: Roopa Prabhu <roopa@cumulusnetworks.com>
While at it also add missing text for proxy in the man page.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
ip/ipneigh.c | 1 +
man/man8/ip-neighbour.8 | 11 ++++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/ip/ipneigh.c b/ip/ipneigh.c
index 5747152..165546e 100644
--- a/ip/ipneigh.c
+++ b/ip/ipneigh.c
@@ -48,6 +48,7 @@ static void usage(void)
{
fprintf(stderr, "Usage: ip neigh { add | del | change | replace }\n"
" { ADDR [ lladdr LLADDR ] [ nud STATE ] | proxy ADDR } [ dev DEV ]\n");
+ fprintf(stderr, " [ router ]\n\n");
fprintf(stderr, " ip neigh { show | flush } [ proxy ] [ to PREFIX ] [ dev DEV ] [ nud STATE ]\n");
fprintf(stderr, " [ vrf NAME ]\n\n");
fprintf(stderr, "STATE := { permanent | noarp | stale | reachable | none |\n"
diff --git a/man/man8/ip-neighbour.8 b/man/man8/ip-neighbour.8
index bbfe8e7..db286d1 100644
--- a/man/man8/ip-neighbour.8
+++ b/man/man8/ip-neighbour.8
@@ -23,7 +23,8 @@ ip-neighbour \- neighbour/arp tables management.
.B proxy
.IR ADDR " } [ "
.B dev
-.IR DEV " ]"
+.IR DEV " ] [ "
+.BR router " ] "
.ti -8
.BR "ip neigh" " { " show " | " flush " } [ " proxy " ] [ " to
@@ -76,6 +77,14 @@ the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
the interface to which this neighbour is attached.
.TP
+.BI proxy
+indicates whether we are proxying for this neigbour entry
+
+.TP
+.BI router
+indicates whether neigbour is a router
+
+.TP
.BI lladdr " LLADDRESS"
the link layer address of the neighbour.
.I LLADDRESS
--
2.1.4
^ permalink raw reply related
* [PATCH][net-next] net: drop container_of in dst_cache_get_ip4
From: Li RongQing @ 2018-09-30 5:00 UTC (permalink / raw)
To: netdev
we can save container_of computation and return dst directly,
since dst is always first member of struct rtable, and any
breaking will be caught by BUILD_BUG_ON in route.h
include/net/route.h: BUILD_BUG_ON(offsetof(struct rtable, dst) != 0);
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
net/core/dst_cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/dst_cache.c b/net/core/dst_cache.c
index 64cef977484a..0753838480fd 100644
--- a/net/core/dst_cache.c
+++ b/net/core/dst_cache.c
@@ -87,7 +87,7 @@ struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr)
return NULL;
*saddr = idst->in_saddr.s_addr;
- return container_of(dst, struct rtable, dst);
+ return (struct rtable *)dst;
}
EXPORT_SYMBOL_GPL(dst_cache_get_ip4);
--
2.16.2
^ permalink raw reply related
* [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info
From: Li RongQing @ 2018-09-30 5:02 UTC (permalink / raw)
To: netdev
we can save container_of computation and return dst directly,
since dst is always first member of struct rt6_info
Add a BUILD_BUG_ON() to catch any change that could break this
assertion.
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
include/net/ip6_route.h | 4 +++-
net/ipv6/route.c | 6 +++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 7b9c82de11cc..1f09298634cb 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -194,8 +194,10 @@ static inline const struct rt6_info *skb_rt6_info(const struct sk_buff *skb)
const struct dst_entry *dst = skb_dst(skb);
const struct rt6_info *rt6 = NULL;
+ BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0);
+
if (dst)
- rt6 = container_of(dst, struct rt6_info, dst);
+ rt6 = (struct rt6_info *)dst;
return rt6;
}
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index d28f83e01593..3fb8034fc2d0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -217,7 +217,7 @@ static struct neighbour *ip6_dst_neigh_lookup(const struct dst_entry *dst,
struct sk_buff *skb,
const void *daddr)
{
- const struct rt6_info *rt = container_of(dst, struct rt6_info, dst);
+ const struct rt6_info *rt = (struct rt6_info *)dst;
return ip6_neigh_lookup(&rt->rt6i_gateway, dst->dev, skb, daddr);
}
@@ -2187,7 +2187,7 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
struct fib6_info *from;
struct rt6_info *rt;
- rt = container_of(dst, struct rt6_info, dst);
+ rt = (struct rt6_info *)dst;
rcu_read_lock();
@@ -4911,7 +4911,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
}
- rt = container_of(dst, struct rt6_info, dst);
+ rt = (struct rt6_info *)dst;
if (rt->dst.error) {
err = rt->dst.error;
ip6_rt_put(rt);
--
2.16.2
^ permalink raw reply related
* [PATCH v2 1/9] net: ip_rt_get_source() - use new style struct initializer instead of memset
From: Maciej Żenczykowski @ 2018-09-30 6:44 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev, David Ahern
From: Maciej Żenczykowski <maze@google.com>
(allows for better compiler optimization)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
net/ipv4/route.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index dce2ed66ebe1..02482b71498b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1217,18 +1217,15 @@ void ip_rt_get_source(u8 *addr, struct sk_buff *skb, struct rtable *rt)
src = ip_hdr(skb)->saddr;
else {
struct fib_result res;
- struct flowi4 fl4;
- struct iphdr *iph;
-
- iph = ip_hdr(skb);
-
- memset(&fl4, 0, sizeof(fl4));
- fl4.daddr = iph->daddr;
- fl4.saddr = iph->saddr;
- fl4.flowi4_tos = RT_TOS(iph->tos);
- fl4.flowi4_oif = rt->dst.dev->ifindex;
- fl4.flowi4_iif = skb->dev->ifindex;
- fl4.flowi4_mark = skb->mark;
+ struct iphdr *iph = ip_hdr(skb);
+ struct flowi4 fl4 = {
+ .daddr = iph->daddr,
+ .saddr = iph->saddr,
+ .flowi4_tos = RT_TOS(iph->tos),
+ .flowi4_oif = rt->dst.dev->ifindex,
+ .flowi4_iif = skb->dev->ifindex,
+ .flowi4_mark = skb->mark,
+ };
rcu_read_lock();
if (fib_lookup(dev_net(rt->dst.dev), &fl4, &res, 0) == 0)
--
2.19.0.605.g01d371f741-goog
^ permalink raw reply related
* [PATCH v2 2/9] net: inet_rtm_getroute() - use new style struct initializer instead of memset
From: Maciej Żenczykowski @ 2018-09-30 6:44 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev, David Ahern
In-Reply-To: <20180930064454.187537-1-zenczykowski@gmail.com>
From: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
net/ipv4/route.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 02482b71498b..048919713f4e 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2780,7 +2780,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
struct rtable *rt = NULL;
struct sk_buff *skb;
struct rtmsg *rtm;
- struct flowi4 fl4;
+ struct flowi4 fl4 = {};
__be32 dst = 0;
__be32 src = 0;
kuid_t uid;
@@ -2820,7 +2820,6 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
if (!skb)
return -ENOBUFS;
- memset(&fl4, 0, sizeof(fl4));
fl4.daddr = dst;
fl4.saddr = src;
fl4.flowi4_tos = rtm->rtm_tos;
--
2.19.0.605.g01d371f741-goog
^ permalink raw reply related
* [PATCH v2 3/9] net: ip6_redirect() - use new style struct initializer instead of memset
From: Maciej Żenczykowski @ 2018-09-30 6:44 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev, David Ahern
In-Reply-To: <20180930064454.187537-1-zenczykowski@gmail.com>
From: Maciej Żenczykowski <maze@google.com>
(allows for better compiler optimization)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
net/ipv6/route.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index d28f83e01593..6f252fa914c2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2508,16 +2508,15 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark,
{
const struct ipv6hdr *iph = (struct ipv6hdr *) skb->data;
struct dst_entry *dst;
- struct flowi6 fl6;
-
- memset(&fl6, 0, sizeof(fl6));
- fl6.flowi6_iif = LOOPBACK_IFINDEX;
- fl6.flowi6_oif = oif;
- fl6.flowi6_mark = mark;
- fl6.daddr = iph->daddr;
- fl6.saddr = iph->saddr;
- fl6.flowlabel = ip6_flowinfo(iph);
- fl6.flowi6_uid = uid;
+ struct flowi6 fl6 = {
+ .flowi6_iif = LOOPBACK_IFINDEX,
+ .flowi6_oif = oif,
+ .flowi6_mark = mark,
+ .daddr = iph->daddr,
+ .saddr = iph->saddr,
+ .flowlabel = ip6_flowinfo(iph),
+ .flowi6_uid = uid,
+ };
dst = ip6_route_redirect(net, &fl6, skb, &ipv6_hdr(skb)->saddr);
rt6_do_redirect(dst, NULL, skb);
--
2.19.0.605.g01d371f741-goog
^ permalink raw reply related
* [PATCH v2 4/9] net: ip6_redirect_no_header() - use new style struct initializer instead of memset
From: Maciej Żenczykowski @ 2018-09-30 6:44 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev, David Ahern
In-Reply-To: <20180930064454.187537-1-zenczykowski@gmail.com>
From: Maciej Żenczykowski <maze@google.com>
(allows for better compiler optimization)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
net/ipv6/route.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6f252fa914c2..dff80697c033 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2530,15 +2530,14 @@ void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
const struct ipv6hdr *iph = ipv6_hdr(skb);
const struct rd_msg *msg = (struct rd_msg *)icmp6_hdr(skb);
struct dst_entry *dst;
- struct flowi6 fl6;
-
- memset(&fl6, 0, sizeof(fl6));
- fl6.flowi6_iif = LOOPBACK_IFINDEX;
- fl6.flowi6_oif = oif;
- fl6.flowi6_mark = mark;
- fl6.daddr = msg->dest;
- fl6.saddr = iph->daddr;
- fl6.flowi6_uid = sock_net_uid(net, NULL);
+ struct flowi6 fl6 = {
+ .flowi6_iif = LOOPBACK_IFINDEX,
+ .flowi6_oif = oif,
+ .flowi6_mark = mark,
+ .daddr = msg->dest,
+ .saddr = iph->daddr,
+ .flowi6_uid = sock_net_uid(net, NULL),
+ };
dst = ip6_route_redirect(net, &fl6, skb, &iph->saddr);
rt6_do_redirect(dst, NULL, skb);
--
2.19.0.605.g01d371f741-goog
^ permalink raw reply related
* [PATCH v2 5/9] net: remove 1 always zero parameter from ip6_redirect_no_header()
From: Maciej Żenczykowski @ 2018-09-30 6:44 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev, David Ahern
In-Reply-To: <20180930064454.187537-1-zenczykowski@gmail.com>
From: Maciej Żenczykowski <maze@google.com>
(the parameter in question is mark)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
include/net/ip6_route.h | 3 +--
net/ipv6/ndisc.c | 2 +-
net/ipv6/route.c | 4 +---
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 7b9c82de11cc..cef186dbd2ce 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -165,8 +165,7 @@ void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu, int oif,
void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu);
void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark,
kuid_t uid);
-void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
- u32 mark);
+void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif);
void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk);
struct netlink_callback;
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 0ec273997d1d..51863ada15a4 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1533,7 +1533,7 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
if (!ndopts.nd_opts_rh) {
ip6_redirect_no_header(skb, dev_net(skb->dev),
- skb->dev->ifindex, 0);
+ skb->dev->ifindex);
return;
}
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index dff80697c033..e50525a95a09 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2524,8 +2524,7 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark,
}
EXPORT_SYMBOL_GPL(ip6_redirect);
-void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
- u32 mark)
+void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif)
{
const struct ipv6hdr *iph = ipv6_hdr(skb);
const struct rd_msg *msg = (struct rd_msg *)icmp6_hdr(skb);
@@ -2533,7 +2532,6 @@ void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
struct flowi6 fl6 = {
.flowi6_iif = LOOPBACK_IFINDEX,
.flowi6_oif = oif,
- .flowi6_mark = mark,
.daddr = msg->dest,
.saddr = iph->daddr,
.flowi6_uid = sock_net_uid(net, NULL),
--
2.19.0.605.g01d371f741-goog
^ permalink raw reply related
* [PATCH v2 6/9] net: ip6_update_pmtu() - use new style struct initializer instead of memset
From: Maciej Żenczykowski @ 2018-09-30 6:44 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev, David Ahern
In-Reply-To: <20180930064454.187537-1-zenczykowski@gmail.com>
From: Maciej Żenczykowski <maze@google.com>
(allows for better compiler optimization)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
net/ipv6/route.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e50525a95a09..dd19cf8dbcc1 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2349,15 +2349,14 @@ void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
{
const struct ipv6hdr *iph = (struct ipv6hdr *) skb->data;
struct dst_entry *dst;
- struct flowi6 fl6;
-
- memset(&fl6, 0, sizeof(fl6));
- fl6.flowi6_oif = oif;
- fl6.flowi6_mark = mark ? mark : IP6_REPLY_MARK(net, skb->mark);
- fl6.daddr = iph->daddr;
- fl6.saddr = iph->saddr;
- fl6.flowlabel = ip6_flowinfo(iph);
- fl6.flowi6_uid = uid;
+ struct flowi6 fl6 = {
+ .flowi6_oif = oif,
+ .flowi6_mark = mark ? mark : IP6_REPLY_MARK(net, skb->mark),
+ .daddr = iph->daddr,
+ .saddr = iph->saddr,
+ .flowlabel = ip6_flowinfo(iph),
+ .flowi6_uid = uid,
+ };
dst = ip6_route_output(net, NULL, &fl6);
if (!dst->error)
--
2.19.0.605.g01d371f741-goog
^ permalink raw reply related
* [PATCH v2 7/9] net: rtmsg_to_fib6_config() - use new style struct initializer instead of memset
From: Maciej Żenczykowski @ 2018-09-30 6:44 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev, David Ahern
In-Reply-To: <20180930064454.187537-1-zenczykowski@gmail.com>
From: Maciej Żenczykowski <maze@google.com>
(allows for better compiler optimization)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
net/ipv6/route.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index dd19cf8dbcc1..c312ad4046d1 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3604,23 +3604,23 @@ static void rtmsg_to_fib6_config(struct net *net,
struct in6_rtmsg *rtmsg,
struct fib6_config *cfg)
{
- memset(cfg, 0, sizeof(*cfg));
+ *cfg = (struct fib6_config){
+ .fc_table = l3mdev_fib_table_by_index(net, rtmsg->rtmsg_ifindex) ?
+ : RT6_TABLE_MAIN,
+ .fc_ifindex = rtmsg->rtmsg_ifindex,
+ .fc_metric = rtmsg->rtmsg_metric,
+ .fc_expires = rtmsg->rtmsg_info,
+ .fc_dst_len = rtmsg->rtmsg_dst_len,
+ .fc_src_len = rtmsg->rtmsg_src_len,
+ .fc_flags = rtmsg->rtmsg_flags,
+ .fc_type = rtmsg->rtmsg_type,
+
+ .fc_nlinfo.nl_net = net,
- cfg->fc_table = l3mdev_fib_table_by_index(net, rtmsg->rtmsg_ifindex) ?
- : RT6_TABLE_MAIN;
- cfg->fc_ifindex = rtmsg->rtmsg_ifindex;
- cfg->fc_metric = rtmsg->rtmsg_metric;
- cfg->fc_expires = rtmsg->rtmsg_info;
- cfg->fc_dst_len = rtmsg->rtmsg_dst_len;
- cfg->fc_src_len = rtmsg->rtmsg_src_len;
- cfg->fc_flags = rtmsg->rtmsg_flags;
- cfg->fc_type = rtmsg->rtmsg_type;
-
- cfg->fc_nlinfo.nl_net = net;
-
- cfg->fc_dst = rtmsg->rtmsg_dst;
- cfg->fc_src = rtmsg->rtmsg_src;
- cfg->fc_gateway = rtmsg->rtmsg_gateway;
+ .fc_dst = rtmsg->rtmsg_dst,
+ .fc_src = rtmsg->rtmsg_src,
+ .fc_gateway = rtmsg->rtmsg_gateway,
+ };
}
int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg)
--
2.19.0.605.g01d371f741-goog
^ permalink raw reply related
* [PATCH v2 8/9] net: rtm_to_fib6_config() - use new style struct initializer instead of memset
From: Maciej Żenczykowski @ 2018-09-30 6:44 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev, David Ahern
In-Reply-To: <20180930064454.187537-1-zenczykowski@gmail.com>
From: Maciej Żenczykowski <maze@google.com>
(allows for better compiler optimization)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
net/ipv6/route.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c312ad4046d1..be5f7a15bc38 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -4143,14 +4143,19 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
err = -EINVAL;
rtm = nlmsg_data(nlh);
- memset(cfg, 0, sizeof(*cfg));
- cfg->fc_table = rtm->rtm_table;
- cfg->fc_dst_len = rtm->rtm_dst_len;
- cfg->fc_src_len = rtm->rtm_src_len;
- cfg->fc_flags = RTF_UP;
- cfg->fc_protocol = rtm->rtm_protocol;
- cfg->fc_type = rtm->rtm_type;
+ *cfg = (struct fib6_config){
+ .fc_table = rtm->rtm_table,
+ .fc_dst_len = rtm->rtm_dst_len,
+ .fc_src_len = rtm->rtm_src_len,
+ .fc_flags = RTF_UP,
+ .fc_protocol = rtm->rtm_protocol,
+ .fc_type = rtm->rtm_type,
+
+ .fc_nlinfo.portid = NETLINK_CB(skb).portid,
+ .fc_nlinfo.nlh = nlh,
+ .fc_nlinfo.nl_net = sock_net(skb->sk),
+ };
if (rtm->rtm_type == RTN_UNREACHABLE ||
rtm->rtm_type == RTN_BLACKHOLE ||
@@ -4166,10 +4171,6 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
cfg->fc_flags |= (rtm->rtm_flags & RTNH_F_ONLINK);
- cfg->fc_nlinfo.portid = NETLINK_CB(skb).portid;
- cfg->fc_nlinfo.nlh = nlh;
- cfg->fc_nlinfo.nl_net = sock_net(skb->sk);
-
if (tb[RTA_GATEWAY]) {
cfg->fc_gateway = nla_get_in6_addr(tb[RTA_GATEWAY]);
cfg->fc_flags |= RTF_GATEWAY;
--
2.19.0.605.g01d371f741-goog
^ permalink raw reply related
* [PATCH v2 9/9] net: inet6_rtm_getroute() - use new style struct initializer instead of memset
From: Maciej Żenczykowski @ 2018-09-30 6:44 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev, David Ahern
In-Reply-To: <20180930064454.187537-1-zenczykowski@gmail.com>
From: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
net/ipv6/route.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index be5f7a15bc38..6311a7fc5f63 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -4823,7 +4823,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
struct rt6_info *rt;
struct sk_buff *skb;
struct rtmsg *rtm;
- struct flowi6 fl6;
+ struct flowi6 fl6 = {};
bool fibmatch;
err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy,
@@ -4832,7 +4832,6 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
goto errout;
err = -EINVAL;
- memset(&fl6, 0, sizeof(fl6));
rtm = nlmsg_data(nlh);
fl6.flowlabel = ip6_make_flowinfo(rtm->rtm_tos, 0);
fibmatch = !!(rtm->rtm_flags & RTM_F_FIB_MATCH);
--
2.19.0.605.g01d371f741-goog
^ permalink raw reply related
* [PATCH] xfrm: fix gro_cells leak when remove virtual xfrm interfaces
From: Li RongQing @ 2018-09-30 7:06 UTC (permalink / raw)
To: netdev, steffen.klassert
The device gro_cells has been initialized, it should be freed,
otherwise it will be leaked
Fixes: f203b76d78092faf2 ("xfrm: Add virtual xfrm interfaces")
Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
net/xfrm/xfrm_interface.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
index 4b4ef4f662d9..9cc6e72bc802 100644
--- a/net/xfrm/xfrm_interface.c
+++ b/net/xfrm/xfrm_interface.c
@@ -116,6 +116,9 @@ static void xfrmi_unlink(struct xfrmi_net *xfrmn, struct xfrm_if *xi)
static void xfrmi_dev_free(struct net_device *dev)
{
+ struct xfrm_if *xi = netdev_priv(dev);
+
+ gro_cells_destroy(&xi->gro_cells);
free_percpu(dev->tstats);
}
--
2.16.2
^ permalink raw reply related
* Re: [PATCH] team: set IFF_SLAVE on team ports
From: Jiri Pirko @ 2018-09-30 7:14 UTC (permalink / raw)
To: Chas Williams; +Cc: Jan Blunck, LKML, netdev
In-Reply-To: <c674e681-9f7f-85c2-a578-a246d1ec9f45@gmail.com>
Thu, Sep 27, 2018 at 04:04:26PM CEST, 3chas3@gmail.com wrote:
>
>
>On 07/10/15 02:41, Jiri Pirko wrote:
>> Thu, Jul 09, 2015 at 05:36:55PM CEST, jblunck@infradead.org wrote:
>> > On Thu, Jul 9, 2015 at 12:07 PM, Jiri Pirko <jiri@resnulli.us> wrote:
>> > > Thu, Jul 09, 2015 at 11:58:34AM CEST, jblunck@infradead.org wrote:
>> > > > The code in net/ipv6/addrconf.c:addrconf_notify() tests for IFF_SLAVE to
>> > > > decide if it should start the address configuration. Since team ports
>> > > > shouldn't get link-local addresses assigned lets set IFF_SLAVE when linking
>> > > > a port to the team master.
>> > >
>> > > I don't want to use IFF_SLAVE in team. Other master-slave devices are
>> > > not using that as well, for example bridge, ovs, etc.
>> > >
>> >
>> > Maybe they need to get fixed too. I've used that flag because it is
>> > documented as
>> > a "slave of a load balancer" which describes what a team port is.
>> >
>> >
>> > > I think that this should be fixed in addrconf_notify. It should lookup
>> > > if there is a master on top and bail out in that case.
>> >
>> > There are other virtual interfaces that have a master assigned and want to
>> > participate in IPv6 address configuration.
>>
>> Can you give me an example?
>
>I would like to revisit this patch (yes, I know it has been a while). I
>believe the VRF implementation uses master to group the interfaces under
>a single interface.
>
>I don't see a reason not to use IFF_SLAVE since team and bonding are fairly
>similar.
Again, why do you need team port to have IFF_SLAVE flag? What do you
want to achieve?
>
>> >
>> > Unless we want to have a cascade of conditionals testing the priv_flags in
>> > addrconf_notify() this is asking for a new net_device_flags flag.
>> > Maybe something
>> > generic like IFF_L2PORT ?
>> >
>> > Thanks,
>> > Jan
>> >
>> > [ Jiri, sorry for getting that mail twice ]
>>
>>
>>
^ permalink raw reply
* pull request: bluetooth-next 2018-09-30
From: Johan Hedberg @ 2018-09-30 7:36 UTC (permalink / raw)
To: davem; +Cc: linux-bluetooth, netdev
[-- Attachment #1: Type: text/plain, Size: 3501 bytes --]
Hi Dave,
Here's the first bluetooth-next pull request for the 4.20 kernel.
- Fixes & cleanups to hci_qca driver
- NULL dereference fix to debugfs
- Improved L2CAP Connection-oriented Channel MTU & MPS handling
- Added support for USB-based RTL8822C controller
- Added device ID for BCM4335C0 UART-based controller
- Various other smaller cleanups & fixes
Please let me know if there are any issues pulling. Thanks.
Johan
---
The following changes since commit 1042caa79e9351b81ed19dc8d2d7fd6ff51a4422:
net-ipv4: remove 2 always zero parameters from ipv4_redirect() (2018-09-26 20:30:55 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git for-upstream
for you to fetch changes up to 30d65e0804d58a03d1a8ea4e12c6fc07ed08218b:
Bluetooth: Fix debugfs NULL pointer dereference (2018-09-28 20:53:48 +0200)
----------------------------------------------------------------
Alex Lu (1):
Bluetooth: btrtl: Add support for RTL8822C with USB interface
Andrea Parri (1):
Bluetooth: Remove unnecessary smp_mb__{before,after}_atomic
Ankit Navik (1):
Bluetooth: Add definitions and track LE resolve list modification
Balakrishna Godavarthi (5):
Bluetooth: hci_qca: Remove serdev_device_open/close function calls
Bluetooth: hci_qca: Remove hdev dereference in qca_close().
Bluetooth: hci_serdev: clear HCI_UART_PROTO_READY to avoid closing proto races
Bluetooth: hci_serdev: Add protocol check in hci_uart_dequeue().
Bluetooth: hci_qca: Add poweroff support during hci down for wcn3990
Christian Hewitt (1):
Bluetooth: btbcm: Add entry for BCM4335C0 UART bluetooth
Colin Ian King (1):
Bluetooth: btrtl: Make array extension_sig static, shrinks object size
Ding Xiang (1):
Bluetooth: bt3c_cs: Fix obsolete function
Jagdish Tirumala (1):
Bluetooth: hci_serdev: Fixed error space required before open paranethesis
Justin TerAvest (1):
Bluetooth: btusb: Add quirk for BTUSB_INTEL_NEW
Luiz Augusto von Dentz (3):
Bluetooth: L2CAP: Derive MPS from connection MTU
Bluetooth: L2CAP: Derive rx credits from MTU and MPS
Bluetooth: L2CAP: Detect if remote is not able to use the whole MPS
Luiz Carlos Ramos (1):
Bluetooth: ath3k: add more information to error message
Matias Karhumaa (1):
Bluetooth: Fix debugfs NULL pointer dereference
Sanjay Kumar Konduri (1):
Bluetooth: btrsi: fix bt tx timeout issue
drivers/bluetooth/ath3k.c | 11 ++++---
drivers/bluetooth/bt3c_cs.c | 9 ++++--
drivers/bluetooth/btbcm.c | 1 +
drivers/bluetooth/btrsi.c | 13 +++++++-
drivers/bluetooth/btrtl.c | 10 +++++-
drivers/bluetooth/btusb.c | 1 +
drivers/bluetooth/hci_qca.c | 50 +++++++++++++++++++++++++-----
drivers/bluetooth/hci_serdev.c | 10 +++---
include/net/bluetooth/hci.h | 14 +++++++++
include/net/bluetooth/hci_core.h | 17 +++++++++++
include/net/bluetooth/l2cap.h | 3 --
net/bluetooth/bnep/core.c | 7 +++--
net/bluetooth/cmtp/core.c | 14 +++++----
net/bluetooth/hci_core.c | 65 +++++++++++++++++++++++++++++++++++++++
net/bluetooth/hci_event.c | 47 ++++++++++++++++++++++++++++
net/bluetooth/hidp/core.c | 13 +++++---
net/bluetooth/l2cap_core.c | 66 ++++++++++++++++++++++++++--------------
net/bluetooth/smp.c | 23 ++++++--------
18 files changed, 299 insertions(+), 75 deletions(-)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* [PATCH net v2] r8169: always autoneg on resume
From: Alex Xu (Hello71) @ 2018-09-30 15:06 UTC (permalink / raw)
To: netdev; +Cc: hkallweit1, nic_swsd, davem, linux-kernel
This affects at least versions 25 and 33, so assume all cards are broken
and just renegotiate by default.
Fixes: 10bc6a6042c9 ("r8169: fix autoneg issue on resume with RTL8168E")
Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
---
drivers/net/ethernet/realtek/r8169.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index ab30aaeac6d3..db2f347c1463 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4072,13 +4072,12 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
genphy_soft_reset(dev->phydev);
- /* It was reported that chip version 33 ends up with 10MBit/Half on a
+ /* It was reported that several chips end up with 10MBit/Half on a
* 1GBit link after resuming from S3. For whatever reason the PHY on
- * this chip doesn't properly start a renegotiation when soft-reset.
+ * these chips doesn't properly start a renegotiation when soft-reset.
* Explicitly requesting a renegotiation fixes this.
*/
- if (tp->mac_version == RTL_GIGA_MAC_VER_33 &&
- dev->phydev->autoneg == AUTONEG_ENABLE)
+ if (dev->phydev->autoneg == AUTONEG_ENABLE)
phy_restart_aneg(dev->phydev);
}
--
2.19.0
^ permalink raw reply related
* Re: [PATCH v2 net-next 7/8] net: ethernet: xgbe: expand PHY_GBIT_FEAUTRES
From: Sergei Shtylyov @ 2018-09-30 8:41 UTC (permalink / raw)
To: Andrew Lunn, David Miller; +Cc: netdev, Florian Fainelli, Maxime Chevallier
In-Reply-To: <1538255056-15114-8-git-send-email-andrew@lunn.ch>
Hello!
On 9/30/2018 12:04 AM, Andrew Lunn wrote:
> The macro PHY_GBIT_FEAUTRES needs to change into a bitmap in order to
> support link_modes. Remove its use from xgde by replacing it with its
> definition.
>
> Probably, the current behavior is wrong. It probably should be
> ANDing not assigning.
ORing, maybe?
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
> v2
> Remove unneeded ()
Really? :-)
> ---
> drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> index a7e03e3ecc93..151bdb629e8a 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> @@ -878,8 +878,9 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
> phy_write(phy_data->phydev, 0x04, 0x0d01);
> phy_write(phy_data->phydev, 0x00, 0x9140);
>
> - phy_data->phydev->supported = PHY_GBIT_FEATURES;
> - phy_data->phydev->advertising = phy_data->phydev->supported;
> + phy_data->phydev->supported = PHY_10BT_FEATURES |
> + PHY_100BT_FEATURES |
> + PHY_1000BT_FEATURES;
> phy_support_asym_pause(phy_data->phydev);
>
> netif_dbg(pdata, drv, pdata->netdev,
> @@ -950,8 +951,9 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
> reg = phy_read(phy_data->phydev, 0x00);
> phy_write(phy_data->phydev, 0x00, reg & ~0x00800);
>
> - phy_data->phydev->supported = PHY_GBIT_FEATURES;
> - phy_data->phydev->advertising = phy_data->phydev->supported;
> + phy_data->phydev->supported = (PHY_10BT_FEATURES |
> + PHY_100BT_FEATURES |
> + PHY_1000BT_FEATURES);
First time w/o parens and 2nd time with them doesn't look very consistent...
> phy_support_asym_pause(phy_data->phydev);
>
> netif_dbg(pdata, drv, pdata->netdev,
MBR, Sergei
^ permalink raw reply
* Re: [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info
From: Li RongQing @ 2018-09-30 9:27 UTC (permalink / raw)
To: Li RongQing; +Cc: netdev
In-Reply-To: <1538283772-23985-1-git-send-email-lirongqing@baidu.com>
> + BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0);
> +
please drop this patch, thanks
since BUILD_BUG_ON has been added in ip6_fib.h
include/net/ip6_fib.h: BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0);
-Li
^ permalink raw reply
* Re: [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info
From: Stephen Hemminger @ 2018-09-30 9:32 UTC (permalink / raw)
To: Li RongQing; +Cc: netdev
In-Reply-To: <1538283772-23985-1-git-send-email-lirongqing@baidu.com>
On Sun, 30 Sep 2018 13:02:52 +0800
Li RongQing <lirongqing@baidu.com> wrote:
> we can save container_of computation and return dst directly,
> since dst is always first member of struct rt6_info
>
> Add a BUILD_BUG_ON() to catch any change that could break this
> assertion.
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
I don't understand why you are doing this? It is not going to be
faster (or safer) than container_of. container_of provides the
same functionality and is safe against position of the member
in the structure.
^ permalink raw reply
* Re: [PATCH iproute2-next 01/11] libnetlink: Convert GETADDR dumps to use rtnl_addrdump_req
From: Stephen Hemminger @ 2018-09-30 9:35 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, christian, David Ahern
In-Reply-To: <20180929175931.18448-2-dsahern@kernel.org>
On Sat, 29 Sep 2018 10:59:21 -0700
David Ahern <dsahern@kernel.org> wrote:
> From: David Ahern <dsahern@gmail.com>
>
> Add rtnl_addrdump_req for address dumps using the proper ifaddrmsg
> as the header. Convert existing RTM_GETADDR dumps to use it.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
}
>
> +int rtnl_addrdump_req(struct rtnl_handle *rth, int family)
> +{
> + struct {
> + struct nlmsghdr nlh;
> + struct ifaddrmsg ifm;
> + } req = {
> + .nlh.nlmsg_len = sizeof(req),
> + .nlh.nlmsg_type = RTM_GETADDR,
> + .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
> + .nlh.nlmsg_seq = rth->dump = ++rth->seq,
> + .ifm.ifa_family = family,
> + };
This could be:
} req = {
.nlh = {
.nlmsg_len = sizeof(req),
.nlmsg_type = RTM_GETADDR,
...
^ permalink raw reply
* Re: [PATCH] team: set IFF_SLAVE on team ports
From: Stephen Hemminger @ 2018-09-30 9:38 UTC (permalink / raw)
To: Jiri Pirko; +Cc: Chas Williams, Jan Blunck, LKML, netdev
In-Reply-To: <20180930071414.GF2209@nanopsycho.orion>
On Sun, 30 Sep 2018 09:14:14 +0200
Jiri Pirko <jiri@resnulli.us> wrote:
> Thu, Sep 27, 2018 at 04:04:26PM CEST, 3chas3@gmail.com wrote:
> >
> >
> >On 07/10/15 02:41, Jiri Pirko wrote:
> >> Thu, Jul 09, 2015 at 05:36:55PM CEST, jblunck@infradead.org wrote:
> >> > On Thu, Jul 9, 2015 at 12:07 PM, Jiri Pirko <jiri@resnulli.us> wrote:
> >> > > Thu, Jul 09, 2015 at 11:58:34AM CEST, jblunck@infradead.org wrote:
> >> > > > The code in net/ipv6/addrconf.c:addrconf_notify() tests for IFF_SLAVE to
> >> > > > decide if it should start the address configuration. Since team ports
> >> > > > shouldn't get link-local addresses assigned lets set IFF_SLAVE when linking
> >> > > > a port to the team master.
> >> > >
> >> > > I don't want to use IFF_SLAVE in team. Other master-slave devices are
> >> > > not using that as well, for example bridge, ovs, etc.
> >> > >
> >> >
> >> > Maybe they need to get fixed too. I've used that flag because it is
> >> > documented as
> >> > a "slave of a load balancer" which describes what a team port is.
> >> >
> >> >
> >> > > I think that this should be fixed in addrconf_notify. It should lookup
> >> > > if there is a master on top and bail out in that case.
> >> >
> >> > There are other virtual interfaces that have a master assigned and want to
> >> > participate in IPv6 address configuration.
> >>
> >> Can you give me an example?
> >
> >I would like to revisit this patch (yes, I know it has been a while). I
> >believe the VRF implementation uses master to group the interfaces under
> >a single interface.
> >
> >I don't see a reason not to use IFF_SLAVE since team and bonding are fairly
> >similar.
>
> Again, why do you need team port to have IFF_SLAVE flag? What do you
> want to achieve
Without setting this flag IPv6 will try and make a link specific address.
^ permalink raw reply
* Re: [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info
From: Li RongQing @ 2018-09-30 9:38 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Li RongQing, netdev
In-Reply-To: <20180930113252.7159eedd@shemminger-XPS-13-9360>
>
> I don't understand why you are doing this? It is not going to be
> faster (or safer) than container_of. container_of provides the
> same functionality and is safe against position of the member
> in the structure.
>
In fact, most places are converting dst to rt6_info directly, and only
few place uses container_of
net/ipv6/ip6_output.c: struct rt6_info *rt = (struct rt6_info *)skb_dst(skb);
net/ipv6/route.c: const struct rt6_info *rt = (struct rt6_info *)dst;
-Li
^ permalink raw reply
* Re: [PATCH] team: set IFF_SLAVE on team ports
From: Jiri Pirko @ 2018-09-30 9:34 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Chas Williams, Jan Blunck, LKML, netdev
In-Reply-To: <20180930113805.3b8e62a1@shemminger-XPS-13-9360>
Sun, Sep 30, 2018 at 11:38:05AM CEST, stephen@networkplumber.org wrote:
>On Sun, 30 Sep 2018 09:14:14 +0200
>Jiri Pirko <jiri@resnulli.us> wrote:
>
>> Thu, Sep 27, 2018 at 04:04:26PM CEST, 3chas3@gmail.com wrote:
>> >
>> >
>> >On 07/10/15 02:41, Jiri Pirko wrote:
>> >> Thu, Jul 09, 2015 at 05:36:55PM CEST, jblunck@infradead.org wrote:
>> >> > On Thu, Jul 9, 2015 at 12:07 PM, Jiri Pirko <jiri@resnulli.us> wrote:
>> >> > > Thu, Jul 09, 2015 at 11:58:34AM CEST, jblunck@infradead.org wrote:
>> >> > > > The code in net/ipv6/addrconf.c:addrconf_notify() tests for IFF_SLAVE to
>> >> > > > decide if it should start the address configuration. Since team ports
>> >> > > > shouldn't get link-local addresses assigned lets set IFF_SLAVE when linking
>> >> > > > a port to the team master.
>> >> > >
>> >> > > I don't want to use IFF_SLAVE in team. Other master-slave devices are
>> >> > > not using that as well, for example bridge, ovs, etc.
>> >> > >
>> >> >
>> >> > Maybe they need to get fixed too. I've used that flag because it is
>> >> > documented as
>> >> > a "slave of a load balancer" which describes what a team port is.
>> >> >
>> >> >
>> >> > > I think that this should be fixed in addrconf_notify. It should lookup
>> >> > > if there is a master on top and bail out in that case.
>> >> >
>> >> > There are other virtual interfaces that have a master assigned and want to
>> >> > participate in IPv6 address configuration.
>> >>
>> >> Can you give me an example?
>> >
>> >I would like to revisit this patch (yes, I know it has been a while). I
>> >believe the VRF implementation uses master to group the interfaces under
>> >a single interface.
>> >
>> >I don't see a reason not to use IFF_SLAVE since team and bonding are fairly
>> >similar.
>>
>> Again, why do you need team port to have IFF_SLAVE flag? What do you
>> want to achieve
>
>Without setting this flag IPv6 will try and make a link specific address.
Why is it not an issue with bridge, ovs, and other master-slave devices?
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox