* Re: [PATCH v2 3/3] ipgre: capture inner headers during encapsulation
From: Joseph Gasparakis @ 2012-11-12 3:17 UTC (permalink / raw)
To: David Miller
Cc: joseph.gasparakis, shemminger, chrisw, netdev, linux-kernel,
peter.p.waskiewicz.jr
In-Reply-To: <20121111.220652.1964621381859974031.davem@davemloft.net>
On Sun, 11 Nov 2012, David Miller wrote:
>
> Please post the entire series again when making updates to any of
> the patches, thank you.
>
Will do. Thanks Dave.
^ permalink raw reply
* Re: [PATCH v2 3/3] ipgre: capture inner headers during encapsulation
From: David Miller @ 2012-11-12 3:06 UTC (permalink / raw)
To: joseph.gasparakis
Cc: shemminger, chrisw, netdev, linux-kernel, peter.p.waskiewicz.jr
In-Reply-To: <1352689450-4092-1-git-send-email-joseph.gasparakis@intel.com>
Please post the entire series again when making updates to any of
the patches, thank you.
^ permalink raw reply
* [PATCH v2 3/3] ipgre: capture inner headers during encapsulation
From: Joseph Gasparakis @ 2012-11-12 3:04 UTC (permalink / raw)
To: davem, shemminger, chrisw
Cc: Joseph Gasparakis, netdev, linux-kernel, Peter P Waskiewicz Jr
Populating the inner header pointers of skb for ipgre
This patch has been compile-tested only.
v2 Makes sure that checksumming does not take place if the offload flag is set in the skb's netdev features
Signed-off-by: Joseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---
net/ipv4/ip_gre.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 7240f8e..e35ed52 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -766,8 +766,10 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
int gre_hlen;
__be32 dst;
int mtu;
+ unsigned int offset;
- if (skb->ip_summed == CHECKSUM_PARTIAL &&
+ if (!(skb->dev->features & NETIF_F_HW_CSUM_ENC_BIT) &&
+ skb->ip_summed == CHECKSUM_PARTIAL &&
skb_checksum_help(skb))
goto tx_error;
@@ -902,6 +904,17 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
tunnel->err_count = 0;
}
+ offset = skb->data - skb->head;
+
+ skb_reset_inner_mac_header(skb);
+
+ if (skb->network_header)
+ skb_set_inner_network_header(skb, skb->network_header - offset);
+
+ if (skb->transport_header)
+ skb_set_inner_transport_header(skb, skb->transport_header -
+ offset);
+
max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->dst.header_len;
if (skb_headroom(skb) < max_headroom || skb_shared(skb)||
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH 3/3] ipgre: capture inner headers during encapsulation
From: Joseph Gasparakis @ 2012-11-12 1:47 UTC (permalink / raw)
To: Dmitry Kravkov
Cc: Joseph Gasparakis, davem, shemminger, chrisw, netdev,
linux-kernel, Peter P Waskiewicz Jr
In-Reply-To: <1352647110.5201.4.camel@lb-tlvb-dmitry.il.broadcom.com>
On Sun, 11 Nov 2012, Dmitry Kravkov wrote:
> On Thu, 2012-11-08 at 18:18 -0800, Joseph Gasparakis wrote:
> >
> > if (skb->ip_summed == CHECKSUM_PARTIAL &&
> > skb_checksum_help(skb))
> > @@ -902,6 +903,17 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
> > tunnel->err_count = 0;
> > }
> >
> > + offset = skb->data - skb->head;
> > +
> > + skb_reset_inner_mac_header(skb);
> > +
> > + if (skb->network_header)
> > + skb_set_inner_network_header(skb, skb->network_header - offset);
> > +
> > + if (skb->transport_header)
> > + skb_set_inner_transport_header(skb, skb->transport_header -
> > + offset);
> > +
> > max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->dst.header_len;
> >
> > if (skb_headroom(skb) < max_headroom || skb_shared(skb)||
>
> How it will be useful if skb_checksum_help(skb) will calculate csum? And
> leaves nothing to offload
>
Thanks for catching this Dmitry. Will fix it in v2
^ permalink raw reply
* Re: [PATCH v3 3/9] net: xfrm: use __this_cpu_read per-cpu helper
From: Shan Wei @ 2012-11-12 1:45 UTC (permalink / raw)
To: Christoph Lameter
Cc: steffen.klassert, David Miller, NetDev, Herbert Xu,
Kernel-Maillist
In-Reply-To: <0000013ae6ccff86-695eb9f4-23b6-4196-a575-e12d05e1a659-000000@email.amazonses.com>
Christoph Lameter said, at 2012/11/10 4:12:
> On Fri, 9 Nov 2012, Shan Wei wrote:
>
>> v3 fix compile warning:
>> net/xfrm/xfrm_ipcomp.c: In function 'ipcomp_alloc_tfms':
>> net/xfrm/xfrm_ipcomp.c:285: warning: assignment from incompatible pointer type
>
> Why exactly is the pointer type not compatible? Looks like we have a
> problem here.
>
pos->tfms(struct crypto_comp **tfms) is a double pointer that point to struct crypto_comp.
returned value is a pointer that point to struct crypto_comp;
So, we need to dereference and then read.
+ tfm = __this_cpu_read(*pos->tfms);
I will update this patch in v4 to fix it.
Thanks~
^ permalink raw reply
* Re: [PATCH] iproute2: avoid errors from double-installing manpages
From: Stephen Hemminger @ 2012-11-12 0:23 UTC (permalink / raw)
To: Andreas Henriksson; +Cc: netdev
In-Reply-To: <20121109154241.GA29156@amd64.fatal.se>
On Fri, 9 Nov 2012 16:42:41 +0100
Andreas Henriksson <andreas@fatal.se> wrote:
> Three manpages in man8 are listed twice in MAN8PAGES (both directly and
> in TARGETS) which causes the install command to spit our a couple of
> warnings as below and exiting with non-zero exit code....
>
Applied
^ permalink raw reply
* Re: [PATCH] allow pkg-config to be customized
From: Stephen Hemminger @ 2012-11-12 0:21 UTC (permalink / raw)
To: Mike Frysinger; +Cc: stephen.hemminger, netdev
In-Reply-To: <1352392877-22300-1-git-send-email-vapier@gentoo.org>
On Thu, 8 Nov 2012 11:41:17 -0500
Mike Frysinger <vapier@gentoo.org> wrote:
> Rather than hard coding `pkg-config`, use ${PKG_CONFIG} so people can
> override it to their specific version (like when cross-compiling).
>
> This is the same way the upstream pkg-config code works.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] ipv6: setsockopt(IPIPPROTO_IPV6,IPV6_MINHOPCOUNT) forgot to set return value
From: Stephen Hemminger @ 2012-11-12 0:20 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: netdev
In-Reply-To: <20121111055234.GA28043@order.stressinduktion.org>
Wonder if this ever worked? The patch should go
to stable as well.
The original coding style was prone to these kind of errors
because of the use of "goto e_inval" to do the unlock, and fall through
is prone to these kind of errors.
^ permalink raw reply
* [PATCH v2 2/3] net/macb: add support for phy irq via gpio pin
From: Joachim Eastwood @ 2012-11-11 23:56 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352678188-18647-1-git-send-email-manabian@gmail.com>
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/ethernet/cadence/macb.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 1fac769..ca34efc 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -16,6 +16,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/init.h>
+#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
@@ -261,7 +262,9 @@ static void macb_handle_link_change(struct net_device *dev)
static int macb_mii_probe(struct net_device *dev)
{
struct macb *bp = netdev_priv(dev);
+ struct macb_platform_data *pdata;
struct phy_device *phydev;
+ int phy_irq;
int ret;
phydev = phy_find_first(bp->mii_bus);
@@ -270,7 +273,14 @@ static int macb_mii_probe(struct net_device *dev)
return -1;
}
- /* TODO : add pin_irq */
+ pdata = dev_get_platdata(&bp->pdev->dev);
+ if (pdata && gpio_is_valid(pdata->phy_irq_pin)) {
+ ret = devm_gpio_request(&bp->pdev->dev, pdata->phy_irq_pin, "phy int");
+ if (!ret) {
+ phy_irq = gpio_to_irq(pdata->phy_irq_pin);
+ phydev->irq = (phy_irq < 0) ? PHY_POLL : phy_irq;
+ }
+ }
/* attach the mac to the phy */
ret = phy_connect_direct(dev, phydev, &macb_handle_link_change, 0,
--
1.8.0
^ permalink raw reply related
* [PATCH v2 3/3] net/macb: clear unused address register
From: Joachim Eastwood @ 2012-11-11 23:56 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352678188-18647-1-git-send-email-manabian@gmail.com>
Only the first register set is used for matching but
we support getting the initial hw addr from any of
the registers.
To prevent stale entries and false matches clear unused
register sets. This most important for the at91_ether
driver where u-boot always uses the 2nd register set.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/ethernet/cadence/macb.c | 8 ++++++++
drivers/net/ethernet/cadence/macb.h | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index ca34efc..edb2aba 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -108,6 +108,14 @@ void macb_set_hwaddr(struct macb *bp)
macb_or_gem_writel(bp, SA1B, bottom);
top = cpu_to_le16(*((u16 *)(bp->dev->dev_addr + 4)));
macb_or_gem_writel(bp, SA1T, top);
+
+ /* Clear unused address register sets */
+ macb_or_gem_writel(bp, SA2B, 0);
+ macb_or_gem_writel(bp, SA2T, 0);
+ macb_or_gem_writel(bp, SA3B, 0);
+ macb_or_gem_writel(bp, SA3T, 0);
+ macb_or_gem_writel(bp, SA4B, 0);
+ macb_or_gem_writel(bp, SA4T, 0);
}
EXPORT_SYMBOL_GPL(macb_set_hwaddr);
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 864e380..4414421 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -74,6 +74,12 @@
#define GEM_HRT 0x0084
#define GEM_SA1B 0x0088
#define GEM_SA1T 0x008C
+#define GEM_SA2B 0x0090
+#define GEM_SA2T 0x0094
+#define GEM_SA3B 0x0098
+#define GEM_SA3T 0x009C
+#define GEM_SA4B 0x00A0
+#define GEM_SA4T 0x00A4
#define GEM_OTX 0x0100
#define GEM_DCFG1 0x0280
#define GEM_DCFG2 0x0284
--
1.8.0
^ permalink raw reply related
* [PATCH v2 1/3] net/phy/davicom: add irq functions to DM9161E and DM9161A
From: Joachim Eastwood @ 2012-11-11 23:56 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352678188-18647-1-git-send-email-manabian@gmail.com>
Both these PHYs support interrupt generation on IC pin 32.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/phy/davicom.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index 81c7bc0..383e833 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -150,18 +150,24 @@ static struct phy_driver dm91xx_driver[] = {
.name = "Davicom DM9161E",
.phy_id_mask = 0x0ffffff0,
.features = PHY_BASIC_FEATURES,
+ .flags = PHY_HAS_INTERRUPT,
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
.read_status = genphy_read_status,
+ .ack_interrupt = dm9161_ack_interrupt,
+ .config_intr = dm9161_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = 0x0181b8a0,
.name = "Davicom DM9161A",
.phy_id_mask = 0x0ffffff0,
.features = PHY_BASIC_FEATURES,
+ .flags = PHY_HAS_INTERRUPT,
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
.read_status = genphy_read_status,
+ .ack_interrupt = dm9161_ack_interrupt,
+ .config_intr = dm9161_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = 0x00181b80,
--
1.8.0
^ permalink raw reply related
* [PATCH v2 0/3] macb add support for phy gpio interrupt
From: Joachim Eastwood @ 2012-11-11 23:56 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
Main feature of this patch set is phy gpio interrupt for macb.
There is a couple of concerns about this patch series.
* PHY interrupt support has never been supported with macb before but many board have set phy_irq_pin variable. These board will be swapped over to interrupt handing now and while this should work but one can never be 100% certain.
* at91_ether driver supported interrupt on some PHYs which does not have PHY drivers in phylib or doesn't have interrupt support hooked up.
Patch 1 add interrupt handing to a couple of Davicom PHY that is used on most (all?) Atmel eval boards and was also popular on custom boards.
If the 2nd patch breaks any boards there are 2 possible ways to fix the issue. One would be to go back to polling by setting phy_irq_pin to EINVAL. The other would be add a proper PHY driver with interrupt support for the PHY in question.
I would be grateful if anyone can test the 2 first patches on any AT91 boards that they might have access to. If there is any breakage I am more than willing to help out.
Patch series was tested on a custom board with DM9161AEP and AT91RM9200 EMAC.
Last patch in this series is unrelated to the phy stuff. It's is a small fix for macb hw set addr functions when used in at91_ether.
v2: set PHY_HAS_INTERRUPT in phy_driver flags.
Joachim Eastwood (3):
net/phy/davicom: add irq functions to DM9161E and DM9161A
net/macb: add support for phy irq via gpio pin
net/macb: clear unused address register
drivers/net/ethernet/cadence/macb.c | 20 +++++++++++++++++++-
drivers/net/ethernet/cadence/macb.h | 6 ++++++
drivers/net/phy/davicom.c | 6 ++++++
3 files changed, 31 insertions(+), 1 deletion(-)
--
1.8.0
^ permalink raw reply
* Pull request for 'davem-next.r8169' branch
From: Francois Romieu @ 2012-11-11 23:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Kirill Smelkov, Dayanidhi Sreenivasan, Hayes Wang
Please pull from branch 'davem-next.r8169' in repository
git://violet.fr.zoreil.com/romieu/linux davem-next.r8169
to get the changes below.
Distance from 'davem-next' (d4185bbf62a5d8d777ee445db1581beb17882a07)
---------------------------------------------------------------------
810f4893e93b4e074be6b7a7cc6a36a1f2c51aa8
ac50974b37f2763aa8c6e6626e17694af468b9ad
Diffstat
--------
drivers/net/ethernet/realtek/r8169.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
Shortlog
--------
Dayanidhi Sreenivasan (1):
r8169: remove unused macros.
Kirill Smelkov (1):
r8169: Drop tp arg from rtl8169_tx_vlan_tag()
Patch
-----
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 50a55fb..248f883 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -84,17 +84,12 @@ static const int multicast_filter_limit = 32;
#define R8169_NAPI_WEIGHT 64
#define NUM_TX_DESC 64 /* Number of Tx descriptor registers */
#define NUM_RX_DESC 256 /* Number of Rx descriptor registers */
-#define RX_BUF_SIZE 1536 /* Rx Buffer size */
#define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc))
#define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc))
#define RTL8169_TX_TIMEOUT (6*HZ)
#define RTL8169_PHY_TIMEOUT (10*HZ)
-#define RTL_EEPROM_SIG cpu_to_le32(0x8129)
-#define RTL_EEPROM_SIG_MASK cpu_to_le32(0xffff)
-#define RTL_EEPROM_SIG_ADDR 0x0000
-
/* write/read MMIO register */
#define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg))
#define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg))
@@ -1819,8 +1814,7 @@ static int rtl8169_set_features(struct net_device *dev,
}
-static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp,
- struct sk_buff *skb)
+static inline u32 rtl8169_tx_vlan_tag(struct sk_buff *skb)
{
return (vlan_tx_tag_present(skb)) ?
TxVlanTag | swab16(vlan_tx_tag_get(skb)) : 0x00;
@@ -5821,7 +5815,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
tp->tx_skb[entry].len = len;
txd->addr = cpu_to_le64(mapping);
- opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(tp, skb));
+ opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(skb));
opts[0] = DescOwn;
rtl8169_tso_csum(tp, skb, opts);
--
Ueimor
^ permalink raw reply related
* Re: [PATCH v3 8/7] pppoatm: fix missing wakeup in pppoatm_send()
From: Chas Williams (CONTRACTOR) @ 2012-11-11 22:57 UTC (permalink / raw)
To: David Woodhouse; +Cc: Krzysztof Mazur, netdev, linux-kernel, davem
In-Reply-To: <1352667081.9449.135.camel@shinybook.infradead.org>
In message <1352667081.9449.135.camel@shinybook.infradead.org>,David Woodhouse writes:
>Acked-by: David Woodhouse <David.Woodhouse@intel.com> for your new
>version of patch #6 (returning DROP_PACKET for !VF_READY), and your
>followup to my patch #8, adding the 'need_wakeup' flag. Which we might
>as well merge into (the pppoatm part of) my patch.
>
>Chas, are you happy with the generic ATM part of that? And the
>nomenclature? I didn't want to call it 'release_cb' like the core socket
>code does, because we use 'release' to mean something different in ATM.
>So I called it 'unlock_cb' instead...
i really would prefer not to use a strange name since it might confuse
larger group of people who are more familiar with the traditional meaning
of this function. vcc_release() isnt exported so we could rename it if
things get too confusing.
i have to look at this a bit more but we might be able to use release_cb
to get rid of the null push to detach the underlying protocol. that would
be somewhat nice.
^ permalink raw reply
* Re: [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt()
From: David Miller @ 2012-11-11 22:50 UTC (permalink / raw)
To: xi.wang; +Cc: netdev
In-Reply-To: <50A0244F.1070302@gmail.com>
From: Xi Wang <xi.wang@gmail.com>
Date: Sun, 11 Nov 2012 17:18:55 -0500
> On 11/11/12 5:02 PM, David Miller wrote:
>>
>> This code is a fast bit test on purpose. You're making the
>> code slower.
>
> No, it's the opposite. All modern compilers optimize switch cases
> into a fast bit test.
Indeed, I even checked sparc64 with gcc-4.6 and it looks good.
Thanks for the clarification, I'll apply this, thanks.
^ permalink raw reply
* Re: [PATCH v3 8/7] pppoatm: fix missing wakeup in pppoatm_send()
From: Chas Williams (CONTRACTOR) @ 2012-11-11 22:47 UTC (permalink / raw)
To: Krzysztof Mazur; +Cc: David Woodhouse, netdev, linux-kernel, davem
In-Reply-To: <20121111110437.GA25894@shrek.podlesie.net>
In message <20121111110437.GA25894@shrek.podlesie.net>,Krzysztof Mazur writes:
>Any race with testing vcc flags is probably not really important
>because:
> - vcc_release_async() does not take any lock so this check
> will be always racy so we are probably allowed to send
> new frames until vcc is really closed,
this locking/synchronization is handled in the atm device drivers.
the send and close routines are responsbile for synchronization (yes, i
believe that leads to duplicated code but that is the way it currently is)
^ permalink raw reply
* Re: [PATCH] r8169: Drop tp arg from rtl8169_tx_vlan_tag()
From: Francois Romieu @ 2012-11-11 22:18 UTC (permalink / raw)
To: Kirill Smelkov; +Cc: Realtek linux nic maintainers, netdev, Hayes Wang
In-Reply-To: <1352567462-23174-1-git-send-email-kirr@mns.spb.ru>
Kirill Smelkov <kirr@mns.spb.ru> :
> Since eab6d18d (vlan: Don't check for vlan group before
> vlan_tx_tag_present.) we don't check tp->vlgrp and thus tp is not needed
> in this function.
Pushed to branch git://violet.fr.zoreil.com/romieu/linux davem-next.r8169
Thanks.
--
Ueimor
^ permalink raw reply
* Re: [PATCH] vmxnet3: convert BUG_ON(true) into a simple BUG()
From: Ryan Mallon @ 2012-11-11 22:27 UTC (permalink / raw)
To: Sasha Levin; +Cc: linux-kernel, Shreyas Bhatewara, VMware, Inc., netdev
In-Reply-To: <1352406191-14303-1-git-send-email-sasha.levin@oracle.com>
On 09/11/12 07:23, Sasha Levin wrote:
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
> drivers/net/vmxnet3/vmxnet3_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index 0ae1bcc..7e9622f 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -1922,7 +1922,7 @@ vmxnet3_free_irqs(struct vmxnet3_adapter *adapter)
> free_irq(adapter->pdev->irq, adapter->netdev);
> break;
> default:
> - BUG_ON(true);
> + BUG();
> }
> }
All of the BUG_ON tests in this function look like programming error
assertions. It looks like the worst that would happen is that some irqs
might not be properly released, not the sort of thing that is going to
make the system unstable if you don't bug.
Can't they just be replaced with (for example):
if (WARN_ON(blah))
return;
Or even just:
netdev_err(adapter->netdev, "bad irq type %d for free\n",
intr->type);
~Ryan
^ permalink raw reply
* [PATCH 3/3] net/macb: clear unused address register
From: Joachim Eastwood @ 2012-11-11 22:23 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352672607-12793-1-git-send-email-manabian@gmail.com>
Only the first register set is used for matching but
we support getting the initial hw addr from any of
the registers.
To prevent stale entries and false matches clear unused
register sets. This most important for the at91_ether
driver where u-boot always uses the 2nd register set.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/ethernet/cadence/macb.c | 8 ++++++++
drivers/net/ethernet/cadence/macb.h | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index ca34efc..edb2aba 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -108,6 +108,14 @@ void macb_set_hwaddr(struct macb *bp)
macb_or_gem_writel(bp, SA1B, bottom);
top = cpu_to_le16(*((u16 *)(bp->dev->dev_addr + 4)));
macb_or_gem_writel(bp, SA1T, top);
+
+ /* Clear unused address register sets */
+ macb_or_gem_writel(bp, SA2B, 0);
+ macb_or_gem_writel(bp, SA2T, 0);
+ macb_or_gem_writel(bp, SA3B, 0);
+ macb_or_gem_writel(bp, SA3T, 0);
+ macb_or_gem_writel(bp, SA4B, 0);
+ macb_or_gem_writel(bp, SA4T, 0);
}
EXPORT_SYMBOL_GPL(macb_set_hwaddr);
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 864e380..4414421 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -74,6 +74,12 @@
#define GEM_HRT 0x0084
#define GEM_SA1B 0x0088
#define GEM_SA1T 0x008C
+#define GEM_SA2B 0x0090
+#define GEM_SA2T 0x0094
+#define GEM_SA3B 0x0098
+#define GEM_SA3T 0x009C
+#define GEM_SA4B 0x00A0
+#define GEM_SA4T 0x00A4
#define GEM_OTX 0x0100
#define GEM_DCFG1 0x0280
#define GEM_DCFG2 0x0284
--
1.8.0
^ permalink raw reply related
* [PATCH 1/3] net/phy/davicom: add irq functions to DM9161E and DM9161A
From: Joachim Eastwood @ 2012-11-11 22:23 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352672607-12793-1-git-send-email-manabian@gmail.com>
Both these PHYs support interrupt generation on IC pin 32.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/phy/davicom.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index 81c7bc0..a2ad421 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -153,6 +153,8 @@ static struct phy_driver dm91xx_driver[] = {
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
.read_status = genphy_read_status,
+ .ack_interrupt = dm9161_ack_interrupt,
+ .config_intr = dm9161_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = 0x0181b8a0,
@@ -162,6 +164,8 @@ static struct phy_driver dm91xx_driver[] = {
.config_init = dm9161_config_init,
.config_aneg = dm9161_config_aneg,
.read_status = genphy_read_status,
+ .ack_interrupt = dm9161_ack_interrupt,
+ .config_intr = dm9161_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = 0x00181b80,
--
1.8.0
^ permalink raw reply related
* [PATCH 2/3] net/macb: add support for phy irq via gpio pin
From: Joachim Eastwood @ 2012-11-11 22:23 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
In-Reply-To: <1352672607-12793-1-git-send-email-manabian@gmail.com>
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/ethernet/cadence/macb.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 1fac769..ca34efc 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -16,6 +16,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/init.h>
+#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
@@ -261,7 +262,9 @@ static void macb_handle_link_change(struct net_device *dev)
static int macb_mii_probe(struct net_device *dev)
{
struct macb *bp = netdev_priv(dev);
+ struct macb_platform_data *pdata;
struct phy_device *phydev;
+ int phy_irq;
int ret;
phydev = phy_find_first(bp->mii_bus);
@@ -270,7 +273,14 @@ static int macb_mii_probe(struct net_device *dev)
return -1;
}
- /* TODO : add pin_irq */
+ pdata = dev_get_platdata(&bp->pdev->dev);
+ if (pdata && gpio_is_valid(pdata->phy_irq_pin)) {
+ ret = devm_gpio_request(&bp->pdev->dev, pdata->phy_irq_pin, "phy int");
+ if (!ret) {
+ phy_irq = gpio_to_irq(pdata->phy_irq_pin);
+ phydev->irq = (phy_irq < 0) ? PHY_POLL : phy_irq;
+ }
+ }
/* attach the mac to the phy */
ret = phy_connect_direct(dev, phydev, &macb_handle_link_change, 0,
--
1.8.0
^ permalink raw reply related
* [PATCH 0/3] macb add support for phy gpio interrupt
From: Joachim Eastwood @ 2012-11-11 22:23 UTC (permalink / raw)
To: nicolas.ferre, davem; +Cc: plagnioj, netdev, Joachim Eastwood
Main feature of this patch set is phy gpio interrupt for macb.
There is a couple of concerns about this patch series.
* PHY interrupt support has never been supported with macb before but many board have set phy_irq_pin variable. These board will be swapped over to interrupt handing now and while this should work but one can never be 100% certain.
* at91_ether driver supported interrupt on some PHYs which does not have PHY drivers in phylib or doesn't have interrupt support hooked up.
Patch 1 add interrupt handing to a couple of Davicom PHY that is used on most (all?) Atmel eval boards and was also popular on custom boards.
If the 2nd patch breaks any boards there are 2 possible ways to fix the issue. One would be to go back to polling by setting phy_irq_pin to EINVAL. The other would be add a proper PHY driver with interrupt support for the PHY in question.
I would be grateful if anyone can test the 2 first patches on any AT91 boards that they might have access to. If there is any breakage I am more than willing to help out.
Patch series was tested on a custom board with DM9161AEP and AT91RM9200 EMAC.
Last patch in this series is unrelated to the phy stuff. It's is a small fix for macb hw set addr functions when used in at91_ether.
Joachim Eastwood (3):
net/phy/davicom: add irq functions to DM9161E and DM9161A
net/macb: add support for phy irq via gpio pin
net/macb: clear unused address register
drivers/net/ethernet/cadence/macb.c | 20 +++++++++++++++++++-
drivers/net/ethernet/cadence/macb.h | 6 ++++++
drivers/net/phy/davicom.c | 4 ++++
3 files changed, 29 insertions(+), 1 deletion(-)
--
1.8.0
^ permalink raw reply
* Re: [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt()
From: Xi Wang @ 2012-11-11 22:18 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20121111.170247.780516266044882867.davem@davemloft.net>
On 11/11/12 5:02 PM, David Miller wrote:
>
> This code is a fast bit test on purpose. You're making the
> code slower.
No, it's the opposite. All modern compilers optimize switch cases
into a fast bit test. The original "smarter" code, however, hinders
the compiler determining the mask for a fast bit test. With this
patch, GCC is able to compute a better mask. You can check the
assembly.
- xi
^ permalink raw reply
* Re: [PATCH 1/1] r8169: Removed unused macros from r8169.c
From: Francois Romieu @ 2012-11-11 22:07 UTC (permalink / raw)
To: Dayanidhi Sreenivasan; +Cc: nic_swsd, netdev, linux-kernel, Hayes Wang
In-Reply-To: <1352652518-2287-1-git-send-email-dayanidhi.sreenivasan@gmail.com>
Dayanidhi Sreenivasan <dayanidhi.sreenivasan@gmail.com> :
[...]
I have fixed the conflict with the driver in net-next due to removal of
the SafeMtu #define and pushed the result in branch davem-next.r8169 at
git://violet.fr.zoreil.com/romieu/linux
Next time you send a patch, please specify the branch it should apply
to and check it does not conflict.
Thanks.
--
Ueimor
^ permalink raw reply
* Re: [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt()
From: David Miller @ 2012-11-11 22:02 UTC (permalink / raw)
To: xi.wang; +Cc: netdev
In-Reply-To: <1352668801-14373-1-git-send-email-xi.wang@gmail.com>
This code is a fast bit test on purpose. You're making the
code slower.
I'm not applying this patch.
^ 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