forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
ixgbe: convert Rx to libeth and page_pool #6
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
Open
Magda-Pytel
wants to merge
25
commits into
ixgbevf-xdp-public
Choose a base branch
from
ixgbe-XDP-public
base: ixgbevf-xdp-public
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.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f2908e7
ixgbevf: remove legacy Rx
walking-machine d7bf74b
ixgbevf: do not share pages between packets
walking-machine 0cb83cd
ixgbevf: use libeth in Rx processing
walking-machine 93e53ab
ixgbevf: support XDP multi-buffer on Rx path
walking-machine 60a8d27
ixgbevf: XDP_TX in multi-buffer through libeth
walking-machine 57735ac
ixgbevf: support XDP_REDIRECT and .ndo_xdp_xmit
walking-machine d6ec774
ixgbevf: add pseudo header split
nwochtma 57d29b3
ixgbevf: reconfigure page pool when reallocating buffers
walking-machine e3676d7
ixgbevf: allow changing MTU when XDP program is attached
walking-machine 1160e99
ixgbevf: move skb-filling code to a header
walking-machine ad388e4
ixgbevf: implement AF_XDP ZC initialization
walking-machine a0ee7f6
ixgbevf: implement AF_XDP zero-copy Tx
walking-machine bcdbbdd
ixgbevf: implement AF_XDP zero-copy Rx
walking-machine e828d3a
ixgbevf: implement .ndo_xsk_wakeup() and set features
walking-machine 3176c41
ixgbevf: multi-buffer AF_XDP Tx
walking-machine 6dc49d1
ixgbe: remove legacy rx
Magda-Pytel 3536c94
ixgbe: do not share pages between packets
Magda-Pytel 4d7562c
ixgbe: use libeth in Rx processing
Magda-Pytel 97d1245
ixgbe: branch prediction and cleanup
Magda-Pytel d3a0b9d
ixgbe: support XDP multi-buffer on Rx path
Magda-Pytel ee84bfa
ixgbe: XDP_TX in multi-buffer through libeth
Magda-Pytel 8b4bb7a
ixgbe: support XDP_REDIRECT and .ndo_xdp_xmit through libeth
Magda-Pytel fcb4918
ixgbe: add pseudo header split
Magda-Pytel 6313904
ixgbe: reconfigure page pool when reallocating buffers
Magda-Pytel e0b9442
ixgbe: allow changing MTU when XDP program is attached
Magda-Pytel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,11 +132,9 @@ static const char ixgbe_gstrings_test[][ETH_GSTRING_LEN] = { | |
| #define IXGBE_TEST_LEN sizeof(ixgbe_gstrings_test) / ETH_GSTRING_LEN | ||
|
|
||
| static const char ixgbe_priv_flags_strings[][ETH_GSTRING_LEN] = { | ||
| #define IXGBE_PRIV_FLAGS_LEGACY_RX BIT(0) | ||
| "legacy-rx", | ||
| #define IXGBE_PRIV_FLAGS_VF_IPSEC_EN BIT(1) | ||
| #define IXGBE_PRIV_FLAGS_VF_IPSEC_EN BIT(0) | ||
| "vf-ipsec", | ||
| #define IXGBE_PRIV_FLAGS_AUTO_DISABLE_VF BIT(2) | ||
| #define IXGBE_PRIV_FLAGS_AUTO_DISABLE_VF BIT(1) | ||
| "mdd-disable-vf", | ||
| }; | ||
|
|
||
|
|
@@ -1951,7 +1949,6 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter) | |
| /* Setup Rx Descriptor ring and Rx buffers */ | ||
| rx_ring->count = IXGBE_DEFAULT_RXD; | ||
| rx_ring->queue_index = 0; | ||
| rx_ring->dev = &adapter->pdev->dev; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is still |
||
| rx_ring->netdev = adapter->netdev; | ||
| rx_ring->reg_idx = adapter->rx_ring[0]->reg_idx; | ||
|
|
||
|
|
@@ -2058,14 +2055,16 @@ static void ixgbe_create_lbtest_frame(struct sk_buff *skb, | |
| skb->data[frame_size + 12] = 0xAF; | ||
| } | ||
|
|
||
| static bool ixgbe_check_lbtest_frame(struct ixgbe_rx_buffer *rx_buffer, | ||
| static bool ixgbe_check_lbtest_frame(const struct libeth_fqe *rx_buffer, | ||
| unsigned int frame_size) | ||
| { | ||
| u32 hr = netmem_get_pp(rx_buffer->netmem)->p.offset; | ||
| unsigned char *data; | ||
|
|
||
| frame_size >>= 1; | ||
|
|
||
| data = page_address(rx_buffer->page) + rx_buffer->page_offset; | ||
| data = page_address(__netmem_to_page(rx_buffer->netmem)) + | ||
| rx_buffer->offset + hr; | ||
|
|
||
| return data[3] == 0xFF && data[frame_size + 10] == 0xBE && | ||
| data[frame_size + 12] == 0xAF; | ||
|
|
@@ -2113,28 +2112,22 @@ static u16 ixgbe_clean_test_rings(struct ixgbe_ring *rx_ring, | |
| } | ||
|
|
||
| while (rx_desc->wb.upper.length) { | ||
| struct ixgbe_rx_buffer *rx_buffer; | ||
| struct libeth_fqe *rx_buffer; | ||
|
|
||
| /* check Rx buffer */ | ||
| rx_buffer = &rx_ring->rx_buffer_info[rx_ntc]; | ||
| rx_buffer = &rx_ring->rx_fqes[rx_ntc]; | ||
|
|
||
| /* sync Rx buffer for CPU read */ | ||
| dma_sync_single_for_cpu(rx_ring->dev, | ||
| rx_buffer->dma, | ||
| ixgbe_rx_bufsz(rx_ring), | ||
| DMA_FROM_DEVICE); | ||
| libeth_rx_sync_for_cpu(rx_buffer, rx_ring->rx_buf_len); | ||
|
|
||
| /* verify contents of skb */ | ||
| if (ixgbe_check_lbtest_frame(rx_buffer, size)) | ||
| count++; | ||
| else | ||
| break; | ||
|
|
||
| /* sync Rx buffer for device write */ | ||
| dma_sync_single_for_device(rx_ring->dev, | ||
| rx_buffer->dma, | ||
| ixgbe_rx_bufsz(rx_ring), | ||
| DMA_FROM_DEVICE); | ||
| /* recycle the page back to the pool */ | ||
| libeth_rx_recycle_slow(rx_buffer->netmem); | ||
|
|
||
| /* increment Rx next to clean counter */ | ||
| rx_ntc++; | ||
|
|
@@ -3667,9 +3660,6 @@ static u32 ixgbe_get_priv_flags(struct net_device *netdev) | |
| struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev); | ||
| u32 priv_flags = 0; | ||
|
|
||
| if (adapter->flags2 & IXGBE_FLAG2_RX_LEGACY) | ||
| priv_flags |= IXGBE_PRIV_FLAGS_LEGACY_RX; | ||
|
|
||
| if (adapter->flags2 & IXGBE_FLAG2_VF_IPSEC_ENABLED) | ||
| priv_flags |= IXGBE_PRIV_FLAGS_VF_IPSEC_EN; | ||
|
|
||
|
|
@@ -3685,10 +3675,6 @@ static int ixgbe_set_priv_flags(struct net_device *netdev, u32 priv_flags) | |
| unsigned int flags2 = adapter->flags2; | ||
| unsigned int i; | ||
|
|
||
| flags2 &= ~IXGBE_FLAG2_RX_LEGACY; | ||
| if (priv_flags & IXGBE_PRIV_FLAGS_LEGACY_RX) | ||
| flags2 |= IXGBE_FLAG2_RX_LEGACY; | ||
|
|
||
| flags2 &= ~IXGBE_FLAG2_VF_IPSEC_ENABLED; | ||
| if (priv_flags & IXGBE_PRIV_FLAGS_VF_IPSEC_EN) | ||
| flags2 |= IXGBE_FLAG2_VF_IPSEC_ENABLED; | ||
|
|
||
Oops, something went wrong.
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.
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.
ring->xdp_progis still accessed thoughxdp_prog = READ_ONCE(rx_ring->xdp_prog);, butrcu_dereference()should be used.rx_ring->xdp_prog = NULL;could also utilizercu_assign_pointer()for consistency, although AFAIK sparse does not compain about that. Neither it complains about accesses like!!rx_ring->xdp_prog, so those can stay as-is, although I thinkrcu_access_pointer()can be used there (rcu_dereference()is only for NAPI and other high priority contexts).