From: Davide Caratti <dcaratti@redhat.com>
To: Jiri Pirko <jiri@resnulli.us>, netdev@vger.kernel.org
Cc: davem@davemloft.net, yotamg@mellanox.com, idosch@mellanox.com,
mlxsw@mellanox.com, nikolay@cumulusnetworks.com, andrew@lunn.ch,
dsa@cumulusnetworks.com, edumazet@google.com, willemb@google.com,
johannes.berg@intel.com, pabeni@redhat.com, daniel@iogearbox.net,
f.fainelli@gmail.com, fw@strlen.de, gfree.wind@vip.163.com
Subject: Re: [patch net-next 1/7] skbuff: Add the offload_mr_fwd_mark field
Date: Fri, 29 Sep 2017 13:14:46 +0200 [thread overview]
Message-ID: <1506683686.2980.44.camel@redhat.com> (raw)
In-Reply-To: <20170928173415.15551-2-jiri@resnulli.us>
hello Jiri and Yotam,
On Thu, 2017-09-28 at 19:34 +0200, Jiri Pirko wrote:
> From: Yotam Gigi <yotamg@mellanox.com>
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 19e64bf..ada8214 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -772,6 +772,7 @@ struct sk_buff {
> __u8 remcsum_offload:1;
> #ifdef CONFIG_NET_SWITCHDEV
> __u8 offload_fwd_mark:1;
> + __u8 offload_mr_fwd_mark:1;
I had a look at the pahole output:
$ make allyesconfig
$ make net/core/skbuff.o
$ pahole net/core/skbuff.o | grep -C7 tc_from_ingress
__u8 ipvs_property:1; /* 147: 7 1 */
__u8 inner_protocol_type:1; /* 147: 6 1 */
__u8 remcsum_offload:1; /* 147: 5 1 */
__u8 offload_fwd_mark:1; /* 147: 4 1 */
__u8 tc_skip_classify:1; /* 147: 3 1 */
__u8 tc_at_ingress:1; /* 147: 2 1 */
__u8 tc_redirected:1; /* 147: 1 1 */
__u8 tc_from_ingress:1; /* 147: 0 1 */
__u16 tc_index; /* 148 2 */
/* XXX 2 bytes hole, try to pack */
union {
__wsum csum; /* 4 */
struct {
apparently there are no more spare bits to use at that offset: therefore,
adding 'offload_mr_fwd_mark' before 'tc_skip_classify' will make
'tc_from_ingress' slip at offset 148, and tc_index at offset 150.
I think you can use that 2-bytes hole below tc_index, and also move the
offload_fwd_mark bit there, as we use both when CONFIG_NET_SWITCHDEV is
enabled. This way we will also gain one spare bit, without changing the
struct size or worsening the cacheline alignments.
what do you think?
regards,
--
davide
next prev parent reply other threads:[~2017-09-29 11:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-28 17:34 [patch net-next 0/7] mlxsw: Add support for partial multicast route offload Jiri Pirko
2017-09-28 17:34 ` [patch net-next 1/7] skbuff: Add the offload_mr_fwd_mark field Jiri Pirko
2017-09-28 17:49 ` Andrew Lunn
2017-09-29 6:05 ` Jiri Pirko
2017-09-29 11:14 ` Davide Caratti [this message]
2017-09-29 11:36 ` Yuval Mintz
2017-09-28 17:34 ` [patch net-next 2/7] ipv4: ipmr: Add the parent ID field to VIF struct Jiri Pirko
2017-09-29 9:29 ` Nikolay Aleksandrov
2017-09-29 9:45 ` Nikolay Aleksandrov
2017-10-01 6:22 ` Yotam Gigi
2017-09-29 9:50 ` Nikolay Aleksandrov
2017-10-01 6:33 ` Yotam Gigi
2017-09-28 17:34 ` [patch net-next 3/7] ipv4: ipmr: Don't forward packets already forwarded by hardware Jiri Pirko
2017-09-28 17:56 ` Florian Fainelli
2017-10-01 8:51 ` Yotam Gigi
2017-09-28 17:34 ` [patch net-next 4/7] mlxsw: acl: Introduce ACL trap and forward action Jiri Pirko
2017-09-28 17:34 ` [patch net-next 5/7] mlxsw: spectrum: Add trap for multicast trap-and-forward routes Jiri Pirko
2017-09-28 17:34 ` [patch net-next 6/7] mlxsw: spectrum: mr_tcam: Add trap-and-forward multicast route Jiri Pirko
2017-09-28 17:34 ` [patch net-next 7/7] mlxsw: spectrum: mr: Support trap-and-forward routes Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1506683686.2980.44.camel@redhat.com \
--to=dcaratti@redhat.com \
--cc=andrew@lunn.ch \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=fw@strlen.de \
--cc=gfree.wind@vip.163.com \
--cc=idosch@mellanox.com \
--cc=jiri@resnulli.us \
--cc=johannes.berg@intel.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
--cc=yotamg@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).