mirror of
https://github.com/bolucat/Archive.git
synced 2026-04-23 00:17:16 +08:00
Update On Sun May 5 20:28:38 CEST 2024
This commit is contained in:
@@ -637,3 +637,4 @@ Update On Wed May 1 20:30:48 CEST 2024
|
||||
Update On Thu May 2 20:28:05 CEST 2024
|
||||
Update On Fri May 3 20:27:51 CEST 2024
|
||||
Update On Sat May 4 20:29:46 CEST 2024
|
||||
Update On Sun May 5 20:28:27 CEST 2024
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
"@types/lodash-es": "4.17.12",
|
||||
"@types/node": "20.12.8",
|
||||
"autoprefixer": "10.4.19",
|
||||
"conventional-changelog-conventionalcommits": "7.0.2",
|
||||
"conventional-changelog-conventionalcommits": "8.0.0",
|
||||
"cross-env": "7.0.3",
|
||||
"dedent": "1.5.3",
|
||||
"eslint": "8.57.0",
|
||||
@@ -99,7 +99,7 @@
|
||||
"stylelint-order": "6.0.4",
|
||||
"stylelint-scss": "6.3.0",
|
||||
"tailwindcss": "3.4.3",
|
||||
"tsx": "4.9.0",
|
||||
"tsx": "4.9.1",
|
||||
"typescript": "5.4.5"
|
||||
},
|
||||
"packageManager": "pnpm@9.0.6",
|
||||
|
||||
Generated
+4125
-5128
File diff suppressed because it is too large
Load Diff
@@ -65,7 +65,9 @@ export const ControllerViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
sx={{ width: 175 }}
|
||||
value={secret}
|
||||
placeholder={t("Recommended")}
|
||||
onChange={(e) => setSecret(e.target.value)}
|
||||
onChange={(e) =>
|
||||
setSecret(e.target.value?.replace(/[^\x00-\x7F]/g, ""))
|
||||
}
|
||||
/>
|
||||
</ListItem>
|
||||
</List>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<Application
|
||||
x:Class="ClashN.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:conv="clr-namespace:ClashN.Converters"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
ShutdownMode="OnExplicitShutdown"
|
||||
StartupUri="Views/MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
@@ -13,7 +13,7 @@
|
||||
BaseTheme="Dark"
|
||||
PrimaryColor="Blue"
|
||||
SecondaryColor="Lime" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<system:Double x:Key="StdFontSize1">11</system:Double>
|
||||
<system:Double x:Key="StdFontSize2">12</system:Double>
|
||||
@@ -74,7 +74,7 @@
|
||||
</materialDesign:Card>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter TargetName="_Card" Property="Background" Value="{DynamicResource PrimaryHueLightBrush}" />
|
||||
<Setter TargetName="_Card" Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -95,7 +95,7 @@
|
||||
BasedOn="{StaticResource MaterialDesignRaisedButton}"
|
||||
TargetType="{x:Type ButtonBase}">
|
||||
<Setter Property="FontSize" Value="{DynamicResource StdFontSize3}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueDarkForegroundBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Dark.Foreground}" />
|
||||
</Style>
|
||||
<Style
|
||||
x:Key="DefMenu"
|
||||
|
||||
@@ -528,7 +528,7 @@ namespace ClashN.ViewModels
|
||||
{
|
||||
var theme = _paletteHelper.GetTheme();
|
||||
|
||||
theme.SetBaseTheme(isDarkTheme ? Theme.Dark : Theme.Light);
|
||||
theme.SetBaseTheme(isDarkTheme ? BaseTheme.Dark : BaseTheme.Light);
|
||||
_paletteHelper.SetTheme(theme);
|
||||
|
||||
Utils.SetDarkBorder(Application.Current.MainWindow, isDarkTheme);
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
SnackbarMessageQueue="{Binding ElementName=MainSnackbar, Path=MessageQueue}"
|
||||
Style="{StaticResource MaterialDesignEmbeddedDialogHost}">
|
||||
<Grid>
|
||||
<TabControl Padding="2,0" Style="{StaticResource MaterialDesignNavigatilRailTabControl}">
|
||||
<TabControl Padding="2,0" Style="{StaticResource MaterialDesignNavigationRailTabControl}">
|
||||
<materialDesign:NavigationRailAssist.FloatingContent>
|
||||
<StackPanel
|
||||
Width="auto"
|
||||
Height="auto"
|
||||
Margin="4">
|
||||
Width="auto"
|
||||
Height="auto"
|
||||
Margin="4">
|
||||
<Grid Width="80" Margin="0,8,0,8">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -46,33 +46,33 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<materialDesign:PackIcon
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Kind="ArrowUpThin" />
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Kind="ArrowUpThin" />
|
||||
<TextBlock
|
||||
x:Name="txtSpeedUpload"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
Padding="0,0,4,0"
|
||||
Style="{StaticResource ToolbarItem}" />
|
||||
x:Name="txtSpeedUpload"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
Padding="0,0,4,0"
|
||||
Style="{StaticResource ToolbarItem}" />
|
||||
<materialDesign:PackIcon
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Kind="ArrowDownThin" />
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Kind="ArrowDownThin" />
|
||||
<TextBlock
|
||||
x:Name="txtSpeedDownload"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
Padding="0,0,4,0"
|
||||
Style="{StaticResource ToolbarItem}" />
|
||||
x:Name="txtSpeedDownload"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
Padding="0,0,4,0"
|
||||
Style="{StaticResource ToolbarItem}" />
|
||||
</Grid>
|
||||
<Button
|
||||
x:Name="btnReload"
|
||||
Content="{materialDesign:PackIcon Kind=Reload}"
|
||||
Style="{StaticResource MaterialDesignFlatLightBgButton}"
|
||||
ToolTip="{x:Static resx:ResUI.TbReloadCore}" />
|
||||
x:Name="btnReload"
|
||||
Content="{materialDesign:PackIcon Kind=Reload}"
|
||||
Style="{StaticResource MaterialDesignFlatLightBgButton}"
|
||||
ToolTip="{x:Static resx:ResUI.TbReloadCore}" />
|
||||
</StackPanel>
|
||||
</materialDesign:NavigationRailAssist.FloatingContent>
|
||||
<!--<TabItem
|
||||
@@ -99,14 +99,14 @@
|
||||
<TabItem.Header>
|
||||
<StackPanel Width="auto" Height="auto">
|
||||
<materialDesign:PackIcon
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="ArrowDecisionOutline" />
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="ArrowDecisionOutline" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbProxies}" />
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbProxies}" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
</TabItem>
|
||||
@@ -114,14 +114,14 @@
|
||||
<TabItem.Header>
|
||||
<StackPanel Width="auto" Height="auto">
|
||||
<materialDesign:PackIcon
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="Server" />
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="Server" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbProfiles}" />
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbProfiles}" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
</TabItem>
|
||||
@@ -129,14 +129,14 @@
|
||||
<TabItem.Header>
|
||||
<StackPanel Width="auto" Height="auto">
|
||||
<materialDesign:PackIcon
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="MessageTextOutline" />
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="MessageTextOutline" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbLogs}" />
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbLogs}" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
</TabItem>
|
||||
@@ -144,14 +144,14 @@
|
||||
<TabItem.Header>
|
||||
<StackPanel Width="auto" Height="auto">
|
||||
<materialDesign:PackIcon
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="LanConnect" />
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="LanConnect" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbConnections}" />
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbConnections}" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
</TabItem>
|
||||
@@ -159,14 +159,14 @@
|
||||
<TabItem.Header>
|
||||
<StackPanel Width="auto" Height="auto">
|
||||
<materialDesign:PackIcon
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="SettingsOutline" />
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="SettingsOutline" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbSettings}" />
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbSettings}" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
</TabItem>
|
||||
@@ -174,14 +174,14 @@
|
||||
<TabItem.Header>
|
||||
<StackPanel Width="auto" Height="auto">
|
||||
<materialDesign:PackIcon
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="HelpCircleOutline" />
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="HelpCircleOutline" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbHelp}" />
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbHelp}" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
</TabItem>
|
||||
@@ -189,32 +189,32 @@
|
||||
<TabItem.Header>
|
||||
<StackPanel Width="auto" Height="auto">
|
||||
<materialDesign:PackIcon
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="VolumeHigh" />
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
Kind="VolumeHigh" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbPromotion}" />
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TabItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbPromotion}" />
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<tb:TaskbarIcon
|
||||
x:Name="tbNotify"
|
||||
IconSource="/ClashN.ico"
|
||||
NoLeftClickDelay="True">
|
||||
x:Name="tbNotify"
|
||||
IconSource="/ClashN.ico"
|
||||
NoLeftClickDelay="True">
|
||||
<tb:TaskbarIcon.ContextMenu>
|
||||
<ContextMenu Style="{StaticResource DefMenu}">
|
||||
<MenuItem x:Name="menuSystemProxyClear">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
x:Name="menuSystemProxyClear2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
x:Name="menuSystemProxyClear2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
<TextBlock Text="{x:Static resx:ResUI.menuSystemProxyClear}" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
@@ -223,9 +223,9 @@
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
x:Name="menuSystemProxySet2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
x:Name="menuSystemProxySet2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
<TextBlock Text="{x:Static resx:ResUI.menuSystemProxySet}" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
@@ -234,9 +234,9 @@
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
x:Name="menuSystemProxyNothing2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
x:Name="menuSystemProxyNothing2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
<TextBlock Text="{x:Static resx:ResUI.menuSystemProxyNothing}" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
@@ -245,9 +245,9 @@
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
x:Name="menuSystemProxyPac2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
x:Name="menuSystemProxyPac2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
<TextBlock Text="{x:Static resx:ResUI.menuSystemProxyPac}" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
@@ -258,9 +258,9 @@
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
x:Name="menuModeRule2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
x:Name="menuModeRule2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
<TextBlock Text="{x:Static resx:ResUI.menuModeRule}" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
@@ -269,9 +269,9 @@
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
x:Name="menuModeGlobal2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
x:Name="menuModeGlobal2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
<TextBlock Text="{x:Static resx:ResUI.menuModeGlobal}" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
@@ -280,9 +280,9 @@
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
x:Name="menuModeDirect2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
x:Name="menuModeDirect2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
<TextBlock Text="{x:Static resx:ResUI.menuModeDirect}" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
@@ -291,9 +291,9 @@
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
x:Name="menuModeNothing2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
x:Name="menuModeNothing2"
|
||||
Margin="0,0,8,0"
|
||||
Kind="Check" />
|
||||
<TextBlock Text="{x:Static resx:ResUI.menuModeNothing}" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
@@ -305,9 +305,9 @@
|
||||
<MenuItem x:Name="menuSubUpdateViaProxy" Header="{x:Static resx:ResUI.menuSubUpdateViaProxy}" />
|
||||
<Separator />
|
||||
<MenuItem
|
||||
x:Name="menuExit"
|
||||
Click="menuExit_Click"
|
||||
Header="{x:Static resx:ResUI.menuExit}" />
|
||||
x:Name="menuExit"
|
||||
Click="menuExit_Click"
|
||||
Header="{x:Static resx:ResUI.menuExit}" />
|
||||
</ContextMenu>
|
||||
</tb:TaskbarIcon.ContextMenu>
|
||||
</tb:TaskbarIcon>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<DockPanel Margin="2">
|
||||
<TextBlock
|
||||
DockPanel.Dock="Top"
|
||||
Foreground="{DynamicResource PrimaryHueLightBrush}"
|
||||
Foreground="{DynamicResource MaterialDesign.Brush.Primary.Light}"
|
||||
Style="{StaticResource ListItemTitle}"
|
||||
Text="{x:Static resx:ResUI.TbMsgTitle}" />
|
||||
<TextBox
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
Width="5"
|
||||
Height="auto"
|
||||
Margin="0,1"
|
||||
Background="{DynamicResource PrimaryHueLightBrush}"
|
||||
Background="{DynamicResource MaterialDesign.Brush.Primary.Light}"
|
||||
CornerRadius="4"
|
||||
DockPanel.Dock="Left"
|
||||
Visibility="{Binding Path=IsActive, Converter={StaticResource BoolToVisConverter}}" />
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
Width="5"
|
||||
Height="auto"
|
||||
Margin="0,1"
|
||||
Background="{DynamicResource PrimaryHueLightBrush}"
|
||||
Background="{DynamicResource MaterialDesign.Brush.Primary.Light}"
|
||||
CornerRadius="4"
|
||||
DockPanel.Dock="Left"
|
||||
Visibility="{Binding Path=isActive, Converter={StaticResource BoolToVisConverter}}" />
|
||||
|
||||
@@ -15,19 +15,19 @@
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
|
||||
<PackageReference Include="MaterialDesignThemes" Version="5.0.0" />
|
||||
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NHotkey" Version="3.0.0" />
|
||||
<PackageReference Include="NHotkey.Wpf" Version="3.0.0" />
|
||||
<PackageReference Include="QRCoder.Xaml" Version="1.5.1" />
|
||||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
||||
<PackageReference Include="TaskScheduler" Version="2.11.0" />
|
||||
<PackageReference Include="YamlDotNet" Version="15.1.2" />
|
||||
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
|
||||
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
|
||||
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />
|
||||
<PackageReference Include="ReactiveUI.WPF" Version="19.6.12" />
|
||||
<PackageReference Include="Splat.NLog" Version="14.8.12" />
|
||||
<PackageReference Include="ReactiveUI.WPF" Version="20.0.1" />
|
||||
<PackageReference Include="Splat.NLog" Version="15.0.1" />
|
||||
<PackageReference Include="System.Reactive" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.10 = .216
|
||||
LINUX_KERNEL_HASH-5.10.216 = e310588c4b23f0959614e60f007afc20e9b1a8f296d682b041fa129f96fbe151
|
||||
LINUX_VERSION-5.10 = .215
|
||||
LINUX_KERNEL_HASH-5.10.215 = 879ca159c34ea9d3a6775f292cc59c2d3931d57dca00f0bebe2675ea0c82c6a9
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.15 = .158
|
||||
LINUX_KERNEL_HASH-5.15.158 = f9071c83a4fd8b80af026b48cfc1869bfa25883f9148b92b5dc1e1e1e26dd5c6
|
||||
LINUX_VERSION-5.15 = .157
|
||||
LINUX_KERNEL_HASH-5.15.157 = aff22351d34d69a16762dcf1fd51fe228da55d4b96b67247bdd598a86cc7a414
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.4 = .275
|
||||
LINUX_KERNEL_HASH-5.4.275 = dad2b068946f0ca0026130d7ab17601d5074d90b381379c4479314d4edf4304c
|
||||
LINUX_VERSION-5.4 = .274
|
||||
LINUX_KERNEL_HASH-5.4.274 = eac7b421a43cd46a3dbebf7c85d075faa7e164d80d215d31fcd35544b6f79ed4
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.1 = .89
|
||||
LINUX_KERNEL_HASH-6.1.89 = 12bab8e092618d1d4eeaf4201e6e70054c94896198956bd84ff0e908b0264719
|
||||
LINUX_VERSION-6.1 = .90
|
||||
LINUX_KERNEL_HASH-6.1.90 = 83a3d72e764fceda2c1fc68a4ea6b91253a28da56a688a2b61776b0d19788e1d
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.6 = .29
|
||||
LINUX_KERNEL_HASH-6.6.29 = 7f26f74c08082c86b1daf866e4d49c5d8276cc1906a89d0e367e457ec167cbd0
|
||||
LINUX_VERSION-6.6 = .30
|
||||
LINUX_KERNEL_HASH-6.6.30 = b66a5b863b0f8669448b74ca83bd641a856f164b29956e539bbcb5fdeeab9cc6
|
||||
|
||||
@@ -19,7 +19,7 @@ Subject: [PATCH 210/210] b44: register adm switch
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
@@ -2251,6 +2253,69 @@ static void b44_adjust_link(struct net_d
|
||||
@@ -2249,6 +2251,69 @@ static void b44_adjust_link(struct net_d
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ Subject: [PATCH 210/210] b44: register adm switch
|
||||
static int b44_register_phy_one(struct b44 *bp)
|
||||
{
|
||||
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
@@ -2287,6 +2352,9 @@ static int b44_register_phy_one(struct b
|
||||
@@ -2285,6 +2350,9 @@ static int b44_register_phy_one(struct b
|
||||
if (!mdiobus_is_registered_device(bp->mii_bus, bp->phy_addr) &&
|
||||
(sprom->boardflags_lo & (B44_BOARDFLAG_ROBO | B44_BOARDFLAG_ADM))) {
|
||||
|
||||
@@ -99,7 +99,7 @@ Subject: [PATCH 210/210] b44: register adm switch
|
||||
dev_info(sdev->dev,
|
||||
"could not find PHY at %i, use fixed one\n",
|
||||
bp->phy_addr);
|
||||
@@ -2483,6 +2551,7 @@ static void b44_remove_one(struct ssb_de
|
||||
@@ -2481,6 +2549,7 @@ static void b44_remove_one(struct ssb_de
|
||||
unregister_netdev(dev);
|
||||
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
|
||||
b44_unregister_phy_one(bp);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
|
||||
return 0;
|
||||
@@ -2181,6 +2206,8 @@ static int b44_get_invariants(struct b44
|
||||
@@ -2179,6 +2204,8 @@ static int b44_get_invariants(struct b44
|
||||
* valid PHY address. */
|
||||
bp->phy_addr &= 0x1F;
|
||||
|
||||
|
||||
+1
-1
@@ -1913,7 +1913,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
eth_hw_addr_inherit(slave_dev, master);
|
||||
--- a/net/ethernet/eth.c
|
||||
+++ b/net/ethernet/eth.c
|
||||
@@ -496,13 +496,14 @@ unsigned char * __weak arch_get_platform
|
||||
@@ -506,13 +506,14 @@ unsigned char * __weak arch_get_platform
|
||||
|
||||
int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr)
|
||||
{
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
/* Enable checksum offload */
|
||||
*tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP |
|
||||
@@ -1582,17 +1583,19 @@ ax88179_tx_fixup(struct usbnet *dev, str
|
||||
@@ -1587,17 +1588,19 @@ ax88179_tx_fixup(struct usbnet *dev, str
|
||||
{
|
||||
u32 tx_hdr1, tx_hdr2;
|
||||
int frame_size = dev->maxpacket;
|
||||
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if ((skb_header_cloned(skb) || headroom < 0) &&
|
||||
pskb_expand_head(skb, headroom < 0 ? 8 : 0, 0, GFP_ATOMIC)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
@@ -1603,6 +1606,8 @@ ax88179_tx_fixup(struct usbnet *dev, str
|
||||
@@ -1608,6 +1611,8 @@ ax88179_tx_fixup(struct usbnet *dev, str
|
||||
put_unaligned_le32(tx_hdr1, ptr);
|
||||
put_unaligned_le32(tx_hdr2, ptr + 4);
|
||||
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
|
||||
--- a/arch/Kconfig
|
||||
+++ b/arch/Kconfig
|
||||
@@ -1307,6 +1307,14 @@ config ARCH_HAS_ELFCORE_COMPAT
|
||||
@@ -1299,6 +1299,14 @@ config ARCH_HAS_ELFCORE_COMPAT
|
||||
config ARCH_HAS_PARANOID_L1D_FLUSH
|
||||
bool
|
||||
|
||||
@@ -90,7 +90,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
source "scripts/gcc-plugins/Kconfig"
|
||||
--- a/arch/x86/Kconfig
|
||||
+++ b/arch/x86/Kconfig
|
||||
@@ -86,6 +86,7 @@ config X86
|
||||
@@ -85,6 +85,7 @@ config X86
|
||||
select ARCH_HAS_PMEM_API if X86_64
|
||||
select ARCH_HAS_PTE_DEVMAP if X86_64
|
||||
select ARCH_HAS_PTE_SPECIAL
|
||||
|
||||
+1
-1
@@ -552,7 +552,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
--- a/kernel/bounds.c
|
||||
+++ b/kernel/bounds.c
|
||||
@@ -22,6 +22,11 @@ int main(void)
|
||||
DEFINE(NR_CPUS_BITS, order_base_2(CONFIG_NR_CPUS));
|
||||
DEFINE(NR_CPUS_BITS, bits_per(CONFIG_NR_CPUS));
|
||||
#endif
|
||||
DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
|
||||
+#ifdef CONFIG_LRU_GEN
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Mon, 7 Feb 2022 10:27:22 +0100
|
||||
Subject: [PATCH] arm64: dts: mediatek: mt7622: add support for coherent
|
||||
DMA
|
||||
|
||||
It improves performance by eliminating the need for a cache flush on rx and tx
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -357,7 +357,7 @@
|
||||
};
|
||||
|
||||
cci_control2: slave-if@5000 {
|
||||
- compatible = "arm,cci-400-ctrl-if";
|
||||
+ compatible = "arm,cci-400-ctrl-if", "syscon";
|
||||
interface-type = "ace";
|
||||
reg = <0x5000 0x1000>;
|
||||
};
|
||||
@@ -938,6 +938,8 @@
|
||||
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
|
||||
mediatek,ethsys = <ðsys>;
|
||||
mediatek,sgmiisys = <&sgmiisys>;
|
||||
+ mediatek,cci-control = <&cci_control2>;
|
||||
+ dma-coherent;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "disabled";
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 5 Feb 2022 18:36:36 +0100
|
||||
Subject: [PATCH] arm64: dts: mediatek: mt7622: introduce nodes for
|
||||
Wireless Ethernet Dispatch
|
||||
|
||||
Introduce wed0 and wed1 nodes in order to enable offloading forwarding
|
||||
between ethernet and wireless devices on the mt7622 chipset.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -894,6 +894,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ hifsys: syscon@1af00000 {
|
||||
+ compatible = "mediatek,mt7622-hifsys", "syscon";
|
||||
+ reg = <0 0x1af00000 0 0x70>;
|
||||
+ };
|
||||
+
|
||||
ethsys: syscon@1b000000 {
|
||||
compatible = "mediatek,mt7622-ethsys",
|
||||
"syscon";
|
||||
@@ -912,6 +917,26 @@
|
||||
#dma-cells = <1>;
|
||||
};
|
||||
|
||||
+ pcie_mirror: pcie-mirror@10000400 {
|
||||
+ compatible = "mediatek,mt7622-pcie-mirror",
|
||||
+ "syscon";
|
||||
+ reg = <0 0x10000400 0 0x10>;
|
||||
+ };
|
||||
+
|
||||
+ wed0: wed@1020a000 {
|
||||
+ compatible = "mediatek,mt7622-wed",
|
||||
+ "syscon";
|
||||
+ reg = <0 0x1020a000 0 0x1000>;
|
||||
+ interrupts = <GIC_SPI 214 IRQ_TYPE_LEVEL_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wed1: wed@1020b000 {
|
||||
+ compatible = "mediatek,mt7622-wed",
|
||||
+ "syscon";
|
||||
+ reg = <0 0x1020b000 0 0x1000>;
|
||||
+ interrupts = <GIC_SPI 215 IRQ_TYPE_LEVEL_LOW>;
|
||||
+ };
|
||||
+
|
||||
eth: ethernet@1b100000 {
|
||||
compatible = "mediatek,mt7622-eth",
|
||||
"mediatek,mt2701-eth",
|
||||
@@ -939,6 +964,9 @@
|
||||
mediatek,ethsys = <ðsys>;
|
||||
mediatek,sgmiisys = <&sgmiisys>;
|
||||
mediatek,cci-control = <&cci_control2>;
|
||||
+ mediatek,wed = <&wed0>, <&wed1>;
|
||||
+ mediatek,pcie-mirror = <&pcie_mirror>;
|
||||
+ mediatek,hifsys = <&hifsys>;
|
||||
dma-coherent;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
+1
-1
@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -957,7 +957,7 @@
|
||||
@@ -963,7 +963,7 @@
|
||||
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
|
||||
mediatek,ethsys = <ðsys>;
|
||||
mediatek,sgmiisys = <&sgmiisys>;
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
ax88179_reset(dev);
|
||||
|
||||
@@ -1502,17 +1503,19 @@ ax88179_tx_fixup(struct usbnet *dev, str
|
||||
@@ -1507,17 +1508,19 @@ ax88179_tx_fixup(struct usbnet *dev, str
|
||||
{
|
||||
u32 tx_hdr1, tx_hdr2;
|
||||
int frame_size = dev->maxpacket;
|
||||
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
if ((skb_header_cloned(skb) || headroom < 0) &&
|
||||
pskb_expand_head(skb, headroom < 0 ? 8 : 0, 0, GFP_ATOMIC)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
@@ -1523,6 +1526,8 @@ ax88179_tx_fixup(struct usbnet *dev, str
|
||||
@@ -1528,6 +1531,8 @@ ax88179_tx_fixup(struct usbnet *dev, str
|
||||
put_unaligned_le32(tx_hdr1, ptr);
|
||||
put_unaligned_le32(tx_hdr2, ptr + 4);
|
||||
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -2289,6 +2289,23 @@ struct btmtk_section_map {
|
||||
@@ -2287,6 +2287,23 @@ struct btmtk_section_map {
|
||||
};
|
||||
} __packed;
|
||||
|
||||
@@ -41,7 +41,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
static void btusb_mtk_wmt_recv(struct urb *urb)
|
||||
{
|
||||
struct hci_dev *hdev = urb->context;
|
||||
@@ -3943,6 +3960,7 @@ static int btusb_probe(struct usb_interf
|
||||
@@ -3941,6 +3958,7 @@ static int btusb_probe(struct usb_interf
|
||||
hdev->shutdown = btusb_mtk_shutdown;
|
||||
hdev->manufacturer = 70;
|
||||
hdev->cmd_timeout = btusb_mtk_cmd_timeout;
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -2294,7 +2294,7 @@ static int btusb_set_bdaddr_mtk(struct h
|
||||
@@ -2292,7 +2292,7 @@ static int btusb_set_bdaddr_mtk(struct h
|
||||
struct sk_buff *skb;
|
||||
long ret;
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -478,6 +478,9 @@ static const struct usb_device_id blackl
|
||||
@@ -476,6 +476,9 @@ static const struct usb_device_id blackl
|
||||
{ USB_DEVICE(0x13d3, 0x3564), .driver_info = BTUSB_MEDIATEK |
|
||||
BTUSB_WIDEBAND_SPEECH |
|
||||
BTUSB_VALID_LE_STATES },
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -469,6 +469,9 @@ static const struct usb_device_id blackl
|
||||
@@ -467,6 +467,9 @@ static const struct usb_device_id blackl
|
||||
BTUSB_VALID_LE_STATES },
|
||||
|
||||
/* Additional MediaTek MT7921 Bluetooth devices */
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
||||
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -487,6 +487,9 @@ static const struct usb_device_id blackl
|
||||
@@ -485,6 +485,9 @@ static const struct usb_device_id blackl
|
||||
{ USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK |
|
||||
BTUSB_WIDEBAND_SPEECH |
|
||||
BTUSB_VALID_LE_STATES },
|
||||
|
||||
+1
-1
@@ -1775,7 +1775,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
eth_hw_addr_inherit(slave_dev, master);
|
||||
--- a/net/ethernet/eth.c
|
||||
+++ b/net/ethernet/eth.c
|
||||
@@ -540,13 +540,14 @@ unsigned char * __weak arch_get_platform
|
||||
@@ -550,13 +550,14 @@ unsigned char * __weak arch_get_platform
|
||||
|
||||
int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr)
|
||||
{
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
From: Richard Gobert <richardbgobert@gmail.com>
|
||||
Date: Wed, 3 Jan 2024 15:44:21 +0100
|
||||
Subject: [PATCH] net: gro: parse ipv6 ext headers without frag0 invalidation
|
||||
|
||||
The existing code always pulls the IPv6 header and sets the transport
|
||||
offset initially. Then optionally again pulls any extension headers in
|
||||
ipv6_gso_pull_exthdrs and sets the transport offset again on return from
|
||||
that call. skb->data is set at the start of the first extension header
|
||||
before calling ipv6_gso_pull_exthdrs, and must disable the frag0
|
||||
optimization because that function uses pskb_may_pull/pskb_pull instead of
|
||||
skb_gro_ helpers. It sets the GRO offset to the TCP header with
|
||||
skb_gro_pull and sets the transport header. Then returns skb->data to its
|
||||
position before this block.
|
||||
|
||||
This commit introduces a new helper function - ipv6_gro_pull_exthdrs -
|
||||
which is used in ipv6_gro_receive to pull ipv6 ext headers instead of
|
||||
ipv6_gso_pull_exthdrs. Thus, there is no modification of skb->data, all
|
||||
operations use skb_gro_* helpers, and the frag0 fast path can be taken for
|
||||
IPv6 packets with ext headers.
|
||||
|
||||
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
|
||||
Reviewed-by: Willem de Bruijn <willemb@google.com>
|
||||
Reviewed-by: David Ahern <dsahern@kernel.org>
|
||||
Reviewed-by: Eric Dumazet <edumazet@google.com>
|
||||
Link: https://lore.kernel.org/r/504130f6-b56c-4dcc-882c-97942c59f5b7@gmail.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
|
||||
--- a/net/ipv6/ip6_offload.c
|
||||
+++ b/net/ipv6/ip6_offload.c
|
||||
@@ -36,6 +36,40 @@
|
||||
INDIRECT_CALL_L4(cb, f2, f1, head, skb); \
|
||||
})
|
||||
|
||||
+static int ipv6_gro_pull_exthdrs(struct sk_buff *skb, int off, int proto)
|
||||
+{
|
||||
+ const struct net_offload *ops = NULL;
|
||||
+ struct ipv6_opt_hdr *opth;
|
||||
+
|
||||
+ for (;;) {
|
||||
+ int len;
|
||||
+
|
||||
+ ops = rcu_dereference(inet6_offloads[proto]);
|
||||
+
|
||||
+ if (unlikely(!ops))
|
||||
+ break;
|
||||
+
|
||||
+ if (!(ops->flags & INET6_PROTO_GSO_EXTHDR))
|
||||
+ break;
|
||||
+
|
||||
+ opth = skb_gro_header(skb, off + sizeof(*opth), off);
|
||||
+ if (unlikely(!opth))
|
||||
+ break;
|
||||
+
|
||||
+ len = ipv6_optlen(opth);
|
||||
+
|
||||
+ opth = skb_gro_header(skb, off + len, off);
|
||||
+ if (unlikely(!opth))
|
||||
+ break;
|
||||
+ proto = opth->nexthdr;
|
||||
+
|
||||
+ off += len;
|
||||
+ }
|
||||
+
|
||||
+ skb_gro_pull(skb, off - skb_network_offset(skb));
|
||||
+ return proto;
|
||||
+}
|
||||
+
|
||||
static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
|
||||
{
|
||||
const struct net_offload *ops = NULL;
|
||||
@@ -224,28 +258,25 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
|
||||
goto out;
|
||||
|
||||
skb_set_network_header(skb, off);
|
||||
- skb_gro_pull(skb, sizeof(*iph));
|
||||
- skb_set_transport_header(skb, skb_gro_offset(skb));
|
||||
|
||||
- flush += ntohs(iph->payload_len) != skb_gro_len(skb);
|
||||
+ flush += ntohs(iph->payload_len) != skb->len - hlen;
|
||||
|
||||
proto = iph->nexthdr;
|
||||
ops = rcu_dereference(inet6_offloads[proto]);
|
||||
if (!ops || !ops->callbacks.gro_receive) {
|
||||
- pskb_pull(skb, skb_gro_offset(skb));
|
||||
- skb_gro_frag0_invalidate(skb);
|
||||
- proto = ipv6_gso_pull_exthdrs(skb, proto);
|
||||
- skb_gro_pull(skb, -skb_transport_offset(skb));
|
||||
- skb_reset_transport_header(skb);
|
||||
- __skb_push(skb, skb_gro_offset(skb));
|
||||
+ proto = ipv6_gro_pull_exthdrs(skb, hlen, proto);
|
||||
|
||||
ops = rcu_dereference(inet6_offloads[proto]);
|
||||
if (!ops || !ops->callbacks.gro_receive)
|
||||
goto out;
|
||||
|
||||
- iph = ipv6_hdr(skb);
|
||||
+ iph = skb_gro_network_header(skb);
|
||||
+ } else {
|
||||
+ skb_gro_pull(skb, sizeof(*iph));
|
||||
}
|
||||
|
||||
+ skb_set_transport_header(skb, skb_gro_offset(skb));
|
||||
+
|
||||
NAPI_GRO_CB(skb)->proto = proto;
|
||||
|
||||
flush--;
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
From: Richard Gobert <richardbgobert@gmail.com>
|
||||
Date: Tue, 30 Apr 2024 16:35:55 +0200
|
||||
Subject: [PATCH] net: gro: add flush check in udp_gro_receive_segment
|
||||
|
||||
GRO-GSO path is supposed to be transparent and as such L3 flush checks are
|
||||
relevant to all UDP flows merging in GRO. This patch uses the same logic
|
||||
and code from tcp_gro_receive, terminating merge if flush is non zero.
|
||||
|
||||
Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
|
||||
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
|
||||
Reviewed-by: Willem de Bruijn <willemb@google.com>
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
|
||||
--- a/net/ipv4/udp_offload.c
|
||||
+++ b/net/ipv4/udp_offload.c
|
||||
@@ -463,6 +463,7 @@ static struct sk_buff *udp_gro_receive_s
|
||||
struct sk_buff *p;
|
||||
unsigned int ulen;
|
||||
int ret = 0;
|
||||
+ int flush;
|
||||
|
||||
/* requires non zero csum, for symmetry with GSO */
|
||||
if (!uh->check) {
|
||||
@@ -496,13 +497,22 @@ static struct sk_buff *udp_gro_receive_s
|
||||
return p;
|
||||
}
|
||||
|
||||
+ flush = NAPI_GRO_CB(p)->flush;
|
||||
+
|
||||
+ if (NAPI_GRO_CB(p)->flush_id != 1 ||
|
||||
+ NAPI_GRO_CB(p)->count != 1 ||
|
||||
+ !NAPI_GRO_CB(p)->is_atomic)
|
||||
+ flush |= NAPI_GRO_CB(p)->flush_id;
|
||||
+ else
|
||||
+ NAPI_GRO_CB(p)->is_atomic = false;
|
||||
+
|
||||
/* Terminate the flow on len mismatch or if it grow "too much".
|
||||
* Under small packet flood GRO count could elsewhere grow a lot
|
||||
* leading to excessive truesize values.
|
||||
* On len mismatch merge the first packet shorter than gso_size,
|
||||
* otherwise complete the GRO packet.
|
||||
*/
|
||||
- if (ulen > ntohs(uh2->len)) {
|
||||
+ if (ulen > ntohs(uh2->len) || flush) {
|
||||
pp = p;
|
||||
} else {
|
||||
if (NAPI_GRO_CB(skb)->is_flist) {
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
From: Richard Gobert <richardbgobert@gmail.com>
|
||||
Date: Wed, 3 Jan 2024 15:44:21 +0100
|
||||
Subject: [PATCH] net: gro: parse ipv6 ext headers without frag0 invalidation
|
||||
|
||||
The existing code always pulls the IPv6 header and sets the transport
|
||||
offset initially. Then optionally again pulls any extension headers in
|
||||
ipv6_gso_pull_exthdrs and sets the transport offset again on return from
|
||||
that call. skb->data is set at the start of the first extension header
|
||||
before calling ipv6_gso_pull_exthdrs, and must disable the frag0
|
||||
optimization because that function uses pskb_may_pull/pskb_pull instead of
|
||||
skb_gro_ helpers. It sets the GRO offset to the TCP header with
|
||||
skb_gro_pull and sets the transport header. Then returns skb->data to its
|
||||
position before this block.
|
||||
|
||||
This commit introduces a new helper function - ipv6_gro_pull_exthdrs -
|
||||
which is used in ipv6_gro_receive to pull ipv6 ext headers instead of
|
||||
ipv6_gso_pull_exthdrs. Thus, there is no modification of skb->data, all
|
||||
operations use skb_gro_* helpers, and the frag0 fast path can be taken for
|
||||
IPv6 packets with ext headers.
|
||||
|
||||
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
|
||||
Reviewed-by: Willem de Bruijn <willemb@google.com>
|
||||
Reviewed-by: David Ahern <dsahern@kernel.org>
|
||||
Reviewed-by: Eric Dumazet <edumazet@google.com>
|
||||
Link: https://lore.kernel.org/r/504130f6-b56c-4dcc-882c-97942c59f5b7@gmail.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
|
||||
--- a/net/ipv6/ip6_offload.c
|
||||
+++ b/net/ipv6/ip6_offload.c
|
||||
@@ -37,6 +37,40 @@
|
||||
INDIRECT_CALL_L4(cb, f2, f1, head, skb); \
|
||||
})
|
||||
|
||||
+static int ipv6_gro_pull_exthdrs(struct sk_buff *skb, int off, int proto)
|
||||
+{
|
||||
+ const struct net_offload *ops = NULL;
|
||||
+ struct ipv6_opt_hdr *opth;
|
||||
+
|
||||
+ for (;;) {
|
||||
+ int len;
|
||||
+
|
||||
+ ops = rcu_dereference(inet6_offloads[proto]);
|
||||
+
|
||||
+ if (unlikely(!ops))
|
||||
+ break;
|
||||
+
|
||||
+ if (!(ops->flags & INET6_PROTO_GSO_EXTHDR))
|
||||
+ break;
|
||||
+
|
||||
+ opth = skb_gro_header(skb, off + sizeof(*opth), off);
|
||||
+ if (unlikely(!opth))
|
||||
+ break;
|
||||
+
|
||||
+ len = ipv6_optlen(opth);
|
||||
+
|
||||
+ opth = skb_gro_header(skb, off + len, off);
|
||||
+ if (unlikely(!opth))
|
||||
+ break;
|
||||
+ proto = opth->nexthdr;
|
||||
+
|
||||
+ off += len;
|
||||
+ }
|
||||
+
|
||||
+ skb_gro_pull(skb, off - skb_network_offset(skb));
|
||||
+ return proto;
|
||||
+}
|
||||
+
|
||||
static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
|
||||
{
|
||||
const struct net_offload *ops = NULL;
|
||||
@@ -206,28 +240,25 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
|
||||
goto out;
|
||||
|
||||
skb_set_network_header(skb, off);
|
||||
- skb_gro_pull(skb, sizeof(*iph));
|
||||
- skb_set_transport_header(skb, skb_gro_offset(skb));
|
||||
|
||||
- flush += ntohs(iph->payload_len) != skb_gro_len(skb);
|
||||
+ flush += ntohs(iph->payload_len) != skb->len - hlen;
|
||||
|
||||
proto = iph->nexthdr;
|
||||
ops = rcu_dereference(inet6_offloads[proto]);
|
||||
if (!ops || !ops->callbacks.gro_receive) {
|
||||
- pskb_pull(skb, skb_gro_offset(skb));
|
||||
- skb_gro_frag0_invalidate(skb);
|
||||
- proto = ipv6_gso_pull_exthdrs(skb, proto);
|
||||
- skb_gro_pull(skb, -skb_transport_offset(skb));
|
||||
- skb_reset_transport_header(skb);
|
||||
- __skb_push(skb, skb_gro_offset(skb));
|
||||
+ proto = ipv6_gro_pull_exthdrs(skb, hlen, proto);
|
||||
|
||||
ops = rcu_dereference(inet6_offloads[proto]);
|
||||
if (!ops || !ops->callbacks.gro_receive)
|
||||
goto out;
|
||||
|
||||
- iph = ipv6_hdr(skb);
|
||||
+ iph = skb_gro_network_header(skb);
|
||||
+ } else {
|
||||
+ skb_gro_pull(skb, sizeof(*iph));
|
||||
}
|
||||
|
||||
+ skb_set_transport_header(skb, skb_gro_offset(skb));
|
||||
+
|
||||
NAPI_GRO_CB(skb)->proto = proto;
|
||||
|
||||
flush--;
|
||||
+178
@@ -0,0 +1,178 @@
|
||||
From: Richard Gobert <richardbgobert@gmail.com>
|
||||
Date: Tue, 30 Apr 2024 16:35:54 +0200
|
||||
Subject: [PATCH] net: gro: fix udp bad offset in socket lookup by adding
|
||||
{inner_}network_offset to napi_gro_cb
|
||||
|
||||
Commits a602456 ("udp: Add GRO functions to UDP socket") and 57c67ff ("udp:
|
||||
additional GRO support") introduce incorrect usage of {ip,ipv6}_hdr in the
|
||||
complete phase of gro. The functions always return skb->network_header,
|
||||
which in the case of encapsulated packets at the gro complete phase, is
|
||||
always set to the innermost L3 of the packet. That means that calling
|
||||
{ip,ipv6}_hdr for skbs which completed the GRO receive phase (both in
|
||||
gro_list and *_gro_complete) when parsing an encapsulated packet's _outer_
|
||||
L3/L4 may return an unexpected value.
|
||||
|
||||
This incorrect usage leads to a bug in GRO's UDP socket lookup.
|
||||
udp{4,6}_lib_lookup_skb functions use ip_hdr/ipv6_hdr respectively. These
|
||||
*_hdr functions return network_header which will point to the innermost L3,
|
||||
resulting in the wrong offset being used in __udp{4,6}_lib_lookup with
|
||||
encapsulated packets.
|
||||
|
||||
This patch adds network_offset and inner_network_offset to napi_gro_cb, and
|
||||
makes sure both are set correctly.
|
||||
|
||||
To fix the issue, network_offsets union is used inside napi_gro_cb, in
|
||||
which both the outer and the inner network offsets are saved.
|
||||
|
||||
Reproduction example:
|
||||
|
||||
Endpoint configuration example (fou + local address bind)
|
||||
|
||||
# ip fou add port 6666 ipproto 4
|
||||
# ip link add name tun1 type ipip remote 2.2.2.1 local 2.2.2.2 encap fou encap-dport 5555 encap-sport 6666 mode ipip
|
||||
# ip link set tun1 up
|
||||
# ip a add 1.1.1.2/24 dev tun1
|
||||
|
||||
Netperf TCP_STREAM result on net-next before patch is applied:
|
||||
|
||||
net-next main, GRO enabled:
|
||||
$ netperf -H 1.1.1.2 -t TCP_STREAM -l 5
|
||||
Recv Send Send
|
||||
Socket Socket Message Elapsed
|
||||
Size Size Size Time Throughput
|
||||
bytes bytes bytes secs. 10^6bits/sec
|
||||
|
||||
131072 16384 16384 5.28 2.37
|
||||
|
||||
net-next main, GRO disabled:
|
||||
$ netperf -H 1.1.1.2 -t TCP_STREAM -l 5
|
||||
Recv Send Send
|
||||
Socket Socket Message Elapsed
|
||||
Size Size Size Time Throughput
|
||||
bytes bytes bytes secs. 10^6bits/sec
|
||||
|
||||
131072 16384 16384 5.01 2745.06
|
||||
|
||||
patch applied, GRO enabled:
|
||||
$ netperf -H 1.1.1.2 -t TCP_STREAM -l 5
|
||||
Recv Send Send
|
||||
Socket Socket Message Elapsed
|
||||
Size Size Size Time Throughput
|
||||
bytes bytes bytes secs. 10^6bits/sec
|
||||
|
||||
131072 16384 16384 5.01 2877.38
|
||||
|
||||
Fixes: a6024562ffd7 ("udp: Add GRO functions to UDP socket")
|
||||
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
|
||||
Reviewed-by: Eric Dumazet <edumazet@google.com>
|
||||
Reviewed-by: Willem de Bruijn <willemb@google.com>
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
|
||||
--- a/include/net/gro.h
|
||||
+++ b/include/net/gro.h
|
||||
@@ -86,6 +86,15 @@ struct napi_gro_cb {
|
||||
|
||||
/* used to support CHECKSUM_COMPLETE for tunneling protocols */
|
||||
__wsum csum;
|
||||
+
|
||||
+ /* L3 offsets */
|
||||
+ union {
|
||||
+ struct {
|
||||
+ u16 network_offset;
|
||||
+ u16 inner_network_offset;
|
||||
+ };
|
||||
+ u16 network_offsets[2];
|
||||
+ };
|
||||
};
|
||||
|
||||
#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
|
||||
--- a/net/8021q/vlan_core.c
|
||||
+++ b/net/8021q/vlan_core.c
|
||||
@@ -478,6 +478,8 @@ static struct sk_buff *vlan_gro_receive(
|
||||
if (unlikely(!vhdr))
|
||||
goto out;
|
||||
|
||||
+ NAPI_GRO_CB(skb)->network_offsets[NAPI_GRO_CB(skb)->encap_mark] = hlen;
|
||||
+
|
||||
type = vhdr->h_vlan_encapsulated_proto;
|
||||
|
||||
ptype = gro_find_receive_by_type(type);
|
||||
--- a/net/core/gro.c
|
||||
+++ b/net/core/gro.c
|
||||
@@ -373,6 +373,7 @@ static inline void skb_gro_reset_offset(
|
||||
const struct skb_shared_info *pinfo = skb_shinfo(skb);
|
||||
const skb_frag_t *frag0 = &pinfo->frags[0];
|
||||
|
||||
+ NAPI_GRO_CB(skb)->network_offset = 0;
|
||||
NAPI_GRO_CB(skb)->data_offset = 0;
|
||||
NAPI_GRO_CB(skb)->frag0 = NULL;
|
||||
NAPI_GRO_CB(skb)->frag0_len = 0;
|
||||
--- a/net/ipv4/af_inet.c
|
||||
+++ b/net/ipv4/af_inet.c
|
||||
@@ -1571,6 +1571,7 @@ struct sk_buff *inet_gro_receive(struct
|
||||
/* The above will be needed by the transport layer if there is one
|
||||
* immediately following this IP hdr.
|
||||
*/
|
||||
+ NAPI_GRO_CB(skb)->inner_network_offset = off;
|
||||
|
||||
/* Note : No need to call skb_gro_postpull_rcsum() here,
|
||||
* as we already checked checksum over ipv4 header was 0
|
||||
--- a/net/ipv4/udp.c
|
||||
+++ b/net/ipv4/udp.c
|
||||
@@ -534,7 +534,8 @@ static inline struct sock *__udp4_lib_lo
|
||||
struct sock *udp4_lib_lookup_skb(const struct sk_buff *skb,
|
||||
__be16 sport, __be16 dport)
|
||||
{
|
||||
- const struct iphdr *iph = ip_hdr(skb);
|
||||
+ const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation];
|
||||
+ const struct iphdr *iph = (struct iphdr *)(skb->data + offset);
|
||||
struct net *net = dev_net(skb->dev);
|
||||
int iif, sdif;
|
||||
|
||||
--- a/net/ipv4/udp_offload.c
|
||||
+++ b/net/ipv4/udp_offload.c
|
||||
@@ -718,7 +718,8 @@ EXPORT_SYMBOL(udp_gro_complete);
|
||||
|
||||
INDIRECT_CALLABLE_SCOPE int udp4_gro_complete(struct sk_buff *skb, int nhoff)
|
||||
{
|
||||
- const struct iphdr *iph = ip_hdr(skb);
|
||||
+ const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation];
|
||||
+ const struct iphdr *iph = (struct iphdr *)(skb->data + offset);
|
||||
struct udphdr *uh = (struct udphdr *)(skb->data + nhoff);
|
||||
|
||||
/* do fraglist only if there is no outer UDP encap (or we already processed it) */
|
||||
--- a/net/ipv6/ip6_offload.c
|
||||
+++ b/net/ipv6/ip6_offload.c
|
||||
@@ -240,6 +240,7 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
|
||||
goto out;
|
||||
|
||||
skb_set_network_header(skb, off);
|
||||
+ NAPI_GRO_CB(skb)->inner_network_offset = off;
|
||||
|
||||
flush += ntohs(iph->payload_len) != skb->len - hlen;
|
||||
|
||||
--- a/net/ipv6/udp.c
|
||||
+++ b/net/ipv6/udp.c
|
||||
@@ -275,7 +275,8 @@ static struct sock *__udp6_lib_lookup_sk
|
||||
struct sock *udp6_lib_lookup_skb(const struct sk_buff *skb,
|
||||
__be16 sport, __be16 dport)
|
||||
{
|
||||
- const struct ipv6hdr *iph = ipv6_hdr(skb);
|
||||
+ const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation];
|
||||
+ const struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + offset);
|
||||
struct net *net = dev_net(skb->dev);
|
||||
int iif, sdif;
|
||||
|
||||
--- a/net/ipv6/udp_offload.c
|
||||
+++ b/net/ipv6/udp_offload.c
|
||||
@@ -164,7 +164,8 @@ flush:
|
||||
|
||||
INDIRECT_CALLABLE_SCOPE int udp6_gro_complete(struct sk_buff *skb, int nhoff)
|
||||
{
|
||||
- const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
|
||||
+ const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation];
|
||||
+ const struct ipv6hdr *ipv6h = (struct ipv6hdr *)(skb->data + offset);
|
||||
struct udphdr *uh = (struct udphdr *)(skb->data + nhoff);
|
||||
|
||||
/* do fraglist only if there is no outer UDP encap (or we already processed it) */
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
From: Richard Gobert <richardbgobert@gmail.com>
|
||||
Date: Tue, 30 Apr 2024 16:35:55 +0200
|
||||
Subject: [PATCH] net: gro: add flush check in udp_gro_receive_segment
|
||||
|
||||
GRO-GSO path is supposed to be transparent and as such L3 flush checks are
|
||||
relevant to all UDP flows merging in GRO. This patch uses the same logic
|
||||
and code from tcp_gro_receive, terminating merge if flush is non zero.
|
||||
|
||||
Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
|
||||
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
|
||||
Reviewed-by: Willem de Bruijn <willemb@google.com>
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
|
||||
--- a/net/ipv4/udp_offload.c
|
||||
+++ b/net/ipv4/udp_offload.c
|
||||
@@ -471,6 +471,7 @@ static struct sk_buff *udp_gro_receive_s
|
||||
struct sk_buff *p;
|
||||
unsigned int ulen;
|
||||
int ret = 0;
|
||||
+ int flush;
|
||||
|
||||
/* requires non zero csum, for symmetry with GSO */
|
||||
if (!uh->check) {
|
||||
@@ -504,13 +505,22 @@ static struct sk_buff *udp_gro_receive_s
|
||||
return p;
|
||||
}
|
||||
|
||||
+ flush = NAPI_GRO_CB(p)->flush;
|
||||
+
|
||||
+ if (NAPI_GRO_CB(p)->flush_id != 1 ||
|
||||
+ NAPI_GRO_CB(p)->count != 1 ||
|
||||
+ !NAPI_GRO_CB(p)->is_atomic)
|
||||
+ flush |= NAPI_GRO_CB(p)->flush_id;
|
||||
+ else
|
||||
+ NAPI_GRO_CB(p)->is_atomic = false;
|
||||
+
|
||||
/* Terminate the flow on len mismatch or if it grow "too much".
|
||||
* Under small packet flood GRO count could elsewhere grow a lot
|
||||
* leading to excessive truesize values.
|
||||
* On len mismatch merge the first packet shorter than gso_size,
|
||||
* otherwise complete the GRO packet.
|
||||
*/
|
||||
- if (ulen > ntohs(uh2->len)) {
|
||||
+ if (ulen > ntohs(uh2->len) || flush) {
|
||||
pp = p;
|
||||
} else {
|
||||
if (NAPI_GRO_CB(skb)->is_flist) {
|
||||
@@ -1,82 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Fri, 7 Jul 2017 17:18:54 +0200
|
||||
Subject: bridge: only accept EAP locally
|
||||
|
||||
When bridging, do not forward EAP frames to other ports, only deliver
|
||||
them locally, regardless of the state.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
[add disable_eap_hack sysfs attribute]
|
||||
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
|
||||
---
|
||||
|
||||
--- a/net/bridge/br_input.c
|
||||
+++ b/net/bridge/br_input.c
|
||||
@@ -114,10 +114,14 @@ int br_handle_frame_finish(struct net *n
|
||||
}
|
||||
}
|
||||
|
||||
+ BR_INPUT_SKB_CB(skb)->brdev = br->dev;
|
||||
+
|
||||
+ if (skb->protocol == htons(ETH_P_PAE) && !br->disable_eap_hack)
|
||||
+ return br_pass_frame_up(skb);
|
||||
+
|
||||
if (state == BR_STATE_LEARNING)
|
||||
goto drop;
|
||||
|
||||
- BR_INPUT_SKB_CB(skb)->brdev = br->dev;
|
||||
BR_INPUT_SKB_CB(skb)->src_port_isolated = !!(p->flags & BR_ISOLATED);
|
||||
|
||||
if (IS_ENABLED(CONFIG_INET) &&
|
||||
--- a/net/bridge/br_private.h
|
||||
+++ b/net/bridge/br_private.h
|
||||
@@ -404,6 +404,8 @@ struct net_bridge {
|
||||
u16 group_fwd_mask;
|
||||
u16 group_fwd_mask_required;
|
||||
|
||||
+ bool disable_eap_hack;
|
||||
+
|
||||
/* STP */
|
||||
bridge_id designated_root;
|
||||
bridge_id bridge_id;
|
||||
--- a/net/bridge/br_sysfs_br.c
|
||||
+++ b/net/bridge/br_sysfs_br.c
|
||||
@@ -164,6 +164,30 @@ static ssize_t group_fwd_mask_store(stru
|
||||
}
|
||||
static DEVICE_ATTR_RW(group_fwd_mask);
|
||||
|
||||
+static ssize_t disable_eap_hack_show(struct device *d,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ struct net_bridge *br = to_bridge(d);
|
||||
+ return sprintf(buf, "%u\n", br->disable_eap_hack);
|
||||
+}
|
||||
+
|
||||
+static int set_disable_eap_hack(struct net_bridge *br, unsigned long val)
|
||||
+{
|
||||
+ br->disable_eap_hack = !!val;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static ssize_t disable_eap_hack_store(struct device *d,
|
||||
+ struct device_attribute *attr,
|
||||
+ const char *buf,
|
||||
+ size_t len)
|
||||
+{
|
||||
+ return store_bridge_parm(d, buf, len, set_disable_eap_hack);
|
||||
+}
|
||||
+static DEVICE_ATTR_RW(disable_eap_hack);
|
||||
+
|
||||
static ssize_t priority_show(struct device *d, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
@@ -849,6 +873,7 @@ static struct attribute *bridge_attrs[]
|
||||
&dev_attr_ageing_time.attr,
|
||||
&dev_attr_stp_state.attr,
|
||||
&dev_attr_group_fwd_mask.attr,
|
||||
+ &dev_attr_disable_eap_hack.attr,
|
||||
&dev_attr_priority.attr,
|
||||
&dev_attr_bridge_id.attr,
|
||||
&dev_attr_root_id.attr,
|
||||
@@ -11,7 +11,7 @@ Submitted-by: Yousong Zhou <yszhou4tech@gmail.com>
|
||||
|
||||
--- a/net/ethernet/eth.c
|
||||
+++ b/net/ethernet/eth.c
|
||||
@@ -528,6 +528,63 @@ int eth_platform_get_mac_address(struct
|
||||
@@ -538,6 +538,63 @@ int eth_platform_get_mac_address(struct
|
||||
}
|
||||
EXPORT_SYMBOL(eth_platform_get_mac_address);
|
||||
|
||||
@@ -75,7 +75,7 @@ Submitted-by: Yousong Zhou <yszhou4tech@gmail.com>
|
||||
/**
|
||||
* nvmem_get_mac_address - Obtain the MAC address from an nvmem cell named
|
||||
* 'mac-address' associated with given device.
|
||||
@@ -541,19 +598,23 @@ int nvmem_get_mac_address(struct device
|
||||
@@ -551,19 +608,23 @@ int nvmem_get_mac_address(struct device
|
||||
{
|
||||
struct nvmem_cell *cell;
|
||||
const void *mac;
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Fri, 7 Jul 2017 17:18:54 +0200
|
||||
Subject: bridge: only accept EAP locally
|
||||
|
||||
When bridging, do not forward EAP frames to other ports, only deliver
|
||||
them locally, regardless of the state.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
[add disable_eap_hack sysfs attribute]
|
||||
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
|
||||
---
|
||||
|
||||
--- a/net/bridge/br_input.c
|
||||
+++ b/net/bridge/br_input.c
|
||||
@@ -121,10 +121,14 @@ int br_handle_frame_finish(struct net *n
|
||||
}
|
||||
}
|
||||
|
||||
+ BR_INPUT_SKB_CB(skb)->brdev = br->dev;
|
||||
+
|
||||
+ if (skb->protocol == htons(ETH_P_PAE) && !br->disable_eap_hack)
|
||||
+ return br_pass_frame_up(skb);
|
||||
+
|
||||
if (state == BR_STATE_LEARNING)
|
||||
goto drop;
|
||||
|
||||
- BR_INPUT_SKB_CB(skb)->brdev = br->dev;
|
||||
BR_INPUT_SKB_CB(skb)->src_port_isolated = !!(p->flags & BR_ISOLATED);
|
||||
|
||||
if (IS_ENABLED(CONFIG_INET) &&
|
||||
--- a/net/bridge/br_private.h
|
||||
+++ b/net/bridge/br_private.h
|
||||
@@ -483,6 +483,8 @@ struct net_bridge {
|
||||
u16 group_fwd_mask;
|
||||
u16 group_fwd_mask_required;
|
||||
|
||||
+ bool disable_eap_hack;
|
||||
+
|
||||
/* STP */
|
||||
bridge_id designated_root;
|
||||
bridge_id bridge_id;
|
||||
--- a/net/bridge/br_sysfs_br.c
|
||||
+++ b/net/bridge/br_sysfs_br.c
|
||||
@@ -198,6 +198,31 @@ static ssize_t group_fwd_mask_store(stru
|
||||
}
|
||||
static DEVICE_ATTR_RW(group_fwd_mask);
|
||||
|
||||
+static ssize_t disable_eap_hack_show(struct device *d,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ struct net_bridge *br = to_bridge(d);
|
||||
+ return sprintf(buf, "%u\n", br->disable_eap_hack);
|
||||
+}
|
||||
+
|
||||
+static int set_disable_eap_hack(struct net_bridge *br, unsigned long val,
|
||||
+ struct netlink_ext_ack *extack)
|
||||
+{
|
||||
+ br->disable_eap_hack = !!val;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static ssize_t disable_eap_hack_store(struct device *d,
|
||||
+ struct device_attribute *attr,
|
||||
+ const char *buf,
|
||||
+ size_t len)
|
||||
+{
|
||||
+ return store_bridge_parm(d, buf, len, set_disable_eap_hack);
|
||||
+}
|
||||
+static DEVICE_ATTR_RW(disable_eap_hack);
|
||||
+
|
||||
static ssize_t priority_show(struct device *d, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
@@ -970,6 +995,7 @@ static struct attribute *bridge_attrs[]
|
||||
&dev_attr_ageing_time.attr,
|
||||
&dev_attr_stp_state.attr,
|
||||
&dev_attr_group_fwd_mask.attr,
|
||||
+ &dev_attr_disable_eap_hack.attr,
|
||||
&dev_attr_priority.attr,
|
||||
&dev_attr_bridge_id.attr,
|
||||
&dev_attr_root_id.attr,
|
||||
@@ -1,82 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Fri, 7 Jul 2017 17:18:54 +0200
|
||||
Subject: bridge: only accept EAP locally
|
||||
|
||||
When bridging, do not forward EAP frames to other ports, only deliver
|
||||
them locally, regardless of the state.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
[add disable_eap_hack sysfs attribute]
|
||||
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
|
||||
---
|
||||
|
||||
--- a/net/bridge/br_input.c
|
||||
+++ b/net/bridge/br_input.c
|
||||
@@ -110,10 +110,14 @@ int br_handle_frame_finish(struct net *n
|
||||
}
|
||||
}
|
||||
|
||||
+ BR_INPUT_SKB_CB(skb)->brdev = br->dev;
|
||||
+
|
||||
+ if (skb->protocol == htons(ETH_P_PAE) && !br->disable_eap_hack)
|
||||
+ return br_pass_frame_up(skb);
|
||||
+
|
||||
if (p->state == BR_STATE_LEARNING)
|
||||
goto drop;
|
||||
|
||||
- BR_INPUT_SKB_CB(skb)->brdev = br->dev;
|
||||
BR_INPUT_SKB_CB(skb)->src_port_isolated = !!(p->flags & BR_ISOLATED);
|
||||
|
||||
if (IS_ENABLED(CONFIG_INET) &&
|
||||
--- a/net/bridge/br_private.h
|
||||
+++ b/net/bridge/br_private.h
|
||||
@@ -345,6 +345,8 @@ struct net_bridge {
|
||||
u16 group_fwd_mask;
|
||||
u16 group_fwd_mask_required;
|
||||
|
||||
+ bool disable_eap_hack;
|
||||
+
|
||||
/* STP */
|
||||
bridge_id designated_root;
|
||||
bridge_id bridge_id;
|
||||
--- a/net/bridge/br_sysfs_br.c
|
||||
+++ b/net/bridge/br_sysfs_br.c
|
||||
@@ -166,6 +166,30 @@ static ssize_t group_fwd_mask_store(stru
|
||||
}
|
||||
static DEVICE_ATTR_RW(group_fwd_mask);
|
||||
|
||||
+static ssize_t disable_eap_hack_show(struct device *d,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ struct net_bridge *br = to_bridge(d);
|
||||
+ return sprintf(buf, "%u\n", br->disable_eap_hack);
|
||||
+}
|
||||
+
|
||||
+static int set_disable_eap_hack(struct net_bridge *br, unsigned long val)
|
||||
+{
|
||||
+ br->disable_eap_hack = !!val;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static ssize_t disable_eap_hack_store(struct device *d,
|
||||
+ struct device_attribute *attr,
|
||||
+ const char *buf,
|
||||
+ size_t len)
|
||||
+{
|
||||
+ return store_bridge_parm(d, buf, len, set_disable_eap_hack);
|
||||
+}
|
||||
+static DEVICE_ATTR_RW(disable_eap_hack);
|
||||
+
|
||||
static ssize_t priority_show(struct device *d, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
@@ -851,6 +875,7 @@ static struct attribute *bridge_attrs[]
|
||||
&dev_attr_ageing_time.attr,
|
||||
&dev_attr_stp_state.attr,
|
||||
&dev_attr_group_fwd_mask.attr,
|
||||
+ &dev_attr_disable_eap_hack.attr,
|
||||
&dev_attr_priority.attr,
|
||||
&dev_attr_bridge_id.attr,
|
||||
&dev_attr_root_id.attr,
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/usb/serial/option.c
|
||||
+++ b/drivers/usb/serial/option.c
|
||||
@@ -282,6 +282,7 @@ static void option_instat_callback(struc
|
||||
@@ -278,6 +278,7 @@ static void option_instat_callback(struc
|
||||
#define QUECTEL_PRODUCT_EM061K_LWW 0x6008
|
||||
#define QUECTEL_PRODUCT_EM061K_LCN 0x6009
|
||||
#define QUECTEL_PRODUCT_EC200T 0x6026
|
||||
@@ -8,7 +8,7 @@
|
||||
#define QUECTEL_PRODUCT_RM500K 0x7001
|
||||
|
||||
#define CMOTECH_VENDOR_ID 0x16d8
|
||||
@@ -1267,6 +1268,7 @@ static const struct usb_device_id option
|
||||
@@ -1251,6 +1252,7 @@ static const struct usb_device_id option
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 23 Apr 2024 12:35:21 +0200
|
||||
Subject: [PATCH] net: enable fraglist GRO by default
|
||||
|
||||
This can significantly improve performance for packet forwarding/bridging
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/linux/netdev_features.h
|
||||
+++ b/include/linux/netdev_features.h
|
||||
@@ -242,10 +242,10 @@ static inline int find_next_netdev_featu
|
||||
#define NETIF_F_UPPER_DISABLES NETIF_F_LRO
|
||||
|
||||
/* changeable features with no special hardware requirements */
|
||||
-#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
|
||||
+#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO | NETIF_F_GRO_FRAGLIST)
|
||||
|
||||
/* Changeable features with no special hardware requirements that defaults to off. */
|
||||
-#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UDP_FWD)
|
||||
+#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_UDP_FWD)
|
||||
|
||||
#define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \
|
||||
NETIF_F_HW_VLAN_CTAG_RX | \
|
||||
@@ -11,7 +11,7 @@ Submitted-by: Yousong Zhou <yszhou4tech@gmail.com>
|
||||
|
||||
--- a/net/ethernet/eth.c
|
||||
+++ b/net/ethernet/eth.c
|
||||
@@ -531,6 +531,63 @@ int eth_platform_get_mac_address(struct
|
||||
@@ -521,6 +521,63 @@ int eth_platform_get_mac_address(struct
|
||||
}
|
||||
EXPORT_SYMBOL(eth_platform_get_mac_address);
|
||||
|
||||
@@ -75,7 +75,7 @@ Submitted-by: Yousong Zhou <yszhou4tech@gmail.com>
|
||||
/**
|
||||
* platform_get_ethdev_address - Set netdev's MAC address from a given device
|
||||
* @dev: Pointer to the device
|
||||
@@ -564,19 +621,23 @@ int nvmem_get_mac_address(struct device
|
||||
@@ -554,19 +611,23 @@ int nvmem_get_mac_address(struct device
|
||||
{
|
||||
struct nvmem_cell *cell;
|
||||
const void *mac;
|
||||
|
||||
@@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
static void sock_def_write_space_wfree(struct sock *sk);
|
||||
static void sock_def_write_space(struct sock *sk);
|
||||
@@ -585,6 +587,18 @@ discard_and_relse:
|
||||
@@ -586,6 +588,18 @@ discard_and_relse:
|
||||
}
|
||||
EXPORT_SYMBOL(__sk_receive_skb);
|
||||
|
||||
@@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *,
|
||||
u32));
|
||||
INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *,
|
||||
@@ -2188,9 +2202,11 @@ static void __sk_free(struct sock *sk)
|
||||
@@ -2189,9 +2203,11 @@ static void __sk_free(struct sock *sk)
|
||||
if (likely(sk->sk_net_refcnt))
|
||||
sock_inuse_add(sock_net(sk), -1);
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/core/sock.c
|
||||
+++ b/net/core/sock.c
|
||||
@@ -4114,6 +4114,8 @@ static __net_initdata struct pernet_oper
|
||||
@@ -4115,6 +4115,8 @@ static __net_initdata struct pernet_oper
|
||||
|
||||
static int __init proto_init(void)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 23 Apr 2024 12:35:21 +0200
|
||||
Subject: [PATCH] net: enable fraglist GRO by default
|
||||
|
||||
This can significantly improve performance for packet forwarding/bridging
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/linux/netdev_features.h
|
||||
+++ b/include/linux/netdev_features.h
|
||||
@@ -242,10 +242,10 @@ static inline int find_next_netdev_featu
|
||||
#define NETIF_F_UPPER_DISABLES NETIF_F_LRO
|
||||
|
||||
/* changeable features with no special hardware requirements */
|
||||
-#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
|
||||
+#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO | NETIF_F_GRO_FRAGLIST)
|
||||
|
||||
/* Changeable features with no special hardware requirements that defaults to off. */
|
||||
-#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UDP_FWD)
|
||||
+#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_UDP_FWD)
|
||||
|
||||
#define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \
|
||||
NETIF_F_HW_VLAN_CTAG_RX | \
|
||||
+1
-1
@@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -3305,6 +3305,9 @@ static int mv88e6xxx_setup_port(struct m
|
||||
@@ -3353,6 +3353,9 @@ static int mv88e6xxx_setup_port(struct m
|
||||
else
|
||||
reg = 1 << port;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
static void sock_def_write_space_wfree(struct sock *sk);
|
||||
static void sock_def_write_space(struct sock *sk);
|
||||
@@ -589,6 +591,21 @@ discard_and_relse:
|
||||
@@ -590,6 +592,21 @@ discard_and_relse:
|
||||
}
|
||||
EXPORT_SYMBOL(__sk_receive_skb);
|
||||
|
||||
@@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *,
|
||||
u32));
|
||||
INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *,
|
||||
@@ -2246,9 +2263,11 @@ static void __sk_free(struct sock *sk)
|
||||
@@ -2247,9 +2264,11 @@ static void __sk_free(struct sock *sk)
|
||||
if (likely(sk->sk_net_refcnt))
|
||||
sock_inuse_add(sock_net(sk), -1);
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/core/sock.c
|
||||
+++ b/net/core/sock.c
|
||||
@@ -4144,6 +4144,8 @@ static __net_initdata struct pernet_oper
|
||||
@@ -4145,6 +4145,8 @@ static __net_initdata struct pernet_oper
|
||||
|
||||
static int __init proto_init(void)
|
||||
{
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
for (i = sizeof(struct ipt_entry);
|
||||
i < e->target_offset;
|
||||
i += m->u.match_size) {
|
||||
@@ -1226,12 +1263,15 @@ compat_copy_entry_to_user(struct ipt_ent
|
||||
@@ -1224,12 +1261,15 @@ compat_copy_entry_to_user(struct ipt_ent
|
||||
compat_uint_t origsize;
|
||||
const struct xt_entry_match *ematch;
|
||||
int ret = 0;
|
||||
|
||||
+4
-4
@@ -136,9 +136,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
/**
|
||||
* eth_type_trans - determine the packet's protocol ID.
|
||||
* @skb: received socket data
|
||||
@@ -426,6 +438,10 @@ struct sk_buff *eth_gro_receive(struct l
|
||||
NAPI_GRO_CB(p)->same_flow = 0;
|
||||
continue;
|
||||
@@ -174,6 +186,10 @@ __be16 eth_type_trans(struct sk_buff *sk
|
||||
} else {
|
||||
skb->pkt_type = PACKET_OTHERHOST;
|
||||
}
|
||||
+
|
||||
+ if (eth_check_local_mask(eth->h_dest, dev->dev_addr,
|
||||
@@ -146,4 +146,4 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+ skb->gro_skip = 1;
|
||||
}
|
||||
|
||||
type = eh->h_proto;
|
||||
/*
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Mon, 7 Feb 2022 10:27:22 +0100
|
||||
Subject: [PATCH] arm64: dts: mediatek: mt7622: add support for coherent
|
||||
DMA
|
||||
|
||||
It improves performance by eliminating the need for a cache flush on rx and tx
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -357,7 +357,7 @@
|
||||
};
|
||||
|
||||
cci_control2: slave-if@5000 {
|
||||
- compatible = "arm,cci-400-ctrl-if";
|
||||
+ compatible = "arm,cci-400-ctrl-if", "syscon";
|
||||
interface-type = "ace";
|
||||
reg = <0x5000 0x1000>;
|
||||
};
|
||||
@@ -937,6 +937,8 @@
|
||||
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
|
||||
mediatek,ethsys = <ðsys>;
|
||||
mediatek,sgmiisys = <&sgmiisys>;
|
||||
+ mediatek,cci-control = <&cci_control2>;
|
||||
+ dma-coherent;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "disabled";
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 5 Feb 2022 18:36:36 +0100
|
||||
Subject: [PATCH] arm64: dts: mediatek: mt7622: introduce nodes for
|
||||
Wireless Ethernet Dispatch
|
||||
|
||||
Introduce wed0 and wed1 nodes in order to enable offloading forwarding
|
||||
between ethernet and wireless devices on the mt7622 chipset.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -893,6 +893,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ hifsys: syscon@1af00000 {
|
||||
+ compatible = "mediatek,mt7622-hifsys", "syscon";
|
||||
+ reg = <0 0x1af00000 0 0x70>;
|
||||
+ };
|
||||
+
|
||||
ethsys: syscon@1b000000 {
|
||||
compatible = "mediatek,mt7622-ethsys",
|
||||
"syscon";
|
||||
@@ -911,6 +916,26 @@
|
||||
#dma-cells = <1>;
|
||||
};
|
||||
|
||||
+ pcie_mirror: pcie-mirror@10000400 {
|
||||
+ compatible = "mediatek,mt7622-pcie-mirror",
|
||||
+ "syscon";
|
||||
+ reg = <0 0x10000400 0 0x10>;
|
||||
+ };
|
||||
+
|
||||
+ wed0: wed@1020a000 {
|
||||
+ compatible = "mediatek,mt7622-wed",
|
||||
+ "syscon";
|
||||
+ reg = <0 0x1020a000 0 0x1000>;
|
||||
+ interrupts = <GIC_SPI 214 IRQ_TYPE_LEVEL_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wed1: wed@1020b000 {
|
||||
+ compatible = "mediatek,mt7622-wed",
|
||||
+ "syscon";
|
||||
+ reg = <0 0x1020b000 0 0x1000>;
|
||||
+ interrupts = <GIC_SPI 215 IRQ_TYPE_LEVEL_LOW>;
|
||||
+ };
|
||||
+
|
||||
eth: ethernet@1b100000 {
|
||||
compatible = "mediatek,mt7622-eth",
|
||||
"mediatek,mt2701-eth",
|
||||
@@ -938,6 +963,9 @@
|
||||
mediatek,ethsys = <ðsys>;
|
||||
mediatek,sgmiisys = <&sgmiisys>;
|
||||
mediatek,cci-control = <&cci_control2>;
|
||||
+ mediatek,wed = <&wed0>, <&wed1>;
|
||||
+ mediatek,pcie-mirror = <&pcie_mirror>;
|
||||
+ mediatek,hifsys = <&hifsys>;
|
||||
dma-coherent;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
|
||||
/*
|
||||
* We need to store the untouched command line for future reference.
|
||||
* We also need to store the touched command line since the parameter
|
||||
@@ -868,6 +891,7 @@ asmlinkage __visible void __init __no_sa
|
||||
@@ -866,6 +889,7 @@ asmlinkage __visible void __init __no_sa
|
||||
pr_notice("%s", linux_banner);
|
||||
early_security_init();
|
||||
setup_arch(&command_line);
|
||||
|
||||
+4
-4
@@ -136,9 +136,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
/**
|
||||
* eth_type_trans - determine the packet's protocol ID.
|
||||
* @skb: received socket data
|
||||
@@ -421,6 +433,10 @@ struct sk_buff *eth_gro_receive(struct l
|
||||
NAPI_GRO_CB(p)->same_flow = 0;
|
||||
continue;
|
||||
@@ -173,6 +185,10 @@ __be16 eth_type_trans(struct sk_buff *sk
|
||||
} else {
|
||||
skb->pkt_type = PACKET_OTHERHOST;
|
||||
}
|
||||
+
|
||||
+ if (eth_check_local_mask(eth->h_dest, dev->dev_addr,
|
||||
@@ -146,4 +146,4 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+ skb->gro_skip = 1;
|
||||
}
|
||||
|
||||
type = eh->h_proto;
|
||||
/*
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/drivers/net/usb/qmi_wwan.c
|
||||
+++ b/drivers/net/usb/qmi_wwan.c
|
||||
@@ -1420,6 +1420,9 @@ static const struct usb_device_id produc
|
||||
{QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
|
||||
@@ -1431,6 +1431,9 @@ static const struct usb_device_id produc
|
||||
{QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
|
||||
{QMI_QUIRK_SET_DTR(0x1546, 0x1312, 4)}, /* u-blox LARA-R6 01B */
|
||||
{QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
|
||||
+ {QMI_FIXED_INTF(0x2077, 0x2002, 4)}, /* T&W TW04C */
|
||||
+ {QMI_FIXED_INTF(0x2077, 0x2003, 4)}, /* T&W TW12G */
|
||||
|
||||
+3
-3
@@ -506,7 +506,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
+MODULE_ALIAS("nf-flow-table-hw");
|
||||
--- a/net/netfilter/nf_tables_api.c
|
||||
+++ b/net/netfilter/nf_tables_api.c
|
||||
@@ -6045,6 +6045,13 @@ static int nf_tables_flowtable_parse_hoo
|
||||
@@ -6041,6 +6041,13 @@ static int nf_tables_flowtable_parse_hoo
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@@ -520,7 +520,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
ops = kcalloc(n, sizeof(struct nf_hook_ops), GFP_KERNEL);
|
||||
if (!ops)
|
||||
return -ENOMEM;
|
||||
@@ -6194,10 +6201,19 @@ static int nf_tables_newflowtable(struct
|
||||
@@ -6190,10 +6197,19 @@ static int nf_tables_newflowtable(struct
|
||||
}
|
||||
|
||||
flowtable->data.type = type;
|
||||
@@ -540,7 +540,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK],
|
||||
flowtable);
|
||||
if (err < 0)
|
||||
@@ -6323,7 +6339,8 @@ static int nf_tables_fill_flowtable_info
|
||||
@@ -6319,7 +6335,8 @@ static int nf_tables_fill_flowtable_info
|
||||
nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) ||
|
||||
nla_put_be32(skb, NFTA_FLOWTABLE_USE, htonl(flowtable->use)) ||
|
||||
nla_put_be64(skb, NFTA_FLOWTABLE_HANDLE, cpu_to_be64(flowtable->handle),
|
||||
|
||||
+4
-4
@@ -136,9 +136,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
/**
|
||||
* eth_type_trans - determine the packet's protocol ID.
|
||||
* @skb: received socket data
|
||||
@@ -470,6 +482,10 @@ struct sk_buff *eth_gro_receive(struct l
|
||||
NAPI_GRO_CB(p)->same_flow = 0;
|
||||
continue;
|
||||
@@ -174,6 +186,10 @@ __be16 eth_type_trans(struct sk_buff *sk
|
||||
} else {
|
||||
skb->pkt_type = PACKET_OTHERHOST;
|
||||
}
|
||||
+
|
||||
+ if (eth_check_local_mask(eth->h_dest, dev->dev_addr,
|
||||
@@ -146,4 +146,4 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+ skb->gro_skip = 1;
|
||||
}
|
||||
|
||||
type = eh->h_proto;
|
||||
/*
|
||||
|
||||
-151
@@ -1,151 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Subject: net: replace GRO optimization patch with a new one that supports VLANs/bridges with different MAC addresses
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
include/linux/netdevice.h | 2 ++
|
||||
include/linux/skbuff.h | 3 ++-
|
||||
net/core/dev.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
net/ethernet/eth.c | 18 +++++++++++++++++-
|
||||
4 files changed, 69 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/include/linux/netdevice.h
|
||||
+++ b/include/linux/netdevice.h
|
||||
@@ -2135,6 +2135,8 @@ struct net_device {
|
||||
struct netdev_hw_addr_list mc;
|
||||
struct netdev_hw_addr_list dev_addrs;
|
||||
|
||||
+ unsigned char local_addr_mask[MAX_ADDR_LEN];
|
||||
+
|
||||
#ifdef CONFIG_SYSFS
|
||||
struct kset *queues_kset;
|
||||
#endif
|
||||
--- a/include/linux/skbuff.h
|
||||
+++ b/include/linux/skbuff.h
|
||||
@@ -967,6 +967,7 @@ struct sk_buff {
|
||||
#ifdef CONFIG_IPV6_NDISC_NODETYPE
|
||||
__u8 ndisc_nodetype:2;
|
||||
#endif
|
||||
+ __u8 gro_skip:1;
|
||||
|
||||
__u8 ipvs_property:1;
|
||||
__u8 inner_protocol_type:1;
|
||||
--- a/net/core/gro.c
|
||||
+++ b/net/core/gro.c
|
||||
@@ -492,6 +492,9 @@ static enum gro_result dev_gro_receive(s
|
||||
int same_flow;
|
||||
int grow;
|
||||
|
||||
+ if (skb->gro_skip)
|
||||
+ goto normal;
|
||||
+
|
||||
if (netif_elide_gro(skb->dev))
|
||||
goto normal;
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -7643,6 +7643,48 @@ static void __netdev_adjacent_dev_unlink
|
||||
&upper_dev->adj_list.lower);
|
||||
}
|
||||
|
||||
+static void __netdev_addr_mask(unsigned char *mask, const unsigned char *addr,
|
||||
+ struct net_device *dev)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < dev->addr_len; i++)
|
||||
+ mask[i] |= addr[i] ^ dev->dev_addr[i];
|
||||
+}
|
||||
+
|
||||
+static void __netdev_upper_mask(unsigned char *mask, struct net_device *dev,
|
||||
+ struct net_device *lower)
|
||||
+{
|
||||
+ struct net_device *cur;
|
||||
+ struct list_head *iter;
|
||||
+
|
||||
+ netdev_for_each_upper_dev_rcu(dev, cur, iter) {
|
||||
+ __netdev_addr_mask(mask, cur->dev_addr, lower);
|
||||
+ __netdev_upper_mask(mask, cur, lower);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void __netdev_update_addr_mask(struct net_device *dev)
|
||||
+{
|
||||
+ unsigned char mask[MAX_ADDR_LEN];
|
||||
+ struct net_device *cur;
|
||||
+ struct list_head *iter;
|
||||
+
|
||||
+ memset(mask, 0, sizeof(mask));
|
||||
+ __netdev_upper_mask(mask, dev, dev);
|
||||
+ memcpy(dev->local_addr_mask, mask, dev->addr_len);
|
||||
+
|
||||
+ netdev_for_each_lower_dev(dev, cur, iter)
|
||||
+ __netdev_update_addr_mask(cur);
|
||||
+}
|
||||
+
|
||||
+static void netdev_update_addr_mask(struct net_device *dev)
|
||||
+{
|
||||
+ rcu_read_lock();
|
||||
+ __netdev_update_addr_mask(dev);
|
||||
+ rcu_read_unlock();
|
||||
+}
|
||||
+
|
||||
static int __netdev_upper_dev_link(struct net_device *dev,
|
||||
struct net_device *upper_dev, bool master,
|
||||
void *upper_priv, void *upper_info,
|
||||
@@ -7694,6 +7736,7 @@ static int __netdev_upper_dev_link(struc
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ netdev_update_addr_mask(dev);
|
||||
ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
|
||||
&changeupper_info.info);
|
||||
ret = notifier_to_errno(ret);
|
||||
@@ -7790,6 +7833,7 @@ static void __netdev_upper_dev_unlink(st
|
||||
|
||||
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
|
||||
|
||||
+ netdev_update_addr_mask(dev);
|
||||
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
|
||||
&changeupper_info.info);
|
||||
|
||||
@@ -8842,6 +8886,7 @@ int dev_set_mac_address(struct net_devic
|
||||
if (err)
|
||||
return err;
|
||||
dev->addr_assign_type = NET_ADDR_SET;
|
||||
+ netdev_update_addr_mask(dev);
|
||||
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
|
||||
add_device_randomness(dev->dev_addr, dev->addr_len);
|
||||
return 0;
|
||||
--- a/net/ethernet/eth.c
|
||||
+++ b/net/ethernet/eth.c
|
||||
@@ -143,6 +143,18 @@ u32 eth_get_headlen(const struct net_dev
|
||||
}
|
||||
EXPORT_SYMBOL(eth_get_headlen);
|
||||
|
||||
+static inline bool
|
||||
+eth_check_local_mask(const void *addr1, const void *addr2, const void *mask)
|
||||
+{
|
||||
+ const u16 *a1 = addr1;
|
||||
+ const u16 *a2 = addr2;
|
||||
+ const u16 *m = mask;
|
||||
+
|
||||
+ return (((a1[0] ^ a2[0]) & ~m[0]) |
|
||||
+ ((a1[1] ^ a2[1]) & ~m[1]) |
|
||||
+ ((a1[2] ^ a2[2]) & ~m[2]));
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* eth_type_trans - determine the packet's protocol ID.
|
||||
* @skb: received socket data
|
||||
@@ -174,6 +186,10 @@ __be16 eth_type_trans(struct sk_buff *sk
|
||||
} else {
|
||||
skb->pkt_type = PACKET_OTHERHOST;
|
||||
}
|
||||
+
|
||||
+ if (eth_check_local_mask(eth->h_dest, dev->dev_addr,
|
||||
+ dev->local_addr_mask))
|
||||
+ skb->gro_skip = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -0,0 +1,627 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 23 Apr 2024 11:23:03 +0200
|
||||
Subject: [PATCH] net: add TCP fraglist GRO support
|
||||
|
||||
When forwarding TCP after GRO, software segmentation is very expensive,
|
||||
especially when the checksum needs to be recalculated.
|
||||
One case where that's currently unavoidable is when routing packets over
|
||||
PPPoE. Performance improves significantly when using fraglist GRO
|
||||
implemented in the same way as for UDP.
|
||||
|
||||
Here's a measurement of running 2 TCP streams through a MediaTek MT7622
|
||||
device (2-core Cortex-A53), which runs NAT with flow offload enabled from
|
||||
one ethernet port to PPPoE on another ethernet port + cake qdisc set to
|
||||
1Gbps.
|
||||
|
||||
rx-gro-list off: 630 Mbit/s, CPU 35% idle
|
||||
rx-gro-list on: 770 Mbit/s, CPU 40% idle
|
||||
|
||||
Signe-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/net/gro.h
|
||||
+++ b/include/net/gro.h
|
||||
@@ -424,6 +424,7 @@ static inline __wsum ip6_gro_compute_pse
|
||||
}
|
||||
|
||||
int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb);
|
||||
+int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb);
|
||||
|
||||
/* Pass the currently batched GRO_NORMAL SKBs up to the stack. */
|
||||
static inline void gro_normal_list(struct napi_struct *napi)
|
||||
@@ -446,5 +447,48 @@ static inline void gro_normal_one(struct
|
||||
gro_normal_list(napi);
|
||||
}
|
||||
|
||||
+/* This function is the alternative of 'inet_iif' and 'inet_sdif'
|
||||
+ * functions in case we can not rely on fields of IPCB.
|
||||
+ *
|
||||
+ * The caller must verify skb_valid_dst(skb) is false and skb->dev is initialized.
|
||||
+ * The caller must hold the RCU read lock.
|
||||
+ */
|
||||
+static inline void inet_get_iif_sdif(const struct sk_buff *skb, int *iif, int *sdif)
|
||||
+{
|
||||
+ *iif = inet_iif(skb) ?: skb->dev->ifindex;
|
||||
+ *sdif = 0;
|
||||
+
|
||||
+#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV)
|
||||
+ if (netif_is_l3_slave(skb->dev)) {
|
||||
+ struct net_device *master = netdev_master_upper_dev_get_rcu(skb->dev);
|
||||
+
|
||||
+ *sdif = *iif;
|
||||
+ *iif = master ? master->ifindex : 0;
|
||||
+ }
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+/* This function is the alternative of 'inet6_iif' and 'inet6_sdif'
|
||||
+ * functions in case we can not rely on fields of IP6CB.
|
||||
+ *
|
||||
+ * The caller must verify skb_valid_dst(skb) is false and skb->dev is initialized.
|
||||
+ * The caller must hold the RCU read lock.
|
||||
+ */
|
||||
+static inline void inet6_get_iif_sdif(const struct sk_buff *skb, int *iif, int *sdif)
|
||||
+{
|
||||
+ /* using skb->dev->ifindex because skb_dst(skb) is not initialized */
|
||||
+ *iif = skb->dev->ifindex;
|
||||
+ *sdif = 0;
|
||||
+
|
||||
+#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV)
|
||||
+ if (netif_is_l3_slave(skb->dev)) {
|
||||
+ struct net_device *master = netdev_master_upper_dev_get_rcu(skb->dev);
|
||||
+
|
||||
+ *sdif = *iif;
|
||||
+ *iif = master ? master->ifindex : 0;
|
||||
+ }
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
|
||||
#endif /* _NET_IPV6_GRO_H */
|
||||
--- a/include/net/tcp.h
|
||||
+++ b/include/net/tcp.h
|
||||
@@ -2057,7 +2057,10 @@ void tcp_v4_destroy_sock(struct sock *sk
|
||||
|
||||
struct sk_buff *tcp_gso_segment(struct sk_buff *skb,
|
||||
netdev_features_t features);
|
||||
-struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb);
|
||||
+struct tcphdr *tcp_gro_pull_header(struct sk_buff *skb);
|
||||
+struct sk_buff *tcp_gro_lookup(struct list_head *head, struct tcphdr *th);
|
||||
+struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb,
|
||||
+ struct tcphdr *th);
|
||||
INDIRECT_CALLABLE_DECLARE(int tcp4_gro_complete(struct sk_buff *skb, int thoff));
|
||||
INDIRECT_CALLABLE_DECLARE(struct sk_buff *tcp4_gro_receive(struct list_head *head, struct sk_buff *skb));
|
||||
INDIRECT_CALLABLE_DECLARE(int tcp6_gro_complete(struct sk_buff *skb, int thoff));
|
||||
--- a/net/core/gro.c
|
||||
+++ b/net/core/gro.c
|
||||
@@ -290,6 +290,33 @@ done:
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb)
|
||||
+{
|
||||
+ if (unlikely(p->len + skb->len >= 65536))
|
||||
+ return -E2BIG;
|
||||
+
|
||||
+ if (NAPI_GRO_CB(p)->last == p)
|
||||
+ skb_shinfo(p)->frag_list = skb;
|
||||
+ else
|
||||
+ NAPI_GRO_CB(p)->last->next = skb;
|
||||
+
|
||||
+ skb_pull(skb, skb_gro_offset(skb));
|
||||
+
|
||||
+ NAPI_GRO_CB(p)->last = skb;
|
||||
+ NAPI_GRO_CB(p)->count++;
|
||||
+ p->data_len += skb->len;
|
||||
+
|
||||
+ /* sk ownership - if any - completely transferred to the aggregated packet */
|
||||
+ skb->destructor = NULL;
|
||||
+ skb->sk = NULL;
|
||||
+ p->truesize += skb->truesize;
|
||||
+ p->len += skb->len;
|
||||
+
|
||||
+ NAPI_GRO_CB(skb)->same_flow = 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
|
||||
static void napi_gro_complete(struct napi_struct *napi, struct sk_buff *skb)
|
||||
{
|
||||
--- a/net/ipv4/tcp_offload.c
|
||||
+++ b/net/ipv4/tcp_offload.c
|
||||
@@ -27,6 +27,70 @@ static void tcp_gso_tstamp(struct sk_buf
|
||||
}
|
||||
}
|
||||
|
||||
+static void __tcpv4_gso_segment_csum(struct sk_buff *seg,
|
||||
+ __be32 *oldip, __be32 newip,
|
||||
+ __be16 *oldport, __be16 newport)
|
||||
+{
|
||||
+ struct tcphdr *th;
|
||||
+ struct iphdr *iph;
|
||||
+
|
||||
+ if (*oldip == newip && *oldport == newport)
|
||||
+ return;
|
||||
+
|
||||
+ th = tcp_hdr(seg);
|
||||
+ iph = ip_hdr(seg);
|
||||
+
|
||||
+ inet_proto_csum_replace4(&th->check, seg, *oldip, newip, true);
|
||||
+ inet_proto_csum_replace2(&th->check, seg, *oldport, newport, false);
|
||||
+ *oldport = newport;
|
||||
+
|
||||
+ csum_replace4(&iph->check, *oldip, newip);
|
||||
+ *oldip = newip;
|
||||
+}
|
||||
+
|
||||
+static struct sk_buff *__tcpv4_gso_segment_list_csum(struct sk_buff *segs)
|
||||
+{
|
||||
+ const struct tcphdr *th;
|
||||
+ const struct iphdr *iph;
|
||||
+ struct sk_buff *seg;
|
||||
+ struct tcphdr *th2;
|
||||
+ struct iphdr *iph2;
|
||||
+
|
||||
+ seg = segs;
|
||||
+ th = tcp_hdr(seg);
|
||||
+ iph = ip_hdr(seg);
|
||||
+ th2 = tcp_hdr(seg->next);
|
||||
+ iph2 = ip_hdr(seg->next);
|
||||
+
|
||||
+ if (!(*(const u32 *)&th->source ^ *(const u32 *)&th2->source) &&
|
||||
+ iph->daddr == iph2->daddr && iph->saddr == iph2->saddr)
|
||||
+ return segs;
|
||||
+
|
||||
+ while ((seg = seg->next)) {
|
||||
+ th2 = tcp_hdr(seg);
|
||||
+ iph2 = ip_hdr(seg);
|
||||
+
|
||||
+ __tcpv4_gso_segment_csum(seg,
|
||||
+ &iph2->saddr, iph->saddr,
|
||||
+ &th2->source, th->source);
|
||||
+ __tcpv4_gso_segment_csum(seg,
|
||||
+ &iph2->daddr, iph->daddr,
|
||||
+ &th2->dest, th->dest);
|
||||
+ }
|
||||
+
|
||||
+ return segs;
|
||||
+}
|
||||
+
|
||||
+static struct sk_buff *__tcp4_gso_segment_list(struct sk_buff *skb,
|
||||
+ netdev_features_t features)
|
||||
+{
|
||||
+ skb = skb_segment_list(skb, features, skb_mac_header_len(skb));
|
||||
+ if (IS_ERR(skb))
|
||||
+ return skb;
|
||||
+
|
||||
+ return __tcpv4_gso_segment_list_csum(skb);
|
||||
+}
|
||||
+
|
||||
static struct sk_buff *tcp4_gso_segment(struct sk_buff *skb,
|
||||
netdev_features_t features)
|
||||
{
|
||||
@@ -36,6 +100,9 @@ static struct sk_buff *tcp4_gso_segment(
|
||||
if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
+ if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST)
|
||||
+ return __tcp4_gso_segment_list(skb, features);
|
||||
+
|
||||
if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
@@ -177,61 +244,76 @@ out:
|
||||
return segs;
|
||||
}
|
||||
|
||||
-struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb)
|
||||
+struct sk_buff *tcp_gro_lookup(struct list_head *head, struct tcphdr *th)
|
||||
{
|
||||
- struct sk_buff *pp = NULL;
|
||||
+ struct tcphdr *th2;
|
||||
struct sk_buff *p;
|
||||
+
|
||||
+ list_for_each_entry(p, head, list) {
|
||||
+ if (!NAPI_GRO_CB(p)->same_flow)
|
||||
+ continue;
|
||||
+
|
||||
+ th2 = tcp_hdr(p);
|
||||
+ if (*(u32 *)&th->source ^ *(u32 *)&th2->source) {
|
||||
+ NAPI_GRO_CB(p)->same_flow = 0;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ return p;
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+struct tcphdr *tcp_gro_pull_header(struct sk_buff *skb)
|
||||
+{
|
||||
+ unsigned int thlen, hlen, off;
|
||||
struct tcphdr *th;
|
||||
- struct tcphdr *th2;
|
||||
- unsigned int len;
|
||||
- unsigned int thlen;
|
||||
- __be32 flags;
|
||||
- unsigned int mss = 1;
|
||||
- unsigned int hlen;
|
||||
- unsigned int off;
|
||||
- int flush = 1;
|
||||
- int i;
|
||||
|
||||
off = skb_gro_offset(skb);
|
||||
hlen = off + sizeof(*th);
|
||||
th = skb_gro_header(skb, hlen, off);
|
||||
if (unlikely(!th))
|
||||
- goto out;
|
||||
+ return NULL;
|
||||
|
||||
thlen = th->doff * 4;
|
||||
if (thlen < sizeof(*th))
|
||||
- goto out;
|
||||
+ return NULL;
|
||||
|
||||
hlen = off + thlen;
|
||||
if (skb_gro_header_hard(skb, hlen)) {
|
||||
th = skb_gro_header_slow(skb, hlen, off);
|
||||
if (unlikely(!th))
|
||||
- goto out;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
skb_gro_pull(skb, thlen);
|
||||
|
||||
- len = skb_gro_len(skb);
|
||||
- flags = tcp_flag_word(th);
|
||||
-
|
||||
- list_for_each_entry(p, head, list) {
|
||||
- if (!NAPI_GRO_CB(p)->same_flow)
|
||||
- continue;
|
||||
+ return th;
|
||||
+}
|
||||
|
||||
- th2 = tcp_hdr(p);
|
||||
+struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb,
|
||||
+ struct tcphdr *th)
|
||||
+{
|
||||
+ unsigned int thlen = th->doff * 4;
|
||||
+ struct sk_buff *pp = NULL;
|
||||
+ struct sk_buff *p;
|
||||
+ struct tcphdr *th2;
|
||||
+ unsigned int len;
|
||||
+ __be32 flags;
|
||||
+ unsigned int mss = 1;
|
||||
+ int flush = 1;
|
||||
+ int i;
|
||||
|
||||
- if (*(u32 *)&th->source ^ *(u32 *)&th2->source) {
|
||||
- NAPI_GRO_CB(p)->same_flow = 0;
|
||||
- continue;
|
||||
- }
|
||||
+ len = skb_gro_len(skb);
|
||||
+ flags = tcp_flag_word(th);
|
||||
|
||||
- goto found;
|
||||
- }
|
||||
- p = NULL;
|
||||
- goto out_check_final;
|
||||
+ p = tcp_gro_lookup(head, th);
|
||||
+ if (!p)
|
||||
+ goto out_check_final;
|
||||
|
||||
-found:
|
||||
/* Include the IP ID check below from the inner most IP hdr */
|
||||
+ th2 = tcp_hdr(p);
|
||||
flush = NAPI_GRO_CB(p)->flush;
|
||||
flush |= (__force int)(flags & TCP_FLAG_CWR);
|
||||
flush |= (__force int)((flags ^ tcp_flag_word(th2)) &
|
||||
@@ -268,6 +350,19 @@ found:
|
||||
flush |= p->decrypted ^ skb->decrypted;
|
||||
#endif
|
||||
|
||||
+ if (unlikely(NAPI_GRO_CB(p)->is_flist)) {
|
||||
+ flush |= (__force int)(flags ^ tcp_flag_word(th2));
|
||||
+ flush |= skb->ip_summed != p->ip_summed;
|
||||
+ flush |= skb->csum_level != p->csum_level;
|
||||
+ flush |= !pskb_may_pull(skb, skb_gro_offset(skb));
|
||||
+ flush |= NAPI_GRO_CB(p)->count >= 64;
|
||||
+
|
||||
+ if (flush || skb_gro_receive_list(p, skb))
|
||||
+ mss = 1;
|
||||
+
|
||||
+ goto out_check_final;
|
||||
+ }
|
||||
+
|
||||
if (flush || skb_gro_receive(p, skb)) {
|
||||
mss = 1;
|
||||
goto out_check_final;
|
||||
@@ -289,7 +384,6 @@ out_check_final:
|
||||
if (p && (!NAPI_GRO_CB(skb)->same_flow || flush))
|
||||
pp = p;
|
||||
|
||||
-out:
|
||||
NAPI_GRO_CB(skb)->flush |= (flush != 0);
|
||||
|
||||
return pp;
|
||||
@@ -315,18 +409,58 @@ int tcp_gro_complete(struct sk_buff *skb
|
||||
}
|
||||
EXPORT_SYMBOL(tcp_gro_complete);
|
||||
|
||||
+static void tcp4_check_fraglist_gro(struct list_head *head, struct sk_buff *skb,
|
||||
+ struct tcphdr *th)
|
||||
+{
|
||||
+ const struct iphdr *iph;
|
||||
+ struct sk_buff *p;
|
||||
+ struct sock *sk;
|
||||
+ struct net *net;
|
||||
+ int iif, sdif;
|
||||
+
|
||||
+ if (!(skb->dev->features & NETIF_F_GRO_FRAGLIST))
|
||||
+ return;
|
||||
+
|
||||
+ p = tcp_gro_lookup(head, th);
|
||||
+ if (p) {
|
||||
+ NAPI_GRO_CB(skb)->is_flist = NAPI_GRO_CB(p)->is_flist;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ inet_get_iif_sdif(skb, &iif, &sdif);
|
||||
+ iph = skb_gro_network_header(skb);
|
||||
+ net = dev_net(skb->dev);
|
||||
+ sk = __inet_lookup_established(net, net->ipv4.tcp_death_row.hashinfo,
|
||||
+ iph->saddr, th->source,
|
||||
+ iph->daddr, ntohs(th->dest),
|
||||
+ iif, sdif);
|
||||
+ NAPI_GRO_CB(skb)->is_flist = !sk;
|
||||
+ if (sk)
|
||||
+ sock_put(sk);
|
||||
+}
|
||||
+
|
||||
INDIRECT_CALLABLE_SCOPE
|
||||
struct sk_buff *tcp4_gro_receive(struct list_head *head, struct sk_buff *skb)
|
||||
{
|
||||
+ struct tcphdr *th;
|
||||
+
|
||||
/* Don't bother verifying checksum if we're going to flush anyway. */
|
||||
if (!NAPI_GRO_CB(skb)->flush &&
|
||||
skb_gro_checksum_validate(skb, IPPROTO_TCP,
|
||||
- inet_gro_compute_pseudo)) {
|
||||
- NAPI_GRO_CB(skb)->flush = 1;
|
||||
- return NULL;
|
||||
- }
|
||||
+ inet_gro_compute_pseudo))
|
||||
+ goto flush;
|
||||
+
|
||||
+ th = tcp_gro_pull_header(skb);
|
||||
+ if (!th)
|
||||
+ goto flush;
|
||||
|
||||
- return tcp_gro_receive(head, skb);
|
||||
+ tcp4_check_fraglist_gro(head, skb, th);
|
||||
+
|
||||
+ return tcp_gro_receive(head, skb, th);
|
||||
+
|
||||
+flush:
|
||||
+ NAPI_GRO_CB(skb)->flush = 1;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
INDIRECT_CALLABLE_SCOPE int tcp4_gro_complete(struct sk_buff *skb, int thoff)
|
||||
@@ -334,6 +468,15 @@ INDIRECT_CALLABLE_SCOPE int tcp4_gro_com
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
|
||||
+ if (unlikely(NAPI_GRO_CB(skb)->is_flist)) {
|
||||
+ skb_shinfo(skb)->gso_type |= SKB_GSO_FRAGLIST | SKB_GSO_TCPV4;
|
||||
+ skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count;
|
||||
+
|
||||
+ __skb_incr_checksum_unnecessary(skb);
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
th->check = ~tcp_v4_check(skb->len - thoff, iph->saddr,
|
||||
iph->daddr, 0);
|
||||
skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;
|
||||
--- a/net/ipv4/udp_offload.c
|
||||
+++ b/net/ipv4/udp_offload.c
|
||||
@@ -425,33 +425,6 @@ out:
|
||||
return segs;
|
||||
}
|
||||
|
||||
-static int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb)
|
||||
-{
|
||||
- if (unlikely(p->len + skb->len >= 65536))
|
||||
- return -E2BIG;
|
||||
-
|
||||
- if (NAPI_GRO_CB(p)->last == p)
|
||||
- skb_shinfo(p)->frag_list = skb;
|
||||
- else
|
||||
- NAPI_GRO_CB(p)->last->next = skb;
|
||||
-
|
||||
- skb_pull(skb, skb_gro_offset(skb));
|
||||
-
|
||||
- NAPI_GRO_CB(p)->last = skb;
|
||||
- NAPI_GRO_CB(p)->count++;
|
||||
- p->data_len += skb->len;
|
||||
-
|
||||
- /* sk ownership - if any - completely transferred to the aggregated packet */
|
||||
- skb->destructor = NULL;
|
||||
- skb->sk = NULL;
|
||||
- p->truesize += skb->truesize;
|
||||
- p->len += skb->len;
|
||||
-
|
||||
- NAPI_GRO_CB(skb)->same_flow = 1;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
|
||||
#define UDP_GRO_CNT_MAX 64
|
||||
static struct sk_buff *udp_gro_receive_segment(struct list_head *head,
|
||||
--- a/net/ipv6/tcpv6_offload.c
|
||||
+++ b/net/ipv6/tcpv6_offload.c
|
||||
@@ -7,24 +7,67 @@
|
||||
*/
|
||||
#include <linux/indirect_call_wrapper.h>
|
||||
#include <linux/skbuff.h>
|
||||
+#include <net/inet6_hashtables.h>
|
||||
#include <net/gro.h>
|
||||
#include <net/protocol.h>
|
||||
#include <net/tcp.h>
|
||||
#include <net/ip6_checksum.h>
|
||||
#include "ip6_offload.h"
|
||||
|
||||
+static void tcp6_check_fraglist_gro(struct list_head *head, struct sk_buff *skb,
|
||||
+ struct tcphdr *th)
|
||||
+{
|
||||
+#if IS_ENABLED(CONFIG_IPV6)
|
||||
+ const struct ipv6hdr *hdr;
|
||||
+ struct sk_buff *p;
|
||||
+ struct sock *sk;
|
||||
+ struct net *net;
|
||||
+ int iif, sdif;
|
||||
+
|
||||
+ if (!(skb->dev->features & NETIF_F_GRO_FRAGLIST))
|
||||
+ return;
|
||||
+
|
||||
+ p = tcp_gro_lookup(head, th);
|
||||
+ if (p) {
|
||||
+ NAPI_GRO_CB(skb)->is_flist = NAPI_GRO_CB(p)->is_flist;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ inet6_get_iif_sdif(skb, &iif, &sdif);
|
||||
+ hdr = skb_gro_network_header(skb);
|
||||
+ net = dev_net(skb->dev);
|
||||
+ sk = __inet6_lookup_established(net, net->ipv4.tcp_death_row.hashinfo,
|
||||
+ &hdr->saddr, th->source,
|
||||
+ &hdr->daddr, ntohs(th->dest),
|
||||
+ iif, sdif);
|
||||
+ NAPI_GRO_CB(skb)->is_flist = !sk;
|
||||
+ if (sk)
|
||||
+ sock_put(sk);
|
||||
+#endif /* IS_ENABLED(CONFIG_IPV6) */
|
||||
+}
|
||||
+
|
||||
INDIRECT_CALLABLE_SCOPE
|
||||
struct sk_buff *tcp6_gro_receive(struct list_head *head, struct sk_buff *skb)
|
||||
{
|
||||
+ struct tcphdr *th;
|
||||
+
|
||||
/* Don't bother verifying checksum if we're going to flush anyway. */
|
||||
if (!NAPI_GRO_CB(skb)->flush &&
|
||||
skb_gro_checksum_validate(skb, IPPROTO_TCP,
|
||||
- ip6_gro_compute_pseudo)) {
|
||||
- NAPI_GRO_CB(skb)->flush = 1;
|
||||
- return NULL;
|
||||
- }
|
||||
+ ip6_gro_compute_pseudo))
|
||||
+ goto flush;
|
||||
|
||||
- return tcp_gro_receive(head, skb);
|
||||
+ th = tcp_gro_pull_header(skb);
|
||||
+ if (!th)
|
||||
+ goto flush;
|
||||
+
|
||||
+ tcp6_check_fraglist_gro(head, skb, th);
|
||||
+
|
||||
+ return tcp_gro_receive(head, skb, th);
|
||||
+
|
||||
+flush:
|
||||
+ NAPI_GRO_CB(skb)->flush = 1;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
INDIRECT_CALLABLE_SCOPE int tcp6_gro_complete(struct sk_buff *skb, int thoff)
|
||||
@@ -32,6 +75,15 @@ INDIRECT_CALLABLE_SCOPE int tcp6_gro_com
|
||||
const struct ipv6hdr *iph = ipv6_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
|
||||
+ if (unlikely(NAPI_GRO_CB(skb)->is_flist)) {
|
||||
+ skb_shinfo(skb)->gso_type |= SKB_GSO_FRAGLIST | SKB_GSO_TCPV6;
|
||||
+ skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count;
|
||||
+
|
||||
+ __skb_incr_checksum_unnecessary(skb);
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
th->check = ~tcp_v6_check(skb->len - thoff, &iph->saddr,
|
||||
&iph->daddr, 0);
|
||||
skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV6;
|
||||
@@ -39,6 +91,61 @@ INDIRECT_CALLABLE_SCOPE int tcp6_gro_com
|
||||
return tcp_gro_complete(skb);
|
||||
}
|
||||
|
||||
+static void __tcpv6_gso_segment_csum(struct sk_buff *seg,
|
||||
+ __be16 *oldport, __be16 newport)
|
||||
+{
|
||||
+ struct tcphdr *th;
|
||||
+
|
||||
+ if (*oldport == newport)
|
||||
+ return;
|
||||
+
|
||||
+ th = tcp_hdr(seg);
|
||||
+ inet_proto_csum_replace2(&th->check, seg, *oldport, newport, false);
|
||||
+ *oldport = newport;
|
||||
+}
|
||||
+
|
||||
+static struct sk_buff *__tcpv6_gso_segment_list_csum(struct sk_buff *segs)
|
||||
+{
|
||||
+ const struct tcphdr *th;
|
||||
+ const struct ipv6hdr *iph;
|
||||
+ struct sk_buff *seg;
|
||||
+ struct tcphdr *th2;
|
||||
+ struct ipv6hdr *iph2;
|
||||
+
|
||||
+ seg = segs;
|
||||
+ th = tcp_hdr(seg);
|
||||
+ iph = ipv6_hdr(seg);
|
||||
+ th2 = tcp_hdr(seg->next);
|
||||
+ iph2 = ipv6_hdr(seg->next);
|
||||
+
|
||||
+ if (!(*(const u32 *)&th->source ^ *(const u32 *)&th2->source) &&
|
||||
+ ipv6_addr_equal(&iph->saddr, &iph2->saddr) &&
|
||||
+ ipv6_addr_equal(&iph->daddr, &iph2->daddr))
|
||||
+ return segs;
|
||||
+
|
||||
+ while ((seg = seg->next)) {
|
||||
+ th2 = tcp_hdr(seg);
|
||||
+ iph2 = ipv6_hdr(seg);
|
||||
+
|
||||
+ iph2->saddr = iph->saddr;
|
||||
+ iph2->daddr = iph->daddr;
|
||||
+ __tcpv6_gso_segment_csum(seg, &th2->source, th->source);
|
||||
+ __tcpv6_gso_segment_csum(seg, &th2->dest, th->dest);
|
||||
+ }
|
||||
+
|
||||
+ return segs;
|
||||
+}
|
||||
+
|
||||
+static struct sk_buff *__tcp6_gso_segment_list(struct sk_buff *skb,
|
||||
+ netdev_features_t features)
|
||||
+{
|
||||
+ skb = skb_segment_list(skb, features, skb_mac_header_len(skb));
|
||||
+ if (IS_ERR(skb))
|
||||
+ return skb;
|
||||
+
|
||||
+ return __tcpv6_gso_segment_list_csum(skb);
|
||||
+}
|
||||
+
|
||||
static struct sk_buff *tcp6_gso_segment(struct sk_buff *skb,
|
||||
netdev_features_t features)
|
||||
{
|
||||
@@ -50,6 +157,9 @@ static struct sk_buff *tcp6_gso_segment(
|
||||
if (!pskb_may_pull(skb, sizeof(*th)))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
+ if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST)
|
||||
+ return __tcp6_gso_segment_list(skb, features);
|
||||
+
|
||||
if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
|
||||
const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 27 Apr 2024 18:54:25 +0200
|
||||
Subject: [PATCH] net: bridge: fix multicast-to-unicast with fraglist GSO
|
||||
|
||||
Calling skb_copy on a SKB_GSO_FRAGLIST skb is not valid, since it returns
|
||||
an invalid linearized skb. This code only needs to change the ethernet
|
||||
header, so pskb_copy is the right function to call here.
|
||||
|
||||
Fixes: 6db6f0eae605 ("bridge: multicast to unicast")
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/net/bridge/br_forward.c
|
||||
+++ b/net/bridge/br_forward.c
|
||||
@@ -261,7 +261,7 @@ static void maybe_deliver_addr(struct ne
|
||||
if (skb->dev == p->dev && ether_addr_equal(src, addr))
|
||||
return;
|
||||
|
||||
- skb = skb_copy(skb, GFP_ATOMIC);
|
||||
+ skb = pskb_copy(skb, GFP_ATOMIC);
|
||||
if (!skb) {
|
||||
DEV_STATS_INC(dev, tx_dropped);
|
||||
return;
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 27 Apr 2024 19:29:45 +0200
|
||||
Subject: [PATCH] net: core: reject skb_copy(_expand) for fraglist GSO skbs
|
||||
|
||||
SKB_GSO_FRAGLIST skbs must not be linearized, otherwise they become
|
||||
invalid. Return NULL if such an skb is passed to skb_copy or
|
||||
skb_copy_expand, in order to prevent a crash on a potential later
|
||||
call to skb_gso_segment.
|
||||
|
||||
Fixes: 3a1296a38d0c ("net: Support GRO/GSO fraglist chaining.")
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/net/core/skbuff.c
|
||||
+++ b/net/core/skbuff.c
|
||||
@@ -1720,11 +1720,17 @@ static inline int skb_alloc_rx_flag(cons
|
||||
|
||||
struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask)
|
||||
{
|
||||
- int headerlen = skb_headroom(skb);
|
||||
- unsigned int size = skb_end_offset(skb) + skb->data_len;
|
||||
- struct sk_buff *n = __alloc_skb(size, gfp_mask,
|
||||
- skb_alloc_rx_flag(skb), NUMA_NO_NODE);
|
||||
+ struct sk_buff *n;
|
||||
+ unsigned int size;
|
||||
+ int headerlen;
|
||||
|
||||
+ if (WARN_ON_ONCE(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST))
|
||||
+ return NULL;
|
||||
+
|
||||
+ headerlen = skb_headroom(skb);
|
||||
+ size = skb_end_offset(skb) + skb->data_len;
|
||||
+ n = __alloc_skb(size, gfp_mask,
|
||||
+ skb_alloc_rx_flag(skb), NUMA_NO_NODE);
|
||||
if (!n)
|
||||
return NULL;
|
||||
|
||||
@@ -2037,12 +2043,17 @@ struct sk_buff *skb_copy_expand(const st
|
||||
/*
|
||||
* Allocate the copy buffer
|
||||
*/
|
||||
- struct sk_buff *n = __alloc_skb(newheadroom + skb->len + newtailroom,
|
||||
- gfp_mask, skb_alloc_rx_flag(skb),
|
||||
- NUMA_NO_NODE);
|
||||
- int oldheadroom = skb_headroom(skb);
|
||||
int head_copy_len, head_copy_off;
|
||||
+ struct sk_buff *n;
|
||||
+ int oldheadroom;
|
||||
+
|
||||
+ if (WARN_ON_ONCE(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST))
|
||||
+ return NULL;
|
||||
|
||||
+ oldheadroom = skb_headroom(skb);
|
||||
+ n = __alloc_skb(newheadroom + skb->len + newtailroom,
|
||||
+ gfp_mask, skb_alloc_rx_flag(skb),
|
||||
+ NUMA_NO_NODE);
|
||||
if (!n)
|
||||
return NULL;
|
||||
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
From 844c273286f328acf0dab5fbd5d864366b4904dc Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Tue, 30 Mar 2021 18:21:14 +0200
|
||||
Subject: [PATCH] of_net: add mac-address-increment support
|
||||
|
||||
Lots of embedded devices use the mac-address of other interface
|
||||
extracted from nvmem cells and increments it by one or two. Add two
|
||||
bindings to integrate this and directly use the right mac-address for
|
||||
the interface. Some example are some routers that use the gmac
|
||||
mac-address stored in the art partition and increments it by one for the
|
||||
wifi. mac-address-increment-byte bindings is used to tell what byte of
|
||||
the mac-address has to be increased (if not defined the last byte is
|
||||
increased) and mac-address-increment tells how much the byte decided
|
||||
early has to be increased.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
net/core/of_net.c | 43 +++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 39 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/net/core/of_net.c
|
||||
+++ b/net/core/of_net.c
|
||||
@@ -119,28 +119,63 @@ static int of_get_mac_addr_nvmem(struct
|
||||
* this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
|
||||
* but is all zeros.
|
||||
*
|
||||
+ * DT can tell the system to increment the mac-address after is extracted by
|
||||
+ * using:
|
||||
+ * - mac-address-increment-byte to decide what byte to increase
|
||||
+ * (if not defined is increased the last byte)
|
||||
+ * - mac-address-increment to decide how much to increase. The value WILL
|
||||
+ * overflow to other bytes if the increment is over 255 or the total
|
||||
+ * increment will exceed 255 of the current byte.
|
||||
+ * (example 00:01:02:03:04:ff + 1 == 00:01:02:03:05:00)
|
||||
+ * (example 00:01:02:03:04:fe + 5 == 00:01:02:03:05:03)
|
||||
+ *
|
||||
* Return: 0 on success and errno in case of error.
|
||||
*/
|
||||
int of_get_mac_address(struct device_node *np, u8 *addr)
|
||||
{
|
||||
+ u32 inc_idx, mac_inc, mac_val;
|
||||
int ret;
|
||||
|
||||
+ /* Check first if the increment byte is present and valid.
|
||||
+ * If not set assume to increment the last byte if found.
|
||||
+ */
|
||||
+ if (of_property_read_u32(np, "mac-address-increment-byte", &inc_idx))
|
||||
+ inc_idx = 5;
|
||||
+ if (inc_idx < 3 || inc_idx > 5)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
if (!np)
|
||||
return -ENODEV;
|
||||
|
||||
ret = of_get_mac_addr(np, "mac-address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
ret = of_get_mac_addr(np, "local-mac-address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
ret = of_get_mac_addr(np, "address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
+
|
||||
+ ret = of_get_mac_addr_nvmem(np, addr);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+found:
|
||||
+ if (!of_property_read_u32(np, "mac-address-increment", &mac_inc)) {
|
||||
+ /* Convert to a contiguous value */
|
||||
+ mac_val = (addr[3] << 16) + (addr[4] << 8) + addr[5];
|
||||
+ mac_val += mac_inc << 8 * (5-inc_idx);
|
||||
+
|
||||
+ /* Apply the incremented value handling overflow case */
|
||||
+ addr[3] = (mac_val >> 16) & 0xff;
|
||||
+ addr[4] = (mac_val >> 8) & 0xff;
|
||||
+ addr[5] = (mac_val >> 0) & 0xff;
|
||||
+ }
|
||||
|
||||
- return of_get_mac_addr_nvmem(np, addr);
|
||||
+ return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(of_get_mac_address);
|
||||
|
||||
@@ -45,11 +45,31 @@ property. This way, the MAC address can be accessed using procfs.
|
||||
/**
|
||||
* of_get_mac_address()
|
||||
* @np: Caller's Device Node
|
||||
@@ -175,6 +196,7 @@ found:
|
||||
addr[5] = (mac_val >> 0) & 0xff;
|
||||
}
|
||||
@@ -130,17 +151,23 @@ int of_get_mac_address(struct device_nod
|
||||
|
||||
+ of_add_mac_address(np, addr);
|
||||
return ret;
|
||||
ret = of_get_mac_addr(np, "mac-address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
ret = of_get_mac_addr(np, "local-mac-address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
ret = of_get_mac_addr(np, "address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
- return of_get_mac_addr_nvmem(np, addr);
|
||||
+ ret = of_get_mac_addr_nvmem(np, addr);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+found:
|
||||
+ ret = of_add_mac_address(np, addr);
|
||||
+ return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(of_get_mac_address);
|
||||
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
From dd07dd394d8bfdb5d527fab18ca54f20815ec4e4 Mon Sep 17 00:00:00 2001
|
||||
From: Will Moss <willormos@gmail.com>
|
||||
Date: Wed, 3 Aug 2022 13:48:55 +0000
|
||||
Subject: [PATCH] of_net: do mac-address-increment only once
|
||||
|
||||
Remove mac-address-increment and mac-address-increment-byte
|
||||
DT property after incrementing process to make sure MAC address
|
||||
would not get incremented more if this function is stared again.
|
||||
It could happen if device initialization is deferred after
|
||||
unsuccessful attempt.
|
||||
|
||||
Signed-off-by: Will Moss <willormos@gmail.com>
|
||||
---
|
||||
drivers/of/of_net.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
--- a/net/core/of_net.c
|
||||
+++ b/net/core/of_net.c
|
||||
@@ -194,6 +194,12 @@ found:
|
||||
addr[3] = (mac_val >> 16) & 0xff;
|
||||
addr[4] = (mac_val >> 8) & 0xff;
|
||||
addr[5] = (mac_val >> 0) & 0xff;
|
||||
+
|
||||
+ /* Remove mac-address-increment and mac-address-increment-byte
|
||||
+ * DT property to make sure MAC address would not get incremented
|
||||
+ * more if this function is stared again. */
|
||||
+ of_remove_property(np, of_find_property(np, "mac-address-increment", NULL));
|
||||
+ of_remove_property(np, of_find_property(np, "mac-address-increment-byte", NULL));
|
||||
}
|
||||
|
||||
of_add_mac_address(np, addr);
|
||||
+4
-4
@@ -177,15 +177,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
sd->backlog.weight = weight_p;
|
||||
--- a/net/core/sysctl_net_core.c
|
||||
+++ b/net/core/sysctl_net_core.c
|
||||
@@ -29,6 +29,7 @@ static int int_3600 = 3600;
|
||||
static int min_sndbuf = SOCK_MIN_SNDBUF;
|
||||
@@ -30,6 +30,7 @@ static int min_sndbuf = SOCK_MIN_SNDBUF;
|
||||
static int min_rcvbuf = SOCK_MIN_RCVBUF;
|
||||
static int max_skb_frags = MAX_SKB_FRAGS;
|
||||
static int min_mem_pcpu_rsv = SK_MEMORY_PCPU_RESERVE;
|
||||
+static int backlog_threaded;
|
||||
|
||||
static int net_msg_warn; /* Unused, but still a sysctl */
|
||||
|
||||
@@ -112,6 +113,23 @@ static int rps_sock_flow_sysctl(struct c
|
||||
@@ -113,6 +114,23 @@ static int rps_sock_flow_sysctl(struct c
|
||||
}
|
||||
#endif /* CONFIG_RPS */
|
||||
|
||||
@@ -209,7 +209,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
#ifdef CONFIG_NET_FLOW_LIMIT
|
||||
static DEFINE_MUTEX(flow_limit_update_mutex);
|
||||
|
||||
@@ -473,6 +491,15 @@ static struct ctl_table net_core_table[]
|
||||
@@ -482,6 +500,15 @@ static struct ctl_table net_core_table[]
|
||||
.proc_handler = rps_sock_flow_sysctl
|
||||
},
|
||||
#endif
|
||||
|
||||
-151
@@ -1,151 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Subject: net: replace GRO optimization patch with a new one that supports VLANs/bridges with different MAC addresses
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
include/linux/netdevice.h | 2 ++
|
||||
include/linux/skbuff.h | 3 ++-
|
||||
net/core/dev.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
net/ethernet/eth.c | 18 +++++++++++++++++-
|
||||
4 files changed, 69 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/include/linux/netdevice.h
|
||||
+++ b/include/linux/netdevice.h
|
||||
@@ -2210,6 +2210,8 @@ struct net_device {
|
||||
struct netdev_hw_addr_list mc;
|
||||
struct netdev_hw_addr_list dev_addrs;
|
||||
|
||||
+ unsigned char local_addr_mask[MAX_ADDR_LEN];
|
||||
+
|
||||
#ifdef CONFIG_SYSFS
|
||||
struct kset *queues_kset;
|
||||
#endif
|
||||
--- a/include/linux/skbuff.h
|
||||
+++ b/include/linux/skbuff.h
|
||||
@@ -959,6 +959,7 @@ struct sk_buff {
|
||||
#ifdef CONFIG_IPV6_NDISC_NODETYPE
|
||||
__u8 ndisc_nodetype:2;
|
||||
#endif
|
||||
+ __u8 gro_skip:1;
|
||||
|
||||
#if IS_ENABLED(CONFIG_IP_VS)
|
||||
__u8 ipvs_property:1;
|
||||
--- a/net/core/gro.c
|
||||
+++ b/net/core/gro.c
|
||||
@@ -446,6 +446,9 @@ static enum gro_result dev_gro_receive(s
|
||||
enum gro_result ret;
|
||||
int same_flow;
|
||||
|
||||
+ if (skb->gro_skip)
|
||||
+ goto normal;
|
||||
+
|
||||
if (netif_elide_gro(skb->dev))
|
||||
goto normal;
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -7689,6 +7689,48 @@ static void __netdev_adjacent_dev_unlink
|
||||
&upper_dev->adj_list.lower);
|
||||
}
|
||||
|
||||
+static void __netdev_addr_mask(unsigned char *mask, const unsigned char *addr,
|
||||
+ struct net_device *dev)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < dev->addr_len; i++)
|
||||
+ mask[i] |= addr[i] ^ dev->dev_addr[i];
|
||||
+}
|
||||
+
|
||||
+static void __netdev_upper_mask(unsigned char *mask, struct net_device *dev,
|
||||
+ struct net_device *lower)
|
||||
+{
|
||||
+ struct net_device *cur;
|
||||
+ struct list_head *iter;
|
||||
+
|
||||
+ netdev_for_each_upper_dev_rcu(dev, cur, iter) {
|
||||
+ __netdev_addr_mask(mask, cur->dev_addr, lower);
|
||||
+ __netdev_upper_mask(mask, cur, lower);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void __netdev_update_addr_mask(struct net_device *dev)
|
||||
+{
|
||||
+ unsigned char mask[MAX_ADDR_LEN];
|
||||
+ struct net_device *cur;
|
||||
+ struct list_head *iter;
|
||||
+
|
||||
+ memset(mask, 0, sizeof(mask));
|
||||
+ __netdev_upper_mask(mask, dev, dev);
|
||||
+ memcpy(dev->local_addr_mask, mask, dev->addr_len);
|
||||
+
|
||||
+ netdev_for_each_lower_dev(dev, cur, iter)
|
||||
+ __netdev_update_addr_mask(cur);
|
||||
+}
|
||||
+
|
||||
+static void netdev_update_addr_mask(struct net_device *dev)
|
||||
+{
|
||||
+ rcu_read_lock();
|
||||
+ __netdev_update_addr_mask(dev);
|
||||
+ rcu_read_unlock();
|
||||
+}
|
||||
+
|
||||
static int __netdev_upper_dev_link(struct net_device *dev,
|
||||
struct net_device *upper_dev, bool master,
|
||||
void *upper_priv, void *upper_info,
|
||||
@@ -7740,6 +7782,7 @@ static int __netdev_upper_dev_link(struc
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ netdev_update_addr_mask(dev);
|
||||
ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
|
||||
&changeupper_info.info);
|
||||
ret = notifier_to_errno(ret);
|
||||
@@ -7836,6 +7879,7 @@ static void __netdev_upper_dev_unlink(st
|
||||
|
||||
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
|
||||
|
||||
+ netdev_update_addr_mask(dev);
|
||||
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
|
||||
&changeupper_info.info);
|
||||
|
||||
@@ -8892,6 +8936,7 @@ int dev_set_mac_address(struct net_devic
|
||||
return err;
|
||||
}
|
||||
dev->addr_assign_type = NET_ADDR_SET;
|
||||
+ netdev_update_addr_mask(dev);
|
||||
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
|
||||
add_device_randomness(dev->dev_addr, dev->addr_len);
|
||||
return 0;
|
||||
--- a/net/ethernet/eth.c
|
||||
+++ b/net/ethernet/eth.c
|
||||
@@ -143,6 +143,18 @@ u32 eth_get_headlen(const struct net_dev
|
||||
}
|
||||
EXPORT_SYMBOL(eth_get_headlen);
|
||||
|
||||
+static inline bool
|
||||
+eth_check_local_mask(const void *addr1, const void *addr2, const void *mask)
|
||||
+{
|
||||
+ const u16 *a1 = addr1;
|
||||
+ const u16 *a2 = addr2;
|
||||
+ const u16 *m = mask;
|
||||
+
|
||||
+ return (((a1[0] ^ a2[0]) & ~m[0]) |
|
||||
+ ((a1[1] ^ a2[1]) & ~m[1]) |
|
||||
+ ((a1[2] ^ a2[2]) & ~m[2]));
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* eth_type_trans - determine the packet's protocol ID.
|
||||
* @skb: received socket data
|
||||
@@ -174,6 +186,10 @@ __be16 eth_type_trans(struct sk_buff *sk
|
||||
} else {
|
||||
skb->pkt_type = PACKET_OTHERHOST;
|
||||
}
|
||||
+
|
||||
+ if (eth_check_local_mask(eth->h_dest, dev->dev_addr,
|
||||
+ dev->local_addr_mask))
|
||||
+ skb->gro_skip = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -0,0 +1,578 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 23 Apr 2024 11:23:03 +0200
|
||||
Subject: [PATCH] net: add TCP fraglist GRO support
|
||||
|
||||
When forwarding TCP after GRO, software segmentation is very expensive,
|
||||
especially when the checksum needs to be recalculated.
|
||||
One case where that's currently unavoidable is when routing packets over
|
||||
PPPoE. Performance improves significantly when using fraglist GRO
|
||||
implemented in the same way as for UDP.
|
||||
|
||||
Here's a measurement of running 2 TCP streams through a MediaTek MT7622
|
||||
device (2-core Cortex-A53), which runs NAT with flow offload enabled from
|
||||
one ethernet port to PPPoE on another ethernet port + cake qdisc set to
|
||||
1Gbps.
|
||||
|
||||
rx-gro-list off: 630 Mbit/s, CPU 35% idle
|
||||
rx-gro-list on: 770 Mbit/s, CPU 40% idle
|
||||
|
||||
Signe-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/net/gro.h
|
||||
+++ b/include/net/gro.h
|
||||
@@ -439,6 +439,7 @@ static inline __wsum ip6_gro_compute_pse
|
||||
}
|
||||
|
||||
int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb);
|
||||
+int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb);
|
||||
|
||||
/* Pass the currently batched GRO_NORMAL SKBs up to the stack. */
|
||||
static inline void gro_normal_list(struct napi_struct *napi)
|
||||
--- a/include/net/tcp.h
|
||||
+++ b/include/net/tcp.h
|
||||
@@ -2082,7 +2082,10 @@ void tcp_v4_destroy_sock(struct sock *sk
|
||||
|
||||
struct sk_buff *tcp_gso_segment(struct sk_buff *skb,
|
||||
netdev_features_t features);
|
||||
-struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb);
|
||||
+struct tcphdr *tcp_gro_pull_header(struct sk_buff *skb);
|
||||
+struct sk_buff *tcp_gro_lookup(struct list_head *head, struct tcphdr *th);
|
||||
+struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb,
|
||||
+ struct tcphdr *th);
|
||||
INDIRECT_CALLABLE_DECLARE(int tcp4_gro_complete(struct sk_buff *skb, int thoff));
|
||||
INDIRECT_CALLABLE_DECLARE(struct sk_buff *tcp4_gro_receive(struct list_head *head, struct sk_buff *skb));
|
||||
INDIRECT_CALLABLE_DECLARE(int tcp6_gro_complete(struct sk_buff *skb, int thoff));
|
||||
--- a/net/core/gro.c
|
||||
+++ b/net/core/gro.c
|
||||
@@ -233,6 +233,33 @@ done:
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb)
|
||||
+{
|
||||
+ if (unlikely(p->len + skb->len >= 65536))
|
||||
+ return -E2BIG;
|
||||
+
|
||||
+ if (NAPI_GRO_CB(p)->last == p)
|
||||
+ skb_shinfo(p)->frag_list = skb;
|
||||
+ else
|
||||
+ NAPI_GRO_CB(p)->last->next = skb;
|
||||
+
|
||||
+ skb_pull(skb, skb_gro_offset(skb));
|
||||
+
|
||||
+ NAPI_GRO_CB(p)->last = skb;
|
||||
+ NAPI_GRO_CB(p)->count++;
|
||||
+ p->data_len += skb->len;
|
||||
+
|
||||
+ /* sk ownership - if any - completely transferred to the aggregated packet */
|
||||
+ skb->destructor = NULL;
|
||||
+ skb->sk = NULL;
|
||||
+ p->truesize += skb->truesize;
|
||||
+ p->len += skb->len;
|
||||
+
|
||||
+ NAPI_GRO_CB(skb)->same_flow = 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
|
||||
static void napi_gro_complete(struct napi_struct *napi, struct sk_buff *skb)
|
||||
{
|
||||
--- a/net/ipv4/tcp_offload.c
|
||||
+++ b/net/ipv4/tcp_offload.c
|
||||
@@ -28,6 +28,70 @@ static void tcp_gso_tstamp(struct sk_buf
|
||||
}
|
||||
}
|
||||
|
||||
+static void __tcpv4_gso_segment_csum(struct sk_buff *seg,
|
||||
+ __be32 *oldip, __be32 newip,
|
||||
+ __be16 *oldport, __be16 newport)
|
||||
+{
|
||||
+ struct tcphdr *th;
|
||||
+ struct iphdr *iph;
|
||||
+
|
||||
+ if (*oldip == newip && *oldport == newport)
|
||||
+ return;
|
||||
+
|
||||
+ th = tcp_hdr(seg);
|
||||
+ iph = ip_hdr(seg);
|
||||
+
|
||||
+ inet_proto_csum_replace4(&th->check, seg, *oldip, newip, true);
|
||||
+ inet_proto_csum_replace2(&th->check, seg, *oldport, newport, false);
|
||||
+ *oldport = newport;
|
||||
+
|
||||
+ csum_replace4(&iph->check, *oldip, newip);
|
||||
+ *oldip = newip;
|
||||
+}
|
||||
+
|
||||
+static struct sk_buff *__tcpv4_gso_segment_list_csum(struct sk_buff *segs)
|
||||
+{
|
||||
+ const struct tcphdr *th;
|
||||
+ const struct iphdr *iph;
|
||||
+ struct sk_buff *seg;
|
||||
+ struct tcphdr *th2;
|
||||
+ struct iphdr *iph2;
|
||||
+
|
||||
+ seg = segs;
|
||||
+ th = tcp_hdr(seg);
|
||||
+ iph = ip_hdr(seg);
|
||||
+ th2 = tcp_hdr(seg->next);
|
||||
+ iph2 = ip_hdr(seg->next);
|
||||
+
|
||||
+ if (!(*(const u32 *)&th->source ^ *(const u32 *)&th2->source) &&
|
||||
+ iph->daddr == iph2->daddr && iph->saddr == iph2->saddr)
|
||||
+ return segs;
|
||||
+
|
||||
+ while ((seg = seg->next)) {
|
||||
+ th2 = tcp_hdr(seg);
|
||||
+ iph2 = ip_hdr(seg);
|
||||
+
|
||||
+ __tcpv4_gso_segment_csum(seg,
|
||||
+ &iph2->saddr, iph->saddr,
|
||||
+ &th2->source, th->source);
|
||||
+ __tcpv4_gso_segment_csum(seg,
|
||||
+ &iph2->daddr, iph->daddr,
|
||||
+ &th2->dest, th->dest);
|
||||
+ }
|
||||
+
|
||||
+ return segs;
|
||||
+}
|
||||
+
|
||||
+static struct sk_buff *__tcp4_gso_segment_list(struct sk_buff *skb,
|
||||
+ netdev_features_t features)
|
||||
+{
|
||||
+ skb = skb_segment_list(skb, features, skb_mac_header_len(skb));
|
||||
+ if (IS_ERR(skb))
|
||||
+ return skb;
|
||||
+
|
||||
+ return __tcpv4_gso_segment_list_csum(skb);
|
||||
+}
|
||||
+
|
||||
static struct sk_buff *tcp4_gso_segment(struct sk_buff *skb,
|
||||
netdev_features_t features)
|
||||
{
|
||||
@@ -37,6 +101,9 @@ static struct sk_buff *tcp4_gso_segment(
|
||||
if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
+ if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST)
|
||||
+ return __tcp4_gso_segment_list(skb, features);
|
||||
+
|
||||
if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
@@ -178,61 +245,76 @@ out:
|
||||
return segs;
|
||||
}
|
||||
|
||||
-struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb)
|
||||
+struct sk_buff *tcp_gro_lookup(struct list_head *head, struct tcphdr *th)
|
||||
{
|
||||
- struct sk_buff *pp = NULL;
|
||||
+ struct tcphdr *th2;
|
||||
struct sk_buff *p;
|
||||
+
|
||||
+ list_for_each_entry(p, head, list) {
|
||||
+ if (!NAPI_GRO_CB(p)->same_flow)
|
||||
+ continue;
|
||||
+
|
||||
+ th2 = tcp_hdr(p);
|
||||
+ if (*(u32 *)&th->source ^ *(u32 *)&th2->source) {
|
||||
+ NAPI_GRO_CB(p)->same_flow = 0;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ return p;
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+struct tcphdr *tcp_gro_pull_header(struct sk_buff *skb)
|
||||
+{
|
||||
+ unsigned int thlen, hlen, off;
|
||||
struct tcphdr *th;
|
||||
- struct tcphdr *th2;
|
||||
- unsigned int len;
|
||||
- unsigned int thlen;
|
||||
- __be32 flags;
|
||||
- unsigned int mss = 1;
|
||||
- unsigned int hlen;
|
||||
- unsigned int off;
|
||||
- int flush = 1;
|
||||
- int i;
|
||||
|
||||
off = skb_gro_offset(skb);
|
||||
hlen = off + sizeof(*th);
|
||||
th = skb_gro_header(skb, hlen, off);
|
||||
if (unlikely(!th))
|
||||
- goto out;
|
||||
+ return NULL;
|
||||
|
||||
thlen = th->doff * 4;
|
||||
if (thlen < sizeof(*th))
|
||||
- goto out;
|
||||
+ return NULL;
|
||||
|
||||
hlen = off + thlen;
|
||||
if (skb_gro_header_hard(skb, hlen)) {
|
||||
th = skb_gro_header_slow(skb, hlen, off);
|
||||
if (unlikely(!th))
|
||||
- goto out;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
skb_gro_pull(skb, thlen);
|
||||
|
||||
- len = skb_gro_len(skb);
|
||||
- flags = tcp_flag_word(th);
|
||||
-
|
||||
- list_for_each_entry(p, head, list) {
|
||||
- if (!NAPI_GRO_CB(p)->same_flow)
|
||||
- continue;
|
||||
+ return th;
|
||||
+}
|
||||
|
||||
- th2 = tcp_hdr(p);
|
||||
+struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb,
|
||||
+ struct tcphdr *th)
|
||||
+{
|
||||
+ unsigned int thlen = th->doff * 4;
|
||||
+ struct sk_buff *pp = NULL;
|
||||
+ struct sk_buff *p;
|
||||
+ struct tcphdr *th2;
|
||||
+ unsigned int len;
|
||||
+ __be32 flags;
|
||||
+ unsigned int mss = 1;
|
||||
+ int flush = 1;
|
||||
+ int i;
|
||||
|
||||
- if (*(u32 *)&th->source ^ *(u32 *)&th2->source) {
|
||||
- NAPI_GRO_CB(p)->same_flow = 0;
|
||||
- continue;
|
||||
- }
|
||||
+ len = skb_gro_len(skb);
|
||||
+ flags = tcp_flag_word(th);
|
||||
|
||||
- goto found;
|
||||
- }
|
||||
- p = NULL;
|
||||
- goto out_check_final;
|
||||
+ p = tcp_gro_lookup(head, th);
|
||||
+ if (!p)
|
||||
+ goto out_check_final;
|
||||
|
||||
-found:
|
||||
/* Include the IP ID check below from the inner most IP hdr */
|
||||
+ th2 = tcp_hdr(p);
|
||||
flush = NAPI_GRO_CB(p)->flush;
|
||||
flush |= (__force int)(flags & TCP_FLAG_CWR);
|
||||
flush |= (__force int)((flags ^ tcp_flag_word(th2)) &
|
||||
@@ -269,6 +351,19 @@ found:
|
||||
flush |= p->decrypted ^ skb->decrypted;
|
||||
#endif
|
||||
|
||||
+ if (unlikely(NAPI_GRO_CB(p)->is_flist)) {
|
||||
+ flush |= (__force int)(flags ^ tcp_flag_word(th2));
|
||||
+ flush |= skb->ip_summed != p->ip_summed;
|
||||
+ flush |= skb->csum_level != p->csum_level;
|
||||
+ flush |= !pskb_may_pull(skb, skb_gro_offset(skb));
|
||||
+ flush |= NAPI_GRO_CB(p)->count >= 64;
|
||||
+
|
||||
+ if (flush || skb_gro_receive_list(p, skb))
|
||||
+ mss = 1;
|
||||
+
|
||||
+ goto out_check_final;
|
||||
+ }
|
||||
+
|
||||
if (flush || skb_gro_receive(p, skb)) {
|
||||
mss = 1;
|
||||
goto out_check_final;
|
||||
@@ -290,7 +385,6 @@ out_check_final:
|
||||
if (p && (!NAPI_GRO_CB(skb)->same_flow || flush))
|
||||
pp = p;
|
||||
|
||||
-out:
|
||||
NAPI_GRO_CB(skb)->flush |= (flush != 0);
|
||||
|
||||
return pp;
|
||||
@@ -314,18 +408,58 @@ void tcp_gro_complete(struct sk_buff *sk
|
||||
}
|
||||
EXPORT_SYMBOL(tcp_gro_complete);
|
||||
|
||||
+static void tcp4_check_fraglist_gro(struct list_head *head, struct sk_buff *skb,
|
||||
+ struct tcphdr *th)
|
||||
+{
|
||||
+ const struct iphdr *iph;
|
||||
+ struct sk_buff *p;
|
||||
+ struct sock *sk;
|
||||
+ struct net *net;
|
||||
+ int iif, sdif;
|
||||
+
|
||||
+ if (!(skb->dev->features & NETIF_F_GRO_FRAGLIST))
|
||||
+ return;
|
||||
+
|
||||
+ p = tcp_gro_lookup(head, th);
|
||||
+ if (p) {
|
||||
+ NAPI_GRO_CB(skb)->is_flist = NAPI_GRO_CB(p)->is_flist;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ inet_get_iif_sdif(skb, &iif, &sdif);
|
||||
+ iph = skb_gro_network_header(skb);
|
||||
+ net = dev_net(skb->dev);
|
||||
+ sk = __inet_lookup_established(net, net->ipv4.tcp_death_row.hashinfo,
|
||||
+ iph->saddr, th->source,
|
||||
+ iph->daddr, ntohs(th->dest),
|
||||
+ iif, sdif);
|
||||
+ NAPI_GRO_CB(skb)->is_flist = !sk;
|
||||
+ if (sk)
|
||||
+ sock_put(sk);
|
||||
+}
|
||||
+
|
||||
INDIRECT_CALLABLE_SCOPE
|
||||
struct sk_buff *tcp4_gro_receive(struct list_head *head, struct sk_buff *skb)
|
||||
{
|
||||
+ struct tcphdr *th;
|
||||
+
|
||||
/* Don't bother verifying checksum if we're going to flush anyway. */
|
||||
if (!NAPI_GRO_CB(skb)->flush &&
|
||||
skb_gro_checksum_validate(skb, IPPROTO_TCP,
|
||||
- inet_gro_compute_pseudo)) {
|
||||
- NAPI_GRO_CB(skb)->flush = 1;
|
||||
- return NULL;
|
||||
- }
|
||||
+ inet_gro_compute_pseudo))
|
||||
+ goto flush;
|
||||
+
|
||||
+ th = tcp_gro_pull_header(skb);
|
||||
+ if (!th)
|
||||
+ goto flush;
|
||||
|
||||
- return tcp_gro_receive(head, skb);
|
||||
+ tcp4_check_fraglist_gro(head, skb, th);
|
||||
+
|
||||
+ return tcp_gro_receive(head, skb, th);
|
||||
+
|
||||
+flush:
|
||||
+ NAPI_GRO_CB(skb)->flush = 1;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
INDIRECT_CALLABLE_SCOPE int tcp4_gro_complete(struct sk_buff *skb, int thoff)
|
||||
@@ -333,6 +467,15 @@ INDIRECT_CALLABLE_SCOPE int tcp4_gro_com
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
|
||||
+ if (unlikely(NAPI_GRO_CB(skb)->is_flist)) {
|
||||
+ skb_shinfo(skb)->gso_type |= SKB_GSO_FRAGLIST | SKB_GSO_TCPV4;
|
||||
+ skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count;
|
||||
+
|
||||
+ __skb_incr_checksum_unnecessary(skb);
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
th->check = ~tcp_v4_check(skb->len - thoff, iph->saddr,
|
||||
iph->daddr, 0);
|
||||
skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;
|
||||
--- a/net/ipv4/udp_offload.c
|
||||
+++ b/net/ipv4/udp_offload.c
|
||||
@@ -433,33 +433,6 @@ out:
|
||||
return segs;
|
||||
}
|
||||
|
||||
-static int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb)
|
||||
-{
|
||||
- if (unlikely(p->len + skb->len >= 65536))
|
||||
- return -E2BIG;
|
||||
-
|
||||
- if (NAPI_GRO_CB(p)->last == p)
|
||||
- skb_shinfo(p)->frag_list = skb;
|
||||
- else
|
||||
- NAPI_GRO_CB(p)->last->next = skb;
|
||||
-
|
||||
- skb_pull(skb, skb_gro_offset(skb));
|
||||
-
|
||||
- NAPI_GRO_CB(p)->last = skb;
|
||||
- NAPI_GRO_CB(p)->count++;
|
||||
- p->data_len += skb->len;
|
||||
-
|
||||
- /* sk ownership - if any - completely transferred to the aggregated packet */
|
||||
- skb->destructor = NULL;
|
||||
- skb->sk = NULL;
|
||||
- p->truesize += skb->truesize;
|
||||
- p->len += skb->len;
|
||||
-
|
||||
- NAPI_GRO_CB(skb)->same_flow = 1;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
|
||||
#define UDP_GRO_CNT_MAX 64
|
||||
static struct sk_buff *udp_gro_receive_segment(struct list_head *head,
|
||||
--- a/net/ipv6/tcpv6_offload.c
|
||||
+++ b/net/ipv6/tcpv6_offload.c
|
||||
@@ -7,24 +7,67 @@
|
||||
*/
|
||||
#include <linux/indirect_call_wrapper.h>
|
||||
#include <linux/skbuff.h>
|
||||
+#include <net/inet6_hashtables.h>
|
||||
#include <net/gro.h>
|
||||
#include <net/protocol.h>
|
||||
#include <net/tcp.h>
|
||||
#include <net/ip6_checksum.h>
|
||||
#include "ip6_offload.h"
|
||||
|
||||
+static void tcp6_check_fraglist_gro(struct list_head *head, struct sk_buff *skb,
|
||||
+ struct tcphdr *th)
|
||||
+{
|
||||
+#if IS_ENABLED(CONFIG_IPV6)
|
||||
+ const struct ipv6hdr *hdr;
|
||||
+ struct sk_buff *p;
|
||||
+ struct sock *sk;
|
||||
+ struct net *net;
|
||||
+ int iif, sdif;
|
||||
+
|
||||
+ if (!(skb->dev->features & NETIF_F_GRO_FRAGLIST))
|
||||
+ return;
|
||||
+
|
||||
+ p = tcp_gro_lookup(head, th);
|
||||
+ if (p) {
|
||||
+ NAPI_GRO_CB(skb)->is_flist = NAPI_GRO_CB(p)->is_flist;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ inet6_get_iif_sdif(skb, &iif, &sdif);
|
||||
+ hdr = skb_gro_network_header(skb);
|
||||
+ net = dev_net(skb->dev);
|
||||
+ sk = __inet6_lookup_established(net, net->ipv4.tcp_death_row.hashinfo,
|
||||
+ &hdr->saddr, th->source,
|
||||
+ &hdr->daddr, ntohs(th->dest),
|
||||
+ iif, sdif);
|
||||
+ NAPI_GRO_CB(skb)->is_flist = !sk;
|
||||
+ if (sk)
|
||||
+ sock_put(sk);
|
||||
+#endif /* IS_ENABLED(CONFIG_IPV6) */
|
||||
+}
|
||||
+
|
||||
INDIRECT_CALLABLE_SCOPE
|
||||
struct sk_buff *tcp6_gro_receive(struct list_head *head, struct sk_buff *skb)
|
||||
{
|
||||
+ struct tcphdr *th;
|
||||
+
|
||||
/* Don't bother verifying checksum if we're going to flush anyway. */
|
||||
if (!NAPI_GRO_CB(skb)->flush &&
|
||||
skb_gro_checksum_validate(skb, IPPROTO_TCP,
|
||||
- ip6_gro_compute_pseudo)) {
|
||||
- NAPI_GRO_CB(skb)->flush = 1;
|
||||
- return NULL;
|
||||
- }
|
||||
+ ip6_gro_compute_pseudo))
|
||||
+ goto flush;
|
||||
|
||||
- return tcp_gro_receive(head, skb);
|
||||
+ th = tcp_gro_pull_header(skb);
|
||||
+ if (!th)
|
||||
+ goto flush;
|
||||
+
|
||||
+ tcp6_check_fraglist_gro(head, skb, th);
|
||||
+
|
||||
+ return tcp_gro_receive(head, skb, th);
|
||||
+
|
||||
+flush:
|
||||
+ NAPI_GRO_CB(skb)->flush = 1;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
INDIRECT_CALLABLE_SCOPE int tcp6_gro_complete(struct sk_buff *skb, int thoff)
|
||||
@@ -32,6 +75,15 @@ INDIRECT_CALLABLE_SCOPE int tcp6_gro_com
|
||||
const struct ipv6hdr *iph = ipv6_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
|
||||
+ if (unlikely(NAPI_GRO_CB(skb)->is_flist)) {
|
||||
+ skb_shinfo(skb)->gso_type |= SKB_GSO_FRAGLIST | SKB_GSO_TCPV6;
|
||||
+ skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count;
|
||||
+
|
||||
+ __skb_incr_checksum_unnecessary(skb);
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
th->check = ~tcp_v6_check(skb->len - thoff, &iph->saddr,
|
||||
&iph->daddr, 0);
|
||||
skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV6;
|
||||
@@ -40,6 +92,61 @@ INDIRECT_CALLABLE_SCOPE int tcp6_gro_com
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void __tcpv6_gso_segment_csum(struct sk_buff *seg,
|
||||
+ __be16 *oldport, __be16 newport)
|
||||
+{
|
||||
+ struct tcphdr *th;
|
||||
+
|
||||
+ if (*oldport == newport)
|
||||
+ return;
|
||||
+
|
||||
+ th = tcp_hdr(seg);
|
||||
+ inet_proto_csum_replace2(&th->check, seg, *oldport, newport, false);
|
||||
+ *oldport = newport;
|
||||
+}
|
||||
+
|
||||
+static struct sk_buff *__tcpv6_gso_segment_list_csum(struct sk_buff *segs)
|
||||
+{
|
||||
+ const struct tcphdr *th;
|
||||
+ const struct ipv6hdr *iph;
|
||||
+ struct sk_buff *seg;
|
||||
+ struct tcphdr *th2;
|
||||
+ struct ipv6hdr *iph2;
|
||||
+
|
||||
+ seg = segs;
|
||||
+ th = tcp_hdr(seg);
|
||||
+ iph = ipv6_hdr(seg);
|
||||
+ th2 = tcp_hdr(seg->next);
|
||||
+ iph2 = ipv6_hdr(seg->next);
|
||||
+
|
||||
+ if (!(*(const u32 *)&th->source ^ *(const u32 *)&th2->source) &&
|
||||
+ ipv6_addr_equal(&iph->saddr, &iph2->saddr) &&
|
||||
+ ipv6_addr_equal(&iph->daddr, &iph2->daddr))
|
||||
+ return segs;
|
||||
+
|
||||
+ while ((seg = seg->next)) {
|
||||
+ th2 = tcp_hdr(seg);
|
||||
+ iph2 = ipv6_hdr(seg);
|
||||
+
|
||||
+ iph2->saddr = iph->saddr;
|
||||
+ iph2->daddr = iph->daddr;
|
||||
+ __tcpv6_gso_segment_csum(seg, &th2->source, th->source);
|
||||
+ __tcpv6_gso_segment_csum(seg, &th2->dest, th->dest);
|
||||
+ }
|
||||
+
|
||||
+ return segs;
|
||||
+}
|
||||
+
|
||||
+static struct sk_buff *__tcp6_gso_segment_list(struct sk_buff *skb,
|
||||
+ netdev_features_t features)
|
||||
+{
|
||||
+ skb = skb_segment_list(skb, features, skb_mac_header_len(skb));
|
||||
+ if (IS_ERR(skb))
|
||||
+ return skb;
|
||||
+
|
||||
+ return __tcpv6_gso_segment_list_csum(skb);
|
||||
+}
|
||||
+
|
||||
static struct sk_buff *tcp6_gso_segment(struct sk_buff *skb,
|
||||
netdev_features_t features)
|
||||
{
|
||||
@@ -51,6 +158,9 @@ static struct sk_buff *tcp6_gso_segment(
|
||||
if (!pskb_may_pull(skb, sizeof(*th)))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
+ if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST)
|
||||
+ return __tcp6_gso_segment_list(skb, features);
|
||||
+
|
||||
if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
|
||||
const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 27 Apr 2024 18:54:25 +0200
|
||||
Subject: [PATCH] net: bridge: fix multicast-to-unicast with fraglist GSO
|
||||
|
||||
Calling skb_copy on a SKB_GSO_FRAGLIST skb is not valid, since it returns
|
||||
an invalid linearized skb. This code only needs to change the ethernet
|
||||
header, so pskb_copy is the right function to call here.
|
||||
|
||||
Fixes: 6db6f0eae605 ("bridge: multicast to unicast")
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/net/bridge/br_forward.c
|
||||
+++ b/net/bridge/br_forward.c
|
||||
@@ -266,7 +266,7 @@ static void maybe_deliver_addr(struct ne
|
||||
if (skb->dev == p->dev && ether_addr_equal(src, addr))
|
||||
return;
|
||||
|
||||
- skb = skb_copy(skb, GFP_ATOMIC);
|
||||
+ skb = pskb_copy(skb, GFP_ATOMIC);
|
||||
if (!skb) {
|
||||
DEV_STATS_INC(dev, tx_dropped);
|
||||
return;
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 27 Apr 2024 19:29:45 +0200
|
||||
Subject: [PATCH] net: core: reject skb_copy(_expand) for fraglist GSO skbs
|
||||
|
||||
SKB_GSO_FRAGLIST skbs must not be linearized, otherwise they become
|
||||
invalid. Return NULL if such an skb is passed to skb_copy or
|
||||
skb_copy_expand, in order to prevent a crash on a potential later
|
||||
call to skb_gso_segment.
|
||||
|
||||
Fixes: 3a1296a38d0c ("net: Support GRO/GSO fraglist chaining.")
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/net/core/skbuff.c
|
||||
+++ b/net/core/skbuff.c
|
||||
@@ -1971,11 +1971,17 @@ static inline int skb_alloc_rx_flag(cons
|
||||
|
||||
struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask)
|
||||
{
|
||||
- int headerlen = skb_headroom(skb);
|
||||
- unsigned int size = skb_end_offset(skb) + skb->data_len;
|
||||
- struct sk_buff *n = __alloc_skb(size, gfp_mask,
|
||||
- skb_alloc_rx_flag(skb), NUMA_NO_NODE);
|
||||
+ struct sk_buff *n;
|
||||
+ unsigned int size;
|
||||
+ int headerlen;
|
||||
|
||||
+ if (WARN_ON_ONCE(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST))
|
||||
+ return NULL;
|
||||
+
|
||||
+ headerlen = skb_headroom(skb);
|
||||
+ size = skb_end_offset(skb) + skb->data_len;
|
||||
+ n = __alloc_skb(size, gfp_mask,
|
||||
+ skb_alloc_rx_flag(skb), NUMA_NO_NODE);
|
||||
if (!n)
|
||||
return NULL;
|
||||
|
||||
@@ -2303,12 +2309,17 @@ struct sk_buff *skb_copy_expand(const st
|
||||
/*
|
||||
* Allocate the copy buffer
|
||||
*/
|
||||
- struct sk_buff *n = __alloc_skb(newheadroom + skb->len + newtailroom,
|
||||
- gfp_mask, skb_alloc_rx_flag(skb),
|
||||
- NUMA_NO_NODE);
|
||||
- int oldheadroom = skb_headroom(skb);
|
||||
int head_copy_len, head_copy_off;
|
||||
+ struct sk_buff *n;
|
||||
+ int oldheadroom;
|
||||
+
|
||||
+ if (WARN_ON_ONCE(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST))
|
||||
+ return NULL;
|
||||
|
||||
+ oldheadroom = skb_headroom(skb);
|
||||
+ n = __alloc_skb(newheadroom + skb->len + newtailroom,
|
||||
+ gfp_mask, skb_alloc_rx_flag(skb),
|
||||
+ NUMA_NO_NODE);
|
||||
if (!n)
|
||||
return NULL;
|
||||
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
From 844c273286f328acf0dab5fbd5d864366b4904dc Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Tue, 30 Mar 2021 18:21:14 +0200
|
||||
Subject: [PATCH] of_net: add mac-address-increment support
|
||||
|
||||
Lots of embedded devices use the mac-address of other interface
|
||||
extracted from nvmem cells and increments it by one or two. Add two
|
||||
bindings to integrate this and directly use the right mac-address for
|
||||
the interface. Some example are some routers that use the gmac
|
||||
mac-address stored in the art partition and increments it by one for the
|
||||
wifi. mac-address-increment-byte bindings is used to tell what byte of
|
||||
the mac-address has to be increased (if not defined the last byte is
|
||||
increased) and mac-address-increment tells how much the byte decided
|
||||
early has to be increased.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
net/core/of_net.c | 43 +++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 39 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/net/core/of_net.c
|
||||
+++ b/net/core/of_net.c
|
||||
@@ -121,28 +121,63 @@ EXPORT_SYMBOL(of_get_mac_address_nvmem);
|
||||
* this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
|
||||
* but is all zeros.
|
||||
*
|
||||
+ * DT can tell the system to increment the mac-address after is extracted by
|
||||
+ * using:
|
||||
+ * - mac-address-increment-byte to decide what byte to increase
|
||||
+ * (if not defined is increased the last byte)
|
||||
+ * - mac-address-increment to decide how much to increase. The value WILL
|
||||
+ * overflow to other bytes if the increment is over 255 or the total
|
||||
+ * increment will exceed 255 of the current byte.
|
||||
+ * (example 00:01:02:03:04:ff + 1 == 00:01:02:03:05:00)
|
||||
+ * (example 00:01:02:03:04:fe + 5 == 00:01:02:03:05:03)
|
||||
+ *
|
||||
* Return: 0 on success and errno in case of error.
|
||||
*/
|
||||
int of_get_mac_address(struct device_node *np, u8 *addr)
|
||||
{
|
||||
+ u32 inc_idx, mac_inc, mac_val;
|
||||
int ret;
|
||||
|
||||
+ /* Check first if the increment byte is present and valid.
|
||||
+ * If not set assume to increment the last byte if found.
|
||||
+ */
|
||||
+ if (of_property_read_u32(np, "mac-address-increment-byte", &inc_idx))
|
||||
+ inc_idx = 5;
|
||||
+ if (inc_idx < 3 || inc_idx > 5)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
if (!np)
|
||||
return -ENODEV;
|
||||
|
||||
ret = of_get_mac_addr(np, "mac-address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
ret = of_get_mac_addr(np, "local-mac-address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
ret = of_get_mac_addr(np, "address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
+
|
||||
+ ret = of_get_mac_address_nvmem(np, addr);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+found:
|
||||
+ if (!of_property_read_u32(np, "mac-address-increment", &mac_inc)) {
|
||||
+ /* Convert to a contiguous value */
|
||||
+ mac_val = (addr[3] << 16) + (addr[4] << 8) + addr[5];
|
||||
+ mac_val += mac_inc << 8 * (5-inc_idx);
|
||||
+
|
||||
+ /* Apply the incremented value handling overflow case */
|
||||
+ addr[3] = (mac_val >> 16) & 0xff;
|
||||
+ addr[4] = (mac_val >> 8) & 0xff;
|
||||
+ addr[5] = (mac_val >> 0) & 0xff;
|
||||
+ }
|
||||
|
||||
- return of_get_mac_address_nvmem(np, addr);
|
||||
+ return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(of_get_mac_address);
|
||||
|
||||
@@ -45,11 +45,31 @@ property. This way, the MAC address can be accessed using procfs.
|
||||
/**
|
||||
* of_get_mac_address()
|
||||
* @np: Caller's Device Node
|
||||
@@ -177,6 +198,7 @@ found:
|
||||
addr[5] = (mac_val >> 0) & 0xff;
|
||||
}
|
||||
@@ -132,17 +153,23 @@ int of_get_mac_address(struct device_nod
|
||||
|
||||
+ of_add_mac_address(np, addr);
|
||||
return ret;
|
||||
ret = of_get_mac_addr(np, "mac-address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
ret = of_get_mac_addr(np, "local-mac-address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
ret = of_get_mac_addr(np, "address", addr);
|
||||
if (!ret)
|
||||
- return 0;
|
||||
+ goto found;
|
||||
|
||||
- return of_get_mac_address_nvmem(np, addr);
|
||||
+ ret = of_get_mac_address_nvmem(np, addr);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+found:
|
||||
+ ret = of_add_mac_address(np, addr);
|
||||
+ return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(of_get_mac_address);
|
||||
|
||||
|
||||
+4
-4
@@ -177,15 +177,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
sd->backlog.weight = weight_p;
|
||||
--- a/net/core/sysctl_net_core.c
|
||||
+++ b/net/core/sysctl_net_core.c
|
||||
@@ -30,6 +30,7 @@ static int int_3600 = 3600;
|
||||
static int min_sndbuf = SOCK_MIN_SNDBUF;
|
||||
@@ -31,6 +31,7 @@ static int min_sndbuf = SOCK_MIN_SNDBUF;
|
||||
static int min_rcvbuf = SOCK_MIN_RCVBUF;
|
||||
static int max_skb_frags = MAX_SKB_FRAGS;
|
||||
static int min_mem_pcpu_rsv = SK_MEMORY_PCPU_RESERVE;
|
||||
+static int backlog_threaded;
|
||||
|
||||
static int net_msg_warn; /* Unused, but still a sysctl */
|
||||
|
||||
@@ -188,6 +189,23 @@ static int rps_sock_flow_sysctl(struct c
|
||||
@@ -189,6 +190,23 @@ static int rps_sock_flow_sysctl(struct c
|
||||
}
|
||||
#endif /* CONFIG_RPS */
|
||||
|
||||
@@ -209,7 +209,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
#ifdef CONFIG_NET_FLOW_LIMIT
|
||||
static DEFINE_MUTEX(flow_limit_update_mutex);
|
||||
|
||||
@@ -532,6 +550,15 @@ static struct ctl_table net_core_table[]
|
||||
@@ -541,6 +559,15 @@ static struct ctl_table net_core_table[]
|
||||
.proc_handler = rps_sock_flow_sysctl
|
||||
},
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -6887,6 +6887,7 @@ static int mv88e6xxx_register_switch(str
|
||||
@@ -6935,6 +6935,7 @@ static int mv88e6xxx_register_switch(str
|
||||
ds->ops = &mv88e6xxx_switch_ops;
|
||||
ds->ageing_time_min = chip->info->age_time_coeff;
|
||||
ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX;
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
|
||||
static int kernel_init(void *);
|
||||
|
||||
extern void init_IRQ(void);
|
||||
@@ -905,6 +909,18 @@ asmlinkage __visible void __init __no_sa
|
||||
@@ -903,6 +907,18 @@ asmlinkage __visible void __init __no_sa
|
||||
pr_notice("Kernel command line: %s\n", saved_command_line);
|
||||
/* parameters may set static keys */
|
||||
jump_label_init();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -556,6 +556,7 @@
|
||||
@@ -559,6 +559,7 @@
|
||||
compatible = "mediatek,mt7622-nor",
|
||||
"mediatek,mt8173-nor";
|
||||
reg = <0 0x11014000 0 0xe0>;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -550,6 +550,18 @@
|
||||
@@ -553,6 +553,18 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -337,7 +337,7 @@
|
||||
@@ -339,7 +339,7 @@
|
||||
#interrupt-cells = <3>;
|
||||
interrupt-parent = <&gic>;
|
||||
reg = <0 0x10310000 0 0x1000>,
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -938,6 +938,7 @@
|
||||
@@ -942,6 +942,7 @@
|
||||
clock-names = "hsdma";
|
||||
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
|
||||
#dma-cells = <1>;
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi
|
||||
@@ -916,64 +916,67 @@
|
||||
@@ -915,64 +915,67 @@
|
||||
};
|
||||
};
|
||||
|
||||
@@ -194,7 +194,7 @@ Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
|
||||
&pio {
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -804,75 +804,83 @@
|
||||
@@ -809,75 +809,83 @@
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -844,6 +844,12 @@
|
||||
@@ -849,6 +849,12 @@
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
};
|
||||
@@ -13,7 +13,7 @@
|
||||
};
|
||||
|
||||
pcie1: pcie@1a145000 {
|
||||
@@ -882,6 +888,12 @@
|
||||
@@ -887,6 +893,12 @@
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
};
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -832,6 +832,9 @@
|
||||
@@ -837,6 +837,9 @@
|
||||
bus-range = <0x00 0xff>;
|
||||
ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x8000000>;
|
||||
status = "disabled";
|
||||
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
@@ -876,6 +879,9 @@
|
||||
@@ -881,6 +884,9 @@
|
||||
bus-range = <0x00 0xff>;
|
||||
ranges = <0x82000000 0 0x28000000 0x0 0x28000000 0 0x8000000>;
|
||||
status = "disabled";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -578,6 +578,7 @@
|
||||
@@ -575,6 +575,7 @@
|
||||
compatible = "mediatek,mt7622-nor",
|
||||
"mediatek,mt8173-nor";
|
||||
reg = <0 0x11014000 0 0xe0>;
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -346,7 +346,7 @@
|
||||
@@ -344,7 +344,7 @@
|
||||
#interrupt-cells = <3>;
|
||||
interrupt-parent = <&gic>;
|
||||
reg = <0 0x10310000 0 0x1000>,
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -849,6 +849,12 @@
|
||||
@@ -844,6 +844,12 @@
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
};
|
||||
@@ -13,7 +13,7 @@
|
||||
};
|
||||
|
||||
pcie1: pcie@1a145000 {
|
||||
@@ -887,6 +893,12 @@
|
||||
@@ -882,6 +888,12 @@
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
};
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
|
||||
@@ -837,6 +837,9 @@
|
||||
@@ -832,6 +832,9 @@
|
||||
bus-range = <0x00 0xff>;
|
||||
ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x8000000>;
|
||||
status = "disabled";
|
||||
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
@@ -881,6 +884,9 @@
|
||||
@@ -876,6 +879,9 @@
|
||||
bus-range = <0x00 0xff>;
|
||||
ranges = <0x82000000 0 0x28000000 0x0 0x28000000 0 0x8000000>;
|
||||
status = "disabled";
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
|
||||
static int kernel_init(void *);
|
||||
|
||||
extern void init_IRQ(void);
|
||||
@@ -903,6 +907,18 @@ asmlinkage __visible void __init __no_sa
|
||||
@@ -901,6 +905,18 @@ asmlinkage __visible void __init __no_sa
|
||||
page_alloc_init();
|
||||
|
||||
pr_notice("Kernel command line: %s\n", saved_command_line);
|
||||
|
||||
+1
-1
@@ -168,7 +168,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
|
||||
static int kernel_init(void *);
|
||||
|
||||
extern void init_IRQ(void);
|
||||
@@ -903,6 +907,18 @@ asmlinkage __visible void __init __no_sa
|
||||
@@ -901,6 +905,18 @@ asmlinkage __visible void __init __no_sa
|
||||
page_alloc_init();
|
||||
|
||||
pr_notice("Kernel command line: %s\n", saved_command_line);
|
||||
|
||||
@@ -1849,7 +1849,7 @@
|
||||
+obj-$(CONFIG_PHYTIUM_IXIC) += irq-phytium-ixic.o
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -4787,6 +4787,7 @@ static void its_restore_enable(void)
|
||||
@@ -4792,6 +4792,7 @@ static void its_restore_enable(void)
|
||||
{
|
||||
struct its_node *its;
|
||||
int ret;
|
||||
@@ -1857,7 +1857,7 @@
|
||||
|
||||
raw_spin_lock(&its_lock);
|
||||
list_for_each_entry(its, &its_nodes, entry) {
|
||||
@@ -4840,6 +4841,23 @@ static void its_restore_enable(void)
|
||||
@@ -4845,6 +4846,23 @@ static void its_restore_enable(void)
|
||||
GITS_TYPER_HCC(gic_read_typer(base + GITS_TYPER)))
|
||||
its_cpu_init_collection(its);
|
||||
}
|
||||
|
||||
+5
-5
@@ -138,7 +138,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
if (alloc_lpis) {
|
||||
lpi_map = its_lpi_alloc(nvecs, &lpi_base, &nr_lpis);
|
||||
if (lpi_map)
|
||||
@@ -4721,6 +4758,13 @@ static bool __maybe_unused its_enable_qu
|
||||
@@ -4726,6 +4763,13 @@ static bool __maybe_unused its_enable_qu
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
static const struct gic_quirk its_quirks[] = {
|
||||
#ifdef CONFIG_CAVIUM_ERRATUM_22375
|
||||
{
|
||||
@@ -4767,6 +4811,14 @@ static const struct gic_quirk its_quirks
|
||||
@@ -4772,6 +4816,14 @@ static const struct gic_quirk its_quirks
|
||||
.init = its_enable_quirk_hip07_161600802,
|
||||
},
|
||||
#endif
|
||||
@@ -167,7 +167,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -4990,6 +5042,7 @@ static int __init its_probe_one(struct r
|
||||
@@ -4995,6 +5047,7 @@ static int __init its_probe_one(struct r
|
||||
u64 baser, tmp, typer;
|
||||
struct page *page;
|
||||
int err;
|
||||
@@ -175,7 +175,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
|
||||
its_base = ioremap(res->start, SZ_64K);
|
||||
if (!its_base) {
|
||||
@@ -5058,7 +5111,9 @@ static int __init its_probe_one(struct r
|
||||
@@ -5063,7 +5116,9 @@ static int __init its_probe_one(struct r
|
||||
|
||||
its->numa_node = numa_node;
|
||||
|
||||
@@ -186,7 +186,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
get_order(ITS_CMD_QUEUE_SZ));
|
||||
if (!page) {
|
||||
err = -ENOMEM;
|
||||
@@ -5089,6 +5144,9 @@ static int __init its_probe_one(struct r
|
||||
@@ -5094,6 +5149,9 @@ static int __init its_probe_one(struct r
|
||||
gits_write_cbaser(baser, its->base + GITS_CBASER);
|
||||
tmp = gits_read_cbaser(its->base + GITS_CBASER);
|
||||
|
||||
|
||||
+5
-5
@@ -138,7 +138,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
if (alloc_lpis) {
|
||||
lpi_map = its_lpi_alloc(nvecs, &lpi_base, &nr_lpis);
|
||||
if (lpi_map)
|
||||
@@ -4731,6 +4768,13 @@ static bool __maybe_unused its_enable_qu
|
||||
@@ -4726,6 +4763,13 @@ static bool __maybe_unused its_enable_qu
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
static const struct gic_quirk its_quirks[] = {
|
||||
#ifdef CONFIG_CAVIUM_ERRATUM_22375
|
||||
{
|
||||
@@ -4777,6 +4821,14 @@ static const struct gic_quirk its_quirks
|
||||
@@ -4772,6 +4816,14 @@ static const struct gic_quirk its_quirks
|
||||
.init = its_enable_quirk_hip07_161600802,
|
||||
},
|
||||
#endif
|
||||
@@ -167,7 +167,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -5032,6 +5084,7 @@ static int __init its_probe_one(struct r
|
||||
@@ -5027,6 +5079,7 @@ static int __init its_probe_one(struct r
|
||||
struct page *page;
|
||||
u32 ctlr;
|
||||
int err;
|
||||
@@ -175,7 +175,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
|
||||
its_base = its_map_one(res, &err);
|
||||
if (!its_base)
|
||||
@@ -5085,7 +5138,9 @@ static int __init its_probe_one(struct r
|
||||
@@ -5080,7 +5133,9 @@ static int __init its_probe_one(struct r
|
||||
|
||||
its->numa_node = numa_node;
|
||||
|
||||
@@ -186,7 +186,7 @@ Subject: [PATCH] irqchip: gic-v3: add hackaround for rk3568 its
|
||||
get_order(ITS_CMD_QUEUE_SZ));
|
||||
if (!page) {
|
||||
err = -ENOMEM;
|
||||
@@ -5116,6 +5171,9 @@ static int __init its_probe_one(struct r
|
||||
@@ -5111,6 +5166,9 @@ static int __init its_probe_one(struct r
|
||||
gits_write_cbaser(baser, its->base + GITS_CBASER);
|
||||
tmp = gits_read_cbaser(its->base + GITS_CBASER);
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -4757,11 +4757,13 @@ static bool __maybe_unused its_enable_qu
|
||||
@@ -4752,11 +4752,13 @@ static bool __maybe_unused its_enable_qu
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
!of_machine_is_compatible("rockchip,rk3588s"))
|
||||
return false;
|
||||
|
||||
@@ -4827,10 +4829,10 @@ static const struct gic_quirk its_quirks
|
||||
@@ -4822,10 +4824,10 @@ static const struct gic_quirk its_quirks
|
||||
#endif
|
||||
#ifdef CONFIG_ROCKCHIP_ERRATUM_3588001
|
||||
{
|
||||
|
||||
Generated
+47
-41
@@ -93,47 +93,48 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anstream"
|
||||
version = "0.6.13"
|
||||
version = "0.6.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb"
|
||||
checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"anstyle-parse",
|
||||
"anstyle-query",
|
||||
"anstyle-wincon",
|
||||
"colorchoice",
|
||||
"is_terminal_polyfill",
|
||||
"utf8parse",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anstyle"
|
||||
version = "1.0.6"
|
||||
version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc"
|
||||
checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
|
||||
|
||||
[[package]]
|
||||
name = "anstyle-parse"
|
||||
version = "0.2.3"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c"
|
||||
checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4"
|
||||
dependencies = [
|
||||
"utf8parse",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anstyle-query"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
|
||||
checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5"
|
||||
dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anstyle-wincon"
|
||||
version = "3.0.2"
|
||||
version = "3.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7"
|
||||
checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"windows-sys 0.52.0",
|
||||
@@ -176,15 +177,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.2.0"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
|
||||
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-rs"
|
||||
version = "1.7.0"
|
||||
version = "1.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5509d663b2c00ee421bda8d6a24d6c42e15970957de1701b8df9f6fbe5707df1"
|
||||
checksum = "8487b59d62764df8231cb371c459314df895b41756df457a1fb1243d65c89195"
|
||||
dependencies = [
|
||||
"aws-lc-sys",
|
||||
"mirai-annotations",
|
||||
@@ -194,9 +195,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-sys"
|
||||
version = "0.15.0"
|
||||
version = "0.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8d5d317212c2a78d86ba6622e969413c38847b62f48111f8b763af3dac2f9840"
|
||||
checksum = "c15eb61145320320eb919d9bab524617a7aa4216c78d342fae3a758bc33073e4"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"cc",
|
||||
@@ -236,9 +237,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.22.0"
|
||||
version = "0.22.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51"
|
||||
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
||||
|
||||
[[package]]
|
||||
name = "base64ct"
|
||||
@@ -528,9 +529,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "colorchoice"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
|
||||
checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
|
||||
|
||||
[[package]]
|
||||
name = "const-oid"
|
||||
@@ -1595,6 +1596,12 @@ dependencies = [
|
||||
"ipnet",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "is_terminal_polyfill"
|
||||
version = "1.70.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800"
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.12.1"
|
||||
@@ -1975,9 +1982,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.18"
|
||||
version = "0.2.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a"
|
||||
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
@@ -2180,9 +2187,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||
|
||||
[[package]]
|
||||
name = "pest"
|
||||
version = "2.7.9"
|
||||
version = "2.7.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95"
|
||||
checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"thiserror",
|
||||
@@ -2191,9 +2198,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pest_derive"
|
||||
version = "2.7.9"
|
||||
version = "2.7.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c"
|
||||
checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459"
|
||||
dependencies = [
|
||||
"pest",
|
||||
"pest_generator",
|
||||
@@ -2201,9 +2208,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pest_generator"
|
||||
version = "2.7.9"
|
||||
version = "2.7.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd"
|
||||
checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687"
|
||||
dependencies = [
|
||||
"pest",
|
||||
"pest_meta",
|
||||
@@ -2214,9 +2221,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pest_meta"
|
||||
version = "2.7.9"
|
||||
version = "2.7.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca"
|
||||
checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"pest",
|
||||
@@ -2607,7 +2614,7 @@ version = "0.12.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10"
|
||||
dependencies = [
|
||||
"base64 0.22.0",
|
||||
"base64 0.22.1",
|
||||
"bytes",
|
||||
"encoding_rs",
|
||||
"futures-channel",
|
||||
@@ -2856,7 +2863,7 @@ version = "2.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d"
|
||||
dependencies = [
|
||||
"base64 0.22.0",
|
||||
"base64 0.22.1",
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
@@ -2976,9 +2983,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.199"
|
||||
version = "1.0.200"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a"
|
||||
checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
@@ -2995,9 +3002,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.199"
|
||||
version = "1.0.200"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc"
|
||||
checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -3069,7 +3076,7 @@ dependencies = [
|
||||
"aes",
|
||||
"arc-swap",
|
||||
"async-trait",
|
||||
"base64 0.22.0",
|
||||
"base64 0.22.1",
|
||||
"blake3",
|
||||
"bloomfilter",
|
||||
"byte_string",
|
||||
@@ -3132,7 +3139,7 @@ dependencies = [
|
||||
name = "shadowsocks-rust"
|
||||
version = "1.18.3"
|
||||
dependencies = [
|
||||
"base64 0.22.0",
|
||||
"base64 0.22.1",
|
||||
"build-time",
|
||||
"byte_string",
|
||||
"byteorder",
|
||||
@@ -3653,16 +3660,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tokio-util"
|
||||
version = "0.7.10"
|
||||
version = "0.7.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15"
|
||||
checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -1,37 +1,10 @@
|
||||
<svg width="1027" height="1109" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" overflow="hidden">
|
||||
<defs>
|
||||
<filter id="fx0" x="-10%" y="-10%" width="120%" height="120%" filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse">
|
||||
<feComponentTransfer color-interpolation-filters="sRGB">
|
||||
<feFuncR type="discrete" tableValues="0 0" />
|
||||
<feFuncG type="discrete" tableValues="0 0" />
|
||||
<feFuncB type="discrete" tableValues="0 0" />
|
||||
<feFuncA type="linear" slope="0.4" intercept="0" />
|
||||
</feComponentTransfer>
|
||||
<feGaussianBlur stdDeviation="4.58333 4.58333" />
|
||||
</filter>
|
||||
<clipPath id="clip1">
|
||||
<rect x="692" y="855" width="1027" height="1109" />
|
||||
</clipPath>
|
||||
<clipPath id="clip2">
|
||||
<rect x="-2" y="-2" width="541" height="786" />
|
||||
</clipPath>
|
||||
<clipPath id="clip3">
|
||||
<rect x="0" y="0" width="535" height="782" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g clip-path="url(#clip1)" transform="translate(-692 -855)">
|
||||
<path d="M692 1191 692 1575.69C692 1640.41 731.499 1651.19 731.499 1651.19L1148.03 1931.62C1212.66 1974.77 1194.71 1881.29 1194.71 1881.29L1194.71 1528.96 692 1191Z" fill="#37474F" fill-rule="evenodd" />
|
||||
<g clip-path="url(#clip2)" filter="url(#fx0)" transform="translate(1184 1182)">
|
||||
<g clip-path="url(#clip3)">
|
||||
<path d="M520.482 15.4819 520.482 400.176C520.482 464.89 480.983 475.676 480.983 475.676 480.983 475.676 129.086 712.963 64.4523 756.106-0.181814 799.25 17.7721 705.773 17.7721 705.773L17.7721 353.437 520.482 15.4819Z" fill="#455A64" fill-rule="evenodd" />
|
||||
</g>
|
||||
</g>
|
||||
<path d="M1698 1191 1698 1575.69C1698 1640.41 1658.5 1651.19 1658.5 1651.19 1658.5 1651.19 1306.6 1888.48 1241.97 1931.62 1177.34 1974.77 1195.29 1881.29 1195.29 1881.29L1195.29 1528.96 1698 1191Z" fill="#455A64" fill-rule="evenodd" />
|
||||
<path d="M1241.71 868.473C1212.96 850.509 1169.85 850.509 1144.7 868.473L713.557 1163.07C684.814 1181.04 684.814 1213.37 713.557 1231.33L1144.7 1529.53C1173.44 1547.49 1216.56 1547.49 1241.71 1529.53L1676.44 1227.74C1705.19 1209.78 1705.19 1177.44 1676.44 1159.48L1241.71 868.473Z" fill="#546E7A" fill-rule="evenodd" />
|
||||
<path d="M1195 1949C1173.4 1949 1159 1935.19 1159 1917.92L1159 1531.08C1159 1513.82 1173.4 1500 1195 1500 1216.6 1500 1231 1513.82 1231 1531.08L1231 1914.46C1231 1935.19 1216.6 1949 1195 1949Z" fill="#546E7A" fill-rule="evenodd" />
|
||||
<path d="M1553.92 1435.92C1553.92 1471.89 1557.5 1486.27 1518.03 1511.45L1428.32 1568.99C1388.85 1594.17 1374.5 1572.59 1374.5 1540.22L1374.5 1446.71C1374.5 1439.52 1374.5 1435.92 1363.73 1428.73 1270.43 1363.99 911.591 1115.84 847 1069.09L1012.07 954C1058.72 982.772 1399.61 1209.35 1539.56 1306.45 1546.74 1310.05 1550.33 1317.24 1550.33 1320.84L1550.33 1435.92Z" fill="#99AAB5" fill-rule="evenodd" />
|
||||
<path d="M1543.41 1310.21C1399.82 1213.17 1058.79 986.752 1015.72 958L951.103 997.534 847 1069.41C911.615 1116.14 1270.59 1360.53 1363.92 1425.22 1371.1 1428.81 1371.1 1432.41 1371.1 1436L1547 1313.8C1547 1313.8 1547 1310.21 1543.41 1310.21Z" fill="#CCD6DD" fill-rule="evenodd" />
|
||||
<path d="M1554.9 1435.48 1554.9 1324.19C1554.9 1317.01 1551.3 1313.42 1544.11 1309.83 1400.28 1212.89 1058.67 986.721 1015.51 958L940 1008.26C1062.26 1090.83 1389.49 1306.24 1475.79 1367.27 1486.58 1374.45 1486.58 1381.63 1486.58 1385.22L1486.58 1536 1522.54 1510.87C1558.5 1485.74 1554.9 1467.79 1554.9 1435.48Z" fill="#CCD6DD" fill-rule="evenodd" />
|
||||
<path d="M1543.23 1309.95C1399.6 1212.98 1058.49 986.731 1015.4 958L940 1008.28C1062.08 1090.88 1388.83 1306.36 1475.01 1367.41 1475.01 1367.41 1478.6 1371 1478.6 1371L1554 1317.13C1546.82 1313.54 1546.82 1309.95 1543.23 1309.95Z" fill="#E1E8ED" fill-rule="evenodd" />
|
||||
</g>
|
||||
</svg>
|
||||
<svg width="1000" height="1000" viewBox="0 0 1000 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M45.0161 306.871V653.437C45.0161 701.5 80.5373 723.002 80.5373 723.002L455 976.685L456.679 977.823C457.277 978.228 481.417 994.62 482 995C496 982.5 500 933.49 500 933.49V614.93L45.0161 306.871Z" fill="#37474F"/>
|
||||
<path d="M954.984 306.871V653.437C954.984 698 920.438 723.002 920.438 723.002C920.438 723.002 609.663 933.226 545.793 976.5C545.114 976.96 544.463 977.401 543.841 977.823C543.219 978.244 518.5 995 517 995.5C503 981.5 500 933.49 500 933.49V614.93L954.984 306.871Z" fill="#455A64"/>
|
||||
<path d="M541.891 12.8124C517.419 -4.27081 477.283 -4.27081 452.779 12.8124L63.3781 279.675C38.874 296.759 38.874 324.68 63.3781 341.735L454.112 611.875C478.616 628.93 518.752 628.93 543.256 611.875L936.622 339.383C961.126 322.327 961.126 294.406 936.622 277.323L541.891 12.8124Z" fill="#546E7A"/>
|
||||
<path d="M500 999.999C482.061 999.999 467.501 986.501 467.501 969.81V607.785C467.501 591.093 482.061 577.595 500 577.595C517.972 577.595 532.499 591.093 532.499 607.785V969.81C532.499 986.501 517.972 999.999 500 999.999Z" fill="#546E7A"/>
|
||||
<path d="M824.989 526.321C824.989 557.239 828.368 572.418 792.49 594.71L712.25 647.304C676.371 669.624 662.494 650.469 662.494 619.523V536.599C662.494 531.194 661.649 525.397 653.46 519.572C569.678 460.06 244.364 237.39 185.086 196.278L335.394 93.2744C376.537 119.207 684.854 324.374 813.841 411.891C820.244 416.26 824.989 421.077 824.989 426.342V526.321Z" fill="#99AAB5"/>
|
||||
<path d="M813.809 411.891C684.854 324.374 376.537 119.207 335.394 93.2744L279.463 131.586L185.086 196.278C244.397 237.39 569.678 460.06 653.46 519.572C657.408 522.17 660.243 525.825 661.519 529.962L821.836 418.892C819.578 416.228 816.873 413.869 813.809 411.891Z" fill="#CCD6DD"/>
|
||||
<path d="M824.989 526.321V426.342C824.989 421.077 820.244 416.288 813.809 411.891C684.854 324.374 376.537 119.207 335.394 93.2744L268.023 139.455C378.292 214.201 673.642 410.575 750.956 463.561C759.276 469.274 759.991 475.183 759.991 480.588V616.022L792.49 594.71C828.369 572.39 824.989 557.239 824.989 526.321Z" fill="#CCD6DD"/>
|
||||
<path d="M813.809 411.891C684.854 324.374 376.537 119.207 335.394 93.2744L268.023 139.455C378.292 214.201 673.641 410.575 750.956 463.561C752.159 464.373 752.906 465.213 753.784 466.026L821.836 418.893C819.578 416.228 816.873 413.869 813.809 411.891Z" fill="#E1E8ED"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -21,13 +21,13 @@ define Download/geoip
|
||||
HASH:=2f7516c0f853625e0a7ca932f534eb6d963f4287d4a2c585b1d193b4bb0a0f4f
|
||||
endef
|
||||
|
||||
GEOSITE_VER:=20240504082351
|
||||
GEOSITE_VER:=20240505044033
|
||||
GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
|
||||
define Download/geosite
|
||||
URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
|
||||
URL_FILE:=dlc.dat
|
||||
FILE:=$(GEOSITE_FILE)
|
||||
HASH:=a4d70989c3928289f07528894f29788d7844bdbfb450dd6597595d1d0210881d
|
||||
HASH:=dea8bd0adad25dad733ed813bfbab7015ca8231aa09f23c7c511bd24b302da32
|
||||
endef
|
||||
|
||||
GEOSITE_IRAN_VER:=202404290026
|
||||
|
||||
@@ -178,7 +178,7 @@ func (r *AuthenticationReader) readInternal(soft bool, mb *buf.MultiBuffer) erro
|
||||
return errSoft
|
||||
}
|
||||
|
||||
if size <= buf.Size {
|
||||
if effectiveSize <= buf.Size {
|
||||
b, err := r.readBuffer(effectiveSize, int32(padding))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -62,6 +62,9 @@ func (a AES128GCMMethod) GetUDPClientProcessor(ipsk [][]byte, psk []byte, deriva
|
||||
}
|
||||
return aead
|
||||
}
|
||||
if len(ipsk) == 0 {
|
||||
return NewAESUDPClientPacketProcessor(reqSeparateHeaderCipher, respSeparateHeaderCipher, getPacketAEAD, nil), nil
|
||||
}
|
||||
eihGenerator := newAESEIHGeneratorContainer(len(ipsk), psk, ipsk)
|
||||
getEIH := func(mask []byte) ExtensibleIdentityHeaders {
|
||||
eih, err := eihGenerator.GenerateEIHUDP(derivation, a, mask)
|
||||
|
||||
@@ -62,6 +62,9 @@ func (a AES256GCMMethod) GetUDPClientProcessor(ipsk [][]byte, psk []byte, deriva
|
||||
}
|
||||
return aead
|
||||
}
|
||||
if len(ipsk) == 0 {
|
||||
return NewAESUDPClientPacketProcessor(reqSeparateHeaderCipher, respSeparateHeaderCipher, getPacketAEAD, nil), nil
|
||||
}
|
||||
eihGenerator := newAESEIHGeneratorContainer(len(ipsk), psk, ipsk)
|
||||
getEIH := func(mask []byte) ExtensibleIdentityHeaders {
|
||||
eih, err := eihGenerator.GenerateEIHUDP(derivation, a, mask)
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"io"
|
||||
gonet "net"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v5/transport/internet/transportcommon"
|
||||
|
||||
@@ -119,7 +120,14 @@ func (h *httpTripperServer) Start() error {
|
||||
}
|
||||
h.listener = listener
|
||||
go func() {
|
||||
err := http.Serve(listener, h)
|
||||
httpServer := http.Server{
|
||||
ReadHeaderTimeout: 15 * time.Second,
|
||||
ReadTimeout: 15 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
IdleTimeout: 30 * time.Second,
|
||||
}
|
||||
httpServer.Handler = h
|
||||
err := httpServer.Serve(h.listener)
|
||||
if err != nil {
|
||||
newError("unable to serve listener for http tripper server").Base(err).WriteToLog()
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user