drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c- Extension
.c- Size
- 36309 bytes
- Lines
- 1364
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/list.hlinux/slab.hnet/neighbour.hlinux/notifier.hlinux/atomic.hlinux/proc_fs.hlinux/if_vlan.hnet/netevent.hlinux/highmem.hlinux/vmalloc.hlinux/export.hcommon.hregs.hcxgb3_ioctl.hcxgb3_ctl_defs.hcxgb3_defs.hl2t.hfirmware_exports.hcxgb3_offload.h
Detected Declarations
function offload_activatedfunction cxgb3_register_clientfunction cxgb3_unregister_clientfunction cxgb3_add_clientsfunction cxgb3_remove_clientsfunction cxgb3_event_notifyfunction for_each_portfunction cxgb_ulp_iscsi_ctlfunction cxgb_rdma_ctlfunction cxgb_offload_ctlfunction rx_offload_blackholefunction dummy_neigh_updatefunction cxgb3_insert_tidfunction mk_tid_releasefunction t3_process_tid_release_listfunction cxgb3_queue_tid_releasefunction cxgb3_remove_tidfunction cxgb3_alloc_atidfunction do_smt_write_rplfunction do_l2t_write_rplfunction do_rte_write_rplfunction do_act_open_rplfunction do_stid_rplfunction do_hwtid_rplfunction do_crfunction do_abort_req_rssfunction do_act_establishfunction do_tracefunction process_responsesfunction get_opcodefunction do_termfunction nb_callbackfunction do_bad_cplfunction t3_register_cpl_handlerfunction process_rxfunction cxgb3_ofld_sendfunction is_offloadingfunction for_each_portfunction cxgb_neigh_updatefunction set_l2t_ixfunction cxgb_redirectfunction init_tid_tabsfunction free_tid_mapsfunction add_adapterfunction remove_adapterfunction cxgb3_offload_activatefunction clean_l2_datafunction cxgb3_offload_deactivate
Annotated Snippet
list_for_each_entry(tdev, &ofld_dev_list, ofld_dev_list) {
if (offload_activated(tdev))
client->add(tdev);
}
}
mutex_unlock(&cxgb3_db_lock);
}
EXPORT_SYMBOL(cxgb3_register_client);
/**
* cxgb3_unregister_client - unregister an offload client
* @client: the client
*
* Remove the client to the client list,
* and call backs the client for each activated offload device.
*/
void cxgb3_unregister_client(struct cxgb3_client *client)
{
struct t3cdev *tdev;
mutex_lock(&cxgb3_db_lock);
list_del(&client->client_list);
if (client->remove) {
list_for_each_entry(tdev, &ofld_dev_list, ofld_dev_list) {
if (offload_activated(tdev))
client->remove(tdev);
}
}
mutex_unlock(&cxgb3_db_lock);
}
EXPORT_SYMBOL(cxgb3_unregister_client);
/**
* cxgb3_add_clients - activate registered clients for an offload device
* @tdev: the offload device
*
* Call backs all registered clients once a offload device is activated
*/
void cxgb3_add_clients(struct t3cdev *tdev)
{
struct cxgb3_client *client;
mutex_lock(&cxgb3_db_lock);
list_for_each_entry(client, &client_list, client_list) {
if (client->add)
client->add(tdev);
}
mutex_unlock(&cxgb3_db_lock);
}
/**
* cxgb3_remove_clients - deactivates registered clients
* for an offload device
* @tdev: the offload device
*
* Call backs all registered clients once a offload device is deactivated
*/
void cxgb3_remove_clients(struct t3cdev *tdev)
{
struct cxgb3_client *client;
mutex_lock(&cxgb3_db_lock);
list_for_each_entry(client, &client_list, client_list) {
if (client->remove)
client->remove(tdev);
}
mutex_unlock(&cxgb3_db_lock);
}
void cxgb3_event_notify(struct t3cdev *tdev, u32 event, u32 port)
{
struct cxgb3_client *client;
mutex_lock(&cxgb3_db_lock);
list_for_each_entry(client, &client_list, client_list) {
if (client->event_handler)
client->event_handler(tdev, event, port);
}
mutex_unlock(&cxgb3_db_lock);
}
static struct net_device *get_iff_from_mac(struct adapter *adapter,
const unsigned char *mac,
unsigned int vlan)
{
int i;
Annotation
- Immediate include surface: `linux/list.h`, `linux/slab.h`, `net/neighbour.h`, `linux/notifier.h`, `linux/atomic.h`, `linux/proc_fs.h`, `linux/if_vlan.h`, `net/netevent.h`.
- Detected declarations: `function offload_activated`, `function cxgb3_register_client`, `function cxgb3_unregister_client`, `function cxgb3_add_clients`, `function cxgb3_remove_clients`, `function cxgb3_event_notify`, `function for_each_port`, `function cxgb_ulp_iscsi_ctl`, `function cxgb_rdma_ctl`, `function cxgb_offload_ctl`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.