From patchwork Tue Jun 25 08:29:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: echken X-Patchwork-Id: 13710767 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42385148857 for ; Tue, 25 Jun 2024 08:29:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719304183; cv=none; b=KwfTUDBF0uLGy2fKwwW0QeV//RUO/V6ReDDGVIvz/ls9a/8hY9ZdArQpZhr5/4Khx6O8H6mB3T4zhb/PsLn0IOuXQqgZBsoB8zTQRopV8K4CLwtAs+kfbwd3E2YmNJqsAjpJYOD7SJJfO7yillBrSVqe78ad7Uytx2zsAexB1Fc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719304183; c=relaxed/simple; bh=AnmKil8+NfynUTaFHzWfLAaLMrrcYuTWsIEWkLL1vfI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=qW/zq2yqW3ffyjBzOnE7lDZcIpGCY32OL82KhTJsnexjJJei4flfqbmSNogNqkOZSuChnl0FajA3noRSyUrwY7B+VBoProVBtlFktHc/cQ8AhJaF+jTH5Ck6vktGYSf+LCEsDkVmxQmEeagThswUB8FPFNvjXBscda+TGEudcUE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=smartx.com; spf=none smtp.mailfrom=smartx.com; dkim=pass (2048-bit key) header.d=smartx-com.20230601.gappssmtp.com header.i=@smartx-com.20230601.gappssmtp.com header.b=IjAIMraZ; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=smartx.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=smartx.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=smartx-com.20230601.gappssmtp.com header.i=@smartx-com.20230601.gappssmtp.com header.b="IjAIMraZ" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1fa2782a8ccso15532425ad.2 for ; Tue, 25 Jun 2024 01:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1719304180; x=1719908980; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=EHm6jSq3YRWEu2BqkiF85SjfiXnv03zfze5ShEkImQ8=; b=IjAIMraZEV2mZ83rYmfj5XNXOgKcRoa/Yepk2YVAfrKjq35C0miTcUBO2eHRpXnimj IIT4Wk6DrAio9Y+15WwC8o3sxaPgQr7JG12ZyIfS0X06E1GZavus5mzuXsBkiImLZ/tv 2XiAiQDnc6NgzyjvVkg/29jT1YLxcviMEWDcFyVTc36QGFOng83l1rkB4MwroRTj16sj pffht+JRrZ/JNfH9JGTAbCl54O3FkZlkS37ht7lZxu8pv19PcDUWJpLcK17CyASG8gdN 8VpORHrrWtedqmFAoL98zSgkKLTL5U3mzHyQu/4z9PeiJ0tULR0l/I6gT70kWtve66xP 431g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719304180; x=1719908980; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EHm6jSq3YRWEu2BqkiF85SjfiXnv03zfze5ShEkImQ8=; b=T0Q29LIFcGNivzE0YWCX3RHtJy+TFxCsP7VuJxPPlJlVtcVGP+yERCMLa+0uSvVqTm jvm/5+ZPt59g2FFRTmXMOLB1Y6GYD73w2a81n4Ka7HlgNWd8/vyYA4MUrnC7rhroxW6a Ad9PaITO8BNXkn+NpV5DPd4TSjmPPJwWOQI/ROei2djGFMYjhIs2kcC1KUBFGZdiWKzv jsqQy4AukGqj8xAMCBDvocOEPcsGWkBAdeVNL31dHnT7d1iHQH+QYXgx2/pOWy33KcyS uNHMBmmDyIrEJODCAS01LHr2hlnaf0o52WBu0F6qLh5yYT7h2n9YXpd8I9DcLE8rsTmK AhEg== X-Gm-Message-State: AOJu0Ywo9j35qJqV9LwrFSZm4H14J/FIBQEygQyrPCwH3tN5EOywY9Sm DKx4Dm6dkzlYqleexmElSOvPhLxBkZeL6CCqgHHUDzy7u65gwPLmXDKaje03eJ0= X-Google-Smtp-Source: AGHT+IEuUm/k18cKpsPHmSMA/4F5q07QPsr1++pGXwTWN6paEYO6DEUJj/D6ppjMr7SThqV4w9G47g== X-Received: by 2002:a17:902:f685:b0:1fa:12a5:a4f9 with SMTP id d9443c01a7336-1fa23f15c1dmr85226395ad.47.1719304179756; Tue, 25 Jun 2024 01:29:39 -0700 (PDT) Received: from echken.smartx.com (vps-bd302c4a.vps.ovh.ca. [15.235.142.94]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-1fa2b011112sm41628545ad.121.2024.06.25.01.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 01:29:39 -0700 (PDT) From: echken To: pshelar@ovn.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, dev@openvswitch.org, linux-kernel@vger.kernel.org, echken Subject: [PATCH 1/2] Add GSO UDP Offloading feature to OVS Internal Port Date: Tue, 25 Jun 2024 08:29:24 +0000 Message-Id: <20240625082924.775877-1-chengcheng.luo@smartx.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The OVS internal port does not support UDP fragmentation offloading, resulting in large packets sent through the OVS internal port to OVS being prematurely fragmented. This increases the total number of packets processed in the path from the vport to the OVS bridge output port, affecting transmission efficiency. Signed-off-by: echken --- net/openvswitch/vport-internal_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index 74c88a6baa43..c5a72c4dc6fd 100644 --- a/net/openvswitch/vport-internal_dev.c +++ b/net/openvswitch/vport-internal_dev.c @@ -110,7 +110,8 @@ static void do_setup(struct net_device *netdev) netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | - NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL; + NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL | + NETIF_F_GSO_UDP | NETIF_F_GSO_UDP_L4; netdev->vlan_features = netdev->features; netdev->hw_enc_features = netdev->features; From patchwork Tue Jun 25 08:33:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: echken X-Patchwork-Id: 13710768 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFF3C148832 for ; Tue, 25 Jun 2024 08:33:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719304420; cv=none; b=Nn/LU+l9xnZ3AaqXhp0yK1xCwhyal4KesI39jwM4FnUQy9JekF7EKboyaoQP+cjoeodCVBj7ds72w20EW8rsWcqmdWtuocH583fKSLgoHdVtmqVd2UD+4sxKAfLnxGUTKPzpX6GDnHC/3lyOlc9eJ1a5lyu6z8TL06u7ZkIt+bE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719304420; c=relaxed/simple; bh=6zLeUxGI/6eJmXDQirmzJApQvIPtWQsC1uEMVIgt2tU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Ic1spMHILf7wiurJjFBg8r+I+gixoEwvSTHyoKM8qEbVJabXoBp3P7oNPAxpth8UhfZzuPwJe1KxzIn3bKCTHmvww6ysZQYN+8YyDPYvbAcbXLhyG5Y+BDumOHD7AHo5A7QAHE0FLligU1UcMG11r6YSjzbtD/B+shoJyTOR7ig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=smartx.com; spf=none smtp.mailfrom=smartx.com; dkim=pass (2048-bit key) header.d=smartx-com.20230601.gappssmtp.com header.i=@smartx-com.20230601.gappssmtp.com header.b=J0h5vpYR; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=smartx.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=smartx.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=smartx-com.20230601.gappssmtp.com header.i=@smartx-com.20230601.gappssmtp.com header.b="J0h5vpYR" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-7067a2e9607so1877016b3a.3 for ; Tue, 25 Jun 2024 01:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1719304418; x=1719909218; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Mm6ddIKDyA7yDOVacp77GbndxO6yjA2PPWGRWlNTN1Q=; b=J0h5vpYRiqosRaYwTeDSWa7DdrN8EDN7B+B+WXEl5ZdQNBBj2dXfguSQ64usrxddoF 08W+b6rndt8CJIb4vwjNotO9W16+mwHfJkl1lo97bOxzzJ0hM1xdwy1xJHMkyEWEG1NS QgU3cwpMweam3XpfM82MDJQUAqrSjQOTKUAglSz7JWG8AgPV6+RukprNwU5/49tFndDr guVtEhi20WzM3JirI4GZxb1YHybwf7vCenGSqFZCj0ttpWQwRMXs7fEo6KfhWmukj1a8 Ibl1oIqwIuXyCjQMwTxWMCx/n7XfoDJYf8Vls/OOlqnPvQX86oIdo0JEiLBsePsoOFuy Rhtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719304418; x=1719909218; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Mm6ddIKDyA7yDOVacp77GbndxO6yjA2PPWGRWlNTN1Q=; b=bL2V8jkaMiDUIzUd36uRbflgAeW1P4f33P1x1M5zmx5Z0c9sKOTjCQCMnFX5XHYRY5 iqR6SgZzdtZuUiuQqPKAFETzqUG8kprYhv/tfAqF2aVoMvsdlsvmmsC83jLpS11p44c5 jbhAWyLsUPwOnFRENKENUOEqDlp2MTANH3W7XaFL3VEb3AUAAYpqgQygFHwcKE9G5/dB fOUPM2y+UISSAew9EiYl8f9pRpCuWUpeYUDn31CJWqVPmwAIP8g/mAWGUHgp+328P+Fk 5j2CladpUTgi/FrVEnoyF7FTfp6E2cOg8x+tMf1L6GoPRzHifYrZe6FghTKFcbJvOEqg wm5g== X-Gm-Message-State: AOJu0YyaDnGesyCmHUHIxEIoronVAPY524DTXaN+jbyoXG4EHBh4KgGC Y7ykl4v5vRovZAJMRPIlXdQWYKIjRoOPPcYB7+U2IHxbj0t3p19+AeP/q/pAo+0= X-Google-Smtp-Source: AGHT+IELm3Ttvtx5YR4G1Z8+z+DN1lPcg5UI0/UEjh9cx2tvPjDsjig+TPYlFTxJUKTZbgzOn8F1Kg== X-Received: by 2002:a05:6a20:6720:b0:1b4:b4af:6045 with SMTP id adf61e73a8af0-1bcf4479e5cmr7378240637.18.1719304417403; Tue, 25 Jun 2024 01:33:37 -0700 (PDT) Received: from echken.smartx.com (vps-bd302c4a.vps.ovh.ca. [15.235.142.94]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-70662ee117asm6035587b3a.211.2024.06.25.01.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 01:33:37 -0700 (PDT) From: echken To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, echken Subject: [PATCH 2/2] Add UDP fragmentation features to Geneve devices Date: Tue, 25 Jun 2024 08:33:24 +0000 Message-Id: <20240625083324.776057-1-chengcheng.luo@smartx.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Since Geneve devices do not support any offloading features for UDP fragmentation, large UDP packets sent through Geneve devices to the kernel protocol stack are preemptively fragmented in the TX direction of the Geneve device. The more computationally intensive encapsulation and routing processes occur after fragmentation, which leads to a significant increase in performance overhead in this scenario. By adding GSO_UDP and GSO_UDP_L4 to Geneve devices, we can ensure a significant reduction in the number of packets that undergo the computationally expensive Geneve encapsulation and routing processes in this scenario, thereby improving throughput performance. Signed-off-by: echken --- drivers/net/geneve.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 838e85ddec67..dc0f5846b415 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -1198,10 +1198,14 @@ static void geneve_setup(struct net_device *dev) dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST; dev->features |= NETIF_F_RXCSUM; dev->features |= NETIF_F_GSO_SOFTWARE; + dev->features |= NETIF_F_GSO_UDP; + dev->features |= NETIF_F_GSO_UDP_L4; dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST; dev->hw_features |= NETIF_F_RXCSUM; dev->hw_features |= NETIF_F_GSO_SOFTWARE; + dev->features |= NETIF_F_GSO_UDP; + dev->features |= NETIF_F_GSO_UDP_L4; dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS; /* MTU range: 68 - (something less than 65535) */