aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_fragment.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2011-12-06inet_diag: Move byte-code finding up the call-stackPavel Emelyanov1-19/+17
Current code calculates it at fixed offset. This offset will change, so move the BC calculation upper to make the further patching simpler. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06sock_diag: Introduce new message typePavel Emelyanov2-2/+16
This type will run the family+protocol based socket dumping. Also prepare the stub function for it. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06inet_diag: Partly rename inet_ to sock_Pavel Emelyanov5-18/+25
The ultimate goal is to get the sock_diag module, that works in family+protocol terms. Currently this is suitable to do on the inet_diag basis, so rename parts of the code. It will be moved to sock_diag.c later. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06caif-spi: Bugfix for dump upon device removalErwan Bracq2-88/+92
Fix dump upon device removal, by moving deinitialization from platform-device-remove to network-interface-uninit. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06bnx2x: fix crash while ethtool -tDmitry Kravkov1-0/+3
commit 2df1a70aaf70e8dff11b89b938a5f317556ee640 "bnx2x: Support for byte queue limits" has introduced an asymmetry in usage of netdev_tx_completed_queue and netdev_tx_sent_queue. Missing call to netdev_tx_sent_queue causes the crash during ethtool -t. The patch adds the missing call. Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06netback: fix typo in commentWei Liu1-1/+1
"variables a used" should be "variables are used". Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06netback: remove redundant assignmentWei Liu1-4/+0
New value for netbk->mmap_pages[pending_idx] is assigned in xen_netbk_alloc_page(), no need for a second assignment which exposes internal to the outside world. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06bnx2x, cnic: support DRV_INFO upon FW requestBarak Witkowski6-8/+459
Add support to send driver capabilities, settings and statistics to management firmware. [ Redone using many local variables, removed many unnecessary inlines, and put #defines at the left margin suggested by Joe Perches ] Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06bnx2x: support classification config queryAriel Elior2-0/+46
To support copying MAC addresses to firmware query structure. [ Fixed up style and formatting errors noted by DaveM and Joe Perches ] Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06bnx2x: add fcoe statisticsBarak Witkowski4-23/+120
Add FCoE statistics support for FCoE capable devices. Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06bnx2x: add PFC statisticsBarak Witkowski6-3/+63
Add Priority flow control counters for ethtool -S. Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06openvswitch: small potential memory leak in ovs_vport_alloc()Dan Carpenter1-1/+3
We're unlikely to hit this leak, but the static checkers complain if we don't take care of it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-06ipv4: arp: Cleanup in arp.cIgor Maravic1-10/+10
Use "IS_ENABLED(CONFIG_FOO)" macro instead of "defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)" Signed-off-by: Igor Maravic <igorm@etf.rs> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05tcp: remove TCP_OFF and TCP_PAGE macrosEric Dumazet1-13/+10
As mentioned by Joe Perches, TCP_OFF() and TCP_PAGE() macros are useless. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05bql: fix CONFIG_XPS=n buildEric Dumazet1-2/+0
netdev_queue_release() should be called even if CONFIG_XPS=n to properly release device reference. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05tcp: fix tcp_trim_head()Eric Dumazet1-5/+8
commit f07d960df3 (tcp: avoid frag allocation for small frames) breaked assumption in tcp stack that skb is either linear (skb->data_len == 0), or fully fragged (skb->data_len == skb->len) tcp_trim_head() made this assumption, we must fix it. Thanks to Vijay for providing a very detailed explanation. Reported-by: Vijay Subramanian <subramanian.vijay@gmail.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05caif: Stash away hijacked skb destructor and call it latersjur.brandeland@stericsson.com1-1/+33
This patch adds functionality for avoiding orphaning SKB too early. The original skb is stashed away and the original destructor is called from the hi-jacked flow-on callback. If CAIF interface goes down and a hi-jacked SKB exists, the original skb->destructor is restored. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05caif: Add support for flow-control on device's tx-queuesjur.brandeland@stericsson.com1-1/+84
Flow control is implemented by inspecting the qdisc queue length in order to detect potential overflow on the TX queue. When a threshold is reached flow-off is sent upwards in the CAIF stack. At the same time the skb->destructor is hi-jacked by orphaning the SKB and the original destructor is replaced with a "flow-on" callback. When the "hi-jacked" SKB is consumed the queue should be empty, and the "flow-on" callback is called and xon is sent upwards in the CAIF stack. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05caif: Add support for CAIF over CDC NCM USB interfacesjur.brandeland@stericsson.com5-9/+224
NCM 1.0 does not support anything but Ethernet framing, hence CAIF payload will be put into Ethernet frames. Discovery is based on fixed USB vendor 0x04cc (ST-Ericsson), product-id 0x230f (NCM). In this variant only CAIF payload is sent over the NCM interface. The CAIF stack (cfusbl.c) will when USB interface register first check if we got a CDC NCM USB interface with the right VID, PID. It will then read the device's Ethernet address and create a 'template' Ethernet TX header, using a broadcast address as the destination address, and EthType 0x88b5 (802.1 Local Experimental - vendor specific). A protocol handler for 0x88b5 is setup for reception of CAIF frames from the CDC NCM USB interface. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05if_ether.h: Add IEEE 802.1 Local Experimental Ethertype 1.sjur.brandeland@stericsson.com1-0/+1
Add EthType 0x88b5. This Ethertype value is available for public use for prototype and vendor-specific protocol development,as defined in Amendment 802a to IEEE Std 802. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05infiniband: ipoib: Sanitize neighbour handling in ipoib_main.cDavid Miller1-12/+12
Reduce the number of dst_get_neighbour_noref() calls within a single call chain. Primarily by passing the neighbour pointer down to the helper functions. Handle dst_get_neighbour_noref() returning NULL in ipoib_start_xmit() by incrementing the dropped counter and freeing the packet. We don't want it to fall through into the ARP/RARP/multicast handling, since that should only happen when skb_dst() is NULL. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Roland Dreier <roland@purestorage.com>
2011-12-05cxgb4i: Handle dst_get_neighbour_noref() returning NULL.David Miller1-1/+7
Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Roland Dreier <roland@purestorage.com>
2011-12-05libcxgbi: Handle dst_get_neighbour_noref() returning NULL.David Miller1-2/+8
Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Roland Dreier <roland@purestorage.com>
2011-12-05infiniband: cxgb4: Consolidate 3 copies of the same operation into 1 helper function.David Miller1-140/+80
Three pieces of code do the same thing, create a l2t entry and then import this information into the c4iw_ep object. Create a helper function and call it from these 3 locations instead. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Roland Dreier <roland@purestorage.com>
2011-12-05infiniband: nes: Use dst's neighbour entry.David Miller1-9/+5
Do this instead of performing a by-hand lookup. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Roland Dreier <roland@purestorage.com>
2011-12-05cxgb3: Handle NULL dst neighbour in cxgb3_offload.cDavid Miller1-3/+15
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05cxgb3: Rework t3_l2t_get to take a dst_entry instead of a neighbour.David Miller5-23/+25
This way we consolidate the RCU locking down into the place where it actually matters, and also we can make the code handle dst_get_neighbour_noref() returning NULL properly. Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-05infiniband: addr: Consolidate code to fetch neighbour hardware address from dst.David Miller1-26/+21
IPV4 should do exactly what the IPV6 code does here, which is use the neighbour obtained via the dst entry. And now that the two code paths do the same thing, use a common helper function to perform the operation. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Roland Dreier <roland@purestorage.com>
2011-12-05net: Rename dst_get_neighbour{, _raw} to dst_get_neighbour_noref{, _raw}.David Miller29-58/+58
To reflect the fact that a refrence is not obtained to the resulting neighbour entry. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Roland Dreier <roland@purestorage.com>
2011-12-05ixgbe: Remove function prototype for non-existent functionGreg Rose1-1/+0
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-12-05ixgbe: DCB: IEEE transitions may fail to reprogram hardware.John Fastabend1-11/+10
Transitioning through an IEEE DCBX version from a CEE DCBX and back (CEE->IEEE->CEE) may leave IEEE attributes programmed in the hardware. DCB uses a bit field in the set routines to determine which attributes PG, PFC, APP need to be reprogrammed. This is needed because user flow allows queueing a series of changes and then reprogramming the hardware with the entire set in one operation. When transitioning from IEEE DCBX mode back into CEE DCBX mode the PG and PFC bits need to be set so the possibly different CEE attributes get programmed into the device. This patch fixes broken logic that was evaluating to 0 and never setting any bits. Further this removes some checks for num_tc in set routines. This logic only worked when the number of traffic classes and user priorities were equal. This is no longer the case for X540 devices. Besides we can trust user input in this case if the device is incorrectly configured the DCB bandwidths will be incorrectly mapped but no OOPs, BUG, or hardware failure will occur. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-12-05ixgbe: DCBnl set_all, order of operations fixJohn Fastabend1-48/+29
The order of operations is important in DCBnl set_all(). When FCoE is configured it uses the up2tc map to learn which queues to configure the hardware offloads on. Therefore we need to setup the map before configuring FCoE. This is only seen when the both up2tc mappings and APP info are configured simultaneously. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-12-05igb: Update DMA Coalescing threshold calculation.Matthew Vick1-7/+19
This patch updates the DMA Coalescing feature parameters to account for larger MTUs. Previously, sufficient space may not have been allocated in the receive buffer, causing packet drop. Signed-off-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-12-05e1000e: hitting BUG_ON() from napi_enableBruce Allan1-2/+2
Based on a patch from Mike McElroy created against the out-of-tree e1000e driver: Hitting the BUG_ON in napi_enable(). Code inspection shows that this can only be triggered by calling napi_enable() twice without an intervening napi_disable(). I saw the following sequence of events in the stack trace: 1) We simulated a cable pull using an Extreme switch. 2) e1000_tx_timeout() was entered. 3) e1000_reset_task() was called. Saw the message from e_err() in the console log. 4) e1000_reinit_locked was called. This function calls e1000_down() and e1000_up(). These functions call napi_disable() and napi_enable() respectively. 5) Then on another thread, a monitor task saw carrier was down and executed 'ip set link down' and 'ip set link up' commands. 6) Saw the '_E1000_RESETTING'warning fron the e1000_close function. 7) Either the e1000_open() executed between the e1000_down() and e1000_up() calls in step 4 or the e1000_open() call executed after the e1000_up() call. In either case, napi_enable() is called twice which triggers the BUG_ON. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Cc: Mike McElroy <mike.mcelroy@stratus.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-12-05e1000e: Avoid wrong check on TX hangJeff Kirsher2-3/+21
Based on the original patch submitted my Michael Wang <wangyun@linux.vnet.ibm.com>. Descriptors may not be write-back while checking TX hang with flag FLAG2_DMA_BURST on. So when we detect hang, we just flush the descriptor and detect again for once. -v2 change 1 to true and 0 to false and remove extra () CC: Michael Wang <wangyun@linux.vnet.ibm.com> CC: Flavio Leitner <fbl@redhat.com> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-12-04tcp: tcp_sendmsg() page recyclingEric Dumazet1-1/+6
If our TCP_PAGE(sk) is not shared (page_count() == 1), we can set page offset to 0. This permits better filling of the pages on small to medium tcp writes. "tbench 16" results on my dev server (2x4x2 machine) : Before : 3072 MB/s After : 3146 MB/s (2.4 % gain) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-04tcp: take care of misalignmentsEric Dumazet3-8/+24
We discovered that TCP stack could retransmit misaligned skbs if a malicious peer acknowledged sub MSS frame. This currently can happen only if output interface is non SG enabled : If SG is enabled, tcp builds headless skbs (all payload is included in fragments), so the tcp trimming process only removes parts of skb fragments, header stay aligned. Some arches cant handle misalignments, so force a head reallocation and shrink headroom to MAX_TCP_HEADER. Dont care about misaligments on x86 and PPC (or other arches setting NET_IP_ALIGN to 0) This patch introduces __pskb_copy() which can specify the headroom of new head, and pskb_copy() becomes a wrapper on top of __pskb_copy() Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-04sfc: Use kcalloc instead of kzalloc to allocate arrayThomas Meyer3-4/+4
The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-04ll_temac: Use kcalloc instead of kzalloc to allocate arrayThomas Meyer1-1/+1
The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-04enic: Use kcalloc instead of kzalloc to allocate arrayThomas Meyer1-1/+1
The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-04bnx2x: Use kcalloc instead of kzalloc to allocate arrayThomas Meyer2-3/+3
The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-04tcp: drop SYN+FIN messagesEric Dumazet1-0/+2
Denys Fedoryshchenko reported that SYN+FIN attacks were bringing his linux machines to their limits. Dont call conn_request() if the TCP flags includes SYN flag Reported-by: Denys Fedoryshchenko <denys@visp.net.lb> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-03ipv6: Kill ndisc_get_neigh() inline helper.David S. Miller2-12/+4
It's only used in net/ipv6/route.c and the NULL device check is superfluous for all of the existing call sites. Just expand the __ndisc_lookup_errno() call at each location. Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-03ipv6: Various cleanups in route.cDavid S. Miller1-47/+48
1) x == NULL --> !x 2) x != NULL --> x 3) (x&BIT) --> (x & BIT) 4) (BIT1|BIT2) --> (BIT1 | BIT2) 5) proper argument and struct member alignment Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-03ipv6: Various cleanups in ip6_route.cDavid S. Miller1-59/+56
1) x == NULL --> !x 2) x != NULL --> x 3) if() --> if () 4) while() --> while () 5) (x & BIT) == 0 --> !(x & BIT) 6) (x&BIT) --> (x & BIT) 7) x=y --> x = y 8) (BIT1|BIT2) --> (BIT1 | BIT2) 9) if ((x & BIT)) --> if (x & BIT) 10) proper argument and struct member alignment Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-03net: Add Open vSwitch kernel components.Jesse Gross20-0/+5874
Open vSwitch is a multilayer Ethernet switch targeted at virtualized environments. In addition to supporting a variety of features expected in a traditional hardware switch, it enables fine-grained programmatic extension and flow-based control of the network. This control is useful in a wide variety of applications but is particularly important in multi-server virtualization deployments, which are often characterized by highly dynamic endpoints and the need to maintain logical abstractions for multiple tenants. The Open vSwitch datapath provides an in-kernel fast path for packet forwarding. It is complemented by a userspace daemon, ovs-vswitchd, which is able to accept configuration from a variety of sources and translate it into packet processing rules. See http://openvswitch.org for more information and userspace utilities. Signed-off-by: Jesse Gross <jesse@nicira.com>
2011-12-03ipv6: Add fragment reporting to ipv6_skip_exthdr().Jesse Gross17-19/+45
While parsing through IPv6 extension headers, fragment headers are skipped making them invisible to the caller. This reports the fragment offset of the last header in order to make it possible to determine whether the packet is fragmented and, if so whether it is a first or last fragment. Signed-off-by: Jesse Gross <jesse@nicira.com>
2011-12-03vlan: Move vlan_set_encap_proto() to vlan header filePravin B Shelar2-33/+34
Open vSwitch needs this function for vlan handling. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
2011-12-03genetlink: Add rcu_dereference_genl and genl_dereference.Jesse Gross1-0/+21
This adds rcu_dereference_genl and genl_dereference, which are genl variants of the RTNL functions to enforce proper locking with lockdep and sparse. Signed-off-by: Jesse Gross <jesse@nicira.com>
2011-12-03genetlink: Add lockdep_genl_is_held().Pravin B Shelar2-0/+11
Open vSwitch uses genl_mutex locking to protect datapath data-structures like flow-table, flow-actions. Following patch adds lockdep_genl_is_held() which is used for rcu annotation to prove locking. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>