* Re: [PATCH] bonding: clear header_ops when last slave detached (v2)
From: Cong Wang @ 2014-11-21 18:17 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: Eric Dumazet, Wengang, netdev
In-Reply-To: <23563.1416523985@famine>
On Thu, Nov 20, 2014 at 2:53 PM, Jay Vosburgh
<jay.vosburgh@canonical.com> wrote:
> Cong Wang <cwang@twopensource.com> wrote:
>
>>Also, no one seems to care about my previous question:
>>why only bonding has the problem?
>
> Bonding has the problem because it stashes a pointer to a data
> structure (the header_ops) from another module, and when that module is
> unloaded the dangling pointer may be dereferenced if it's not either
> cleared or made to never go away.
I knew, please re-read my question, I was asking why ONLY bonding
has the problem, i.e. why not neigh or whatever else calling
header_ops->foo()? :)
As I said, I may miss some try_get_module() somewhere of course.
Needs more digging.
^ permalink raw reply
* Re: [PATCHv10 ovs 03/15] datapath: Add 'is_mask' to ovs_nla_put_flow().
From: Pravin Shelar @ 2014-11-21 18:17 UTC (permalink / raw)
To: Joe Stringer; +Cc: dev@openvswitch.org, Linux Netdev List
In-Reply-To: <CANr6G5x4ObV4r3G1wLd+51nr=oYtwt=ConknjO29VkNT-vvrmA@mail.gmail.com>
On Thu, Nov 20, 2014 at 4:15 PM, Joe Stringer <joestringer@nicira.com> wrote:
> On 13 November 2014 11:17, Joe Stringer <joestringer@nicira.com> wrote:
>> This function previously hid the 'is_mask' parameter from the callers,
>> which actually have better knowledge about whether it is serializing a
>> mask or not. Expose this parameter to the callers. This allows the same
>> function to be called to serialize masked keys as well as masked keys.
>>
>> To serialize an unmasked key:
>> ovs_nla_put_flow(key, key, skb, false);
>>
>> To serialize a masked key:
>> ovs_nla_put_flow(mask, key, skb, false);
>>
>> To serialize a mask:
>> ovs_nla_put_flow(key, mask, skb, true);
>
> I'll add helpers for each of these functions:
> ovs_nla_put_{un,}masked_key(), ovs_nla_put_mask() in the next version.
sounds good to me.
^ permalink raw reply
* Re: [PATCH] Add support of Cavium Liquidio ethernet adapters
From: Joe Perches @ 2014-11-21 18:28 UTC (permalink / raw)
To: Chickles, Derek
Cc: Jeff Kirsher, Vatsavayi, Raghu, David Miller, netdev,
Burla, Satananda, Manlunas, Felix
In-Reply-To: <cf26e72eac21446eb65fa1bb7463d5b0@BY2PR07MB486.namprd07.prod.outlook.com>
On Fri, 2014-11-21 at 17:55 +0000, Chickles, Derek wrote:
> We apologize for that. It looks like we were running an older version of
> checkpatch.pl that didn't include these checks. We'll get it fixed and
> send a new version of the patch.
[ plus nearly 1MB of unnecessary quoted stuff]
Please remember to strip out the unnecessary quoted
stuff from your replies too.
thanks.
^ permalink raw reply
* pull request: wireless-next 2014-11-21
From: John W. Linville @ 2014-11-21 18:30 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 34192 bytes --]
Dave,
Please pull this batch of updates intended for the 3.19 stream...
For the mac80211 bits, Johannes says:
"It has been a while since my last pull request, so we accumulated
another relatively large set of changes:
* TDLS off-channel support set from Arik/Liad, with some support
patches I did
* custom regulatory fixes from Arik
* minstrel VHT fix (and a small optimisation) from Felix
* add back radiotap vendor namespace support (myself)
* random MAC address scanning for cfg80211/mac80211/hwsim (myself)
* CSA improvements (Luca)
* WoWLAN Net Detect (wake on network found) support (Luca)
* and lots of other smaller changes from many people"
For the Bluetooth bits, Johan says:
"Here's another set of patches for 3.19. Most of it is again fixes and
cleanups to ieee802154 related code from Alexander Aring. We've also got
better handling of hardware error events along with a proper API for HCI
drivers to notify the HCI core of such situations. There's also a minor
fix for mgmt events as well as a sparse warning fix. The code for
sending HCI commands synchronously also gets a fix where we might loose
the completion event in the case of very fast HW (particularly easily
reproducible with an emulated HCI device)."
And...
"Here's another bluetooth-next pull request for 3.19. We've got:
- Various fixes, cleanups and improvements to ieee802154/mac802154
- Support for a Broadcom BCM20702A1 variant
- Lots of lockdep fixes
- Fixed handling of LE CoC errors that should trigger SMP"
For the Atheros bits, Kalle says:
"One ath6kl patch and rest for ath10k, but nothing really major which
stands out. Most notable:
o fix resume (Bartosz)
o firmware restart is now faster and more reliable (Michal)
o it's now possible to test hardware restart functionality without
crashing the firmware using hw-restart parameter with
simulate_fw_crash debugfs file (Michal)"
On top of that...both ath9k and mwifiex get their usual level of
updates. Of note is the ath9k spectral scan work from Oleksij Rempel.
I also pulled from the wireless tree in order to avoid some merge issues.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit bf515fb11ab539c76d04f0e3c5216ed41f41d81f:
Merge tag 'mac80211-next-for-john-2014-11-04' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next (2014-11-04 16:18:12 -0500)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git tags/master-2014-11-20
for you to fetch changes up to 9e6f3f472c8f95021ad048acc7cd3e40a827f8ce:
mwifiex: Add USB8766 support (2014-11-20 16:14:39 -0500)
----------------------------------------------------------------
Alexander Aring (90):
at86rf230: fix page parameter constraints
ieee802154: remove default channel settings
at86rf230: add default channel settings
cfg802154: introduce cfg802154_registered_device
mac802154: introduce mac802154_config_ops
ieee802154: add helper wpan_phy_to_rdev function
cfg802154: convert deprecated iface add and del
ieee802154: don't allow to change addr while netif_running
mac802154: add helper for converting dev_addr
mac802154: set extended address filter on ifup
mac802154: set short address filter on ifup
mac802154: set panid address filter on ifup
mac802154: move phy settings into netlink receive
ieee802154: add extended address validation helper
mac802154: iface: add validation for extended address
ieee802154: 6lowpan: remove set of mac address
ieee802154: add missing ULL definition
ieee802154: fix byteorder issues
mac802154: fix byteorder issues
ieee802154: sysfs: add missing include
mac802154: cfg: add missing include
ieee802154: remove unnecessary functions
netdevice: add ieee802154_ptr to net_device
ieee802154: rework wpan_phy index assignment
ieee802154: remove nl802154 unused functions
mac802154: move interface del handling in iface
mac802154: move interface add handling in iface
mac802154: move dev_hold out of ieee802154_if_add
ieee802154: rework interface registration
ieee802154: remove mlme get_phy callback
mac802154: add default interface registration
mac802154: add ieee802154_vif struct
ieee802154: add IEEE802154_EXTENDED_ADDR_LEN
ieee802154: add ieee802154_random_extended_addr
mac802154: add ieee802154_le64_to_be64
mac802154: cleanup ieee802154_netdev_to_extended_addr
mac802154: add support for perm_extended_addr
at86rf230: generate random perm extended address
at86rf230: add force slotted operation bit
mac802154: use IEEE802154_EXTENDED_ADDR_LEN
mac802154: fix typo promisuous to promiscuous
Bluetooth: 6lowpan: fix skb_unshare behaviour
mac802154: move mac pib attributes into wpan_dev
mac802154: remove mac_params in sdata
ieee802154: rename wpan_phy_alloc
ieee802154: add cfg802154_registered_device list
ieee802154: add iftype to wpan_dev
ieee802154: add wpan_dev_list
ieee802154: sysfs add wpan_phy index and name
ieee802154: add new nl802154 header
ieee802154: add nl802154 framework
ieee802154: add wpan_phy dump support
ieee802154: add wpan_dev dump support
mac820154: don't set monitor dev_addr
ieee802154: netlink add rtnl lock
ieee802154: fix iface dump with lowpan
mac802154: protect address changes via ioctl
mac820154: move interface unregistration into iface
mac820154: rename sdata next to tmp
mac820154: move mutex locks out of loop
mac802154: add wpan_phy priv id
mac802154: change module description
mac802154: add ifname change notifier
ieee802154: cleanup cfg802154 intendation
ieee820154: add channel set support
ieee820154: remove valid page and channel checks
ieee820154: add pan_id setting support
ieee820154: add short_addr setting support
ieee820154: add backoff exponent setting support
at86rf230: remove invalid backoff exponent check
ieee820154: add max csma backoffs setting support
at86rf230: remove invalid max csma backoffs check
ieee820154: add max frame retries setting support
at86rf230: remove invalid max frame retries check
ieee820154: add lbt setting support
mac802154: add interframe spacing time handling
at86rf230: remove interframe spacing time workaround
mac802154: remove unused prototypes
at86rf230: fix commentation for symbol duration
mac802154: remove const for non pointer in driver-ops
mac802154: remove const for non pointer in cfg ops
mac802154: remove const for non pointer in rdev-ops
mac802154: remove deprecated linux-zigbee info
mac802154: use new nl802154 iftype types
mac802154: remove wpan_dev parameter in if_add
ieee802154: add new interface command
ieee802154: setting extended address while iface add
ieee802154: add del interface command
ieee802154: rename and move WPAN_NUM_ defines
ieee802154: fix byteorder for short address and panid
Alexey Khoroshilov (1):
ath6kl: remove incorrect reset_resume handler
Amitkumar Karwar (2):
mwifiex: fix out of memory issue observed for USB chipsets
mwifiex: fix version display problem on big endian platforms
Arend van Spriel (1):
brcmfmac: fix conversion of channel width 20MHZ_NOHT
Arik Nemtsov (12):
cfg80211: introduce regulatory flags controlling bw
mac80211: add supported channels IE during TDLS setup
mac80211: add BSS coex IE to TDLS setup frames
cfg/mac80211: define TDLS channel switch feature bit
mac80211: track AP and peer STA TDLS chan-switch support
mac80211: prepare TDLS mgmt code for channel-switch templates
cfg80211: introduce TDLS channel switch commands
mac80211: add parsing of TDLS specific IEs
mac80211: introduce TDLS channel switch ops
mac80211: add TDLS channel-switch Rx flow
cfg80211: update missing fields in custom regulatory path
cfg80211: explicitly initialize some fields in custom reg path
Avinash Patil (11):
mwifiex: rx workqueue support for USB interface
mwifiex: remove data_complete handler
mwifiex: do not setup AMPDU/AMSDU with broadcast receiver
mwifiex: fix warning while starting BSS
mwifiex: module load parameter for interface creation
mwifiex: update rx packet descriptor structure to match FW
mwifiex: do not explicitly disable TDLS link during teardown
mwifiex: wmm support for TDLS link
mwifiex: add auto TDLS support
mwifiex: support for parsing TDLS discovery frames
mwifiex: enable auto TDLS support for SD8887
Bartosz Markowski (1):
ath10k: fix pm resume after suspend
Ben Greear (1):
ath9k: fix misc debugfs when not using chan context
Chan-yeol Park (1):
Bluetooth: Fix hci_sync missing wakeup interrupt
Chun-Yeow Yeoh (3):
ath9k: fix the assignment of hw queues for mesh interface
ath9k|ath9k_htc: Seperate the software crypto flag for Tx and Rx
ath9k_htc: Enable software crypto for mgmt frame in Tx for USB devices
Dan Carpenter (1):
ieee802154: || vs && in ieee802154_is_valid_extended_addr()
Eliad Peller (2):
mac80211: remove redundant check
mac80211: don't allow 40MHz tx rates in case of 20MHz chandef
Emmanuel Grumbach (1):
iwlwifi: mvm: abort scan upon RFKILL
Fabian Frederick (1):
Bluetooth: hidp: replace kzalloc/copy_from_user by memdup_user
Fabio K (1):
Bluetooth: Add support for Broadcom BCM20702A1 variant
Felix Fietkau (4):
ath10k: add SURVEY_INFO_IN_USE for current channel on survey
ath9k: add support for reporting tx power to mac80211
mac80211: skip legacy rate mask handling for VHT rates
mac80211: minstrel_ht: add a small optimization to minstrel_aggr_check
Fengguang Wu (1):
at86rf230: fix simple_return.cocci warnings
Fugang Duan (1):
Bluetooth: hci-uart-ath: Correct the comments in this driver
Hauke Mehrtens (3):
b43: fix NULL pointer dereference in b43_phy_copy()
bcma: make it possible to specify a IRQ num in bcma_core_irq()
bcma: get IRQ numbers from dt
Henning Rogge (1):
cfg80211: fix nl80211 cmd id in nl80211_send_mpath()
Jaganath Kanakkassery (1):
Bluetooth: Send mgmt_connected only if state is BT_CONFIG
James Cameron (1):
mwifiex: simplify ad hoc join capability info
Johan Hedberg (21):
Bluetooth: Fix sparse warnings in RFCOMM
Bluetooth: Fix sparse warning in amp.c
Bluetooth: Fix mgmt connected notification
Bluetooth: 6lowpan: Remove unnecessary RCU callback
Bluetooth: Fix l2cap_sock_teardown_cb lockdep warning
Bluetooth: Remove unnecessary hci_dev_lock/unlock in smp.c
Bluetooth: Use proper nesting annotation for l2cap_chan lock
Bluetooth: Fix L2CAP socket lock nesting level
Bluetooth: Fix L2CAP nesting level initialization location
Bluetooth: Fix correct nesting for 6lowpan server channel
Bluetooth: Fix sending incorrect LE CoC PDU in BT_CONNECT2 state
Bluetooth: Add key preference parameter to smp_sufficient_security
Bluetooth: Trigger SMP for the appropriate LE CoC errors
Bluetooth: Convert LTK list to RCU
Bluetooth: Convert IRK list to RCU
Bluetooth: Remove unnecessary hdev locking in smp.c
Bluetooth: Add debug logs to help track locking issues
Bluetooth: Fix clearing remote OOB data through mgmt
Bluetooth: Fix BR/EDR-only address checks for remote OOB data
Bluetooth: Use shorter "rand" name for "randomizer"
Bluetooth: Call drain_workqueue() before resetting state
Johannes Berg (12):
mac80211: add back support for radiotap vendor namespace data
mac80211: refactor duplicate detection
Merge remote-tracking branch 'wireless-next/master' into mac80211-next
mac80211: move skb info band assignment out
mac80211: factor out 802.11 header building code
mac80211: add function to create data frame template including key
cfg80211: allow drivers to support random MAC addresses for scan
mac80211: rcu-ify scan and scheduled scan request pointers
mac80211: allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR
mac80211_hwsim: support scanning with random MAC address
mac80211-hwsim: remove unnecessary hwname check
mac80211: notify drivers on sta rate table changes
John W. Linville (8):
Merge tag 'mac80211-for-john-2014-11-10' of git://git.kernel.org/.../jberg/mac80211
Merge tag 'iwlwifi-for-john-2014-11-10' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Merge branch 'for-upstream' of git://git.kernel.org/.../bluetooth/bluetooth-next
ath9k_htc: remove return of value in empty definintion of ath9k_htc_deinit_debug
Merge branch 'for-linville' of git://github.com/kvalo/ath
Merge branch 'for-upstream' of git://git.kernel.org/.../bluetooth/bluetooth-next
Merge commit '4e6ce4dc7ce71d0886908d55129d5d6482a27ff9' of git://git.kernel.org/.../linville/wireless
Merge tag 'mac80211-next-for-john-2014-11-20' of git://git.kernel.org/.../jberg/mac80211-next
Jukka Rissanen (2):
mac80211-hwsim: hwname is always known so use the value from wiphy
nl80211: Replace interface socket owner attribute with more generic one
Kristian Evensen (1):
mwifiex: Add USB8766 support
Kuba Pawlak (2):
Bluetooth: Clear role switch pending flag
Bluetooth: Sort switch cases by opcode's numeric value
Larry Finger (3):
rtlwifi: Fix setting of tx descriptor for new trx flow
rtlwifi: Fix errors in descriptor manipulation
rtlwifi: rtl8192se: Fix connection problems
Liad Kaufman (5):
iwlwifi: pcie: fix prph dump length
mac80211: add option for setting skb flags before xmit
mac80211: retransmit TDLS teardown packet through AP if not ACKed
mac80211: add specific-queue flushing support
mac80211: synchronously reserve TID per station
Luciano Coelho (9):
mac80211: fix order of setting ch_switch and drv_pre_channel_switch call
mac80211: add device_timestamp to the drv_pre_channel_switch trace
cfg80211: add channel switch started notification
mac80211: send channel switch started notifications
cfg80211/mac80211: allow any interface to send channel switch notifications
wlcore: check minimum buffer size in some cmd_send functions
wlcore: make wlcore_cmd_send_failsafe() static
cfg80211: refactor nl80211_start_sched_scan so it can be reused
cfg80211: add wowlan net-detect support
Marcel Holtmann (11):
Bluetooth: Check status of command complete for HCI_Reset
Bluetooth: Print error message for HCI_Hardware_Error event
Bluetooth: Use HCI_EV_HARDWARE_ERROR define for event payload
Bluetooth: Introduce BT_BREDR and BT_LE config options
Bluetooth: Add hci_reset_dev() for driver triggerd stack reset
Bluetooth: Switch HCI H5 driver to use hci_reset_dev() function
Bluetooth: Introduce HCI_QUIRK_STRICT_DUPLICATE_FILTER
Bluetooth: Set HCI_QUIRK_STRICT_DUPLICATE_FILTER for Broadcom devices
Bluetooth: Consolidate whitelist debugfs entry into device_list
Bluetooth: btusb: Add internal callback for USB bulk rx data
Bluetooth: Add hci_conn_lookup_type() helper function
Markus Elfring (1):
net: brcm80211: Deletion of unnecessary checks before two function calls
Martin Townsend (1):
6lowpan: move skb_free from error paths in decompression
Miaoqing Pan (2):
ath9k: Fix RTC_DERIVED_CLK usage
ath9k: Use new QCA953x initvals
Michal Kazior (20):
ath10k: don't drop control and null func Rx
ath10k: remove unused variable
ath10k: use ieee80211 defines for crypto param lengths
ath10k: fix rx buffer tracing
ath10k: deduplicate htt rx dma unmapping
ath10k: don't drop frames aggressively
ath10k: add extra sanity check when popping amsdu
ath10k: don't forget to replenish after fragmented Rx
ath10k: clear htt->rx_confused on load
ath10k: remove tsf argument from rx_desc tracing
ath10k: re-use trace class
ath10k: call correct function for frag threshold
ath10k: avoid possible deadlock with scan timeout
ath10k: change ce ring cleanup logic
ath10k: make warm reset a bit safer and faster
ath10k: split reset logic from power up
ath10k: don't reset chip on power_down
ath10k: fix possible bmi crash
ath10k: expose hw restart via debugfs
ath10k: speed up hw recovery
Oleksij Rempel (23):
ath9k: add struct ath_spec_scan_priv
ath9k: move spectral_mode to ath_spec_scan_priv
ath9k: move spec_config to ath_spec_scan_priv
ath9k: use struct dentry by ath9k_spectral_init_debug
ath9k: add ath_hw to ath_spec_scan_priv
ath9k: remove all struct ath_softc dependencies from spectral code
ath: add struct ath_ps_ops
ath9k: add ath_ps_ops bindings
ath9k: use ath_ps_ops in ath9k_spectral_scan_
ath9k: use ath_common instead of ieee80211_hw in ath9k_spectral_scan_
ath9k: make ath9k_spectral_scan_ do not depend on ath_softc
ath9k: move ath9k_spectral_scan_ from main.c to spectral.c
ath9k: move spectral.* to common-spectral.*
ath9k: For AR9271 chipsets, set count = 0 for endless samples.
ath9k_htc: fix rs_datalen conversation
ath9k_htc: add ath_ps_ops bindings
ath9k_htc: add struct ath_spec_scan_priv to ath9k_htc_priv
ath9k_htc: set initial spec_config values
ath9k_htc: trigger spectral scan on set_channel
ath9k_htc: process rx spectral packets
ath9k_htc: add spectral scan debug interface
ath9k: common-spectral: don't depend from ATH9K_DEBUGFS
ath9k_common: make sure DEBUG_FS and RELAY enabled
Patrik Flykt (2):
mac80211-hwsim: Factor out netlink attribute appending
mac80211-hwsim: Add HWSIM_CMD_GET_RADIO command
Peter Oh (1):
ath10k: fix mismatched wmi api call
Rafał Miłecki (1):
cfg80211: protect fools returning NULL in add_virtual_intf
Rajkumar Manoharan (3):
ath10k: handle ieee80211 header and payload tracing separately
ath10k: add modpram 'skip_otp' to ignore empty otp error during BMI
ath10k: advertise support for AP mode channel width changes
Ronald Wahl (1):
mac80211: Fix regression that triggers a kernel BUG with CCMP
Simon Vincent (1):
6lowpan: fix udp header compression when using raw sockets
Stanislaw Gruszka (1):
rt2x00: do not align payload on modern H/W
Sujith Manoharan (10):
ath9k: Update QCA953x initvals
ath9k: Fix LED configuration
ath9k: Enable TSF2 for generic HW timers
ath9k: Store the chip chainmask in HW capabilities
ath9k: Fix thermometer programming
ath9k: Clear offchannel state properly
ath9k: Cancel pending offchannel operations
ath9k: Handle failure to send NoA
ath9k: Adjust tbtt delta properly
ath9k: Move roc completion to the offchannel timer
Szymon Janc (1):
Bluetooth: Fix invalid response for 'Start Discovery' command
Tomasz Bursztyka (1):
nl80211: Broadcast CMD_NEW_INTERFACE and CMD_DEL_INTERFACE
kbuild test robot (2):
ath9k: ath9k_op_ps_wakeup() can be static
ath9k_htc: ath9k_htc_op_ps_wakeup() can be static
Documentation/devicetree/bindings/bus/bcma.txt | 21 +
drivers/bcma/driver_chipcommon.c | 2 +-
drivers/bcma/driver_gpio.c | 4 +-
drivers/bcma/driver_mips.c | 11 +-
drivers/bcma/driver_pci_host.c | 4 +-
drivers/bcma/host_pci.c | 5 +-
drivers/bcma/main.c | 74 +-
drivers/bluetooth/btusb.c | 9 +-
drivers/bluetooth/hci_ath.c | 2 +-
drivers/bluetooth/hci_h5.c | 13 +-
drivers/net/ieee802154/at86rf230.c | 91 +-
drivers/net/ieee802154/cc2520.c | 1 +
drivers/net/ieee802154/fakelb.c | 3 -
drivers/net/wireless/ath/ath.h | 12 +
drivers/net/wireless/ath/ath10k/ce.c | 9 +-
drivers/net/wireless/ath/ath10k/core.c | 30 +-
drivers/net/wireless/ath/ath10k/core.h | 5 +
drivers/net/wireless/ath/ath10k/debug.c | 7 +-
drivers/net/wireless/ath/ath10k/htt_rx.c | 99 +--
drivers/net/wireless/ath/ath10k/htt_tx.c | 4 +-
drivers/net/wireless/ath/ath10k/mac.c | 27 +-
drivers/net/wireless/ath/ath10k/mac.h | 1 +
drivers/net/wireless/ath/ath10k/pci.c | 364 ++++----
drivers/net/wireless/ath/ath10k/trace.h | 109 ++-
drivers/net/wireless/ath/ath10k/txrx.c | 3 +-
drivers/net/wireless/ath/ath10k/wmi.c | 16 +-
drivers/net/wireless/ath/ath5k/mac80211-ops.c | 6 +-
drivers/net/wireless/ath/ath6kl/usb.c | 9 -
drivers/net/wireless/ath/ath9k/Kconfig | 2 +
drivers/net/wireless/ath/ath9k/Makefile | 6 +-
drivers/net/wireless/ath/ath9k/ar9002_phy.c | 9 +-
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 9 +-
drivers/net/wireless/ath/ath9k/ar9003_hw.c | 51 +-
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 13 +
drivers/net/wireless/ath/ath9k/ar953x_initvals.h | 498 ++++++++++-
drivers/net/wireless/ath/ath9k/ath9k.h | 11 +-
drivers/net/wireless/ath/ath9k/channel.c | 23 +-
.../ath/ath9k/{spectral.c => common-spectral.c} | 165 +++-
.../ath/ath9k/{spectral.h => common-spectral.h} | 29 +-
drivers/net/wireless/ath/ath9k/common.c | 10 +-
drivers/net/wireless/ath/ath9k/common.h | 1 +
drivers/net/wireless/ath/ath9k/debug.c | 13 +-
drivers/net/wireless/ath/ath9k/gpio.c | 9 +-
drivers/net/wireless/ath/ath9k/htc.h | 5 +
drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 6 +
drivers/net/wireless/ath/ath9k/htc_drv_init.c | 25 +
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 13 +-
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 16 +-
drivers/net/wireless/ath/ath9k/hw.c | 68 +-
drivers/net/wireless/ath/ath9k/hw.h | 7 +-
drivers/net/wireless/ath/ath9k/init.c | 112 ++-
drivers/net/wireless/ath/ath9k/main.c | 174 ++--
drivers/net/wireless/ath/ath9k/pci.c | 4 +-
drivers/net/wireless/ath/ath9k/recv.c | 2 +-
drivers/net/wireless/ath/ath9k/reg.h | 3 +
drivers/net/wireless/ath/ath9k/xmit.c | 10 +-
drivers/net/wireless/ath/regd.c | 14 +
drivers/net/wireless/ath/wcn36xx/main.c | 7 +-
drivers/net/wireless/b43/main.c | 7 +-
drivers/net/wireless/b43/phy_common.c | 4 +-
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 6 +
drivers/net/wireless/brcm80211/brcmfmac/firmware.c | 3 +-
drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c | 3 +-
drivers/net/wireless/brcm80211/brcmfmac/sdio.c | 25 +-
.../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 7 +-
drivers/net/wireless/brcm80211/brcmsmac/main.c | 3 +-
drivers/net/wireless/cw1200/scan.c | 2 +-
drivers/net/wireless/iwlwifi/mvm/fw.c | 10 +-
drivers/net/wireless/iwlwifi/mvm/mac80211.c | 1 +
drivers/net/wireless/iwlwifi/mvm/mvm.h | 1 +
drivers/net/wireless/iwlwifi/mvm/ops.c | 12 +-
drivers/net/wireless/iwlwifi/mvm/scan.c | 20 +-
drivers/net/wireless/iwlwifi/pcie/trans.c | 7 +-
drivers/net/wireless/mac80211_hwsim.c | 283 +++++-
drivers/net/wireless/mac80211_hwsim.h | 3 +
drivers/net/wireless/mwifiex/11n.h | 4 +
drivers/net/wireless/mwifiex/11n_rxreorder.c | 52 +-
drivers/net/wireless/mwifiex/11n_rxreorder.h | 2 +
drivers/net/wireless/mwifiex/Kconfig | 2 +-
drivers/net/wireless/mwifiex/cfg80211.c | 6 +
drivers/net/wireless/mwifiex/decl.h | 5 +
drivers/net/wireless/mwifiex/fw.h | 1 +
drivers/net/wireless/mwifiex/init.c | 19 +-
drivers/net/wireless/mwifiex/join.c | 4 +-
drivers/net/wireless/mwifiex/main.c | 49 +-
drivers/net/wireless/mwifiex/main.h | 45 +-
drivers/net/wireless/mwifiex/sdio.c | 2 +
drivers/net/wireless/mwifiex/sdio.h | 7 +
drivers/net/wireless/mwifiex/sta_event.c | 9 +-
drivers/net/wireless/mwifiex/sta_ioctl.c | 4 +-
drivers/net/wireless/mwifiex/sta_rx.c | 3 +
drivers/net/wireless/mwifiex/tdls.c | 288 +++++++
drivers/net/wireless/mwifiex/txrx.c | 4 -
drivers/net/wireless/mwifiex/uap_cmd.c | 2 +-
drivers/net/wireless/mwifiex/usb.c | 51 +-
drivers/net/wireless/mwifiex/usb.h | 3 +
drivers/net/wireless/mwifiex/util.c | 38 +
drivers/net/wireless/mwl8k.c | 7 +-
drivers/net/wireless/rt2x00/rt2800usb.c | 1 +
drivers/net/wireless/rt2x00/rt2x00.h | 7 +-
drivers/net/wireless/rt2x00/rt2x00mac.c | 7 +-
drivers/net/wireless/rt2x00/rt2x00queue.c | 50 +-
drivers/net/wireless/rtlwifi/base.c | 2 +-
drivers/net/wireless/rtlwifi/core.c | 13 +-
drivers/net/wireless/rtlwifi/core.h | 1 +
drivers/net/wireless/rtlwifi/pci.c | 22 +-
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | 8 +-
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h | 4 +-
drivers/net/wireless/rtlwifi/rtl8192ce/def.h | 2 +
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 2 +-
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 3 +
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 17 +-
drivers/net/wireless/rtlwifi/rtl8192cu/hw.h | 1 -
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 7 +
drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192ee/hw.c | 8 +-
drivers/net/wireless/rtlwifi/rtl8192se/def.h | 2 +
drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 7 +-
drivers/net/wireless/rtlwifi/rtl8192se/phy.c | 2 +
drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 38 +-
drivers/net/wireless/rtlwifi/rtl8192se/trx.c | 3 +
drivers/net/wireless/rtlwifi/rtl8821ae/phy.c | 15 +-
drivers/net/wireless/rtlwifi/usb.c | 11 +
drivers/net/wireless/ti/wl1251/main.c | 2 +-
drivers/net/wireless/ti/wlcore/cmd.c | 15 +-
drivers/net/wireless/ti/wlcore/cmd.h | 2 -
drivers/staging/vt6656/main_usb.c | 7 +-
include/linux/bcma/bcma.h | 2 +
include/linux/bcma/bcma_driver_mips.h | 4 +-
include/linux/ieee80211.h | 49 ++
include/linux/ieee802154.h | 42 +
include/linux/netdevice.h | 3 +
include/net/bluetooth/hci.h | 27 +-
include/net/bluetooth/hci_core.h | 37 +-
include/net/bluetooth/l2cap.h | 15 +-
include/net/bluetooth/mgmt.h | 12 +-
include/net/cfg80211.h | 94 ++
include/net/cfg802154.h | 102 ++-
include/net/ieee802154_netdev.h | 12 -
include/net/mac80211.h | 149 +++-
include/net/mac802154.h | 36 +-
include/net/nl802154.h | 222 ++---
include/uapi/linux/nl80211.h | 108 ++-
net/6lowpan/iphc.c | 41 +-
net/bluetooth/6lowpan.c | 36 +-
net/bluetooth/Kconfig | 20 +-
net/bluetooth/amp.c | 25 +-
net/bluetooth/bnep/Kconfig | 2 +-
net/bluetooth/cmtp/Kconfig | 2 +-
net/bluetooth/hci_core.c | 184 ++--
net/bluetooth/hci_event.c | 91 +-
net/bluetooth/hidp/Kconfig | 2 +-
net/bluetooth/hidp/core.c | 10 +-
net/bluetooth/l2cap_core.c | 35 +-
net/bluetooth/l2cap_sock.c | 29 +-
net/bluetooth/mgmt.c | 108 ++-
net/bluetooth/rfcomm/Kconfig | 2 +-
net/bluetooth/rfcomm/core.c | 6 +-
net/bluetooth/smp.c | 61 +-
net/bluetooth/smp.h | 9 +-
net/ieee802154/6lowpan_rtnl.c | 38 +-
net/ieee802154/Makefile | 2 +-
net/ieee802154/core.c | 220 ++++-
net/ieee802154/core.h | 46 +
net/ieee802154/ieee802154.h | 2 +-
net/ieee802154/netlink.c | 2 +-
net/ieee802154/nl-mac.c | 226 +----
net/ieee802154/nl-phy.c | 23 +-
net/ieee802154/nl802154.c | 957 +++++++++++++++++++++
net/ieee802154/nl802154.h | 7 +
net/ieee802154/rdev-ops.h | 89 ++
net/ieee802154/sysfs.c | 40 +-
net/mac80211/aes_ccm.c | 3 +
net/mac80211/agg-tx.c | 7 +
net/mac80211/cfg.c | 27 +-
net/mac80211/debugfs_sta.c | 11 +-
net/mac80211/driver-ops.h | 83 +-
net/mac80211/ibss.c | 2 +-
net/mac80211/ieee80211_i.h | 45 +-
net/mac80211/iface.c | 20 +-
net/mac80211/main.c | 6 +
net/mac80211/mesh.c | 2 +-
net/mac80211/mlme.c | 33 +-
net/mac80211/rate.c | 5 +-
net/mac80211/rc80211_minstrel_ht.c | 6 +-
net/mac80211/rx.c | 160 +++-
net/mac80211/scan.c | 129 ++-
net/mac80211/spectmgmt.c | 18 +-
net/mac80211/sta_info.c | 15 +-
net/mac80211/sta_info.h | 11 +
net/mac80211/status.c | 55 +-
net/mac80211/tdls.c | 792 ++++++++++++++++-
net/mac80211/trace.h | 142 ++-
net/mac80211/tx.c | 303 +++++--
net/mac80211/util.c | 60 +-
net/mac80211/vht.c | 2 +
net/mac80211/wme.c | 39 +
net/mac802154/Makefile | 2 +-
net/mac802154/cfg.c | 210 +++++
net/mac802154/cfg.h | 9 +
net/mac802154/driver-ops.h | 46 +-
net/mac802154/ieee802154_i.h | 47 +-
net/mac802154/iface.c | 310 +++++--
net/mac802154/mac_cmd.c | 78 +-
net/mac802154/main.c | 150 ++--
net/mac802154/mib.c | 81 +-
net/mac802154/rx.c | 14 +-
net/mac802154/tx.c | 2 +-
net/mac802154/util.c | 35 +-
net/wireless/core.c | 4 +
net/wireless/core.h | 1 +
net/wireless/nl80211.c | 522 +++++++++--
net/wireless/rdev-ops.h | 24 +
net/wireless/reg.c | 49 +-
net/wireless/trace.h | 58 ++
216 files changed, 8045 insertions(+), 2323 deletions(-)
rename drivers/net/wireless/ath/ath9k/{spectral.c => common-spectral.c} (73%)
rename drivers/net/wireless/ath/ath9k/{spectral.h => common-spectral.h} (85%)
create mode 100644 net/ieee802154/core.h
create mode 100644 net/ieee802154/nl802154.c
create mode 100644 net/ieee802154/nl802154.h
create mode 100644 net/ieee802154/rdev-ops.h
create mode 100644 net/mac802154/cfg.c
create mode 100644 net/mac802154/cfg.h
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [patch net-next v4 8/9] net: move vlan pop/push functions into common code
From: Pravin Shelar @ 2014-11-21 18:41 UTC (permalink / raw)
To: Jiri Pirko, Jiri Benc
Cc: netdev, David Miller, Jamal Hadi Salim, Tom Herbert, Eric Dumazet,
Willem de Bruijn, Daniel Borkmann, mst, fw, Paul.Durrant,
Thomas Graf, Cong Wang
In-Reply-To: <20141121180553.GA2251@nanopsycho.orion>
On Fri, Nov 21, 2014 at 10:05 AM, Jiri Pirko <jiri@resnulli.us> wrote:
> Fri, Nov 21, 2014 at 05:11:39PM CET, pshelar@nicira.com wrote:
>>On Wed, Nov 19, 2014 at 5:05 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>>> So it can be used from out of openvswitch code.
>>> Did couple of cosmetic changes on the way, namely variable naming and
>>> adding support for 8021AD proto.
>>>
>>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>> ---
>>>
>>> v3->v4:
>>> - don't try to be smart and copy skb->mac_len manipulation as it is. It can be
>>> adjusted later on.
>>
>>I am fine with moving this code to generic library, as long as we can
>>adjust the mac_len as offset for MPLS header, otherwise this breaks
>>MPLS support.
>
> Pravin, I'm just moving the code without changing it in this aspect.
> Maybe I'm missing something but can you tell me what you see wrong?
> Thanks.
>
There is bug in the openvswitch code where vlan-pop does mac-length
reset rather than subtracting VLAN_HLEN from mac-len. MPLS code
depends on this. Now this patch moves the bug to common code. I am
fine with this patch and I can send fix to change code vlan-pop code
to adjust mac_len later on.
But I am worried about the comment made by Jiri Benc on earlier
version of this patch where is mentioned that subtracting VLAN_HLEN
can break common case for vlan-pop. In that case we can not change
this common function. Jiri Benc, Can you point me to the code, so the
we can work on solution to fix this issue.
>>
>>> - fix error path in do_execute_actions as suggested by Pravin
>>> v2->v3:
>>> - used previously introduced __vlan_insert_tag helper
>>> - used skb_push/pull to get skb->data into needed point
>>> - fixed skb->mac_len computation in skb_vlan_push pointed out by Pravin
>>> v1->v2:
>>> - adjusted to fix recent ovs changes
>>> - included change to use make_writable suggested by Eric
>>>
>>> include/linux/skbuff.h | 2 +
>>> net/core/skbuff.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++
>>> net/openvswitch/actions.c | 86 +++++-------------------------------------
>>> 3 files changed, 106 insertions(+), 77 deletions(-)
>>>
>>> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
>>> index e045516..78c299f 100644
>>> --- a/include/linux/skbuff.h
>>> +++ b/include/linux/skbuff.h
>>> @@ -2679,6 +2679,8 @@ unsigned int skb_gso_transport_seglen(const struct sk_buff *skb);
>>> struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
>>> struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
>>> int skb_ensure_writable(struct sk_buff *skb, int write_len);
>>> +int skb_vlan_pop(struct sk_buff *skb);
>>> +int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
>>>
>>> struct skb_checksum_ops {
>>> __wsum (*update)(const void *mem, int len, __wsum wsum);
>>> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
>>> index d11bbe0..c906c5f 100644
>>> --- a/net/core/skbuff.c
>>> +++ b/net/core/skbuff.c
>>> @@ -4163,6 +4163,101 @@ int skb_ensure_writable(struct sk_buff *skb, int write_len)
>>> }
>>> EXPORT_SYMBOL(skb_ensure_writable);
>>>
>>> +/* remove VLAN header from packet and update csum accordingly. */
>>> +static int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci)
>>> +{
>>> + struct vlan_hdr *vhdr;
>>> + unsigned int offset = skb->data - skb_mac_header(skb);
>>> + int err;
>>> +
>>> + __skb_push(skb, offset);
>>> + err = skb_ensure_writable(skb, VLAN_ETH_HLEN);
>>> + if (unlikely(err))
>>> + goto pull;
>>> +
>>> + skb_postpull_rcsum(skb, skb->data + (2 * ETH_ALEN), VLAN_HLEN);
>>> +
>>> + vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
>>> + *vlan_tci = ntohs(vhdr->h_vlan_TCI);
>>> +
>>> + memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);
>>> + __skb_pull(skb, VLAN_HLEN);
>>> +
>>> + vlan_set_encap_proto(skb, vhdr);
>>> + skb->mac_header += VLAN_HLEN;
>>> +
>>> + if (skb_network_offset(skb) < ETH_HLEN)
>>> + skb_set_network_header(skb, ETH_HLEN);
>>> +
>>> + skb_reset_mac_len(skb);
>>> +pull:
>>> + __skb_pull(skb, offset);
>>> +
>>> + return err;
>>> +}
>>> +
>>> +int skb_vlan_pop(struct sk_buff *skb)
>>> +{
>>> + u16 vlan_tci;
>>> + __be16 vlan_proto;
>>> + int err;
>>> +
>>> + if (likely(vlan_tx_tag_present(skb))) {
>>> + skb->vlan_tci = 0;
>>> + } else {
>>> + if (unlikely((skb->protocol != htons(ETH_P_8021Q) &&
>>> + skb->protocol != htons(ETH_P_8021AD)) ||
>>> + skb->len < VLAN_ETH_HLEN))
>>> + return 0;
>>> +
>>> + err = __skb_vlan_pop(skb, &vlan_tci);
>>> + if (err)
>>> + return err;
>>> + }
>>> + /* move next vlan tag to hw accel tag */
>>> + if (likely((skb->protocol != htons(ETH_P_8021Q) &&
>>> + skb->protocol != htons(ETH_P_8021AD)) ||
>>> + skb->len < VLAN_ETH_HLEN))
>>> + return 0;
>>> +
>>> + vlan_proto = skb->protocol;
>>> + err = __skb_vlan_pop(skb, &vlan_tci);
>>> + if (unlikely(err))
>>> + return err;
>>> +
>>> + __vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci);
>>> + return 0;
>>> +}
>>> +EXPORT_SYMBOL(skb_vlan_pop);
>>> +
>>> +int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)
>>> +{
>>> + if (vlan_tx_tag_present(skb)) {
>>> + unsigned int offset = skb->data - skb_mac_header(skb);
>>> + int err;
>>> +
>>> + /* __vlan_insert_tag expect skb->data pointing to mac header.
>>> + * So change skb->data before calling it and change back to
>>> + * original position later
>>> + */
>>> + __skb_push(skb, offset);
>>> + err = __vlan_insert_tag(skb, skb->vlan_proto,
>>> + vlan_tx_tag_get(skb));
>>> + if (err)
>>> + return err;
>>> + skb->protocol = skb->vlan_proto;
>>> + skb->mac_len += VLAN_HLEN;
>>> + __skb_pull(skb, offset);
>>> +
>>> + if (skb->ip_summed == CHECKSUM_COMPLETE)
>>> + skb->csum = csum_add(skb->csum, csum_partial(skb->data
>>> + + (2 * ETH_ALEN), VLAN_HLEN, 0));
>>> + }
>>> + __vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci);
>>> + return 0;
>>> +}
>>> +EXPORT_SYMBOL(skb_vlan_push);
>>> +
>>> /**
>>> * alloc_skb_with_frags - allocate skb with page frags
>>> *
>>> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
>>> index 7ffa377..4e05ea1 100644
>>> --- a/net/openvswitch/actions.c
>>> +++ b/net/openvswitch/actions.c
>>> @@ -206,93 +206,27 @@ static int set_mpls(struct sk_buff *skb, struct sw_flow_key *key,
>>> return 0;
>>> }
>>>
>>> -/* remove VLAN header from packet and update csum accordingly. */
>>> -static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci)
>>> -{
>>> - struct vlan_hdr *vhdr;
>>> - int err;
>>> -
>>> - err = skb_ensure_writable(skb, VLAN_ETH_HLEN);
>>> - if (unlikely(err))
>>> - return err;
>>> -
>>> - skb_postpull_rcsum(skb, skb->data + (2 * ETH_ALEN), VLAN_HLEN);
>>> -
>>> - vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
>>> - *current_tci = vhdr->h_vlan_TCI;
>>> -
>>> - memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);
>>> - __skb_pull(skb, VLAN_HLEN);
>>> -
>>> - vlan_set_encap_proto(skb, vhdr);
>>> - skb->mac_header += VLAN_HLEN;
>>> -
>>> - if (skb_network_offset(skb) < ETH_HLEN)
>>> - skb_set_network_header(skb, ETH_HLEN);
>>> -
>>> - /* Update mac_len for subsequent MPLS actions */
>>> - skb_reset_mac_len(skb);
>>> - return 0;
>>> -}
>>> -
>>> static int pop_vlan(struct sk_buff *skb, struct sw_flow_key *key)
>>> {
>>> - __be16 tci;
>>> int err;
>>>
>>> - if (likely(vlan_tx_tag_present(skb))) {
>>> - skb->vlan_tci = 0;
>>> - } else {
>>> - if (unlikely(skb->protocol != htons(ETH_P_8021Q) ||
>>> - skb->len < VLAN_ETH_HLEN))
>>> - return 0;
>>> -
>>> - err = __pop_vlan_tci(skb, &tci);
>>> - if (err)
>>> - return err;
>>> - }
>>> - /* move next vlan tag to hw accel tag */
>>> - if (likely(skb->protocol != htons(ETH_P_8021Q) ||
>>> - skb->len < VLAN_ETH_HLEN)) {
>>> + err = skb_vlan_pop(skb);
>>> + if (vlan_tx_tag_present(skb))
>>> + invalidate_flow_key(key);
>>> + else
>>> key->eth.tci = 0;
>>> - return 0;
>>> - }
>>> -
>>> - invalidate_flow_key(key);
>>> - err = __pop_vlan_tci(skb, &tci);
>>> - if (unlikely(err))
>>> - return err;
>>> -
>>> - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(tci));
>>> - return 0;
>>> + return err;
>>> }
>>>
>>> static int push_vlan(struct sk_buff *skb, struct sw_flow_key *key,
>>> const struct ovs_action_push_vlan *vlan)
>>> {
>>> - if (unlikely(vlan_tx_tag_present(skb))) {
>>> - u16 current_tag;
>>> -
>>> - /* push down current VLAN tag */
>>> - current_tag = vlan_tx_tag_get(skb);
>>> -
>>> - skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
>>> - current_tag);
>>> - if (!skb)
>>> - return -ENOMEM;
>>> - /* Update mac_len for subsequent MPLS actions */
>>> - skb->mac_len += VLAN_HLEN;
>>> -
>>> - if (skb->ip_summed == CHECKSUM_COMPLETE)
>>> - skb->csum = csum_add(skb->csum, csum_partial(skb->data
>>> - + (2 * ETH_ALEN), VLAN_HLEN, 0));
>>> -
>>> + if (vlan_tx_tag_present(skb))
>>> invalidate_flow_key(key);
>>> - } else {
>>> + else
>>> key->eth.tci = vlan->vlan_tci;
>>> - }
>>> - __vlan_hwaccel_put_tag(skb, vlan->vlan_tpid, ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT);
>>> - return 0;
>>> + return skb_vlan_push(skb, vlan->vlan_tpid,
>>> + ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT);
>>> }
>>>
>>> static int set_eth_addr(struct sk_buff *skb, struct sw_flow_key *key,
>>> @@ -858,8 +792,6 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
>>>
>>> case OVS_ACTION_ATTR_PUSH_VLAN:
>>> err = push_vlan(skb, key, nla_data(a));
>>> - if (unlikely(err)) /* skb already freed. */
>>> - return err;
>>> break;
>>>
>>> case OVS_ACTION_ATTR_POP_VLAN:
>>> --
>>> 1.9.3
>>>
^ permalink raw reply
* Re: [PATCH v2 net 1/2] drivers/net: Disable UFO through virtio
From: Ben Hutchings @ 2014-11-21 18:46 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: netdev, Hannes Frederic Sowa, virtualization
In-Reply-To: <20141119091455.GA26036@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1911 bytes --]
On Wed, 2014-11-19 at 11:14 +0200, Michael S. Tsirkin wrote:
> On Thu, Oct 30, 2014 at 06:27:12PM +0000, Ben Hutchings wrote:
> > IPv6 does not allow fragmentation by routers, so there is no
> > fragmentation ID in the fixed header. UFO for IPv6 requires the ID to
> > be passed separately, but there is no provision for this in the virtio
> > net protocol.
> >
> > Until recently our software implementation of UFO/IPv6 generated a new
> > ID, but this was a bug. Now we will use ID=0 for any UFO/IPv6 packet
> > passed through a tap, which is even worse.
> >
> > Unfortunately there is no distinction between UFO/IPv4 and v6
> > features, so disable UFO on taps and virtio_net completely until we
> > have a proper solution.
> >
> > We cannot depend on VM managers respecting the tap feature flags, so
> > keep accepting UFO packets but log a warning the first time we do
> > this.
> >
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > Fixes: 916e4cf46d02 ("ipv6: reuse ip6_frag_id from ip6_ufo_append_data")
>
>
> There's something I don't understand here. I see:
>
> NETIF_F_UFO_BIT, /* ... UDPv4 fragmentation */
>
> this comment is wrong then?
Yes.
> The patches drastically regress performance for UDPv4 for VMs only, but
> isn't it likely many other devices based their code on this comment?
There's only one hardware driver that implements UFO (s2io), and it does
handle IPv6.
> How about we disable UFO for IPv6 globally, and put the
> flag back in?
> We can then gradually add NETIF_F_UFO6_BIT for devices that
> actually support UFO for IPv6.
Since the corresponding virtio feature bit is understood to include
UFO/IPv6, and existing VMs rely on that, I don't see what this solves.
Ben.
--
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Re: [PATCH 1/2] 8139too: Allow setting MTU larger than 1500
From: Ben Hutchings @ 2014-11-21 18:51 UTC (permalink / raw)
To: Alban
Cc: linux-kernel, netdev, Bjorn Helgaas, Benoit Taine,
Eric W. Biederman, David S. Miller
In-Reply-To: <20141121145853.1be898de@tock>
[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]
On Fri, 2014-11-21 at 14:58 +0100, Alban wrote:
> On Fri, 21 Nov 2014 00:34:34 +0000
> Ben Hutchings <ben@decadent.org.uk> wrote:
>
> > On Sat, 2014-11-08 at 12:48 +0100, Alban Bedel wrote:
> > > Replace the default ndo_change_mtu callback with one that allow
> > > setting MTU that the driver can handle.
> > >
> > > Signed-off-by: Alban Bedel <albeu@free.fr>
> > > ---
> > > drivers/net/ethernet/realtek/8139too.c | 13 ++++++++++++-
> > > 1 file changed, 12 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/ethernet/realtek/8139too.c
> > > b/drivers/net/ethernet/realtek/8139too.c index 007b38c..8387de9
> > > 100644 --- a/drivers/net/ethernet/realtek/8139too.c
> > > +++ b/drivers/net/ethernet/realtek/8139too.c
> > > @@ -185,6 +185,9 @@ static int debug = -1;
> > > /* max supported ethernet frame size -- must be at least
> > > (dev->mtu+14+4).*/ #define MAX_ETH_FRAME_SIZE 1536
> > >
> > > +/* max supported payload size */
> > > +#define MAX_ETH_DATA_SIZE (MAX_ETH_FRAME_SIZE - ETH_HLEN -
> > > ETH_FCS_LEN)
> > [...]
> >
> > Does this maximum still allow for VLAN tags, or should it use
> > VLAN_ETH_HLEN instead of ETH_HLEN?
>
> That might well be as the VLAN code seems to assume that the physical
> device can handle frames of MTU + VLAN_HLEN bytes. I can fix it, but to
> me it seems like the VLAN code should be fixed to respect the physical
> device MTU.
Drivers that support VLANs have to allow for at least one VLAN tag when
validating the MTU. This is obviously broken for multiple layers of
VLAN tags, but those are the semantics we're stuck with.
Ben.
--
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply
* Re: [PATCH] bonding: clear header_ops when last slave detached (v2)
From: Jay Vosburgh @ 2014-11-21 18:54 UTC (permalink / raw)
To: Cong Wang; +Cc: Eric Dumazet, Wengang, netdev
In-Reply-To: <CAHA+R7Pnn4TxRQcR4KBRrZV8mqsm-YznMMvXVasji07caY9b1g@mail.gmail.com>
Cong Wang <cwang@twopensource.com> wrote:
>On Thu, Nov 20, 2014 at 2:53 PM, Jay Vosburgh
><jay.vosburgh@canonical.com> wrote:
>> Cong Wang <cwang@twopensource.com> wrote:
>>
>>>Also, no one seems to care about my previous question:
>>>why only bonding has the problem?
>>
>> Bonding has the problem because it stashes a pointer to a data
>> structure (the header_ops) from another module, and when that module is
>> unloaded the dangling pointer may be dereferenced if it's not either
>> cleared or made to never go away.
>
>I knew, please re-read my question, I was asking why ONLY bonding
>has the problem, i.e. why not neigh or whatever else calling
>header_ops->foo()? :)
>
>As I said, I may miss some try_get_module() somewhere of course.
>Needs more digging.
My explanation is why only bonding has the problem; it's keeping
a pointer (in bond_dev->header_ops) that is copied from the slave
device's ->header_ops, and clearing that stashed pointer is (a) not
correctly synchronized with the removal of the slave device, and (b)
trying to simply clear the pointer has a check then use race in
dev_hard_header.
8021q, for example, uses a "passthru" header_ops to call the
underlying device's header_ops, but 8021q is only for ethernet, and the
eth_header_ops are static in vmlinux, so it won't see these problems.
Actually, now that I think about it, when the last ipoib slave
is released, the bonding master device is theoretically supposed to be
removed to avoid the sort of problem we're discussing here.
That apparently isn't happening, unless Wengang is running
pktgen and simultaneously removing the ipoib module (racing the transmit
against the removal), or maybe something else is going on (perhaps
pktgen holds a reference to the bonding master, preventing its removal).
Also, curiously, looking at pkgten, pktgen_setup_dev appears to
only accept devices of type ARPHRD_ETHER, but bonding with an ipoib
slave would be ARPHRD_INFINIBAND. I'm therefore not sure how Wengang
configured pktgen over an ipoib bond.
Wengang, what kernel are you using, and is your kernel modified
to change pktgen_setup_dev?
-J
---
-Jay Vosburgh, jay.vosburgh@canonical.com
^ permalink raw reply
* Re: [PATCH] bonding: clear header_ops when last slave detached (v2)
From: David Miller @ 2014-11-21 18:55 UTC (permalink / raw)
To: cwang; +Cc: jay.vosburgh, eric.dumazet, wen.gang.wang, netdev
In-Reply-To: <CAHA+R7Pnn4TxRQcR4KBRrZV8mqsm-YznMMvXVasji07caY9b1g@mail.gmail.com>
From: Cong Wang <cwang@twopensource.com>
Date: Fri, 21 Nov 2014 10:17:12 -0800
> On Thu, Nov 20, 2014 at 2:53 PM, Jay Vosburgh
> <jay.vosburgh@canonical.com> wrote:
>> Cong Wang <cwang@twopensource.com> wrote:
>>
>>>Also, no one seems to care about my previous question:
>>>why only bonding has the problem?
>>
>> Bonding has the problem because it stashes a pointer to a data
>> structure (the header_ops) from another module, and when that module is
>> unloaded the dangling pointer may be dereferenced if it's not either
>> cleared or made to never go away.
>
> I knew, please re-read my question, I was asking why ONLY bonding
> has the problem, i.e. why not neigh or whatever else calling
> header_ops->foo()? :)
They are either static only (ipv4) or cannot be unloaded as a module
after being loaded (ipv6).
^ permalink raw reply
* Re: [PATCH] tcp: Restore RFC5961-compliant behavior for SYN packets
From: Neal Cardwell @ 2014-11-21 18:55 UTC (permalink / raw)
To: Calvin Owens
Cc: David S. Miller, Alexey Kuznetsov, James Morris, Eric Dumazet,
kernel-team, Netdev, LKML
In-Reply-To: <1416524993-26228-1-git-send-email-calvinowens@fb.com>
On Thu, Nov 20, 2014 at 6:09 PM, Calvin Owens <calvinowens@fb.com> wrote:
> Commit c3ae62af8e755 ("tcp: should drop incoming frames without ACK
> flag set") was created to mitigate a security vulnerability in which a
> local attacker is able to inject data into locally-opened sockets by
> using TCP protocol statistics in procfs to quickly find the correct
> sequence number.
>
> This broke the RFC5961 requirement to send a challenge ACK in response
> to spurious RST packets, which was subsequently fixed by commit
> 7b514a886ba50 ("tcp: accept RST without ACK flag").
>
> Unfortunately, the RFC5961 requirement that spurious SYN packets be
> handled in a similar manner remains broken.
>
> RFC5961 section 4 states that:
>
> ... the handling of the SYN in the synchronized state SHOULD be
> performed as follows:
>
> 1) If the SYN bit is set, irrespective of the sequence number, TCP
> MUST send an ACK (also referred to as challenge ACK) to the remote
> peer:
>
> <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
>
> After sending the acknowledgment, TCP MUST drop the unacceptable
> segment and stop processing further.
>
> By sending an ACK, the remote peer is challenged to confirm the loss
> of the previous connection and the request to start a new connection.
> A legitimate peer, after restart, would not have a TCB in the
> synchronized state. Thus, when the ACK arrives, the peer should send
> a RST segment back with the sequence number derived from the ACK
> field that caused the RST.
>
> This RST will confirm that the remote peer has indeed closed the
> previous connection. Upon receipt of a valid RST, the local TCP
> endpoint MUST terminate its connection. The local TCP endpoint
> should then rely on SYN retransmission from the remote end to
> re-establish the connection.
>
> This patch lets SYN packets through the discard added in c3ae62af8e755,
> so that spurious SYN packets are properly dealt with as per the RFC.
>
> The challenge ACK is sent unconditionally and is rate-limited, so the
> original vulnerability is not reintroduced by this patch.
>
> Signed-off-by: Calvin Owens <calvinowens@fb.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
neal
^ permalink raw reply
* Re: [PATCH 1/2] 8139too: Allow setting MTU larger than 1500
From: Alban @ 2014-11-21 18:57 UTC (permalink / raw)
To: Ben Hutchings
Cc: Aban Bedel, linux-kernel, netdev, Bjorn Helgaas, Benoit Taine,
Eric W. Biederman, David S. Miller
In-Reply-To: <1416595911.7215.23.camel@decadent.org.uk>
On Fri, 21 Nov 2014 18:51:51 +0000
Ben Hutchings <ben@decadent.org.uk> wrote:
> On Fri, 2014-11-21 at 14:58 +0100, Alban wrote:
> > On Fri, 21 Nov 2014 00:34:34 +0000
> > Ben Hutchings <ben@decadent.org.uk> wrote:
> >
> > > On Sat, 2014-11-08 at 12:48 +0100, Alban Bedel wrote:
> > > > Replace the default ndo_change_mtu callback with one that allow
> > > > setting MTU that the driver can handle.
> > > >
> > > > Signed-off-by: Alban Bedel <albeu@free.fr>
> > > > ---
> > > > drivers/net/ethernet/realtek/8139too.c | 13 ++++++++++++-
> > > > 1 file changed, 12 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/net/ethernet/realtek/8139too.c
> > > > b/drivers/net/ethernet/realtek/8139too.c index 007b38c..8387de9
> > > > 100644 --- a/drivers/net/ethernet/realtek/8139too.c
> > > > +++ b/drivers/net/ethernet/realtek/8139too.c
> > > > @@ -185,6 +185,9 @@ static int debug = -1;
> > > > /* max supported ethernet frame size -- must be at least
> > > > (dev->mtu+14+4).*/ #define MAX_ETH_FRAME_SIZE 1536
> > > >
> > > > +/* max supported payload size */
> > > > +#define MAX_ETH_DATA_SIZE (MAX_ETH_FRAME_SIZE -
> > > > ETH_HLEN - ETH_FCS_LEN)
> > > [...]
> > >
> > > Does this maximum still allow for VLAN tags, or should it use
> > > VLAN_ETH_HLEN instead of ETH_HLEN?
> >
> > That might well be as the VLAN code seems to assume that the
> > physical device can handle frames of MTU + VLAN_HLEN bytes. I can
> > fix it, but to me it seems like the VLAN code should be fixed to
> > respect the physical device MTU.
>
> Drivers that support VLANs have to allow for at least one VLAN tag
> when validating the MTU. This is obviously broken for multiple
> layers of VLAN tags, but those are the semantics we're stuck with.
Ok, I see. Should a I send a fix patch or redo a new version of this
patch?
Alban
^ permalink raw reply
* Re: pull request: wireless-next 2014-11-21
From: Larry Finger @ 2014-11-21 19:06 UTC (permalink / raw)
To: John W. Linville, davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20141121183014.GA24984-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
On 11/21/2014 12:30 PM, John W. Linville wrote:
> Dave,
>
> Please pull this batch of updates intended for the 3.19 stream...
>
---snip---
> Larry Finger (3):
> rtlwifi: Fix setting of tx descriptor for new trx flow
> rtlwifi: Fix errors in descriptor manipulation
> rtlwifi: rtl8192se: Fix connection problems
I probably do not understand the update process, but the above 3 patches need to
be in kernel 3.18, not 3.19.
Thanks,
Larry
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [patch net-next v4 8/9] net: move vlan pop/push functions into common code
From: Jiri Pirko @ 2014-11-21 19:08 UTC (permalink / raw)
To: Pravin Shelar
Cc: Jiri Benc, netdev, David Miller, Jamal Hadi Salim, Tom Herbert,
Eric Dumazet, Willem de Bruijn, Daniel Borkmann, mst, fw,
Paul.Durrant, Thomas Graf, Cong Wang
In-Reply-To: <CALnjE+p3PtaOz7Ujp7KDK0-=giP-kzEDDDvw8=GCjJdcECYJEA@mail.gmail.com>
Fri, Nov 21, 2014 at 07:41:27PM CET, pshelar@nicira.com wrote:
>On Fri, Nov 21, 2014 at 10:05 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>> Fri, Nov 21, 2014 at 05:11:39PM CET, pshelar@nicira.com wrote:
>>>On Wed, Nov 19, 2014 at 5:05 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>>>> So it can be used from out of openvswitch code.
>>>> Did couple of cosmetic changes on the way, namely variable naming and
>>>> adding support for 8021AD proto.
>>>>
>>>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>>> ---
>>>>
>>>> v3->v4:
>>>> - don't try to be smart and copy skb->mac_len manipulation as it is. It can be
>>>> adjusted later on.
>>>
>>>I am fine with moving this code to generic library, as long as we can
>>>adjust the mac_len as offset for MPLS header, otherwise this breaks
>>>MPLS support.
>>
>> Pravin, I'm just moving the code without changing it in this aspect.
>> Maybe I'm missing something but can you tell me what you see wrong?
>> Thanks.
>>
>
>There is bug in the openvswitch code where vlan-pop does mac-length
>reset rather than subtracting VLAN_HLEN from mac-len. MPLS code
>depends on this. Now this patch moves the bug to common code. I am
>fine with this patch and I can send fix to change code vlan-pop code
>to adjust mac_len later on.
>But I am worried about the comment made by Jiri Benc on earlier
>version of this patch where is mentioned that subtracting VLAN_HLEN
>can break common case for vlan-pop. In that case we can not change
>this common function. Jiri Benc, Can you point me to the code, so the
>we can work on solution to fix this issue.
Lets move to common code and fix this there with follow-up patches.
This common code should work for all users.
>
>>>
>>>> - fix error path in do_execute_actions as suggested by Pravin
>>>> v2->v3:
>>>> - used previously introduced __vlan_insert_tag helper
>>>> - used skb_push/pull to get skb->data into needed point
>>>> - fixed skb->mac_len computation in skb_vlan_push pointed out by Pravin
>>>> v1->v2:
>>>> - adjusted to fix recent ovs changes
>>>> - included change to use make_writable suggested by Eric
>>>>
>>>> include/linux/skbuff.h | 2 +
>>>> net/core/skbuff.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++
>>>> net/openvswitch/actions.c | 86 +++++-------------------------------------
>>>> 3 files changed, 106 insertions(+), 77 deletions(-)
>>>>
>>>> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
>>>> index e045516..78c299f 100644
>>>> --- a/include/linux/skbuff.h
>>>> +++ b/include/linux/skbuff.h
>>>> @@ -2679,6 +2679,8 @@ unsigned int skb_gso_transport_seglen(const struct sk_buff *skb);
>>>> struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
>>>> struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
>>>> int skb_ensure_writable(struct sk_buff *skb, int write_len);
>>>> +int skb_vlan_pop(struct sk_buff *skb);
>>>> +int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
>>>>
>>>> struct skb_checksum_ops {
>>>> __wsum (*update)(const void *mem, int len, __wsum wsum);
>>>> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
>>>> index d11bbe0..c906c5f 100644
>>>> --- a/net/core/skbuff.c
>>>> +++ b/net/core/skbuff.c
>>>> @@ -4163,6 +4163,101 @@ int skb_ensure_writable(struct sk_buff *skb, int write_len)
>>>> }
>>>> EXPORT_SYMBOL(skb_ensure_writable);
>>>>
>>>> +/* remove VLAN header from packet and update csum accordingly. */
>>>> +static int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci)
>>>> +{
>>>> + struct vlan_hdr *vhdr;
>>>> + unsigned int offset = skb->data - skb_mac_header(skb);
>>>> + int err;
>>>> +
>>>> + __skb_push(skb, offset);
>>>> + err = skb_ensure_writable(skb, VLAN_ETH_HLEN);
>>>> + if (unlikely(err))
>>>> + goto pull;
>>>> +
>>>> + skb_postpull_rcsum(skb, skb->data + (2 * ETH_ALEN), VLAN_HLEN);
>>>> +
>>>> + vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
>>>> + *vlan_tci = ntohs(vhdr->h_vlan_TCI);
>>>> +
>>>> + memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);
>>>> + __skb_pull(skb, VLAN_HLEN);
>>>> +
>>>> + vlan_set_encap_proto(skb, vhdr);
>>>> + skb->mac_header += VLAN_HLEN;
>>>> +
>>>> + if (skb_network_offset(skb) < ETH_HLEN)
>>>> + skb_set_network_header(skb, ETH_HLEN);
>>>> +
>>>> + skb_reset_mac_len(skb);
>>>> +pull:
>>>> + __skb_pull(skb, offset);
>>>> +
>>>> + return err;
>>>> +}
>>>> +
>>>> +int skb_vlan_pop(struct sk_buff *skb)
>>>> +{
>>>> + u16 vlan_tci;
>>>> + __be16 vlan_proto;
>>>> + int err;
>>>> +
>>>> + if (likely(vlan_tx_tag_present(skb))) {
>>>> + skb->vlan_tci = 0;
>>>> + } else {
>>>> + if (unlikely((skb->protocol != htons(ETH_P_8021Q) &&
>>>> + skb->protocol != htons(ETH_P_8021AD)) ||
>>>> + skb->len < VLAN_ETH_HLEN))
>>>> + return 0;
>>>> +
>>>> + err = __skb_vlan_pop(skb, &vlan_tci);
>>>> + if (err)
>>>> + return err;
>>>> + }
>>>> + /* move next vlan tag to hw accel tag */
>>>> + if (likely((skb->protocol != htons(ETH_P_8021Q) &&
>>>> + skb->protocol != htons(ETH_P_8021AD)) ||
>>>> + skb->len < VLAN_ETH_HLEN))
>>>> + return 0;
>>>> +
>>>> + vlan_proto = skb->protocol;
>>>> + err = __skb_vlan_pop(skb, &vlan_tci);
>>>> + if (unlikely(err))
>>>> + return err;
>>>> +
>>>> + __vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci);
>>>> + return 0;
>>>> +}
>>>> +EXPORT_SYMBOL(skb_vlan_pop);
>>>> +
>>>> +int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)
>>>> +{
>>>> + if (vlan_tx_tag_present(skb)) {
>>>> + unsigned int offset = skb->data - skb_mac_header(skb);
>>>> + int err;
>>>> +
>>>> + /* __vlan_insert_tag expect skb->data pointing to mac header.
>>>> + * So change skb->data before calling it and change back to
>>>> + * original position later
>>>> + */
>>>> + __skb_push(skb, offset);
>>>> + err = __vlan_insert_tag(skb, skb->vlan_proto,
>>>> + vlan_tx_tag_get(skb));
>>>> + if (err)
>>>> + return err;
>>>> + skb->protocol = skb->vlan_proto;
>>>> + skb->mac_len += VLAN_HLEN;
>>>> + __skb_pull(skb, offset);
>>>> +
>>>> + if (skb->ip_summed == CHECKSUM_COMPLETE)
>>>> + skb->csum = csum_add(skb->csum, csum_partial(skb->data
>>>> + + (2 * ETH_ALEN), VLAN_HLEN, 0));
>>>> + }
>>>> + __vlan_hwaccel_put_tag(skb, vlan_proto, vlan_tci);
>>>> + return 0;
>>>> +}
>>>> +EXPORT_SYMBOL(skb_vlan_push);
>>>> +
>>>> /**
>>>> * alloc_skb_with_frags - allocate skb with page frags
>>>> *
>>>> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
>>>> index 7ffa377..4e05ea1 100644
>>>> --- a/net/openvswitch/actions.c
>>>> +++ b/net/openvswitch/actions.c
>>>> @@ -206,93 +206,27 @@ static int set_mpls(struct sk_buff *skb, struct sw_flow_key *key,
>>>> return 0;
>>>> }
>>>>
>>>> -/* remove VLAN header from packet and update csum accordingly. */
>>>> -static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci)
>>>> -{
>>>> - struct vlan_hdr *vhdr;
>>>> - int err;
>>>> -
>>>> - err = skb_ensure_writable(skb, VLAN_ETH_HLEN);
>>>> - if (unlikely(err))
>>>> - return err;
>>>> -
>>>> - skb_postpull_rcsum(skb, skb->data + (2 * ETH_ALEN), VLAN_HLEN);
>>>> -
>>>> - vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
>>>> - *current_tci = vhdr->h_vlan_TCI;
>>>> -
>>>> - memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);
>>>> - __skb_pull(skb, VLAN_HLEN);
>>>> -
>>>> - vlan_set_encap_proto(skb, vhdr);
>>>> - skb->mac_header += VLAN_HLEN;
>>>> -
>>>> - if (skb_network_offset(skb) < ETH_HLEN)
>>>> - skb_set_network_header(skb, ETH_HLEN);
>>>> -
>>>> - /* Update mac_len for subsequent MPLS actions */
>>>> - skb_reset_mac_len(skb);
>>>> - return 0;
>>>> -}
>>>> -
>>>> static int pop_vlan(struct sk_buff *skb, struct sw_flow_key *key)
>>>> {
>>>> - __be16 tci;
>>>> int err;
>>>>
>>>> - if (likely(vlan_tx_tag_present(skb))) {
>>>> - skb->vlan_tci = 0;
>>>> - } else {
>>>> - if (unlikely(skb->protocol != htons(ETH_P_8021Q) ||
>>>> - skb->len < VLAN_ETH_HLEN))
>>>> - return 0;
>>>> -
>>>> - err = __pop_vlan_tci(skb, &tci);
>>>> - if (err)
>>>> - return err;
>>>> - }
>>>> - /* move next vlan tag to hw accel tag */
>>>> - if (likely(skb->protocol != htons(ETH_P_8021Q) ||
>>>> - skb->len < VLAN_ETH_HLEN)) {
>>>> + err = skb_vlan_pop(skb);
>>>> + if (vlan_tx_tag_present(skb))
>>>> + invalidate_flow_key(key);
>>>> + else
>>>> key->eth.tci = 0;
>>>> - return 0;
>>>> - }
>>>> -
>>>> - invalidate_flow_key(key);
>>>> - err = __pop_vlan_tci(skb, &tci);
>>>> - if (unlikely(err))
>>>> - return err;
>>>> -
>>>> - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(tci));
>>>> - return 0;
>>>> + return err;
>>>> }
>>>>
>>>> static int push_vlan(struct sk_buff *skb, struct sw_flow_key *key,
>>>> const struct ovs_action_push_vlan *vlan)
>>>> {
>>>> - if (unlikely(vlan_tx_tag_present(skb))) {
>>>> - u16 current_tag;
>>>> -
>>>> - /* push down current VLAN tag */
>>>> - current_tag = vlan_tx_tag_get(skb);
>>>> -
>>>> - skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
>>>> - current_tag);
>>>> - if (!skb)
>>>> - return -ENOMEM;
>>>> - /* Update mac_len for subsequent MPLS actions */
>>>> - skb->mac_len += VLAN_HLEN;
>>>> -
>>>> - if (skb->ip_summed == CHECKSUM_COMPLETE)
>>>> - skb->csum = csum_add(skb->csum, csum_partial(skb->data
>>>> - + (2 * ETH_ALEN), VLAN_HLEN, 0));
>>>> -
>>>> + if (vlan_tx_tag_present(skb))
>>>> invalidate_flow_key(key);
>>>> - } else {
>>>> + else
>>>> key->eth.tci = vlan->vlan_tci;
>>>> - }
>>>> - __vlan_hwaccel_put_tag(skb, vlan->vlan_tpid, ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT);
>>>> - return 0;
>>>> + return skb_vlan_push(skb, vlan->vlan_tpid,
>>>> + ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT);
>>>> }
>>>>
>>>> static int set_eth_addr(struct sk_buff *skb, struct sw_flow_key *key,
>>>> @@ -858,8 +792,6 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
>>>>
>>>> case OVS_ACTION_ATTR_PUSH_VLAN:
>>>> err = push_vlan(skb, key, nla_data(a));
>>>> - if (unlikely(err)) /* skb already freed. */
>>>> - return err;
>>>> break;
>>>>
>>>> case OVS_ACTION_ATTR_POP_VLAN:
>>>> --
>>>> 1.9.3
>>>>
^ permalink raw reply
* Re: [PATCH 00/10] net: phy: add device-type abstraction
From: David Miller @ 2014-11-21 19:16 UTC (permalink / raw)
To: johan; +Cc: f.fainelli, netdev, linux-kernel, bth, s.hauer, mark.rutland
In-Reply-To: <1416398363-32306-1-git-send-email-johan@kernel.org>
From: Johan Hovold <johan@kernel.org>
Date: Wed, 19 Nov 2014 12:59:13 +0100
> This series adds device and device-type abstractions to the micrel
> driver, and enables support for RMII-reference clock selection for
> KSZ8081 and KSZ8091 devices.
Series applied, thanks Johan.
^ permalink raw reply
* Re: [PATCH] l2tp_eth: allow to set a specific mac address
From: David Miller @ 2014-11-21 19:16 UTC (permalink / raw)
To: lynxis; +Cc: netdev
In-Reply-To: <1416399879-3164-1-git-send-email-lynxis@fe80.eu>
From: Alexander Couzens <lynxis@fe80.eu>
Date: Wed, 19 Nov 2014 13:24:39 +0100
> Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Looks good, applied, thanks.
^ permalink raw reply
* Re: [patch net-next v4 0/9] sched: introduce vlan action
From: David Miller @ 2014-11-21 19:21 UTC (permalink / raw)
To: jiri
Cc: netdev, jhs, pshelar, therbert, edumazet, willemb, dborkman, mst,
fw, Paul.Durrant, tgraf, cwang
In-Reply-To: <1416402303-25341-1-git-send-email-jiri@resnulli.us>
From: Jiri Pirko <jiri@resnulli.us>
Date: Wed, 19 Nov 2014 14:04:54 +0100
> Please see the individual patches for info
Series applied, thanks Jiri.
Please work with others to resolve the MPLS header length subtraction
issue Pravin mentioned.
Thanks.
^ permalink raw reply
* Re: [PATCH net] net: Revert "net: avoid one atomic operation in skb_clone()"
From: Eric Dumazet @ 2014-11-21 19:29 UTC (permalink / raw)
To: Sabrina Dubroca; +Cc: Chris Mason, David Miller, netdev
In-Reply-To: <20141121180510.GA22112@kria>
On Fri, 2014-11-21 at 19:05 +0100, Sabrina Dubroca wrote:
> Hello Eric,
>
> 2014-11-21, 09:04:11 -0800, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> >
> > Not sure what I was thinking, but doing anything after
> > releasing a refcount is suicidal or/and embarrassing.
> >
> > By the time we set skb->fclone to SKB_FCLONE_FREE, another cpu
> > could have released last reference and freed whole skb.
> >
> > We potentially corrupt memory or trap if CONFIG_DEBUG_PAGEALLOC is set.
> >
> > Reported-by: Chris Mason <clm@fb.com>
> > Fixes: ce1a4ea3f1258 ("net: avoid one atomic operation in skb_clone()")
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > ---
> > net/core/skbuff.c | 23 ++++++-----------------
> > 1 file changed, 6 insertions(+), 17 deletions(-)
> >
> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > index c16615bfb61e..be4c7deed971 100644
> > --- a/net/core/skbuff.c
> > +++ b/net/core/skbuff.c
> > @@ -552,20 +552,13 @@ static void kfree_skbmem(struct sk_buff *skb)
> > case SKB_FCLONE_CLONE:
> > fclones = container_of(skb, struct sk_buff_fclones, skb2);
> >
> > - /* Warning : We must perform the atomic_dec_and_test() before
> > - * setting skb->fclone back to SKB_FCLONE_FREE, otherwise
> > - * skb_clone() could set clone_ref to 2 before our decrement.
> > - * Anyway, if we are going to free the structure, no need to
> > - * rewrite skb->fclone.
> > + /* The clone portion is available for
> > + * fast-cloning again.
> > */
> > - if (atomic_dec_and_test(&fclones->fclone_ref)) {
> > + skb->fclone = SKB_FCLONE_UNAVAILABLE;
>
> Shouldn't that be SKB_FCLONE_FREE ?
Absolutely :(
I'll send a v2, thanks !
^ permalink raw reply
* Re: [patch net-next v4 8/9] net: move vlan pop/push functions into common code
From: Jiri Benc @ 2014-11-21 19:29 UTC (permalink / raw)
To: Pravin Shelar
Cc: Jiri Pirko, netdev, David Miller, Jamal Hadi Salim, Tom Herbert,
Eric Dumazet, Willem de Bruijn, Daniel Borkmann, mst, fw,
Paul.Durrant, Thomas Graf, Cong Wang
In-Reply-To: <CALnjE+p3PtaOz7Ujp7KDK0-=giP-kzEDDDvw8=GCjJdcECYJEA@mail.gmail.com>
On Fri, 21 Nov 2014 10:41:27 -0800, Pravin Shelar wrote:
> There is bug in the openvswitch code where vlan-pop does mac-length
> reset rather than subtracting VLAN_HLEN from mac-len. MPLS code
> depends on this. Now this patch moves the bug to common code. I am
> fine with this patch and I can send fix to change code vlan-pop code
> to adjust mac_len later on.
> But I am worried about the comment made by Jiri Benc on earlier
> version of this patch where is mentioned that subtracting VLAN_HLEN
> can break common case for vlan-pop. In that case we can not change
> this common function. Jiri Benc, Can you point me to the code, so the
> we can work on solution to fix this issue.
In such case, a skb that enters the __pop_vlan_tci function looks like
this:
+--------+--------+-------------+-----+---------+-------
| dstmac | srcmac | ETH_P_8021Q | tci | ETH_P_x | data
+--------+--------+-------------+-----+---------+-------
^ ^
mac_header network_header
skb->protocol = ETH_P_8021Q
skb->mac_len = 14
After the function finishes, it's supposed to look like this:
+--------+--------+---------+-------
| dstmac | srcmac | ETH_P_x | data
+--------+--------+---------+-------
^ ^
mac_header network_header
skb->protocol = ETH_P_x
skb->mac_len = 14
Blindly decrementing mac_len wouldn't work here, you'd end up with
mac_len = 10. You'd either need to ensure this case doesn't happen (it
does with openvswitch currently) or detect this case.
Jiri
--
Jiri Benc
^ permalink raw reply
* Re: [RFC] situation with csum_and_copy_... API
From: Al Viro @ 2014-11-21 19:39 UTC (permalink / raw)
To: David Laight
Cc: Eric Dumazet, David Miller, torvalds@linux-foundation.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
target-devel@vger.kernel.org, Nicholas A. Bellinger,
Christoph Hellwig
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1C9F6930@AcuExch.aculab.com>
On Fri, Nov 21, 2014 at 05:42:55PM +0000, David Laight wrote:
> Callers of kernel_send/recvmsg() could easily be using a wrapper
> function that creates the 'msghdr'.
> When the want to send the remaining part of a buffer the old iterator
> will no longer be available - just the original iov and the required offset.
Er... So why not copy a struct iov_iter to/from msg->msg_iter, then?
It's not as it had been particulary large - 5 words isn't much...
I'm not at all sure that _anything_ has valid reasons for draining iovecs.
Maintaining a struct iov_iter and modifying it is easy and actually faster...
Right now the main examples outside of net/* are due to unfortunate
limitations of ->sendmsg() - until now it had no way to be told that
desired data starts at offset. With ->msg_iter it obviously becomes
possible...
^ permalink raw reply
* Re: [PATCH net] net: Revert "net: avoid one atomic operation in skb_clone()"
From: Chris Mason @ 2014-11-21 19:39 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Sabrina Dubroca, David Miller, netdev
In-Reply-To: <1416598161.8629.120.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, Nov 21, 2014 at 2:29 PM, Eric Dumazet <eric.dumazet@gmail.com>
wrote:
> On Fri, 2014-11-21 at 19:05 +0100, Sabrina Dubroca wrote:
>> Hello Eric,
>>
>> >
>> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
>> > index c16615bfb61e..be4c7deed971 100644
>> > --- a/net/core/skbuff.c
>> > +++ b/net/core/skbuff.c
>> > @@ -552,20 +552,13 @@ static void kfree_skbmem(struct sk_buff
>> *skb)
>> > case SKB_FCLONE_CLONE:
>> > fclones = container_of(skb, struct sk_buff_fclones, skb2);
>> >
>> > - /* Warning : We must perform the atomic_dec_and_test() before
>> > - * setting skb->fclone back to SKB_FCLONE_FREE, otherwise
>> > - * skb_clone() could set clone_ref to 2 before our decrement.
>> > - * Anyway, if we are going to free the structure, no need to
>> > - * rewrite skb->fclone.
>> > + /* The clone portion is available for
>> > + * fast-cloning again.
>> > */
>> > - if (atomic_dec_and_test(&fclones->fclone_ref)) {
>> > + skb->fclone = SKB_FCLONE_UNAVAILABLE;
>>
>> Shouldn't that be SKB_FCLONE_FREE ?
>
> Absolutely :(
>
> I'll send a v2, thanks !
v1 made it through the first pass here. I'll switch to SKB_FCLONE_FREE
and restart.
-chris
^ permalink raw reply
* Re: [RFC] situation with csum_and_copy_... API
From: Linus Torvalds @ 2014-11-21 19:40 UTC (permalink / raw)
To: Al Viro
Cc: David Laight, Eric Dumazet, David Miller, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, target-devel@vger.kernel.org,
Nicholas A. Bellinger, Christoph Hellwig
In-Reply-To: <20141121193911.GU7996@ZenIV.linux.org.uk>
On Fri, Nov 21, 2014 at 11:39 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> I'm not at all sure that _anything_ has valid reasons for draining iovecs.
> Maintaining a struct iov_iter and modifying it is easy and actually faster...
For new code, I agree. But the whole "draining iovec's" is a fairly
common old model.
Linus
^ permalink raw reply
* Re: [PATCH net-next v2] packet: make packet_snd fail on len smaller than l2 header
From: David Miller @ 2014-11-21 19:43 UTC (permalink / raw)
To: willemb; +Cc: netdev, eric.dumazet, dborkman
In-Reply-To: <1416420616-5029-1-git-send-email-willemb@google.com>
From: Willem de Bruijn <willemb@google.com>
Date: Wed, 19 Nov 2014 13:10:16 -0500
> From: Willem de Bruijn <willemb@google.com>
>
> When sending packets out with PF_PACKET, SOCK_RAW, ensure that the
> packet is at least as long as the device's expected link layer header.
> This check already exists in tpacket_snd, but not in packet_snd.
> Also rate limit the warning in tpacket_snd.
>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 1/2] net: systemport: log RX buffer allocation and RX/TX DMA failures
From: David Miller @ 2014-11-21 19:46 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev
In-Reply-To: <1416421796-27657-2-git-send-email-f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 19 Nov 2014 10:29:55 -0800
> To help troubleshoot heavy memory pressure conditions, add a bunch of
> statistics counter to log RX buffer allocation and RX/TX DMA mapping
> failures. These are reported like any other counters through the ethtool
> stats interface.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 2/2] net: bcmgenet: log RX buffer allocation and RX/TX dma failures
From: David Miller @ 2014-11-21 19:46 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev
In-Reply-To: <1416421796-27657-3-git-send-email-f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 19 Nov 2014 10:29:56 -0800
> To help troubleshoot heavy memory pressure conditions, add a bunch of
> statistics counter to log RX buffer allocation and RX/TX DMA mapping
> failures. These are reported like any other counters through the ethtool
> stats interface.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH v4] ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg
From: David Miller @ 2014-11-21 19:46 UTC (permalink / raw)
To: jbohac; +Cc: arnd, acme, netdev
In-Reply-To: <20141119220549.GA26133@midget.suse.cz>
From: Jiri Bohac <jbohac@suse.cz>
Date: Wed, 19 Nov 2014 23:05:49 +0100
> This fixes an old regression introduced by commit
> b0d0d915 (ipx: remove the BKL).
>
> When a recvmsg syscall blocks waiting for new data, no data can be sent on the
> same socket with sendmsg because ipx_recvmsg() sleeps with the socket locked.
>
> This breaks mars-nwe (NetWare emulator):
> - the ncpserv process reads the request using recvmsg
> - ncpserv forks and spawns nwconn
> - ncpserv calls a (blocking) recvmsg and waits for new requests
> - nwconn deadlocks in sendmsg on the same socket
>
> Commit b0d0d915 has simply replaced BKL locking with
> lock_sock/release_sock. Unlike now, BKL got unlocked while
> sleeping, so a blocking recvmsg did not block a concurrent
> sendmsg.
>
> Only keep the socket locked while actually working with the socket data and
> release it prior to calling skb_recv_datagram().
>
>
> Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Applied.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox