aboutsummaryrefslogtreecommitdiffstats
path: root/tools (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2015-03-23isdn/gigaset: restructure modem response parser (4)Tilman Schmidt1-107/+151
Restructure the control structure of the modem response parser to improve readability and error handling. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-23isdn/gigaset: restructure modem response parser (3)Tilman Schmidt1-37/+19
Separate CID detection from main parser loop. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-23isdn/gigaset: restructure modem response parser (2)Tilman Schmidt1-69/+57
Separate literal string handling from main parser loop. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-23isdn/gigaset: restructure modem response parser (1)Tilman Schmidt1-44/+55
Factor out queueing of modem response events into helper function add_cid_event(). Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-23switchdev: fix stp update API to work with layered netdevicesRoopa Prabhu1-4/+13
make it same as the netdev_switch_port_bridge_setlink/dellink api (ie traverse lowerdevs to get to the switch port). removes "WARN_ON(!ops->ndo_switch_parent_id_get)" because direct bridge ports can be stacked netdevices (like bonds and team of switch ports) which may not implement this ndo. v2 to v3: - remove changes to bond and team. Bring back the transparently following lowerdevs like i initially had for setlink/getlink (http://www.spinics.net/lists/netdev/msg313436.html) dave and scott feldman also seem to prefer it be that way and move to non-transparent way of doing things if we see a problem down the lane. v3 to v4: - fix ret initialization v4 to v5: - return err on first failure (scott feldman) v5 to v6: - change variable name (err) and initialize to -EOPNOTSUPP (scott feldman). Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Acked-by: Scott Feldman <sfeldma@gmail.com> Acked-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-23net: clear skb->priority when forwarding to another netnsWANG Cong1-0/+1
skb->priority can be set for two purposes: 1) With respect to IP TOS field, which is computed by a mask. Ususally used for priority qdisc's (pfifo, prio etc.), on TX side (we only have ingress qdisc on RX side). 2) Used as a classid or flowid, works in the same way with tc classid. What's more, this can even override the classid of tc filters. For case 1), it has been respected within its netns, I don't see any point of keeping it for another netns, especially when packets will be forwarded to Rx path (no matter from TX path or RX path). For case 2) we care, our applications run inside a netns, and we classify the packets by our own filters outside, If some application sets this priority, it could bypass our filters, therefore clear it when moving out of a netns, it makes no sense to bypass tc filters out of its netns. Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-23crypto: algif - change algif_skcipher to be asynchronousTadeusz Struk1-7/+226
The way the algif_skcipher works currently is that on sendmsg/sendpage it builds an sgl for the input data and then on read/recvmsg it sends the job for encryption putting the user to sleep till the data is processed. This way it can only handle one job at a given time. This patch changes it to be asynchronous by adding AIO support. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-23crypto: af_alg - Allow to link sglTadeusz Struk2-6/+16
Allow to link af_alg sgls. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-23net: socket: add support for async operationstadeusz.struk@intel.com3-2/+9
Add support for async operations. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-21netlink: Remove netlink_compare_arg.trailerHerbert Xu1-2/+3
Instead of computing the offset from trailer, this patch computes netlink_compare_arg_len from the offset of portid and then adds 4 to it. This allows trailer to be removed. Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: netcp: ethss: enhancement to support NetCP 1.5 ethssWingMan Kwok2-36/+902
NetCP 1.5 available on newer K2 SoCs such as K2E and K2L introduced 3 variants of the ethss subsystem, 9 port, 5 port and 2 port. These have one host port towards the CPU and N external slave ports. To customize the driver for these new ethss sub systems, multiple compatibility strings are introduced. Currently some of parameters that are different on different variants such as number of ALE ports, stats modules and number of ports are defined through constants. These are now changed to variables in gbe_priv data that get set based on the compatibility string. This is required as there are no hardware identification registers available to distinguish among the variants of NetCP 1.5 ethss. However there is identification register available to differentiate between NetCP 1.4 vs NetCP 1.5 and the same is made use of in the code to differentiate them. For more reading on the details of this peripheral, please refer to the User Guide available at http://www.ti.com/lit/pdf/spruhz3 Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: WingMan Kwok <w-kwok2@ti.com> CC: "David S. Miller" <davem@davemloft.net> CC: Mugunthan V N <mugunthanvnm@ti.com> CC: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> CC: Grygorii Strashko <grygorii.strashko@ti.com> CC: Christoph Jaeger <cj@linux.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Markus Pargmann <mpa@pengutronix.de> CC: Kumar Gala <galak@codeaurora.org> CC: Ian Campbell <ijc+devicetree@hellion.org.uk> CC: Mark Rutland <mark.rutland@arm.com> CC: Pawel Moll <pawel.moll@arm.com> CC: Rob Herring <robh+dt@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: netcp: enclose macros in parenthesesKaricheri, Muralidharan1-251/+272
Fix following checkpatch error. It seems to have passed checkpatch last time when original code was introduced. ERROR: Macros with complex values should be enclosed in parentheses #172: FILE: drivers/net/ethernet/ti/netcp_ethss.c:869: Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: WingMan Kwok <w-kwok2@ti.com> CC: "David S. Miller" <davem@davemloft.net> CC: Mugunthan V N <mugunthanvnm@ti.com> CC: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> CC: Grygorii Strashko <grygorii.strashko@ti.com> CC: Christoph Jaeger <cj@linux.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Markus Pargmann <mpa@pengutronix.de> CC: Kumar Gala <galak@codeaurora.org> CC: Ian Campbell <ijc+devicetree@hellion.org.uk> CC: Mark Rutland <mark.rutland@arm.com> CC: Pawel Moll <pawel.moll@arm.com> CC: Rob Herring <robh+dt@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: netcp: select davinci_mdio driver by defaultKaricheri, Muralidharan1-0/+1
Keystone netcp driver re-uses davinci mdio driver. So enable it by default for keystone netcp driver. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: WingMan Kwok <w-kwok2@ti.com> CC: "David S. Miller" <davem@davemloft.net> CC: Mugunthan V N <mugunthanvnm@ti.com> CC: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> CC: Grygorii Strashko <grygorii.strashko@ti.com> CC: Christoph Jaeger <cj@linux.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Markus Pargmann <mpa@pengutronix.de> CC: Kumar Gala <galak@codeaurora.org> CC: Ian Campbell <ijc+devicetree@hellion.org.uk> CC: Mark Rutland <mark.rutland@arm.com> CC: Pawel Moll <pawel.moll@arm.com> CC: Rob Herring <robh+dt@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: netcp: use separate reg region for individual ethss modulesKaricheri, Muralidharan2-44/+102
Ethss has multiple modules within the sub system - switch sub system - sgmii - mdio - switch module NetCP driver re-uses existing davinci mdio driver. It requires to have its own register region to map the reg space. So restructure the code to use separate reg region for the individual modules it manages. Use range property to define register space of NetCP and use reg property to define individual reg spaces. So MDIO will have its own reg space to map. This is a pre-requisite to enable MDIO driver for NetCP. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: WingMan Kwok <w-kwok2@ti.com> CC: "David S. Miller" <davem@davemloft.net> CC: Mugunthan V N <mugunthanvnm@ti.com> CC: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> CC: Grygorii Strashko <grygorii.strashko@ti.com> CC: Christoph Jaeger <cj@linux.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Markus Pargmann <mpa@pengutronix.de> CC: Kumar Gala <galak@codeaurora.org> CC: Ian Campbell <ijc+devicetree@hellion.org.uk> CC: Mark Rutland <mark.rutland@arm.com> CC: Pawel Moll <pawel.moll@arm.com> CC: Rob Herring <robh+dt@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: netcp: fix forward port number usage for 10G ethssKaricheri, Muralidharan3-13/+29
10G switch requires forward port number in the taginfo field, where as it should be in packet_info field for necp 1.4 Ethss. So fill this value correctly in the knav dma descriptor. Also rename dma_psflags field in struct netcp_tx_pipe to switch_to_port as it contain no flag, but the switch port number for forwarding the packet. Add a flag to hold the new flag, SWITCH_TO_PORT_IN_TAGINFO which will be set for 10G. This can also used in the future for other flags for the tx_pipe. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: WingMan Kwok <w-kwok2@ti.com> CC: "David S. Miller" <davem@davemloft.net> CC: Mugunthan V N <mugunthanvnm@ti.com> CC: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> CC: Grygorii Strashko <grygorii.strashko@ti.com> CC: Christoph Jaeger <cj@linux.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Markus Pargmann <mpa@pengutronix.de> CC: Kumar Gala <galak@codeaurora.org> CC: Ian Campbell <ijc+devicetree@hellion.org.uk> CC: Mark Rutland <mark.rutland@arm.com> CC: Pawel Moll <pawel.moll@arm.com> CC: Rob Herring <robh+dt@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: neighbour: Document {mcast, ucast}_solicit, mcast_resolicit.YOSHIFUJI Hideaki/吉藤英明1-1/+13
Signed-off-by: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: neighbour: Add mcast_resolicit to configure the number of multicast resolicitations in PROBE state.YOSHIFUJI Hideaki/吉藤英明3-4/+13
We send unicast neighbor (ARP or NDP) solicitations ucast_probes times in PROBE state. Zhu Yanjun reported that some implementation does not reply against them and the entry will become FAILED, which is undesirable. We had been dealt with such nodes by sending multicast probes mcast_ solicit times after unicast probes in PROBE state. In 2003, I made a change not to send them to improve compatibility with IPv6 NDP. Let's introduce per-protocol per-interface sysctl knob "mcast_ reprobe" to configure the number of multicast (re)solicitation for reconfirmation in PROBE state. The default is 0, since we have been doing so for 10+ years. Reported-by: Zhu Yanjun <Yanjun.Zhu@windriver.com> CC: Ulf Samuelsson <ulf.samuelsson@ericsson.com> Signed-off-by: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20bgmac: allow enabling on ARCH_BCM_5301XRafał Miłecki1-1/+1
Home routers based on ARM SoCs like BCM4708 also have bcma bus with core supported by bgmac. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20bgmac: register fixed PHY for ARM BCM470X / BCM5301X chipsetsRafał Miłecki1-0/+34
On ARM SoCs with bgmac Ethernet hardware we don't have any normal PHY. There is always a switch attached but it's not even controlled over MDIO like in case of MIPS devices. We need a fixed PHY to be able to send/receive packets from the switch. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: dsa: make NET_DSA manually selectable from the configMathieu Olivari1-1/+4
Change bd76a116707bd2381da36cf7c3183df11293f1d6 made all DSA drivers depend on NET_DSA rather than selecting them. However, as the only way to select this option was to actually select a driver, it made DSA impossible to enable at all. This patch adds an explicit entry which the user will have to enable prior selecting a driver. Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20switchdev: kernel-doc cleanup on swithdev opsScott Feldman1-16/+7
Suggested-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20Revert "selinux: add a skb_owned_by() hook"Eric Dumazet5-27/+0
This reverts commit ca10b9e9a8ca7342ee07065289cbe74ac128c169. No longer needed after commit eb8895debe1baba41fcb62c78a16f0c63c21662a ("tcp: tcp_make_synack() should use sock_wmalloc") When under SYNFLOOD, we build lot of SYNACK and hit false sharing because of multiple modifications done on sk_listener->sk_wmem_alloc Since tcp_make_synack() uses sock_wmalloc(), there is no need to call skb_set_owner_w() again, as this adds two atomic operations. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20igbvf: use netif_carrier_off earlier when bringing if downTodd Fujinaka1-2/+1
Use netif_carrier_off() first, since that will prevent the stack from queuing more packets to this IF. This operation is fast, and should behave much nicer when trying to bring down an interface under load. Reported-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-20igb: use netif_carrier_off earlier when bringing if downTodd Fujinaka1-3/+1
Use netif_carrier_off() first, since that will prevent the stack from queuing more packets to this IF. This operation is fast, and should behave much nicer when trying to bring down an interface under load. Reported-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-20e1000e: NVM write protect access removed from SPT HWYanir Lubetkin1-1/+2
The call to e1000e_write_protect_nvm_ich8lan() is no longer supported by HW. Access to these registers causes a system freeze in A step hardware and is ignored in B step hardware. This function must not be called in hardware newer than LPT. Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-20e1000e: call netif_carrier_off early on downEliezer Tamir1-2/+2
When bringing down an interface netif_carrier_off() should be one the first things we do, since this will prevent the stack from queuing more packets to this interface. This operation is very fast, and should make the device behave much nicer when trying to bring down an interface under load. Also, this would Do The Right Thing (TM) if this device has some sort of fail-over teaming and redirect traffic to the other IF. Move netif_carrier_off as early as possible. Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-20ixgb: call netif_carrier_off early on downEliezer Tamir1-1/+2
When bringing down an interface netif_carrier_off() should be one the first things we do, since this will prevent the stack from queuing more packets to this interface. This operation is very fast, and should make the device behave much nicer when trying to bring down an interface under load. Also, this would Do The Right Thing (TM) if this device has some sort of fail-over teaming and redirect traffic to the other IF. Move netif_carrier_off as early as possible. Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-03-20act_bpf: add initial eBPF support for actionsDaniel Borkmann3-83/+220
This work extends the "classic" BPF programmable tc action by extending its scope also to native eBPF code! Together with commit e2e9b6541dd4 ("cls_bpf: add initial eBPF support for programmable classifiers") this adds the facility to implement fully flexible classifier and actions for tc that can be implemented in a C subset in user space, "safely" loaded into the kernel, and being run in native speed when JITed. Also, since eBPF maps can be shared between eBPF programs, it offers the possibility that cls_bpf and act_bpf can share data 1) between themselves and 2) between user space applications. That means that, f.e. customized runtime statistics can be collected in user space, but also more importantly classifier and action behaviour could be altered based on map input from the user space application. For the remaining details on the workflow and integration, see the cls_bpf commit e2e9b6541dd4. Preliminary iproute2 part can be found under [1]. [1] http://git.breakpoint.cc/cgit/dborkman/iproute2.git/log/?h=ebpf-act Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Jiri Pirko <jiri@resnulli.us> Acked-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20ebpf: add sched_act_type and map it to sk_filter's verifier opsDaniel Borkmann3-0/+8
In order to prepare eBPF support for tc action, we need to add sched_act_type, so that the eBPF verifier is aware of what helper function act_bpf may use, that it can load skb data and read out currently available skb fields. This is bascially analogous to 96be4325f443 ("ebpf: add sched_cls_type and map it to sk_filter's verifier ops"). BPF_PROG_TYPE_SCHED_CLS and BPF_PROG_TYPE_SCHED_ACT need to be separate since both will have a different set of functionality in future (classifier vs action), thus we won't run into ABI troubles when the point in time comes to diverge functionality from the classifier. The future plan for act_bpf would be that it will be able to write into skb->data and alter selected fields mirrored in struct __sk_buff. For an initial support, it's sufficient to map it to sk_filter_ops. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Jiri Pirko <jiri@resnulli.us> Reviewed-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20rhashtable: Fix undeclared EEXIST build error on ia64Herbert Xu1-0/+1
We need to include linux/errno.h in rhashtable.h since it doesn't always get included otherwise. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: validate the range we feed to iov_iter_init() in sys_sendto/sys_recvfromAl Viro1-0/+4
Cc: stable@vger.kernel.org # v3.19 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20amd-xgbe: Use napi_alloc_skb when allocating skb in softirqLendacky, Thomas1-4/+3
Use the napi_alloc_skb function to allocate an skb when running within the softirq context to avoid calls to local_irq_save/restore. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20amd-xgbe: Fix Rx coalescing reportingLendacky, Thomas3-7/+7
The Rx coalescing value is internally converted from usecs to a value that the hardware can use. When reporting the Rx coalescing value, this internal value is converted back to usecs. During the conversion from and back to usecs some rounding occurs. So, for example, when setting an Rx usec of 30, it will be reported as 29. Fix this reporting issue by keeping the original usec value and using that during reporting. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20amd-xgbe: Remove Tx coalescingLendacky, Thomas4-21/+12
The Tx coalescing support in the driver was a software implementation for something lacking in the hardware. Using hrtimers, the idea was to trigger a timer interrupt after having queued a packet for transmit. Unfortunately, as the timer value was lowered, the timer expired before the hardware actually did the transmit and so it was racey and resulted in unnecessary interrupts. Remove the Tx coalescing support and hrtimer and replace with a Tx timer that is used as a reclaim timer in case of inactivity. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20amd-xgbe: Set DMA mask based on hardware register valueLendacky, Thomas4-9/+29
The hardware supplies a value that indicates the DMA range that it is capable of using. Use this value rather than hard-coding it in the driver. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20amd-xgbe: Use the new DMA memory barriers where appropriateLendacky, Thomas2-7/+13
Use the new lighter weight memory barriers when working with the device descriptors. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20amd-xgbe: Clarify output message about queuesLendacky, Thomas1-2/+4
Clarify that the queues referred to in a message when the device is brought up are hardware queues and not necessarily related to the Linux network queues. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20amd-xgbe-phy: Provide support for auto-negotiation timeoutLendacky, Thomas1-0/+20
Currently, there is no interrupt code that indicates auto-negotiation has timed out. If the auto-negotiation has timed out then the start of a new auto-negotiation will begin again with a new base page being received. The state machine could be in a state that is not expecting this interrupt code which results in an error during auto-negotiation. Update the code to timestamp when the auto-negotiation starts. Should another page received interrupt code occur before auto-negotiation has completed but after the auto-negotiation timeout, then reset the state machine to allow the auto-negotiation to continue. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20amd-xgbe-phy: Use the phy_driver flags fieldLendacky, Thomas2-1/+1
Remove the setting of the transceiver type when retrieving the device settings using ethtool and instead set the transceiver type in the phy_driver structure flags field. Change the transceiver type to be internal, also. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20amd-xgbe-phy: Use phydev advertising field vs supportedLendacky, Thomas1-39/+38
With ethtool being able to control what is advertised, the advertising field is what should be used for priming the auto-negotiation registers and for various other checks, instead of the supported field. Also, move the initial setting of the supported and advertising fields into the probe function so that they are not reset each time the device is brought up, thus allowing the user to set as desired before bringing the device up. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20net: compat: Update get_compat_msghdr() to match copy_msghdr_from_user() behaviourCatalin Marinas1-0/+7
Commit db31c55a6fb2 (net: clamp ->msg_namelen instead of returning an error) introduced the clamping of msg_namelen when the unsigned value was larger than sizeof(struct sockaddr_storage). This caused a msg_namelen of -1 to be valid. The native code was subsequently fixed by commit dbb490b96584 (net: socket: error on a negative msg_namelen). In addition, the native code sets msg_namelen to 0 when msg_name is NULL. This was done in commit (6a2a2b3ae075 net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr struct from userland) and subsequently updated by 08adb7dabd48 (fold verify_iovec() into copy_msghdr_from_user()). This patch brings the get_compat_msghdr() in line with copy_msghdr_from_user(). Fixes: db31c55a6fb2 (net: clamp ->msg_namelen instead of returning an error) Cc: David S. Miller <davem@davemloft.net> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20rhashtable: Rip out obsolete out-of-line interfaceHerbert Xu2-300/+3
Now that all rhashtable users have been converted over to the inline interface, this patch removes the unused out-of-line interface. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20tipc: Use inlined rhashtable interfaceHerbert Xu1-14/+18
This patch converts tipc to the inlined rhashtable interface. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20test_rhashtable: Use inlined rhashtable interfaceHerbert Xu1-14/+19
This patch converts test_rhashtable to the inlined rhashtable interface. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20netfilter: Convert nft_hash to inlined rhashtableHerbert Xu1-41/+29
This patch converts nft_hash to the inlined rhashtable interface. This patch also replaces the call to rhashtable_lookup_compare with a straight rhashtable_lookup_fast because it's simply doing a memcmp (in fact nft_hash_lookup already uses memcmp instead of nft_data_cmp). Furthermore, the compare function is only meant to compare, it is not supposed to have side-effects. The current side-effect code can simply be moved into the nft_hash_get. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20netlink: Move namespace into hash keyHerbert Xu1-32/+56
Currently the name space is a de facto key because it has to match before we find an object in the hash table. However, it isn't in the hash value so all objects from different name spaces with the same port ID hash to the same bucket. This is bad as the number of name spaces is unbounded. This patch fixes this by using the namespace when doing the hash. Because the namespace field doesn't lie next to the portid field in the netlink socket, this patch switches over to the rhashtable interface without a fixed key. This patch also uses the new inlined rhashtable interface where possible. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20rhashtable: Allow hash/comparison functions to be inlinedHerbert Xu2-113/+436
This patch deals with the complaint that we make indirect function calls on the fast paths unnecessarily in rhashtable. We resolve it by moving the fast paths into inline functions that take struct rhashtable_param (which obviously must be the same set of parameters supplied to rhashtable_init) as an argument. The only remaining indirect call is to obj_hashfn (or key_hashfn it obj_hashfn is unset) on the rehash as well as the insert-during- rehash slow path. This patch also extends the support of vairable-length keys to include those where the key is fixed but scattered in the object. For example, in netlink we want to key off the namespace and the portid but they're not next to each other. This patch does this by directly using the object hash function as the indicator of whether the key is accessible or not. It also adds a new function obj_cmpfn to compare a key against an object. This means that the caller no longer needs to supply explicit compare functions. All this is done in a backwards compatible manner so no existing users are affected until they convert to the new interface. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20rhashtable: Make rhashtable_init params argument constHerbert Xu2-4/+6
This patch marks the rhashtable_init params argument const as there is no reason to modify it since we will always make a copy of it in the rhashtable. This patch also fixes a bug where we don't actually round up the value of min_size unless it is less than HASH_MIN_SIZE. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20ebpf, filter: do not convert skb->protocol to host endianess during runtimeDaniel Borkmann1-15/+14
Commit c24973957975 ("bpf: allow BPF programs access 'protocol' and 'vlan_tci' fields") has added support for accessing protocol, vlan_present and vlan_tci into the skb offset map. As referenced in the below discussion, accessing skb->protocol from an eBPF program should be converted without handling endianess. The reason for this is that an eBPF program could simply do a check more naturally, by f.e. testing skb->protocol == htons(ETH_P_IP), where the LLVM compiler resolves htons() against a constant automatically during compilation time, as opposed to an otherwise needed run time conversion. After all, the way of programming both from a user perspective differs quite a lot, i.e. bpf_asm ["ld proto"] versus a C subset/LLVM. Reference: https://patchwork.ozlabs.org/patch/450819/ Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-20ipv6: invert join/leave anycast rtnl/socket locking orderMarcelo Ricardo Leitner2-7/+7
Commit baf606d9c9b1 ("ipv4,ipv6: grab rtnl before locking the socket") missed to update two setsockopt options, IPV6_JOIN_ANYCAST and IPV6_LEAVE_ANYCAST, causing a lock inverstion regarding to the updated ones. As ipv6_sock_ac_join and ipv6_sock_ac_leave are only called from do_ipv6_setsockopt, we are good to just move the rtnl lock upper. Fixes: baf606d9c9b1 ("ipv4,ipv6: grab rtnl before locking the socket") Reported-by: Ying Huang <ying.huang@intel.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>