summaryrefslogtreecommitdiffstats
path: root/net
Commit message (Collapse)AuthorAgeFilesLines
* nfnetlink: add support for memory mapped netlinkPatrick McHardy2013-04-193-5/+15
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netfilter: rename netlink related "pid" variables to "portid"Patrick McHardy2013-04-193-14/+15
| | | | | | | | Get rid of the confusing mix of pid and portid and use portid consistently for all netlink related socket identities. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: add RX/TX-ring support to netlink diagPatrick McHardy2013-04-191-0/+32
| | | | | | | Based on AF_PACKET. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: add flow control for memory mapped I/OPatrick McHardy2013-04-191-27/+61
| | | | | | | | | | Add flow control for memory mapped RX. Since user-space usually doesn't invoke recvmsg() when using memory mapped I/O, flow control is performed in netlink_poll(). Dumps are allowed to continue if at least half of the ring frames are unused. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: implement memory mapped recvmsg()Patrick McHardy2013-04-191-3/+141
| | | | | | | | | | | | | | | | | Add support for mmap'ed recvmsg(). To allow the kernel to construct messages into the mapped area, a dataless skb is allocated and the data pointer is set to point into the ring frame. This means frames will be delivered to userspace in order of allocation instead of order of transmission. This usually doesn't matter since the order is either not determinable by userspace or message creation/transmission is serialized. The only case where this can have a visible difference is nfnetlink_queue. Userspace can't assume mmap'ed messages have ordered IDs anymore and needs to check this if using batched verdicts. For non-mapped sockets, nothing changes. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: implement memory mapped sendmsg()Patrick McHardy2013-04-191-6/+129
| | | | | | | | | | | | Add support for mmap'ed sendmsg() to netlink. Since the kernel validates received messages before processing them, the code makes sure userspace can't modify the message contents after invoking sendmsg(). To do that only a single mapping of the TX ring is allowed to exist and the socket must not be shared. If either of these two conditions does not hold, it falls back to copying. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: add mmap'ed netlink helper functionsPatrick McHardy2013-04-191-2/+183
| | | | | | | | | Add helper functions for looking up mmap'ed frame headers, reading and writing their status, allocating skbs with mmap'ed data areas and a poll function. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: mmaped netlink: ring setupPatrick McHardy2013-04-193-2/+295
| | | | | | | | | Add support for mmap'ed RX and TX ring setup and teardown based on the af_packet.c code. The following patches will use this to add the real mmap'ed receive and transmit functionality. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: add netlink_skb_set_owner_r()Patrick McHardy2013-04-191-3/+17
| | | | | | | | | | | | | | | | For mmap'ed I/O a netlink specific skb destructor needs to be invoked after the final kfree_skb() to clean up state. This doesn't work currently since the skb's ownership is transfered to the receiving socket using skb_set_owner_r(), which orphans the skb, thereby invoking the destructor prematurely. Since netlink doesn't account skbs to the originating socket, there's no need to orphan the skb. Add a netlink specific skb_set_owner_r() variant that does not orphan the skb and use a netlink specific destructor to call sock_rfree(). Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: don't orphan skb in netlink_trim()Patrick McHardy2013-04-191-1/+1
| | | | | | | | | | | | Netlink doesn't account skbs to the sending socket, so the there's no need to orphan the skb before trimming it. Removing the skb_orphan() call is required for mmap'ed netlink, which uses a netlink specific skb destructor that must not be invoked before the final freeing of the skb. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: add function to allocate sk_buff head without data areaPatrick McHardy2013-04-191-1/+29
| | | | | | | | | | | | | Add a function to allocate a sk_buff head without any data. This will be used by memory mapped netlink to attach data from the mmaped area to the skb. Additionally change skb_release_all() to check whether the skb has a data area to allow the skb destructor to clear the data pointer in case only a head has been allocated. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: rename ssk to sk in struct netlink_skb_paramsPatrick McHardy2013-04-195-8/+8
| | | | | | | | | Memory mapped netlink needs to store the receiving userspace socket when sending from the kernel to userspace. Rename 'ssk' to 'sk' to avoid confusion. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* netlink: add symbolic value for congested statePatrick McHardy2013-04-191-7/+11
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: vlan: add 802.1ad supportPatrick McHardy2013-04-195-14/+50
| | | | | | | | | | | | | | | | | | | | | Add support for 802.1ad VLAN devices. This mainly consists of checking for ETH_P_8021AD in addition to ETH_P_8021Q in a couple of places and check offloading capabilities based on the used protocol. Configuration is done using "ip link": # ip link add link eth0 eth0.1000 \ type vlan proto 802.1ad id 1000 # ip link add link eth0.1000 eth0.1000.1000 \ type vlan proto 802.1q id 1000 52:54:00:12:34:56 > 92:b1:54:28:e4:8c, ethertype 802.1Q (0x8100), length 106: vlan 1000, p 0, ethertype 802.1Q, vlan 1000, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84) 20.1.0.2 > 20.1.0.1: ICMP echo request, id 3003, seq 8, length 64 92:b1:54:28:e4:8c > 52:54:00:12:34:56, ethertype 802.1Q-QinQ (0x88a8), length 106: vlan 1000, p 0, ethertype 802.1Q, vlan 1000, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 47944, offset 0, flags [none], proto ICMP (1), length 84) 20.1.0.1 > 20.1.0.2: ICMP echo reply, id 3003, seq 8, length 64 Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: vlan: add protocol argument to packet tagging functionsPatrick McHardy2013-04-1910-16/+21
| | | | | | | | | | Add a protocol argument to the VLAN packet tagging functions. In case of HW tagging, we need that protocol available in the ndo_start_xmit functions, so it is stored in a new field in the skb. The new field fits into a hole (on 64 bit) and doesn't increase the sks's size. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: vlan: prepare for 802.1ad supportPatrick McHardy2013-04-198-78/+100
| | | | | | | | Make the encapsulation protocol value a property of VLAN devices and change the device lookup functions to take the protocol value into account. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: vlan: prepare for 802.1ad VLAN filtering offloadPatrick McHardy2013-04-193-29/+38
| | | | | | | | | Change the rx_{add,kill}_vid callbacks to take a protocol argument in preparation of 802.1ad support. The protocol argument used so far is always htons(ETH_P_8021Q). Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: vlan: rename NETIF_F_HW_VLAN_* feature flags to NETIF_F_HW_VLAN_CTAG_*Patrick McHardy2013-04-199-29/+31
| | | | | | | | | | Rename the hardware VLAN acceleration features to include "CTAG" to indicate that they only support CTAGs. Follow up patches will introduce 802.1ad server provider tagging (STAGs) and require the distinction for hardware not supporting acclerating both. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* tcp: introduce TCPSpuriousRtxHostQueues SNMP counterEric Dumazet2013-04-182-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Host queues (Qdisc + NIC) can hold packets so long that TCP can eventually retransmit a packet before the first transmit even left the host. Its not clear right now if we could avoid this in the first place : - We could arm RTO timer not at the time we enqueue packets, but at the time we TX complete them (tcp_wfree()) - Cancel the sending of the new copy of the packet if prior one is still in queue. This patch adds instrumentation so that we can at least see how often this problem happens. TCPSpuriousRtxHostQueues SNMP counter is incremented every time we detect the fast clone is not yet freed in tcp_transmit_skb() Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Yuchung Cheng <ycheng@google.com> Cc: Neal Cardwell <ncardwell@google.com> Cc: Tom Herbert <therbert@google.com> Cc: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: add InfiniBand media typePatrick McHardy2013-04-176-3/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add InfiniBand media type based on the ethernet media type. The only real difference is that in case of InfiniBand, we need the entire 20 bytes of space reserved for media addresses, so the TIPC media type ID is not explicitly stored in the packet payload. Sample output of tipc-config: # tipc-config -v -addr -netid -nt=all -p -m -b -n -ls node address: <10.1.4> current network id: 4711 Type Lower Upper Port Identity Publication Scope 0 167776257 167776257 <10.1.1:1855512577> 1855512578 cluster 167776260 167776260 <10.1.4:1216454657> 1216454658 zone 1 1 1 <10.1.4:1216479235> 1216479236 node Ports: 1216479235: bound to {1,1} 1216454657: bound to {0,167776260} Media: eth ib Bearers: ib:ib0 Nodes known: <10.1.1>: up Link <broadcast-link> Window:20 packets RX packets:0 fragments:0/0 bundles:0/0 TX packets:0 fragments:0/0 bundles:0/0 RX naks:0 defs:0 dups:0 TX naks:0 acks:0 dups:0 Congestion bearer:0 link:0 Send queue max:0 avg:0 Link <10.1.4:ib0-10.1.1:ib0> ACTIVE MTU:2044 Priority:10 Tolerance:1500 ms Window:50 packets RX packets:80 fragments:0/0 bundles:0/0 TX packets:40 fragments:0/0 bundles:0/0 TX profile sample:22 packets average:54 octets 0-64:100% -256:0% -1024:0% -4096:0% -16384:0% -32768:0% -66000:0% RX states:410 probes:213 naks:0 defs:0 dups:0 TX states:410 probes:197 naks:0 acks:0 dups:0 Congestion bearer:0 link:0 Send queue max:1 avg:0 Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: set skb->protocol in eth_media packet transmissionPatrick McHardy2013-04-171-0/+1
| | | | | | | | | | | | | | | The skb->protocol field is used by packet classifiers and for AF_PACKET cooked format, TIPC needs to set it properly. Fixes packet classification and ethertype of 0x0000 in cooked captures: Out 20:c9:d0:43:12:d9 ethertype Unknown (0x0000), length 56: 0x0000: 5b50 0028 0000 30d4 0100 1000 0100 1001 [P.(..0......... 0x0010: 0000 03e8 0000 0001 20c9 d043 12d9 0000 ...........C.... 0x0020: 0000 0000 0000 0000 ........ Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: move bcast_addr from struct tipc_media to struct tipc_bearerPatrick McHardy2013-04-175-16/+18
| | | | | | | | | | Some network protocols, like InfiniBand, don't have a fixed broadcast address but one that depends on the configuration. Move the bcast_addr to struct tipc_bearer and initialize it with the broadcast address of the network device when the bearer is enabled. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: remove unused str2addr media callbackPatrick McHardy2013-04-172-22/+0Star
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: sctp: sctp_ulpq: remove 'malloced' struct memberDaniel Borkmann2013-04-171-3/+0Star
| | | | | | | | | | The structure sctp_ulpq is embedded into sctp_association and never separately allocated, also ulpq->malloced is always 0, so that kfree() is never called. Therefore, remove this code. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: sctp: sctp_bind_addr: remove dead codeDaniel Borkmann2013-04-171-7/+0Star
| | | | | | | | | | | The sctp_bind_addr structure has a 'malloced' member that is always set to 0, thus in sctp_bind_addr_free() the kfree() part can never be called. This part is embedded into sctp_ep_common anyway and never alloced. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: sctp: sctp_transport: remove unused variableDaniel Borkmann2013-04-171-1/+0Star
| | | | | | | | | sctp_transport's member 'malloced' is set to 1, never evaluated and the structure is kfreed anyway. So just remove it. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: sctp: outqueue: simplify sctp_outq_uncork functionDaniel Borkmann2013-04-171-3/+2Star
| | | | | | | | | Just a minor edit to simplify the function. No need for this error variable here. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: sctp: sctp_outq: remove 'malloced' from its structDaniel Borkmann2013-04-171-6/+0Star
| | | | | | | | | | sctp_outq is embedded into sctp_association, and thus never kmalloced in any way. Also, malloced is always 0, thus kfree() is never called. Therefore, remove that dead piece of code. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: sctp: sctp_inq: remove dead codeDaniel Borkmann2013-04-171-7/+0Star
| | | | | | | | | | sctp_inq is never kmalloced, since it's integrated into sctp_ep_common and only initialized from eps and assocs. Therefore, remove the dead code from there. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: sctp: sctp_ssnmap: remove 'malloced' element from structDaniel Borkmann2013-04-171-11/+12
| | | | | | | | | | sctp_ssnmap_init() can only be called from sctp_ssnmap_new() where malloced is always set to 1. Thus, when we call sctp_ssnmap_free() the test for map->malloced evaluates always to true. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2013-04-179-264/+391
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch Jesse Gross says: ==================== A number of improvements for net-next/3.10. Highlights include: * Properly exposing linux/openvswitch.h to userspace after the uapi changes. * Simplification of locking. It immediately makes things simpler to reason about and avoids holding RTNL mutex for longer than necessary. In the near future it will also enable tunnel registration and more fine-grained locking. * Miscellaneous cleanups and simplifications. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * openvswitch: Use generic struct pcpu_tstats.Pravin B Shelar2013-04-152-20/+13Star
| | | | | | | | | | | | | | | | Rather than defining ovs specific stats struct (vport_percpu_stats), we can use existing pcpu_tstats to achieve exactly same functionality. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
| * openvswitch: Simplify datapath locking.Pravin B Shelar2013-04-157-167/+298
| | | | | | | | | | | | | | | | | | | | | | | | Currently OVS uses combination of genl and rtnl lock to protect datapath state. This was done due to networking stack locking. But this has complicated locking and there are few lock ordering issues with new tunneling protocols. Following patch simplifies locking by introducing new ovs mutex and now this lock is used to protect entire ovs state. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
| * openvswitch: datapath.h: Fix a stale comment.Andy Zhou2013-04-101-1/+0Star
| | | | | | | | | | Signed-off-by: Andy Zhou <azhou@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
| * openvswitch: Don't insert empty OVS_VPORT_ATTR_OPTIONS attributeThomas Graf2013-04-031-6/+8
| | | | | | | | | | | | | | | | | | | | | | The port specific options are currently unused resulting in an empty OVS_VPORT_ATTR_OPTIONS nested attribute being inserted into every OVS_VPORT_CMD_GET message. Don't insert OVS_VPORT_ATTR_OPTIONS if no options are present. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Jesse Gross <jesse@nicira.com>
| * openvswitch: Move common genl notify code into ovs_notify()Thomas Graf2013-03-301-20/+16Star
| | | | | | | | | | Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Jesse Gross <jesse@nicira.com>
| * openvswitch: Refine Netlink message size calculation and kill FLOW_BUFSIZEThomas Graf2013-03-302-45/+52
| | | | | | | | | | | | | | | | | | | | | | Kills the FLOW_BUFSIZE constant which needs to be calculated manually and replaces it with key_attr_size() based on nla_total_size(). Calculates the size of datapath messages instead of relying on NLMSG_DEFAULT_SIZE and moves the existing message size calculations into own functions for clarity. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Jesse Gross <jesse@nicira.com>
| * openvswitch: Use nla_memcpy() to memcpy() data from attributesThomas Graf2013-03-302-2/+2
| | | | | | | | | | | | | | | | | | Less error prone as it takes into account the length of both the destination buffer and the source attribute and documents when data is copied from an attribute. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Jesse Gross <jesse@nicira.com>
| * openvswitch: Specify the minimal length of OVS_PACKET_ATTR_PACKET in the policyThomas Graf2013-03-301-3/+2Star
| | | | | | | | | | | | | | | | Specifying the minimal length in the policy makes it reuseable and documents the interface. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Jesse Gross <jesse@nicira.com>
* | packet: minor: add generic tpacket_uhdr to access packet headersDaniel Borkmann2013-04-161-27/+12Star
| | | | | | | | | | | | | | | | | | There is no need to add a dozen unions each time at the start of the function. So, do this once and use it instead. Thus, we can remove some duplicate code and make it more readable. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: Add buffer utilization fields to /proc/net/sctp/assocsDilip Daya2013-04-161-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sctp: Add buffer utilization fields to /proc/net/sctp/assocs This patch adds the following fields to /proc/net/sctp/assocs output: - sk->sk_wmem_alloc as "wmema" (transmit queue bytes committed) - sk->sk_wmem_queued as "wmemq" (persistent queue size) - sk->sk_sndbuf as "sndbuf" (size of send buffer in bytes) - sk->sk_rcvbuf as "rcvbuf" (size of receive buffer in bytes) When small DATA chunks containing 136 bytes data are sent the TX_QUEUE (assoc->sndbuf_used) reaches a maximum of 40.9% of sk_sndbuf value when peer.rwnd = 0. This was diagnosed from sk_wmem_alloc value reaching maximum value of sk_sndbuf. TX_QUEUE (assoc->sndbuf_used), sk_wmem_alloc and sk_wmem_queued values are incremented in sctp_set_owner_w() for outgoing data chunks. Having access to the above values in /proc/net/sctp/assocs will provide a better understanding of SCTP buffer management. With patch applied, example output when peer.rwnd = 0 where: ASSOC ffff880132298000 is sender ffff880125343000 is receiver ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE \ ffff880132298000 ffff880124a0a0c0 2 1 3 29325 1 214656 0 \ ffff880125343000 ffff8801237d7700 2 1 3 36210 2 0 524520 \ UID INODE LPORT RPORT LADDRS <-> RADDRS HBINT INS OUTS \ 0 25108 3455 3456 *10.4.8.3 <-> *10.5.8.3 7500 2 2 \ 0 27819 3456 3455 *10.5.8.3 <-> *10.4.8.3 7500 2 2 \ MAXRT T1X T2X RTXC wmema wmemq sndbuf rcvbuf 4 0 0 72 525633 440320 524288 524288 4 0 0 0 1 0 524288 524288 Signed-off-by: Dilip Daya <dilip.daya@hp.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | neighbour: Convert NEIGH_PRINTK to neigh_dbgJoe Perches2013-04-161-29/+20Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Update debugging messages to a more current style. Emit these debugging messages at KERN_DEBUG instead of KERN_DEFAULT. Add and use neigh_dbg(level, fmt, ...) macro Add dynamic_debug capability via pr_debug Convert embedded function names to "%s: ", __func__ Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: add dev_uc_sync_multiple() and dev_mc_sync_multiple() apiVlad Yasevich2013-04-151-42/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of dev_uc_sync/unsync() assumes that there is a strict 1-to-1 relationship between the source and destination of the sync. In other words, once an address has been synced to a destination device, it will not be synced to any other device through the sync API. However, there are some virtual devices that aggreate a number of lower devices and need to sync addresses to all of them. The current API falls short there. This patch introduces a new dev_uc_sync_multiple() api that can be called in the above circumstances and allows sync to work for every invocation. CC: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: sctp: minor: make sctp_ep_common's member 'dead' a boolDaniel Borkmann2013-04-152-4/+4
| | | | | | | | | | | | | | | | | | Since dead only holds two states (0,1), make it a bool instead of a 'char', which is more appropriate for its purpose. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: sctp: remove sctp_ep_common struct member 'malloced'Daniel Borkmann2013-04-152-13/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | There is actually no need to keep this member in the structure, because after init it's always 1 anyway, thus always kfree called. This seems to be an ancient leftover from the very initial implementation from 2.5 times. Only in case the initialization of an association fails, we leave base.malloced as 0, but we nevertheless kfree it in the error path in sctp_association_new(). Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: tcp_memcontrol: minor: remove unused variableDaniel Borkmann2013-04-141-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 10b96f7306e5 (``tcp_memcontrol: remove a redundant statement in tcp_destroy_cgroup()'') says ``We read the value but make no use of it.'', but forgot to remove the variable declaration as well. This was a follow-up commit of 3f1346193 (``memcg: decrement static keys at real destroy time'') that removed the read of variable 'val'. This fixes therefore: CC net/ipv4/tcp_memcontrol.o net/ipv4/tcp_memcontrol.c: In function ‘tcp_destroy_cgroup’: net/ipv4/tcp_memcontrol.c:67:6: warning: unused variable ‘val’ [-Wunused-variable] Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: sock: make sock_tx_timestamp voidDaniel Borkmann2013-04-146-22/+14Star
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, sock_tx_timestamp() always returns 0. The comment that describes the sock_tx_timestamp() function wrongly says that it returns an error when an invalid argument is passed (from commit 20d4947353be, ``net: socket infrastructure for SO_TIMESTAMPING''). Make the function void, so that we can also remove all the unneeded if conditions that check for such a _non-existant_ error case in the output path. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tcp: tcp_tso_segment() small optimizationEric Dumazet2013-04-131-2/+5
| | | | | | | | | | | | | | | | | | We can move th->check computation out of the loop, as compiler doesn't know each skb initially share same tcp headers after skb_segment() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tcp: GSO should be TSQ friendlyEric Dumazet2013-04-132-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that TSQ (TCP Small queues) was less effective when TSO is turned off, and GSO is on. If BQL is not enabled, TSQ has then no effect. It turns out the GSO engine frees the original gso_skb at the time the fragments are generated and queued to the NIC. We should instead call the tcp_wfree() destructor for the last fragment, to keep the flow control as intended in TSQ. This effectively limits the number of queued packets on qdisc + NIC layers. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Tom Herbert <therbert@google.com> Cc: Yuchung Cheng <ycheng@google.com> Cc: Nandita Dukkipati <nanditad@google.com> Cc: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | act_csum: fix possible use after freeEric Dumazet2013-04-121-14/+25
| | | | | | | | | | | | | | | | | | | | tcf_csum_skb_nextlayer() / pskb_may_pull() can change skb->head, so we must be careful not keeping pointers to previous headers. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Grégoire Baron <baronchon@n7mm.org> Signed-off-by: David S. Miller <davem@davemloft.net>