-
Notifications
You must be signed in to change notification settings - Fork 0
add pseudo header split #2
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
base: ixgbevf-libeth
Are you sure you want to change the base?
add pseudo header split #2
Conversation
walking-machine
left a comment
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.
A lot of nits in this review, but one thing that needs to be fixed is I think there would be memory leaks for larger packets, because you always alloc the same number of header buffers as data buffers, but if we have 2 data buffers per packet, we only need 8 new header buffers per 16 new data buffers, the remaining 8 would be leaked. There several solutions to such a problem:
- If total packet size (
READ_ONCE(adapter->netdev->mtu) + LIBETH_RX_LL_LEN) is 3K or greater, do not use pseudo header split, I prefer this option - do separate
next_to_useandnext_to_cleanaccounting for header buffer
The solution is to recycle the buffer to the page pool just like in idpf and ice (
You mean during the configuration or on a per-packet basis? The latter is not possible: buffers from the data FQ have a different layout when created with the The initial idea of this W/A is that: if we can't fine-tune the HW-writable buffer len using a 128-byte stride, then we always create header pools, so that data pools always have pow-2 buffers (almost the same as
Please don't :D |
7e71a22 to
35f9f52
Compare
| #define IXGBEVF_RX_PAGE_LEN(hr) (ALIGN_DOWN(LIBETH_RX_PAGE_LEN(hr), \ | ||
| IXGBE_SRRCTL_BSIZEPKT_STEP)) | ||
|
|
||
| #define IXGBEVF_FLAG_PSEUDO_HSPLIT BIT(0) |
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.
I'd just name it HSPLIT maybe. Both pseudo and normal hsplit won't differ too much.
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.
But we do not have header split, so it would be confusing
35f9f52 to
68621c1
Compare
When MTU + LL is greater than 3K, it behaves just like any other ixgbevf HW, so it would not be per-packet (see, I have used netdev->mtu), as every packet buffer would have headroom + 3K + tailroom. Like the only advantage of the newer HW here is the packet size filter, which obviously does not help in case of bigger MTU.
|
68621c1 to
fa3678e
Compare
fa3678e to
395ae75
Compare
walking-machine
left a comment
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.
Overall looks fine to me
| struct page_pool *hdr_pp; | ||
|
|
||
| struct xdp_rxq_info xdp_rxq; | ||
|
|
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.
Newlines not related to the patch
| union ixgbe_adv_rx_desc *rx_desc; | ||
| struct libeth_fqe *rx_buffer; | ||
| struct libeth_fqe *hdr_buff; | ||
| unsigned int hdr_size = 0; |
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.
You can move it under if() now
| hdr_size = ixgbevf_rx_hsplit_wa(hdr_buff, | ||
| rx_buffer, | ||
| size); | ||
| size -= hdr_size ? : size; |
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.
So if we cannot copy from the buffer, we zero its size, so it is dropped?
This patch introduces pseudo header split support in the ixgbevf driver, specifically targeting ixgbe_mac_82599_vf. On older hardware (e.g. ixgbe_mac_82599_vf), RX DMA write size can only be limited in 1K increments. This causes issues when attempting to fit multiple packets per page, as a DMA write may overwrite the headroom of the next packet. To address this, introduce pseudo header split support, where the hardware copies the full L2 header into a dedicated header buffer. This avoids the need for HR/TR alignment and allows safe skb construction from the header buffer without risking overwrites. Signed-off-by: Natalia Wochtman <natalia.wochtman@intel.com>
395ae75 to
5341a01
Compare
No description provided.