2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-27 21:57:49 -07:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-22 02:20:41 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 17:04:11 +09:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2023-08-04 20:05:24 +02:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2009-10-06 15:11:14 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-21 15:08:38 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
2017-01-10 14:32:51 +01:00
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-07 12:20:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
|
|
|
|
|
2009-09-02 01:03:33 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2012-08-22 00:26:47 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-07 14:21:30 +02:00
|
|
|
|
2017-11-23 15:18:35 +01:00
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
2026-01-21 16:25:46 +08:00
|
|
|
|
|
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
[NET]: Make NAPI polling independent of struct net_device objects.
Several devices have multiple independant RX queues per net
device, and some have a single interrupt doorbell for several
queues.
In either case, it's easier to support layouts like that if the
structure representing the poll is independant from the net
device itself.
The signature of the ->poll() call back goes from:
int foo_poll(struct net_device *dev, int *budget)
to
int foo_poll(struct napi_struct *napi, int budget)
The caller is returned the number of RX packets processed (or
the number of "NAPI credits" consumed if you want to get
abstract). The callee no longer messes around bumping
dev->quota, *budget, etc. because that is all handled in the
caller upon return.
The napi_struct is to be embedded in the device driver private data
structures.
Furthermore, it is the driver's responsibility to disable all NAPI
instances in it's ->stop() device close handler. Since the
napi_struct is privatized into the driver's private data structures,
only the driver knows how to get at all of the napi_struct instances
it may have per-device.
With lots of help and suggestions from Rusty Russell, Roland Dreier,
Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
[ Ported to current tree and all drivers converted. Integrated
Stephen's follow-on kerneldoc additions, and restored poll_list
handling to the old style to fix mutual exclusion issues. -DaveM ]
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-03 16:41:36 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2007-10-15 12:59:53 -07:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-01-28 11:35:42 +08:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2007-10-15 12:59:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
|
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
|
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-07 12:20:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-04 14:38:55 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2011-11-16 14:05:33 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2011-11-16 14:05:33 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: setup_timer() -> timer_setup()
This converts all remaining cases of the old setup_timer() API into using
timer_setup(), where the callback argument is the structure already
holding the struct timer_list. These should have no behavioral changes,
since they just change which pointer is passed into the callback with
the same available pointers after conversion. It handles the following
examples, in addition to some other variations.
Casting from unsigned long:
void my_callback(unsigned long data)
{
struct something *ptr = (struct something *)data;
...
}
...
setup_timer(&ptr->my_timer, my_callback, ptr);
and forced object casts:
void my_callback(struct something *ptr)
{
...
}
...
setup_timer(&ptr->my_timer, my_callback, (unsigned long)ptr);
become:
void my_callback(struct timer_list *t)
{
struct something *ptr = from_timer(ptr, t, my_timer);
...
}
...
timer_setup(&ptr->my_timer, my_callback, 0);
Direct function assignments:
void my_callback(unsigned long data)
{
struct something *ptr = (struct something *)data;
...
}
...
ptr->my_timer.function = my_callback;
have a temporary cast added, along with converting the args:
void my_callback(struct timer_list *t)
{
struct something *ptr = from_timer(ptr, t, my_timer);
...
}
...
ptr->my_timer.function = (TIMER_FUNC_TYPE)my_callback;
And finally, callbacks without a data assignment:
void my_callback(unsigned long data)
{
...
}
...
setup_timer(&ptr->my_timer, my_callback, 0);
have their argument renamed to verify they're unused during conversion:
void my_callback(struct timer_list *unused)
{
...
}
...
timer_setup(&ptr->my_timer, my_callback, 0);
The conversion is done with the following Coccinelle script:
spatch --very-quiet --all-includes --include-headers \
-I ./arch/x86/include -I ./arch/x86/include/generated \
-I ./include -I ./arch/x86/include/uapi \
-I ./arch/x86/include/generated/uapi -I ./include/uapi \
-I ./include/generated/uapi --include ./include/linux/kconfig.h \
--dir . \
--cocci-file ~/src/data/timer_setup.cocci
@fix_address_of@
expression e;
@@
setup_timer(
-&(e)
+&e
, ...)
// Update any raw setup_timer() usages that have a NULL callback, but
// would otherwise match change_timer_function_usage, since the latter
// will update all function assignments done in the face of a NULL
// function initialization in setup_timer().
@change_timer_function_usage_NULL@
expression _E;
identifier _timer;
type _cast_data;
@@
(
-setup_timer(&_E->_timer, NULL, _E);
+timer_setup(&_E->_timer, NULL, 0);
|
-setup_timer(&_E->_timer, NULL, (_cast_data)_E);
+timer_setup(&_E->_timer, NULL, 0);
|
-setup_timer(&_E._timer, NULL, &_E);
+timer_setup(&_E._timer, NULL, 0);
|
-setup_timer(&_E._timer, NULL, (_cast_data)&_E);
+timer_setup(&_E._timer, NULL, 0);
)
@change_timer_function_usage@
expression _E;
identifier _timer;
struct timer_list _stl;
identifier _callback;
type _cast_func, _cast_data;
@@
(
-setup_timer(&_E->_timer, _callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, &_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, &_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)&_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)&_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, &_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, &_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
_E->_timer@_stl.function = _callback;
|
_E->_timer@_stl.function = &_callback;
|
_E->_timer@_stl.function = (_cast_func)_callback;
|
_E->_timer@_stl.function = (_cast_func)&_callback;
|
_E._timer@_stl.function = _callback;
|
_E._timer@_stl.function = &_callback;
|
_E._timer@_stl.function = (_cast_func)_callback;
|
_E._timer@_stl.function = (_cast_func)&_callback;
)
// callback(unsigned long arg)
@change_callback_handle_cast
depends on change_timer_function_usage@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _origtype;
identifier _origarg;
type _handletype;
identifier _handle;
@@
void _callback(
-_origtype _origarg
+struct timer_list *t
)
{
(
... when != _origarg
_handletype *_handle =
-(_handletype *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle =
-(void *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle;
... when != _handle
_handle =
-(_handletype *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle;
... when != _handle
_handle =
-(void *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
)
}
// callback(unsigned long arg) without existing variable
@change_callback_handle_cast_no_arg
depends on change_timer_function_usage &&
!change_callback_handle_cast@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _origtype;
identifier _origarg;
type _handletype;
@@
void _callback(
-_origtype _origarg
+struct timer_list *t
)
{
+ _handletype *_origarg = from_timer(_origarg, t, _timer);
+
... when != _origarg
- (_handletype *)_origarg
+ _origarg
... when != _origarg
}
// Avoid already converted callbacks.
@match_callback_converted
depends on change_timer_function_usage &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg@
identifier change_timer_function_usage._callback;
identifier t;
@@
void _callback(struct timer_list *t)
{ ... }
// callback(struct something *handle)
@change_callback_handle_arg
depends on change_timer_function_usage &&
!match_callback_converted &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _handletype;
identifier _handle;
@@
void _callback(
-_handletype *_handle
+struct timer_list *t
)
{
+ _handletype *_handle = from_timer(_handle, t, _timer);
...
}
// If change_callback_handle_arg ran on an empty function, remove
// the added handler.
@unchange_callback_handle_arg
depends on change_timer_function_usage &&
change_callback_handle_arg@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _handletype;
identifier _handle;
identifier t;
@@
void _callback(struct timer_list *t)
{
- _handletype *_handle = from_timer(_handle, t, _timer);
}
// We only want to refactor the setup_timer() data argument if we've found
// the matching callback. This undoes changes in change_timer_function_usage.
@unchange_timer_function_usage
depends on change_timer_function_usage &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg &&
!change_callback_handle_arg@
expression change_timer_function_usage._E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type change_timer_function_usage._cast_data;
@@
(
-timer_setup(&_E->_timer, _callback, 0);
+setup_timer(&_E->_timer, _callback, (_cast_data)_E);
|
-timer_setup(&_E._timer, _callback, 0);
+setup_timer(&_E._timer, _callback, (_cast_data)&_E);
)
// If we fixed a callback from a .function assignment, fix the
// assignment cast now.
@change_timer_function_assignment
depends on change_timer_function_usage &&
(change_callback_handle_cast ||
change_callback_handle_cast_no_arg ||
change_callback_handle_arg)@
expression change_timer_function_usage._E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type _cast_func;
typedef TIMER_FUNC_TYPE;
@@
(
_E->_timer.function =
-_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-&_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-(_cast_func)_callback;
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-(_cast_func)&_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-&_callback;
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-(_cast_func)_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-(_cast_func)&_callback
+(TIMER_FUNC_TYPE)_callback
;
)
// Sometimes timer functions are called directly. Replace matched args.
@change_timer_function_calls
depends on change_timer_function_usage &&
(change_callback_handle_cast ||
change_callback_handle_cast_no_arg ||
change_callback_handle_arg)@
expression _E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type _cast_data;
@@
_callback(
(
-(_cast_data)_E
+&_E->_timer
|
-(_cast_data)&_E
+&_E._timer
|
-_E
+&_E->_timer
)
)
// If a timer has been configured without a data argument, it can be
// converted without regard to the callback argument, since it is unused.
@match_timer_function_unused_data@
expression _E;
identifier _timer;
identifier _callback;
@@
(
-setup_timer(&_E->_timer, _callback, 0);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, 0L);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, 0UL);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0L);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0UL);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0L);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0UL);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0);
+timer_setup(_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0L);
+timer_setup(_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0UL);
+timer_setup(_timer, _callback, 0);
)
@change_callback_unused_data
depends on match_timer_function_unused_data@
identifier match_timer_function_unused_data._callback;
type _origtype;
identifier _origarg;
@@
void _callback(
-_origtype _origarg
+struct timer_list *unused
)
{
... when != _origarg
}
Signed-off-by: Kees Cook <keescook@chromium.org>
2017-10-16 14:43:17 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2025-05-09 07:51:14 +02:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2018-06-12 08:57:53 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-06 17:38:04 +02:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-27 13:14:56 +01:00
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
2017-02-07 18:59:01 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
2017-02-07 18:59:01 +00:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2017-02-07 18:59:01 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2016-11-02 09:04:33 +08:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
2017-02-07 18:59:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[NET]: Make NAPI polling independent of struct net_device objects.
Several devices have multiple independant RX queues per net
device, and some have a single interrupt doorbell for several
queues.
In either case, it's easier to support layouts like that if the
structure representing the poll is independant from the net
device itself.
The signature of the ->poll() call back goes from:
int foo_poll(struct net_device *dev, int *budget)
to
int foo_poll(struct napi_struct *napi, int budget)
The caller is returned the number of RX packets processed (or
the number of "NAPI credits" consumed if you want to get
abstract). The callee no longer messes around bumping
dev->quota, *budget, etc. because that is all handled in the
caller upon return.
The napi_struct is to be embedded in the device driver private data
structures.
Furthermore, it is the driver's responsibility to disable all NAPI
instances in it's ->stop() device close handler. Since the
napi_struct is privatized into the driver's private data structures,
only the driver knows how to get at all of the napi_struct instances
it may have per-device.
With lots of help and suggestions from Rusty Russell, Roland Dreier,
Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
[ Ported to current tree and all drivers converted. Integrated
Stephen's follow-on kerneldoc additions, and restored poll_list
handling to the old style to fix mutual exclusion issues. -DaveM ]
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-03 16:41:36 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-26 17:12:44 +00:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
|
|
|
|
|
2022-03-07 09:48:54 +01:00
|
|
|
|
2022-03-11 11:34:29 +01:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2016-01-26 17:12:44 +00:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
|
|
|
|
|
2016-11-02 09:04:33 +08:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-21 02:02:16 +00:00
|
|
|
|
2015-01-13 17:16:43 +00:00
|
|
|
|
|
|
|
|
|
2012-11-21 02:02:16 +00:00
|
|
|
|
2015-01-13 17:16:43 +00:00
|
|
|
|
2012-11-21 02:02:16 +00:00
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2015-01-13 17:16:43 +00:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
2012-11-21 02:02:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-30 07:40:33 -07:00
|
|
|
|
2012-11-21 02:02:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2012-11-21 02:02:16 +00:00
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
2012-11-21 02:02:16 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
2019-03-20 11:02:06 +01:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-21 16:25:46 +08:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-08 12:06:58 +01:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-08 12:06:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-08 12:06:58 +01:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2022-09-14 14:43:39 +08:00
|
|
|
|
2022-04-07 12:20:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
2018-04-24 15:18:14 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2012-11-21 02:02:16 +00:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-23 08:24:43 +00:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2016-09-19 12:53:40 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2013-04-22 02:20:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:43 +00:00
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
xen-netfront: Fix handling packets on compound pages with skb_linearize
There is a long known problem with the netfront/netback interface: if the guest
tries to send a packet which constitues more than MAX_SKB_FRAGS + 1 ring slots,
it gets dropped. The reason is that netback maps these slots to a frag in the
frags array, which is limited by size. Having so many slots can occur since
compound pages were introduced, as the ring protocol slice them up into
individual (non-compound) page aligned slots. The theoretical worst case
scenario looks like this (note, skbs are limited to 64 Kb here):
linear buffer: at most PAGE_SIZE - 17 * 2 bytes, overlapping page boundary,
using 2 slots
first 15 frags: 1 + PAGE_SIZE + 1 bytes long, first and last bytes are at the
end and the beginning of a page, therefore they use 3 * 15 = 45 slots
last 2 frags: 1 + 1 bytes, overlapping page boundary, 2 * 2 = 4 slots
Although I don't think this 51 slots skb can really happen, we need a solution
which can deal with every scenario. In real life there is only a few slots
overdue, but usually it causes the TCP stream to be blocked, as the retry will
most likely have the same buffer layout.
This patch solves this problem by linearizing the packet. This is not the
fastest way, and it can fail much easier as it tries to allocate a big linear
area for the whole packet, but probably easier by an order of magnitude than
anything else. Probably this code path is not touched very frequently anyway.
Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: xen-devel@lists.xenproject.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-08-11 18:32:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
|
|
|
|
|
2016-09-19 12:53:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-07 12:20:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-19 12:53:40 +02:00
|
|
|
|
2022-04-07 12:20:06 +02:00
|
|
|
|
|
|
|
|
|
2016-09-19 12:53:40 +02:00
|
|
|
|
|
|
|
|
|
2017-08-30 10:32:58 -07:00
|
|
|
|
2016-09-19 12:53:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2012-11-21 02:02:16 +00:00
|
|
|
|
2015-04-17 15:45:04 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-10 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-01-15 17:30:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:07 +02:00
|
|
|
|
2019-07-30 07:40:33 -07:00
|
|
|
|
2015-01-13 17:16:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2020-07-03 01:22:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
2026-01-21 16:25:46 +08:00
|
|
|
|
|
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
2007-08-13 12:54:37 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2009-06-23 06:03:08 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2007-10-03 17:41:50 -07:00
|
|
|
|
2014-03-15 18:33:04 -07:00
|
|
|
|
2009-06-23 06:03:08 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-07 16:17:00 +01:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-23 22:19:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-07 16:17:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-23 22:19:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-28 09:59:01 +02:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-02 15:22:23 +01:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2020-12-22 22:09:28 +01:00
|
|
|
|
|
|
|
|
|
2020-12-22 22:09:29 +01:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-04-17 12:21:17 +00:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2025-04-17 12:21:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-04-17 12:21:17 +00:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2025-04-17 12:21:17 +00:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-30 11:08:07 +01:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-25 01:08:19 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2011-03-15 00:06:18 +00:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-22 02:20:40 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-13 11:19:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-11 11:34:29 +01:00
|
|
|
|
2022-03-07 09:48:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-01 08:56:52 +02:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2022-07-01 08:56:52 +02:00
|
|
|
|
|
|
|
|
|
2011-03-15 00:06:18 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2013-03-25 01:08:19 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2013-03-25 01:08:19 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2013-03-25 01:08:19 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2013-03-25 01:08:19 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2013-04-22 02:20:40 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-27 21:57:49 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-15 17:30:33 +00:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2013-06-27 21:57:49 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-15 17:30:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-01 21:56:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2011-10-05 00:28:47 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
|
|
|
|
|
2018-08-09 16:42:16 +02:00
|
|
|
|
2013-07-17 08:09:37 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2018-12-18 16:06:19 +01:00
|
|
|
|
2013-07-17 08:09:37 +01:00
|
|
|
|
|
|
|
|
|
2018-09-11 09:04:48 +02:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
2018-09-11 09:04:48 +02:00
|
|
|
|
2019-10-01 21:56:41 +08:00
|
|
|
|
2018-09-11 09:04:48 +02:00
|
|
|
|
2013-07-17 08:09:37 +01:00
|
|
|
|
2018-08-09 16:42:16 +02:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
2019-10-01 21:56:41 +08:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-01-09 10:02:48 +00:00
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
2014-01-09 10:02:48 +00:00
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-01-09 10:02:48 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-10-03 17:41:50 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-22 00:26:47 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2013-07-17 08:09:37 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2014-02-19 18:48:34 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
2026-01-21 16:25:46 +08:00
|
|
|
|
|
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[NET]: Make NAPI polling independent of struct net_device objects.
Several devices have multiple independant RX queues per net
device, and some have a single interrupt doorbell for several
queues.
In either case, it's easier to support layouts like that if the
structure representing the poll is independant from the net
device itself.
The signature of the ->poll() call back goes from:
int foo_poll(struct net_device *dev, int *budget)
to
int foo_poll(struct napi_struct *napi, int budget)
The caller is returned the number of RX packets processed (or
the number of "NAPI credits" consumed if you want to get
abstract). The callee no longer messes around bumping
dev->quota, *budget, etc. because that is all handled in the
caller upon return.
The napi_struct is to be embedded in the device driver private data
structures.
Furthermore, it is the driver's responsibility to disable all NAPI
instances in it's ->stop() device close handler. Since the
napi_struct is privatized into the driver's private data structures,
only the driver knows how to get at all of the napi_struct instances
it may have per-device.
With lots of help and suggestions from Rusty Russell, Roland Dreier,
Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
[ Ported to current tree and all drivers converted. Integrated
Stephen's follow-on kerneldoc additions, and restored poll_list
handling to the old style to fix mutual exclusion issues. -DaveM ]
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-03 16:41:36 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[NET]: Make NAPI polling independent of struct net_device objects.
Several devices have multiple independant RX queues per net
device, and some have a single interrupt doorbell for several
queues.
In either case, it's easier to support layouts like that if the
structure representing the poll is independant from the net
device itself.
The signature of the ->poll() call back goes from:
int foo_poll(struct net_device *dev, int *budget)
to
int foo_poll(struct napi_struct *napi, int budget)
The caller is returned the number of RX packets processed (or
the number of "NAPI credits" consumed if you want to get
abstract). The callee no longer messes around bumping
dev->quota, *budget, etc. because that is all handled in the
caller upon return.
The napi_struct is to be embedded in the device driver private data
structures.
Furthermore, it is the driver's responsibility to disable all NAPI
instances in it's ->stop() device close handler. Since the
napi_struct is privatized into the driver's private data structures,
only the driver knows how to get at all of the napi_struct instances
it may have per-device.
With lots of help and suggestions from Rusty Russell, Roland Dreier,
Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
[ Ported to current tree and all drivers converted. Integrated
Stephen's follow-on kerneldoc additions, and restored poll_list
handling to the old style to fix mutual exclusion issues. -DaveM ]
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-03 16:41:36 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:06 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2022-03-07 09:48:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-03 17:41:50 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-22 00:26:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2019-07-30 07:40:33 -07:00
|
|
|
|
2012-08-22 00:26:47 +00:00
|
|
|
|
|
|
|
|
|
2013-07-17 08:09:37 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2019-10-01 21:56:41 +08:00
|
|
|
|
2018-09-11 09:04:48 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2011-03-15 00:06:18 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2011-03-15 00:06:18 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2008-05-22 18:09:06 +08:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
[NET]: Make NAPI polling independent of struct net_device objects.
Several devices have multiple independant RX queues per net
device, and some have a single interrupt doorbell for several
queues.
In either case, it's easier to support layouts like that if the
structure representing the poll is independant from the net
device itself.
The signature of the ->poll() call back goes from:
int foo_poll(struct net_device *dev, int *budget)
to
int foo_poll(struct napi_struct *napi, int budget)
The caller is returned the number of RX packets processed (or
the number of "NAPI credits" consumed if you want to get
abstract). The callee no longer messes around bumping
dev->quota, *budget, etc. because that is all handled in the
caller upon return.
The napi_struct is to be embedded in the device driver private data
structures.
Furthermore, it is the driver's responsibility to disable all NAPI
instances in it's ->stop() device close handler. Since the
napi_struct is privatized into the driver's private data structures,
only the driver knows how to get at all of the napi_struct instances
it may have per-device.
With lots of help and suggestions from Rusty Russell, Roland Dreier,
Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
[ Ported to current tree and all drivers converted. Integrated
Stephen's follow-on kerneldoc additions, and restored poll_list
handling to the old style to fix mutual exclusion issues. -DaveM ]
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-03 16:41:36 -07:00
|
|
|
|
|
|
|
|
|
2017-01-30 08:22:01 -08:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2014-12-16 18:59:46 +00:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
[NET]: Make NAPI polling independent of struct net_device objects.
Several devices have multiple independant RX queues per net
device, and some have a single interrupt doorbell for several
queues.
In either case, it's easier to support layouts like that if the
structure representing the poll is independant from the net
device itself.
The signature of the ->poll() call back goes from:
int foo_poll(struct net_device *dev, int *budget)
to
int foo_poll(struct napi_struct *napi, int budget)
The caller is returned the number of RX packets processed (or
the number of "NAPI credits" consumed if you want to get
abstract). The callee no longer messes around bumping
dev->quota, *budget, etc. because that is all handled in the
caller upon return.
The napi_struct is to be embedded in the device driver private data
structures.
Furthermore, it is the driver's responsibility to disable all NAPI
instances in it's ->stop() device close handler. Since the
napi_struct is privatized into the driver's private data structures,
only the driver knows how to get at all of the napi_struct instances
it may have per-device.
With lots of help and suggestions from Rusty Russell, Roland Dreier,
Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
[ Ported to current tree and all drivers converted. Integrated
Stephen's follow-on kerneldoc additions, and restored poll_list
handling to the old style to fix mutual exclusion issues. -DaveM ]
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-03 16:41:36 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xen-netfront: transmit fully GSO-sized packets
xen-netfront limits transmitted skbs to be at most 44 segments in size. However,
GSO permits up to 65536 bytes, which means a maximum of 45 segments of 1448
bytes each. This slight reduction in the size of packets means a slight loss in
efficiency.
Since c/s 9ecd1a75d, xen-netfront sets gso_max_size to
XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER,
where XEN_NETIF_MAX_TX_SIZE is 65535 bytes.
The calculation used by tcp_tso_autosize (and also tcp_xmit_size_goal since c/s
6c09fa09d) in determining when to split an skb into two is
sk->sk_gso_max_size - 1 - MAX_TCP_HEADER.
So the maximum permitted size of an skb is calculated to be
(XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER) - 1 - MAX_TCP_HEADER.
Intuitively, this looks like the wrong formula -- we don't need two TCP headers.
Instead, there is no need to deviate from the default gso_max_size of 65536 as
this already accommodates the size of the header.
Currently, the largest skb transmitted by netfront is 63712 bytes (44 segments
of 1448 bytes each), as observed via tcpdump. This patch makes netfront send
skbs of up to 65160 bytes (45 segments of 1448 bytes each).
Similarly, the maximum allowable mtu does not need to subtract MAX_TCP_HEADER as
it relates to the size of the whole packet, including the header.
Fixes: 9ecd1a75d977 ("xen-netfront: reduce gso_max_size to account for max TCP header")
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-31 11:05:15 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-06 10:28:12 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-06 19:12:52 -08:00
|
|
|
|
|
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
|
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-26 15:22:14 +02:00
|
|
|
|
2026-01-21 16:25:46 +08:00
|
|
|
|
|
|
|
|
|
2022-10-26 15:22:14 +02:00
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
2022-10-26 15:22:14 +02:00
|
|
|
|
2026-01-21 16:25:46 +08:00
|
|
|
|
|
|
|
|
|
2022-10-26 15:22:14 +02:00
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2022-05-24 13:46:30 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-01-28 11:35:42 +08:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2014-01-28 11:35:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
2014-01-28 11:35:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-24 13:46:30 +02:00
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-01-28 11:35:42 +08:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2011-11-15 15:29:55 +00:00
|
|
|
|
|
|
|
|
|
2011-04-03 17:21:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-31 14:58:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-03 17:21:00 -07:00
|
|
|
|
2016-10-31 14:58:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-03 17:21:00 -07:00
|
|
|
|
2016-10-31 14:58:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-15 17:30:33 +00:00
|
|
|
|
2016-10-31 14:58:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-15 17:30:33 +00:00
|
|
|
|
2011-04-03 17:21:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-15 15:29:55 +00:00
|
|
|
|
|
|
|
|
|
2011-04-03 17:21:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
2012-01-23 08:24:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2012-01-23 08:24:43 +00:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-23 08:24:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-28 09:59:01 +02:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-23 08:24:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2012-01-23 08:24:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-18 10:52:04 +01:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-06 10:44:55 -08:00
|
|
|
|
2022-02-23 22:19:54 +01:00
|
|
|
|
2009-01-06 10:44:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
2009-01-06 10:44:55 -08:00
|
|
|
|
|
|
|
|
|
2011-03-31 01:01:35 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2012-01-23 08:24:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-06 10:44:55 -08:00
|
|
|
|
|
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-03 09:24:22 -05:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
2012-01-29 13:47:52 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-21 05:35:31 +00:00
|
|
|
|
|
|
|
|
|
2009-01-06 10:44:55 -08:00
|
|
|
|
|
|
|
|
|
2011-03-31 01:01:35 +00:00
|
|
|
|
|
|
|
|
|
2014-01-15 17:30:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2011-04-04 11:07:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drivers: net: turn on XDP features
A summary of the flags being set for various drivers is given below.
Note that XDP_F_REDIRECT_TARGET and XDP_F_FRAG_TARGET are features
that can be turned off and on at runtime. This means that these flags
may be set and unset under RTNL lock protection by the driver. Hence,
READ_ONCE must be used by code loading the flag value.
Also, these flags are not used for synchronization against the availability
of XDP resources on a device. It is merely a hint, and hence the read
may race with the actual teardown of XDP resources on the device. This
may change in the future, e.g. operations taking a reference on the XDP
resources of the driver, and in turn inhibiting turning off this flag.
However, for now, it can only be used as a hint to check whether device
supports becoming a redirection target.
Turn 'hw-offload' feature flag on for:
- netronome (nfp)
- netdevsim.
Turn 'native' and 'zerocopy' features flags on for:
- intel (i40e, ice, ixgbe, igc)
- mellanox (mlx5).
- stmmac
- netronome (nfp)
Turn 'native' features flags on for:
- amazon (ena)
- broadcom (bnxt)
- freescale (dpaa, dpaa2, enetc)
- funeth
- intel (igb)
- marvell (mvneta, mvpp2, octeontx2)
- mellanox (mlx4)
- mtk_eth_soc
- qlogic (qede)
- sfc
- socionext (netsec)
- ti (cpsw)
- tap
- tsnep
- veth
- xen
- virtio_net.
Turn 'basic' (tx, pass, aborted and drop) features flags on for:
- netronome (nfp)
- cavium (thunder)
- hyperv.
Turn 'redirect_target' feature flag on for:
- amanzon (ena)
- broadcom (bnxt)
- freescale (dpaa, dpaa2)
- intel (i40e, ice, igb, ixgbe)
- ti (cpsw)
- marvell (mvneta, mvpp2)
- sfc
- socionext (netsec)
- qlogic (qede)
- mellanox (mlx5)
- tap
- veth
- virtio_net
- xen
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Link: https://lore.kernel.org/r/3eca9fafb308462f7edb1f58e451d59209aa07eb.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 11:24:18 +01:00
|
|
|
|
|
|
|
|
|
2011-04-04 11:07:57 -07:00
|
|
|
|
2014-05-11 00:12:32 +00:00
|
|
|
|
2017-10-16 15:20:32 +02:00
|
|
|
|
2016-10-20 13:55:21 -04:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-18 10:52:04 +01:00
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
2026-02-18 10:52:04 +01:00
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-15 20:09:03 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-03 09:24:22 -05:00
|
|
|
|
2012-12-06 14:30:56 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-04 12:40:54 -07:00
|
|
|
|
2015-02-04 14:38:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
2022-05-24 13:46:30 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-07-02 16:09:15 +01:00
|
|
|
|
|
|
|
|
|
2015-08-19 19:14:20 -04:00
|
|
|
|
2014-06-18 10:47:27 +01:00
|
|
|
|
|
|
|
|
|
2025-04-05 10:17:26 +02:00
|
|
|
|
2017-01-30 12:45:46 -05:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-27 12:28:46 -04:00
|
|
|
|
|
|
|
|
|
2014-07-02 16:09:15 +01:00
|
|
|
|
2014-07-31 17:38:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2021-01-15 20:09:03 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-04 12:40:54 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-22 16:31:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2022-12-02 08:52:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2022-04-28 09:01:03 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2022-04-28 09:01:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2022-04-28 09:01:03 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2022-04-28 09:01:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-07 09:48:55 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2022-04-28 09:01:03 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-02 18:17:49 +08:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2022-03-07 09:48:55 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-07 09:48:55 +01:00
|
|
|
|
2022-04-28 09:01:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-14 23:21:28 +08:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-16 08:24:08 +01:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
treewide: setup_timer() -> timer_setup()
This converts all remaining cases of the old setup_timer() API into using
timer_setup(), where the callback argument is the structure already
holding the struct timer_list. These should have no behavioral changes,
since they just change which pointer is passed into the callback with
the same available pointers after conversion. It handles the following
examples, in addition to some other variations.
Casting from unsigned long:
void my_callback(unsigned long data)
{
struct something *ptr = (struct something *)data;
...
}
...
setup_timer(&ptr->my_timer, my_callback, ptr);
and forced object casts:
void my_callback(struct something *ptr)
{
...
}
...
setup_timer(&ptr->my_timer, my_callback, (unsigned long)ptr);
become:
void my_callback(struct timer_list *t)
{
struct something *ptr = from_timer(ptr, t, my_timer);
...
}
...
timer_setup(&ptr->my_timer, my_callback, 0);
Direct function assignments:
void my_callback(unsigned long data)
{
struct something *ptr = (struct something *)data;
...
}
...
ptr->my_timer.function = my_callback;
have a temporary cast added, along with converting the args:
void my_callback(struct timer_list *t)
{
struct something *ptr = from_timer(ptr, t, my_timer);
...
}
...
ptr->my_timer.function = (TIMER_FUNC_TYPE)my_callback;
And finally, callbacks without a data assignment:
void my_callback(unsigned long data)
{
...
}
...
setup_timer(&ptr->my_timer, my_callback, 0);
have their argument renamed to verify they're unused during conversion:
void my_callback(struct timer_list *unused)
{
...
}
...
timer_setup(&ptr->my_timer, my_callback, 0);
The conversion is done with the following Coccinelle script:
spatch --very-quiet --all-includes --include-headers \
-I ./arch/x86/include -I ./arch/x86/include/generated \
-I ./include -I ./arch/x86/include/uapi \
-I ./arch/x86/include/generated/uapi -I ./include/uapi \
-I ./include/generated/uapi --include ./include/linux/kconfig.h \
--dir . \
--cocci-file ~/src/data/timer_setup.cocci
@fix_address_of@
expression e;
@@
setup_timer(
-&(e)
+&e
, ...)
// Update any raw setup_timer() usages that have a NULL callback, but
// would otherwise match change_timer_function_usage, since the latter
// will update all function assignments done in the face of a NULL
// function initialization in setup_timer().
@change_timer_function_usage_NULL@
expression _E;
identifier _timer;
type _cast_data;
@@
(
-setup_timer(&_E->_timer, NULL, _E);
+timer_setup(&_E->_timer, NULL, 0);
|
-setup_timer(&_E->_timer, NULL, (_cast_data)_E);
+timer_setup(&_E->_timer, NULL, 0);
|
-setup_timer(&_E._timer, NULL, &_E);
+timer_setup(&_E._timer, NULL, 0);
|
-setup_timer(&_E._timer, NULL, (_cast_data)&_E);
+timer_setup(&_E._timer, NULL, 0);
)
@change_timer_function_usage@
expression _E;
identifier _timer;
struct timer_list _stl;
identifier _callback;
type _cast_func, _cast_data;
@@
(
-setup_timer(&_E->_timer, _callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, &_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, &_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)&_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)&_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, &_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, &_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
_E->_timer@_stl.function = _callback;
|
_E->_timer@_stl.function = &_callback;
|
_E->_timer@_stl.function = (_cast_func)_callback;
|
_E->_timer@_stl.function = (_cast_func)&_callback;
|
_E._timer@_stl.function = _callback;
|
_E._timer@_stl.function = &_callback;
|
_E._timer@_stl.function = (_cast_func)_callback;
|
_E._timer@_stl.function = (_cast_func)&_callback;
)
// callback(unsigned long arg)
@change_callback_handle_cast
depends on change_timer_function_usage@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _origtype;
identifier _origarg;
type _handletype;
identifier _handle;
@@
void _callback(
-_origtype _origarg
+struct timer_list *t
)
{
(
... when != _origarg
_handletype *_handle =
-(_handletype *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle =
-(void *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle;
... when != _handle
_handle =
-(_handletype *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle;
... when != _handle
_handle =
-(void *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
)
}
// callback(unsigned long arg) without existing variable
@change_callback_handle_cast_no_arg
depends on change_timer_function_usage &&
!change_callback_handle_cast@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _origtype;
identifier _origarg;
type _handletype;
@@
void _callback(
-_origtype _origarg
+struct timer_list *t
)
{
+ _handletype *_origarg = from_timer(_origarg, t, _timer);
+
... when != _origarg
- (_handletype *)_origarg
+ _origarg
... when != _origarg
}
// Avoid already converted callbacks.
@match_callback_converted
depends on change_timer_function_usage &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg@
identifier change_timer_function_usage._callback;
identifier t;
@@
void _callback(struct timer_list *t)
{ ... }
// callback(struct something *handle)
@change_callback_handle_arg
depends on change_timer_function_usage &&
!match_callback_converted &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _handletype;
identifier _handle;
@@
void _callback(
-_handletype *_handle
+struct timer_list *t
)
{
+ _handletype *_handle = from_timer(_handle, t, _timer);
...
}
// If change_callback_handle_arg ran on an empty function, remove
// the added handler.
@unchange_callback_handle_arg
depends on change_timer_function_usage &&
change_callback_handle_arg@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _handletype;
identifier _handle;
identifier t;
@@
void _callback(struct timer_list *t)
{
- _handletype *_handle = from_timer(_handle, t, _timer);
}
// We only want to refactor the setup_timer() data argument if we've found
// the matching callback. This undoes changes in change_timer_function_usage.
@unchange_timer_function_usage
depends on change_timer_function_usage &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg &&
!change_callback_handle_arg@
expression change_timer_function_usage._E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type change_timer_function_usage._cast_data;
@@
(
-timer_setup(&_E->_timer, _callback, 0);
+setup_timer(&_E->_timer, _callback, (_cast_data)_E);
|
-timer_setup(&_E._timer, _callback, 0);
+setup_timer(&_E._timer, _callback, (_cast_data)&_E);
)
// If we fixed a callback from a .function assignment, fix the
// assignment cast now.
@change_timer_function_assignment
depends on change_timer_function_usage &&
(change_callback_handle_cast ||
change_callback_handle_cast_no_arg ||
change_callback_handle_arg)@
expression change_timer_function_usage._E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type _cast_func;
typedef TIMER_FUNC_TYPE;
@@
(
_E->_timer.function =
-_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-&_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-(_cast_func)_callback;
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-(_cast_func)&_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-&_callback;
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-(_cast_func)_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-(_cast_func)&_callback
+(TIMER_FUNC_TYPE)_callback
;
)
// Sometimes timer functions are called directly. Replace matched args.
@change_timer_function_calls
depends on change_timer_function_usage &&
(change_callback_handle_cast ||
change_callback_handle_cast_no_arg ||
change_callback_handle_arg)@
expression _E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type _cast_data;
@@
_callback(
(
-(_cast_data)_E
+&_E->_timer
|
-(_cast_data)&_E
+&_E._timer
|
-_E
+&_E->_timer
)
)
// If a timer has been configured without a data argument, it can be
// converted without regard to the callback argument, since it is unused.
@match_timer_function_unused_data@
expression _E;
identifier _timer;
identifier _callback;
@@
(
-setup_timer(&_E->_timer, _callback, 0);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, 0L);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, 0UL);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0L);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0UL);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0L);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0UL);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0);
+timer_setup(_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0L);
+timer_setup(_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0UL);
+timer_setup(_timer, _callback, 0);
)
@change_callback_unused_data
depends on match_timer_function_unused_data@
identifier match_timer_function_unused_data._callback;
type _origtype;
identifier _origarg;
@@
void _callback(
-_origtype _origarg
+struct timer_list *unused
)
{
... when != _origarg
}
Signed-off-by: Kees Cook <keescook@chromium.org>
2017-10-16 14:43:17 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2018-08-14 23:21:28 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:47 +01:00
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:08 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-28 09:01:01 +02:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-30 19:52:01 +01:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-18 10:47:28 +01:00
|
|
|
|
2015-10-19 13:37:17 +08:00
|
|
|
|
2014-06-18 10:47:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 20:03:00 -08:00
|
|
|
|
2014-06-18 10:47:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-19 13:37:17 +08:00
|
|
|
|
2014-06-18 10:47:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
2014-07-31 17:38:24 +01:00
|
|
|
|
2015-10-19 13:37:17 +08:00
|
|
|
|
2014-06-18 10:47:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-27 06:27:53 -07:00
|
|
|
|
2014-06-18 10:47:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-19 13:37:17 +08:00
|
|
|
|
2014-06-18 10:47:28 +01:00
|
|
|
|
2015-10-19 13:37:17 +08:00
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
2014-06-18 10:47:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2010-08-18 23:27:49 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2021-10-21 06:12:03 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2022-04-07 12:20:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
2016-10-31 14:58:41 +01:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2016-10-31 14:58:41 +01:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2021-10-21 06:12:03 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2018-06-21 14:00:20 +01:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2021-10-21 06:12:03 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
2014-06-18 10:47:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 12:28:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-19 13:37:17 +08:00
|
|
|
|
2017-02-08 10:57:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-08 10:57:37 +00:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-16 16:28:25 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-22 06:34:46 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-15 17:30:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
2017-02-08 10:57:37 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
2018-06-21 14:00:20 +01:00
|
|
|
|
2017-05-11 13:58:06 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2014-07-31 17:38:23 +01:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2016-10-31 14:58:41 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2007-10-18 03:06:30 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-18 23:27:49 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2020-06-29 16:13:28 +03:00
|
|
|
|
|
|
|
|
|
2022-04-07 12:20:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-21 14:00:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-07-31 17:38:23 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-22 16:31:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2014-07-02 16:09:14 +01:00
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-07-02 16:09:14 +01:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-15 20:09:03 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2010-08-18 23:27:49 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2009-05-04 12:40:54 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-07 14:21:30 +02:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-13 17:22:29 -04:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xen-netfront: delay gARP until backend switches to Connected
After a guest is live migrated, the xen-netfront driver emits a gratuitous
ARP message, so that networking hardware on the target host's subnet can
take notice, and public routing to the guest is re-established. However,
if the packet appears on the backend interface before the backend is added
to the target host's bridge, the packet is lost, and the migrated guest's
peers become unable to talk to the guest.
A sufficient two-parts condition to prevent the above is:
(1) ensure that the backend only moves to Connected xenbus state after its
hotplug scripts completed, ie. the netback interface got added to the
bridge; and
(2) ensure the frontend only queues the gARP when it sees the backend move
to Connected.
These two together provide complete ordering. Sub-condition (1) is already
satisfied by commit f942dc2552b8 in Linus' tree, based on commit
6b0b80ca7165 from [1].
In general, the full condition is sufficient, not necessary, because,
according to [2], live migration has been working for a long time without
satisfying sub-condition (2). However, after 6b0b80ca7165 was backported
to the RHEL-5 host to ensure (1), (2) still proved necessary in the RHEL-6
guest. This patch intends to provide (2) for upstream.
The Reviewed-by line comes from [3].
[1] git://xenbits.xen.org/people/ianc/linux-2.6.git#upstream/dom0/backend/netback-history
[2] http://old-list-archives.xen.org/xen-devel/2011-06/msg01969.html
[3] http://old-list-archives.xen.org/xen-devel/2011-07/msg00484.html
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-11 01:48:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-09 22:14:56 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-02-04 18:50:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-23 17:36:59 -05:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:44 +01:00
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-02 01:03:33 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2011-01-27 04:14:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-03 01:22:34 -05:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-31 19:04:35 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-22 11:17:06 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-23 15:54:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-04 14:38:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2015-02-04 14:38:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-18 10:52:04 +01:00
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-18 10:52:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
|
|
|
|
|
2026-02-18 10:52:04 +01:00
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-18 10:52:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-13 23:46:52 +08:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2009-05-04 12:40:54 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2020-07-24 10:59:10 +02:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
|
|
|
|
|
2012-06-25 22:48:41 +00:00
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
|
|
|
|
|
2015-08-19 19:14:20 -04:00
|
|
|
|
2018-01-11 09:36:38 +00:00
|
|
|
|
|
|
|
|
|
2015-01-13 16:42:42 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
2014-09-08 17:30:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2012-12-03 09:24:22 -05:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2010-08-18 23:27:49 +00:00
|
|
|
|
2014-09-08 17:30:41 +01:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-08-19 13:16:17 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4).
The user has the option of disabling the platform driver:
00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
which is used to unplug the emulated drivers (IDE, Realtek 8169, etc)
and allow the PV drivers to take over. If the user wishes
to disable that they can set:
xen_platform_pci=0
(in the guest config file)
or
xen_emul_unplug=never
(on the Linux command line)
except it does not work properly. The PV drivers still try to
load and since the Xen platform driver is not run - and it
has not initialized the grant tables, most of the PV drivers
stumble upon:
input: Xen Virtual Keyboard as /devices/virtual/input/input5
input: Xen Virtual Pointer as /devices/virtual/input/input6M
------------[ cut here ]------------
kernel BUG at /home/konrad/ssd/konrad/linux/drivers/xen/grant-table.c:1206!
invalid opcode: 0000 [#1] SMP
Modules linked in: xen_kbdfront(+) xenfs xen_privcmd
CPU: 6 PID: 1389 Comm: modprobe Not tainted 3.13.0-rc1upstream-00021-ga6c892b-dirty #1
Hardware name: Xen HVM domU, BIOS 4.4-unstable 11/26/2013
RIP: 0010:[<ffffffff813ddc40>] [<ffffffff813ddc40>] get_free_entries+0x2e0/0x300
Call Trace:
[<ffffffff8150d9a3>] ? evdev_connect+0x1e3/0x240
[<ffffffff813ddd0e>] gnttab_grant_foreign_access+0x2e/0x70
[<ffffffffa0010081>] xenkbd_connect_backend+0x41/0x290 [xen_kbdfront]
[<ffffffffa0010a12>] xenkbd_probe+0x2f2/0x324 [xen_kbdfront]
[<ffffffff813e5757>] xenbus_dev_probe+0x77/0x130
[<ffffffff813e7217>] xenbus_frontend_dev_probe+0x47/0x50
[<ffffffff8145e9a9>] driver_probe_device+0x89/0x230
[<ffffffff8145ebeb>] __driver_attach+0x9b/0xa0
[<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
[<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
[<ffffffff8145cf1c>] bus_for_each_dev+0x8c/0xb0
[<ffffffff8145e7d9>] driver_attach+0x19/0x20
[<ffffffff8145e260>] bus_add_driver+0x1a0/0x220
[<ffffffff8145f1ff>] driver_register+0x5f/0xf0
[<ffffffff813e55c5>] xenbus_register_driver_common+0x15/0x20
[<ffffffff813e76b3>] xenbus_register_frontend+0x23/0x40
[<ffffffffa0015000>] ? 0xffffffffa0014fff
[<ffffffffa001502b>] xenkbd_init+0x2b/0x1000 [xen_kbdfront]
[<ffffffff81002049>] do_one_initcall+0x49/0x170
.. snip..
which is hardly nice. This patch fixes this by having each
PV driver check for:
- if running in PV, then it is fine to execute (as that is their
native environment).
- if running in HVM, check if user wanted 'xen_emul_unplug=never',
in which case bail out and don't load any PV drivers.
- if running in HVM, and if PCI device 5853:0001 (xen_platform_pci)
does not exist, then bail out and not load PV drivers.
- (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=ide-disks',
then bail out for all PV devices _except_ the block one.
Ditto for the network one ('nics').
- (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=unnecessary'
then load block PV driver, and also setup the legacy IDE paths.
In (v3) make it actually load PV drivers.
Reported-by: Sander Eikelenboom <linux@eikelenboom.it
Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Reported-and-Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[v2: Add extra logic to handle the myrid ways 'xen_emul_unplug'
can be used per Ian and Stefano suggestion]
[v3: Make the unnecessary case work properly]
[v4: s/disks/ide-disks/ spotted by Fabio]
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> [for PCI parts]
CC: stable@vger.kernel.org
2013-11-26 15:05:40 -05:00
|
|
|
|
2012-03-21 15:08:38 +01:00
|
|
|
|
|
|
|
|
|
2013-06-27 21:57:49 -07:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
2025-11-03 11:22:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-10 11:18:58 +01:00
|
|
|
|
|
|
|
|
|
2017-01-10 14:32:51 +01:00
|
|
|
|
|
|
|
|
|
2014-06-04 10:30:45 +01:00
|
|
|
|
2008-11-22 17:38:14 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-11-22 17:38:14 +00:00
|
|
|
|
2007-07-17 18:37:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-02 10:54:05 -07:00
|
|
|
|
2008-04-02 10:54:06 -07:00
|
|
|
|