* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (44 commits) e1000e: increase driver version number e1000e: alternate MAC address update e1000e: do not disable receiver on 82574/82583 e1000e: alternate MAC address does not work on device id 0x1060 PCnet: Fix section mismatch bnx2x: disable dcb on 578xx since not supported yet bnx2x: properly clean indirect addresses bnx2x: prevent race between undi_unload and load flows bnx2x: fix select_queue when FCoE is disabled bnx2x: init FCOE FP only once ipv4: some rt_iif -> rt_route_iif conversions net/bridge/netfilter/ebtables.c: use available error handling code net/netlabel/netlabel_kapi.c: add missing cleanup code net/irda: sh_sir: tidyup compile warning net/irda: sh_sir: add missing header net/irda: sh_irda: add missing header slcan: ldisc generated skbs are received in softirq context scm: Capture the full credentials of the scm sender tcp: initialize variable ecn_ok in syncookies path drivers/net/wireless/wl1251: add missing kfree ...
Unified · Split
| @@ -238,6 +238,18 @@ ad_select · 237 unmodified lines | ||
| 238 | 238 | |
| 239 | 239 | This option was added in bonding version 3.4.0. |
| 240 | 240 | |
| 241 | +all_slaves_active | |
| 242 | + | |
| 243 | + Specifies that duplicate frames (received on inactive ports) should be | |
| 244 | + dropped (0) or delivered (1). | |
| 245 | + | |
| 246 | + Normally, bonding will drop duplicate frames (received on inactive | |
| 247 | + ports), which is desirable for most users. But there are some times | |
| 248 | + it is nice to allow duplicate frames to be delivered. | |
| 249 | + | |
| 250 | + The default value is 0 (drop duplicate frames received on inactive | |
| 251 | + ports). | |
| 252 | + | |
| 241 | 253 | arp_interval |
| 242 | 254 | |
| 243 | 255 | Specifies the ARP link monitoring frequency in milliseconds. |
| @@ -433,6 +445,23 @@ miimon · 189 unmodified lines | ||
| 433 | 445 | determined. See the High Availability section for additional |
| 434 | 446 | information. The default value is 0. |
| 435 | 447 | |
| 448 | +min_links | |
| 449 | + | |
| 450 | + Specifies the minimum number of links that must be active before | |
| 451 | + asserting carrier. It is similar to the Cisco EtherChannel min-links | |
| 452 | + feature. This allows setting the minimum number of member ports that | |
| 453 | + must be up (link-up state) before marking the bond device as up | |
| 454 | + (carrier on). This is useful for situations where higher level services | |
| 455 | + such as clustering want to ensure a minimum number of low bandwidth | |
| 456 | + links are active before switchover. This option only affect 802.3ad | |
| 457 | + mode. | |
| 458 | + | |
| 459 | + The default value is 0. This will cause carrier to be asserted (for | |
| 460 | + 802.3ad mode) whenever there is an active aggregator, regardless of the | |
| 461 | + number of available links in that aggregator. Note that, because an | |
| 462 | + aggregator cannot be active without at least one available link, | |
| 463 | + setting this option to 0 or to 1 has the exact same effect. | |
| 464 | + | |
| 436 | 465 | mode |
| 437 | 466 | |
| 438 | 467 | Specifies one of the bonding policies. The default is |
| @@ -0,0 +1,371 @@ | ||
| 1 | +Scaling in the Linux Networking Stack | |
| 2 | + | |
| 3 | + | |
| 4 | +Introduction | |
| 5 | +============ | |
| 6 | + | |
| 7 | +This document describes a set of complementary techniques in the Linux | |
| 8 | +networking stack to increase parallelism and improve performance for | |
| 9 | +multi-processor systems. | |
| 10 | + | |
| 11 | +The following technologies are described: | |
| 12 | + | |
| 13 | + RSS: Receive Side Scaling | |
| 14 | + RPS: Receive Packet Steering | |
| 15 | + RFS: Receive Flow Steering | |
| 16 | + Accelerated Receive Flow Steering | |
| 17 | + XPS: Transmit Packet Steering | |
| 18 | + | |
| 19 | + | |
| 20 | +RSS: Receive Side Scaling | |
| 21 | +========================= | |
| 22 | + | |
| 23 | +Contemporary NICs support multiple receive and transmit descriptor queues | |
| 24 | +(multi-queue). On reception, a NIC can send different packets to different | |
| 25 | +queues to distribute processing among CPUs. The NIC distributes packets by | |
| 26 | +applying a filter to each packet that assigns it to one of a small number | |
| 27 | +of logical flows. Packets for each flow are steered to a separate receive | |
| 28 | +queue, which in turn can be processed by separate CPUs. This mechanism is | |
| 29 | +generally known as “Receive-side Scaling” (RSS). The goal of RSS and | |
| 30 | +the other scaling techniques to increase performance uniformly. | |
| 31 | +Multi-queue distribution can also be used for traffic prioritization, but | |
| 32 | +that is not the focus of these techniques. | |
| 33 | + | |
| 34 | +The filter used in RSS is typically a hash function over the network | |
| 35 | +and/or transport layer headers-- for example, a 4-tuple hash over | |
| 36 | +IP addresses and TCP ports of a packet. The most common hardware | |
| 37 | +implementation of RSS uses a 128-entry indirection table where each entry | |
| 38 | +stores a queue number. The receive queue for a packet is determined | |
| 39 | +by masking out the low order seven bits of the computed hash for the | |
| 40 | +packet (usually a Toeplitz hash), taking this number as a key into the | |
| 41 | +indirection table and reading the corresponding value. | |
| 42 | + | |
| 43 | +Some advanced NICs allow steering packets to queues based on | |
| 44 | +programmable filters. For example, webserver bound TCP port 80 packets | |
| 45 | +can be directed to their own receive queue. Such “n-tuple” filters can | |
| 46 | +be configured from ethtool (--config-ntuple). | |
| 47 | + | |
| 48 | +==== RSS Configuration | |
| 49 | + | |
| 50 | +The driver for a multi-queue capable NIC typically provides a kernel | |
| 51 | +module parameter for specifying the number of hardware queues to | |
| 52 | +configure. In the bnx2x driver, for instance, this parameter is called | |
| 53 | +num_queues. A typical RSS configuration would be to have one receive queue | |
| 54 | +for each CPU if the device supports enough queues, or otherwise at least | |
| 55 | +one for each cache domain at a particular cache level (L1, L2, etc.). | |
| 56 | + | |
| 57 | +The indirection table of an RSS device, which resolves a queue by masked | |
| 58 | +hash, is usually programmed by the driver at initialization. The | |
| 59 | +default mapping is to distribute the queues evenly in the table, but the | |
| 60 | +indirection table can be retrieved and modified at runtime using ethtool | |
| 61 | +commands (--show-rxfh-indir and --set-rxfh-indir). Modifying the | |
| 62 | +indirection table could be done to give different queues different | |
| 63 | +relative weights. | |
| 64 | + | |
| 65 | +== RSS IRQ Configuration | |
| 66 | + | |
| 67 | +Each receive queue has a separate IRQ associated with it. The NIC triggers | |
| 68 | +this to notify a CPU when new packets arrive on the given queue. The | |
| 69 | +signaling path for PCIe devices uses message signaled interrupts (MSI-X), | |
| 70 | +that can route each interrupt to a particular CPU. The active mapping | |
| 71 | +of queues to IRQs can be determined from /proc/interrupts. By default, | |
| 72 | +an IRQ may be handled on any CPU. Because a non-negligible part of packet | |
| 73 | +processing takes place in receive interrupt handling, it is advantageous | |
| 74 | +to spread receive interrupts between CPUs. To manually adjust the IRQ | |
| 75 | +affinity of each interrupt see Documentation/IRQ-affinity. Some systems | |
| 76 | +will be running irqbalance, a daemon that dynamically optimizes IRQ | |
| 77 | +assignments and as a result may override any manual settings. | |
| 78 | + | |
| 79 | +== Suggested Configuration | |
| 80 | + | |
| 81 | +RSS should be enabled when latency is a concern or whenever receive | |
| 82 | +interrupt processing forms a bottleneck. Spreading load between CPUs | |
| 83 | +decreases queue length. For low latency networking, the optimal setting | |
| 84 | +is to allocate as many queues as there are CPUs in the system (or the | |
| 85 | +NIC maximum, if lower). Because the aggregate number of interrupts grows | |
| 86 | +with each additional queue, the most efficient high-rate configuration | |
| 87 | +is likely the one with the smallest number of receive queues where no | |
| 88 | +CPU that processes receive interrupts reaches 100% utilization. Per-cpu | |
| 89 | +load can be observed using the mpstat utility. | |
| 90 | + | |
| 91 | + | |
| 92 | +RPS: Receive Packet Steering | |
| 93 | +============================ | |
| 94 | + | |
| 95 | +Receive Packet Steering (RPS) is logically a software implementation of | |
| 96 | +RSS. Being in software, it is necessarily called later in the datapath. | |
| 97 | +Whereas RSS selects the queue and hence CPU that will run the hardware | |
| 98 | +interrupt handler, RPS selects the CPU to perform protocol processing | |
| 99 | +above the interrupt handler. This is accomplished by placing the packet | |
| 100 | +on the desired CPU’s backlog queue and waking up the CPU for processing. | |
| 101 | +RPS has some advantages over RSS: 1) it can be used with any NIC, | |
| 102 | +2) software filters can easily be added to hash over new protocols, | |
| 103 | +3) it does not increase hardware device interrupt rate (although it does | |
| 104 | +introduce inter-processor interrupts (IPIs)). | |
| 105 | + | |
| 106 | +RPS is called during bottom half of the receive interrupt handler, when | |
| 107 | +a driver sends a packet up the network stack with netif_rx() or | |
| 108 | +netif_receive_skb(). These call the get_rps_cpu() function, which | |
| 109 | +selects the queue that should process a packet. | |
| 110 | + | |
| 111 | +The first step in determining the target CPU for RPS is to calculate a | |
| 112 | +flow hash over the packet’s addresses or ports (2-tuple or 4-tuple hash | |
| 113 | +depending on the protocol). This serves as a consistent hash of the | |
| 114 | +associated flow of the packet. The hash is either provided by hardware | |
| 115 | +or will be computed in the stack. Capable hardware can pass the hash in | |
| 116 | +the receive descriptor for the packet; this would usually be the same | |
| 117 | +hash used for RSS (e.g. computed Toeplitz hash). The hash is saved in | |
| 118 | +skb->rx_hash and can be used elsewhere in the stack as a hash of the | |
| 119 | +packet’s flow. | |
| 120 | + | |
| 121 | +Each receive hardware queue has an associated list of CPUs to which | |
| 122 | +RPS may enqueue packets for processing. For each received packet, | |
| 123 | +an index into the list is computed from the flow hash modulo the size | |
| 124 | +of the list. The indexed CPU is the target for processing the packet, | |
| 125 | +and the packet is queued to the tail of that CPU’s backlog queue. At | |
| 126 | +the end of the bottom half routine, IPIs are sent to any CPUs for which | |
| 127 | +packets have been queued to their backlog queue. The IPI wakes backlog | |
| 128 | +processing on the remote CPU, and any queued packets are then processed | |
| 129 | +up the networking stack. | |
| 130 | + | |
| 131 | +==== RPS Configuration | |
| 132 | + | |
| 133 | +RPS requires a kernel compiled with the CONFIG_RPS kconfig symbol (on | |
| 134 | +by default for SMP). Even when compiled in, RPS remains disabled until | |
| 135 | +explicitly configured. The list of CPUs to which RPS may forward traffic | |
| 136 | +can be configured for each receive queue using a sysfs file entry: | |
| 137 | + | |
| 138 | + /sys/class/net/<dev>/queues/rx-<n>/rps_cpus | |
| 139 | + | |
| 140 | +This file implements a bitmap of CPUs. RPS is disabled when it is zero | |
| 141 | +(the default), in which case packets are processed on the interrupting | |
| 142 | +CPU. Documentation/IRQ-affinity.txt explains how CPUs are assigned to | |
| 143 | +the bitmap. | |
| 144 | + | |
| 145 | +== Suggested Configuration | |
| 146 | + | |
| 147 | +For a single queue device, a typical RPS configuration would be to set | |
| 148 | +the rps_cpus to the CPUs in the same cache domain of the interrupting | |
| 149 | +CPU. If NUMA locality is not an issue, this could also be all CPUs in | |
| 150 | +the system. At high interrupt rate, it might be wise to exclude the | |
| 151 | +interrupting CPU from the map since that already performs much work. | |
| 152 | + | |
| 153 | +For a multi-queue system, if RSS is configured so that a hardware | |
| 154 | +receive queue is mapped to each CPU, then RPS is probably redundant | |
| 155 | +and unnecessary. If there are fewer hardware queues than CPUs, then | |
| 156 | +RPS might be beneficial if the rps_cpus for each queue are the ones that | |
| 157 | +share the same cache domain as the interrupting CPU for that queue. | |
| 158 | + | |
| 159 | + | |
| 160 | +RFS: Receive Flow Steering | |
| 161 | +========================== | |
| 162 | + | |
| 163 | +While RPS steers packets solely based on hash, and thus generally | |
| 164 | +provides good load distribution, it does not take into account | |
| 165 | +application locality. This is accomplished by Receive Flow Steering | |
| 166 | +(RFS). The goal of RFS is to increase datacache hitrate by steering | |
| 167 | +kernel processing of packets to the CPU where the application thread | |
| 168 | +consuming the packet is running. RFS relies on the same RPS mechanisms | |
| 169 | +to enqueue packets onto the backlog of another CPU and to wake up that | |
| 170 | +CPU. | |
| 171 | + | |
| 172 | +In RFS, packets are not forwarded directly by the value of their hash, | |
| 173 | +but the hash is used as index into a flow lookup table. This table maps | |
| 174 | +flows to the CPUs where those flows are being processed. The flow hash | |
| 175 | +(see RPS section above) is used to calculate the index into this table. | |
| 176 | +The CPU recorded in each entry is the one which last processed the flow. | |
| 177 | +If an entry does not hold a valid CPU, then packets mapped to that entry | |
| 178 | +are steered using plain RPS. Multiple table entries may point to the | |
| 179 | +same CPU. Indeed, with many flows and few CPUs, it is very likely that | |
| 180 | +a single application thread handles flows with many different flow hashes. | |
| 181 | + | |
| 182 | +rps_sock_table is a global flow table that contains the *desired* CPU for | |
| 183 | +flows: the CPU that is currently processing the flow in userspace. Each | |
| 184 | +table value is a CPU index that is updated during calls to recvmsg and | |
| 185 | +sendmsg (specifically, inet_recvmsg(), inet_sendmsg(), inet_sendpage() | |
| 186 | +and tcp_splice_read()). | |
| 187 | + | |
| 188 | +When the scheduler moves a thread to a new CPU while it has outstanding | |
| 189 | +receive packets on the old CPU, packets may arrive out of order. To | |
| 190 | +avoid this, RFS uses a second flow table to track outstanding packets | |
| 191 | +for each flow: rps_dev_flow_table is a table specific to each hardware | |
| 192 | +receive queue of each device. Each table value stores a CPU index and a | |
| 193 | +counter. The CPU index represents the *current* CPU onto which packets | |
| 194 | +for this flow are enqueued for further kernel processing. Ideally, kernel | |
| 195 | +and userspace processing occur on the same CPU, and hence the CPU index | |
| 196 | +in both tables is identical. This is likely false if the scheduler has | |
| 197 | +recently migrated a userspace thread while the kernel still has packets | |
| 198 | +enqueued for kernel processing on the old CPU. | |
| 199 | + | |
| 200 | +The counter in rps_dev_flow_table values records the length of the current | |
| 201 | +CPU's backlog when a packet in this flow was last enqueued. Each backlog | |
| 202 | +queue has a head counter that is incremented on dequeue. A tail counter | |
| 203 | +is computed as head counter + queue length. In other words, the counter | |
| 204 | +in rps_dev_flow_table[i] records the last element in flow i that has | |
| 205 | +been enqueued onto the currently designated CPU for flow i (of course, | |
| 206 | +entry i is actually selected by hash and multiple flows may hash to the | |
| 207 | +same entry i). | |
| 208 | + | |
| 209 | +And now the trick for avoiding out of order packets: when selecting the | |
| 210 | +CPU for packet processing (from get_rps_cpu()) the rps_sock_flow table | |
| 211 | +and the rps_dev_flow table of the queue that the packet was received on | |
| 212 | +are compared. If the desired CPU for the flow (found in the | |
| 213 | +rps_sock_flow table) matches the current CPU (found in the rps_dev_flow | |
| 214 | +table), the packet is enqueued onto that CPU’s backlog. If they differ, | |
| 215 | +the current CPU is updated to match the desired CPU if one of the | |
| 216 | +following is true: | |
| 217 | + | |
| 218 | +- The current CPU's queue head counter >= the recorded tail counter | |
| 219 | + value in rps_dev_flow[i] | |
| 220 | +- The current CPU is unset (equal to NR_CPUS) | |
| 221 | +- The current CPU is offline | |
| 222 | + | |
| 223 | +After this check, the packet is sent to the (possibly updated) current | |
| 224 | +CPU. These rules aim to ensure that a flow only moves to a new CPU when | |
| 225 | +there are no packets outstanding on the old CPU, as the outstanding | |
| 226 | +packets could arrive later than those about to be processed on the new | |
| 227 | +CPU. | |
| 228 | + | |
| 229 | +==== RFS Configuration | |
| 230 | + | |
| 231 | +RFS is only available if the kconfig symbol CONFIG_RFS is enabled (on | |
| 232 | +by default for SMP). The functionality remains disabled until explicitly | |
| 233 | +configured. The number of entries in the global flow table is set through: | |
| 234 | + | |
| 235 | + /proc/sys/net/core/rps_sock_flow_entries | |
| 236 | + | |
| 237 | +The number of entries in the per-queue flow table are set through: | |
| 238 | + | |
| 239 | + /sys/class/net/<dev>/queues/tx-<n>/rps_flow_cnt | |
| 240 | + | |
| 241 | +== Suggested Configuration | |
| 242 | + | |
| 243 | +Both of these need to be set before RFS is enabled for a receive queue. | |
| 244 | +Values for both are rounded up to the nearest power of two. The | |
| 245 | +suggested flow count depends on the expected number of active connections | |
| 246 | +at any given time, which may be significantly less than the number of open | |
| 247 | +connections. We have found that a value of 32768 for rps_sock_flow_entries | |
| 248 | +works fairly well on a moderately loaded server. | |
| 249 | + | |
| 250 | +For a single queue device, the rps_flow_cnt value for the single queue | |
| 251 | +would normally be configured to the same value as rps_sock_flow_entries. | |
| 252 | +For a multi-queue device, the rps_flow_cnt for each queue might be | |
| 253 | +configured as rps_sock_flow_entries / N, where N is the number of | |
| 254 | +queues. So for instance, if rps_flow_entries is set to 32768 and there | |
| 255 | +are 16 configured receive queues, rps_flow_cnt for each queue might be | |
| 256 | +configured as 2048. | |
| 257 | + | |
| 258 | + | |
| 259 | +Accelerated RFS | |
| 260 | +=============== | |
| 261 | + | |
| 262 | +Accelerated RFS is to RFS what RSS is to RPS: a hardware-accelerated load | |
| 263 | +balancing mechanism that uses soft state to steer flows based on where | |
| 264 | +the application thread consuming the packets of each flow is running. | |
| 265 | +Accelerated RFS should perform better than RFS since packets are sent | |
| 266 | +directly to a CPU local to the thread consuming the data. The target CPU | |
| 267 | +will either be the same CPU where the application runs, or at least a CPU | |
| 268 | +which is local to the application thread’s CPU in the cache hierarchy. | |
| 269 | + | |
| 270 | +To enable accelerated RFS, the networking stack calls the | |
| 271 | +ndo_rx_flow_steer driver function to communicate the desired hardware | |
| 272 | +queue for packets matching a particular flow. The network stack | |
| 273 | +automatically calls this function every time a flow entry in | |
| 274 | +rps_dev_flow_table is updated. The driver in turn uses a device specific | |
| 275 | +method to program the NIC to steer the packets. | |
| 276 | + | |
| 277 | +The hardware queue for a flow is derived from the CPU recorded in | |
| 278 | +rps_dev_flow_table. The stack consults a CPU to hardware queue map which | |
| 279 | +is maintained by the NIC driver. This is an auto-generated reverse map of | |
| 280 | +the IRQ affinity table shown by /proc/interrupts. Drivers can use | |
| 281 | +functions in the cpu_rmap (“CPU affinity reverse map”) kernel library | |
| 282 | +to populate the map. For each CPU, the corresponding queue in the map is | |
| 283 | +set to be one whose processing CPU is closest in cache locality. | |
| 284 | + | |
| 285 | +==== Accelerated RFS Configuration | |
| 286 | + | |
| 287 | +Accelerated RFS is only available if the kernel is compiled with | |
| 288 | +CONFIG_RFS_ACCEL and support is provided by the NIC device and driver. | |
| 289 | +It also requires that ntuple filtering is enabled via ethtool. The map | |
| 290 | +of CPU to queues is automatically deduced from the IRQ affinities | |
| 291 | +configured for each receive queue by the driver, so no additional | |
| 292 | +configuration should be necessary. | |
| 293 | + | |
| 294 | +== Suggested Configuration | |
| 295 | + | |
| 296 | +This technique should be enabled whenever one wants to use RFS and the | |
| 297 | +NIC supports hardware acceleration. | |
| 298 | + | |
| 299 | +XPS: Transmit Packet Steering | |
| 300 | +============================= | |
| 301 | + | |
| 302 | +Transmit Packet Steering is a mechanism for intelligently selecting | |
| 303 | +which transmit queue to use when transmitting a packet on a multi-queue | |
| 304 | +device. To accomplish this, a mapping from CPU to hardware queue(s) is | |
| 305 | +recorded. The goal of this mapping is usually to assign queues | |
| 306 | +exclusively to a subset of CPUs, where the transmit completions for | |
| 307 | +these queues are processed on a CPU within this set. This choice | |
| 308 | +provides two benefits. First, contention on the device queue lock is | |
| 309 | +significantly reduced since fewer CPUs contend for the same queue | |
| 310 | +(contention can be eliminated completely if each CPU has its own | |
| 311 | +transmit queue). Secondly, cache miss rate on transmit completion is | |
| 312 | +reduced, in particular for data cache lines that hold the sk_buff | |
| 313 | +structures. | |
| 314 | + | |
| 315 | +XPS is configured per transmit queue by setting a bitmap of CPUs that | |
| 316 | +may use that queue to transmit. The reverse mapping, from CPUs to | |
| 317 | +transmit queues, is computed and maintained for each network device. | |
| 318 | +When transmitting the first packet in a flow, the function | |
| 319 | +get_xps_queue() is called to select a queue. This function uses the ID | |
| 320 | +of the running CPU as a key into the CPU-to-queue lookup table. If the | |
| 321 | +ID matches a single queue, that is used for transmission. If multiple | |
| 322 | +queues match, one is selected by using the flow hash to compute an index | |
| 323 | +into the set. | |
| 324 | + | |
| 325 | +The queue chosen for transmitting a particular flow is saved in the | |
| 326 | +corresponding socket structure for the flow (e.g. a TCP connection). | |
| 327 | +This transmit queue is used for subsequent packets sent on the flow to | |
| 328 | +prevent out of order (ooo) packets. The choice also amortizes the cost | |
| 329 | +of calling get_xps_queues() over all packets in the connection. To avoid | |
| 330 | +ooo packets, the queue for a flow can subsequently only be changed if | |
| 331 | +skb->ooo_okay is set for a packet in the flow. This flag indicates that | |
| 332 | +there are no outstanding packets in the flow, so the transmit queue can | |
| 333 | +change without the risk of generating out of order packets. The | |
| 334 | +transport layer is responsible for setting ooo_okay appropriately. TCP, | |
| 335 | +for instance, sets the flag when all data for a connection has been | |
| 336 | +acknowledged. | |
| 337 | + | |
| 338 | +==== XPS Configuration | |
| 339 | + | |
| 340 | +XPS is only available if the kconfig symbol CONFIG_XPS is enabled (on by | |
| 341 | +default for SMP). The functionality remains disabled until explicitly | |
| 342 | +configured. To enable XPS, the bitmap of CPUs that may use a transmit | |
| 343 | +queue is configured using the sysfs file entry: | |
| 344 | + | |
| 345 | +/sys/class/net/<dev>/queues/tx-<n>/xps_cpus | |
| 346 | + | |
| 347 | +== Suggested Configuration | |
| 348 | + | |
| 349 | +For a network device with a single transmission queue, XPS configuration | |
| 350 | +has no effect, since there is no choice in this case. In a multi-queue | |
| 351 | +system, XPS is preferably configured so that each CPU maps onto one queue. | |
| 352 | +If there are as many queues as there are CPUs in the system, then each | |
| 353 | +queue can also map onto one CPU, resulting in exclusive pairings that | |
| 354 | +experience no contention. If there are fewer queues than CPUs, then the | |
| 355 | +best CPUs to share a given queue are probably those that share the cache | |
| 356 | +with the CPU that processes transmit completions for that queue | |
| 357 | +(transmit interrupts). | |
| 358 | + | |
| 359 | + | |
| 360 | +Further Information | |
| 361 | +=================== | |
| 362 | +RPS and RFS were introduced in kernel 2.6.35. XPS was incorporated into | |
| 363 | +2.6.38. Original patches were submitted by Tom Herbert | |
| 364 | +(therbert@google.com) | |
| 365 | + | |
| 366 | +Accelerated RFS was introduced in 2.6.35. Original patches were | |
| 367 | +submitted by Ben Hutchings (bhutchings@solarflare.com) | |
| 368 | + | |
| 369 | +Authors: | |
| 370 | +Tom Herbert (therbert@google.com) | |
| 371 | +Willem de Bruijn (willemb@google.com) | |
| @@ -63,8 +63,9 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index) · 62 unmodified lines | ||
| 63 | 63 | fp->disable_tpa = ((bp->flags & TPA_ENABLE_FLAG) == 0); |
| 64 | 64 | |
| 65 | 65 | #ifdef BCM_CNIC |
| 66 | − /* We don't want TPA on FCoE, FWD and OOO L2 rings */ | |
| 67 | − bnx2x_fcoe(bp, disable_tpa) = 1; | |
| 66 | + /* We don't want TPA on an FCoE L2 ring */ | |
| 67 | + if (IS_FCOE_FP(fp)) | |
| 68 | + fp->disable_tpa = 1; | |
| 68 | 69 | #endif |
| 69 | 70 | } |
| 70 | 71 | |
| @@ -1404,10 +1405,9 @@ void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) · 1333 unmodified lines | ||
| 1404 | 1405 | u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) |
| 1405 | 1406 | { |
| 1406 | 1407 | struct bnx2x *bp = netdev_priv(dev); |
| 1408 | + | |
| 1407 | 1409 | #ifdef BCM_CNIC |
| 1408 | − if (NO_FCOE(bp)) | |
| 1409 | − return skb_tx_hash(dev, skb); | |
| 1410 | − else { | |
| 1410 | + if (!NO_FCOE(bp)) { | |
| 1411 | 1411 | struct ethhdr *hdr = (struct ethhdr *)skb->data; |
| 1412 | 1412 | u16 ether_type = ntohs(hdr->h_proto); |
| 1413 | 1413 | |
| @@ -1424,8 +1424,7 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) · 10 unmodified lines | ||
| 1424 | 1424 | return bnx2x_fcoe_tx(bp, txq_index); |
| 1425 | 1425 | } |
| 1426 | 1426 | #endif |
| 1427 | − /* Select a none-FCoE queue: if FCoE is enabled, exclude FCoE L2 ring | |
| 1428 | − */ | |
| 1427 | + /* select a non-FCoE queue */ | |
| 1429 | 1428 | return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp)); |
| 1430 | 1429 | } |
| 1431 | 1430 | |
| @@ -1448,6 +1447,28 @@ void bnx2x_set_num_queues(struct bnx2x *bp) · 16 unmodified lines | ||
| 1448 | 1447 | bp->num_queues += NON_ETH_CONTEXT_USE; |
| 1449 | 1448 | } |
| 1450 | 1449 | |
| 1450 | +/** | |
| 1451 | + * bnx2x_set_real_num_queues - configure netdev->real_num_[tx,rx]_queues | |
| 1452 | + * | |
| 1453 | + * @bp: Driver handle | |
| 1454 | + * | |
| 1455 | + * We currently support for at most 16 Tx queues for each CoS thus we will | |
| 1456 | + * allocate a multiple of 16 for ETH L2 rings according to the value of the | |
| 1457 | + * bp->max_cos. | |
| 1458 | + * | |
| 1459 | + * If there is an FCoE L2 queue the appropriate Tx queue will have the next | |
| 1460 | + * index after all ETH L2 indices. | |
| 1461 | + * | |
| 1462 | + * If the actual number of Tx queues (for each CoS) is less than 16 then there | |
| 1463 | + * will be the holes at the end of each group of 16 ETh L2 indices (0..15, | |
| 1464 | + * 16..31,...) with indicies that are not coupled with any real Tx queue. | |
| 1465 | + * | |
| 1466 | + * The proper configuration of skb->queue_mapping is handled by | |
| 1467 | + * bnx2x_select_queue() and __skb_tx_hash(). | |
| 1468 | + * | |
| 1469 | + * bnx2x_setup_tc() takes care of the proper TC mappings so that __skb_tx_hash() | |
| 1470 | + * will return a proper Tx index if TC is enabled (netdev->num_tc > 0). | |
| 1471 | + */ | |
| 1451 | 1472 | static inline int bnx2x_set_real_num_queues(struct bnx2x *bp) |
| 1452 | 1473 | { |
| 1453 | 1474 | int rc, tx, rx; |
| @@ -920,7 +920,7 @@ static void bnx2x_dcbx_admin_mib_updated_params(struct bnx2x *bp, · 919 unmodified lines | ||
| 920 | 920 | |
| 921 | 921 | void bnx2x_dcbx_set_state(struct bnx2x *bp, bool dcb_on, u32 dcbx_enabled) |
| 922 | 922 | { |
| 923 | − if (!CHIP_IS_E1x(bp)) { | |
| 923 | + if (!CHIP_IS_E1x(bp) && !CHIP_IS_E3(bp)) { | |
| 924 | 924 | bp->dcb_state = dcb_on; |
| 925 | 925 | bp->dcbx_enabled = dcbx_enabled; |
| 926 | 926 | } else { |
| @@ -5798,6 +5798,12 @@ static int bnx2x_init_hw_common(struct bnx2x *bp) · 5797 unmodified lines | ||
| 5798 | 5798 | |
| 5799 | 5799 | DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_ABS_FUNC(bp)); |
| 5800 | 5800 | |
| 5801 | + /* | |
| 5802 | + * take the UNDI lock to protect undi_unload flow from accessing | |
| 5803 | + * registers while we're resetting the chip | |
| 5804 | + */ | |
| 5805 | + bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | |
| 5806 | + | |
| 5801 | 5807 | bnx2x_reset_common(bp); |
| 5802 | 5808 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff); |
| 5803 | 5809 | |
| @@ -5808,6 +5814,8 @@ static int bnx2x_init_hw_common(struct bnx2x *bp) · 4 unmodified lines | ||
| 5808 | 5814 | } |
| 5809 | 5815 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, val); |
| 5810 | 5816 | |
| 5817 | + bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | |
| 5818 | + | |
| 5811 | 5819 | bnx2x_init_block(bp, BLOCK_MISC, PHASE_COMMON); |
| 5812 | 5820 | |
| 5813 | 5821 | if (!CHIP_IS_E1x(bp)) { |
| @@ -10251,10 +10259,17 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev, · 4437 unmodified lines | ||
| 10251 | 10259 | /* clean indirect addresses */ |
| 10252 | 10260 | pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS, |
| 10253 | 10261 | PCICFG_VENDOR_ID_OFFSET); |
| 10254 | − REG_WR(bp, PXP2_REG_PGL_ADDR_88_F0 + BP_PORT(bp)*16, 0); | |
| 10255 | − REG_WR(bp, PXP2_REG_PGL_ADDR_8C_F0 + BP_PORT(bp)*16, 0); | |
| 10256 | − REG_WR(bp, PXP2_REG_PGL_ADDR_90_F0 + BP_PORT(bp)*16, 0); | |
| 10257 | − REG_WR(bp, PXP2_REG_PGL_ADDR_94_F0 + BP_PORT(bp)*16, 0); | |
| 10262 | + /* Clean the following indirect addresses for all functions since it | |
| 10263 | + * is not used by the driver. | |
| 10264 | + */ | |
| 10265 | + REG_WR(bp, PXP2_REG_PGL_ADDR_88_F0, 0); | |
| 10266 | + REG_WR(bp, PXP2_REG_PGL_ADDR_8C_F0, 0); | |
| 10267 | + REG_WR(bp, PXP2_REG_PGL_ADDR_90_F0, 0); | |
| 10268 | + REG_WR(bp, PXP2_REG_PGL_ADDR_94_F0, 0); | |
| 10269 | + REG_WR(bp, PXP2_REG_PGL_ADDR_88_F1, 0); | |
| 10270 | + REG_WR(bp, PXP2_REG_PGL_ADDR_8C_F1, 0); | |
| 10271 | + REG_WR(bp, PXP2_REG_PGL_ADDR_90_F1, 0); | |
| 10272 | + REG_WR(bp, PXP2_REG_PGL_ADDR_94_F1, 0); | |
| 10258 | 10273 | |
| 10259 | 10274 | /* |
| 10260 | 10275 | * Enable internal target-read (in case we are probed after PF FLR). |
| @@ -3007,11 +3007,27 @@ · 3006 unmodified lines | ||
| 3007 | 3007 | /* [R 6] Debug only: Number of used entries in the data FIFO */ |
| 3008 | 3008 | #define PXP2_REG_HST_DATA_FIFO_STATUS 0x12047c |
| 3009 | 3009 | /* [R 7] Debug only: Number of used entries in the header FIFO */ |
| 3010 | −#define PXP2_REG_HST_HEADER_FIFO_STATUS 0x120478 | |
| 3011 | −#define PXP2_REG_PGL_ADDR_88_F0 0x120534 | |
| 3012 | −#define PXP2_REG_PGL_ADDR_8C_F0 0x120538 | |
| 3013 | −#define PXP2_REG_PGL_ADDR_90_F0 0x12053c | |
| 3014 | −#define PXP2_REG_PGL_ADDR_94_F0 0x120540 | |
| 3010 | +#define PXP2_REG_HST_HEADER_FIFO_STATUS 0x120478 | |
| 3011 | +#define PXP2_REG_PGL_ADDR_88_F0 0x120534 | |
| 3012 | +/* [R 32] GRC address for configuration access to PCIE config address 0x88. | |
| 3013 | + * any write to this PCIE address will cause a GRC write access to the | |
| 3014 | + * address that's in t this register */ | |
| 3015 | +#define PXP2_REG_PGL_ADDR_88_F1 0x120544 | |
| 3016 | +#define PXP2_REG_PGL_ADDR_8C_F0 0x120538 | |
| 3017 | +/* [R 32] GRC address for configuration access to PCIE config address 0x8c. | |
| 3018 | + * any write to this PCIE address will cause a GRC write access to the | |
| 3019 | + * address that's in t this register */ | |
| 3020 | +#define PXP2_REG_PGL_ADDR_8C_F1 0x120548 | |
| 3021 | +#define PXP2_REG_PGL_ADDR_90_F0 0x12053c | |
| 3022 | +/* [R 32] GRC address for configuration access to PCIE config address 0x90. | |
| 3023 | + * any write to this PCIE address will cause a GRC write access to the | |
| 3024 | + * address that's in t this register */ | |
| 3025 | +#define PXP2_REG_PGL_ADDR_90_F1 0x12054c | |
| 3026 | +#define PXP2_REG_PGL_ADDR_94_F0 0x120540 | |
| 3027 | +/* [R 32] GRC address for configuration access to PCIE config address 0x94. | |
| 3028 | + * any write to this PCIE address will cause a GRC write access to the | |
| 3029 | + * address that's in t this register */ | |
| 3030 | +#define PXP2_REG_PGL_ADDR_94_F1 0x120550 | |
| 3015 | 3031 | #define PXP2_REG_PGL_CONTROL0 0x120490 |
| 3016 | 3032 | #define PXP2_REG_PGL_CONTROL1 0x120514 |
| 3017 | 3033 | #define PXP2_REG_PGL_DEBUG 0x120520 |
| @@ -197,7 +197,7 @@ static void slc_bump(struct slcan *sl) · 196 unmodified lines | ||
| 197 | 197 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
| 198 | 198 | memcpy(skb_put(skb, sizeof(struct can_frame)), |
| 199 | 199 | &cf, sizeof(struct can_frame)); |
| 200 | − netif_rx(skb); | |
| 200 | + netif_rx_ni(skb); | |
| 201 | 201 | |
| 202 | 202 | sl->dev->stats.rx_packets++; |
| 203 | 203 | sl->dev->stats.rx_bytes += cf.can_dlc; |
| @@ -2085,7 +2085,8 @@ struct e1000_info e1000_82574_info = { · 2084 unmodified lines | ||
| 2085 | 2085 | | FLAG_HAS_AMT |
| 2086 | 2086 | | FLAG_HAS_CTRLEXT_ON_LOAD, |
| 2087 | 2087 | .flags2 = FLAG2_CHECK_PHY_HANG |
| 2088 | − | FLAG2_DISABLE_ASPM_L0S, | |
| 2088 | + | FLAG2_DISABLE_ASPM_L0S | |
| 2089 | + | FLAG2_NO_DISABLE_RX, | |
| 2089 | 2090 | .pba = 32, |
| 2090 | 2091 | .max_hw_frame_size = DEFAULT_JUMBO, |
| 2091 | 2092 | .get_variants = e1000_get_variants_82571, |
| @@ -2104,7 +2105,8 @@ struct e1000_info e1000_82583_info = { · 12 unmodified lines | ||
| 2104 | 2105 | | FLAG_HAS_AMT |
| 2105 | 2106 | | FLAG_HAS_JUMBO_FRAMES |
| 2106 | 2107 | | FLAG_HAS_CTRLEXT_ON_LOAD, |
| 2107 | − .flags2 = FLAG2_DISABLE_ASPM_L0S, | |
| 2108 | + .flags2 = FLAG2_DISABLE_ASPM_L0S | |
| 2109 | + | FLAG2_NO_DISABLE_RX, | |
| 2108 | 2110 | .pba = 32, |
| 2109 | 2111 | .max_hw_frame_size = DEFAULT_JUMBO, |
| 2110 | 2112 | .get_variants = e1000_get_variants_82571, |
| @@ -453,6 +453,7 @@ struct e1000_info { · 452 unmodified lines | ||
| 453 | 453 | #define FLAG2_DISABLE_ASPM_L0S (1 << 7) |
| 454 | 454 | #define FLAG2_DISABLE_AIM (1 << 8) |
| 455 | 455 | #define FLAG2_CHECK_PHY_HANG (1 << 9) |
| 456 | +#define FLAG2_NO_DISABLE_RX (1 << 10) | |
| 456 | 457 | |
| 457 | 458 | #define E1000_RX_DESC_PS(R, i) \ |
| 458 | 459 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) |
| @@ -1206,7 +1206,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) · 1205 unmodified lines | ||
| 1206 | 1206 | rx_ring->next_to_clean = 0; |
| 1207 | 1207 | |
| 1208 | 1208 | rctl = er32(RCTL); |
| 1209 | − ew32(RCTL, rctl & ~E1000_RCTL_EN); | |
| 1209 | + if (!(adapter->flags2 & FLAG2_NO_DISABLE_RX)) | |
| 1210 | + ew32(RCTL, rctl & ~E1000_RCTL_EN); | |
| 1210 | 1211 | ew32(RDBAL, ((u64) rx_ring->dma & 0xFFFFFFFF)); |
| 1211 | 1212 | ew32(RDBAH, ((u64) rx_ring->dma >> 32)); |
| 1212 | 1213 | ew32(RDLEN, rx_ring->size); |
| @@ -190,7 +190,8 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) · 189 unmodified lines | ||
| 190 | 190 | /* Check for LOM (vs. NIC) or one of two valid mezzanine cards */ |
| 191 | 191 | if (!((nvm_data & NVM_COMPAT_LOM) || |
| 192 | 192 | (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES_DUAL) || |
| 193 | − (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD))) | |
| 193 | + (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD) || | |
| 194 | + (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES))) | |
| 194 | 195 | goto out; |
| 195 | 196 | |
| 196 | 197 | ret_val = e1000_read_nvm(hw, NVM_ALT_MAC_ADDR_PTR, 1, |
| @@ -200,10 +201,10 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) · 3 unmodified lines | ||
| 200 | 201 | goto out; |
| 201 | 202 | } |
| 202 | 203 | |
| 203 | − if (nvm_alt_mac_addr_offset == 0xFFFF) { | |
| 204 | + if ((nvm_alt_mac_addr_offset == 0xFFFF) || | |
| 205 | + (nvm_alt_mac_addr_offset == 0x0000)) | |
| 204 | 206 | /* There is no Alternate MAC Address */ |
| 205 | 207 | goto out; |
| 206 | − } | |
| 207 | 208 | |
| 208 | 209 | if (hw->bus.func == E1000_FUNC_1) |
| 209 | 210 | nvm_alt_mac_addr_offset += E1000_ALT_MAC_ADDRESS_OFFSET_LAN1; |
| @@ -56,7 +56,7 @@ · 55 unmodified lines | ||
| 56 | 56 | |
| 57 | 57 | #define DRV_EXTRAVERSION "-k" |
| 58 | 58 | |
| 59 | −#define DRV_VERSION "1.3.16" DRV_EXTRAVERSION | |
| 59 | +#define DRV_VERSION "1.4.4" DRV_EXTRAVERSION | |
| 60 | 60 | char e1000e_driver_name[] = "e1000e"; |
| 61 | 61 | const char e1000e_driver_version[] = DRV_VERSION; |
| 62 | 62 | |
| @@ -2915,7 +2915,8 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) · 2852 unmodified lines | ||
| 2915 | 2915 | |
| 2916 | 2916 | /* disable receives while setting up the descriptors */ |
| 2917 | 2917 | rctl = er32(RCTL); |
| 2918 | − ew32(RCTL, rctl & ~E1000_RCTL_EN); | |
| 2918 | + if (!(adapter->flags2 & FLAG2_NO_DISABLE_RX)) | |
| 2919 | + ew32(RCTL, rctl & ~E1000_RCTL_EN); | |
| 2919 | 2920 | e1e_flush(); |
| 2920 | 2921 | usleep_range(10000, 20000); |
| 2921 | 2922 | |
| @@ -3394,7 +3395,8 @@ void e1000e_down(struct e1000_adapter *adapter) · 472 unmodified lines | ||
| 3394 | 3395 | |
| 3395 | 3396 | /* disable receives in the hardware */ |
| 3396 | 3397 | rctl = er32(RCTL); |
| 3397 | − ew32(RCTL, rctl & ~E1000_RCTL_EN); | |
| 3398 | + if (!(adapter->flags2 & FLAG2_NO_DISABLE_RX)) | |
| 3399 | + ew32(RCTL, rctl & ~E1000_RCTL_EN); | |
| 3398 | 3400 | /* flush and sleep below */ |
| 3399 | 3401 | |
| 3400 | 3402 | netif_stop_queue(netdev); |
| @@ -3403,6 +3405,7 @@ void e1000e_down(struct e1000_adapter *adapter) · 2 unmodified lines | ||
| 3403 | 3405 | tctl = er32(TCTL); |
| 3404 | 3406 | tctl &= ~E1000_TCTL_EN; |
| 3405 | 3407 | ew32(TCTL, tctl); |
| 3408 | + | |
| 3406 | 3409 | /* flush both disables and wait for them to finish */ |
| 3407 | 3410 | e1e_flush(); |
| 3408 | 3411 | usleep_range(10000, 20000); |
| @@ -193,14 +193,9 @@ static void set_alarm(struct etsects *etsects) · 192 unmodified lines | ||
| 193 | 193 | /* Caller must hold etsects->lock. */ |
| 194 | 194 | static void set_fipers(struct etsects *etsects) |
| 195 | 195 | { |
| 196 | − u32 tmr_ctrl = gfar_read(&etsects->regs->tmr_ctrl); | |
| 197 | − | |
| 198 | − gfar_write(&etsects->regs->tmr_ctrl, tmr_ctrl & (~TE)); | |
| 199 | − gfar_write(&etsects->regs->tmr_prsc, etsects->tmr_prsc); | |
| 196 | + set_alarm(etsects); | |
| 200 | 197 | gfar_write(&etsects->regs->tmr_fiper1, etsects->tmr_fiper1); |
| 201 | 198 | gfar_write(&etsects->regs->tmr_fiper2, etsects->tmr_fiper2); |
| 202 | − set_alarm(etsects); | |
| 203 | − gfar_write(&etsects->regs->tmr_ctrl, tmr_ctrl|TE); | |
| 204 | 199 | } |
| 205 | 200 | |
| 206 | 201 | /* |
| @@ -511,7 +506,7 @@ static int gianfar_ptp_probe(struct platform_device *dev) · 304 unmodified lines | ||
| 511 | 506 | gfar_write(&etsects->regs->tmr_fiper1, etsects->tmr_fiper1); |
| 512 | 507 | gfar_write(&etsects->regs->tmr_fiper2, etsects->tmr_fiper2); |
| 513 | 508 | set_alarm(etsects); |
| 514 | − gfar_write(&etsects->regs->tmr_ctrl, tmr_ctrl|FS|RTPE|TE); | |
| 509 | + gfar_write(&etsects->regs->tmr_ctrl, tmr_ctrl|FS|RTPE|TE|FRD); | |
| 515 | 510 | |
| 516 | 511 | spin_unlock_irqrestore(&etsects->lock, flags); |
| 517 | 512 | |
| @@ -22,6 +22,8 @@ · 21 unmodified lines | ||
| 22 | 22 | * - DMA transfer support |
| 23 | 23 | * - FIFO mode support |
| 24 | 24 | */ |
| 25 | +#include <linux/io.h> | |
| 26 | +#include <linux/interrupt.h> | |
| 25 | 27 | #include <linux/module.h> |
| 26 | 28 | #include <linux/platform_device.h> |
| 27 | 29 | #include <linux/clk.h> |
| @@ -12,6 +12,8 @@ · 11 unmodified lines | ||
| 12 | 12 | * published by the Free Software Foundation. |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | +#include <linux/io.h> | |
| 16 | +#include <linux/interrupt.h> | |
| 15 | 17 | #include <linux/module.h> |
| 16 | 18 | #include <linux/platform_device.h> |
| 17 | 19 | #include <linux/slab.h> |
| @@ -511,7 +513,7 @@ static void sh_sir_tx(struct sh_sir_self *self, int phase) · 493 unmodified lines | ||
| 511 | 513 | |
| 512 | 514 | static int sh_sir_read_data(struct sh_sir_self *self) |
| 513 | 515 | { |
| 514 | − u16 val; | |
| 516 | + u16 val = 0; | |
| 515 | 517 | int timeout = 1024; |
| 516 | 518 | |
| 517 | 519 | while (timeout--) { |
| @@ -82,7 +82,7 @@ static int cards_found; · 81 unmodified lines | ||
| 82 | 82 | /* |
| 83 | 83 | * VLB I/O addresses |
| 84 | 84 | */ |
| 85 | −static unsigned int pcnet32_portlist[] __initdata = | |
| 85 | +static unsigned int pcnet32_portlist[] = | |
| 86 | 86 | { 0x300, 0x320, 0x340, 0x360, 0 }; |
| 87 | 87 | |
| 88 | 88 | static int pcnet32_debug; |
| @@ -34,8 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | #define PAGESEL 0x13 |
| 35 | 35 | #define LAYER4 0x02 |
| 36 | 36 | #define LAYER2 0x01 |
| 37 | −#define MAX_RXTS 4 | |
| 38 | −#define MAX_TXTS 4 | |
| 37 | +#define MAX_RXTS 64 | |
| 39 | 38 | #define N_EXT_TS 1 |
| 40 | 39 | #define PSF_PTPVER 2 |
| 41 | 40 | #define PSF_EVNT 0x4000 |
| @@ -218,7 +217,7 @@ static void phy2rxts(struct phy_rxts *p, struct rxts *rxts) · 176 unmodified lines | ||
| 218 | 217 | rxts->seqid = p->seqid; |
| 219 | 218 | rxts->msgtype = (p->msgtype >> 12) & 0xf; |
| 220 | 219 | rxts->hash = p->msgtype & 0x0fff; |
| 221 | − rxts->tmo = jiffies + HZ; | |
| 220 | + rxts->tmo = jiffies + 2; | |
| 222 | 221 | } |
| 223 | 222 | |
| 224 | 223 | static u64 phy2txts(struct phy_txts *p) |
| @@ -367,7 +367,7 @@ static void sl_bump(struct slip *sl) · 366 unmodified lines | ||
| 367 | 367 | memcpy(skb_put(skb, count), sl->rbuff, count); |
| 368 | 368 | skb_reset_mac_header(skb); |
| 369 | 369 | skb->protocol = htons(ETH_P_IP); |
| 370 | − netif_rx(skb); | |
| 370 | + netif_rx_ni(skb); | |
| 371 | 371 | dev->stats.rx_packets++; |
| 372 | 372 | } |
| 373 | 373 | |
| @@ -977,7 +977,6 @@ static void rtl8150_disconnect(struct usb_interface *intf) · 976 unmodified lines | ||
| 977 | 977 | usb_set_intfdata(intf, NULL); |
| 978 | 978 | if (dev) { |
| 979 | 979 | set_bit(RTL8150_UNPLUG, &dev->flags); |
| 980 | − tasklet_disable(&dev->tl); | |
| 981 | 980 | tasklet_kill(&dev->tl); |
| 982 | 981 | unregister_netdev(dev->netdev); |
| 983 | 982 | unlink_all_urbs(dev); |
| @@ -1735,6 +1735,8 @@ ath5k_beacon_setup(struct ath5k_hw *ah, struct ath5k_buf *bf) · 1734 unmodified lines | ||
| 1735 | 1735 | |
| 1736 | 1736 | if (dma_mapping_error(ah->dev, bf->skbaddr)) { |
| 1737 | 1737 | ATH5K_ERR(ah, "beacon DMA mapping failed\n"); |
| 1738 | + dev_kfree_skb_any(skb); | |
| 1739 | + bf->skb = NULL; | |
| 1738 | 1740 | return -EIO; |
| 1739 | 1741 | } |
| 1740 | 1742 | |
| @@ -1819,8 +1821,6 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif) · 78 unmodified lines | ||
| 1819 | 1821 | ath5k_txbuf_free_skb(ah, avf->bbuf); |
| 1820 | 1822 | avf->bbuf->skb = skb; |
| 1821 | 1823 | ret = ath5k_beacon_setup(ah, avf->bbuf); |
| 1822 | − if (ret) | |
| 1823 | − avf->bbuf->skb = NULL; | |
| 1824 | 1824 | out: |
| 1825 | 1825 | return ret; |
| 1826 | 1826 | } |
| @@ -1840,6 +1840,7 @@ ath5k_beacon_send(struct ath5k_hw *ah) · 13 unmodified lines | ||
| 1840 | 1840 | struct ath5k_vif *avf; |
| 1841 | 1841 | struct ath5k_buf *bf; |
| 1842 | 1842 | struct sk_buff *skb; |
| 1843 | + int err; | |
| 1843 | 1844 | |
| 1844 | 1845 | ATH5K_DBG_UNLIMIT(ah, ATH5K_DEBUG_BEACON, "in beacon_send\n"); |
| 1845 | 1846 | |
| @@ -1888,11 +1889,6 @@ ath5k_beacon_send(struct ath5k_hw *ah) · 42 unmodified lines | ||
| 1888 | 1889 | |
| 1889 | 1890 | avf = (void *)vif->drv_priv; |
| 1890 | 1891 | bf = avf->bbuf; |
| 1891 | − if (unlikely(bf->skb == NULL || ah->opmode == NL80211_IFTYPE_STATION || | |
| 1892 | − ah->opmode == NL80211_IFTYPE_MONITOR)) { | |
| 1893 | − ATH5K_WARN(ah, "bf=%p bf_skb=%p\n", bf, bf ? bf->skb : NULL); | |
| 1894 | − return; | |
| 1895 | − } | |
| 1896 | 1892 | |
| 1897 | 1893 | /* |
| 1898 | 1894 | * Stop any current dma and put the new frame on the queue. |
| @@ -1906,8 +1902,17 @@ ath5k_beacon_send(struct ath5k_hw *ah) · 7 unmodified lines | ||
| 1906 | 1902 | |
| 1907 | 1903 | /* refresh the beacon for AP or MESH mode */ |
| 1908 | 1904 | if (ah->opmode == NL80211_IFTYPE_AP || |
| 1909 | − ah->opmode == NL80211_IFTYPE_MESH_POINT) | |
| 1910 | − ath5k_beacon_update(ah->hw, vif); | |
| 1905 | + ah->opmode == NL80211_IFTYPE_MESH_POINT) { | |
| 1906 | + err = ath5k_beacon_update(ah->hw, vif); | |
| 1907 | + if (err) | |
| 1908 | + return; | |
| 1909 | + } | |
| 1910 | + | |
| 1911 | + if (unlikely(bf->skb == NULL || ah->opmode == NL80211_IFTYPE_STATION || | |
| 1912 | + ah->opmode == NL80211_IFTYPE_MONITOR)) { | |
| 1913 | + ATH5K_WARN(ah, "bf=%p bf_skb=%p\n", bf, bf->skb); | |
| 1914 | + return; | |
| 1915 | + } | |
| 1911 | 1916 | |
| 1912 | 1917 | trace_ath5k_tx(ah, bf->skb, &ah->txqs[ah->bhalq]); |
| 1913 | 1918 | |
| @@ -307,7 +307,7 @@ static const struct ar9300_eeprom ar9300_default = { · 306 unmodified lines | ||
| 307 | 307 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 308 | 308 | { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } }, |
| 309 | 309 | |
| 310 | − { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } }, | |
| 310 | + { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0) } }, | |
| 311 | 311 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 312 | 312 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 313 | 313 | |
| @@ -884,7 +884,7 @@ static const struct ar9300_eeprom ar9300_x113 = { · 570 unmodified lines | ||
| 884 | 884 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 885 | 885 | { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } }, |
| 886 | 886 | |
| 887 | − { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } }, | |
| 887 | + { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0) } }, | |
| 888 | 888 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 889 | 889 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 890 | 890 | |
| @@ -2040,7 +2040,7 @@ static const struct ar9300_eeprom ar9300_x112 = { · 1149 unmodified lines | ||
| 2040 | 2040 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 2041 | 2041 | { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } }, |
| 2042 | 2042 | |
| 2043 | − { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } }, | |
| 2043 | + { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0) } }, | |
| 2044 | 2044 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 2045 | 2045 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
| 2046 | 2046 | |
| @@ -3734,7 +3734,7 @@ static void ar9003_hw_internal_regulator_apply(struct ath_hw *ah) · 1687 unmodified lines | ||
| 3734 | 3734 | } |
| 3735 | 3735 | } else { |
| 3736 | 3736 | reg_pmu_set = (5 << 1) | (7 << 4) | |
| 3737 | − (1 << 8) | (2 << 14) | | |
| 3737 | + (2 << 8) | (2 << 14) | | |
| 3738 | 3738 | (6 << 17) | (1 << 20) | |
| 3739 | 3739 | (3 << 24) | (1 << 28); |
| 3740 | 3740 | } |
| @@ -850,7 +850,7 @@ · 849 unmodified lines | ||
| 850 | 850 | #define AR_PHY_TPC_11_B1 (AR_SM1_BASE + 0x220) |
| 851 | 851 | #define AR_PHY_PDADC_TAB_1 (AR_SM1_BASE + 0x240) |
| 852 | 852 | #define AR_PHY_TX_IQCAL_STATUS_B1 (AR_SM1_BASE + 0x48c) |
| 853 | −#define AR_PHY_TX_IQCAL_CORR_COEFF_B1(_i) (AR_SM_BASE + 0x450 + ((_i) << 2)) | |
| 853 | +#define AR_PHY_TX_IQCAL_CORR_COEFF_B1(_i) (AR_SM1_BASE + 0x450 + ((_i) << 2)) | |
| 854 | 854 | |
| 855 | 855 | /* |
| 856 | 856 | * Channel 2 Register Map |
| @@ -795,9 +795,23 @@ static u64 supported_dma_mask(struct b43_wldev *dev) · 794 unmodified lines | ||
| 795 | 795 | u32 tmp; |
| 796 | 796 | u16 mmio_base; |
| 797 | 797 | |
| 798 | − tmp = b43_read32(dev, SSB_TMSHIGH); | |
| 799 | − if (tmp & SSB_TMSHIGH_DMA64) | |
| 800 | − return DMA_BIT_MASK(64); | |
| 798 | + switch (dev->dev->bus_type) { | |
| 799 | +#ifdef CONFIG_B43_BCMA | |
| 800 | + case B43_BUS_BCMA: | |
| 801 | + tmp = bcma_aread32(dev->dev->bdev, BCMA_IOST); | |
| 802 | + if (tmp & BCMA_IOST_DMA64) | |
| 803 | + return DMA_BIT_MASK(64); | |
| 804 | + break; | |
| 805 | +#endif | |
| 806 | +#ifdef CONFIG_B43_SSB | |
| 807 | + case B43_BUS_SSB: | |
| 808 | + tmp = ssb_read32(dev->dev->sdev, SSB_TMSHIGH); | |
| 809 | + if (tmp & SSB_TMSHIGH_DMA64) | |
| 810 | + return DMA_BIT_MASK(64); | |
| 811 | + break; | |
| 812 | +#endif | |
| 813 | + } | |
| 814 | + | |
| 801 | 815 | mmio_base = b43_dmacontroller_base(0, 0); |
| 802 | 816 | b43_write32(dev, mmio_base + B43_DMA32_TXCTL, B43_DMA32_TXADDREXT_MASK); |
| 803 | 817 | tmp = b43_read32(dev, mmio_base + B43_DMA32_TXCTL); |
| @@ -921,6 +921,8 @@ static struct usb_device_id rt2800usb_device_table[] = { · 920 unmodified lines | ||
| 921 | 921 | { USB_DEVICE(0x07d1, 0x3c16) }, |
| 922 | 922 | /* Draytek */ |
| 923 | 923 | { USB_DEVICE(0x07fa, 0x7712) }, |
| 924 | + /* DVICO */ | |
| 925 | + { USB_DEVICE(0x0fe9, 0xb307) }, | |
| 924 | 926 | /* Edimax */ |
| 925 | 927 | { USB_DEVICE(0x7392, 0x7711) }, |
| 926 | 928 | { USB_DEVICE(0x7392, 0x7717) }, |
| @@ -2420,6 +2420,7 @@ static struct usb_device_id rt73usb_device_table[] = { · 2419 unmodified lines | ||
| 2420 | 2420 | /* Buffalo */ |
| 2421 | 2421 | { USB_DEVICE(0x0411, 0x00d8) }, |
| 2422 | 2422 | { USB_DEVICE(0x0411, 0x00d9) }, |
| 2423 | + { USB_DEVICE(0x0411, 0x00e6) }, | |
| 2423 | 2424 | { USB_DEVICE(0x0411, 0x00f4) }, |
| 2424 | 2425 | { USB_DEVICE(0x0411, 0x0116) }, |
| 2425 | 2426 | { USB_DEVICE(0x0411, 0x0119) }, |
| @@ -281,6 +281,8 @@ static struct usb_device_id rtl8192c_usb_ids[] = { · 280 unmodified lines | ||
| 281 | 281 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817d, rtl92cu_hal_cfg)}, |
| 282 | 282 | /* 8188CE-VAU USB minCard (b/g mode only) */ |
| 283 | 283 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817e, rtl92cu_hal_cfg)}, |
| 284 | + /* 8188RU in Alfa AWUS036NHR */ | |
| 285 | + {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817f, rtl92cu_hal_cfg)}, | |
| 284 | 286 | /* 8188 Combo for BC4 */ |
| 285 | 287 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8754, rtl92cu_hal_cfg)}, |
| 286 | 288 | |
| @@ -303,20 +305,23 @@ static struct usb_device_id rtl8192c_usb_ids[] = { · 16 unmodified lines | ||
| 303 | 305 | {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ |
| 304 | 306 | /* HP - Lite-On ,8188CUS Slim Combo */ |
| 305 | 307 | {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)}, |
| 308 | + {RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */ | |
| 306 | 309 | {RTL_USB_DEVICE(0x2001, 0x3308, rtl92cu_hal_cfg)}, /*D-Link - Alpha*/ |
| 307 | 310 | {RTL_USB_DEVICE(0x2019, 0xab2a, rtl92cu_hal_cfg)}, /*Planex - Abocom*/ |
| 308 | 311 | {RTL_USB_DEVICE(0x2019, 0xed17, rtl92cu_hal_cfg)}, /*PCI - Edimax*/ |
| 309 | 312 | {RTL_USB_DEVICE(0x20f4, 0x648b, rtl92cu_hal_cfg)}, /*TRENDnet - Cameo*/ |
| 310 | 313 | {RTL_USB_DEVICE(0x7392, 0x7811, rtl92cu_hal_cfg)}, /*Edimax - Edimax*/ |
| 311 | − {RTL_USB_DEVICE(0x3358, 0x13d3, rtl92cu_hal_cfg)}, /*Azwave 8188CE-VAU*/ | |
| 314 | + {RTL_USB_DEVICE(0x13d3, 0x3358, rtl92cu_hal_cfg)}, /*Azwave 8188CE-VAU*/ | |
| 312 | 315 | /* Russian customer -Azwave (8188CE-VAU b/g mode only) */ |
| 313 | − {RTL_USB_DEVICE(0x3359, 0x13d3, rtl92cu_hal_cfg)}, | |
| 316 | + {RTL_USB_DEVICE(0x13d3, 0x3359, rtl92cu_hal_cfg)}, | |
| 317 | + {RTL_USB_DEVICE(0x4855, 0x0090, rtl92cu_hal_cfg)}, /* Feixun */ | |
| 318 | + {RTL_USB_DEVICE(0x4855, 0x0091, rtl92cu_hal_cfg)}, /* NetweeN-Feixun */ | |
| 319 | + {RTL_USB_DEVICE(0x9846, 0x9041, rtl92cu_hal_cfg)}, /* Netgear Cameo */ | |
| 314 | 320 | |
| 315 | 321 | /****** 8192CU ********/ |
| 316 | 322 | {RTL_USB_DEVICE(0x0586, 0x341f, rtl92cu_hal_cfg)}, /*Zyxel -Abocom*/ |
| 317 | 323 | {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/ |
| 318 | 324 | {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ |
| 319 | − {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Abocom -Abocom*/ | |
| 320 | 325 | {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/ |
| 321 | 326 | {RTL_USB_DEVICE(0x2001, 0x3309, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/ |
| 322 | 327 | {RTL_USB_DEVICE(0x2001, 0x330a, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/ |
| @@ -140,8 +140,6 @@ int wl1251_acx_sleep_auth(struct wl1251 *wl, u8 sleep_auth) · 139 unmodified lines | ||
| 140 | 140 | auth->sleep_auth = sleep_auth; |
| 141 | 141 | |
| 142 | 142 | ret = wl1251_cmd_configure(wl, ACX_SLEEP_AUTH, auth, sizeof(*auth)); |
| 143 | − if (ret < 0) | |
| 144 | − return ret; | |
| 145 | 143 | |
| 146 | 144 | out: |
| 147 | 145 | kfree(auth); |
| @@ -681,10 +679,8 @@ int wl1251_acx_cca_threshold(struct wl1251 *wl) · 533 unmodified lines | ||
| 681 | 679 | |
| 682 | 680 | ret = wl1251_cmd_configure(wl, ACX_CCA_THRESHOLD, |
| 683 | 681 | detection, sizeof(*detection)); |
| 684 | − if (ret < 0) { | |
| 682 | + if (ret < 0) | |
| 685 | 683 | wl1251_warning("failed to set cca threshold: %d", ret); |
| 686 | − return ret; | |
| 687 | − } | |
| 688 | 684 | |
| 689 | 685 | out: |
| 690 | 686 | kfree(detection); |
| @@ -241,7 +241,7 @@ int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable) · 240 unmodified lines | ||
| 241 | 241 | if (ret < 0) { |
| 242 | 242 | wl1251_error("tx %s cmd for channel %d failed", |
| 243 | 243 | enable ? "start" : "stop", channel); |
| 244 | − return ret; | |
| 244 | + goto out; | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | wl1251_debug(DEBUG_BOOT, "tx %s cmd channel %d", |
| @@ -1003,6 +1003,7 @@ COMPATIBLE_IOCTL(PPPIOCCONNECT) · 1002 unmodified lines | ||
| 1003 | 1003 | COMPATIBLE_IOCTL(PPPIOCDISCONN) |
| 1004 | 1004 | COMPATIBLE_IOCTL(PPPIOCATTCHAN) |
| 1005 | 1005 | COMPATIBLE_IOCTL(PPPIOCGCHAN) |
| 1006 | +COMPATIBLE_IOCTL(PPPIOCGL2TPSTATS) | |
| 1006 | 1007 | /* PPPOX */ |
| 1007 | 1008 | COMPATIBLE_IOCTL(PPPOEIOCSFWD) |
| 1008 | 1009 | COMPATIBLE_IOCTL(PPPOEIOCDFWD) |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #define MAX_LINKS 32 |
| 30 | 30 | |
| 31 | 31 | struct sockaddr_nl { |
| 32 | − sa_family_t nl_family; /* AF_NETLINK */ | |
| 32 | + __kernel_sa_family_t nl_family; /* AF_NETLINK */ | |
| 33 | 33 | unsigned short nl_pad; /* zero */ |
| 34 | 34 | __u32 nl_pid; /* port ID */ |
| 35 | 35 | __u32 nl_groups; /* multicast groups mask */ |
| @@ -8,8 +8,10 @@ · 7 unmodified lines | ||
| 8 | 8 | #define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) |
| 9 | 9 | /* Implementation specific desired alignment */ |
| 10 | 10 | |
| 11 | +typedef unsigned short __kernel_sa_family_t; | |
| 12 | + | |
| 11 | 13 | struct __kernel_sockaddr_storage { |
| 12 | − unsigned short ss_family; /* address family */ | |
| 14 | + __kernel_sa_family_t ss_family; /* address family */ | |
| 13 | 15 | /* Following field(s) are implementation specific */ |
| 14 | 16 | char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; |
| 15 | 17 | /* space to achieve desired size, */ |
| @@ -35,7 +37,7 @@ struct seq_file; · 19 unmodified lines | ||
| 35 | 37 | extern void socket_seq_show(struct seq_file *seq); |
| 36 | 38 | #endif |
| 37 | 39 | |
| 38 | −typedef unsigned short sa_family_t; | |
| 40 | +typedef __kernel_sa_family_t sa_family_t; | |
| 39 | 41 | |
| 40 | 42 | /* |
| 41 | 43 | * 1003.1g requires sa_family_t and that sa_data is char. |
| @@ -238,7 +238,7 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk) · 237 unmodified lines | ||
| 238 | 238 | { |
| 239 | 239 | __u8 flags = 0; |
| 240 | 240 | |
| 241 | − if (inet_sk(sk)->transparent) | |
| 241 | + if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl) | |
| 242 | 242 | flags |= FLOWI_FLAG_ANYSRC; |
| 243 | 243 | if (sk->sk_protocol == IPPROTO_TCP) |
| 244 | 244 | flags |= FLOWI_FLAG_PRECOW_METRICS; |
| @@ -417,6 +417,7 @@ put_back: · 416 unmodified lines | ||
| 417 | 417 | int br_del_if(struct net_bridge *br, struct net_device *dev) |
| 418 | 418 | { |
| 419 | 419 | struct net_bridge_port *p; |
| 420 | + bool changed_addr; | |
| 420 | 421 | |
| 421 | 422 | p = br_port_get_rtnl(dev); |
| 422 | 423 | if (!p || p->br != br) |
| @@ -425,9 +426,12 @@ int br_del_if(struct net_bridge *br, struct net_device *dev) · 2 unmodified lines | ||
| 425 | 426 | del_nbp(p); |
| 426 | 427 | |
| 427 | 428 | spin_lock_bh(&br->lock); |
| 428 | − br_stp_recalculate_bridge_id(br); | |
| 429 | + changed_addr = br_stp_recalculate_bridge_id(br); | |
| 429 | 430 | spin_unlock_bh(&br->lock); |
| 430 | 431 | |
| 432 | + if (changed_addr) | |
| 433 | + call_netdevice_notifiers(NETDEV_CHANGEADDR, br->dev); | |
| 434 | + | |
| 431 | 435 | netdev_update_features(br->dev); |
| 432 | 436 | |
| 433 | 437 | return 0; |
| @@ -34,6 +34,7 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v · 33 unmodified lines | ||
| 34 | 34 | struct net_device *dev = ptr; |
| 35 | 35 | struct net_bridge_port *p; |
| 36 | 36 | struct net_bridge *br; |
| 37 | + bool changed_addr; | |
| 37 | 38 | int err; |
| 38 | 39 | |
| 39 | 40 | /* register of bridge completed, add sysfs entries */ |
| @@ -57,8 +58,12 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v · 17 unmodified lines | ||
| 57 | 58 | case NETDEV_CHANGEADDR: |
| 58 | 59 | spin_lock_bh(&br->lock); |
| 59 | 60 | br_fdb_changeaddr(p, dev->dev_addr); |
| 60 | − br_stp_recalculate_bridge_id(br); | |
| 61 | + changed_addr = br_stp_recalculate_bridge_id(br); | |
| 61 | 62 | spin_unlock_bh(&br->lock); |
| 63 | + | |
| 64 | + if (changed_addr) | |
| 65 | + call_netdevice_notifiers(NETDEV_CHANGEADDR, br->dev); | |
| 66 | + | |
| 62 | 67 | break; |
| 63 | 68 | |
| 64 | 69 | case NETDEV_CHANGE: |
| @@ -1198,7 +1198,8 @@ ebt_register_table(struct net *net, const struct ebt_table *input_table) · 1197 unmodified lines | ||
| 1198 | 1198 | |
| 1199 | 1199 | if (table->check && table->check(newinfo, table->valid_hooks)) { |
| 1200 | 1200 | BUGPRINT("The table doesn't like its own initial data, lol\n"); |
| 1201 | − return ERR_PTR(-EINVAL); | |
| 1201 | + ret = -EINVAL; | |
| 1202 | + goto free_chainstack; | |
| 1202 | 1203 | } |
| 1203 | 1204 | |
| 1204 | 1205 | table->private = newinfo; |
| @@ -192,7 +192,7 @@ int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p) · 191 unmodified lines | ||
| 192 | 192 | goto error; |
| 193 | 193 | |
| 194 | 194 | cred->uid = cred->euid = p->creds.uid; |
| 195 | − cred->gid = cred->egid = p->creds.uid; | |
| 195 | + cred->gid = cred->egid = p->creds.gid; | |
| 196 | 196 | put_cred(p->cred); |
| 197 | 197 | p->cred = cred; |
| 198 | 198 | } |
| @@ -122,6 +122,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb) · 121 unmodified lines | ||
| 122 | 122 | newskb->pkt_type = PACKET_LOOPBACK; |
| 123 | 123 | newskb->ip_summed = CHECKSUM_UNNECESSARY; |
| 124 | 124 | WARN_ON(!skb_dst(newskb)); |
| 125 | + skb_dst_force(newskb); | |
| 125 | 126 | netif_rx_ni(newskb); |
| 126 | 127 | return 0; |
| 127 | 128 | } |
| @@ -1067,7 +1067,7 @@ EXPORT_SYMBOL(compat_ip_setsockopt); · 1066 unmodified lines | ||
| 1067 | 1067 | */ |
| 1068 | 1068 | |
| 1069 | 1069 | static int do_ip_getsockopt(struct sock *sk, int level, int optname, |
| 1070 | − char __user *optval, int __user *optlen) | |
| 1070 | + char __user *optval, int __user *optlen, unsigned flags) | |
| 1071 | 1071 | { |
| 1072 | 1072 | struct inet_sock *inet = inet_sk(sk); |
| 1073 | 1073 | int val; |
| @@ -1240,7 +1240,7 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, · 166 unmodified lines | ||
| 1240 | 1240 | |
| 1241 | 1241 | msg.msg_control = optval; |
| 1242 | 1242 | msg.msg_controllen = len; |
| 1243 | − msg.msg_flags = 0; | |
| 1243 | + msg.msg_flags = flags; | |
| 1244 | 1244 | |
| 1245 | 1245 | if (inet->cmsg_flags & IP_CMSG_PKTINFO) { |
| 1246 | 1246 | struct in_pktinfo info; |
| @@ -1294,7 +1294,7 @@ int ip_getsockopt(struct sock *sk, int level, · 47 unmodified lines | ||
| 1294 | 1294 | { |
| 1295 | 1295 | int err; |
| 1296 | 1296 | |
| 1297 | − err = do_ip_getsockopt(sk, level, optname, optval, optlen); | |
| 1297 | + err = do_ip_getsockopt(sk, level, optname, optval, optlen, 0); | |
| 1298 | 1298 | #ifdef CONFIG_NETFILTER |
| 1299 | 1299 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
| 1300 | 1300 | if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS && |
| @@ -1327,7 +1327,8 @@ int compat_ip_getsockopt(struct sock *sk, int level, int optname, · 26 unmodified lines | ||
| 1327 | 1327 | return compat_mc_getsockopt(sk, level, optname, optval, optlen, |
| 1328 | 1328 | ip_getsockopt); |
| 1329 | 1329 | |
| 1330 | − err = do_ip_getsockopt(sk, level, optname, optval, optlen); | |
| 1330 | + err = do_ip_getsockopt(sk, level, optname, optval, optlen, | |
| 1331 | + MSG_CMSG_COMPAT); | |
| 1331 | 1332 | |
| 1332 | 1333 | #ifdef CONFIG_NETFILTER |
| 1333 | 1334 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
| @@ -18,17 +18,15 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) · 17 unmodified lines | ||
| 18 | 18 | struct rtable *rt; |
| 19 | 19 | struct flowi4 fl4 = {}; |
| 20 | 20 | __be32 saddr = iph->saddr; |
| 21 | − __u8 flags = 0; | |
| 21 | + __u8 flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0; | |
| 22 | 22 | unsigned int hh_len; |
| 23 | 23 | |
| 24 | − if (!skb->sk && addr_type != RTN_LOCAL) { | |
| 25 | − if (addr_type == RTN_UNSPEC) | |
| 26 | − addr_type = inet_addr_type(net, saddr); | |
| 27 | − if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST) | |
| 28 | − flags |= FLOWI_FLAG_ANYSRC; | |
| 29 | − else | |
| 30 | − saddr = 0; | |
| 31 | − } | |
| 24 | + if (addr_type == RTN_UNSPEC) | |
| 25 | + addr_type = inet_addr_type(net, saddr); | |
| 26 | + if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST) | |
| 27 | + flags |= FLOWI_FLAG_ANYSRC; | |
| 28 | + else | |
| 29 | + saddr = 0; | |
| 32 | 30 | |
| 33 | 31 | /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause |
| 34 | 32 | * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook. |
| @@ -38,7 +36,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) · 3 unmodified lines | ||
| 38 | 36 | fl4.flowi4_tos = RT_TOS(iph->tos); |
| 39 | 37 | fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; |
| 40 | 38 | fl4.flowi4_mark = skb->mark; |
| 41 | − fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : flags; | |
| 39 | + fl4.flowi4_flags = flags; | |
| 42 | 40 | rt = ip_route_output_key(net, &fl4); |
| 43 | 41 | if (IS_ERR(rt)) |
| 44 | 42 | return -1; |
| @@ -563,7 +563,8 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, · 562 unmodified lines | ||
| 563 | 563 | flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos, |
| 564 | 564 | RT_SCOPE_UNIVERSE, |
| 565 | 565 | inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol, |
| 566 | − FLOWI_FLAG_CAN_SLEEP, daddr, saddr, 0, 0); | |
| 566 | + inet_sk_flowi_flags(sk) | FLOWI_FLAG_CAN_SLEEP, | |
| 567 | + daddr, saddr, 0, 0); | |
| 567 | 568 | |
| 568 | 569 | if (!inet->hdrincl) { |
| 569 | 570 | err = raw_probe_proto_opt(&fl4, msg); |
| @@ -722,7 +722,7 @@ static inline bool compare_hash_inputs(const struct rtable *rt1, · 721 unmodified lines | ||
| 722 | 722 | { |
| 723 | 723 | return ((((__force u32)rt1->rt_key_dst ^ (__force u32)rt2->rt_key_dst) | |
| 724 | 724 | ((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) | |
| 725 | − (rt1->rt_iif ^ rt2->rt_iif)) == 0); | |
| 725 | + (rt1->rt_route_iif ^ rt2->rt_route_iif)) == 0); | |
| 726 | 726 | } |
| 727 | 727 | |
| 728 | 728 | static inline int compare_keys(struct rtable *rt1, struct rtable *rt2) |
| @@ -731,8 +731,8 @@ static inline int compare_keys(struct rtable *rt1, struct rtable *rt2) · 2 unmodified lines | ||
| 731 | 731 | ((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) | |
| 732 | 732 | (rt1->rt_mark ^ rt2->rt_mark) | |
| 733 | 733 | (rt1->rt_key_tos ^ rt2->rt_key_tos) | |
| 734 | − (rt1->rt_oif ^ rt2->rt_oif) | | |
| 735 | − (rt1->rt_iif ^ rt2->rt_iif)) == 0; | |
| 734 | + (rt1->rt_route_iif ^ rt2->rt_route_iif) | | |
| 735 | + (rt1->rt_oif ^ rt2->rt_oif)) == 0; | |
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | static inline int compare_netns(struct rtable *rt1, struct rtable *rt2) |
| @@ -2320,8 +2320,7 @@ int ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr, · 1581 unmodified lines | ||
| 2320 | 2320 | rth = rcu_dereference(rth->dst.rt_next)) { |
| 2321 | 2321 | if ((((__force u32)rth->rt_key_dst ^ (__force u32)daddr) | |
| 2322 | 2322 | ((__force u32)rth->rt_key_src ^ (__force u32)saddr) | |
| 2323 | − (rth->rt_iif ^ iif) | | |
| 2324 | − rth->rt_oif | | |
| 2323 | + (rth->rt_route_iif ^ iif) | | |
| 2325 | 2324 | (rth->rt_key_tos ^ tos)) == 0 && |
| 2326 | 2325 | rth->rt_mark == skb->mark && |
| 2327 | 2326 | net_eq(dev_net(rth->dst.dev), net) && |
| @@ -276,7 +276,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, · 275 unmodified lines | ||
| 276 | 276 | int mss; |
| 277 | 277 | struct rtable *rt; |
| 278 | 278 | __u8 rcv_wscale; |
| 279 | − bool ecn_ok; | |
| 279 | + bool ecn_ok = false; | |
| 280 | 280 | |
| 281 | 281 | if (!sysctl_tcp_syncookies || !th->ack || th->rst) |
| 282 | 282 | goto out; |
| @@ -165,7 +165,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) · 164 unmodified lines | ||
| 165 | 165 | int mss; |
| 166 | 166 | struct dst_entry *dst; |
| 167 | 167 | __u8 rcv_wscale; |
| 168 | − bool ecn_ok; | |
| 168 | + bool ecn_ok = false; | |
| 169 | 169 | |
| 170 | 170 | if (!sysctl_tcp_syncookies || !th->ack || th->rst) |
| 171 | 171 | goto out; |
| @@ -312,6 +312,7 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict) · 311 unmodified lines | ||
| 312 | 312 | } |
| 313 | 313 | break; |
| 314 | 314 | case NF_STOLEN: |
| 315 | + break; | |
| 315 | 316 | default: |
| 316 | 317 | kfree_skb(skb); |
| 317 | 318 | } |
| @@ -341,11 +341,11 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, · 340 unmodified lines | ||
| 341 | 341 | |
| 342 | 342 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); |
| 343 | 343 | if (entry == NULL) |
| 344 | − return -ENOMEM; | |
| 344 | + goto out_entry; | |
| 345 | 345 | if (domain != NULL) { |
| 346 | 346 | entry->domain = kstrdup(domain, GFP_ATOMIC); |
| 347 | 347 | if (entry->domain == NULL) |
| 348 | − goto cfg_cipsov4_map_add_failure; | |
| 348 | + goto out_domain; | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | if (addr == NULL && mask == NULL) { |
| @@ -354,13 +354,13 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, · 2 unmodified lines | ||
| 354 | 354 | } else if (addr != NULL && mask != NULL) { |
| 355 | 355 | addrmap = kzalloc(sizeof(*addrmap), GFP_ATOMIC); |
| 356 | 356 | if (addrmap == NULL) |
| 357 | − goto cfg_cipsov4_map_add_failure; | |
| 357 | + goto out_addrmap; | |
| 358 | 358 | INIT_LIST_HEAD(&addrmap->list4); |
| 359 | 359 | INIT_LIST_HEAD(&addrmap->list6); |
| 360 | 360 | |
| 361 | 361 | addrinfo = kzalloc(sizeof(*addrinfo), GFP_ATOMIC); |
| 362 | 362 | if (addrinfo == NULL) |
| 363 | − goto cfg_cipsov4_map_add_failure; | |
| 363 | + goto out_addrinfo; | |
| 364 | 364 | addrinfo->type_def.cipsov4 = doi_def; |
| 365 | 365 | addrinfo->type = NETLBL_NLTYPE_CIPSOV4; |
| 366 | 366 | addrinfo->list.addr = addr->s_addr & mask->s_addr; |
| @@ -374,7 +374,7 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, · 7 unmodified lines | ||
| 374 | 374 | entry->type = NETLBL_NLTYPE_ADDRSELECT; |
| 375 | 375 | } else { |
| 376 | 376 | ret_val = -EINVAL; |
| 377 | − goto cfg_cipsov4_map_add_failure; | |
| 377 | + goto out_addrmap; | |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | ret_val = netlbl_domhsh_add(entry, audit_info); |
| @@ -384,11 +384,15 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, · 3 unmodified lines | ||
| 384 | 384 | return 0; |
| 385 | 385 | |
| 386 | 386 | cfg_cipsov4_map_add_failure: |
| 387 | − cipso_v4_doi_putdef(doi_def); | |
| 387 | + kfree(addrinfo); | |
| 388 | +out_addrinfo: | |
| 389 | + kfree(addrmap); | |
| 390 | +out_addrmap: | |
| 388 | 391 | kfree(entry->domain); |
| 392 | +out_domain: | |
| 389 | 393 | kfree(entry); |
| 390 | − kfree(addrmap); | |
| 391 | − kfree(addrinfo); | |
| 394 | +out_entry: | |
| 395 | + cipso_v4_doi_putdef(doi_def); | |
| 392 | 396 | return ret_val; |
| 393 | 397 | } |
| 394 | 398 | |
| @@ -112,7 +112,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch) · 111 unmodified lines | ||
| 112 | 112 | |
| 113 | 113 | for (prio = 0; prio < q->bands; prio++) { |
| 114 | 114 | struct Qdisc *qdisc = q->queues[prio]; |
| 115 | − struct sk_buff *skb = qdisc->dequeue(qdisc); | |
| 115 | + struct sk_buff *skb = qdisc_dequeue_peeked(qdisc); | |
| 116 | 116 | if (skb) { |
| 117 | 117 | qdisc_bstats_update(sch, skb); |
| 118 | 118 | sch->q.qlen--; |