diff options
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_txrx.c')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index d26d6836689d..a51aa37b7b5a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -896,6 +896,11 @@ static void i40e_clean_programming_status(struct i40e_ring *rx_ring, | |||
896 | 896 | ||
897 | if (id == I40E_RX_PROG_STATUS_DESC_FD_FILTER_STATUS) | 897 | if (id == I40E_RX_PROG_STATUS_DESC_FD_FILTER_STATUS) |
898 | i40e_fd_handle_status(rx_ring, rx_desc, id); | 898 | i40e_fd_handle_status(rx_ring, rx_desc, id); |
899 | #ifdef I40E_FCOE | ||
900 | else if ((id == I40E_RX_PROG_STATUS_DESC_FCOE_CTXT_PROG_STATUS) || | ||
901 | (id == I40E_RX_PROG_STATUS_DESC_FCOE_CTXT_INVL_STATUS)) | ||
902 | i40e_fcoe_handle_status(rx_ring, rx_desc, id); | ||
903 | #endif | ||
899 | } | 904 | } |
900 | 905 | ||
901 | /** | 906 | /** |
@@ -1489,6 +1494,12 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) | |||
1489 | vlan_tag = rx_status & (1 << I40E_RX_DESC_STATUS_L2TAG1P_SHIFT) | 1494 | vlan_tag = rx_status & (1 << I40E_RX_DESC_STATUS_L2TAG1P_SHIFT) |
1490 | ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) | 1495 | ? le16_to_cpu(rx_desc->wb.qword0.lo_dword.l2tag1) |
1491 | : 0; | 1496 | : 0; |
1497 | #ifdef I40E_FCOE | ||
1498 | if (!i40e_fcoe_handle_offload(rx_ring, rx_desc, skb)) { | ||
1499 | dev_kfree_skb_any(skb); | ||
1500 | goto next_desc; | ||
1501 | } | ||
1502 | #endif | ||
1492 | i40e_receive_skb(rx_ring, skb, vlan_tag); | 1503 | i40e_receive_skb(rx_ring, skb, vlan_tag); |
1493 | 1504 | ||
1494 | rx_ring->netdev->last_rx = jiffies; | 1505 | rx_ring->netdev->last_rx = jiffies; |
@@ -1719,9 +1730,15 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb, | |||
1719 | * Returns error code indicate the frame should be dropped upon error and the | 1730 | * Returns error code indicate the frame should be dropped upon error and the |
1720 | * otherwise returns 0 to indicate the flags has been set properly. | 1731 | * otherwise returns 0 to indicate the flags has been set properly. |
1721 | **/ | 1732 | **/ |
1733 | #ifdef I40E_FCOE | ||
1734 | int i40e_tx_prepare_vlan_flags(struct sk_buff *skb, | ||
1735 | struct i40e_ring *tx_ring, | ||
1736 | u32 *flags) | ||
1737 | #else | ||
1722 | static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb, | 1738 | static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb, |
1723 | struct i40e_ring *tx_ring, | 1739 | struct i40e_ring *tx_ring, |
1724 | u32 *flags) | 1740 | u32 *flags) |
1741 | #endif | ||
1725 | { | 1742 | { |
1726 | __be16 protocol = skb->protocol; | 1743 | __be16 protocol = skb->protocol; |
1727 | u32 tx_flags = 0; | 1744 | u32 tx_flags = 0; |
@@ -1743,9 +1760,8 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb, | |||
1743 | } | 1760 | } |
1744 | 1761 | ||
1745 | /* Insert 802.1p priority into VLAN header */ | 1762 | /* Insert 802.1p priority into VLAN header */ |
1746 | if ((tx_ring->vsi->back->flags & I40E_FLAG_DCB_ENABLED) && | 1763 | if ((tx_flags & (I40E_TX_FLAGS_HW_VLAN | I40E_TX_FLAGS_SW_VLAN)) || |
1747 | ((tx_flags & (I40E_TX_FLAGS_HW_VLAN | I40E_TX_FLAGS_SW_VLAN)) || | 1764 | (skb->priority != TC_PRIO_CONTROL)) { |
1748 | (skb->priority != TC_PRIO_CONTROL))) { | ||
1749 | tx_flags &= ~I40E_TX_FLAGS_VLAN_PRIO_MASK; | 1765 | tx_flags &= ~I40E_TX_FLAGS_VLAN_PRIO_MASK; |
1750 | tx_flags |= (skb->priority & 0x7) << | 1766 | tx_flags |= (skb->priority & 0x7) << |
1751 | I40E_TX_FLAGS_VLAN_PRIO_SHIFT; | 1767 | I40E_TX_FLAGS_VLAN_PRIO_SHIFT; |
@@ -2018,9 +2034,15 @@ static void i40e_create_tx_ctx(struct i40e_ring *tx_ring, | |||
2018 | * @td_cmd: the command field in the descriptor | 2034 | * @td_cmd: the command field in the descriptor |
2019 | * @td_offset: offset for checksum or crc | 2035 | * @td_offset: offset for checksum or crc |
2020 | **/ | 2036 | **/ |
2037 | #ifdef I40E_FCOE | ||
2038 | void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb, | ||
2039 | struct i40e_tx_buffer *first, u32 tx_flags, | ||
2040 | const u8 hdr_len, u32 td_cmd, u32 td_offset) | ||
2041 | #else | ||
2021 | static void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb, | 2042 | static void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb, |
2022 | struct i40e_tx_buffer *first, u32 tx_flags, | 2043 | struct i40e_tx_buffer *first, u32 tx_flags, |
2023 | const u8 hdr_len, u32 td_cmd, u32 td_offset) | 2044 | const u8 hdr_len, u32 td_cmd, u32 td_offset) |
2045 | #endif | ||
2024 | { | 2046 | { |
2025 | unsigned int data_len = skb->data_len; | 2047 | unsigned int data_len = skb->data_len; |
2026 | unsigned int size = skb_headlen(skb); | 2048 | unsigned int size = skb_headlen(skb); |
@@ -2197,7 +2219,11 @@ static inline int __i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size) | |||
2197 | * | 2219 | * |
2198 | * Returns 0 if stop is not needed | 2220 | * Returns 0 if stop is not needed |
2199 | **/ | 2221 | **/ |
2222 | #ifdef I40E_FCOE | ||
2223 | int i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size) | ||
2224 | #else | ||
2200 | static int i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size) | 2225 | static int i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size) |
2226 | #endif | ||
2201 | { | 2227 | { |
2202 | if (likely(I40E_DESC_UNUSED(tx_ring) >= size)) | 2228 | if (likely(I40E_DESC_UNUSED(tx_ring) >= size)) |
2203 | return 0; | 2229 | return 0; |
@@ -2213,8 +2239,13 @@ static int i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size) | |||
2213 | * there is not enough descriptors available in this ring since we need at least | 2239 | * there is not enough descriptors available in this ring since we need at least |
2214 | * one descriptor. | 2240 | * one descriptor. |
2215 | **/ | 2241 | **/ |
2242 | #ifdef I40E_FCOE | ||
2243 | int i40e_xmit_descriptor_count(struct sk_buff *skb, | ||
2244 | struct i40e_ring *tx_ring) | ||
2245 | #else | ||
2216 | static int i40e_xmit_descriptor_count(struct sk_buff *skb, | 2246 | static int i40e_xmit_descriptor_count(struct sk_buff *skb, |
2217 | struct i40e_ring *tx_ring) | 2247 | struct i40e_ring *tx_ring) |
2248 | #endif | ||
2218 | { | 2249 | { |
2219 | unsigned int f; | 2250 | unsigned int f; |
2220 | int count = 0; | 2251 | int count = 0; |