sync with OpenBSD -current
This commit is contained in:
parent
991d31b9d0
commit
99745de747
62 changed files with 774 additions and 285 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: identcpu.c,v 1.143 2024/05/14 01:42:07 guenther Exp $ */
|
||||
/* $OpenBSD: identcpu.c,v 1.144 2024/06/16 14:01:26 kn Exp $ */
|
||||
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -727,7 +727,8 @@ identifycpu(struct cpu_info *ci)
|
|||
}
|
||||
|
||||
#ifndef SMALL_KERNEL
|
||||
if (CPU_IS_PRIMARY(ci) && (ci->ci_feature_tpmflags & TPM_SENSOR)) {
|
||||
if (CPU_IS_PRIMARY(ci) && (ci->ci_feature_tpmflags & TPM_SENSOR) &&
|
||||
ci->ci_vendor == CPUV_INTEL) {
|
||||
ci->ci_sensor.type = SENSOR_TEMP;
|
||||
sensor_task_register(ci, intelcore_update_sensor, 5);
|
||||
sensor_attach(&ci->ci_sensordev, &ci->ci_sensor);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: efiboot.c,v 1.51 2024/06/14 19:49:17 kettenis Exp $ */
|
||||
/* $OpenBSD: efiboot.c,v 1.52 2024/06/17 09:36:04 kettenis Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
|
||||
|
@ -101,8 +101,7 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
|
|||
/* disable reset by watchdog after 5 minutes */
|
||||
BS->SetWatchdogTimer(0, 0, 0, NULL);
|
||||
|
||||
status = BS->HandleProtocol(image, &imgp_guid,
|
||||
(void **)&imgp);
|
||||
status = BS->HandleProtocol(image, &imgp_guid, (void **)&imgp);
|
||||
if (status == EFI_SUCCESS)
|
||||
status = BS->HandleProtocol(imgp->DeviceHandle, &devp_guid,
|
||||
(void **)&dp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: conf.c,v 1.35 2024/03/10 15:37:54 kettenis Exp $ */
|
||||
/* $OpenBSD: conf.c,v 1.36 2024/06/17 09:12:45 kettenis Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Michael Shalayeff
|
||||
|
@ -42,7 +42,7 @@
|
|||
#include "efidev.h"
|
||||
#include "efipxe.h"
|
||||
|
||||
const char version[] = "1.22";
|
||||
const char version[] = "1.23";
|
||||
int debug = 0;
|
||||
|
||||
struct fs_ops file_system[] = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: efiboot.c,v 1.40 2022/12/22 15:44:02 kettenis Exp $ */
|
||||
/* $OpenBSD: efiboot.c,v 1.41 2024/06/17 09:12:45 kettenis Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
|
||||
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "efidev.h"
|
||||
#include "efiboot.h"
|
||||
#include "efidt.h"
|
||||
#include "fdt.h"
|
||||
|
||||
EFI_SYSTEM_TABLE *ST;
|
||||
|
@ -59,6 +60,7 @@ static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL;
|
|||
static EFI_GUID devp_guid = DEVICE_PATH_PROTOCOL;
|
||||
static EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
|
||||
static EFI_GUID fdt_guid = FDT_TABLE_GUID;
|
||||
static EFI_GUID dt_fixup_guid = EFI_DT_FIXUP_PROTOCOL_GUID;
|
||||
|
||||
#define efi_guidcmp(_a, _b) memcmp((_a), (_b), sizeof(EFI_GUID))
|
||||
|
||||
|
@ -1004,12 +1006,18 @@ efi_fdt(void)
|
|||
return fdt_sys;
|
||||
}
|
||||
|
||||
#define EXTRA_DT_SPACE (32 * 1024)
|
||||
|
||||
int
|
||||
fdt_load_override(char *file)
|
||||
{
|
||||
EFI_DT_FIXUP_PROTOCOL *dt_fixup;
|
||||
EFI_PHYSICAL_ADDRESS addr;
|
||||
char path[MAXPATHLEN];
|
||||
EFI_STATUS status;
|
||||
struct stat sb;
|
||||
size_t dt_size;
|
||||
UINTN sz;
|
||||
int fd;
|
||||
|
||||
if (file == NULL && fdt_override) {
|
||||
|
@ -1027,7 +1035,8 @@ fdt_load_override(char *file)
|
|||
printf("cannot open %s\n", path);
|
||||
return 0;
|
||||
}
|
||||
if (efi_memprobe_find(EFI_SIZE_TO_PAGES(sb.st_size),
|
||||
dt_size = sb.st_size + EXTRA_DT_SPACE;
|
||||
if (efi_memprobe_find(EFI_SIZE_TO_PAGES(dt_size),
|
||||
PAGE_SIZE, EfiLoaderData, &addr) != EFI_SUCCESS) {
|
||||
printf("cannot allocate memory for %s\n", path);
|
||||
return 0;
|
||||
|
@ -1037,9 +1046,18 @@ fdt_load_override(char *file)
|
|||
return 0;
|
||||
}
|
||||
|
||||
status = BS->LocateProtocol(&dt_fixup_guid, NULL, (void **)&dt_fixup);
|
||||
if (status == EFI_SUCCESS) {
|
||||
sz = dt_size;
|
||||
status = dt_fixup->Fixup(dt_fixup, (void *)addr, &sz,
|
||||
EFI_DT_APPLY_FIXUPS | EFI_DT_RESERVE_MEMORY);
|
||||
if (status != EFI_SUCCESS)
|
||||
panic("DT fixup failed: 0x%lx", status);
|
||||
}
|
||||
|
||||
if (!fdt_init((void *)addr)) {
|
||||
printf("invalid device tree\n");
|
||||
BS->FreePages(addr, EFI_SIZE_TO_PAGES(sb.st_size));
|
||||
BS->FreePages(addr, EFI_SIZE_TO_PAGES(dt_size));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1050,7 +1068,7 @@ fdt_load_override(char *file)
|
|||
}
|
||||
|
||||
fdt_override = (void *)addr;
|
||||
fdt_override_size = sb.st_size;
|
||||
fdt_override_size = dt_size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
44
sys/arch/armv7/stand/efiboot/efidt.h
Normal file
44
sys/arch/armv7/stand/efiboot/efidt.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/* $OpenBSD: efidt.h,v 1.1 2024/06/17 09:12:45 kettenis Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2024 Mark Kettenis <kettenis@openbsd.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <efi.h>
|
||||
#include <efiapi.h>
|
||||
|
||||
#define EFI_DT_FIXUP_PROTOCOL_GUID \
|
||||
{ 0xe617d64c, 0xfe08, 0x46da, \
|
||||
{ 0xf4, 0xdc, 0xbb, 0xd5, 0x87, 0x0c, 0x73, 0x00 } }
|
||||
|
||||
INTERFACE_DECL(_EFI_DT_FIXUP_PROTOCOL);
|
||||
|
||||
typedef EFI_STATUS
|
||||
(EFIAPI *EFI_DT_FIXUP) (
|
||||
IN struct _EFI_DT_FIXUP_PROTOCOL *This,
|
||||
IN VOID *Fdt,
|
||||
IN OUT UINTN *BufferSize,
|
||||
IN UINT32 Flags
|
||||
);
|
||||
|
||||
#define EFI_DT_APPLY_FIXUPS 0x00000001
|
||||
#define EFI_DT_RESERVE_MEMORY 0x00000002
|
||||
|
||||
typedef struct _EFI_DT_FIXUP_PROTOCOL {
|
||||
UINT64 Revision;
|
||||
EFI_DT_FIXUP Fixup;
|
||||
} EFI_DT_FIXUP_PROTOCOL;
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ahci_pci.c,v 1.17 2024/05/24 06:02:53 jsg Exp $ */
|
||||
/* $OpenBSD: ahci_pci.c,v 1.18 2024/06/16 18:00:08 kn Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
|
||||
|
@ -71,6 +71,8 @@ int ahci_intel_attach(struct ahci_softc *,
|
|||
struct pci_attach_args *);
|
||||
int ahci_samsung_attach(struct ahci_softc *,
|
||||
struct pci_attach_args *);
|
||||
int ahci_storx_attach(struct ahci_softc *,
|
||||
struct pci_attach_args *);
|
||||
|
||||
static const struct ahci_device ahci_devices[] = {
|
||||
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HUDSON2_SATA_1,
|
||||
|
@ -148,7 +150,10 @@ static const struct ahci_device ahci_devices[] = {
|
|||
NULL, ahci_samsung_attach },
|
||||
|
||||
{ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8251_SATA,
|
||||
ahci_no_match, ahci_vt8251_attach }
|
||||
ahci_no_match, ahci_vt8251_attach },
|
||||
|
||||
{ PCI_VENDOR_ZHAOXIN, PCI_PRODUCT_ZHAOXIN_STORX_AHCI,
|
||||
NULL, ahci_storx_attach },
|
||||
};
|
||||
|
||||
int ahci_pci_match(struct device *, void *, void *);
|
||||
|
@ -285,6 +290,19 @@ ahci_samsung_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
ahci_storx_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
|
||||
{
|
||||
/*
|
||||
* Disable MSI with the ZX-100/ZX-200/ZX-E StorX AHCI Controller
|
||||
* in the Unchartevice 6640MA notebook, otherwise ahci(4) hangs
|
||||
* with SATA speed set to "Gen3" in BIOS.
|
||||
*/
|
||||
sc->sc_flags |= AHCI_F_NO_MSI;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
ahci_pci_match(struct device *parent, void *match, void *aux)
|
||||
{
|
||||
|
|
|
@ -1135,7 +1135,8 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem,
|
|||
int ret;
|
||||
|
||||
ctx->sync = &mem->sync;
|
||||
drm_exec_init(&ctx->exec, DRM_EXEC_INTERRUPTIBLE_WAIT);
|
||||
drm_exec_init(&ctx->exec, DRM_EXEC_INTERRUPTIBLE_WAIT |
|
||||
DRM_EXEC_IGNORE_DUPLICATES);
|
||||
drm_exec_until_all_locked(&ctx->exec) {
|
||||
ctx->n_vms = 0;
|
||||
list_for_each_entry(entry, &mem->attachments, list) {
|
||||
|
|
|
@ -211,6 +211,7 @@ union igp_info {
|
|||
struct atom_integrated_system_info_v1_11 v11;
|
||||
struct atom_integrated_system_info_v1_12 v12;
|
||||
struct atom_integrated_system_info_v2_1 v21;
|
||||
struct atom_integrated_system_info_v2_3 v23;
|
||||
};
|
||||
|
||||
union umc_info {
|
||||
|
@ -359,6 +360,20 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
|
|||
if (vram_type)
|
||||
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
|
||||
break;
|
||||
case 3:
|
||||
mem_channel_number = igp_info->v23.umachannelnumber;
|
||||
if (!mem_channel_number)
|
||||
mem_channel_number = 1;
|
||||
mem_type = igp_info->v23.memorytype;
|
||||
if (mem_type == LpDdr5MemType)
|
||||
mem_channel_width = 32;
|
||||
else
|
||||
mem_channel_width = 64;
|
||||
if (vram_width)
|
||||
*vram_width = mem_channel_number * mem_channel_width;
|
||||
if (vram_type)
|
||||
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
@ -2031,6 +2031,9 @@ static int sdma_v4_0_process_trap_irq(struct amdgpu_device *adev,
|
|||
|
||||
DRM_DEBUG("IH: SDMA trap\n");
|
||||
instance = sdma_v4_0_irq_id_to_seq(entry->client_id);
|
||||
if (instance < 0)
|
||||
return instance;
|
||||
|
||||
switch (entry->ring_id) {
|
||||
case 0:
|
||||
amdgpu_fence_process(&adev->sdma.instance[instance].ring);
|
||||
|
|
|
@ -402,15 +402,8 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf)
|
|||
f2g = &gfx_v11_kfd2kgd;
|
||||
break;
|
||||
case IP_VERSION(11, 0, 3):
|
||||
if ((adev->pdev->device == 0x7460 &&
|
||||
adev->pdev->revision == 0x00) ||
|
||||
(adev->pdev->device == 0x7461 &&
|
||||
adev->pdev->revision == 0x00))
|
||||
/* Note: Compiler version is 11.0.5 while HW version is 11.0.3 */
|
||||
gfx_target_version = 110005;
|
||||
else
|
||||
/* Note: Compiler version is 11.0.1 while HW version is 11.0.3 */
|
||||
gfx_target_version = 110001;
|
||||
/* Note: Compiler version is 11.0.1 while HW version is 11.0.3 */
|
||||
gfx_target_version = 110001;
|
||||
f2g = &gfx_v11_kfd2kgd;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -1625,6 +1625,49 @@ struct atom_integrated_system_info_v2_2
|
|||
uint32_t reserved4[189];
|
||||
};
|
||||
|
||||
struct uma_carveout_option {
|
||||
char optionName[29]; //max length of string is 28chars + '\0'. Current design is for "minimum", "Medium", "High". This makes entire struct size 64bits
|
||||
uint8_t memoryCarvedGb; //memory carved out with setting
|
||||
uint8_t memoryRemainingGb; //memory remaining on system
|
||||
union {
|
||||
struct _flags {
|
||||
uint8_t Auto : 1;
|
||||
uint8_t Custom : 1;
|
||||
uint8_t Reserved : 6;
|
||||
} flags;
|
||||
uint8_t all8;
|
||||
} uma_carveout_option_flags;
|
||||
};
|
||||
|
||||
struct atom_integrated_system_info_v2_3 {
|
||||
struct atom_common_table_header table_header;
|
||||
uint32_t vbios_misc; // enum of atom_system_vbiosmisc_def
|
||||
uint32_t gpucapinfo; // enum of atom_system_gpucapinf_def
|
||||
uint32_t system_config;
|
||||
uint32_t cpucapinfo;
|
||||
uint16_t gpuclk_ss_percentage; // unit of 0.001%, 1000 mean 1%
|
||||
uint16_t gpuclk_ss_type;
|
||||
uint16_t dpphy_override; // bit vector, enum of atom_sysinfo_dpphy_override_def
|
||||
uint8_t memorytype; // enum of atom_dmi_t17_mem_type_def, APU memory type indication.
|
||||
uint8_t umachannelnumber; // number of memory channels
|
||||
uint8_t htc_hyst_limit;
|
||||
uint8_t htc_tmp_limit;
|
||||
uint8_t reserved1; // dp_ss_control
|
||||
uint8_t gpu_package_id;
|
||||
struct edp_info_table edp1_info;
|
||||
struct edp_info_table edp2_info;
|
||||
uint32_t reserved2[8];
|
||||
struct atom_external_display_connection_info extdispconninfo;
|
||||
uint8_t UMACarveoutVersion;
|
||||
uint8_t UMACarveoutIndexMax;
|
||||
uint8_t UMACarveoutTypeDefault;
|
||||
uint8_t UMACarveoutIndexDefault;
|
||||
uint8_t UMACarveoutType; //Auto or Custom
|
||||
uint8_t UMACarveoutIndex;
|
||||
struct uma_carveout_option UMASizeControlOption[20];
|
||||
uint8_t reserved3[110];
|
||||
};
|
||||
|
||||
// system_config
|
||||
enum atom_system_vbiosmisc_def{
|
||||
INTEGRATED_SYSTEM_INFO__GET_EDID_CALLBACK_FUNC_SUPPORT = 0x01,
|
||||
|
|
|
@ -226,15 +226,17 @@ static int smu_v13_0_4_system_features_control(struct smu_context *smu, bool en)
|
|||
struct amdgpu_device *adev = smu->adev;
|
||||
int ret = 0;
|
||||
|
||||
if (!en && adev->in_s4) {
|
||||
/* Adds a GFX reset as workaround just before sending the
|
||||
* MP1_UNLOAD message to prevent GC/RLC/PMFW from entering
|
||||
* an invalid state.
|
||||
*/
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset,
|
||||
SMU_RESET_MODE_2, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!en && !adev->in_s0ix) {
|
||||
if (adev->in_s4) {
|
||||
/* Adds a GFX reset as workaround just before sending the
|
||||
* MP1_UNLOAD message to prevent GC/RLC/PMFW from entering
|
||||
* an invalid state.
|
||||
*/
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset,
|
||||
SMU_RESET_MODE_2, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = smu_cmn_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL);
|
||||
}
|
||||
|
|
|
@ -122,7 +122,6 @@ static int drm_fbdev_generic_helper_fb_probe(struct drm_fb_helper *fb_helper,
|
|||
/* screen */
|
||||
info->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST;
|
||||
info->screen_buffer = screen_buffer;
|
||||
info->fix.smem_start = page_to_phys(vmalloc_to_page(info->screen_buffer));
|
||||
info->fix.smem_len = screen_size;
|
||||
|
||||
#ifdef notyet
|
||||
|
|
|
@ -793,7 +793,7 @@ void i915_hwmon_register(struct drm_i915_private *i915)
|
|||
if (!IS_DGFX(i915))
|
||||
return;
|
||||
|
||||
hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL);
|
||||
hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL);
|
||||
if (!hwmon)
|
||||
return;
|
||||
|
||||
|
@ -819,14 +819,12 @@ void i915_hwmon_register(struct drm_i915_private *i915)
|
|||
hwm_get_preregistration_info(i915);
|
||||
|
||||
/* hwmon_dev points to device hwmon<i> */
|
||||
hwmon_dev = devm_hwmon_device_register_with_info(dev, ddat->name,
|
||||
ddat,
|
||||
&hwm_chip_info,
|
||||
hwm_groups);
|
||||
if (IS_ERR(hwmon_dev)) {
|
||||
i915->hwmon = NULL;
|
||||
return;
|
||||
}
|
||||
hwmon_dev = hwmon_device_register_with_info(dev, ddat->name,
|
||||
ddat,
|
||||
&hwm_chip_info,
|
||||
hwm_groups);
|
||||
if (IS_ERR(hwmon_dev))
|
||||
goto err;
|
||||
|
||||
ddat->hwmon_dev = hwmon_dev;
|
||||
|
||||
|
@ -839,16 +837,36 @@ void i915_hwmon_register(struct drm_i915_private *i915)
|
|||
if (!hwm_gt_is_visible(ddat_gt, hwmon_energy, hwmon_energy_input, 0))
|
||||
continue;
|
||||
|
||||
hwmon_dev = devm_hwmon_device_register_with_info(dev, ddat_gt->name,
|
||||
ddat_gt,
|
||||
&hwm_gt_chip_info,
|
||||
NULL);
|
||||
hwmon_dev = hwmon_device_register_with_info(dev, ddat_gt->name,
|
||||
ddat_gt,
|
||||
&hwm_gt_chip_info,
|
||||
NULL);
|
||||
if (!IS_ERR(hwmon_dev))
|
||||
ddat_gt->hwmon_dev = hwmon_dev;
|
||||
}
|
||||
return;
|
||||
err:
|
||||
i915_hwmon_unregister(i915);
|
||||
}
|
||||
|
||||
void i915_hwmon_unregister(struct drm_i915_private *i915)
|
||||
{
|
||||
fetch_and_zero(&i915->hwmon);
|
||||
struct i915_hwmon *hwmon = i915->hwmon;
|
||||
struct intel_gt *gt;
|
||||
int i;
|
||||
|
||||
if (!hwmon)
|
||||
return;
|
||||
|
||||
for_each_gt(gt, i915, i)
|
||||
if (hwmon->ddat_gt[i].hwmon_dev)
|
||||
hwmon_device_unregister(hwmon->ddat_gt[i].hwmon_dev);
|
||||
|
||||
if (hwmon->ddat.hwmon_dev)
|
||||
hwmon_device_unregister(hwmon->ddat.hwmon_dev);
|
||||
|
||||
mutex_destroy(&hwmon->hwmon_lock);
|
||||
|
||||
kfree(i915->hwmon);
|
||||
i915->hwmon = NULL;
|
||||
}
|
||||
|
|
|
@ -93,5 +93,5 @@
|
|||
#endif
|
||||
|
||||
#if defined(SUSPEND) || defined(HIBERNATE)
|
||||
#define CONFIG_PM_SLEEP
|
||||
#define CONFIG_PM_SLEEP 1
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_vmx.c,v 1.87 2024/06/07 08:44:25 jan Exp $ */
|
||||
/* $OpenBSD: if_vmx.c,v 1.88 2024/06/17 11:13:43 bluhm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 Tsubai Masanari
|
||||
|
@ -1619,6 +1619,8 @@ vmxnet3_start(struct ifqueue *ifq)
|
|||
rgen = ring->gen;
|
||||
|
||||
for (;;) {
|
||||
int hdrlen;
|
||||
|
||||
if (free <= NTXSEGS) {
|
||||
ifq_set_oactive(ifq);
|
||||
break;
|
||||
|
@ -1628,6 +1630,30 @@ vmxnet3_start(struct ifqueue *ifq)
|
|||
if (m == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Headers for Ether, IP, TCP including options must lay in
|
||||
* first mbuf to support TSO. Usually our stack gets that
|
||||
* right. To avoid packet parsing here, make a rough estimate
|
||||
* for simple IPv4. Cases seen in the wild contain only ether
|
||||
* header in separate mbuf. To support IPv6 with TCP options,
|
||||
* move as much as possible into first mbuf. Realloc mbuf
|
||||
* before bus dma load.
|
||||
*/
|
||||
hdrlen = sizeof(struct ether_header) + sizeof(struct ip) +
|
||||
sizeof(struct tcphdr);
|
||||
if (ISSET(m->m_pkthdr.csum_flags, M_TCP_TSO) &&
|
||||
m->m_len < hdrlen && hdrlen <= m->m_pkthdr.len) {
|
||||
hdrlen = MHLEN;
|
||||
/* m_pullup preserves alignment, reserve space */
|
||||
hdrlen -= mtod(m, unsigned long) & (sizeof(long) - 1);
|
||||
if (hdrlen > m->m_pkthdr.len)
|
||||
hdrlen = m->m_pkthdr.len;
|
||||
if ((m = m_pullup(m, hdrlen)) == NULL) {
|
||||
ifq->ifq_errors++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
map = ring->dmap[prod];
|
||||
|
||||
if (vmx_load_mbuf(sc->sc_dmat, map, m) != 0) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$OpenBSD: pcidevs,v 1.2076 2024/05/22 16:24:59 martijn Exp $
|
||||
$OpenBSD: pcidevs,v 1.2077 2024/06/16 16:20:51 kn Exp $
|
||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -346,6 +346,7 @@ vendor SYMPHONY2 0x1c1c Symphony Labs
|
|||
vendor SKHYNIX 0x1c5c SK hynix
|
||||
vendor ADATA 0x1cc1 ADATA Technology
|
||||
vendor UMIS 0x1cc4 Union Memory
|
||||
vendor ZHAOXIN 0x1d17 Zhaoxin
|
||||
vendor BAIKAL 0x1d39 Baikal Electronics
|
||||
vendor AQUANTIA 0x1d6a Aquantia
|
||||
vendor ROCKCHIP 0x1d87 Rockchip
|
||||
|
@ -10039,6 +10040,9 @@ product YMTC PC005 0x1001 PC005
|
|||
/* Zeinet products */
|
||||
product ZEINET 1221 0x0001 1221
|
||||
|
||||
/* Zhaoxin products */
|
||||
product ZHAOXIN STORX_AHCI 0x9083 StorX AHCI
|
||||
|
||||
/* Ziatech products */
|
||||
product ZIATECH ZT8905 0x8905 PCI-ST32
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
*
|
||||
* generated from:
|
||||
* OpenBSD: pcidevs,v 1.2075 2024/05/21 07:03:55 jsg Exp
|
||||
* OpenBSD: pcidevs,v 1.2077 2024/06/16 16:20:51 kn Exp
|
||||
*/
|
||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||
|
||||
|
@ -351,6 +351,7 @@
|
|||
#define PCI_VENDOR_SKHYNIX 0x1c5c /* SK hynix */
|
||||
#define PCI_VENDOR_ADATA 0x1cc1 /* ADATA Technology */
|
||||
#define PCI_VENDOR_UMIS 0x1cc4 /* Union Memory */
|
||||
#define PCI_VENDOR_ZHAOXIN 0x1d17 /* Zhaoxin */
|
||||
#define PCI_VENDOR_BAIKAL 0x1d39 /* Baikal Electronics */
|
||||
#define PCI_VENDOR_AQUANTIA 0x1d6a /* Aquantia */
|
||||
#define PCI_VENDOR_ROCKCHIP 0x1d87 /* Rockchip */
|
||||
|
@ -10044,6 +10045,9 @@
|
|||
/* Zeinet products */
|
||||
#define PCI_PRODUCT_ZEINET_1221 0x0001 /* 1221 */
|
||||
|
||||
/* Zhaoxin products */
|
||||
#define PCI_PRODUCT_ZHAOXIN_STORX_AHCI 0x9083 /* StorX AHCI */
|
||||
|
||||
/* Ziatech products */
|
||||
#define PCI_PRODUCT_ZIATECH_ZT8905 0x8905 /* PCI-ST32 */
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
*
|
||||
* generated from:
|
||||
* OpenBSD: pcidevs,v 1.2075 2024/05/21 07:03:55 jsg Exp
|
||||
* OpenBSD: pcidevs,v 1.2077 2024/06/16 16:20:51 kn Exp
|
||||
*/
|
||||
|
||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||
|
@ -36047,6 +36047,10 @@ static const struct pci_known_product pci_known_products[] = {
|
|||
PCI_VENDOR_ZEINET, PCI_PRODUCT_ZEINET_1221,
|
||||
"1221",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_ZHAOXIN, PCI_PRODUCT_ZHAOXIN_STORX_AHCI,
|
||||
"StorX AHCI",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_ZIATECH, PCI_PRODUCT_ZIATECH_ZT8905,
|
||||
"PCI-ST32",
|
||||
|
@ -37279,6 +37283,10 @@ static const struct pci_known_vendor pci_known_vendors[] = {
|
|||
PCI_VENDOR_UMIS,
|
||||
"Union Memory",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_ZHAOXIN,
|
||||
"Zhaoxin",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_BAIKAL,
|
||||
"Baikal Electronics",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue