* [PATCH 2/3] bnx2x: do not set NETIF_F_LRO in bnx2x_init_bp
From: Michal Schmidt @ 2011-08-31 15:00 UTC (permalink / raw)
To: netdev; +Cc: vladz, dmitry, eilong, mirqus
In-Reply-To: <1314802836-9862-1-git-send-email-mschmidt@redhat.com>
bnx2x_fix_features() will take care of clearing NETIF_F_LRO if
'disable_tpa' is used.
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index fd32c04..c1285db 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -9755,12 +9755,6 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
"must load devices in order!\n");
bp->multi_mode = multi_mode;
-
- /* Set TPA flags */
- if (disable_tpa)
- bp->dev->features &= ~NETIF_F_LRO;
- else
- bp->dev->features |= NETIF_F_LRO;
bp->disable_tpa = disable_tpa;
if (CHIP_IS_E1(bp))
--
1.7.6
^ permalink raw reply related
* [PATCH 3/3] bnx2x: expose HW RX VLAN stripping toggle
From: Michal Schmidt @ 2011-08-31 15:00 UTC (permalink / raw)
To: netdev; +Cc: vladz, dmitry, eilong, mirqus
In-Reply-To: <1314802836-9862-1-git-send-email-mschmidt@redhat.com>
Allow disabling of HW RX VLAN stripping with ethtool.
[v3: per-queue flag was overkill, store the HW config in bp.
Suggestions by Vlad Zolotarov and Michał Mirosław.]
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 20 +++++++++++++++-----
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 10 +++++-----
3 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 5d5f323..b85017e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -1174,7 +1174,7 @@ struct bnx2x {
#define USING_MSIX_FLAG (1 << 5)
#define USING_MSI_FLAG (1 << 6)
#define DISABLE_MSI_FLAG (1 << 7)
-
+#define RX_VLAN_STRIP_FLAG (1 << 8)
#define NO_MCP_FLAG (1 << 9)
#define BP_NOMCP(bp) (bp->flags & NO_MCP_FLAG)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index c660317..6e1b4b4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -385,6 +385,10 @@ static inline u16 bnx2x_set_lro_mss(struct bnx2x *bp, u16 parsing_flags,
else /* IPv4 */
hdrs_len += sizeof(struct iphdr);
+ /* VLAN header present and not stripped by HW */
+ if ((parsing_flags & PARSING_FLAGS_VLAN) &&
+ !(bp->flags & RX_VLAN_STRIP_FLAG))
+ hdrs_len += VLAN_HLEN;
/* Check if there was a TCP timestamp, if there is it's will
* always be 12 bytes length: nop nop kind length echo val.
@@ -412,7 +416,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,
frag_size = le16_to_cpu(cqe->pkt_len) - len_on_bd;
pages = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT;
- /* This is needed in order to enable forwarding support */
+ /* Doing LRO, let TCP know the receive MSS */
if (frag_size)
skb_shinfo(skb)->gso_size = bnx2x_set_lro_mss(bp,
tpa_info->parsing_flags, len_on_bd);
@@ -514,7 +518,8 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
skb->ip_summed = CHECKSUM_UNNECESSARY;
if (!bnx2x_fill_frag_skb(bp, fp, queue, skb, cqe, cqe_idx)) {
- if (tpa_info->parsing_flags & PARSING_FLAGS_VLAN)
+ if ((tpa_info->parsing_flags & PARSING_FLAGS_VLAN) &&
+ (bp->flags & RX_VLAN_STRIP_FLAG))
__vlan_hwaccel_put_tag(skb, tpa_info->vlan_tag);
napi_gro_receive(&fp->napi, skb);
} else {
@@ -745,8 +750,8 @@ reuse_rx:
skb_record_rx_queue(skb, fp->index);
- if (le16_to_cpu(cqe_fp->pars_flags.flags) &
- PARSING_FLAGS_VLAN)
+ if ((le16_to_cpu(cqe_fp->pars_flags.flags) &
+ PARSING_FLAGS_VLAN) && (bp->flags & RX_VLAN_STRIP_FLAG))
__vlan_hwaccel_put_tag(skb,
le16_to_cpu(cqe_fp->vlan_tag));
napi_gro_receive(&fp->napi, skb);
@@ -1711,6 +1716,11 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
bp->state = BNX2X_STATE_OPENING_WAIT4_LOAD;
+ if (bp->dev->features & NETIF_F_HW_VLAN_RX)
+ bp->flags |= RX_VLAN_STRIP_FLAG;
+ else
+ bp->flags &= ~RX_VLAN_STRIP_FLAG;
+
/* Set the initial link reported state to link down */
bnx2x_acquire_phy_lock(bp);
memset(&bp->last_reported_link, 0, sizeof(bp->last_reported_link));
@@ -3412,7 +3422,7 @@ int bnx2x_set_features(struct net_device *dev, u32 features)
struct bnx2x *bp = netdev_priv(dev);
bool bnx2x_reload = false;
- if ((features ^ dev->features) & NETIF_F_LRO)
+ if ((features ^ dev->features) & (NETIF_F_LRO | NETIF_F_HW_VLAN_RX))
bnx2x_reload = true;
if (features & NETIF_F_LOOPBACK) {
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index c1285db..e61be4e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -2720,9 +2720,8 @@ static inline unsigned long bnx2x_get_q_flags(struct bnx2x *bp,
__set_bit(BNX2X_Q_FLG_MCAST, &flags);
}
- /* Always set HW VLAN stripping */
- __set_bit(BNX2X_Q_FLG_VLAN, &flags);
-
+ if (bp->flags & RX_VLAN_STRIP_FLAG)
+ __set_bit(BNX2X_Q_FLG_VLAN, &flags);
return flags | bnx2x_get_common_flags(bp, fp, true);
}
@@ -10265,12 +10264,13 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_LRO |
- NETIF_F_RXCSUM | NETIF_F_RXHASH | NETIF_F_HW_VLAN_TX;
+ NETIF_F_RXCSUM | NETIF_F_RXHASH |
+ NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA;
- dev->features |= dev->hw_features | NETIF_F_HW_VLAN_RX;
+ dev->features |= dev->hw_features;
if (bp->flags & USING_DAC_FLAG)
dev->features |= NETIF_F_HIGHDMA;
--
1.7.6
^ permalink raw reply related
* Re: [PATCH 7/7] bnx2x: expose HW RX VLAN stripping toggle
From: Vlad Zolotarov @ 2011-08-31 15:07 UTC (permalink / raw)
To: Michal Schmidt
Cc: Michał Mirosław, netdev@vger.kernel.org, Dmitry Kravkov,
Eilon Greenstein
In-Reply-To: <20110831155324.7554d035@alice>
On Wednesday 31 August 2011 16:53:24 Michal Schmidt wrote:
> On Wed, 31 Aug 2011 15:01:39 +0300 Vlad Zolotarov wrote:
> > On Tuesday 30 August 2011 22:30:11 Michal Schmidt wrote:
> > > > and then also in fp->flags. Are the
> > > > fp->flags strictly mirroring hardware state (as in: there is no
> > > > way the states can differ in any point in time where the flags are
> > > > tested)?
> > >
> > > Yes. This is the purpose of the second mirroring of the flag.
> >
> > Michal,
> > although the above is true i'd say it's a bit of an overkill:
> > RX VLAN stripping is configured in a function level, so keeping it in
> > a per queue level is not needed.
> >
> > The problem u were trying to resolve (and u resolved it) was to
> > separate the RX_VLAN_ENABLED flag semantics into two: requested
> > feature and HW configured feature in order to further check the
> > second in the fast path, while setting the first one in the
> > set_features(). Then the second lag is updated according to the first
> > one during the loading of the function (bnx2x_nic_load()).
> >
> > Therefore it would be enough to just add those two flags in the
> > function (bp) level keeping the rest of your patch as it is. This
> > would also cancel the need for a patch 6.
>
> Alright, I will remove the per-fp flag and move it to bp.
>
> I will also apply the cheat suggested by Michał, so that:
> - dev->features & NETIF_F_HW_VLAN_RX is the requested state
> - bp->flags & RX_VLAN_STRIP_FLAG is the HW configured state
> => Only one new bp flag needed, not two.
>
> BTW, Michał's cheat should apply to TPA_ENABLE_FLAG as well - it only
> mirrors NETIF_F_LRO. But for TPA the HW configured state is really
> per-queue (fp->disable_tpa). I will remove TPA_ENABLE_FLAG unless you
> object to Michał's "cheat".
I agree the TPA_ENABLE_FLAG may and should be removed.
However I didn’t like the idea of relying on the current implementation
of the calling function (__netdev_update_features()). If u want to change
the implementation the way we rely on the dev->features in the
ndo_set_features() flow, which is a semantics change, u'd rather change
the __netdev_update_features() so that it sets the dev->features before
ndo_set_features() call and restores it in case of a failure. Something like this:
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0a7f619..a5f6d3e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -943,8 +943,7 @@ struct net_device_ops {
struct net_device *slave_dev);
u32 (*ndo_fix_features)(struct net_device *dev,
u32 features);
- int (*ndo_set_features)(struct net_device *dev,
- u32 features);
+ int (*ndo_set_features)(struct net_device *dev);
};
/*
diff --git a/net/core/dev.c b/net/core/dev.c
index b2e262e..474e539 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5321,7 +5321,7 @@ static u32 netdev_fix_features(struct net_device *dev, u32 features)
int __netdev_update_features(struct net_device *dev)
{
- u32 features;
+ u32 features, old_features;
int err = 0;
ASSERT_RTNL();
@@ -5340,19 +5340,23 @@ int __netdev_update_features(struct net_device *dev)
netdev_dbg(dev, "Features changed: 0x%08x -> 0x%08x\n",
dev->features, features);
+ /* Remember the original features and set the new ones */
+ old_features = dev->features;
+ dev->features = features;
+
if (dev->netdev_ops->ndo_set_features)
- err = dev->netdev_ops->ndo_set_features(dev, features);
+ err = dev->netdev_ops->ndo_set_features(dev);
if (unlikely(err < 0)) {
+ /* Restore the original features */
+ dev->features = old_features;
+
netdev_err(dev,
"set_features() failed (%d); wanted 0x%08x, left 0x%08x\n",
err, features, dev->features);
return -1;
}
- if (!err)
- dev->features = features;
-
return 1;
}
However, this would involve updating all other L2 drivers that implement ndo_set_features().
Pls., comment.
thanks,
vlad
>
> Thanks,
> Michal
^ permalink raw reply related
* [PATCH] iPhone 4 Verizon CDMA USB Product ID add
From: Kavan Smith @ 2011-08-31 15:12 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Kavan Smith
Add USB product ID for iPhone 4 CDMA Verizon
Tested on at least 2 devices
Signed-off-by: Kavan Smith <kavansmith82-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/net/usb/ipheth.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 15772b1..13c1f04 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -59,6 +59,7 @@
#define USB_PRODUCT_IPHONE_3G 0x1292
#define USB_PRODUCT_IPHONE_3GS 0x1294
#define USB_PRODUCT_IPHONE_4 0x1297
+#define USB_PRODUCT_IPHONE_4_VZW 0x129c
#define IPHETH_USBINTF_CLASS 255
#define IPHETH_USBINTF_SUBCLASS 253
@@ -98,6 +99,10 @@ static struct usb_device_id ipheth_table[] = {
USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4,
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
IPHETH_USBINTF_PROTO) },
+ { USB_DEVICE_AND_INTERFACE_INFO(
+ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
+ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
+ IPHETH_USBINTF_PROTO) },
{ }
};
MODULE_DEVICE_TABLE(usb, ipheth_table);
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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 related
* [patch net-next-2.6] net: allow notifier subscribers to forbid device from closing
From: Jiri Pirko @ 2011-08-31 15:15 UTC (permalink / raw)
To: netdev; +Cc: davem, eric.dumazet, bhutchings, shemminger
In some situations, like when the device is used as slave device in
bond/br/etc it is not nice if someone closes the device. This allows
it's masters to forbid this closure.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
include/linux/netdevice.h | 1 +
net/core/dev.c | 34 ++++++++++++++++++++++++++++------
net/core/rtnetlink.c | 1 +
3 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index dad7e4d..b8047d3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1559,6 +1559,7 @@ struct packet_type {
#define NETDEV_RELEASE 0x0012
#define NETDEV_NOTIFY_PEERS 0x0013
#define NETDEV_JOIN 0x0014
+#define NETDEV_PRE_DOWN 0x0015
extern int register_netdevice_notifier(struct notifier_block *nb);
extern int unregister_netdevice_notifier(struct notifier_block *nb);
diff --git a/net/core/dev.c b/net/core/dev.c
index 11b0fc7..d252a7e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1253,11 +1253,24 @@ static int __dev_close_many(struct list_head *head)
return 0;
}
+static int __dev_pre_close(struct net_device *dev)
+{
+ int err;
+
+ err = call_netdevice_notifiers(NETDEV_PRE_DOWN, dev);
+ if (err)
+ return notifier_to_errno(err);
+ return 0;
+}
+
static int __dev_close(struct net_device *dev)
{
int retval;
LIST_HEAD(single);
+ retval = __dev_pre_close(dev);
+ if (retval)
+ return retval;
list_add(&dev->unreg_list, &single);
retval = __dev_close_many(&single);
list_del(&single);
@@ -1269,9 +1282,12 @@ static int dev_close_many(struct list_head *head)
struct net_device *dev, *tmp;
LIST_HEAD(tmp_list);
- list_for_each_entry_safe(dev, tmp, head, unreg_list)
+ list_for_each_entry_safe(dev, tmp, head, unreg_list) {
if (!(dev->flags & IFF_UP))
list_move(&dev->unreg_list, &tmp_list);
+ else
+ __dev_pre_close(dev);
+ }
__dev_close_many(head);
@@ -1289,21 +1305,26 @@ static int dev_close_many(struct list_head *head)
* dev_close - shutdown an interface.
* @dev: device to shutdown
*
- * This function moves an active device into down state. A
- * %NETDEV_GOING_DOWN is sent to the netdev notifier chain. The device
- * is then deactivated and finally a %NETDEV_DOWN is sent to the notifier
- * chain.
+ * This function moves an active device into down state.
+ * A %NETDEV_PRE_DOWN and %NETDEV_GOING_DOWN is sent to the netdev
+ * notifier chain. The device is then deactivated and finally
+ * a %NETDEV_DOWN is sent to the notifier chain.
*/
int dev_close(struct net_device *dev)
{
+ int retval = 0;
+
if (dev->flags & IFF_UP) {
LIST_HEAD(single);
+ retval = __dev_pre_close(dev);
+ if (retval)
+ return retval;
list_add(&dev->unreg_list, &single);
dev_close_many(&single);
list_del(&single);
}
- return 0;
+ return retval;
}
EXPORT_SYMBOL(dev_close);
@@ -1397,6 +1418,7 @@ rollback:
break;
if (dev->flags & IFF_UP) {
+ nb->notifier_call(nb, NETDEV_PRE_DOWN, dev);
nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
nb->notifier_call(nb, NETDEV_DOWN, dev);
}
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 39f8dd6..34f5b32 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1997,6 +1997,7 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voi
case NETDEV_UP:
case NETDEV_DOWN:
case NETDEV_PRE_UP:
+ case NETDEV_PRE_DOWN:
case NETDEV_POST_INIT:
case NETDEV_REGISTER:
case NETDEV_CHANGE:
--
1.7.6
^ permalink raw reply related
* Re: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
From: Vlad Zolotarov @ 2011-08-31 15:16 UTC (permalink / raw)
To: Michal Schmidt
Cc: netdev@vger.kernel.org, Dmitry Kravkov, Eilon Greenstein,
mirqus@gmail.com
In-Reply-To: <1314802836-9862-2-git-send-email-mschmidt@redhat.com>
On Wednesday 31 August 2011 18:00:34 Michal Schmidt wrote:
> if (bnx2x_reload) {
> - if (bp->recovery_state == BNX2X_RECOVERY_DONE)
> + if (bp->recovery_state == BNX2X_RECOVERY_DONE) {
> + /*
> + * Cheat! Normally dev->features will be set after we
> + * return, but that's too late. We need to know how to
> + * configure the NIC when reloading it, so update
> + * the features early.
> + */
> + dev->features = features;
> return bnx2x_reload_if_running(dev);
NACK
This is bogus - what if bnx2x_reload_if_running(dev) (bnx2x_nic_load())
failes? The original dev->features would be lost... Pls., see my latest
response on your previouse patch series thread.
thanks,
vlad
> + }
> /* else: bnx2x_nic_load() will be called at end of recovery */
> }
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index e7b584b..fd32c04
> 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> @@ -9757,13 +9757,10 @@ static int __devinit bnx2x_init_bp(struct bnx2x
> *bp) bp->multi_mode = multi_mode;
>
> /* Set TPA flags */
> - if (disable_tpa) {
> - bp->flags &= ~TPA_ENABLE_FLAG;
> + if (disable_tpa)
> bp->dev->features &= ~NETIF_F_LRO;
> - } else {
> - bp->flags |= TPA_ENABLE_FLAG;
> + else
> bp->dev->features |= NETIF_F_LRO;
> - }
> bp->disable_tpa = disable_tpa;
>
> if (CHIP_IS_E1(bp))
^ permalink raw reply
* Re: [patch net-next-2.6] net: allow notifier subscribers to forbid device from closing
From: Stephen Hemminger @ 2011-08-31 15:20 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, eric.dumazet, bhutchings
In-Reply-To: <1314803731-1222-1-git-send-email-jpirko@redhat.com>
On Wed, 31 Aug 2011 17:15:31 +0200
Jiri Pirko <jpirko@redhat.com> wrote:
> In some situations, like when the device is used as slave device in
> bond/br/etc it is not nice if someone closes the device. This allows
> it's masters to forbid this closure.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
I don't think this is necessary, for bridging case.
bridging handles it. And bonding should as well.
It is a good way to test STP etc.
Is this a case of "you really shouldn't do this", or
"don't do this it will crash"? In general Linux allows the
former and uses references to prevent the later.
^ permalink raw reply
* Re: [patch net-next-2.6] net: allow notifier subscribers to forbid device from closing
From: Ben Hutchings @ 2011-08-31 15:25 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, eric.dumazet, shemminger
In-Reply-To: <1314803731-1222-1-git-send-email-jpirko@redhat.com>
On Wed, 2011-08-31 at 17:15 +0200, Jiri Pirko wrote:
> In some situations, like when the device is used as slave device in
> bond/br/etc it is not nice if someone closes the device. This allows
> it's masters to forbid this closure.
No it doesn't.
[...]
> @@ -1269,9 +1282,12 @@ static int dev_close_many(struct list_head *head)
> struct net_device *dev, *tmp;
> LIST_HEAD(tmp_list);
>
> - list_for_each_entry_safe(dev, tmp, head, unreg_list)
> + list_for_each_entry_safe(dev, tmp, head, unreg_list) {
> if (!(dev->flags & IFF_UP))
> list_move(&dev->unreg_list, &tmp_list);
> + else
> + __dev_pre_close(dev);
> + }
>
> __dev_close_many(head);
The return value is ignored here.
And this is called from dev_close(), where you are adding the
notification as well. So the notifier will usually be called twice.
[...]
> @@ -1397,6 +1418,7 @@ rollback:
> break;
>
> if (dev->flags & IFF_UP) {
> + nb->notifier_call(nb, NETDEV_PRE_DOWN, dev);
> nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
> nb->notifier_call(nb, NETDEV_DOWN, dev);
> }
[...]
The return value has to be ignored here. Not sure it makes any sense to
call the notifier at all.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH] mii: Remove references to DP83840 PHY in mii.h
From: Mark Einon @ 2011-08-31 15:35 UTC (permalink / raw)
To: netdev; +Cc: davem, Mark Einon
There are references to this PHY chip in the generic mii.h header, so removing them.
Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
include/linux/mii.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 103113a..4c3cfb5 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -40,12 +40,12 @@
#define BMCR_CTST 0x0080 /* Collision test */
#define BMCR_FULLDPLX 0x0100 /* Full duplex */
#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
-#define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */
-#define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */
+#define BMCR_ISOLATE 0x0400 /* Disconnect PHY from MII */
+#define BMCR_PDOWN 0x0800 /* Powerdown */
#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
-#define BMCR_RESET 0x8000 /* Reset the DP83840 */
+#define BMCR_RESET 0x8000 /* Reset */
/* Basic mode status register. */
#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
@@ -55,9 +55,9 @@
#define BMSR_RFAULT 0x0010 /* Remote fault detected */
#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
#define BMSR_RESV 0x00c0 /* Unused... */
-#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
-#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */
-#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */
+#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
+#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */
+#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */
#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
--
1.7.6
^ permalink raw reply related
* Re: [PATCH 7/7] bnx2x: expose HW RX VLAN stripping toggle
From: Michal Schmidt @ 2011-08-31 15:37 UTC (permalink / raw)
To: Vlad Zolotarov
Cc: Michał Mirosław, netdev@vger.kernel.org, Dmitry Kravkov,
Eilon Greenstein
In-Reply-To: <201108311807.53767.vladz@broadcom.com>
On Wed, 31 Aug 2011 18:07:53 +0300 Vlad Zolotarov wrote:
> If u want to change the implementation the way we rely on the
> dev->features in the ndo_set_features() flow, which is a semantics
> change, u'd rather change the __netdev_update_features() so that it
> sets the dev->features before ndo_set_features() call and restores it
> in case of a failure. Something like this:
...
> diff --git a/net/core/dev.c b/net/core/dev.c
> index b2e262e..474e539 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5321,7 +5321,7 @@ static u32 netdev_fix_features(struct
> net_device *dev, u32 features)
> int __netdev_update_features(struct net_device *dev)
> {
> - u32 features;
> + u32 features, old_features;
> int err = 0;
>
> ASSERT_RTNL();
> @@ -5340,19 +5340,23 @@ int __netdev_update_features(struct
> net_device *dev) netdev_dbg(dev, "Features changed: 0x%08x ->
> 0x%08x\n", dev->features, features);
>
> + /* Remember the original features and set the new ones */
> + old_features = dev->features;
> + dev->features = features;
> +
> if (dev->netdev_ops->ndo_set_features)
> - err = dev->netdev_ops->ndo_set_features(dev,
> features);
> + err = dev->netdev_ops->ndo_set_features(dev);
Drivers want to know which features changed. They compare
the features argument with dev->features.
Perhaps we could pass old_features as the argument. Then we'd better
change the name of the callback to avoid confusion.
I think it's not worth changing. I could restore dev->features before
returning if bnx2x_reload_if_running() fails.
Michal
^ permalink raw reply
* Re: [stable] [net] e1000: Fix driver to be used on PA RISC C8000 workstations
From: Greg KH @ 2011-08-31 15:37 UTC (permalink / raw)
To: Jeff Kirsher
Cc: davem, netdev, Guy Martin, Matt Turner, gospo, Rolf Eike Beer,
stable
In-Reply-To: <1314749966-9960-1-git-send-email-jeffrey.t.kirsher@intel.com>
On Tue, Aug 30, 2011 at 05:19:26PM -0700, Jeff Kirsher wrote:
> The checksum field in the EEPROM on HPPA is really not a
> checksum but a signature (0x16d6). So allow 0x16d6 as the
> matching checksum on HPPA systems.
>
> This issue is present on longterm/stable kernels, I have
> verified that this patch is applicable back to at least
> 2.6.32.y kernels.
>
> CC: Guy Martin <gmsoft@tuxicoman.be>
> CC: Rolf Eike Beer <eike-kernel@sf-tec.de>
> CC: Matt Turner <mattst88@gmail.com>
> Reported-by: Mikulas Patocka <mikulas@artax.kerlin.mff.cuni.cz>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read Documentation/stable_kernel_rules.txt
for how to do this properly.
</formletter>
^ permalink raw reply
* Re: [stable] [net v2] e1000: Fix driver to be used on PA RISC C8000 workstations
From: Greg KH @ 2011-08-31 15:37 UTC (permalink / raw)
To: Jeff Kirsher
Cc: davem, netdev, Guy Martin, Matt Turner, gospo, Rolf Eike Beer,
stable
In-Reply-To: <1314751777-13772-1-git-send-email-jeffrey.t.kirsher@intel.com>
On Tue, Aug 30, 2011 at 05:49:37PM -0700, Jeff Kirsher wrote:
> The checksum field in the EEPROM on HPPA is really not a
> checksum but a signature (0x16d6). So allow 0x16d6 as the
> matching checksum on HPPA systems.
>
> This issue is present on longterm/stable kernels, I have
> verified that this patch is applicable back to at least
> 2.6.32.y kernels.
>
> v2- changed ifdef to use CONFIG_PARISC instead of __hppa__
>
> CC: Guy Martin <gmsoft@tuxicoman.be>
> CC: Rolf Eike Beer <eike-kernel@sf-tec.de>
> CC: Matt Turner <mattst88@gmail.com>
> Reported-by: Mikulas Patocka <mikulas@artax.kerlin.mff.cuni.cz>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> ---
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read Documentation/stable_kernel_rules.txt
for how to do this properly.
</formletter>
^ permalink raw reply
* Re: [PATCH 1/2] Define security_sk_getsecctx
From: Casey Schaufler @ 2011-08-31 15:43 UTC (permalink / raw)
To: rongqing.li; +Cc: netdev, selinux, linux-security-module, Casey Schaufler
In-Reply-To: <1314779777-12669-2-git-send-email-rongqing.li@windriver.com>
On 8/31/2011 1:36 AM, rongqing.li@windriver.com wrote:
> From: Roy.Li <rongqing.li@windriver.com>
>
> Define security_sk_getsecctx to return the security
> context of a sock.
So, what is the intended use of the information
coming from this hook? If I wanted to write the
Smack hook, which of the "contexts" would I want
to return? There are potentially three. If I know
what the caller is looking for, I can (hopefully)
select the correct information.
> Signed-off-by: Roy.Li <rongqing.li@windriver.com>
> ---
> include/linux/security.h | 13 +++++++++++++
> security/capability.c | 6 ++++++
> security/security.c | 6 ++++++
> security/selinux/hooks.c | 9 +++++++++
> 4 files changed, 34 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/security.h b/include/linux/security.h
> index ebd2a53..6bb8e0c 100644
> --- a/include/linux/security.h
> +++ b/include/linux/security.h
> @@ -959,6 +959,12 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
> * @sk_getsecid:
> * Retrieve the LSM-specific secid for the sock to enable caching of network
> * authorizations.
> + * @sk_getsecctx:
> + * Returns a string containing sock security context information
> + * @sk whom we wish to get the security context.
> + * @ctx is the address of the pointer to where to place the allocated
> + * security context.
> + * @ctxlen points to the value of the length of the security context.
> * @sock_graft:
> * Sets the socket's isec sid to the sock's sid.
> * @inet_conn_request:
> @@ -1600,6 +1606,7 @@ struct security_operations {
> void (*sk_free_security) (struct sock *sk);
> void (*sk_clone_security) (const struct sock *sk, struct sock *newsk);
> void (*sk_getsecid) (struct sock *sk, u32 *secid);
> + int (*sk_getsecctx) (struct sock *sk, void **ctx, u32 *ctxlen);
> void (*sock_graft) (struct sock *sk, struct socket *parent);
> int (*inet_conn_request) (struct sock *sk, struct sk_buff *skb,
> struct request_sock *req);
> @@ -2574,6 +2581,7 @@ void security_secmark_refcount_dec(void);
> int security_tun_dev_create(void);
> void security_tun_dev_post_create(struct sock *sk);
> int security_tun_dev_attach(struct sock *sk);
> +int security_sk_getsecctx(struct sock *sk, void **ctx, u32 *ctxlen);
>
> #else /* CONFIG_SECURITY_NETWORK */
> static inline int security_unix_stream_connect(struct sock *sock,
> @@ -2751,6 +2759,11 @@ static inline int security_tun_dev_attach(struct sock *sk)
> {
> return 0;
> }
> +
> +static int security_sk_getsecctx(struct sock *sk, void **ctx, u32 *ctxlen)
> +{
> + return -EOPNOTSUPP;
> +}
> #endif /* CONFIG_SECURITY_NETWORK */
>
> #ifdef CONFIG_SECURITY_NETWORK_XFRM
> diff --git a/security/capability.c b/security/capability.c
> index 2984ea4..89256a6 100644
> --- a/security/capability.c
> +++ b/security/capability.c
> @@ -664,6 +664,11 @@ static void cap_sk_getsecid(struct sock *sk, u32 *secid)
> {
> }
>
> +static int cap_sk_getsecctx(struct sock *sk, void **ctx, u32 *ctxlen)
> +{
> + return 0;
> +}
> +
> static void cap_sock_graft(struct sock *sk, struct socket *parent)
> {
> }
> @@ -1032,6 +1037,7 @@ void __init security_fixup_ops(struct security_operations *ops)
> set_to_cap_if_null(ops, sk_free_security);
> set_to_cap_if_null(ops, sk_clone_security);
> set_to_cap_if_null(ops, sk_getsecid);
> + set_to_cap_if_null(ops, sk_getsecctx);
> set_to_cap_if_null(ops, sock_graft);
> set_to_cap_if_null(ops, inet_conn_request);
> set_to_cap_if_null(ops, inet_csk_clone);
> diff --git a/security/security.c b/security/security.c
> index 0e4fccf..a939f5c 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -757,6 +757,12 @@ void security_task_getsecid(struct task_struct *p, u32 *secid)
> }
> EXPORT_SYMBOL(security_task_getsecid);
>
> +int security_sk_getsecctx(struct sock *sk, void **ctx, u32 *ctxlen)
> +{
> + return security_ops->sk_getsecctx(sk, ctx, ctxlen);
> +}
> +EXPORT_SYMBOL(security_sk_getsecctx);
> +
> int security_task_setnice(struct task_struct *p, int nice)
> {
> return security_ops->task_setnice(p, nice);
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 266a229..6e96f01 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -4284,6 +4284,14 @@ static void selinux_sk_getsecid(struct sock *sk, u32 *secid)
> }
> }
>
> +static int selinux_sk_getsecctx(struct sock *sk, void **ctx, u32 *ctxlen)
> +{
> + u32 secid;
> +
> + selinux_sk_getsecid(sk, &secid);
> + return security_sid_to_context(secid, ctx, ctxlen);
> +}
> +
> static void selinux_sock_graft(struct sock *sk, struct socket *parent)
> {
> struct inode_security_struct *isec = SOCK_INODE(parent)->i_security;
> @@ -5613,6 +5621,7 @@ static struct security_operations selinux_ops = {
> .sk_free_security = selinux_sk_free_security,
> .sk_clone_security = selinux_sk_clone_security,
> .sk_getsecid = selinux_sk_getsecid,
> + .sk_getsecctx = selinux_sk_getsecctx,
> .sock_graft = selinux_sock_graft,
> .inet_conn_request = selinux_inet_conn_request,
> .inet_csk_clone = selinux_inet_csk_clone,
^ permalink raw reply
* Re: [PATCH 7/7] bnx2x: expose HW RX VLAN stripping toggle
From: Michal Schmidt @ 2011-08-31 15:51 UTC (permalink / raw)
To: Vlad Zolotarov
Cc: Michał Mirosław, netdev@vger.kernel.org, Dmitry Kravkov,
Eilon Greenstein
In-Reply-To: <20110831173749.60649b50@alice>
On Wed, 31 Aug 2011 17:37:49 +0200 Michal Schmidt wrote:
> I could restore dev->features before
> returning if bnx2x_reload_if_running() fails.
Or even safer - restore them always:
...
u32 orig_features = dev->features;
dev->features = features;
ret = bnx2x_reload_if_running(dev);
dev->features = orig_features;
return ret;
...
This way we don't have to assume anything about
__netdev_update_features().
Michal
^ permalink raw reply
* Re: [patch net-next-2.6] net: allow notifier subscribers to forbid device from closing
From: Stephen Hemminger @ 2011-08-31 15:53 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Jiri Pirko, netdev, davem, eric.dumazet
In-Reply-To: <1314804352.2741.4.camel@bwh-desktop>
On Wed, 31 Aug 2011 16:25:51 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:
> On Wed, 2011-08-31 at 17:15 +0200, Jiri Pirko wrote:
> > In some situations, like when the device is used as slave device in
> > bond/br/etc it is not nice if someone closes the device. This allows
> > it's masters to forbid this closure.
>
> No it doesn't.
>
> [...]
> > @@ -1269,9 +1282,12 @@ static int dev_close_many(struct list_head *head)
> > struct net_device *dev, *tmp;
> > LIST_HEAD(tmp_list);
> >
> > - list_for_each_entry_safe(dev, tmp, head, unreg_list)
> > + list_for_each_entry_safe(dev, tmp, head, unreg_list) {
> > if (!(dev->flags & IFF_UP))
> > list_move(&dev->unreg_list, &tmp_list);
> > + else
> > + __dev_pre_close(dev);
> > + }
> >
> > __dev_close_many(head);
>
> The return value is ignored here.
>
> And this is called from dev_close(), where you are adding the
> notification as well. So the notifier will usually be called twice.
>
> [...]
> > @@ -1397,6 +1418,7 @@ rollback:
> > break;
> >
> > if (dev->flags & IFF_UP) {
> > + nb->notifier_call(nb, NETDEV_PRE_DOWN, dev);
> > nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
> > nb->notifier_call(nb, NETDEV_DOWN, dev);
> > }
> [...]
>
> The return value has to be ignored here. Not sure it makes any sense to
> call the notifier at all.
>
> Ben.
>
Also we need to allow rmmod'ing a network device even it is
part of a bridge and that implicitly
calls close.
^ permalink raw reply
* Re: [PATCH] RDSRDMA: Fix to PAGE_MASK interpretation
From: Steve Wise @ 2011-08-31 15:57 UTC (permalink / raw)
To: venkat.x.venkatsubra; +Cc: Jonathan Lallinger, netdev, rds-devel
In-Reply-To: <20110829192853.32358.39323.stgit@build.ogc.int>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
^ permalink raw reply
* Re: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
From: Michal Schmidt @ 2011-08-31 15:58 UTC (permalink / raw)
To: Vlad Zolotarov
Cc: netdev@vger.kernel.org, Dmitry Kravkov, Eilon Greenstein,
mirqus@gmail.com
In-Reply-To: <201108311816.30468.vladz@broadcom.com>
On Wed, 31 Aug 2011 18:16:30 +0300 Vlad Zolotarov wrote:
> On Wednesday 31 August 2011 18:00:34 Michal Schmidt wrote:
> > if (bnx2x_reload) {
> > - if (bp->recovery_state == BNX2X_RECOVERY_DONE)
> > + if (bp->recovery_state == BNX2X_RECOVERY_DONE) {
> > + /*
> > + * Cheat! Normally dev->features will be
> > set after we
> > + * return, but that's too late. We need to
> > know how to
> > + * configure the NIC when reloading it, so
> > update
> > + * the features early.
> > + */
> > + dev->features = features;
> > return bnx2x_reload_if_running(dev);
>
> NACK
>
> This is bogus - what if bnx2x_reload_if_running(dev)
> (bnx2x_nic_load()) failes? The original dev->features would be
> lost...
Well, yes, but since the NIC would be now not working, do we really
care about its features? :-)
Michal
^ permalink raw reply
* RE: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
From: Vladislav Zolotarov @ 2011-08-31 16:13 UTC (permalink / raw)
To: Michal Schmidt
Cc: netdev@vger.kernel.org, Dmitry Kravkov, Eilon Greenstein,
mirqus@gmail.com
In-Reply-To: <20110831175849.328192b8@alice>
> -----Original Message-----
> From: Michal Schmidt [mailto:mschmidt@redhat.com]
> Sent: Wednesday, August 31, 2011 6:59 PM
> To: Vladislav Zolotarov
> Cc: netdev@vger.kernel.org; Dmitry Kravkov; Eilon Greenstein;
> mirqus@gmail.com
> Subject: Re: [PATCH 1/3] bnx2x: remove TPA_ENABLE_FLAG
>
> On Wed, 31 Aug 2011 18:16:30 +0300 Vlad Zolotarov wrote:
> > On Wednesday 31 August 2011 18:00:34 Michal Schmidt wrote:
> > > if (bnx2x_reload) {
> > > - if (bp->recovery_state == BNX2X_RECOVERY_DONE)
> > > + if (bp->recovery_state == BNX2X_RECOVERY_DONE) {
> > > + /*
> > > + * Cheat! Normally dev->features will be
> > > set after we
> > > + * return, but that's too late. We need to
> > > know how to
> > > + * configure the NIC when reloading it, so
> > > update
> > > + * the features early.
> > > + */
> > > + dev->features = features;
> > > return bnx2x_reload_if_running(dev);
> >
> > NACK
> >
> > This is bogus - what if bnx2x_reload_if_running(dev)
> > (bnx2x_nic_load()) failes? The original dev->features would be
> > lost...
>
> Well, yes, but since the NIC would be now not working, do we really
> care about its features? :-)
U r kidding, right? ;)
We care about the consistency in the netdev features state - if we failed
to configure the requested feature and returned an error on e.g. "ethtool -K ethX lro on"
call, it's expected that a subsequent ethtool -k ethX call won't report the requested
feature (LRO) as set.
Thanks,
vlad
>
> Michal
^ permalink raw reply
* Re: [PATCH 7/7] bnx2x: expose HW RX VLAN stripping toggle
From: Vlad Zolotarov @ 2011-08-31 16:16 UTC (permalink / raw)
To: Michal Schmidt
Cc: Michał Mirosław, netdev@vger.kernel.org, Dmitry Kravkov,
Eilon Greenstein
In-Reply-To: <20110831175120.739bd5c2@alice>
On Wednesday 31 August 2011 18:51:20 Michal Schmidt wrote:
> On Wed, 31 Aug 2011 17:37:49 +0200 Michal Schmidt wrote:
> > I could restore dev->features before
> > returning if bnx2x_reload_if_running() fails.
>
> Or even safer - restore them always:
> ...
> u32 orig_features = dev->features;
> dev->features = features;
> ret = bnx2x_reload_if_running(dev);
> dev->features = orig_features;
> return ret;
> ...
> This way we don't have to assume anything about
> __netdev_update_features().
I agree - it's the best choice if we go for a bnx2x-only solution.
thanks,
vlad
>
> Michal
> --
> 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
* [linux-firmware v3 1/2] rtl_nic: update firmware for RTL8111E-VL
From: Hayes Wang @ 2011-08-31 16:16 UTC (permalink / raw)
To: dwmw2; +Cc: romieu, netdev, Hayes Wang
Updated firmware with stability fixes.
Version: 0.0.2
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
WHENCE | 2 +-
rtl_nic/rtl8168e-3.fw | Bin 2804 -> 3552 bytes
2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/WHENCE b/WHENCE
index a47b307..eb7bdfd 100644
--- a/WHENCE
+++ b/WHENCE
@@ -1657,7 +1657,7 @@ File: rtl_nic/rtl8168d-2.fw
File: rtl_nic/rtl8105e-1.fw
File: rtl_nic/rtl8168e-1.fw
File: rtl_nic/rtl8168e-2.fw
-File: rtl_nic/rtl8168e-3.fw
+File: rtl_nic/rtl8168e-3.fw (version: 0.0.2)
Licence:
* Copyright © 2011, Realtek Semiconductor Corporation
diff --git a/rtl_nic/rtl8168e-3.fw b/rtl_nic/rtl8168e-3.fw
index cb494071d0273c7b3102b97552f4bc7b756c0e17..525f467e04229c52fbc38676b2bbdc93832bc945 100644
GIT binary patch
literal 3552
zcmaKve{5Cd8OPsy+xzsE9~)pR9DZDGe?Uc~?Y&Ga?vHiMEi6%ENR~`pMwgT<E*gxG
z4L9AM3S6}nVsxM`S=Vj;vyEGkk?jvN${z%iEm>BCL?*a%YYT3gdouzpl$N{CbI-Zt
zXvl7I@_paueSZIV&$-Sy_tehEyD}TPwyj&gwX?mmJ)7?A>R6xY$YeOP-$Oh-HO}pG
zTkhYG&2(<sy5*}6Z2j8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M4sWVk$qW8X<XXk|Uzp~?dm}aE3&HPpjQ6?tvjF3!v&>}THF4M7;BBXOiog9s
zF>vEIZ8AI_W~DZNKJ5$Yws{?ujYFHW#^(WkJG!`Y<!z7G1&-)U&tto>L9`)HUyyrg
zPV@=(`B&iJVbPyF^k9Cnhkmj>Slwfy59L$Fqy2}R%G%R#hg|&c<--4_g@POZZ(97n
VdHX+Uxf?6kf6?+D|9>1#e*sYqwB!H)
--
1.7.6
^ permalink raw reply related
* [linux-firmware v3 2/2] rtl_nic: add new firmware for RTL8111F
From: Hayes Wang @ 2011-08-31 16:16 UTC (permalink / raw)
To: dwmw2; +Cc: romieu, netdev, Hayes Wang
In-Reply-To: <1314807407-1512-1-git-send-email-hayeswang@realtek.com>
Add new firmware:
1. rtl_nic/rtl8168f-1.fw
version: 0.0.2
2. rtl_nic/rtl8168f-2.fw
version: 0.0.2
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
WHENCE | 2 ++
rtl_nic/rtl8168f-1.fw | Bin 0 -> 3024 bytes
rtl_nic/rtl8168f-2.fw | Bin 0 -> 336 bytes
3 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 rtl_nic/rtl8168f-1.fw
create mode 100644 rtl_nic/rtl8168f-2.fw
diff --git a/WHENCE b/WHENCE
index eb7bdfd..2e79b26 100644
--- a/WHENCE
+++ b/WHENCE
@@ -1658,6 +1658,8 @@ File: rtl_nic/rtl8105e-1.fw
File: rtl_nic/rtl8168e-1.fw
File: rtl_nic/rtl8168e-2.fw
File: rtl_nic/rtl8168e-3.fw (version: 0.0.2)
+File: rtl_nic/rtl8168f-1.fw (version: 0.0.2)
+File: rtl_nic/rtl8168f-2.fw (version: 0.0.2)
Licence:
* Copyright © 2011, Realtek Semiconductor Corporation
diff --git a/rtl_nic/rtl8168f-1.fw b/rtl_nic/rtl8168f-1.fw
new file mode 100644
index 0000000000000000000000000000000000000000..ffb1dd137eebeb2394acbfcf14c96a6091e73a06
GIT binary patch
literal 3024
zcmb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AGOYML5`Tv40
z{EwT>I)_8t{^REVw?6uBJH$nDafY;*Um>gCo?^^BpQ<i+$U7Hv-C6tp8^gAL$oGfm
MzqYOImd5}71$?3tJpcdz
literal 0
HcmV?d00001
diff --git a/rtl_nic/rtl8168f-2.fw b/rtl_nic/rtl8168f-2.fw
new file mode 100644
index 0000000000000000000000000000000000000000..880a223f35ab98b5367d2d1ee788ac0c9b05d762
GIT binary patch
literal 336
zcmXw!y-EX75QUEk8YD%wS#>~kA+_0i?~<^j5w%s2yud<;R)L6ETFfJeRqT8MpCOem
z;a{vRY(+5f%(A&~_=YnxoI3z;eKXE|FTXqph3mLZNL-#~KJ}hGd*{?4HN@bw7lJ!3
z21jSb$z*g<c<=I%B_ZqkZolhs2ka|$pg@e}HxhD&DYQX9#U6cJtpRgj*M<^B?QsO#
zTX(Bnn{9J;qrRmLYKmB!x1tZmvFKODALB%HLAJ;ja+7=||DHtOs{Xt2S@eVah3K68
pbi(+!%m6bidzA}pqXtCe%=|h92o_7bN9aXW9hLp^-}iP7@DF!bO921?
literal 0
HcmV?d00001
--
1.7.6
^ permalink raw reply related
* [PATCH net-next 1/3] r8169: fix WOL setting for 8105 and 8111EVL
From: Hayes Wang @ 2011-08-31 16:17 UTC (permalink / raw)
To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
8105, 8111E, and 8111EVL need enable RxConfig bit 1 ~ 3 for supporting
wake on lan.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 1cf8c3c..96e003a 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3416,8 +3416,11 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
rtl_writephy(tp, 0x1f, 0x0000);
rtl_writephy(tp, MII_BMCR, 0x0000);
- if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
- tp->mac_version == RTL_GIGA_MAC_VER_33)
+ if (tp->mac_version == RTL_GIGA_MAC_VER_29 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_30 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_32 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_33 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_34)
RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast |
AcceptMulticast | AcceptMyPhys);
return;
--
1.7.6
^ permalink raw reply related
* [PATCH net-next 2/3] r8169: fix the reset setting for 8111evl
From: Hayes Wang @ 2011-08-31 16:17 UTC (permalink / raw)
To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
In-Reply-To: <1314807479-1552-1-git-send-email-hayeswang@realtek.com>
8111evl should stop any TLP requirement before resetting by enabling
IO 0x37 bit 7.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 96e003a..68f1e2f 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3991,6 +3991,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
while (RTL_R8(TxPoll) & NPQ)
udelay(20);
} else if (tp->mac_version == RTL_GIGA_MAC_VER_34) {
+ RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq);
while (!(RTL_R32(TxConfig) & TXCFG_EMPTY))
udelay(100);
} else {
--
1.7.6
^ permalink raw reply related
* [PATCH net-next 3/3] r8169: support new chips of RTL8111F
From: Hayes Wang @ 2011-08-31 16:17 UTC (permalink / raw)
To: romieu; +Cc: netdev, linux-kernel, Hayes Wang
In-Reply-To: <1314807479-1552-1-git-send-email-hayeswang@realtek.com>
Support new chips of RTL8111F.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 178 +++++++++++++++++++++++++++++++++-
1 files changed, 176 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 68f1e2f..c04fbc0 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -42,6 +42,8 @@
#define FIRMWARE_8168E_1 "rtl_nic/rtl8168e-1.fw"
#define FIRMWARE_8168E_2 "rtl_nic/rtl8168e-2.fw"
#define FIRMWARE_8168E_3 "rtl_nic/rtl8168e-3.fw"
+#define FIRMWARE_8168F_1 "rtl_nic/rtl8168f-1.fw"
+#define FIRMWARE_8168F_2 "rtl_nic/rtl8168f-2.fw"
#define FIRMWARE_8105E_1 "rtl_nic/rtl8105e-1.fw"
#ifdef RTL8169_DEBUG
@@ -133,6 +135,8 @@ enum mac_version {
RTL_GIGA_MAC_VER_32,
RTL_GIGA_MAC_VER_33,
RTL_GIGA_MAC_VER_34,
+ RTL_GIGA_MAC_VER_35,
+ RTL_GIGA_MAC_VER_36,
RTL_GIGA_MAC_NONE = 0xff,
};
@@ -218,7 +222,11 @@ static const struct {
[RTL_GIGA_MAC_VER_33] =
_R("RTL8168e/8111e", RTL_TD_1, FIRMWARE_8168E_2),
[RTL_GIGA_MAC_VER_34] =
- _R("RTL8168evl/8111evl",RTL_TD_1, FIRMWARE_8168E_3)
+ _R("RTL8168evl/8111evl",RTL_TD_1, FIRMWARE_8168E_3),
+ [RTL_GIGA_MAC_VER_35] =
+ _R("RTL8168f/8111f", RTL_TD_1, FIRMWARE_8168F_1),
+ [RTL_GIGA_MAC_VER_36] =
+ _R("RTL8168f/8111f", RTL_TD_1, FIRMWARE_8168F_2)
};
#undef _R
@@ -1199,6 +1207,19 @@ static void rtl_link_chg_patch(struct rtl8169_private *tp)
ERIAR_EXGMAC);
rtl_w1w0_eri(ioaddr, 0xdc, ERIAR_MASK_0001, 0x01, 0x00,
ERIAR_EXGMAC);
+ } else if (tp->mac_version == RTL_GIGA_MAC_VER_35 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_36) {
+ if (RTL_R8(PHYstatus) & _1000bpsF) {
+ rtl_eri_write(ioaddr, 0x1bc, ERIAR_MASK_1111,
+ 0x00000011, ERIAR_EXGMAC);
+ rtl_eri_write(ioaddr, 0x1dc, ERIAR_MASK_1111,
+ 0x00000005, ERIAR_EXGMAC);
+ } else {
+ rtl_eri_write(ioaddr, 0x1bc, ERIAR_MASK_1111,
+ 0x0000001f, ERIAR_EXGMAC);
+ rtl_eri_write(ioaddr, 0x1dc, ERIAR_MASK_1111,
+ 0x0000003f, ERIAR_EXGMAC);
+ }
}
}
@@ -1738,6 +1759,10 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
u32 val;
int mac_version;
} mac_info[] = {
+ /* 8168F family. */
+ { 0x7cf00000, 0x48100000, RTL_GIGA_MAC_VER_36 },
+ { 0x7cf00000, 0x48000000, RTL_GIGA_MAC_VER_35 },
+
/* 8168E family. */
{ 0x7c800000, 0x2c800000, RTL_GIGA_MAC_VER_34 },
{ 0x7cf00000, 0x2c200000, RTL_GIGA_MAC_VER_33 },
@@ -2872,6 +2897,97 @@ static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
rtl_writephy(tp, 0x1f, 0x0000);
}
+static void rtl8168f_1_hw_phy_config(struct rtl8169_private *tp)
+{
+ static const struct phy_reg phy_reg_init[] = {
+ /* Channel estimation fine tune */
+ { 0x1f, 0x0003 },
+ { 0x09, 0xa20f },
+ { 0x1f, 0x0000 },
+
+ /* Modify green table for giga & fnet */
+ { 0x1f, 0x0005 },
+ { 0x05, 0x8b55 },
+ { 0x06, 0x0000 },
+ { 0x05, 0x8b5e },
+ { 0x06, 0x0000 },
+ { 0x05, 0x8b67 },
+ { 0x06, 0x0000 },
+ { 0x05, 0x8b70 },
+ { 0x06, 0x0000 },
+ { 0x1f, 0x0000 },
+ { 0x1f, 0x0007 },
+ { 0x1e, 0x0078 },
+ { 0x17, 0x0000 },
+ { 0x19, 0x00fb },
+ { 0x1f, 0x0000 },
+
+ /* Modify green table for 10M */
+ { 0x1f, 0x0005 },
+ { 0x05, 0x8b79 },
+ { 0x06, 0xaa00 },
+ { 0x1f, 0x0000 },
+
+ /* Disable hiimpedance detection (RTCT) */
+ { 0x1f, 0x0003 },
+ { 0x01, 0x328a },
+ { 0x1f, 0x0000 }
+ };
+
+ rtl_apply_firmware(tp);
+
+ rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+
+ /* For 4-corner performance improve */
+ rtl_writephy(tp, 0x1f, 0x0005);
+ rtl_writephy(tp, 0x05, 0x8b80);
+ rtl_w1w0_phy(tp, 0x06, 0x0006, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* PHY auto speed down */
+ rtl_writephy(tp, 0x1f, 0x0007);
+ rtl_writephy(tp, 0x1e, 0x002d);
+ rtl_w1w0_phy(tp, 0x18, 0x0010, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+ rtl_w1w0_phy(tp, 0x14, 0x8000, 0x0000);
+
+ /* improve 10M EEE waveform */
+ rtl_writephy(tp, 0x1f, 0x0005);
+ rtl_writephy(tp, 0x05, 0x8b86);
+ rtl_w1w0_phy(tp, 0x06, 0x0001, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* Improve 2-pair detection performance */
+ rtl_writephy(tp, 0x1f, 0x0005);
+ rtl_writephy(tp, 0x05, 0x8b85);
+ rtl_w1w0_phy(tp, 0x06, 0x4000, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+}
+
+static void rtl8168f_2_hw_phy_config(struct rtl8169_private *tp)
+{
+ rtl_apply_firmware(tp);
+
+ /* For 4-corner performance improve */
+ rtl_writephy(tp, 0x1f, 0x0005);
+ rtl_writephy(tp, 0x05, 0x8b80);
+ rtl_w1w0_phy(tp, 0x06, 0x0006, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* PHY auto speed down */
+ rtl_writephy(tp, 0x1f, 0x0007);
+ rtl_writephy(tp, 0x1e, 0x002d);
+ rtl_w1w0_phy(tp, 0x18, 0x0010, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+ rtl_w1w0_phy(tp, 0x14, 0x8000, 0x0000);
+
+ /* improve 10M EEE waveform */
+ rtl_writephy(tp, 0x1f, 0x0005);
+ rtl_writephy(tp, 0x05, 0x8b86);
+ rtl_w1w0_phy(tp, 0x06, 0x0001, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+}
+
static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
{
static const struct phy_reg phy_reg_init[] = {
@@ -2996,6 +3112,12 @@ static void rtl_hw_phy_config(struct net_device *dev)
case RTL_GIGA_MAC_VER_34:
rtl8168e_2_hw_phy_config(tp);
break;
+ case RTL_GIGA_MAC_VER_35:
+ rtl8168f_1_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_36:
+ rtl8168f_2_hw_phy_config(tp);
+ break;
default:
break;
@@ -3518,6 +3640,8 @@ static void __devinit rtl_init_pll_power_ops(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_32:
case RTL_GIGA_MAC_VER_33:
case RTL_GIGA_MAC_VER_34:
+ case RTL_GIGA_MAC_VER_35:
+ case RTL_GIGA_MAC_VER_36:
ops->down = r8168_pll_power_down;
ops->up = r8168_pll_power_up;
break;
@@ -3990,7 +4114,9 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
tp->mac_version == RTL_GIGA_MAC_VER_31) {
while (RTL_R8(TxPoll) & NPQ)
udelay(20);
- } else if (tp->mac_version == RTL_GIGA_MAC_VER_34) {
+ } else if (tp->mac_version == RTL_GIGA_MAC_VER_34 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_35 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_36) {
RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq);
while (!(RTL_R32(TxConfig) & TXCFG_EMPTY))
udelay(100);
@@ -4476,6 +4602,49 @@ static void rtl_hw_start_8168e_2(void __iomem *ioaddr, struct pci_dev *pdev)
RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en);
}
+static void rtl_hw_start_8168f_1(void __iomem *ioaddr, struct pci_dev *pdev)
+{
+ static const struct ephy_info e_info_8168f_1[] = {
+ { 0x06, 0x00c0, 0x0020 },
+ { 0x08, 0x0001, 0x0002 },
+ { 0x09, 0x0000, 0x0080 },
+ { 0x19, 0x0000, 0x0224 }
+ };
+
+ rtl_csi_access_enable_1(ioaddr);
+
+ rtl_ephy_init(ioaddr, e_info_8168f_1, ARRAY_SIZE(e_info_8168f_1));
+
+ rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
+
+ rtl_eri_write(ioaddr, 0xc0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
+ rtl_eri_write(ioaddr, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
+ rtl_eri_write(ioaddr, 0xc8, ERIAR_MASK_1111, 0x00100002, ERIAR_EXGMAC);
+ rtl_eri_write(ioaddr, 0xe8, ERIAR_MASK_1111, 0x00100006, ERIAR_EXGMAC);
+ rtl_w1w0_eri(ioaddr, 0xdc, ERIAR_MASK_0001, 0x00, 0x01, ERIAR_EXGMAC);
+ rtl_w1w0_eri(ioaddr, 0xdc, ERIAR_MASK_0001, 0x01, 0x00, ERIAR_EXGMAC);
+ rtl_w1w0_eri(ioaddr, 0x1b0, ERIAR_MASK_0001, 0x10, 0x00, ERIAR_EXGMAC);
+ rtl_w1w0_eri(ioaddr, 0x1d0, ERIAR_MASK_0001, 0x10, 0x00, ERIAR_EXGMAC);
+ rtl_eri_write(ioaddr, 0xcc, ERIAR_MASK_1111, 0x00000050, ERIAR_EXGMAC);
+ rtl_eri_write(ioaddr, 0xd0, ERIAR_MASK_1111, 0x00000060, ERIAR_EXGMAC);
+ rtl_w1w0_eri(ioaddr, 0x0d4, ERIAR_MASK_0011, 0x0c00, 0xff00,
+ ERIAR_EXGMAC);
+
+ RTL_W8(MaxTxPacketSize, 0x27);
+
+ rtl_disable_clock_request(pdev);
+
+ RTL_W32(TxConfig, RTL_R32(TxConfig) | TXCFG_AUTO_FIFO);
+ RTL_W8(MCU, RTL_R8(MCU) & ~NOW_IS_OOB);
+
+ /* Adjust EEE LED frequency */
+ RTL_W8(EEE_LED, RTL_R8(EEE_LED) & ~0x07);
+
+ RTL_W8(DLLPR, RTL_R8(DLLPR) | PFM_EN);
+ RTL_W32(MISC, RTL_R32(MISC) | PWM_EN);
+ RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en);
+}
+
static void rtl_hw_start_8168(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
@@ -4570,6 +4739,11 @@ static void rtl_hw_start_8168(struct net_device *dev)
rtl_hw_start_8168e_2(ioaddr, pdev);
break;
+ case RTL_GIGA_MAC_VER_35:
+ case RTL_GIGA_MAC_VER_36:
+ rtl_hw_start_8168f_1(ioaddr, pdev);
+ break;
+
default:
printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
dev->name, tp->mac_version);
--
1.7.6
^ permalink raw reply related
* Re: [patch net-next-2.6] net: allow notifier subscribers to forbid device from closing
From: Jiri Pirko @ 2011-08-31 16:21 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, davem, eric.dumazet, shemminger
In-Reply-To: <1314804352.2741.4.camel@bwh-desktop>
Wed, Aug 31, 2011 at 05:25:51PM CEST, bhutchings@solarflare.com wrote:
>On Wed, 2011-08-31 at 17:15 +0200, Jiri Pirko wrote:
>> In some situations, like when the device is used as slave device in
>> bond/br/etc it is not nice if someone closes the device. This allows
>> it's masters to forbid this closure.
>
>No it doesn't.
It does
>
>[...]
>> @@ -1269,9 +1282,12 @@ static int dev_close_many(struct list_head *head)
>> struct net_device *dev, *tmp;
>> LIST_HEAD(tmp_list);
>>
>> - list_for_each_entry_safe(dev, tmp, head, unreg_list)
>> + list_for_each_entry_safe(dev, tmp, head, unreg_list) {
>> if (!(dev->flags & IFF_UP))
>> list_move(&dev->unreg_list, &tmp_list);
>> + else
>> + __dev_pre_close(dev);
>> + }
>>
>> __dev_close_many(head);
>
>The return value is ignored here.
That's intended. The reason is this is called from
rollback_registered_many - refuse should be ignored in that case
>
>And this is called from dev_close(), where you are adding the
>notification as well. So the notifier will usually be called twice.
>
Indeed. Anyway I thought about it and we probably do not need this patch
as Stephen said.
>[...]
>> @@ -1397,6 +1418,7 @@ rollback:
>> break;
>>
>> if (dev->flags & IFF_UP) {
>> + nb->notifier_call(nb, NETDEV_PRE_DOWN, dev);
>> nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
>> nb->notifier_call(nb, NETDEV_DOWN, dev);
>> }
>[...]
>
>The return value has to be ignored here. Not sure it makes any sense to
>call the notifier at all.
>
>Ben.
>
>--
>Ben Hutchings, Staff Engineer, Solarflare
>Not speaking for my employer; that's the marketing department's job.
>They asked us to note that Solarflare product names are trademarked.
>
^ 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