-
Notifications
You must be signed in to change notification settings - Fork 92
[Deepin-Kernel-SIG] [linux 6.6-y] net: rnpm: fix compiler error of rnpm #874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Deepin-Kernel-SIG] [linux 6.6-y] net: rnpm: fix compiler error of rnpm #874
Conversation
fix compiler error of rnpm for mucse 4/8 ports ethernet card Signed-off-by: gu.huiguang <[email protected]>
Reviewer's GuideThis PR addresses compiler errors and improves code robustness by introducing a unified 64-bit DMA address variable for splitting high/low parts, refactoring RX ring reinitialization to use dynamic allocation, and correcting minor logic and return-value issues. Sequence Diagram for rnpm_rx_ring_reinit Resource ManagementsequenceDiagram
participant Caller
participant RRI as rnpm_rx_ring_reinit
participant KMem as Kernel Memory
participant RxResMgr as RX Resource Mgr
participant HW as Hardware IO
Caller->>RRI: rnpm_rx_ring_reinit(adapter, rx_ring)
opt If ring count not changed (rx_ring->count == rx_ring->reset_count)
RRI-->>Caller: return 0
end
RRI->>KMem: vmalloc(sizeof(struct rnpm_ring))
KMem-->>RRI: temp_ring_ptr
alt Allocation Fails (temp_ring_ptr is NULL)
RRI-->>Caller: return -ENOMEM
else Allocation Succeeded
RRI->>HW: rnpm_disable_rx_queue(adapter, rx_ring)
RRI->>RxResMgr: rnpm_setup_rx_resources(temp_ring_ptr, adapter)
RxResMgr-->>RRI: setup_status (err)
alt Setup Failed (err is true)
RRI->>RxResMgr: rnpm_free_rx_resources(temp_ring_ptr)
RRI->>KMem: vfree(temp_ring_ptr)
RRI->>HW: wr32(hw, RNPM_DMA_RX_START(...), 1) // Re-enable queue
RRI-->>Caller: return 0
else Setup Succeeded (err is false)
RRI->>RxResMgr: rnpm_free_rx_resources(rx_ring) // Free old resources
RRI->>HW: rnpm_configure_rx_ring(adapter, rx_ring) // Configure with new resources
RRI->>KMem: vfree(temp_ring_ptr)
RRI->>HW: wr32(hw, RNPM_DMA_RX_START(...), 1) // Re-enable queue
RRI-->>Caller: return 0
end
end
Updated Class Diagram for rnpm Driver C Modules and StructsclassDiagram
class rnpm_mbx_fw_c {
+rnpm_maintain_req(struct rnpm_hw* hw, int cmd, int arg0, int req_data_bytes, int reply_bytes, dma_addr_t dma_phy) int
+rnpm_mbx_get_dump(struct rnpm_hw* hw, int flags, u8* data_out, int bytes) int
+rnpm_fw_update(struct rnpm_hw* hw, int partition, const u8* fw_bin, int bytes) int
+rnpm_mbx_lane_link_changed_event_enable(struct rnpm_hw* hw, int enable) int
+rnpm_mbx_sdram_simm(struct rnpm_hw* hw, u32 flags, u32 offset, void* dma_buf, dma_addr_t dma_phy, u32 len) int
}
class rnpm_mbx_fw_h {
+build_ddr_csl(struct mbx_fw_cmd_req* req, void* cookie, bool enable, dma_addr_t dma_phy, int bytes) void
}
class rnpm_main_c {
+rnpm_rx_ring_reinit(struct rnpm_adapter* adapter, struct rnpm_ring* rx_ring) int
}
class rnpm_hw {
<<struct>>
}
class rnpm_adapter {
<<struct>>
}
class rnpm_ring {
<<struct>>
}
class mbx_fw_cmd_req {
<<struct>>
}
rnpm_mbx_fw_c ..> rnpm_hw : uses
rnpm_mbx_fw_h ..> mbx_fw_cmd_req : uses
rnpm_main_c ..> rnpm_adapter : uses
rnpm_main_c ..> rnpm_ring : uses
rnpm_adapter --> rnpm_hw : contains
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Hi @senbao. 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 Once the patch is verified, the new status will be reflected by the 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @senbao - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
e1691e9
into
deepin-community:linux-6.6.y
fix compiler error of rnpm for mucse N10/N400 4/8 ports ethernet card
Summary by Sourcery
Fix compiler errors in the rnpm driver for mucse Ethernet cards by introducing a 64-bit temporary for DMA address handling, correcting a faulty conditional, and refactoring RX ring reinitialization.
Bug Fixes:
address
variable to split 64-bit DMA addresses consistently across mailbox commands.single_lane_link_evt_ctrl_ablity
in lane link change event enable.Enhancements:
rnpm_rx_ring_reinit
to allocate the temporary ring dynamically with vmalloc/vfree and streamline resource setup and teardown.