* Re: [RFC davem] revert: net: Make skb->skb_iif always track skb->dev
From: Oliver Hartkopp @ 2013-01-12 18:40 UTC (permalink / raw)
To: Jiri Pirko; +Cc: David Miller, Linux Netdev List
In-Reply-To: <20130112181307.GA1567@minipsycho.orion>
Hello Jiri,
On 12.01.2013 19:13, Jiri Pirko wrote:
> Sat, Jan 12, 2013 at 02:48:14PM CET, socketcan@hartkopp.net wrote:
>> Hello Dave,
>>
>> in your below patch from 23 Jul 2012 you removed the check for an already set
>> value of skb_iif in net/core/dev.c
>>
>> I'm currently working on a solution to prevent some routed CAN frames to be
>> sent back onto the originating network device.
>
> Hm, I'm not sure where exactly you want to use this information, but
> can_rcv() can get it from orig_dev->ifindex
No - it's not in can_rcv() ...
Depending on the filter lists in can_rcv() the received skb is passed to the
function can_can_gw_rcv() in net/can/gw.c.
An there i wanted to add this code to omit sending the CAN frame on the
originating interface:
@@ .. @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data
if (!(gwj->dst.dev->flags & IFF_UP)) {
gwj->dropped_frames++;
return;
}
+ /* is sending the skb back to the incoming interface allowed? */
+ if (!(gwj->flags & CGW_FLAGS_CAN_IIF_TX_OK) &&
+ skb->skb_iif == gwj->dst.dev->ifindex)
+ return;
+
/*
* clone the given skb, which has not been done in can_rcv()
*
This works fine, when the patch from Dave is reverted.
I did not find any good solution to preserve the originating netdev over
several netif_receive_skb() calls - but this skb_iif which has been made
unusable ...
(..)
>>
>> To me it is not clear why skb_iff is needed anyway as the value should
>> always be available via skb->dev->ifindex, right?
>>
>> But if skb_iff has any right to exist it should contain the first incoming
>> interface on the host IMO.
>>
>> Please correct my if i'm wrong and/or tell me what your commit message means
>> in respect to my request and why skb->dev->ifindex is not used instead of
>> skb_iif. I feel somehow lost about the skb_iif intention ...
>
> I believe that skb_iif should be removed.
AFAICS skb->skb_iif is used as some kind of cached variable for the original
skb->dev->ifindex - or is it really possible that skb->skb_iif is set while
skb->dev->ifindex is not accessible?
Btw. i my case skb_iif would make sense though.
Regards,
Oliver
>>
>> ---
>>
>>
>> http://git.kernel.org/?p=linux/kernel/git/davem/net-next.git;a=commitdiff;h=b68581778cd0051a3fb9a2b614dee7eccb5127ff
>>
>> net: Make skb->skb_iif always track skb->dev
>>
>> Make it follow device decapsulation, from things such as VLAN and
>> bonding.
>>
>> The stuff that actually cares about pre-demuxed device pointers, is
>> handled by the "orig_dev" variable in __netif_receive_skb(). And
>> the only consumer of that is the po->origdev feature of AF_PACKET
>> sockets.
>>
>> Signed-off-by: David S. Miller <davem@davemloft.net>
>> ---
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index cca02ae..0ebaea1 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -3173,8 +3173,6 @@ static int __netif_receive_skb(struct sk_buff *skb)
>> if (netpoll_receive_skb(skb))
>> return NET_RX_DROP;
>>
>> - if (!skb->skb_iif)
>> - skb->skb_iif = skb->dev->ifindex;
>> orig_dev = skb->dev;
>>
>> skb_reset_network_header(skb);
>> @@ -3186,6 +3184,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
>> rcu_read_lock();
>>
>> another_round:
>> + skb->skb_iif = skb->dev->ifindex;
>>
>> __this_cpu_inc(softnet_data.processed);
>>
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [RFC davem] revert: net: Make skb->skb_iif always track skb->dev
From: Jiri Pirko @ 2013-01-12 19:37 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: David Miller, Linux Netdev List
In-Reply-To: <50F1AE21.90701@hartkopp.net>
Sat, Jan 12, 2013 at 07:40:33PM CET, socketcan@hartkopp.net wrote:
>Hello Jiri,
>
>On 12.01.2013 19:13, Jiri Pirko wrote:
>
>> Sat, Jan 12, 2013 at 02:48:14PM CET, socketcan@hartkopp.net wrote:
>>> Hello Dave,
>>>
>>> in your below patch from 23 Jul 2012 you removed the check for an already set
>>> value of skb_iif in net/core/dev.c
>>>
>>> I'm currently working on a solution to prevent some routed CAN frames to be
>>> sent back onto the originating network device.
>>
>> Hm, I'm not sure where exactly you want to use this information, but
>> can_rcv() can get it from orig_dev->ifindex
>
>
>No - it's not in can_rcv() ...
>
>Depending on the filter lists in can_rcv() the received skb is passed to the
>function can_can_gw_rcv() in net/can/gw.c.
>
>An there i wanted to add this code to omit sending the CAN frame on the
>originating interface:
>
>@@ .. @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data
>
> if (!(gwj->dst.dev->flags & IFF_UP)) {
> gwj->dropped_frames++;
> return;
> }
>
>+ /* is sending the skb back to the incoming interface allowed? */
>+ if (!(gwj->flags & CGW_FLAGS_CAN_IIF_TX_OK) &&
>+ skb->skb_iif == gwj->dst.dev->ifindex)
>+ return;
>+
> /*
> * clone the given skb, which has not been done in can_rcv()
> *
>
>This works fine, when the patch from Dave is reverted.
>
>I did not find any good solution to preserve the originating netdev over
>several netif_receive_skb() calls - but this skb_iif which has been made
>unusable ...
Well, look at struct receiver in net/can/af_can.h:
struct receiver {
struct hlist_node list;
struct rcu_head rcu;
canid_t can_id;
canid_t mask;
unsigned long matches;
void (*func)(struct sk_buff *, void *);
void *data;
char *ident;
};
your can_can_gw_rcv() is callback registered as ->func here.
This ->func is called from chain can_rcv->can_receive->can_rcv_filter->deliver
So just extend
->func to something like:
void (*func)(struct sk_buff *, struct neti_device *orig_dev, void *);
and pass the orig_dev all the way through the chain.
>
>(..)
>
>>>
>>> To me it is not clear why skb_iff is needed anyway as the value should
>>> always be available via skb->dev->ifindex, right?
>>>
>>> But if skb_iff has any right to exist it should contain the first incoming
>>> interface on the host IMO.
>>>
>>> Please correct my if i'm wrong and/or tell me what your commit message means
>>> in respect to my request and why skb->dev->ifindex is not used instead of
>>> skb_iif. I feel somehow lost about the skb_iif intention ...
>>
>> I believe that skb_iif should be removed.
>
>
>AFAICS skb->skb_iif is used as some kind of cached variable for the original
>skb->dev->ifindex - or is it really possible that skb->skb_iif is set while
>skb->dev->ifindex is not accessible?
>
>Btw. i my case skb_iif would make sense though.
>
>Regards,
>Oliver
>
>>>
>>> ---
>>>
>>>
>>> http://git.kernel.org/?p=linux/kernel/git/davem/net-next.git;a=commitdiff;h=b68581778cd0051a3fb9a2b614dee7eccb5127ff
>>>
>>> net: Make skb->skb_iif always track skb->dev
>>>
>>> Make it follow device decapsulation, from things such as VLAN and
>>> bonding.
>>>
>>> The stuff that actually cares about pre-demuxed device pointers, is
>>> handled by the "orig_dev" variable in __netif_receive_skb(). And
>>> the only consumer of that is the po->origdev feature of AF_PACKET
>>> sockets.
>>>
>>> Signed-off-by: David S. Miller <davem@davemloft.net>
>>> ---
>>>
>>> diff --git a/net/core/dev.c b/net/core/dev.c
>>> index cca02ae..0ebaea1 100644
>>> --- a/net/core/dev.c
>>> +++ b/net/core/dev.c
>>> @@ -3173,8 +3173,6 @@ static int __netif_receive_skb(struct sk_buff *skb)
>>> if (netpoll_receive_skb(skb))
>>> return NET_RX_DROP;
>>>
>>> - if (!skb->skb_iif)
>>> - skb->skb_iif = skb->dev->ifindex;
>>> orig_dev = skb->dev;
>>>
>>> skb_reset_network_header(skb);
>>> @@ -3186,6 +3184,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
>>> rcu_read_lock();
>>>
>>> another_round:
>>> + skb->skb_iif = skb->dev->ifindex;
>>>
>>> __this_cpu_inc(softnet_data.processed);
>>>
>>>
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 1/3] ssb: add missing method ssb_gige_get_macaddr
From: Hauke Mehrtens @ 2013-01-12 20:01 UTC (permalink / raw)
To: davem; +Cc: mcarlson, mchan, netdev, m, Hauke Mehrtens
In-Reply-To: <1358020905-9924-1-git-send-email-hauke@hauke-m.de>
When CONFIG_SSB_DRIVER_GIGE is not set the header does not provide the
needed method.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
include/linux/ssb/ssb_driver_gige.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h
index 6b05dcd..1438523 100644
--- a/include/linux/ssb/ssb_driver_gige.h
+++ b/include/linux/ssb/ssb_driver_gige.h
@@ -175,6 +175,9 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
{
return 0;
}
+static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
+{
+}
#endif /* CONFIG_SSB_DRIVER_GIGE */
#endif /* LINUX_SSB_DRIVER_GIGE_H_ */
--
1.7.10.4
^ permalink raw reply related
* [PATCH 0/3] tg3: add support for Ethernet core in BCM4785
From: Hauke Mehrtens @ 2013-01-12 20:01 UTC (permalink / raw)
To: davem; +Cc: mcarlson, mchan, netdev, m, Hauke Mehrtens
These patches are adding support for the Ethernet core found in the BCM4705/BCM4785 SoC.
Hauke Mehrtens (3):
ssb: add missing method ssb_gige_get_macaddr
tg3: make it possible to provide phy_id in ioctl
tg3: add support for Ethernet core in bcm4785
drivers/net/ethernet/broadcom/tg3.c | 137 +++++++++++++++++++++++++++++++----
drivers/net/ethernet/broadcom/tg3.h | 5 ++
include/linux/pci_ids.h | 1 +
include/linux/ssb/ssb_driver_gige.h | 3 +
4 files changed, 133 insertions(+), 13 deletions(-)
--
1.7.10.4
^ permalink raw reply
* [PATCH 2/3] tg3: make it possible to provide phy_id in ioctl
From: Hauke Mehrtens @ 2013-01-12 20:01 UTC (permalink / raw)
To: davem; +Cc: mcarlson, mchan, netdev, m, Hauke Mehrtens
In-Reply-To: <1358020905-9924-1-git-send-email-hauke@hauke-m.de>
In OpenWrt we currently use a switch driver which uses the ioctls to
configure the switch in the phy. We have to provide the phy_id to do
so, but without this patch this is not possible.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/ethernet/broadcom/tg3.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 88f2d41..6c397d7 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -1091,7 +1091,8 @@ static void tg3_switch_clocks(struct tg3 *tp)
#define PHY_BUSY_LOOPS 5000
-static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
+static int __tg3_readphy(struct tg3 *tp, unsigned int phy_addr, int reg,
+ u32 *val)
{
u32 frame_val;
unsigned int loops;
@@ -1107,7 +1108,7 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
*val = 0x0;
- frame_val = ((tp->phy_addr << MI_COM_PHY_ADDR_SHIFT) &
+ frame_val = ((phy_addr << MI_COM_PHY_ADDR_SHIFT) &
MI_COM_PHY_ADDR_MASK);
frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) &
MI_COM_REG_ADDR_MASK);
@@ -1144,7 +1145,13 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
return ret;
}
-static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
+static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
+{
+ return __tg3_readphy(tp, tp->phy_addr, reg, val);
+}
+
+static int __tg3_writephy(struct tg3 *tp, unsigned int phy_addr, int reg,
+ u32 val)
{
u32 frame_val;
unsigned int loops;
@@ -1162,7 +1169,7 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
tg3_ape_lock(tp, tp->phy_ape_lock);
- frame_val = ((tp->phy_addr << MI_COM_PHY_ADDR_SHIFT) &
+ frame_val = ((phy_addr << MI_COM_PHY_ADDR_SHIFT) &
MI_COM_PHY_ADDR_MASK);
frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) &
MI_COM_REG_ADDR_MASK);
@@ -1197,6 +1204,11 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
return ret;
}
+static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
+{
+ return __tg3_writephy(tp, tp->phy_addr, reg, val);
+}
+
static int tg3_phy_cl45_write(struct tg3 *tp, u32 devad, u32 addr, u32 val)
{
int err;
@@ -12956,7 +12968,8 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return -EAGAIN;
spin_lock_bh(&tp->lock);
- err = tg3_readphy(tp, data->reg_num & 0x1f, &mii_regval);
+ err = __tg3_readphy(tp, data->phy_id & 0x1f,
+ data->reg_num & 0x1f, &mii_regval);
spin_unlock_bh(&tp->lock);
data->val_out = mii_regval;
@@ -12972,7 +12985,8 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return -EAGAIN;
spin_lock_bh(&tp->lock);
- err = tg3_writephy(tp, data->reg_num & 0x1f, data->val_in);
+ err = __tg3_writephy(tp, data->phy_id & 0x1f,
+ data->reg_num & 0x1f, data->val_in);
spin_unlock_bh(&tp->lock);
return err;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 3/3] tg3: add support for Ethernet core in bcm4785
From: Hauke Mehrtens @ 2013-01-12 20:01 UTC (permalink / raw)
To: davem; +Cc: mcarlson, mchan, netdev, m, Hauke Mehrtens
In-Reply-To: <1358020905-9924-1-git-send-email-hauke@hauke-m.de>
The BCM4785 or sometimes named BMC4705 is a Broadcom SoC which a
Gigabit 5750 Ethernet core. The core is connected via PCI with the rest
of the SoC, but it uses some extension.
This core does not use a firmware or an eeprom.
Some devices only have a switch which supports 100MBit/s, this
currently does not work with this driver.
This patch was original written by Michael Buesch <m@bues.ch> and is in
OpenWrt for some years now.
This was tested on a Linksys WRT610N V1 and older version by other
people on different devices.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/ethernet/broadcom/tg3.c | 111 ++++++++++++++++++++++++++++++++---
drivers/net/ethernet/broadcom/tg3.h | 5 ++
include/linux/pci_ids.h | 1 +
3 files changed, 110 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 6c397d7..788f0e3 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -44,6 +44,7 @@
#include <linux/prefetch.h>
#include <linux/dma-mapping.h>
#include <linux/firmware.h>
+#include <linux/ssb/ssb_driver_gige.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
@@ -263,6 +264,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
TG3_DRV_DATA_FLAG_5705_10_100},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5721)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5722)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751M)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751F),
@@ -573,7 +575,9 @@ static void _tw32_flush(struct tg3 *tp, u32 off, u32 val, u32 usec_wait)
static inline void tw32_mailbox_flush(struct tg3 *tp, u32 off, u32 val)
{
tp->write32_mbox(tp, off, val);
- if (!tg3_flag(tp, MBOX_WRITE_REORDER) && !tg3_flag(tp, ICH_WORKAROUND))
+ if (tg3_flag(tp, FLUSH_POSTED_WRITES) ||
+ (!tg3_flag(tp, MBOX_WRITE_REORDER) &&
+ !tg3_flag(tp, ICH_WORKAROUND)))
tp->read32_mbox(tp, off);
}
@@ -583,7 +587,8 @@ static void tg3_write32_tx_mbox(struct tg3 *tp, u32 off, u32 val)
writel(val, mbox);
if (tg3_flag(tp, TXD_MBOX_HWBUG))
writel(val, mbox);
- if (tg3_flag(tp, MBOX_WRITE_REORDER))
+ if (tg3_flag(tp, MBOX_WRITE_REORDER) ||
+ tg3_flag(tp, FLUSH_POSTED_WRITES))
readl(mbox);
}
@@ -1781,6 +1786,11 @@ static int tg3_poll_fw(struct tg3 *tp)
int i;
u32 val;
+ if (tg3_flag(tp, IS_SSB_CORE)) {
+ /* We don't use firmware. */
+ return 0;
+ }
+
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
/* Wait up to 20ms for init done. */
for (i = 0; i < 200; i++) {
@@ -3453,6 +3463,11 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset)
tw32_f(offset + CPU_MODE, CPU_MODE_HALT);
udelay(10);
} else {
+ /* There is only an Rx CPU for the 5750 derivative in the
+ * BCM4785. */
+ if (tg3_flag(tp, IS_SSB_CORE))
+ return 0;
+
for (i = 0; i < 10000; i++) {
tw32(offset + CPU_STATE, 0xffffffff);
tw32(offset + CPU_MODE, CPU_MODE_HALT);
@@ -3920,8 +3935,9 @@ static int tg3_power_down_prepare(struct tg3 *tp)
tg3_frob_aux_power(tp, true);
/* Workaround for unstable PLL clock */
- if ((GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5750_AX) ||
- (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5750_BX)) {
+ if ((!tg3_flag(tp, IS_SSB_CORE)) &&
+ ((GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5750_AX) ||
+ (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5750_BX))) {
u32 val = tr32(0x7d00);
val &= ~((1 << 16) | (1 << 4) | (1 << 2) | (1 << 1) | 1);
@@ -4442,6 +4458,15 @@ relink:
if (current_link_up == 0 || (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) {
tg3_phy_copper_begin(tp);
+ if (tg3_flag(tp, ROBOSWITCH)) {
+ current_link_up = 1;
+ /* FIXME: when BCM5325 switch is used use 100 MBit/s */
+ current_speed = SPEED_1000;
+ current_duplex = DUPLEX_FULL;
+ tp->link_config.active_speed = current_speed;
+ tp->link_config.active_duplex = current_duplex;
+ }
+
tg3_readphy(tp, MII_BMSR, &bmsr);
if ((!tg3_readphy(tp, MII_BMSR, &bmsr) && (bmsr & BMSR_LSTATUS)) ||
(tp->mac_mode & MAC_MODE_PORT_INT_LPBACK))
@@ -4460,6 +4485,26 @@ relink:
else
tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
+ /* In order for the 5750 core in BCM4785 chip to work properly
+ * in RGMII mode, the Led Control Register must be set up.
+ */
+ if (tg3_flag(tp, RGMII_MODE)) {
+ u32 led_ctrl = tr32(MAC_LED_CTRL);
+ led_ctrl &= ~(LED_CTRL_1000MBPS_ON | LED_CTRL_100MBPS_ON);
+
+ if (tp->link_config.active_speed == SPEED_10)
+ led_ctrl |= LED_CTRL_LNKLED_OVERRIDE;
+ else if (tp->link_config.active_speed == SPEED_100)
+ led_ctrl |= (LED_CTRL_LNKLED_OVERRIDE |
+ LED_CTRL_100MBPS_ON);
+ else if (tp->link_config.active_speed == SPEED_1000)
+ led_ctrl |= (LED_CTRL_LNKLED_OVERRIDE |
+ LED_CTRL_1000MBPS_ON);
+
+ tw32(MAC_LED_CTRL, led_ctrl);
+ udelay(40);
+ }
+
tp->mac_mode &= ~MAC_MODE_HALF_DUPLEX;
if (tp->link_config.active_duplex == DUPLEX_HALF)
tp->mac_mode |= MAC_MODE_HALF_DUPLEX;
@@ -8436,6 +8481,14 @@ static int tg3_chip_reset(struct tg3 *tp)
tw32(0x5000, 0x400);
}
+ if (tg3_flag(tp, IS_SSB_CORE)) {
+ /* BCM4785: In order to avoid repercussions from using
+ * potentially defective internal ROM, stop the Rx RISC CPU,
+ * which is not required. */
+ tg3_stop_fw(tp);
+ tg3_halt_cpu(tp, RX_CPU_BASE);
+ }
+
tw32(GRC_MODE, tp->grc_mode);
if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A0) {
@@ -10094,6 +10147,11 @@ static void tg3_timer(unsigned long __opaque)
tg3_flag(tp, 57765_CLASS))
tg3_chk_missed_msi(tp);
+ if (tg3_flag(tp, FLUSH_POSTED_WRITES)) {
+ /* BCM4785: Flush posted writes from GbE to host memory. */
+ tr32(HOSTCC_MODE);
+ }
+
if (!tg3_flag(tp, TAGGED_STATUS)) {
/* All of this garbage is because when using non-tagged
* IRQ status the mailbox/status_block protocol the chip
@@ -13866,6 +13924,14 @@ static void tg3_get_5720_nvram_info(struct tg3 *tp)
/* Chips other than 5700/5701 use the NVRAM for fetching info. */
static void tg3_nvram_init(struct tg3 *tp)
{
+ if (tg3_flag(tp, IS_SSB_CORE)) {
+ /* No NVRAM and EEPROM on the SSB Broadcom GigE core. */
+ tg3_flag_clear(tp, NVRAM);
+ tg3_flag_clear(tp, NVRAM_BUFFERED);
+ tg3_flag_set(tp, NO_NVRAM);
+ return;
+ }
+
tw32_f(GRC_EEPROM_ADDR,
(EEPROM_ADDR_FSM_RESET |
(EEPROM_DEFAULT_CLOCK_PERIOD <<
@@ -14392,10 +14458,19 @@ static int tg3_phy_probe(struct tg3 *tp)
* subsys device table.
*/
p = tg3_lookup_by_subsys(tp);
- if (!p)
+ if (p) {
+ tp->phy_id = p->phy_id;
+ } else if (!tg3_flag(tp, IS_SSB_CORE)) {
+ /* For now we saw the IDs 0xbc050cd0,
+ * 0xbc050f80 and 0xbc050c30 on devices
+ * connected to an BCM4785 and there are
+ * probably more. Just assume that the phy is
+ * supported when it is connected to a SSB core
+ * for now.
+ */
return -ENODEV;
+ }
- tp->phy_id = p->phy_id;
if (!tp->phy_id ||
tp->phy_id == TG3_PHY_ID_BCM8002)
tp->phy_flags |= TG3_PHYFLG_PHY_SERDES;
@@ -15471,6 +15546,11 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
TG3_CPMU_STATUS_FSHFT_5719;
}
+ if (tg3_flag(tp, FLUSH_POSTED_WRITES)) {
+ tp->write32_tx_mbox = tg3_write_flush_reg32;
+ tp->write32_rx_mbox = tg3_write_flush_reg32;
+ }
+
/* Get eeprom hw config before calling tg3_set_power_state().
* In particular, the TG3_FLAG_IS_NIC flag must be
* determined before calling tg3_set_power_state() so that
@@ -15868,6 +15948,10 @@ static int tg3_get_device_address(struct tg3 *tp)
}
if (!is_valid_ether_addr(&dev->dev_addr[0])) {
+ if (tg3_flag(tp, IS_SSB_CORE))
+ ssb_gige_get_macaddr(tp->pdev, &dev->dev_addr[0]);
+ }
+ if (!is_valid_ether_addr(&dev->dev_addr[0])) {
#ifdef CONFIG_SPARC
if (!tg3_get_default_macaddr_sparc(tp))
return 0;
@@ -16152,7 +16236,8 @@ static int tg3_test_dma(struct tg3 *tp)
if (tg3_flag(tp, 40BIT_DMA_BUG) &&
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704)
tp->dma_rwctrl |= 0x8000;
- else if (ccval == 0x6 || ccval == 0x7)
+ else if ((ccval == 0x6 || ccval == 0x7) ||
+ tg3_flag(tp, ONE_DMA_AT_ONCE))
tp->dma_rwctrl |= DMA_RWCTRL_ONE_DMA;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703)
@@ -16516,6 +16601,18 @@ static int tg3_init_one(struct pci_dev *pdev,
else
tp->msg_enable = TG3_DEF_MSG_ENABLE;
+ if (pdev_is_ssb_gige_core(pdev)) {
+ tg3_flag_set(tp, IS_SSB_CORE);
+ if (ssb_gige_must_flush_posted_writes(pdev))
+ tg3_flag_set(tp, FLUSH_POSTED_WRITES);
+ if (ssb_gige_one_dma_at_once(pdev))
+ tg3_flag_set(tp, ONE_DMA_AT_ONCE);
+ if (ssb_gige_have_roboswitch(pdev))
+ tg3_flag_set(tp, ROBOSWITCH);
+ if (ssb_gige_is_rgmii(pdev))
+ tg3_flag_set(tp, RGMII_MODE);
+ }
+
/* The word/byte swap controls here control register access byte
* swapping. DMA data byte swapping is controlled in the GRC_MODE
* setting below.
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 9cd88a4..ef6ced2 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -3056,6 +3056,11 @@ enum TG3_FLAGS {
TG3_FLAG_57765_PLUS,
TG3_FLAG_57765_CLASS,
TG3_FLAG_5717_PLUS,
+ TG3_FLAG_IS_SSB_CORE,
+ TG3_FLAG_FLUSH_POSTED_WRITES,
+ TG3_FLAG_ROBOSWITCH,
+ TG3_FLAG_ONE_DMA_AT_ONCE,
+ TG3_FLAG_RGMII_MODE,
/* Add new flags before this comment and TG3_FLAG_NUMBER_OF_FLAGS */
TG3_FLAG_NUMBER_OF_FLAGS, /* Last entry in enum TG3_FLAGS */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 0f84473..badb429 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2126,6 +2126,7 @@
#define PCI_DEVICE_ID_TIGON3_5754M 0x1672
#define PCI_DEVICE_ID_TIGON3_5755M 0x1673
#define PCI_DEVICE_ID_TIGON3_5756 0x1674
+#define PCI_DEVICE_ID_TIGON3_5750 0x1676
#define PCI_DEVICE_ID_TIGON3_5751 0x1677
#define PCI_DEVICE_ID_TIGON3_5715 0x1678
#define PCI_DEVICE_ID_TIGON3_5715S 0x1679
--
1.7.10.4
^ permalink raw reply related
* Re: [RFC davem] revert: net: Make skb->skb_iif always track skb->dev
From: Oliver Hartkopp @ 2013-01-12 20:14 UTC (permalink / raw)
To: Jiri Pirko; +Cc: David Miller, Linux Netdev List
In-Reply-To: <20130112193728.GB1567@minipsycho.orion>
On 12.01.2013 20:37, Jiri Pirko wrote:
> Sat, Jan 12, 2013 at 07:40:33PM CET, socketcan@hartkopp.net wrote:
>> An there i wanted to add this code to omit sending the CAN frame on the
>> originating interface:
>>
>> @@ .. @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data
>>
>> if (!(gwj->dst.dev->flags & IFF_UP)) {
>> gwj->dropped_frames++;
>> return;
>> }
>>
>> + /* is sending the skb back to the incoming interface allowed? */
>> + if (!(gwj->flags & CGW_FLAGS_CAN_IIF_TX_OK) &&
>> + skb->skb_iif == gwj->dst.dev->ifindex)
>> + return;
>> +
>> /*
>> * clone the given skb, which has not been done in can_rcv()
>> *
>>
>> This works fine, when the patch from Dave is reverted.
>>
>> I did not find any good solution to preserve the originating netdev over
>> several netif_receive_skb() calls - but this skb_iif which has been made
>> unusable ...
>
>
>
> Well, look at struct receiver in net/can/af_can.h:
>
> struct receiver {
> struct hlist_node list;
> struct rcu_head rcu;
> canid_t can_id;
> canid_t mask;
> unsigned long matches;
> void (*func)(struct sk_buff *, void *);
> void *data;
> char *ident;
> };
>
> your can_can_gw_rcv() is callback registered as ->func here.
> This ->func is called from chain can_rcv->can_receive->can_rcv_filter->deliver
>
> So just extend
> ->func to something like:
>
> void (*func)(struct sk_buff *, struct neti_device *orig_dev, void *);
> and pass the orig_dev all the way through the chain.
>
Passing the information up to the can-gw once is not the problem.
But when this skb has to be routed to another CAN netdev it is cloned and goes
down from can_can_gw_rcv() to
-> can_send(cloned_skb) -> dev_queue_xmit(cloned_skb)
And when it has been sent successfully on the CAN bus the cloned_skb is echoed
back into the system via netif_rx_ni(cloned_skb).
(see http://lxr.linux.no/#linux+v3.7.2/Documentation/networking/can.txt#L177 )
This entire path - using dev_queue_xmit() / netif_rx_ni() - is reduced to a
skb structure and can not deal with any orig_dev pointer.
Therefore storing the first incoming interface in skb_iif is relevant for this
use-case.
Regards,
Oliver
^ permalink raw reply
* (unknown)
From: James White @ 2013-01-12 20:29 UTC (permalink / raw)
Do you need a Loan?If yes,reply us for more Details
^ permalink raw reply
* Re: [patch net] net: correct check in dev_addr_del()
From: Jan Engelhardt @ 2013-01-12 20:39 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jiri Pirko, netdev, davem, shemminger, john.r.fastabend
In-Reply-To: <1352903939.4497.6.camel@edumazet-glaptop>
On Wednesday 2012-11-14 15:38, Eric Dumazet wrote:
>>
>> bug introduced by:
>>
>> commit a748ee2426817a95b1f03012d8f339c45c722ae1
>> Author: Jiri Pirko <jpirko@redhat.com>
>> Date: Thu Apr 1 21:22:09 2010 +0000
>>
>> net: move address list functions to a separate file
>
>Good, the usual way is then to add in the changelog :
>
>Bug added in commit a748ee242681
>(net: move address list functions to a separate file)
>
>(No need to give the author/date, and we can shorten the SHA1 to 10 or
>12 digits)
A shortened hash value is however not truly future-proof. I recommend
using `git describe` or `git describe --contains`, as that is
unambiguous into the future and shows a related version. In case of
a748ee, that would be v2.6.35-rc1~473^2~602, which immediately tells
us that the bug has been in tarballs since 2.6.35-rc1.
^ permalink raw reply
* Re: [RFC davem] revert: net: Make skb->skb_iif always track skb->dev
From: David Miller @ 2013-01-12 21:23 UTC (permalink / raw)
To: socketcan; +Cc: netdev
In-Reply-To: <50F1699E.1000200@hartkopp.net>
From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: Sat, 12 Jan 2013 14:48:14 +0100
> To me it is not clear why skb_iff is needed anyway as the value should
> always be available via skb->dev->ifindex, right?
But all the code uses skb_iif, in particular the ipv4 routing
lookups use that as the key.
It absolutely must follow whatever is skb->dev, it is a hard
invariant.
I am not reverting this change.
^ permalink raw reply
* Re: [RFC davem] revert: net: Make skb->skb_iif always track skb->dev
From: David Miller @ 2013-01-12 21:36 UTC (permalink / raw)
To: socketcan; +Cc: netdev
In-Reply-To: <20130112.132316.2121287993605534669.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Sat, 12 Jan 2013 13:23:16 -0800 (PST)
> From: Oliver Hartkopp <socketcan@hartkopp.net>
> Date: Sat, 12 Jan 2013 14:48:14 +0100
>
>> To me it is not clear why skb_iff is needed anyway as the value should
>> always be available via skb->dev->ifindex, right?
>
> But all the code uses skb_iif, in particular the ipv4 routing
> lookups use that as the key.
>
> It absolutely must follow whatever is skb->dev, it is a hard
> invariant.
>
> I am not reverting this change.
More information, because I can't believe how idiotic and
ignorant people are being able this issue.
skb->dev->ifindex IS NOT the same as skb->skb_iif
Why don't you put a test into tcp_recvmsg() for packets being removed
from the socket's receive queue and see if skb->dev->ifindex is the
same as skb->skb_iif
Surprise, skb->dev is going to be NULL at that point.
Why?
Because on packet receive we don't take references on devices we hook
into skb->dev, therefore we cannot let that pointer escape the
software interrupt packet input paths.
Therefore, as a bug trap, TCP input will set skb->dev to NULL.
The only valid way to figure out the final demuxed device the packet
arrived on, is therefore, via skb->skb_iif.
As per your problem with CAN, that's also rediculous. You have an SKB
control block in skb->cb[] that you can put whatever values with
whatever semantics you want.
Use it.
I'm not discussing this any further.
^ permalink raw reply
* Re: [PATCH 1/3] ssb: add missing method ssb_gige_get_macaddr
From: David Miller @ 2013-01-12 23:32 UTC (permalink / raw)
To: hauke; +Cc: mcarlson, mchan, netdev, m
In-Reply-To: <1358020905-9924-2-git-send-email-hauke@hauke-m.de>
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat, 12 Jan 2013 21:01:43 +0100
> When CONFIG_SSB_DRIVER_GIGE is not set the header does not provide the
> needed method.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This isn't right.
You can't implement this function in a way that the caller cannot
determine that it didn't actually do anything.
You either have to protect calls with ifdefs or make this routine
return an error indication, in response to which the caller can
set a random ethernet address or take some other corrective action.
^ permalink raw reply
* Re: [PATCH 0/3] tg3: add support for Ethernet core in BCM4785
From: David Miller @ 2013-01-12 23:32 UTC (permalink / raw)
To: hauke; +Cc: mcarlson, mchan, netdev, m
In-Reply-To: <1358020905-9924-1-git-send-email-hauke@hauke-m.de>
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat, 12 Jan 2013 21:01:42 +0100
> These patches are adding support for the Ethernet core found in the BCM4705/BCM4785 SoC.
>
You must always indicate what tree you are targetting your changes
at, rather than have me guess.
^ permalink raw reply
* Re: [PATCH net-next] be2net: fix unconditionally returning IRQ_HANDLED in INTx
From: David Miller @ 2013-01-12 23:33 UTC (permalink / raw)
To: Sathya.Perla; +Cc: netdev
In-Reply-To: <CF9D1877D81D214CB0CA0669EFAE020C0F1F0CD6@RVEXMB1.ad.emulex.com>
From: "Perla, Sathya" <Sathya.Perla@Emulex.Com>
Date: Sat, 12 Jan 2013 16:29:36 +0000
>>-----Original Message-----
>>From: David Miller [mailto:davem@davemloft.net]
>>
>>From: Sathya Perla <sathya.perla@emulex.com>
>>Date: Sat, 12 Jan 2013 14:17:02 +0530
>>
>>> commit e49cc34f introduced an unconditional IRQ_HANDLED return in be_intx()
>>> to workaround Lancer and BE2 HW issues. This is bad as it prevents the kernel
>>> from detecting interrupt storms due to broken HW.
>>>
> ...
>>> Issue (1) can cause the notified events to be orphaned, if NAPI was already
>>> running.
>>> This patch fixes this issue by scheduling NAPI only if it is not scheduled
>>> already. Doing this also takes care of possible events_get() race that may be
>>> caused due to issue (2) and (3). Also, IRQ_HANDLED is returned only the first
>>> time zero events are detected.
>>> (Thanks Ben H. for the feedback and suggestions.)
>>>
>>> Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
>>
>>Any particular reason why we shouldn't put this fix into 'net' instead
>>of 'net-next'?
>
> Dave, this fix can surely go into "net" as the previous commit is already in Linus tree....
> I guess I requested "net-next" just out of habit.
Applied to 'net', thanks.
^ permalink raw reply
* Re: [PATCH] CDC_NCM adding support IFF_NOARP for infineon modem platform
From: David Miller @ 2013-01-12 23:35 UTC (permalink / raw)
To: cpuwolf; +Cc: gregkh, alexey.orishko, bjorn, linux-usb, netdev
In-Reply-To: <1357990479-5836-1-git-send-email-cpuwolf@gmail.com>
From: Wei Shuai <cpuwolf@gmail.com>
Date: Sat, 12 Jan 2013 19:34:39 +0800
> Infineon(now Intel) HSPA Modem platform NCM cannot support ARP. so I
> introduce a flag CDC_NCM_DRIVER_DATA_NOARP which is defined in
> driver_info:data. so later on, if more such buggy devices are found,
> they could use same flag to handle.
Is it no able to do ARP or, the more likely case, does broadcast
not work at all?
If it's the latter, IFF_NOARP is just making over the real problem.
I'm not applying this, no hardware device should set IFF_NOARP.
You probably really want IFF_POINTOPOINT or similar.
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2013-01-12 23:56 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev
1) Fix regression allowing IP_TTL setting of zero, fix from Eric
Dumazet.
2) Fix leak regressions in tunap, from Jason Wang.
3) be2net driver always returns IRQ_HANDLED in INTx handler, fix
from Sathya Perla.
4) qlge doesn't really support NETIF_F_TSO6, don't set that
flag. Fix from Amerigo Wang.
5) Add 802.11ad Atheros wil6210 driver, from Vladimir Kondratiev.
6) Fix MTU calculations in mac80211 layer, from T Krishna Chaitanya.
7) Station info layer of mac80211 needs to use del_timer_sync(),
from Johannes Berg.
8) tcp_read_sock() can loop forever, because we don't immediately
stop when recv_actor() returns zero. Fix from Eric Dumazet.
9) Fix WARN_ON() in tcp_cleanup_rbuf(). We have to use sk_eat_skb()
in tcp_recv_skb() to handle the case where a large GRO packet
is split up while it is use by a splice() operation. Fix also
from Eric Dumazet.
10) addrconf_get_prefix_route() in ipv6 tests flags incorrectly, it
does:
if (X && (p->flags & Y) != 0)
when it really meant to go:
if (X && (p->flags & X) != 0)
fix from Romain Kuntz.
11) Fix lost Kconfig dependency for bfin_mac driver hardware
timestamping. From Lars-Peter Clausen.
12) Fix regression in handling of RST without ACK in TCP, from
Eric Dumazet.
Please pull, thanks a lot!
The following changes since commit ed2c8911684ac780d051d251ad0cd9d797dd029c:
Merge tag 'sound-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound (2013-01-08 07:33:41 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net master
for you to fetch changes up to d0b9cec3e27d0e9fda2fbf6aaacece68c99b1104:
be2net: fix unconditionally returning IRQ_HANDLED in INTx (2013-01-12 15:33:01 -0800)
----------------------------------------------------------------
Amerigo Wang (1):
qlge: remove NETIF_F_TSO6 flag
Amitkumar Karwar (1):
mwifiex: fix typo in setting up ibss network parameters
Barak Witkowski (1):
bnx2x: Allow management traffic after boot from SAN
Bing Zhao (1):
mwifiex: check wait_event_interruptible return value
Chaitanya (1):
mac80211: fix maximum MTU
Chen Gang (1):
drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy
Cong Wang (1):
net: prevent setting ttl=0 via IP_TTL
Dan Carpenter (1):
bnx2x: move debugging code before the return
Emmanuel Grumbach (1):
iwlwifi: fix the reclaimed packet tracking upon flush queue
Eric Dumazet (3):
tcp: splice: fix an infinite loop in tcp_read_sock()
tcp: fix splice() and tcp collapsing interaction
tcp: accept RST without ACK flag
Felix Fietkau (1):
mac80211: flush AP_VLAN stations when tearing down the BSS AP
Jason Wang (3):
tuntap: switch to use rtnl_dereference()
tuntap: forbid calling TUNSETIFF when detached
tuntap: fix leaking reference count
Johannes Berg (5):
mac80211: assign VLAN channel contexts
mac80211: fix station destruction in AP/mesh modes
mac80211: use del_timer_sync for final sta cleanup timer deletion
mac80211: fix dtim_period in hidden SSID AP association
iwlwifi: fix PCIe interrupt handle return value
John W. Linville (3):
Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem
Julian Wollrath (1):
rtlwifi: Fix typo in debug output of rtl8192c and rtl8723ae
Larry Finger (1):
b43: Fix firmware loading when driver is built into the kernel
Lars-Peter Clausen (1):
bfin_mac: Restore hardware time-stamping dependency on BF518
Michael S. Tsirkin (1):
tun: avoid owner checks on IFF_ATTACH_QUEUE
Michal Simek (2):
net: ethernet: xilinx: Do not use axienet on PPC
net: ethernet: xilinx: Do not use NO_IRQ in axienet
Nickolai Zeldovich (1):
drivers/net/wireless/mwl8k.c: avoid use-after-free
Romain Kuntz (2):
ipv6: fix the noflags test in addrconf_get_prefix_route
ipv6: use addrconf_get_prefix_route for prefix route lookup [v2]
Sathya Perla (1):
be2net: fix unconditionally returning IRQ_HANDLED in INTx
Stanislaw Gruszka (2):
mac80211: fix ibss scanning
net, wireless: overwrite default_ethtool_ops
Stefan Hajnoczi (1):
tuntap: refuse to re-attach to different tun_struct
Thomas Pedersen (1):
mac80211: RMC buckets are just list heads
Vladimir Kondratiev (1):
wireless: add new wil6210 802.11ad 60GHz driver
Yuval Mintz (1):
bnx2x: Fix fastpath structures when memory allocation fails
MAINTAINERS | 8 +
drivers/net/ethernet/adi/Kconfig | 1 +
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 30 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 60 +++-
drivers/net/ethernet/emulex/benet/be.h | 1 +
drivers/net/ethernet/emulex/benet/be_main.c | 29 +-
drivers/net/ethernet/qlogic/qlge/qlge_main.c | 2 +-
drivers/net/ethernet/xilinx/Kconfig | 2 +-
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
drivers/net/tun.c | 44 +--
drivers/net/wireless/ath/Kconfig | 1 +
drivers/net/wireless/ath/Makefile | 1 +
drivers/net/wireless/ath/wil6210/Kconfig | 29 ++
drivers/net/wireless/ath/wil6210/Makefile | 13 +
drivers/net/wireless/ath/wil6210/cfg80211.c | 573 ++++++++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/dbg_hexdump.h | 30 ++
drivers/net/wireless/ath/wil6210/debugfs.c | 603 ++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/interrupt.c | 471 +++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/main.c | 407 ++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/netdev.c | 157 +++++++++
drivers/net/wireless/ath/wil6210/pcie_bus.c | 223 ++++++++++++
drivers/net/wireless/ath/wil6210/txrx.c | 871 ++++++++++++++++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/txrx.h | 362 +++++++++++++++++++
drivers/net/wireless/ath/wil6210/wil6210.h | 363 +++++++++++++++++++
drivers/net/wireless/ath/wil6210/wmi.c | 975 +++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/wil6210/wmi.h | 1116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/net/wireless/b43/b43.h | 5 +
drivers/net/wireless/b43/main.c | 54 ++-
drivers/net/wireless/b43/main.h | 5 +-
drivers/net/wireless/iwlegacy/3945-mac.c | 2 +-
drivers/net/wireless/iwlwifi/dvm/tx.c | 24 +-
drivers/net/wireless/iwlwifi/pcie/rx.c | 1 +
drivers/net/wireless/mwifiex/cfg80211.c | 2 +-
drivers/net/wireless/mwifiex/sta_ioctl.c | 21 +-
drivers/net/wireless/mwl8k.c | 4 +-
drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c | 2 +-
drivers/net/wireless/rtlwifi/rtl8723ae/phy.c | 2 +-
include/linux/netdevice.h | 3 +
net/core/dev.c | 8 +
net/ipv4/ip_sockglue.c | 2 +-
net/ipv4/tcp.c | 15 +-
net/ipv4/tcp_input.c | 4 +-
net/ipv6/addrconf.c | 27 +-
net/mac80211/cfg.c | 2 +
net/mac80211/chan.c | 38 ++
net/mac80211/ibss.c | 9 +-
net/mac80211/ieee80211_i.h | 16 +-
net/mac80211/iface.c | 48 ++-
net/mac80211/mesh.c | 8 +-
net/mac80211/mesh.h | 2 +-
net/mac80211/mlme.c | 75 ++--
net/mac80211/scan.c | 46 +--
net/mac80211/sta_info.c | 46 ++-
net/mac80211/sta_info.h | 3 +-
net/wireless/core.c | 3 +-
56 files changed, 6654 insertions(+), 199 deletions(-)
create mode 100644 drivers/net/wireless/ath/wil6210/Kconfig
create mode 100644 drivers/net/wireless/ath/wil6210/Makefile
create mode 100644 drivers/net/wireless/ath/wil6210/cfg80211.c
create mode 100644 drivers/net/wireless/ath/wil6210/dbg_hexdump.h
create mode 100644 drivers/net/wireless/ath/wil6210/debugfs.c
create mode 100644 drivers/net/wireless/ath/wil6210/interrupt.c
create mode 100644 drivers/net/wireless/ath/wil6210/main.c
create mode 100644 drivers/net/wireless/ath/wil6210/netdev.c
create mode 100644 drivers/net/wireless/ath/wil6210/pcie_bus.c
create mode 100644 drivers/net/wireless/ath/wil6210/txrx.c
create mode 100644 drivers/net/wireless/ath/wil6210/txrx.h
create mode 100644 drivers/net/wireless/ath/wil6210/wil6210.h
create mode 100644 drivers/net/wireless/ath/wil6210/wmi.c
create mode 100644 drivers/net/wireless/ath/wil6210/wmi.h
^ permalink raw reply
* Re: [GIT] Networking
From: Eric Dumazet @ 2013-01-13 2:03 UTC (permalink / raw)
To: David Miller; +Cc: torvalds, akpm, netdev
In-Reply-To: <20130112.155651.1165922449897847275.davem@davemloft.net>
On Sat, 2013-01-12 at 15:56 -0800, David Miller wrote:
> 1) Fix regression allowing IP_TTL setting of zero, fix from Eric
> Dumazet.
To be fair, I added this bug some time ago, and Cong Wang did the fix ;)
Thanks !
^ permalink raw reply
* [PATCH net-next] pkt_sched: namespace aware ifb
From: Eric Dumazet @ 2013-01-13 3:06 UTC (permalink / raw)
To: David Miller; +Cc: socketcan, netdev
In-Reply-To: <20130112.133630.257139657732337147.davem@davemloft.net>
From: Eric Dumazet <edumazet@google.com>
act_mirred needs to find the current net_ns, and struct net
pointer is not provided in the call chain. We run in process
context and current->nsproxy->net_ns is the needed pointer.
For ifb, things are easier, as the current ifb device can provide
the net pointer immediately.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/ifb.c | 2 +-
net/sched/act_mirred.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 344dceb..8216438 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -90,7 +90,7 @@ static void ri_tasklet(unsigned long dev)
u64_stats_update_end(&dp->tsync);
rcu_read_lock();
- skb->dev = dev_get_by_index_rcu(&init_net, skb->skb_iif);
+ skb->dev = dev_get_by_index_rcu(dev_net(_dev), skb->skb_iif);
if (!skb->dev) {
rcu_read_unlock();
dev_kfree_skb(skb);
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 9c0fd0c..f5a7e18 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -88,7 +88,7 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est,
return -EINVAL;
}
if (parm->ifindex) {
- dev = __dev_get_by_index(&init_net, parm->ifindex);
+ dev = __dev_get_by_index(current->nsproxy->net_ns, parm->ifindex);
if (dev == NULL)
return -ENODEV;
switch (dev->type) {
^ permalink raw reply related
* Re: [PATCH] mm: compaction: Partially revert capture of suitable high-order page
From: Simon Jeons @ 2013-01-13 3:07 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Eric Wong, Eric Dumazet, Rik van Riel, Minchan Kim,
Linus Torvalds, linux-mm, netdev, linux-kernel
In-Reply-To: <20130111092701.GK13304@suse.de>
On Fri, 2013-01-11 at 09:27 +0000, Mel Gorman wrote:
> Eric Wong reported on 3.7 and 3.8-rc2 that ppoll() got stuck when waiting
> for POLLIN on a local TCP socket. It was easier to trigger if there was disk
> IO and dirty pages at the same time and he bisected it to commit 1fb3f8ca
> "mm: compaction: capture a suitable high-order page immediately when it
> is made available".
>
> The intention of that patch was to improve high-order allocations under
> memory pressure after changes made to reclaim in 3.6 drastically hurt
> THP allocations but the approach was flawed. For Eric, the problem was
> that page->pfmemalloc was not being cleared for captured pages leading to
> a poor interaction with swap-over-NFS support causing the packets to be
> dropped. However, I identified a few more problems with the patch including
> the fact that it can increase contention on zone->lock in some cases which
> could result in async direct compaction being aborted early.
>
> In retrospect the capture patch took the wrong approach. What it should
> have done is mark the pageblock being migrated as MIGRATE_ISOLATE if it
> was allocating for THP and avoided races that way. While the patch was
Hi Mel,
Mark pageblock being migrated as MIGRATE_ISOLATE if it was allocating
for THP and avoided races that way is a good idea. But why I can't see
you do it in this patch?
> showing to improve allocation success rates at the time, the benefit is
> marginal given the relative complexity and it should be revisited from
> scratch in the context of the other reclaim-related changes that have taken
> place since the patch was first written and tested. This patch partially
> reverts commit 1fb3f8ca "mm: compaction: capture a suitable high-order
> page immediately when it is made available".
>
> Reported-and-tested-by: Eric Wong <normalperson@yhbt.net>
> Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Mel Gorman <mgorman@suse.de>
> ---
> include/linux/compaction.h | 4 +-
> include/linux/mm.h | 1 -
> mm/compaction.c | 92 +++++++-------------------------------------
> mm/internal.h | 1 -
> mm/page_alloc.c | 35 ++++-------------
> 5 files changed, 23 insertions(+), 110 deletions(-)
>
> diff --git a/include/linux/compaction.h b/include/linux/compaction.h
> index 6ecb6dc..cc7bdde 100644
> --- a/include/linux/compaction.h
> +++ b/include/linux/compaction.h
> @@ -22,7 +22,7 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
> extern int fragmentation_index(struct zone *zone, unsigned int order);
> extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
> int order, gfp_t gfp_mask, nodemask_t *mask,
> - bool sync, bool *contended, struct page **page);
> + bool sync, bool *contended);
> extern int compact_pgdat(pg_data_t *pgdat, int order);
> extern void reset_isolation_suitable(pg_data_t *pgdat);
> extern unsigned long compaction_suitable(struct zone *zone, int order);
> @@ -75,7 +75,7 @@ static inline bool compaction_restarting(struct zone *zone, int order)
> #else
> static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
> int order, gfp_t gfp_mask, nodemask_t *nodemask,
> - bool sync, bool *contended, struct page **page)
> + bool sync, bool *contended)
> {
> return COMPACT_CONTINUE;
> }
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 6320407..66e2f7c 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -455,7 +455,6 @@ void put_pages_list(struct list_head *pages);
>
> void split_page(struct page *page, unsigned int order);
> int split_free_page(struct page *page);
> -int capture_free_page(struct page *page, int alloc_order, int migratetype);
>
> /*
> * Compound pages have a destructor function. Provide a
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 6b807e4..2c57043 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -816,6 +816,7 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
> static int compact_finished(struct zone *zone,
> struct compact_control *cc)
> {
> + unsigned int order;
> unsigned long watermark;
>
> if (fatal_signal_pending(current))
> @@ -850,22 +851,16 @@ static int compact_finished(struct zone *zone,
> return COMPACT_CONTINUE;
>
> /* Direct compactor: Is a suitable page free? */
> - if (cc->page) {
> - /* Was a suitable page captured? */
> - if (*cc->page)
> + for (order = cc->order; order < MAX_ORDER; order++) {
> + struct free_area *area = &zone->free_area[order];
> +
> + /* Job done if page is free of the right migratetype */
> + if (!list_empty(&area->free_list[cc->migratetype]))
> + return COMPACT_PARTIAL;
> +
> + /* Job done if allocation would set block type */
> + if (cc->order >= pageblock_order && area->nr_free)
> return COMPACT_PARTIAL;
> - } else {
> - unsigned int order;
> - for (order = cc->order; order < MAX_ORDER; order++) {
> - struct free_area *area = &zone->free_area[cc->order];
> - /* Job done if page is free of the right migratetype */
> - if (!list_empty(&area->free_list[cc->migratetype]))
> - return COMPACT_PARTIAL;
> -
> - /* Job done if allocation would set block type */
> - if (cc->order >= pageblock_order && area->nr_free)
> - return COMPACT_PARTIAL;
> - }
> }
>
> return COMPACT_CONTINUE;
> @@ -921,60 +916,6 @@ unsigned long compaction_suitable(struct zone *zone, int order)
> return COMPACT_CONTINUE;
> }
>
> -static void compact_capture_page(struct compact_control *cc)
> -{
> - unsigned long flags;
> - int mtype, mtype_low, mtype_high;
> -
> - if (!cc->page || *cc->page)
> - return;
> -
> - /*
> - * For MIGRATE_MOVABLE allocations we capture a suitable page ASAP
> - * regardless of the migratetype of the freelist is is captured from.
> - * This is fine because the order for a high-order MIGRATE_MOVABLE
> - * allocation is typically at least a pageblock size and overall
> - * fragmentation is not impaired. Other allocation types must
> - * capture pages from their own migratelist because otherwise they
> - * could pollute other pageblocks like MIGRATE_MOVABLE with
> - * difficult to move pages and making fragmentation worse overall.
> - */
> - if (cc->migratetype == MIGRATE_MOVABLE) {
> - mtype_low = 0;
> - mtype_high = MIGRATE_PCPTYPES;
> - } else {
> - mtype_low = cc->migratetype;
> - mtype_high = cc->migratetype + 1;
> - }
> -
> - /* Speculatively examine the free lists without zone lock */
> - for (mtype = mtype_low; mtype < mtype_high; mtype++) {
> - int order;
> - for (order = cc->order; order < MAX_ORDER; order++) {
> - struct page *page;
> - struct free_area *area;
> - area = &(cc->zone->free_area[order]);
> - if (list_empty(&area->free_list[mtype]))
> - continue;
> -
> - /* Take the lock and attempt capture of the page */
> - if (!compact_trylock_irqsave(&cc->zone->lock, &flags, cc))
> - return;
> - if (!list_empty(&area->free_list[mtype])) {
> - page = list_entry(area->free_list[mtype].next,
> - struct page, lru);
> - if (capture_free_page(page, cc->order, mtype)) {
> - spin_unlock_irqrestore(&cc->zone->lock,
> - flags);
> - *cc->page = page;
> - return;
> - }
> - }
> - spin_unlock_irqrestore(&cc->zone->lock, flags);
> - }
> - }
> -}
> -
> static int compact_zone(struct zone *zone, struct compact_control *cc)
> {
> int ret;
> @@ -1054,9 +995,6 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
> goto out;
> }
> }
> -
> - /* Capture a page now if it is a suitable size */
> - compact_capture_page(cc);
> }
>
> out:
> @@ -1069,8 +1007,7 @@ out:
>
> static unsigned long compact_zone_order(struct zone *zone,
> int order, gfp_t gfp_mask,
> - bool sync, bool *contended,
> - struct page **page)
> + bool sync, bool *contended)
> {
> unsigned long ret;
> struct compact_control cc = {
> @@ -1080,7 +1017,6 @@ static unsigned long compact_zone_order(struct zone *zone,
> .migratetype = allocflags_to_migratetype(gfp_mask),
> .zone = zone,
> .sync = sync,
> - .page = page,
> };
> INIT_LIST_HEAD(&cc.freepages);
> INIT_LIST_HEAD(&cc.migratepages);
> @@ -1110,7 +1046,7 @@ int sysctl_extfrag_threshold = 500;
> */
> unsigned long try_to_compact_pages(struct zonelist *zonelist,
> int order, gfp_t gfp_mask, nodemask_t *nodemask,
> - bool sync, bool *contended, struct page **page)
> + bool sync, bool *contended)
> {
> enum zone_type high_zoneidx = gfp_zone(gfp_mask);
> int may_enter_fs = gfp_mask & __GFP_FS;
> @@ -1136,7 +1072,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist,
> int status;
>
> status = compact_zone_order(zone, order, gfp_mask, sync,
> - contended, page);
> + contended);
> rc = max(status, rc);
>
> /* If a normal allocation would succeed, stop compacting */
> @@ -1192,7 +1128,6 @@ int compact_pgdat(pg_data_t *pgdat, int order)
> struct compact_control cc = {
> .order = order,
> .sync = false,
> - .page = NULL,
> };
>
> return __compact_pgdat(pgdat, &cc);
> @@ -1203,7 +1138,6 @@ static int compact_node(int nid)
> struct compact_control cc = {
> .order = -1,
> .sync = true,
> - .page = NULL,
> };
>
> return __compact_pgdat(NODE_DATA(nid), &cc);
> diff --git a/mm/internal.h b/mm/internal.h
> index d597f94..9ba2110 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -135,7 +135,6 @@ struct compact_control {
> int migratetype; /* MOVABLE, RECLAIMABLE etc */
> struct zone *zone;
> bool contended; /* True if a lock was contended */
> - struct page **page; /* Page captured of requested size */
> };
>
> unsigned long
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 4ba5e37..7e4ae85 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1389,14 +1389,8 @@ void split_page(struct page *page, unsigned int order)
> set_page_refcounted(page + i);
> }
>
> -/*
> - * Similar to the split_page family of functions except that the page
> - * required at the given order and being isolated now to prevent races
> - * with parallel allocators
> - */
> -int capture_free_page(struct page *page, int alloc_order, int migratetype)
> +static int __isolate_free_page(struct page *page, unsigned int order)
> {
> - unsigned int order;
> unsigned long watermark;
> struct zone *zone;
> int mt;
> @@ -1404,7 +1398,6 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
> BUG_ON(!PageBuddy(page));
>
> zone = page_zone(page);
> - order = page_order(page);
> mt = get_pageblock_migratetype(page);
>
> if (mt != MIGRATE_ISOLATE) {
> @@ -1413,7 +1406,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
> if (!zone_watermark_ok(zone, 0, watermark, 0, 0))
> return 0;
>
> - __mod_zone_freepage_state(zone, -(1UL << alloc_order), mt);
> + __mod_zone_freepage_state(zone, -(1UL << order), mt);
> }
>
> /* Remove page from free list */
> @@ -1421,11 +1414,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
> zone->free_area[order].nr_free--;
> rmv_page_order(page);
>
> - if (alloc_order != order)
> - expand(zone, page, alloc_order, order,
> - &zone->free_area[order], migratetype);
> -
> - /* Set the pageblock if the captured page is at least a pageblock */
> + /* Set the pageblock if the isolated page is at least a pageblock */
> if (order >= pageblock_order - 1) {
> struct page *endpage = page + (1 << order) - 1;
> for (; page < endpage; page += pageblock_nr_pages) {
> @@ -1436,7 +1425,7 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype)
> }
> }
>
> - return 1UL << alloc_order;
> + return 1UL << order;
> }
>
> /*
> @@ -1454,10 +1443,9 @@ int split_free_page(struct page *page)
> unsigned int order;
> int nr_pages;
>
> - BUG_ON(!PageBuddy(page));
> order = page_order(page);
>
> - nr_pages = capture_free_page(page, order, 0);
> + nr_pages = __isolate_free_page(page, order);
> if (!nr_pages)
> return 0;
>
> @@ -2163,8 +2151,6 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
> bool *contended_compaction, bool *deferred_compaction,
> unsigned long *did_some_progress)
> {
> - struct page *page = NULL;
> -
> if (!order)
> return NULL;
>
> @@ -2176,16 +2162,12 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
> current->flags |= PF_MEMALLOC;
> *did_some_progress = try_to_compact_pages(zonelist, order, gfp_mask,
> nodemask, sync_migration,
> - contended_compaction, &page);
> + contended_compaction);
> current->flags &= ~PF_MEMALLOC;
>
> - /* If compaction captured a page, prep and use it */
> - if (page) {
> - prep_new_page(page, order, gfp_mask);
> - goto got_page;
> - }
> -
> if (*did_some_progress != COMPACT_SKIPPED) {
> + struct page *page;
> +
> /* Page migration frees to the PCP lists but we want merging */
> drain_pages(get_cpu());
> put_cpu();
> @@ -2195,7 +2177,6 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
> alloc_flags & ~ALLOC_NO_WATERMARKS,
> preferred_zone, migratetype);
> if (page) {
> -got_page:
> preferred_zone->compact_blockskip_flush = false;
> preferred_zone->compact_considered = 0;
> preferred_zone->compact_defer_shift = 0;
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Simon Jeons <simon.jeons@gmail.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH net-next] pkt_sched: namespace aware ifb
From: Benjamin LaHaise @ 2013-01-13 3:50 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, socketcan, netdev
In-Reply-To: <1358046374.20249.1789.camel@edumazet-glaptop>
On Sat, Jan 12, 2013 at 07:06:14PM -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> act_mirred needs to find the current net_ns, and struct net
> pointer is not provided in the call chain. We run in process
> context and current->nsproxy->net_ns is the needed pointer.
...
I don't think this is correct. Going by the call chain, tcf_action_add can
be called because of a netlink message, and that netlink message may not be
in the same "struct net" as the current process. It looks like the ->init
operation is going to need to have the namespace passed in for this to work
correctly.
-ben
> diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
> index 9c0fd0c..f5a7e18 100644
> --- a/net/sched/act_mirred.c
> +++ b/net/sched/act_mirred.c
> @@ -88,7 +88,7 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est,
> return -EINVAL;
> }
> if (parm->ifindex) {
> - dev = __dev_get_by_index(&init_net, parm->ifindex);
> + dev = __dev_get_by_index(current->nsproxy->net_ns, parm->ifindex);
> if (dev == NULL)
> return -ENODEV;
> switch (dev->type) {
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
"Thought is the essence of where you are now."
^ permalink raw reply
* Re: [RFC PATCH 6/6] ipv6: IPv6 over IEEE1394 (RFC3146) support.
From: YOSHIFUJI Hideaki @ 2013-01-13 3:57 UTC (permalink / raw)
To: stephan.gatzka; +Cc: Stefan Richter, netdev, linux1394-devel, YOSHIFUJI Hideaki
In-Reply-To: <50F192DF.9090100@gmail.com>
Stephan Gatzka wrote:
>> How about putting EUI64, maxrec, sspd and fifo in dev->dev_addr?
>> This enable us to send NDISC/ARP packet easily (based on neighbor
>> cache entry), and driver can be notified for new neighbors (thus
>> new peers).
> Hm, that looks a bit strange to me, because we need that only for link layer option packets and not for every IPv6 packet transmitted via firewire.
It seems the stack will be clearner, overall.
In addition to ARP/NDP things, for example, it will become easier to
implement multicast as well; IP layer can tell net_device layer
multicast listener information via special mapping.
Given multicast bit is disabled in the Unique ID (well, it should be
disabled; otherwise, disable multicast bit and trun on locally
administrated bit), IP layer can tell full IPv6 address via
ip6_mc_map() by copying full IPv6 address to EUI-64 + additional
space, e.g:
IPv6: FF xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx (IPv6 mutlicast address (FF00::/8))
Similar in IPv4:
IPv4: 01 00 00 00 00 00 00 00 00 00 00 00 xx xx xx xx (IPv4 multicast address)
Device will be notified via dev_mc_add() / dev_mc_del(),
then net_device_opts->ndo_set_rx_mode(), and you can manage
multicast lists based on that.
When sending the driver can determine if the packet is multicast or not
by seeing 0x01 bit in the first octet in the destination virtual
"MAC" address, and then MCAP manager can determine IP version by seeing
the first octet of our virtual "MAC" address.
--yoshfuji
^ permalink raw reply
* Regression in 3.6+: fib_validate_source breakage
From: Phil Oester @ 2013-01-13 4:45 UTC (permalink / raw)
To: netdev
In commit 7a9bc9b81a (Elide fib_validate_source() completely when possible) it
was stated:
If rpfilter is off (or the SKB has an IPSEC path) and there are not
tclassid users, we don't have to do anything at all when
fib_validate_source() is invoked besides setting the itag to zero.
However, this change was later proven to break redirects, fixed in commit
e81da0e113 (ipv4: fix sending of redirects).
In addition to this breakage, it also bypassed another necessary check, as
clearly stated in the preamble comment to fib_validate_source:
* - (main) check, that source is valid i.e. not broadcast or our local
* address.
Without this check (and if rp_filter is NOT enabled), packets with local source
addresses are accepted by the stack. This only came to light due to a buggy
switch which is occasionally reflecting packets back at a box running a VRRP
daemon, causing the local box to believe it has seen a higher priority
advertisement, when in reality it is only seeing a copy of its own advertisement.
Prior to 3.6, these packets would be silently dropped.
Also, not that I use it, but accept_local handling appears to now be broken.
I realize the original change likely made the route cache removal more palatable,
but given the number of issues it has caused, perhaps a revert is in order?
I can't find any easy alternative fix.
Phil Oester
^ permalink raw reply
* Re: [PATCH net-next] pkt_sched: namespace aware ifb
From: Eric Dumazet @ 2013-01-13 5:49 UTC (permalink / raw)
To: Benjamin LaHaise; +Cc: David Miller, socketcan, netdev
In-Reply-To: <20130113035013.GJ5259@kvack.org>
On Sat, 2013-01-12 at 22:50 -0500, Benjamin LaHaise wrote:
> On Sat, Jan 12, 2013 at 07:06:14PM -0800, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> >
> > act_mirred needs to find the current net_ns, and struct net
> > pointer is not provided in the call chain. We run in process
> > context and current->nsproxy->net_ns is the needed pointer.
> ...
>
> I don't think this is correct. Going by the call chain, tcf_action_add can
> be called because of a netlink message, and that netlink message may not be
> in the same "struct net" as the current process. It looks like the ->init
> operation is going to need to have the namespace passed in for this to work
> correctly.
But it is working in my tests.
I added a WARN and the call stack is :
[ 701.522282] [<ffffffff8108634f>] warn_slowpath_common+0x7f/0xc0
[ 701.522284] [<ffffffff810863aa>] warn_slowpath_null+0x1a/0x20
[ 701.522286] [<ffffffffa00e00e3>] tcf_mirred_init+0x43/0x340 [act_mirred]
[ 701.522289] [<ffffffff81506385>] ? __rtnl_unlock+0x15/0x20
[ 701.522293] [<ffffffff815195e8>] tcf_action_init_1+0x198/0x1e0
[ 701.522295] [<ffffffff815196c8>] tcf_action_init+0x98/0x100
[ 701.522298] [<ffffffff81517f30>] tcf_exts_validate+0x90/0xb0
[ 701.522300] [<ffffffff8151e55b>] u32_set_parms.isra.11+0x3b/0x270
[ 701.522303] [<ffffffff812ffdf0>] ? nla_parse+0x90/0xe0
[ 701.522304] [<ffffffff8151ed16>] u32_change+0x2e6/0x4c0
[ 701.522306] [<ffffffff81518432>] tc_ctl_tfilter+0x4e2/0x720
[ 701.522308] [<ffffffff815064ad>] rtnetlink_rcv_msg+0x11d/0x310
[ 701.522310] [<ffffffff81506390>] ? __rtnl_unlock+0x20/0x20
[ 701.522312] [<ffffffff81522d39>] netlink_rcv_skb+0xa9/0xd0
[ 701.522314] [<ffffffff81503875>] rtnetlink_rcv+0x25/0x40
[ 701.522316] [<ffffffff81522681>] netlink_unicast+0x1b1/0x230
[ 701.522317] [<ffffffff815229fe>] netlink_sendmsg+0x2fe/0x3b0
[ 701.522321] [<ffffffff814dbdf2>] sock_sendmsg+0xd2/0xf0
[ 701.522323] [<ffffffff814dbca0>] ? sock_recvmsg+0xe0/0x100
[ 701.522326] [<ffffffff814dd0f0>] __sys_sendmsg+0x380/0x390
[ 701.522329] [<ffffffff815b20b4>] ? __do_page_fault+0x214/0x460
[ 701.522331] [<ffffffff814df4e9>] sys_sendmsg+0x49/0x90
[ 701.522334] [<ffffffff815b68c2>] system_call_fastpath+0x16/0x1b
Could you elaborate on what could be the problem ?
We hold the RTNL, so I dont think another process could possibly call
tcf_mirred_init()
^ permalink raw reply
* [PATCH net-next] ipv6 route: Use ipv6_addr_hash() in rt6_info_hash_nhsfn().
From: YOSHIFUJI Hideaki @ 2013-01-13 8:32 UTC (permalink / raw)
To: davem, netdev; +Cc: yoshfuji
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/route.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 621b68e..c408566 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -388,15 +388,8 @@ static int rt6_info_hash_nhsfn(unsigned int candidate_count,
{
unsigned int val = fl6->flowi6_proto;
- val ^= (__force u32)fl6->daddr.s6_addr32[0];
- val ^= (__force u32)fl6->daddr.s6_addr32[1];
- val ^= (__force u32)fl6->daddr.s6_addr32[2];
- val ^= (__force u32)fl6->daddr.s6_addr32[3];
-
- val ^= (__force u32)fl6->saddr.s6_addr32[0];
- val ^= (__force u32)fl6->saddr.s6_addr32[1];
- val ^= (__force u32)fl6->saddr.s6_addr32[2];
- val ^= (__force u32)fl6->saddr.s6_addr32[3];
+ val ^= ipv6_addr_hash(&fl6->daddr);
+ val ^= ipv6_addr_hash(&fl6->saddr);
/* Work only if this not encapsulated */
switch (fl6->flowi6_proto) {
--
1.7.9.5
^ permalink raw reply related
* [PATCH net-next] ipv6 xfrm: Use ipv6_addr_hash() in xfrm6_tunnel_spi_hash_byaddr().
From: YOSHIFUJI Hideaki @ 2013-01-13 8:32 UTC (permalink / raw)
To: davem, netdev; +Cc: yoshfuji
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/xfrm6_tunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index ee5a706..babd167 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -72,7 +72,7 @@ static inline unsigned int xfrm6_tunnel_spi_hash_byaddr(const xfrm_address_t *ad
{
unsigned int h;
- h = (__force u32)(addr->a6[0] ^ addr->a6[1] ^ addr->a6[2] ^ addr->a6[3]);
+ h = ipv6_addr_hash((const struct in6_addr *)addr);
h ^= h >> 16;
h ^= h >> 8;
h &= XFRM6_TUNNEL_SPI_BYADDR_HSIZE - 1;
--
1.7.9.5
^ permalink raw reply related
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