From: Jakub Kicinski <kuba@kernel.org>
To: "mengyuanlou@net-swift.com" <mengyuanlou@net-swift.com>
Cc: netdev@vger.kernel.org, Jiawen Wu <jiawenwu@trustnetic.com>
Subject: Re: [PATCH net-next v6 1/8] net: wangxun: libwx add tx offload functions
Date: Wed, 24 May 2023 08:30:08 -0700 [thread overview]
Message-ID: <20230524083008.4ab6937d@kernel.org> (raw)
In-Reply-To: <5B88318B-4944-43CB-8EF6-4942A2696480@net-swift.com>
On Wed, 24 May 2023 14:59:54 +0800 mengyuanlou@net-swift.com wrote:
> > 2023年5月24日 12:06,Jakub Kicinski <kuba@kernel.org> 写道:
> > On Tue, 23 May 2023 11:06:51 +0800 Mengyuan Lou wrote:
> >> + if (skb->encapsulation) {
> >> + union network_header hdr;
> >> +
> >> + switch (first->protocol) {
> >> + case htons(ETH_P_IP):
> >> + tun_prot = ip_hdr(skb)->protocol;
> >> + if (ip_is_fragment(ip_hdr(skb)))
> >> + return WX_PTYPE_PKT_IP | WX_PTYPE_TYP_IPFRAG;
> >> + ptype = WX_PTYPE_TUN_IPV4;
> >> + break;
> >> + case htons(ETH_P_IPV6):
> >> + wx_get_ipv6_proto(skb, skb_network_offset(skb), &tun_prot);
> >> + if (tun_prot == NEXTHDR_FRAGMENT)
> >> + return WX_PTYPE_PKT_IP | WX_PTYPE_PKT_IPV6 |
> >> + WX_PTYPE_TYP_IPFRAG;
> >> + ptype = WX_PTYPE_TUN_IPV6;
> >
> > Why does the HW care about fragmented packets?
> > AFAIU fragmented packets won't have any offloads enabled.
>
> According to hardware spec(Packet type table), try to tell the ptypes for hardware.
Extracting information from the packet consumes CPU cycles.
If HW will not use the information anyway (because no offload
is requested for the packet) those cycles are wasted.
next prev parent reply other threads:[~2023-05-24 15:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-23 3:06 [PATCH net-next v6 0/8] Wangxun netdev features support Mengyuan Lou
2023-05-23 3:06 ` [PATCH net-next v6 1/8] net: wangxun: libwx add tx offload functions Mengyuan Lou
2023-05-24 4:06 ` Jakub Kicinski
2023-05-24 6:59 ` mengyuanlou
2023-05-24 15:30 ` Jakub Kicinski [this message]
2023-05-23 3:06 ` [PATCH net-next v6 2/8] net: wangxun: libwx add rx " Mengyuan Lou
2023-05-24 4:04 ` Jakub Kicinski
2023-05-23 3:06 ` [PATCH net-next v6 3/8] net: wangxun: Implement vlan add and kill functions Mengyuan Lou
2023-05-23 3:06 ` [PATCH net-next v6 4/8] net: libwx: Implement xx_set_features ops Mengyuan Lou
2023-05-23 3:06 ` [PATCH net-next v6 5/8] net: ngbe: Add netdev features support Mengyuan Lou
2023-05-23 3:06 ` [PATCH net-next v6 6/8] net: ngbe: Implement vlan add and remove ops Mengyuan Lou
2023-05-23 3:06 ` [PATCH net-next v6 7/8] net: txgbe: Add netdev features support Mengyuan Lou
2023-05-23 3:06 ` [PATCH net-next v6 8/8] net: txgbe: Implement vlan add and remove ops Mengyuan Lou
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=20230524083008.4ab6937d@kernel.org \
--to=kuba@kernel.org \
--cc=jiawenwu@trustnetic.com \
--cc=mengyuanlou@net-swift.com \
--cc=netdev@vger.kernel.org \
/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).