On 03/12/15(Thu) 18:07, Alexandr Nedvedicky wrote:
> Hello,
>
> so after a feedback in a hackroom here is the third version of patch. The
> summary of changes is as follows:
> - ip*_send() function use softnettq to dispatch packet
> - ip*_output() functions running in ip*_send_dispatch() are protected
> KERNEL_LOCK() and running at SOFTNET spl level.
> - mq_delist() is used to move packets from global queue to local queue
> for processing.
Two nits below.
> Index: net/if.h
> ===================================================================
> RCS file: /cvs/src/sys/net/if.h,v
> retrieving revision 1.174
> diff -u -p -r1.174 if.h
> --- net/if.h 3 Dec 2015 12:22:51 -0000 1.174
> +++ net/if.h 3 Dec 2015 17:06:32 -0000
> @@ -484,4 +484,7 @@ int if_setlladdr(struct ifnet *, const u
>
> #endif /* __BSD_VISIBLE */
>
> +#ifdef _KERNEL
> +extern struct taskq *softnettq;
> +#endif /* _KERNEL */
Please keep this in the "#ifdef _KERNEL" chunk above. We try as much as
possible to have only one chunk per header.
> +static void
Please drop the static.
> +ip_send_dispatch(void *cx)
> +{
> + struct mbuf *m;
> + struct mbuf_list ml;
> + int s;
> +
> + mq_delist((struct mbuf_queue *)cx, &ml);
It'd makes me happy if you keep the exact code as in if_input_process(),
same thing for the v6 version:
struct mbuf_queue *mq = xmq;
...
mq_delist(mq, &ml);
if (ml_empty(&ml))
return;
With that ok mpi@