forked from alobakin/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Wb on itr newest fixes #6
Draft
michalQb
wants to merge
4
commits into
idpf-top
Choose a base branch
from
wb-on-itr-newest-fixes
base: idpf-top
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Commits on Mar 6, 2024
-
idpf-linux: refactor idpf_tx_buf structure
This patch does main 3 thngs: it 1) adds a mechanism to guard against stashing partial packets into the hash table, 2) uses a type field to more efficiently identify the information contained in any given tx_buf struct and what to do with it, 3) removes the 8 byte next_to_watch pointer in favor of a much smaller index field. This all makes the driver more robust, leads to more efficient decision making when cleaning, and makes the idpf_tx_buf struct more cache friendly. Part 1: don't stash partial packets. This can happen when an RE completion is received in flow scheduling mode, or when an out of order RS completion is received. The first buffer with the skb is stashed, but some or all of its frags are not because the stack is out of reserve buffers. This leaves the ring in a weird state since the frags are still on the ring. Add a field to track the number of fragments/ tx_bufs representing the packet. The clean routines check to make sure there are enough reserve buffers on the stack before stashing any part of the packet. If there are not, next_to_clean is left pointing to the first buffer of the packet that failed to be stashed. This leaves the whole packet on the ring, and the next time around, cleaning will start from this packet. An RS completion is still expected for this packet in either case. So instead of being cleaned from the hash table, it will be cleaned from the ring directly. This should all still be fine since the DESC_UNUSED and BUFS_UNUSED will reflect the state of the ring. If we ever fall below the thresholds, the TXQ will still be stopped, giving the completion queue time to catch up. This may lead to stopping the queue more frequently, but it guarantees the TX ring will always be in a good state. Also, always use the idpf_tx_splitq_clean function to clean descriptors, i.e. use it from clean_buf_ring as well. This way we avoid duplicating the logic and make sure we're using the same reserve buffers guard rail. Part 2: add a type field. Part of shrinking the tx_buf struct size required reverting the completion tag to a u16 instead of an int. The int was necessary so we could use -1 to indicate that a completion tag was invalid, and thus any tx_buf with an invalid completion tag was effectively empty / should be ignored. Instead, now use an explcit EMPTY type to indicate that a tx_buf is empty/should be ignored. This has the added benefit of eliminating the need to clear the tx_bufs of any stale data. The type can simply be set to EMPTY and the cleaning routines can simply move on. The invalid completion tag was also used to indicate that a tx_buf was empty because its corresponding index on the descriptor ring was used for a context descriptor. Now use an explicit RESERVED type to signal to the cleaning routines to skip that descriptor/tx_buf. Part 3: use a smaller end of packet field. To further reduce the size of the tx_buf struct, the 8 byte next_to_watch pointer is replaced with a 2 byte index. next_to_watch was used a pointer to the last descriptor of the packet. Instead, just use that descriptor's index as this can be represented with a much smaller type. Plus, now all of the cleaning routines use the same mechanism to loop through the rest of the packet. This does require a switch from the s16 next_to_clean overflow descriptor ring wrap calculation to u16 and the normal ring size check. Signed-off-by: Joshua Hay <[email protected]> Signed-off-by: Michal Kubiak <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5c00f15 - Browse repository at this point
Copy the full SHA 5c00f15View commit details -
Tell hardware to write back completed descriptors even when interrupts are disabled. Otherwise, descriptors might not be written back until the hardware can flush a full cacheline of descriptors. This can cause unnecessary delays when traffic is light (or even trigger Tx queue timeout). The example scenario to reproduce the Tx timeout if the fix is not applied: - configure at least 2 Tx queues to be assigned to the same q_vector, - generate a huge Tx traffic on the first Tx queue - try to send a few packets using the second Tx queue. In such a case Tx timeout will appear on the second Tx queue because no completion descriptors are written back for that queue while interrupts are disabled due to NAPI polling. The patch is necessary to start work on the AF_XDP implementation for the idpf driver, because there may be a case where a regular LAN Tx queue and an XDP queue share the same NAPI. Fixes: c2d548c ("idpf: add TX splitq napi poll support") Fixes: a5ab9ee ("idpf: add singleq start_xmit and napi poll") Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Alexander Lobakin <[email protected]> Signed-off-by: Joshua Hay <[email protected]> Co-developed-by: Michal Kubiak <[email protected]> Signed-off-by: Michal Kubiak <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dde052f - Browse repository at this point
Copy the full SHA dde052fView commit details
Commits on Mar 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for eb4bf16 - Browse repository at this point
Copy the full SHA eb4bf16View commit details
Commits on Mar 13, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2163fda - Browse repository at this point
Copy the full SHA 2163fdaView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.