As those familiar with network device drivers are aware, the interface between the kernel and driver has been changed to use NAPI (New API). In this paradigm, a polling function is associated with a napi_struct, which is a new structure that must be allocated by the device driver. At any rate, I have an old driver and don't have the time/will to convert it to NAPI. Since the kernel has been modified to account for NAPI, they use the default function "process_backlog" (/net/core/dev.c) to handle the pre-NAPI functionality. This function is still called within interrupt context on a per packet basis (as opposed to NAPI which polls the queue so it doesnt need interrupted each time). I need to override this function but my problem is that unlike the NAPI poll function that is assigned and created by the device driver, the process_backlog is associated with the per-CPU input queue at boot-time. When I load the module, I can override the method using
struct softnet_data *queue, backup;
queue = &__get_cpu_var(softnet_data);
backup = *queue;
queue->backlog.poll = my_process_backlog;
The problem here is that this is only overriding the queue on the CPU that inits the module. Is there some way I can cycle through all the CPU's in a module context? I feel like there has to be some way to do this.
Cheers