Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp306116imn; Thu, 28 Jul 2022 00:50:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tkg+3cfxDhBGGa1wptNl7BQSTDYn3PsNSuKpcS4LgLbrcwwOMUtgXmiFoDzROo32v51UzQ X-Received: by 2002:a17:906:5a61:b0:72b:1468:7fac with SMTP id my33-20020a1709065a6100b0072b14687facmr20170571ejc.440.1658994641113; Thu, 28 Jul 2022 00:50:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658994641; cv=none; d=google.com; s=arc-20160816; b=gy1s3rJldWWRH9LMlviKGNv4FXrHo3Q4iNQgtWOdUbms81MYrmYnw5KUmr/HylAeSw TpEyTlrGXT5XtLdSPWxltpOMXbpRrDT4QOlvuZmB3+nXs4ro0GAxvjkACLF+Igj6fLpU 3ceas9UvIwooqZlRE/FH90e2VvQmI6OeCXoYHn631fbUkgDE52TcZtDhe54+PrR7AmPa NLtRBLzvpGZwFozoF/zCz/V6764yYa4T8U5LFvVO6wKxyNpaKVNJXQRhWVP08/R3oHy3 GxnbtvVUikDbyhg8+Y6eyWFgiawWBgYWNCIabqstHUKBtALwE4z8f84ALQ8BwoJgkCjm jZAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=9truJK93JmeV6lg5otRQeJNOOckTc/2dVdLOM1MxeHY=; b=eO+iy5Omi6wy3lZkwCF6l99rbtJUjNRCiqVZ941t8eWW5BmaPiEQ9eSqXmBlHq9nYQ PfFGdvGGsk8LDoUkvpX33fMthueoe/JzOOU+TbyxIWwrL3Nto6uWxvxvFTDwY/7dyVUE Y0mpEfaUGfny61DZkMHz6cPhauQe55L5g2h7BYNI27fMj7k4WgqBtlwMxsThM8kkikpH hHOTgxNOJiFX6NIdPKxrYXQ5mHR6aJvrc4srUwNFiUfb5F29Gk4zCGrFnPMnvJEAbaPv Q/NuagxQ1ZbsdRKGrrY/tTMPi4ixu8w5Jg3ZOXAWF3gDJAIXbruz2unKCKa1ABd7h8IY hCLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvpn.net header.s=20170822-45nk5nwl header.b=imTyKsUT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mc3-20020a170906eb4300b0072b310dfc0fsi153028ejb.468.2022.07.28.00.50.15; Thu, 28 Jul 2022 00:50:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@openvpn.net header.s=20170822-45nk5nwl header.b=imTyKsUT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234689AbiG1Hnk (ORCPT + 99 others); Thu, 28 Jul 2022 03:43:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234641AbiG1Hnh (ORCPT ); Thu, 28 Jul 2022 03:43:37 -0400 X-Greylist: delayed 187 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 28 Jul 2022 00:43:36 PDT Received: from smtp86.ord1d.emailsrvr.com (smtp86.ord1d.emailsrvr.com [184.106.54.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4394461109 for ; Thu, 28 Jul 2022 00:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=openvpn.net; s=20170822-45nk5nwl; t=1658994214; bh=COnHq0q10jhFOxbkwvLuP4sHO7hzKD2UTU9fvogld5o=; h=Date:Subject:To:From:From; b=imTyKsUTDpVzxEuwveDG9Vi/iPpqKWnZg0vHRucblp1d5tQO6MuTx+7WB+8L2f2dk YW9WYmM4V2DSzo6pGqIjf7+RQEdfKJZq1B33HaqSQhxGDR/ErZ21+856eJAyrStgrV eaPQ4qTYUGlrESkf2GsmhGL5N4yvZI+rwrVuiJxg= X-Auth-ID: antonio@openvpn.net Received: by smtp3.relay.ord1d.emailsrvr.com (Authenticated sender: antonio-AT-openvpn.net) with ESMTPSA id 9B1F460090; Thu, 28 Jul 2022 03:43:33 -0400 (EDT) Message-ID: Date: Thu, 28 Jul 2022 09:44:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [RFC 1/1] net: introduce OpenVPN Data Channel Offload (ovpn-dco) Content-Language: en-US To: Andrew Lunn Cc: netdev@vger.kernel.org, David Miller , Jakub Kicinski , linux-kernel@vger.kernel.org References: <20220719014704.21346-1-antonio@openvpn.net> <20220719014704.21346-2-antonio@openvpn.net> From: Antonio Quartulli Organization: OpenVPN Inc. In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Classification-ID: 8cf5a843-5e45-45b4-8822-23f11e9ecabf-1-1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 19/07/2022 17:37, Andrew Lunn wrote: >> +static int ovpn_net_change_mtu(struct net_device *dev, int new_mtu) >> +{ >> + if (new_mtu < IPV4_MIN_MTU || >> + new_mtu + dev->hard_header_len > IP_MAX_MTU) >> + return -EINVAL; > > If you set dev->min_mtu and dev->max_mtu, the core will validate this > for you, see dev_validate_mtu(). Yeah, thanks for the pointer. > >> +static int ovpn_get_link_ksettings(struct net_device *dev, >> + struct ethtool_link_ksettings *cmd) >> +{ >> + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, 0); >> + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising, 0); > > These two should not be needed. Look at tun, veth etc, they don't set > them. I found this in tun.c: 3512 ethtool_link_ksettings_zero_link_mode(cmd, supported); 3513 ethtool_link_ksettings_zero_link_mode(cmd, advertising); Which seems a more appropriate version of my code, no? Regards, -- Antonio Quartulli OpenVPN Inc.