12 Dec, 2013
1 commit
-
SKIP_NONLOCAL hides the control flow. The control flow should be
inlined and expanded explicitly in code so that someone who reads
it can tell the control flow can be changed by the statement.Signed-off-by: Yang Yingliang
Signed-off-by: David S. Miller
11 Dec, 2013
39 commits
-
When adjusting the link speed, the target frequency is determined by a
'swith (LINK_SPEED)' statement, that assigns the target rate only for
valid and expected LINK_SPEED values. This incomplete switch statement
leads to the following build warning:
drivers/net/ethernet/cadence/macb.c: In function 'macb_handle_link_change':
>> drivers/net/ethernet/cadence/macb.c:241:14: warning: 'rate' may be used uninitialized in this function [-Wmaybe-uninitialized]
netdev_warn(dev, "unable to generate target frequency: %ld Hz\n",
^
drivers/net/ethernet/cadence/macb.c:215:13: note: 'rate' was declared here
long ferr, rate, rate_rounded;Fixing this by bailing out of that function in the switch's default case
before the rate variable is used.Reported-by: kbuild test robot
Signed-off-by: Soren Brinkmann
Signed-off-by: David S. Miller -
Jon Maloy says:
====================
tipc: cleanups in media and bearer layerThis commit series performs a number cleanups in order to make the
bearer and media part of the code more comprehensible and manageable.
====================Signed-off-by: David S. Miller
-
In early versions of TIPC it was possible to administratively block
individual links through the use of the member flag 'blocked'. This
functionality was deemed redundant, and since commit 7368dd ("tipc:
clean out all instances of #if 0'd unused code"), this flag has been
unused.In the current code, a link only needs to be blocked for sending and
reception if it is subject to an ongoing link failover. In that case,
it is sufficient to check if the number of expected failover packets
is non-zero, something which is done via the funtion 'link_blocked()'.This commit finally removes the redundant 'blocked' flag completely.
Signed-off-by: Ying Xue
Reviewed-by: Paul Gortmaker
Signed-off-by: Jon Maloy
Signed-off-by: David S. Miller -
Currently TIPC supports two L2 media types, Ethernet and Infiniband.
Because both these media are accessed through the common net_device API,
several functions in the two media adaptation files turn out to be
fully or almost identical, leading to unnecessary code duplication.In this commit we extract this common code from the two media files
and move them to the generic bearer.c. Additionally, we change
the function names to reflect their real role: to access L2 media,
irrespective of type.Signed-off-by: Ying Xue
Cc: Patrick McHardy
Reviewed-by: Paul Gortmaker
Signed-off-by: Jon Maloy
Signed-off-by: David S. Miller -
Currently, registering a TIPC stack handler in the network device layer
is done twice, once for Ethernet (eth_media) and Infiniband (ib_media)
repectively. But, as this registration is not media specific, we can
avoid some code duplication by moving the registering function to
the generic bearer layer, to the file bearer.c, and call it only once.
The same is true for the network device event notifier.As a side effect, the two workqueues we are using for for setting up/
cleaning up media can now be eliminated. Furthermore, the array for
storing the specific media type structs, media_array[], can be entirely
deleted.Note that the eth_started and ib_started flags were removed during the
code relocation. There is now only one call to bearer_setup and
bearer_cleanup, and these can logically not race against each other.Despite its size, this cleanup work incurs no functional changes in TIPC.
In particular, it should be noted that the sequence ordering of received
packets is unaffected by this change, since packet reception never was
subject to any work queue handling in the first place.Signed-off-by: Ying Xue
Cc: Patrick McHardy
Signed-off-by: Jon Maloy
Reviewed-by: Paul Gortmaker
Signed-off-by: David S. Miller -
TIPC is currently using the field 'af_packet_priv' in struct net_device
as a handle to find the bearer instance associated to the given network
device. But, by doing so it is blocking other networking cleanups, such
as the one discussed here:http://patchwork.ozlabs.org/patch/178044/
This commit removes this usage from TIPC. Instead, we introduce a new
field, 'tipc_ptr', to the net_device structure, to serve this purpose.
When TIPC bearer is enabled, the bearer object is associated to
'tipc_ptr'. When a TIPC packet arrives in the recv_msg() upcall
from a networking device, the bearer object can now be obtained from
'tipc_ptr'. When a bearer is disabled, the bearer object is detached
from its underlying network device by setting 'tipc_ptr' to NULL.Additionally, an RCU lock is used to protect the new pointer.
Henceforth, the existing tipc_net_lock is used in write mode to
serialize write accesses to this pointer, while the new RCU lock is
applied on the read side to ensure that the pointer is 100% valid
within its wrapped area for all readers.Signed-off-by: Ying Xue
Cc: Patrick McHardy
Reviewed-by: Paul Gortmaker
Signed-off-by: Jon Maloy
Signed-off-by: David S. Miller -
struct 'tipc_media' represents the specific info that the media
layer adaptors (eth_media and ib_media) expose to the generic
bearer layer. We clarify this by improved commenting, and by giving
the 'media_list' array the more appropriate name 'media_info_array'.There are no functional changes in this commit.
Signed-off-by: Ying Xue
Reviewed-by: Paul Gortmaker
Signed-off-by: Jon Maloy
Signed-off-by: David S. Miller -
Communication media types are abstracted through the struct 'tipc_media',
one per media type. These structs are allocated statically inside their
respective media file.Furthermore, in order to be able to reach all instances from a central
location, we keep a static array with pointers to these structs. This
array is currently initialized at runtime, under protection of
tipc_net_lock. However, since the contents of the array itself never
changes after initialization, we can just as well initialize it at
compile time and make it 'const', at the same time making it obvious
that no lock protection is needed here.This commit makes the array constant and removes the redundant lock
protection.Signed-off-by: Ying Xue
Reviewed-by: Paul Gortmaker
Signed-off-by: Jon Maloy
Signed-off-by: David S. Miller -
sk_buff lists are currently relased by looping over the list and
explicitly releasing each buffer.We replace all occurrences of this loop with a call to kfree_skb_list().
Signed-off-by: Ying Xue
Reviewed-by: Paul Gortmaker
Signed-off-by: Jon Maloy
Signed-off-by: David S. Miller -
From: Soren Brinkmann
====================
net: macb updatesI'd really like to have Ethernet working for Zynq, so I want to at least
revive this discussion regarding this patchset. And the first four
patches should not even be too controversial.
I didn't change anything compared to my original RFC submission, except
for a typo in one of the commit messages.
Handling the tx_clk as optional clock input seems a little bit weird,
but it works on my Zynq platform and should be compatible with other
users of macb and their DT descriptions.
====================Signed-off-by: David S. Miller
-
Adjust the ethernet clock according to the negotiated link speed.
Signed-off-by: Soren Brinkmann
Signed-off-by: David S. Miller -
Use the device managed interface to request the IRQ, simplifying error
paths.Signed-off-by: Soren Brinkmann
Acked-by: Nicolas Ferre
Signed-off-by: David S. Miller -
Use the device managed version of ioremap to remap IO memory,
simplifying error paths.Signed-off-by: Soren Brinkmann
Acked-by: Nicolas Ferre
Signed-off-by: David S. Miller -
Migrate to using the device managed interface for clocks and clean up
the associated error paths.Signed-off-by: Soren Brinkmann
Acked-by: Nicolas Ferre
Signed-off-by: David S. Miller -
Migrate the suspend/resume functions to use the dev_pm_ops PM interface.
Signed-off-by: Soren Brinkmann
Acked-by: Nicolas Ferre
Signed-off-by: David S. Miller -
Macros with multiple statements should be enclosed in a do - while loop
Signed-off-by: Yang Yingliang
Signed-off-by: David S. Miller -
Spaces required around that '>' (ctx:VxV) and
before the open parenthesis '('.Signed-off-by: Yang Yingliang
Signed-off-by: David S. Miller -
"foo* bar" or "foo * bar" should be "foo *bar".
Signed-off-by: Yang Yingliang
Signed-off-by: David S. Miller -
Code indent should use tabs where possible
Signed-off-by: Yang Yingliang
Signed-off-by: David S. Miller -
return is not a function, parentheses are not required.
Signed-off-by: Yang Yingliang
Signed-off-by: David S. Miller -
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: David S. Miller -
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: David S. Miller -
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: David S. Miller -
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: David S. Miller -
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: Shreyas N Bhatewara
Acked-by: Dmitry Torokhov
Signed-off-by: David S. Miller -
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: David S. Miller -
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: David S. Miller -
Signed-off-by: Stephen Hemminger
Acked-by: Michael S. Tsirkin
Signed-off-by: David S. Miller -
All the code passes NULL for the last sg list (in).
Simplify by just removing it.Signed-off-by: Stephen Hemminger
Acked-by: Michael S. Tsirkin
Signed-off-by: David S. Miller -
This patch makes socketpair() use error paths which do not
rely on heavy-weight call to sys_close(): it's better to try
to push the file descriptor to userspace before installing
the socket file to the file descriptor, so that errors are
catched earlier and being easier to handle.Using sys_close() seems to be the exception, while writing the
file descriptor before installing it look like it's more or less
the norm: eg. except for code used in init/, error handling
involve fput() and put_unused_fd(), but not sys_close().This make socketpair() usage of sys_close() quite unusual.
So it deserves to be replaced by the common pattern relying on
fput() and put_unused_fd() just like, for example, the one used
in pipe(2) or recvmsg(2).Three distinct error paths are still needed since calling
fput() on file structure returned by sock_alloc_file() will
implicitly call sock_release() on the associated socket
structure.Cc: David S. Miller
Cc: Al Viro
Signed-off-by: Yann Droneaud
Link: http://marc.info/?i=1385979146-13825-1-git-send-email-ydroneaud@opteya.com
Signed-off-by: David S. Miller -
This reverts commit 41e4af69a5984a3193ba3108fb4e067b0e34dc73.
MSG_TRUNC handling was broken and is going to be fixed in the
'net' tree, so revert this.Signed-off-by: David S. Miller
-
This reverts commit 73713357ab58aacda1af715bb5a623528dbbfd79.
MSG_TRUNC handling was broken and is going to be fixed in
the 'net' tree, so revert this.Signed-off-by: David S. Miller
-
Various spelling fixes in networking stack
Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller -
Jiri Pirko says:
====================
add support for IFA_FLAGS nl attributeAs this was recently added for ipv6, add it for the rest of occurences
as requested by DaveM.
====================Signed-off-by: David S. Miller
-
Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
Add support for yet another ARM member of the R-Car family, R-Car M2, also known
as R8A7791 -- it will share the code and data with previously added R8A7790.
Despite the Ether devices in these SoCs are indistinguishable at least from the
driver's point of view, we do introduce a new platform device ID "r8a7791-ether"
unlike the wildcard ID used for R8A7778/9 SoCs, due to newly established policy
for the Renesas SoCs.Signed-off-by: Sergei Shtylyov
Signed-off-by: David S. Miller -
Jeff Kirsher says:
====================
Intel Wired LAN Driver UpdatesThis series contains updates to i40e, igb, ixgbe and ixgbevf.
Shannon provides a couple of i40e patches, first restricts the ethtool
diag test messages by using netif_info() macro to when the hardware
bit is enabled in the message level netdev message mask. Second
provides a fix for when there is an out-of-range descriptor request.Kamil provides a fix for i40e by updating the loopback enum types and
add information about the current loopback mode to data returned from
get_link_info().Jesse provides a fix for i40e define name that was being mis-used.
I40E_ITR_NONE was being used as an ITRN register index by accident
because it was easily associated with the i40e Rx ITR and friends
defines, when it should be associated with the DYN_CTL register sets.Jacob provides an update for ixgbevf Kconfig description since the VF
driver supports more than just the 82599 device.Don and Alex provide a cleanup patch for ixgbe to make it where head,
tail, next to clean and next to use are all reset in a single function
for both Tx and Rx path. Before, the code for this was spread out over
several areas which made it difficult to track what the values were for
each of the values.Carolyn provides two igb patches to add a media switching feature for
i354 PHY's and new Media Auto Sense for 82580 devices only.Aaron Sierra provides a fix for igb to resolve an issue with the 64-bit
PCI addresses being truncated because the return values of
pci_resource_start() and pci_resouce_end() were being cast to unsigned
long.Guenter Roeck provides two igb patches, first simplifies the code by
attaching the hwmon sysfs attributes to hwmon device instead of the
PCI device. Second fixes the temperature sensor attribute index by
setting it to 1 instead of 0 (per hwmon ABI).
====================Signed-off-by: David S. Miller
-
I've realized that I need to call ethtool command to get Ethernet
working after booting. Ex call: ethtool -s eth0 autoneg on
It was fixing Ethernet even if auto-negotiation was already on.Adding calls to phy_start and phy_stop look like a real solution.
Signed-off-by: Rafał Miłecki
Acked-by: Florian Fainelli
Signed-off-by: David S. Miller