Skip to content

Conversation

@linyuexie
Copy link

wangxun inclusion
category: feature

this driver is supported for wangxun WX1860 chips, and supports TSO, tx checksum, rx checksum, RSS, flow director, vlan insert, vlan strip, vlan filter offload.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @linyuexie, your pull request is larger than the review limit of 150000 diff characters

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign opsiff for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

Hi @linyuexie. Thanks for your PR. 😃

@deepin-ci-robot
Copy link

Hi @linyuexie. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Avenger-285714
Copy link
Member

/ok-to-test

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive driver support for WangXun 1G network adapters (WX1860 chips) to the Linux kernel 6.6-y branch. The driver introduces features including TSO, TX/RX checksumming, RSS, flow director, VLAN offloading, SR-IOV virtualization, XDP sockets, PTP timestamping, and hardware monitoring.

Key Changes:

  • Adds XDP socket support for AF_XDP zero-copy transmission/reception
  • Implements SR-IOV virtualization with VF management
  • Adds PTP timestamping support
  • Implements hardware temperature monitoring via sysfs/hwmon
  • Adds PCIe error recovery mechanisms
  • Extends PHY layer support for multiple PHY types

Reviewed changes

Copilot reviewed 21 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ngbe_xsk.h Header guard mismatch with filename; defines XDP socket interface
ngbe_xsk.c Implements XDP socket zero-copy operations
ngbe_type.h Dual copyright headers; comprehensive register definitions
ngbe_sysfs.c Dual copyright headers; hwmon interface implementation
ngbe_sriov.h Dual copyright headers; SR-IOV interface definitions
ngbe_sriov.c Dual copyright headers; SR-IOV implementation with spelling errors
ngbe_phy.h Dual copyright headers; PHY layer interface
ngbe_pcierr.h Minimal header for PCIe error handling
ngbe_pcierr.c PCIe error recovery implementation
ngbe_mdio.h Removes unused function declaration
Makefile Adds build targets and non-standard make rules

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

wangxun inclusion
category: feature

this driver is supported for wangxun WX1860 chips,
and supports TSO, tx checksum, rx checksum, RSS, flow director, vlan
insert, vlan strip, vlan filter offload.

Signed-off-by: linyuexie1 <[email protected]>
@deepin-ci-robot
Copy link

deepin pr auto review

The provided files are part of a network driver implementation for a WangXun Gigabit Ethernet adapter. Let me analyze the key components and their relationships:

File Structure and Purpose

1. ngbe_main.c (Main Driver Implementation)

  • Core driver initialization and management
  • Network device operations (open, stop, etc.)
  • Interrupt handling and queue management
  • Statistics and sysfs interfaces
  • SR-IOV (Single Root I/O Virtualization) support
  • XSK (XDP Socket) support for zero-copy networking

2. ngbe_type.h (Hardware Definitions)

  • Register definitions for the WangXun NGBE controller
  • Hardware constants and bit masks
  • MAC, PHY, and DMA register layouts
  • EEPROM and flash memory structures
  • Flow control and link status definitions

3. ngbe_sriov.h/.c (SR-IOV Implementation)

  • Virtual function management
  • VF (Virtual Function) configuration
  • MAC address and VLAN filtering for VFs
  • VF mailbox communication
  • Link state management for VFs

4. ngbe_sysfs.c (SystemFS Interface)

  • Hardware monitoring (temperature sensors)
  • Sysfs file creation for device attributes
  • Thermal sensor data exposure

5. ngbe_xsk.c (XDP Socket Support)

  • Zero-copy packet processing
  • XDP (eXpress Data Path) ring management
  • AF_XDP socket integration
  • DMA mapping for zero-copy buffers

Key Features

1. Multi-Queue Support

  • Supports multiple transmit/receive queues
  • RSS (Receive Side Scaling) for load balancing
  • Separate queues for different traffic types

2. SR-IOV Virtualization

  • Hardware-assisted virtualization
  • VF mailbox for communication between PF and VFs
  • Per-VF MAC address and VLAN filtering
  • VF link state management

3. Advanced Networking Features

  • Flow Director for packet filtering
  • RSS hash configuration
  • IEEE 1588 Precision Time Protocol (PTP) support
  • Energy Efficient Ethernet (EEE)

4. XDP Support

  • Zero-copy packet processing
  • BPF offload capabilities
  • High-performance packet forwarding

5. Hardware Monitoring

  • Temperature sensor monitoring
  • Error counters and statistics
  • Link status and speed monitoring

Architecture

The driver follows a typical Linux network driver architecture:

  1. Probe/Remove Functions - Device initialization and cleanup
  2. Netdev Operations - Standard network device operations
  3. Queue Management - Transmit/receive queue handling
  4. Interrupt Handling - MSI-X interrupt management
  5. Hardware Abstraction - Register access and configuration
  6. Sysfs Interfaces - Device attribute exposure

Notable Implementation Details

  1. Register Access Pattern:

    • Uses rd32()/wr32() macros for register access
    • Includes error checking for register reads
    • Memory barriers for ordering guarantees
  2. Queue Management:

    • Ring buffer descriptors for packet handling
    • Separate transmit and receive queue structures
    • Support for both legacy and XDP rings
  3. Interrupt Handling:

    • MSI-X interrupt vectors
    • Interrupt moderation settings
    • Per-queue interrupt handling
  4. Performance Optimizations:

    • Packet prefetching
    • Descriptor ring pre-allocation
    • DMA mapping optimization

Compilation and Integration

The driver is designed to integrate with the Linux kernel networking stack:

  • Uses standard net_device_ops structure
  • Implements NAPI for interrupt mitigation
  • Follows ethtool interface conventions
  • Supports sysfs for device attributes

This is a sophisticated network driver implementation that leverages hardware acceleration features while maintaining compatibility with standard Linux networking interfaces. The SR-IOV and XDP support make it suitable for virtualized environments and high-performance networking scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants