drivers/net/ethernet/qlogic/qede/qede_fp.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/qede/qede_fp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/qede/qede_fp.c- Extension
.c- Size
- 49397 bytes
- Lines
- 1807
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/array_size.hlinux/netdevice.hlinux/etherdevice.hlinux/skbuff.hlinux/bpf_trace.hnet/udp_tunnel.hlinux/ip.hnet/gro.hnet/ipv6.hnet/tcp.hlinux/if_ether.hlinux/if_vlan.hnet/ip6_checksum.hqede_ptp.hlinux/qed/qed_if.hqede.h
Detected Declarations
function Copyrightfunction qede_free_tx_pktfunction qede_free_failed_tx_pktfunction qede_xmit_typefunction qede_set_params_for_ipv6_extfunction map_frag_to_bdfunction qede_get_skb_hlenfunction qede_pkt_req_linfunction qede_update_tx_producerfunction qede_xdp_xmitfunction qede_xdp_transmitfunction qede_txq_has_workfunction qede_xdp_tx_intfunction qede_tx_intfunction qede_has_rx_workfunction qede_rx_bd_ring_consumefunction qede_reuse_pagefunction qede_recycle_rx_bd_ringfunction qede_realloc_rx_bufferfunction qede_update_rx_prodfunction qede_get_rxhashfunction qede_set_skb_csumfunction qede_skb_receivefunction qede_set_gro_paramsfunction qede_fill_frag_skbfunction qede_tunn_existfunction qede_check_tunn_csumfunction qede_build_skbfunction qede_tpa_rx_build_skbfunction qede_rx_build_skbfunction qede_tpa_startfunction qede_gro_ip_csumfunction qede_gro_ipv6_csumfunction qede_gro_receivefunction qede_tpa_contfunction qede_tpa_endfunction qede_check_notunn_csumfunction qede_check_csumfunction qede_pkt_is_ip_fragmentedfunction qede_rx_xdpfunction qede_rx_build_jumbofunction qede_rx_process_tpa_cqefunction qede_rx_process_cqefunction qede_rx_intfunction qede_poll_is_more_workfunction for_each_cos_in_txqfunction qede_pollfunction for_each_cos_in_txq
Annotated Snippet
if (skb_is_gso(skb)) {
unsigned short gso_type = skb_shinfo(skb)->gso_type;
if ((gso_type & SKB_GSO_UDP_TUNNEL_CSUM) ||
(gso_type & SKB_GSO_GRE_CSUM))
rc |= XMIT_ENC_GSO_L4_CSUM;
rc |= XMIT_LSO;
return rc;
}
}
if (skb_is_gso(skb))
rc |= XMIT_LSO;
return rc;
}
static void qede_set_params_for_ipv6_ext(struct sk_buff *skb,
struct eth_tx_2nd_bd *second_bd,
struct eth_tx_3rd_bd *third_bd)
{
u8 l4_proto;
u16 bd2_bits1 = 0, bd2_bits2 = 0;
bd2_bits1 |= (1 << ETH_TX_DATA_2ND_BD_IPV6_EXT_SHIFT);
bd2_bits2 |= ((skb_transport_offset(skb) >> 1) &
ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_MASK)
<< ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_SHIFT;
bd2_bits1 |= (ETH_L4_PSEUDO_CSUM_CORRECT_LENGTH <<
ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_SHIFT);
if (vlan_get_protocol(skb) == htons(ETH_P_IPV6))
l4_proto = ipv6_hdr(skb)->nexthdr;
else
l4_proto = ip_hdr(skb)->protocol;
if (l4_proto == IPPROTO_UDP)
bd2_bits1 |= 1 << ETH_TX_DATA_2ND_BD_L4_UDP_SHIFT;
if (third_bd)
third_bd->data.bitfields |=
cpu_to_le16(((tcp_hdrlen(skb) / 4) &
ETH_TX_DATA_3RD_BD_TCP_HDR_LEN_DW_MASK) <<
ETH_TX_DATA_3RD_BD_TCP_HDR_LEN_DW_SHIFT);
second_bd->data.bitfields1 = cpu_to_le16(bd2_bits1);
second_bd->data.bitfields2 = cpu_to_le16(bd2_bits2);
}
static int map_frag_to_bd(struct qede_tx_queue *txq,
skb_frag_t *frag, struct eth_tx_bd *bd)
{
dma_addr_t mapping;
/* Map skb non-linear frag data for DMA */
mapping = skb_frag_dma_map(txq->dev, frag, 0,
skb_frag_size(frag), DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(txq->dev, mapping)))
return -ENOMEM;
/* Setup the data pointer of the frag data */
BD_SET_UNMAP_ADDR_LEN(bd, mapping, skb_frag_size(frag));
return 0;
}
static u16 qede_get_skb_hlen(struct sk_buff *skb, bool is_encap_pkt)
{
if (is_encap_pkt)
return skb_inner_tcp_all_headers(skb);
return skb_tcp_all_headers(skb);
}
/* +2 for 1st BD for headers and 2nd BD for headlen (if required) */
#if ((MAX_SKB_FRAGS + 2) > ETH_TX_MAX_BDS_PER_NON_LSO_PACKET)
static bool qede_pkt_req_lin(struct sk_buff *skb, u8 xmit_type)
{
int allowed_frags = ETH_TX_MAX_BDS_PER_NON_LSO_PACKET - 1;
if (xmit_type & XMIT_LSO) {
int hlen;
hlen = qede_get_skb_hlen(skb, xmit_type & XMIT_ENC);
/* linear payload would require its own BD */
if (skb_headlen(skb) > hlen)
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/skbuff.h`, `linux/bpf_trace.h`, `net/udp_tunnel.h`, `linux/ip.h`, `net/gro.h`.
- Detected declarations: `function Copyright`, `function qede_free_tx_pkt`, `function qede_free_failed_tx_pkt`, `function qede_xmit_type`, `function qede_set_params_for_ipv6_ext`, `function map_frag_to_bd`, `function qede_get_skb_hlen`, `function qede_pkt_req_lin`, `function qede_update_tx_producer`, `function qede_xdp_xmit`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.