lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230524083008.4ab6937d@kernel.org>
Date: Wed, 24 May 2023 08:30:08 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: "mengyuanlou@...-swift.com" <mengyuanlou@...-swift.com>
Cc: netdev@...r.kernel.org, Jiawen Wu <jiawenwu@...stnetic.com>
Subject: Re: [PATCH net-next v6 1/8] net: wangxun: libwx add tx offload
 functions

On Wed, 24 May 2023 14:59:54 +0800 mengyuanlou@...-swift.com wrote:
> > 2023年5月24日 12:06,Jakub Kicinski <kuba@...nel.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ