From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Pismenny Subject: Re: [net-next 01/12] net/mlx5e: Add UDP GSO support Date: Mon, 2 Jul 2018 08:29:53 +0300 Message-ID: <7f108395-5782-eb4c-1023-5c513bd13079@mellanox.com> References: <20180628215103.9141-1-saeedm@mellanox.com> <20180628215103.9141-2-saeedm@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: David Miller , Network Development , Saeed Mahameed , ogerlitz@mellanox.com, yossiku@mellanox.com To: Willem de Bruijn , Alexander Duyck Return-path: Received: from mail-eopbgr60087.outbound.protection.outlook.com ([40.107.6.87]:64128 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751419AbeGBFaP (ORCPT ); Mon, 2 Jul 2018 01:30:15 -0400 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 7/2/2018 4:45 AM, Willem de Bruijn wrote: >>> I've noticed that we could get cleaner code in our driver if we remove >>> these two lines from net/ipv4/udp_offload.c: >>> if (skb_is_gso(segs)) >>> mss *= skb_shinfo(segs)->gso_segs; >>> >>> I think that this is correct in case of GSO_PARTIAL segmentation for the >>> following reasons: >>> 1. After this change the UDP payload field is consistent with the IP >>> header payload length field. Currently, IPv4 length is 1500 and UDP >>> total length is the full unsegmented length. > > How does this simplify the driver? Does it currently have to > change the udph->length field to the mss on the wire, because the > device only splits + replicates the headers + computes the csum? Yes, this is the code I have at the moment. The device's limitation is more subtle than this. It could adjust the length, but then the checksum would be wrong.