* [PATCH 8/9] can: janz-ican3: don't copy data to rx'ed RTR frames
From: Marc Kleine-Budde @ 2010-12-25 14:40 UTC (permalink / raw)
To: netdev; +Cc: socketcan-core, Marc Kleine-Budde
In-Reply-To: <1293288034-22428-1-git-send-email-mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Ira W. Snyder <iws@ovro.caltech.edu>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/janz-ican3.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 810345f..77c8413 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -807,18 +807,15 @@ static void ican3_to_can_frame(struct ican3_dev *mod,
struct can_frame *cf)
{
if ((desc->command & ICAN3_CAN_TYPE_MASK) == ICAN3_CAN_TYPE_SFF) {
- if (desc->data[1] & ICAN3_SFF_RTR)
- cf->can_id |= CAN_RTR_FLAG;
-
cf->can_id |= desc->data[0] << 3;
cf->can_id |= (desc->data[1] & 0xe0) >> 5;
+
cf->can_dlc = get_can_dlc(desc->data[1] & ICAN3_CAN_DLC_MASK);
- memcpy(cf->data, &desc->data[2], cf->can_dlc);
- } else {
- cf->can_dlc = get_can_dlc(desc->data[0] & ICAN3_CAN_DLC_MASK);
- if (desc->data[0] & ICAN3_EFF_RTR)
+ if (desc->data[1] & ICAN3_SFF_RTR)
cf->can_id |= CAN_RTR_FLAG;
-
+ else
+ memcpy(cf->data, &desc->data[2], cf->can_dlc);
+ } else {
if (desc->data[0] & ICAN3_EFF) {
cf->can_id |= CAN_EFF_FLAG;
cf->can_id |= desc->data[2] << 21; /* 28-21 */
@@ -830,7 +827,11 @@ static void ican3_to_can_frame(struct ican3_dev *mod,
cf->can_id |= desc->data[3] >> 5; /* 2-0 */
}
- memcpy(cf->data, &desc->data[6], cf->can_dlc);
+ cf->can_dlc = get_can_dlc(desc->data[0] & ICAN3_CAN_DLC_MASK);
+ if (desc->data[0] & ICAN3_EFF_RTR)
+ cf->can_id |= CAN_RTR_FLAG;
+ else
+ memcpy(cf->data, &desc->data[6], cf->can_dlc);
}
}
--
1.7.2.3
^ permalink raw reply related
* [PATCH 7/9] can: janz-ican3: cleanup of ican3_to_can_frame and can_frame_to_ican3
From: Marc Kleine-Budde @ 2010-12-25 14:40 UTC (permalink / raw)
To: netdev; +Cc: socketcan-core, Marc Kleine-Budde, Ira W. Snyder
In-Reply-To: <1293288034-22428-1-git-send-email-mkl@pengutronix.de>
This patch cleans up the ICAN3 to Linux CAN frame and vice versa
conversion functions:
- RX: Use get_can_dlc() to limit the dlc value.
- TX: Drop invalid skbs wiht can_dropped_invalid_skb
- both: Don't copy the whole frame, only copy the amount of bytes specified
in cf->can_dlc.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/janz-ican3.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index b9a6d7a..810345f 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -812,10 +812,10 @@ static void ican3_to_can_frame(struct ican3_dev *mod,
cf->can_id |= desc->data[0] << 3;
cf->can_id |= (desc->data[1] & 0xe0) >> 5;
- cf->can_dlc = desc->data[1] & ICAN3_CAN_DLC_MASK;
- memcpy(cf->data, &desc->data[2], sizeof(cf->data));
+ cf->can_dlc = get_can_dlc(desc->data[1] & ICAN3_CAN_DLC_MASK);
+ memcpy(cf->data, &desc->data[2], cf->can_dlc);
} else {
- cf->can_dlc = desc->data[0] & ICAN3_CAN_DLC_MASK;
+ cf->can_dlc = get_can_dlc(desc->data[0] & ICAN3_CAN_DLC_MASK);
if (desc->data[0] & ICAN3_EFF_RTR)
cf->can_id |= CAN_RTR_FLAG;
@@ -830,7 +830,7 @@ static void ican3_to_can_frame(struct ican3_dev *mod,
cf->can_id |= desc->data[3] >> 5; /* 2-0 */
}
- memcpy(cf->data, &desc->data[6], sizeof(cf->data));
+ memcpy(cf->data, &desc->data[6], cf->can_dlc);
}
}
@@ -862,7 +862,7 @@ static void can_frame_to_ican3(struct ican3_dev *mod,
}
/* copy the data bits into the descriptor */
- memcpy(&desc->data[6], cf->data, sizeof(cf->data));
+ memcpy(&desc->data[6], cf->data, cf->can_dlc);
}
/*
@@ -1421,6 +1421,9 @@ static int ican3_xmit(struct sk_buff *skb, struct net_device *ndev)
void __iomem *desc_addr;
unsigned long flags;
+ if (can_dropped_invalid_skb(dev, skb))
+ return NETDEV_TX_OK;
+
spin_lock_irqsave(&mod->lock, flags);
/* check that we can actually transmit */
--
1.7.2.3
^ permalink raw reply related
* [PATCH 5/9] can: mcp251x: don't copy data to rx'ed RTR frames
From: Marc Kleine-Budde @ 2010-12-25 14:40 UTC (permalink / raw)
To: netdev; +Cc: socketcan-core, Marc Kleine-Budde, Christian Pellegrin
In-Reply-To: <1293288034-22428-1-git-send-email-mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Christian Pellegrin <chripell@fsfe.org>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/mcp251x.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 7ab534a..9e08acc 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -481,7 +481,8 @@ static void mcp251x_hw_rx(struct spi_device *spi, int buf_idx)
}
/* Data length */
frame->can_dlc = get_can_dlc(buf[RXBDLC_OFF] & RXBDLC_LEN_MASK);
- memcpy(frame->data, buf + RXBDAT_OFF, frame->can_dlc);
+ if (!(frame->can_id & CAN_RTR_FLAG))
+ memcpy(frame->data, buf + RXBDAT_OFF, frame->can_dlc);
priv->net->stats.rx_packets++;
priv->net->stats.rx_bytes += frame->can_dlc;
--
1.7.2.3
^ permalink raw reply related
* [PATCH 4/9] can: sja1000: don't copy data to rx'ed RTR frames
From: Marc Kleine-Budde @ 2010-12-25 14:40 UTC (permalink / raw)
To: netdev; +Cc: socketcan-core, Marc Kleine-Budde, Wolfgang Grandegger
In-Reply-To: <1293288034-22428-1-git-send-email-mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/sja1000/sja1000.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 0a8de01..bb4bfe3 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -346,13 +346,12 @@ static void sja1000_rx(struct net_device *dev)
| (priv->read_reg(priv, REG_ID2) >> 5);
}
- if (fi & FI_RTR) {
+ cf->can_dlc = get_can_dlc(fi & 0x0F);
+ if (fi & FI_RTR)
id |= CAN_RTR_FLAG;
- } else {
- cf->can_dlc = get_can_dlc(fi & 0x0F);
+ else
for (i = 0; i < cf->can_dlc; i++)
cf->data[i] = priv->read_reg(priv, dreg++);
- }
cf->can_id = id;
--
1.7.2.3
^ permalink raw reply related
* [PATCH 2/9] can: bfin_can: don't copy data to rx'ed RTR frames
From: Marc Kleine-Budde @ 2010-12-25 14:40 UTC (permalink / raw)
To: netdev; +Cc: socketcan-core, Marc Kleine-Budde, Barry Song
In-Reply-To: <1293288034-22428-1-git-send-email-mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Barry Song <21cnbao@gmail.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/bfin_can.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index b6e890d..07222ca 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -306,18 +306,19 @@ static void bfin_can_rx(struct net_device *dev, u16 isrc)
& 0x1ffc) >> 2;
obj = RECEIVE_STD_CHL;
}
- if (bfin_read16(®->chl[obj].id1) & RTR)
- cf->can_id |= CAN_RTR_FLAG;
/* get data length code */
cf->can_dlc = get_can_dlc(bfin_read16(®->chl[obj].dlc) & 0xF);
- /* get payload */
- for (i = 0; i < 8; i += 2) {
- val = bfin_read16(®->chl[obj].data[i]);
- cf->data[7 - i] = (7 - i) < cf->can_dlc ? val : 0;
- cf->data[6 - i] = (6 - i) < cf->can_dlc ? (val >> 8) : 0;
- }
+ if (bfin_read16(®->chl[obj].id1) & RTR)
+ cf->can_id |= CAN_RTR_FLAG;
+ else /* get payload */
+ for (i = 0; i < 8; i += 2) {
+ val = bfin_read16(®->chl[obj].data[i]);
+ cf->data[7 - i] = (7 - i) < cf->can_dlc ? val : 0;
+ cf->data[6 - i] = (6 - i) < cf->can_dlc ?
+ (val >> 8) : 0;
+ }
netif_rx(skb);
--
1.7.2.3
^ permalink raw reply related
* [PATCH 6/9] can: ti_hecc: don't copy data to rx'ed RTR frames
From: Marc Kleine-Budde @ 2010-12-25 14:40 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde
In-Reply-To: <1293288034-22428-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
While there, remove clearing of data if the dlc isn't longer as 4.
can frames have data initializes to zero.
Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc:Anant Gole <anantgole-l0cyMroinI0@public.gmane.org>
Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
---
drivers/net/can/ti_hecc.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 4d07f1e..b33581b 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -560,18 +560,20 @@ static int ti_hecc_rx_pkt(struct ti_hecc_priv *priv, int mbxno)
cf->can_id = (data & CAN_EFF_MASK) | CAN_EFF_FLAG;
else
cf->can_id = (data >> 18) & CAN_SFF_MASK;
+
data = hecc_read_mbx(priv, mbxno, HECC_CANMCF);
+ cf->can_dlc = get_can_dlc(data & 0xF);
if (data & HECC_CANMCF_RTR)
cf->can_id |= CAN_RTR_FLAG;
- cf->can_dlc = get_can_dlc(data & 0xF);
- data = hecc_read_mbx(priv, mbxno, HECC_CANMDL);
- *(u32 *)(cf->data) = cpu_to_be32(data);
- if (cf->can_dlc > 4) {
- data = hecc_read_mbx(priv, mbxno, HECC_CANMDH);
- *(u32 *)(cf->data + 4) = cpu_to_be32(data);
- } else {
- *(u32 *)(cf->data + 4) = 0;
+ else {
+ data = hecc_read_mbx(priv, mbxno, HECC_CANMDL);
+ *(u32 *)(cf->data) = cpu_to_be32(data);
+ if (cf->can_dlc > 4) {
+ data = hecc_read_mbx(priv, mbxno, HECC_CANMDH);
+ *(u32 *)(cf->data + 4) = cpu_to_be32(data);
+ }
}
+
spin_lock_irqsave(&priv->mbx_lock, flags);
hecc_clear_bit(priv, HECC_CANME, mbx_mask);
hecc_write(priv, HECC_CANRMP, mbx_mask);
--
1.7.2.3
^ permalink raw reply related
* [PATCH 3/9] can: flexcan: don't copy data to rx'ed RTR frames
From: Marc Kleine-Budde @ 2010-12-25 14:40 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde
In-Reply-To: <1293288034-22428-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
---
drivers/net/can/flexcan.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index d499056..b0e16f5 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -471,12 +471,14 @@ static void flexcan_read_fifo(const struct net_device *dev,
else
cf->can_id = (reg_id >> 18) & CAN_SFF_MASK;
- if (reg_ctrl & FLEXCAN_MB_CNT_RTR)
- cf->can_id |= CAN_RTR_FLAG;
cf->can_dlc = get_can_dlc((reg_ctrl >> 16) & 0xf);
- *(__be32 *)(cf->data + 0) = cpu_to_be32(readl(&mb->data[0]));
- *(__be32 *)(cf->data + 4) = cpu_to_be32(readl(&mb->data[1]));
+ if (reg_ctrl & FLEXCAN_MB_CNT_RTR)
+ cf->can_id |= CAN_RTR_FLAG;
+ else {
+ *(__be32 *)(cf->data + 0) = cpu_to_be32(readl(&mb->data[0]));
+ *(__be32 *)(cf->data + 4) = cpu_to_be32(readl(&mb->data[1]));
+ }
/* mark as read */
writel(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1);
--
1.7.2.3
^ permalink raw reply related
* [PATCH 1/9] can: at91_can: don't copy data to rx'ed RTR frames
From: Marc Kleine-Budde @ 2010-12-25 14:40 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde
In-Reply-To: <1293288034-22428-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
---
drivers/net/can/at91_can.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 7ef83d0..53c6598 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -491,12 +491,14 @@ static void at91_read_mb(struct net_device *dev, unsigned int mb,
cf->can_id = (reg_mid >> 18) & CAN_SFF_MASK;
reg_msr = at91_read(priv, AT91_MSR(mb));
- if (reg_msr & AT91_MSR_MRTR)
- cf->can_id |= CAN_RTR_FLAG;
cf->can_dlc = get_can_dlc((reg_msr >> 16) & 0xf);
- *(u32 *)(cf->data + 0) = at91_read(priv, AT91_MDL(mb));
- *(u32 *)(cf->data + 4) = at91_read(priv, AT91_MDH(mb));
+ if (reg_msr & AT91_MSR_MRTR)
+ cf->can_id |= CAN_RTR_FLAG;
+ else {
+ *(u32 *)(cf->data + 0) = at91_read(priv, AT91_MDL(mb));
+ *(u32 *)(cf->data + 4) = at91_read(priv, AT91_MDH(mb));
+ }
/* allow RX of extended frames */
at91_write(priv, AT91_MID(mb), AT91_MID_MIDE);
--
1.7.2.3
^ permalink raw reply related
* [PATCH 0/9] can: don't copy data to rx'ed RTR frames
From: Marc Kleine-Budde @ 2010-12-25 14:40 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA; +Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w
Hello,
this series of patches changes the can driver's RX path. If a RTR frame is
received no data is copied.
As discussed on socketcan-core:
https://lists.berlios.de/pipermail/socketcan-core/2010-October/004836.html
cheers,
Marc
---
The following changes since commit e1928c86c4829703b800c81cc9edc939b5634e6f:
cnic: Add FCoE support on 57712 (2010-12-23 11:44:34 -0800)
are available in the git repository at:
git://git.pengutronix.de/git/mkl/linux-2.6.git public/can/rtr-for-net-next
Marc Kleine-Budde (9):
can: at91_can: don't copy data to rx'ed RTR frames
can: bfin_can: don't copy data to rx'ed RTR frames
can: flexcan: don't copy data to rx'ed RTR frames
can: sja1000: don't copy data to rx'ed RTR frames
can: mcp251x: don't copy data to rx'ed RTR frames
can: ti_hecc: don't copy data to rx'ed RTR frames
can: janz-ican3: cleanup of ican3_to_can_frame and can_frame_to_ican3
can: janz-ican3: don't copy data to rx'ed RTR frames
can: pch_can: don't copy data to rx'ed RTR frames
drivers/net/can/at91_can.c | 10 ++++++----
drivers/net/can/bfin_can.c | 17 +++++++++--------
drivers/net/can/flexcan.c | 10 ++++++----
drivers/net/can/janz-ican3.c | 26 +++++++++++++++-----------
drivers/net/can/mcp251x.c | 3 ++-
drivers/net/can/pch_can.c | 15 ++++++++-------
drivers/net/can/sja1000/sja1000.c | 7 +++----
drivers/net/can/ti_hecc.c | 18 ++++++++++--------
8 files changed, 59 insertions(+), 47 deletions(-)
^ permalink raw reply
* Re: Help: major pppoe regression since 2.6.35 (panic on first ppp conection)?
From: Joel Soete @ 2010-12-25 13:51 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: Eric Dumazet, Andrew Morton, Linux Kernel, netdev
In-Reply-To: <20101225121044.GA1841@del.dom.local>
Hello Jarek,
On 12/25/2010 12:10 PM, Jarek Poplawski wrote:
> On Fri, Dec 24, 2010 at 04:13:25PM +0100, Jarek Poplawski wrote:
>> On Fri, Dec 24, 2010 at 11:22:25AM +0000, Joel Soete wrote:
>>> Hello Jarek,
>> Hi Joel,
>>
[snip]
>
> Alas the list rejected your message (try to limit it to ~200kb next
> time).
>
Ah ok I will take care next ;<)
> Anyway, it looks like the sundance driver is the main guilty. The
> patch below removes one obvious bug but there could be something more.
> Please, apply this one and my previous debugging patch to the clean
> 2.6.37-rc7. (If there're still warnings the first ~20kb should do.)
>
> Thanks,
> Jarek P.
> ---
>
> diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
> index 3ed2a67..b409d7e 100644
> --- a/drivers/net/sundance.c
> +++ b/drivers/net/sundance.c
> @@ -1016,7 +1016,7 @@ static void init_ring(struct net_device *dev)
>
> /* Fill in the Rx buffers. Handle allocation failure gracefully. */
> for (i = 0; i< RX_RING_SIZE; i++) {
> - struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
> + struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + 2);
> np->rx_skbuff[i] = skb;
> if (skb == NULL)
> break;
> @@ -1407,7 +1407,7 @@ static void refill_rx (struct net_device *dev)
> struct sk_buff *skb;
> entry = np->dirty_rx % RX_RING_SIZE;
> if (np->rx_skbuff[entry] == NULL) {
> - skb = dev_alloc_skb(np->rx_buf_sz);
> + skb = dev_alloc_skb(np->rx_buf_sz + 2);
> np->rx_skbuff[entry] = skb;
> if (skb == NULL)
> break; /* Better luck next round. */
>
I don't have any more warnings :<)
Awesome job.
Thanks a lot for help and I wish you a Happy new year,
J.
^ permalink raw reply
* [PATCH] net: bridge: check the length of skb after nf_bridge_maybe_copy_header()
From: Changli Gao @ 2010-12-25 13:41 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, bridge, netdev, Changli Gao
Since nf_bridge_maybe_copy_header() may change the length of skb,
we should check the length of skb after it to handle the ppoe skbs.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
net/bridge/br_forward.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 2bd11ec..ee64287 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -41,17 +41,13 @@ static inline unsigned packet_length(const struct sk_buff *skb)
int br_dev_queue_push_xmit(struct sk_buff *skb)
{
- /* drop mtu oversized packets except gso */
- if (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb))
+ /* ip_fragment doesn't copy the MAC header */
+ if (nf_bridge_maybe_copy_header(skb) ||
+ (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb))) {
kfree_skb(skb);
- else {
- /* ip_fragment doesn't copy the MAC header */
- if (nf_bridge_maybe_copy_header(skb))
- kfree_skb(skb);
- else {
- skb_push(skb, ETH_HLEN);
- dev_queue_xmit(skb);
- }
+ } else {
+ skb_push(skb, ETH_HLEN);
+ dev_queue_xmit(skb);
}
return 0;
^ permalink raw reply related
* looking for testers for CDC EEM runtime power management
From: Oliver Neukum @ 2010-12-25 13:29 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
Hi,
this patch implements runtime power management for CDC EEM.
I lack the hardware and need testers.
Regards
Oliver
>From b9e2ecb3a81c122d37528af4283d9e2ebbb43d23 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
Date: Sat, 25 Dec 2010 14:25:45 +0100
Subject: [PATCH] cdc_eem: runtime power management
This patch grants CDC EEM devices which request to be suspended
their wish.
Signed-off-by: Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>
---
drivers/net/usb/cdc_eem.c | 2 ++
drivers/net/usb/usbnet.c | 20 ++++++++++++++++++++
include/linux/usb/usbnet.h | 2 ++
3 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index 5f3b976..be319bd 100644
--- a/drivers/net/usb/cdc_eem.c
+++ b/drivers/net/usb/cdc_eem.c
@@ -245,6 +245,8 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
* - response complete: suggest N sec polling
*/
case 2: /* Suspend hint */
+ usbnet_notify_idle(dev);
+ continue;
case 3: /* Response hint */
case 4: /* Response complete hint */
continue;
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index c04d49e..95727a7 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1201,6 +1201,24 @@ static void usbnet_bh (unsigned long param)
}
}
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Some devices notify the host of an idle condition
+ * this makes use of this information
+ */
+
+void usbnet_notify_idle(struct usbnet *dev)
+{
+ int r;
+
+ if (!test_and_set_bit(EVENT_REP_IDLE, &dev->flags)) {
+ r = usb_autopm_get_interface_async(dev->intf);
+ if (r < 0)
+ clear_bit(EVENT_REP_IDLE, &dev->flags);
+ }
+}
+EXPORT_SYMBOL_GPL(usbnet_notify_idle);
/*-------------------------------------------------------------------------
*
@@ -1495,6 +1513,8 @@ int usbnet_resume (struct usb_interface *intf)
spin_unlock_irq(&dev->txq.lock);
if (!(dev->txq.qlen >= TX_QLEN(dev)))
netif_start_queue(dev->net);
+ if (test_and_clear_bit(EVENT_REP_IDLE, &dev->flags))
+ usb_autopm_get_interface_no_resume(intf);
tasklet_schedule (&dev->bh);
}
return 0;
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 7ae27a4..1cb929a 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -68,6 +68,7 @@ struct usbnet {
# define EVENT_RX_PAUSED 5
# define EVENT_DEV_WAKING 6
# define EVENT_DEV_ASLEEP 7
+# define EVENT_REP_IDLE 8
};
static inline struct usb_driver *driver_of(struct usb_interface *intf)
@@ -205,6 +206,7 @@ extern void usbnet_unlink_rx_urbs(struct usbnet *);
extern void usbnet_pause_rx(struct usbnet *);
extern void usbnet_resume_rx(struct usbnet *);
extern void usbnet_purge_paused_rxq(struct usbnet *);
+extern void usbnet_notify_idle(struct usbnet *);
extern int usbnet_get_settings(struct net_device *net,
struct ethtool_cmd *cmd);
--
1.7.1
--
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
* Re: [net-next-2.6 04/15] e1000e: checkpatch error - open braces
From: Krzysztof Halasa @ 2010-12-25 13:10 UTC (permalink / raw)
To: Jeff Garzik
Cc: jeffrey.t.kirsher, davem, Bruce Allan, netdev, gospo, bphilips
In-Reply-To: <4D15C77C.9030306@garzik.org>
Jeff Garzik <jeff@garzik.org> writes:
>> ERROR: that open brace { should be on the previous line
>> -static const u16 e1000_gg82563_cable_length_table[] =
>> - { 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
>> - static const u32 test[] =
>> - {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
> Gah, that looks worse than the unpatched code.
>
> I think this was an over-literal checkpatch interpretation. If you
> look at e.g. drivers/net/tg3.c, you see that longer tables have the
> trailing braces on a separate line, where they should be.
>
> IMO, the single-line cases should just be left as they are now in the
> source code.
I think so. Also I think it's a false positive - the above aren't the
typical
if()
{
xxx
}
They are instead single lines:
type var[] = {a, b, c, d};
broken into two to meet the (former) line length limit.
Makes me think that we should never break long lines in the code. This
is best left for the text editors and viewers (only while displaying).
--
Krzysztof Halasa
^ permalink raw reply
* Re: [net-next-2.6 01/15] Documentation/networking: Update Intel Wired LAN docs
From: Ben Hutchings @ 2010-12-25 12:30 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: davem, netdev, gospo, bphilips
In-Reply-To: <1293257174-15498-2-git-send-email-jeffrey.t.kirsher@intel.com>
On Fri, 2010-12-24 at 22:06 -0800, jeffrey.t.kirsher@intel.com wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
> - Update the Intel Wired LAN documentation with the latest
> URL for ethtool.
>
> - replace "Ethtool" with "ethtool"
[...]
Thanks Jeff.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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
* Re: Help: major pppoe regression since 2.6.35 (panic on first ppp conection)?
From: Jarek Poplawski @ 2010-12-25 12:10 UTC (permalink / raw)
To: Joel Soete; +Cc: Eric Dumazet, Andrew Morton, Linux Kernel, netdev
In-Reply-To: <20101224151325.GA1895@del.dom.local>
On Fri, Dec 24, 2010 at 04:13:25PM +0100, Jarek Poplawski wrote:
> On Fri, Dec 24, 2010 at 11:22:25AM +0000, Joel Soete wrote:
> > Hello Jarek,
> Hi Joel,
>
> > Ok I get a clean 2.6.37-rc7 vanilla src and apply your debugging
> > patch and grab the attached syslog-2.6.37-rc7-t2.gz with obviously a
> > lot of "warning" (but as well as with Eric's patch, kernel survived
> > to a lynx connection to ftp.eu.kernel.org to download of a snapshot
> > patch ;<) )
>
> Yes, even more than I expected... I hope the list will forgive us ;-)
Alas the list rejected your message (try to limit it to ~200kb next
time).
Anyway, it looks like the sundance driver is the main guilty. The
patch below removes one obvious bug but there could be something more.
Please, apply this one and my previous debugging patch to the clean
2.6.37-rc7. (If there're still warnings the first ~20kb should do.)
Thanks,
Jarek P.
---
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 3ed2a67..b409d7e 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -1016,7 +1016,7 @@ static void init_ring(struct net_device *dev)
/* Fill in the Rx buffers. Handle allocation failure gracefully. */
for (i = 0; i < RX_RING_SIZE; i++) {
- struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
+ struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + 2);
np->rx_skbuff[i] = skb;
if (skb == NULL)
break;
@@ -1407,7 +1407,7 @@ static void refill_rx (struct net_device *dev)
struct sk_buff *skb;
entry = np->dirty_rx % RX_RING_SIZE;
if (np->rx_skbuff[entry] == NULL) {
- skb = dev_alloc_skb(np->rx_buf_sz);
+ skb = dev_alloc_skb(np->rx_buf_sz + 2);
np->rx_skbuff[entry] = skb;
if (skb == NULL)
break; /* Better luck next round. */
^ permalink raw reply related
* Re: [net-next-2.6 04/15] e1000e: checkpatch error - open braces
From: Jeff Garzik @ 2010-12-25 10:29 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: davem, Bruce Allan, netdev, gospo, bphilips
In-Reply-To: <1293257174-15498-5-git-send-email-jeffrey.t.kirsher@intel.com>
On 12/25/2010 01:06 AM, jeffrey.t.kirsher@intel.com wrote:
> From: Bruce Allan<bruce.w.allan@intel.com>
>
> ERROR: that open brace { should be on the previous line
>
> Signed-off-by: Bruce Allan<bruce.w.allan@intel.com>
> Tested-by: Emil Tantilov<emil.s.tantilov@intel.com>
> Signed-off-by: Jeff Kirsher<jeffrey.t.kirsher@intel.com>
> ---
> drivers/net/e1000e/es2lan.c | 4 ++--
> drivers/net/e1000e/ethtool.c | 4 ++--
> drivers/net/e1000e/phy.c | 22 +++++++++++-----------
> 3 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
> index 79da646..b18c644 100644
> --- a/drivers/net/e1000e/es2lan.c
> +++ b/drivers/net/e1000e/es2lan.c
> @@ -100,8 +100,8 @@
> * with a lower bound at "index" and the upper bound at
> * "index + 5".
> */
> -static const u16 e1000_gg82563_cable_length_table[] =
> - { 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
> +static const u16 e1000_gg82563_cable_length_table[] = {
> + 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
> #define GG82563_CABLE_LENGTH_TABLE_SIZE \
> ARRAY_SIZE(e1000_gg82563_cable_length_table)
>
> diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
> index 15c6330..affcacf 100644
> --- a/drivers/net/e1000e/ethtool.c
> +++ b/drivers/net/e1000e/ethtool.c
> @@ -753,8 +753,8 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
> int reg, int offset, u32 mask, u32 write)
> {
> u32 pat, val;
> - static const u32 test[] =
> - {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
> + static const u32 test[] = {
> + 0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
> for (pat = 0; pat< ARRAY_SIZE(test); pat++) {
> E1000_WRITE_REG_ARRAY(&adapter->hw, reg, offset,
> (test[pat]& write));
Gah, that looks worse than the unpatched code.
I think this was an over-literal checkpatch interpretation. If you look
at e.g. drivers/net/tg3.c, you see that longer tables have the trailing
braces on a separate line, where they should be.
IMO, the single-line cases should just be left as they are now in the
source code.
Jeff
^ permalink raw reply
* Re: [net-next-2.6 00/15][pull-request] Intel Wired LAN Driver Update
From: Jeff Kirsher @ 2010-12-25 6:35 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, bphilips
In-Reply-To: <1293257174-15498-1-git-send-email-jeffrey.t.kirsher@intel.com>
On Fri, Dec 24, 2010 at 22:05, <jeffrey.t.kirsher@intel.com> wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
> The following series addresses the more significant issues reported by
> checkpatch when run against the e1000e driver files. The less serious
> whitespace and lines over 80 characters issues are not addressed. In
> addition, added support for anti-spoofing and X540 SR-IOV.
>
> The remaining warnings for msleep < 20ms will be addressed in a follow-on
> patch after a thorough investigation into the timings tolerated by the
> hardware.
>
> The following changes since commit e1928c86c4829703b800c81cc9edc939b5634e6f:
>
> cnic: Add FCoE support on 57712
>
> are available in the git repository at:
>
> master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6.git master
... and happy holidays everyone!
^ permalink raw reply
* [net-next-2.6 01/15] Documentation/networking: Update Intel Wired LAN docs
From: jeffrey.t.kirsher @ 2010-12-25 6:06 UTC (permalink / raw)
To: davem, davem; +Cc: Jeff Kirsher, netdev, gospo, bphilips
In-Reply-To: <1293257174-15498-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
- Update the Intel Wired LAN documentation with the latest
URL for ethtool.
- replace "Ethtool" with "ethtool"
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
---
Documentation/networking/e100.txt | 19 +++++--------------
Documentation/networking/e1000.txt | 6 +++---
Documentation/networking/e1000e.txt | 14 +++++++-------
Documentation/networking/igb.txt | 6 +++---
Documentation/networking/igbvf.txt | 4 ++--
Documentation/networking/ixgb.txt | 10 +++++-----
Documentation/networking/ixgbe.txt | 8 ++++----
7 files changed, 29 insertions(+), 38 deletions(-)
diff --git a/Documentation/networking/e100.txt b/Documentation/networking/e100.txt
index 944aa55..162f323 100644
--- a/Documentation/networking/e100.txt
+++ b/Documentation/networking/e100.txt
@@ -72,7 +72,7 @@ Tx Descriptors: Number of transmit descriptors. A transmit descriptor is a data
ethtool -G eth? tx n, where n is the number of desired tx descriptors.
Speed/Duplex: The driver auto-negotiates the link speed and duplex settings by
- default. Ethtool can be used as follows to force speed/duplex.
+ default. The ethtool utility can be used as follows to force speed/duplex.
ethtool -s eth? autoneg off speed {10|100} duplex {full|half}
@@ -126,30 +126,21 @@ Additional Configurations
-------
The driver utilizes the ethtool interface for driver configuration and
- diagnostics, as well as displaying statistical information. Ethtool
+ diagnostics, as well as displaying statistical information. The ethtool
version 1.6 or later is required for this functionality.
The latest release of ethtool can be found from
- http://sourceforge.net/projects/gkernel.
-
- NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support
- for a more complete ethtool feature set can be enabled by upgrading
- ethtool to ethtool-1.8.1.
-
+ http://ftp.kernel.org/pub/software/network/ethtool/
Enabling Wake on LAN* (WoL)
---------------------------
- WoL is provided through the Ethtool* utility. Ethtool is included with Red
- Hat* 8.0. For other Linux distributions, download and install Ethtool from
- the following website: http://sourceforge.net/projects/gkernel.
-
- For instructions on enabling WoL with Ethtool, refer to the Ethtool man page.
+ WoL is provided through the ethtool* utility. For instructions on enabling
+ WoL with ethtool, refer to the ethtool man page.
WoL will be enabled on the system during the next shut down or reboot. For
this driver version, in order to enable WoL, the e100 driver must be
loaded when shutting down or rebooting the system.
-
NAPI
----
diff --git a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.txt
index 6cb13e9..71ca958 100644
--- a/Documentation/networking/e1000.txt
+++ b/Documentation/networking/e1000.txt
@@ -431,15 +431,15 @@ Additional Configurations
Ethtool
-------
The driver utilizes the ethtool interface for driver configuration and
- diagnostics, as well as displaying statistical information. Ethtool
+ diagnostics, as well as displaying statistical information. The ethtool
version 1.6 or later is required for this functionality.
The latest release of ethtool can be found from
- http://sourceforge.net/projects/gkernel.
+ http://ftp.kernel.org/pub/software/network/ethtool/
Enabling Wake on LAN* (WoL)
---------------------------
- WoL is configured through the Ethtool* utility.
+ WoL is configured through the ethtool* utility.
WoL will be enabled on the system during the next shut down or reboot.
For this driver version, in order to enable WoL, the e1000 driver must be
diff --git a/Documentation/networking/e1000e.txt b/Documentation/networking/e1000e.txt
index 81a66e6..97b5ba9 100644
--- a/Documentation/networking/e1000e.txt
+++ b/Documentation/networking/e1000e.txt
@@ -269,26 +269,26 @@ Additional Configurations
-------
The driver utilizes the ethtool interface for driver configuration and
diagnostics, as well as displaying statistical information. We
- strongly recommend downloading the latest version of Ethtool at:
+ strongly recommend downloading the latest version of ethtool at:
- http://sourceforge.net/projects/gkernel.
+ http://ftp.kernel.org/pub/software/network/ethtool/
Speed and Duplex
----------------
- Speed and Duplex are configured through the Ethtool* utility. For
- instructions, refer to the Ethtool man page.
+ Speed and Duplex are configured through the ethtool* utility. For
+ instructions, refer to the ethtool man page.
Enabling Wake on LAN* (WoL)
---------------------------
- WoL is configured through the Ethtool* utility. For instructions on
- enabling WoL with Ethtool, refer to the Ethtool man page.
+ WoL is configured through the ethtool* utility. For instructions on
+ enabling WoL with ethtool, refer to the ethtool man page.
WoL will be enabled on the system during the next shut down or reboot.
For this driver version, in order to enable WoL, the e1000e driver must be
loaded when shutting down or rebooting the system.
In most cases Wake On LAN is only supported on port A for multiple port
- adapters. To verify if a port supports Wake on Lan run Ethtool eth<X>.
+ adapters. To verify if a port supports Wake on Lan run ethtool eth<X>.
Support
=======
diff --git a/Documentation/networking/igb.txt b/Documentation/networking/igb.txt
index 4a5e29c..98953c0 100644
--- a/Documentation/networking/igb.txt
+++ b/Documentation/networking/igb.txt
@@ -62,15 +62,15 @@ Additional Configurations
-------
The driver utilizes the ethtool interface for driver configuration and
diagnostics, as well as displaying statistical information. The latest
- version of Ethtool can be found at:
+ version of ethtool can be found at:
http://ftp.kernel.org/pub/software/network/ethtool/
Enabling Wake on LAN* (WoL)
---------------------------
- WoL is configured through the Ethtool* utility.
+ WoL is configured through the ethtool* utility.
- For instructions on enabling WoL with Ethtool, refer to the Ethtool man page.
+ For instructions on enabling WoL with ethtool, refer to the ethtool man page.
WoL will be enabled on the system during the next shut down or reboot.
For this driver version, in order to enable WoL, the igb driver must be
diff --git a/Documentation/networking/igbvf.txt b/Documentation/networking/igbvf.txt
index 694817b..cbfe4ee 100644
--- a/Documentation/networking/igbvf.txt
+++ b/Documentation/networking/igbvf.txt
@@ -58,11 +58,11 @@ Additional Configurations
Ethtool
-------
The driver utilizes the ethtool interface for driver configuration and
- diagnostics, as well as displaying statistical information. Ethtool
+ diagnostics, as well as displaying statistical information. The ethtool
version 3.0 or later is required for this functionality, although we
strongly recommend downloading the latest version at:
- http://sourceforge.net/projects/gkernel.
+ http://ftp.kernel.org/pub/software/network/ethtool/
Support
=======
diff --git a/Documentation/networking/ixgb.txt b/Documentation/networking/ixgb.txt
index a0d0ffb..e196f16 100644
--- a/Documentation/networking/ixgb.txt
+++ b/Documentation/networking/ixgb.txt
@@ -309,15 +309,15 @@ Additional Configurations
Ethtool
-------
The driver utilizes the ethtool interface for driver configuration and
- diagnostics, as well as displaying statistical information. Ethtool
+ diagnostics, as well as displaying statistical information. The ethtool
version 1.6 or later is required for this functionality.
The latest release of ethtool can be found from
- http://sourceforge.net/projects/gkernel
+ http://ftp.kernel.org/pub/software/network/ethtool/
- NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support
- for a more complete ethtool feature set can be enabled by upgrading
- to the latest version.
+ NOTE: The ethtool version 1.6 only supports a limited set of ethtool options.
+ Support for a more complete ethtool feature set can be enabled by
+ upgrading to the latest version.
NAPI
diff --git a/Documentation/networking/ixgbe.txt b/Documentation/networking/ixgbe.txt
index 9ade280..af77ed3 100644
--- a/Documentation/networking/ixgbe.txt
+++ b/Documentation/networking/ixgbe.txt
@@ -34,7 +34,7 @@ is an Intel(R) Ethernet Server Adapter X520-2, then it only supports Intel
optics and/or the direct attach cables listed below.
When 82599-based SFP+ devices are connected back to back, they should be set to
-the same Speed setting via Ethtool. Results may vary if you mix speed settings.
+the same Speed setting via ethtool. Results may vary if you mix speed settings.
82598-based adapters support all passive direct attach cables that comply
with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. Active direct attach
cables are not supported.
@@ -110,7 +110,7 @@ threshold. When rx is enabled, the transmit unit will halt for the time delay
specified when a PAUSE frame is received.
Flow Control is enabled by default. If you want to disable a flow control
-capable link partner, use Ethtool:
+capable link partner, use ethtool:
ethtool -A eth? autoneg off RX off TX off
@@ -181,10 +181,10 @@ Additional Configurations
-------
The driver utilizes the ethtool interface for driver configuration and
diagnostics, as well as displaying statistical information. The latest
- Ethtool version is required for this functionality.
+ ethtool version is required for this functionality.
The latest release of ethtool can be found from
- http://sourceforge.net/projects/gkernel.
+ http://ftp.kernel.org/pub/software/network/ethtool/
FCoE
----
--
1.7.3.4
^ permalink raw reply related
* [net-next-2.6 00/15][pull-request] Intel Wired LAN Driver Update
From: jeffrey.t.kirsher @ 2010-12-25 6:05 UTC (permalink / raw)
To: davem, davem; +Cc: Jeff Kirsher, netdev, gospo, bphilips
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
The following series addresses the more significant issues reported by
checkpatch when run against the e1000e driver files. The less serious
whitespace and lines over 80 characters issues are not addressed. In
addition, added support for anti-spoofing and X540 SR-IOV.
The remaining warnings for msleep < 20ms will be addressed in a follow-on
patch after a thorough investigation into the timings tolerated by the
hardware.
The following changes since commit e1928c86c4829703b800c81cc9edc939b5634e6f:
cnic: Add FCoE support on 57712
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6.git master
Alexander Duyck (1):
igbvf: force link checking when mailbox timeout has occurred
Bruce Allan (4):
e1000e: checkpatch error - macro panethesis
e1000e: checkpatch error - trailing statements
e1000e: checkpatch error - open braces
e1000e: checkpatch warnings - braces
Gasparakis, Joseph (1):
igb: Some fine tuning
Greg Rose (7):
igb: Fix overwrite of the VF's flags
igb: Warn on attempt to override administratively set MAC/VLAN
igb: Add Anti-spoofing feature support
ixgbe: Warn on VF attempt to override Administratively set MAC/VLAN
ixgbe: Add SR-IOV feature support to X540
ixgbe: Add anti-spoofing feature support
ixgbevf: Add X540 VF device support to the ixgbevf driver
Jeff Kirsher (1):
Documentation/networking: Update Intel Wired LAN docs
Williams, Mitch A (1):
igbvf: add support for i350 VF device
Documentation/networking/e100.txt | 19 ++----
Documentation/networking/e1000.txt | 6 +-
Documentation/networking/e1000e.txt | 14 ++--
Documentation/networking/igb.txt | 6 +-
Documentation/networking/igbvf.txt | 4 +-
Documentation/networking/ixgb.txt | 10 ++--
Documentation/networking/ixgbe.txt | 8 +-
drivers/net/e1000e/es2lan.c | 8 +-
drivers/net/e1000e/ethtool.c | 118 ++++++++++++++++++-----------------
drivers/net/e1000e/ich8lan.c | 5 +-
drivers/net/e1000e/lib.c | 6 +-
drivers/net/e1000e/netdev.c | 21 +++----
drivers/net/e1000e/phy.c | 25 ++++----
drivers/net/igb/e1000_82575.c | 37 +++++++++++-
drivers/net/igb/e1000_82575.h | 5 ++
drivers/net/igb/e1000_hw.h | 6 +-
drivers/net/igb/e1000_regs.h | 1 +
drivers/net/igb/igb.h | 1 +
drivers/net/igb/igb_main.c | 74 ++++++++++++++++++++--
drivers/net/igbvf/igbvf.h | 1 +
drivers/net/igbvf/netdev.c | 9 +++
drivers/net/igbvf/vf.c | 4 +-
drivers/net/igbvf/vf.h | 2 +
drivers/net/ixgbe/ixgbe_82599.c | 2 +
drivers/net/ixgbe/ixgbe_common.c | 64 +++++++++++++++++++
drivers/net/ixgbe/ixgbe_common.h | 2 +
drivers/net/ixgbe/ixgbe_main.c | 26 +++++++-
drivers/net/ixgbe/ixgbe_mbx.c | 4 +-
drivers/net/ixgbe/ixgbe_sriov.c | 52 ++++++++++++----
drivers/net/ixgbe/ixgbe_type.h | 13 ++++-
drivers/net/ixgbe/ixgbe_x540.c | 2 +
drivers/net/ixgbevf/defines.h | 1 +
drivers/net/ixgbevf/ixgbevf.h | 4 +-
drivers/net/ixgbevf/ixgbevf_main.c | 7 ++-
drivers/net/ixgbevf/vf.c | 6 ++-
drivers/net/ixgbevf/vf.h | 1 +
36 files changed, 410 insertions(+), 164 deletions(-)
--
1.7.3.4
^ permalink raw reply
* [net-next-2.6 15/15] ixgbevf: Add X540 VF device support to the ixgbevf driver
From: jeffrey.t.kirsher @ 2010-12-25 6:06 UTC (permalink / raw)
To: davem, davem; +Cc: Greg Rose, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1293257174-15498-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Greg Rose <gregory.v.rose@intel.com>
The X540 introduces a new Virtual Function device ID so that the X540
VF device can be distinguished from the 82599 VF device. The X540 VF
device will have additional capability over the 82599 VF device so it
is necessary to be able to discern the difference.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbevf/defines.h | 1 +
drivers/net/ixgbevf/ixgbevf.h | 4 +++-
drivers/net/ixgbevf/ixgbevf_main.c | 7 +++++--
drivers/net/ixgbevf/vf.c | 6 +++++-
drivers/net/ixgbevf/vf.h | 1 +
5 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbevf/defines.h b/drivers/net/ixgbevf/defines.h
index f8a807d..de643eb 100644
--- a/drivers/net/ixgbevf/defines.h
+++ b/drivers/net/ixgbevf/defines.h
@@ -30,6 +30,7 @@
/* Device IDs */
#define IXGBE_DEV_ID_82599_VF 0x10ED
+#define IXGBE_DEV_ID_X540_VF 0x1515
#define IXGBE_VF_IRQ_CLEAR_MASK 7
#define IXGBE_VF_MAX_TX_QUEUES 1
diff --git a/drivers/net/ixgbevf/ixgbevf.h b/drivers/net/ixgbevf/ixgbevf.h
index 0cd6abc..a63efcb 100644
--- a/drivers/net/ixgbevf/ixgbevf.h
+++ b/drivers/net/ixgbevf/ixgbevf.h
@@ -275,9 +275,11 @@ enum ixbgevf_state_t {
enum ixgbevf_boards {
board_82599_vf,
+ board_X540_vf,
};
-extern struct ixgbevf_info ixgbevf_vf_info;
+extern struct ixgbevf_info ixgbevf_82599_vf_info;
+extern struct ixgbevf_info ixgbevf_X540_vf_info;
extern struct ixgbe_mac_operations ixgbevf_mbx_ops;
/* needed by ethtool.c */
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 809e38c..464e6c9 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -51,13 +51,14 @@ char ixgbevf_driver_name[] = "ixgbevf";
static const char ixgbevf_driver_string[] =
"Intel(R) 82599 Virtual Function";
-#define DRV_VERSION "1.0.12-k0"
+#define DRV_VERSION "1.0.19-k0"
const char ixgbevf_driver_version[] = DRV_VERSION;
static char ixgbevf_copyright[] =
"Copyright (c) 2009 - 2010 Intel Corporation.";
static const struct ixgbevf_info *ixgbevf_info_tbl[] = {
- [board_82599_vf] = &ixgbevf_vf_info,
+ [board_82599_vf] = &ixgbevf_82599_vf_info,
+ [board_X540_vf] = &ixgbevf_X540_vf_info,
};
/* ixgbevf_pci_tbl - PCI Device ID Table
@@ -71,6 +72,8 @@ static const struct ixgbevf_info *ixgbevf_info_tbl[] = {
static struct pci_device_id ixgbevf_pci_tbl[] = {
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_VF),
board_82599_vf},
+ {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540_VF),
+ board_X540_vf},
/* required last entry */
{0, }
diff --git a/drivers/net/ixgbevf/vf.c b/drivers/net/ixgbevf/vf.c
index 971019d..eecd3bf 100644
--- a/drivers/net/ixgbevf/vf.c
+++ b/drivers/net/ixgbevf/vf.c
@@ -381,8 +381,12 @@ static struct ixgbe_mac_operations ixgbevf_mac_ops = {
.set_vfta = ixgbevf_set_vfta_vf,
};
-struct ixgbevf_info ixgbevf_vf_info = {
+struct ixgbevf_info ixgbevf_82599_vf_info = {
.mac = ixgbe_mac_82599_vf,
.mac_ops = &ixgbevf_mac_ops,
};
+struct ixgbevf_info ixgbevf_X540_vf_info = {
+ .mac = ixgbe_mac_X540_vf,
+ .mac_ops = &ixgbevf_mac_ops,
+};
diff --git a/drivers/net/ixgbevf/vf.h b/drivers/net/ixgbevf/vf.h
index 144c99d..23eb114 100644
--- a/drivers/net/ixgbevf/vf.h
+++ b/drivers/net/ixgbevf/vf.h
@@ -73,6 +73,7 @@ struct ixgbe_mac_operations {
enum ixgbe_mac_type {
ixgbe_mac_unknown = 0,
ixgbe_mac_82599_vf,
+ ixgbe_mac_X540_vf,
ixgbe_num_macs
};
--
1.7.3.4
^ permalink raw reply related
* [net-next-2.6 14/15] ixgbe: Add anti-spoofing feature support
From: jeffrey.t.kirsher @ 2010-12-25 6:06 UTC (permalink / raw)
To: davem, davem; +Cc: Greg Rose, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1293257174-15498-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Greg Rose <gregory.v.rose@intel.com>
Add support for the anti-spoofing feature in the HW. Packets from
VF devices with spoofed MAC addresses or VLAN tags will be blocked
and a counter incremented. During the watchdog timer the spoofed
packet dropped counter is read and if it is non-zero then a warning
message is displayed on the host VMM's console.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_82599.c | 2 +
drivers/net/ixgbe/ixgbe_common.c | 64 ++++++++++++++++++++++++++++++++++++++
drivers/net/ixgbe/ixgbe_common.h | 2 +
drivers/net/ixgbe/ixgbe_main.c | 24 ++++++++++++++
drivers/net/ixgbe/ixgbe_sriov.c | 12 ++++++-
drivers/net/ixgbe/ixgbe_type.h | 13 +++++++-
6 files changed, 114 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 6827ddd..bfd3c22 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -2165,6 +2165,8 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
.fc_enable = &ixgbe_fc_enable_generic,
.init_uta_tables = &ixgbe_init_uta_tables_generic,
.setup_sfp = &ixgbe_setup_sfp_modules_82599,
+ .set_mac_anti_spoofing = &ixgbe_set_mac_anti_spoofing,
+ .set_vlan_anti_spoofing = &ixgbe_set_vlan_anti_spoofing,
};
static struct ixgbe_eeprom_operations eeprom_ops_82599 = {
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index cc11e42..d5ede2d 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -2809,3 +2809,67 @@ s32 ixgbe_get_wwn_prefix_generic(struct ixgbe_hw *hw, u16 *wwnn_prefix,
wwn_prefix_out:
return 0;
}
+
+/**
+ * ixgbe_set_mac_anti_spoofing - Enable/Disable MAC anti-spoofing
+ * @hw: pointer to hardware structure
+ * @enable: enable or disable switch for anti-spoofing
+ * @pf: Physical Function pool - do not enable anti-spoofing for the PF
+ *
+ **/
+void ixgbe_set_mac_anti_spoofing(struct ixgbe_hw *hw, bool enable, int pf)
+{
+ int j;
+ int pf_target_reg = pf >> 3;
+ int pf_target_shift = pf % 8;
+ u32 pfvfspoof = 0;
+
+ if (hw->mac.type == ixgbe_mac_82598EB)
+ return;
+
+ if (enable)
+ pfvfspoof = IXGBE_SPOOF_MACAS_MASK;
+
+ /*
+ * PFVFSPOOF register array is size 8 with 8 bits assigned to
+ * MAC anti-spoof enables in each register array element.
+ */
+ for (j = 0; j < IXGBE_PFVFSPOOF_REG_COUNT; j++)
+ IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(j), pfvfspoof);
+
+ /* If not enabling anti-spoofing then done */
+ if (!enable)
+ return;
+
+ /*
+ * The PF should be allowed to spoof so that it can support
+ * emulation mode NICs. Reset the bit assigned to the PF
+ */
+ pfvfspoof = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(pf_target_reg));
+ pfvfspoof ^= (1 << pf_target_shift);
+ IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(pf_target_reg), pfvfspoof);
+}
+
+/**
+ * ixgbe_set_vlan_anti_spoofing - Enable/Disable VLAN anti-spoofing
+ * @hw: pointer to hardware structure
+ * @enable: enable or disable switch for VLAN anti-spoofing
+ * @pf: Virtual Function pool - VF Pool to set for VLAN anti-spoofing
+ *
+ **/
+void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf)
+{
+ int vf_target_reg = vf >> 3;
+ int vf_target_shift = vf % 8 + IXGBE_SPOOF_VLANAS_SHIFT;
+ u32 pfvfspoof;
+
+ if (hw->mac.type == ixgbe_mac_82598EB)
+ return;
+
+ pfvfspoof = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg));
+ if (enable)
+ pfvfspoof |= (1 << vf_target_shift);
+ else
+ pfvfspoof &= ~(1 << vf_target_shift);
+ IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg), pfvfspoof);
+}
diff --git a/drivers/net/ixgbe/ixgbe_common.h b/drivers/net/ixgbe/ixgbe_common.h
index e1f980a..66ed045 100644
--- a/drivers/net/ixgbe/ixgbe_common.h
+++ b/drivers/net/ixgbe/ixgbe_common.h
@@ -88,6 +88,8 @@ s32 ixgbe_get_wwn_prefix_generic(struct ixgbe_hw *hw, u16 *wwnn_prefix,
u16 *wwpn_prefix);
s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index);
s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index);
+void ixgbe_set_mac_anti_spoofing(struct ixgbe_hw *hw, bool enable, int pf);
+void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf);
#define IXGBE_WRITE_REG(a, reg, value) writel((value), ((a)->hw_addr + (reg)))
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index c905625..38ab4f3 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3132,6 +3132,9 @@ static void ixgbe_configure_virtualization(struct ixgbe_adapter *adapter)
/* enable Tx loopback for VF/PF communication */
IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, IXGBE_PFDTXGSWC_VT_LBEN);
+ /* Enable MAC Anti-Spoofing */
+ hw->mac.ops.set_mac_anti_spoofing(hw, (adapter->num_vfs != 0),
+ adapter->num_vfs);
}
static void ixgbe_set_rx_buffer_len(struct ixgbe_adapter *adapter)
@@ -5960,6 +5963,26 @@ static void ixgbe_fdir_reinit_task(struct work_struct *work)
netif_tx_start_all_queues(adapter->netdev);
}
+static void ixgbe_spoof_check(struct ixgbe_adapter *adapter)
+{
+ u32 ssvpc;
+
+ /* Do not perform spoof check for 82598 */
+ if (adapter->hw.mac.type == ixgbe_mac_82598EB)
+ return;
+
+ ssvpc = IXGBE_READ_REG(&adapter->hw, IXGBE_SSVPC);
+
+ /*
+ * ssvpc register is cleared on read, if zero then no
+ * spoofed packets in the last interval.
+ */
+ if (!ssvpc)
+ return;
+
+ e_warn(drv, "%d Spoofed packets detected\n", ssvpc);
+}
+
static DEFINE_MUTEX(ixgbe_watchdog_lock);
/**
@@ -6080,6 +6103,7 @@ static void ixgbe_watchdog_task(struct work_struct *work)
}
}
+ ixgbe_spoof_check(adapter);
ixgbe_update_stats(adapter);
mutex_unlock(&ixgbe_watchdog_lock);
}
diff --git a/drivers/net/ixgbe/ixgbe_sriov.c b/drivers/net/ixgbe/ixgbe_sriov.c
index e01d0db..47b1573 100644
--- a/drivers/net/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ixgbe/ixgbe_sriov.c
@@ -215,6 +215,11 @@ static inline void ixgbe_vf_reset_msg(struct ixgbe_adapter *adapter, u32 vf)
reg |= (reg | (1 << vf_shift));
IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), reg);
+ /* Enable counting of spoofed packets in the SSVPC register */
+ reg = IXGBE_READ_REG(hw, IXGBE_VMECM(reg_offset));
+ reg |= (1 << vf_shift);
+ IXGBE_WRITE_REG(hw, IXGBE_VMECM(reg_offset), reg);
+
ixgbe_vf_reset_event(adapter, vf);
}
@@ -412,6 +417,7 @@ int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos)
{
int err = 0;
struct ixgbe_adapter *adapter = netdev_priv(netdev);
+ struct ixgbe_hw *hw = &adapter->hw;
if ((vf >= adapter->num_vfs) || (vlan > 4095) || (qos > 7))
return -EINVAL;
@@ -420,7 +426,8 @@ int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos)
if (err)
goto out;
ixgbe_set_vmvir(adapter, vlan | (qos << VLAN_PRIO_SHIFT), vf);
- ixgbe_set_vmolr(&adapter->hw, vf, false);
+ ixgbe_set_vmolr(hw, vf, false);
+ hw->mac.ops.set_vlan_anti_spoofing(hw, true, vf);
adapter->vfinfo[vf].pf_vlan = vlan;
adapter->vfinfo[vf].pf_qos = qos;
dev_info(&adapter->pdev->dev,
@@ -437,7 +444,8 @@ int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos)
err = ixgbe_set_vf_vlan(adapter, false,
adapter->vfinfo[vf].pf_vlan, vf);
ixgbe_set_vmvir(adapter, vlan, vf);
- ixgbe_set_vmolr(&adapter->hw, vf, true);
+ ixgbe_set_vmolr(hw, vf, true);
+ hw->mac.ops.set_vlan_anti_spoofing(hw, false, vf);
adapter->vfinfo[vf].pf_vlan = 0;
adapter->vfinfo[vf].pf_qos = 0;
}
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index 59f6d0a..446f3467 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -230,6 +230,7 @@
#define IXGBE_VT_CTL 0x051B0
#define IXGBE_VFRE(_i) (0x051E0 + ((_i) * 4))
#define IXGBE_VFTE(_i) (0x08110 + ((_i) * 4))
+#define IXGBE_VMECM(_i) (0x08790 + ((_i) * 4))
#define IXGBE_QDE 0x2F04
#define IXGBE_VMOLR(_i) (0x0F000 + ((_i) * 4)) /* 64 total */
#define IXGBE_UTA(_i) (0x0F400 + ((_i) * 4))
@@ -284,7 +285,8 @@
#define IXGBE_TDWBAH(_i) (0x0603C + ((_i) * 0x40))
#define IXGBE_DTXCTL 0x07E00
-#define IXGBE_DMATXCTL 0x04A80
+#define IXGBE_DMATXCTL 0x04A80
+#define IXGBE_PFVFSPOOF(_i) (0x08200 + ((_i) * 4)) /* 8 of these 0 - 7 */
#define IXGBE_PFDTXGSWC 0x08220
#define IXGBE_DTXMXSZRQ 0x08100
#define IXGBE_DTXTCPFLGL 0x04A88
@@ -298,6 +300,13 @@
#define IXGBE_DMATXCTL_VT_SHIFT 16 /* VLAN EtherType */
#define IXGBE_PFDTXGSWC_VT_LBEN 0x1 /* Local L2 VT switch enable */
+
+/* Anti-spoofing defines */
+#define IXGBE_SPOOF_MACAS_MASK 0xFF
+#define IXGBE_SPOOF_VLANAS_MASK 0xFF00
+#define IXGBE_SPOOF_VLANAS_SHIFT 8
+#define IXGBE_PFVFSPOOF_REG_COUNT 8
+
#define IXGBE_DCA_TXCTRL(_i) (0x07200 + ((_i) * 4)) /* 16 of these (0-15) */
/* Tx DCA Control register : 128 of these (0-127) */
#define IXGBE_DCA_TXCTRL_82599(_i) (0x0600C + ((_i) * 0x40))
@@ -2482,6 +2491,8 @@ struct ixgbe_mac_operations {
s32 (*clear_vfta)(struct ixgbe_hw *);
s32 (*set_vfta)(struct ixgbe_hw *, u32, u32, bool);
s32 (*init_uta_tables)(struct ixgbe_hw *);
+ void (*set_mac_anti_spoofing)(struct ixgbe_hw *, bool, int);
+ void (*set_vlan_anti_spoofing)(struct ixgbe_hw *, bool, int);
/* Flow Control */
s32 (*fc_enable)(struct ixgbe_hw *, s32);
--
1.7.3.4
^ permalink raw reply related
* [net-next-2.6 13/15] ixgbe: Add SR-IOV feature support to X540
From: jeffrey.t.kirsher @ 2010-12-25 6:06 UTC (permalink / raw)
To: davem, davem; +Cc: Greg Rose, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1293257174-15498-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Greg Rose <gregory.v.rose@intel.com>
Add X540 specific feature support to X540
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_main.c | 2 +-
drivers/net/ixgbe/ixgbe_mbx.c | 4 +++-
drivers/net/ixgbe/ixgbe_x540.c | 2 ++
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index ca9036d..c905625 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -6889,7 +6889,7 @@ static void __devinit ixgbe_probe_vf(struct ixgbe_adapter *adapter,
struct ixgbe_hw *hw = &adapter->hw;
int err;
- if (hw->mac.type != ixgbe_mac_82599EB || !max_vfs)
+ if (hw->mac.type == ixgbe_mac_82598EB || !max_vfs)
return;
/* The 82599 supports up to 64 VFs per physical function
diff --git a/drivers/net/ixgbe/ixgbe_mbx.c b/drivers/net/ixgbe/ixgbe_mbx.c
index 027c628..ea82c5a 100644
--- a/drivers/net/ixgbe/ixgbe_mbx.c
+++ b/drivers/net/ixgbe/ixgbe_mbx.c
@@ -321,9 +321,11 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number)
switch (hw->mac.type) {
case ixgbe_mac_82599EB:
- case ixgbe_mac_X540:
vflre = IXGBE_READ_REG(hw, IXGBE_VFLRE(reg_offset));
break;
+ case ixgbe_mac_X540:
+ vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset));
+ break;
default:
break;
}
diff --git a/drivers/net/ixgbe/ixgbe_x540.c b/drivers/net/ixgbe/ixgbe_x540.c
index cf88515..3a89239 100644
--- a/drivers/net/ixgbe/ixgbe_x540.c
+++ b/drivers/net/ixgbe/ixgbe_x540.c
@@ -685,6 +685,8 @@ static struct ixgbe_mac_operations mac_ops_X540 = {
.fc_enable = &ixgbe_fc_enable_generic,
.init_uta_tables = &ixgbe_init_uta_tables_generic,
.setup_sfp = NULL,
+ .set_mac_anti_spoofing = &ixgbe_set_mac_anti_spoofing,
+ .set_vlan_anti_spoofing = &ixgbe_set_vlan_anti_spoofing,
};
static struct ixgbe_eeprom_operations eeprom_ops_X540 = {
--
1.7.3.4
^ permalink raw reply related
* [net-next-2.6 12/15] ixgbe: Warn on VF attempt to override Administratively set MAC/VLAN
From: jeffrey.t.kirsher @ 2010-12-25 6:06 UTC (permalink / raw)
To: davem, davem; +Cc: Greg Rose, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1293257174-15498-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Greg Rose <gregory.v.rose@intel.com>
Print warnings to the system log when the VF attempts to override
MAC/VLAN settings that were configured by the VMM Host administrator
using the ip link set commands.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_sriov.c | 40 ++++++++++++++++++++++++++++----------
1 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_sriov.c b/drivers/net/ixgbe/ixgbe_sriov.c
index 6e3e94b..e01d0db 100644
--- a/drivers/net/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ixgbe/ixgbe_sriov.c
@@ -227,6 +227,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
int entries;
u16 *hash_list;
int add, vid;
+ u8 *new_mac;
retval = ixgbe_read_mbx(hw, msgbuf, mbx_size, vf);
@@ -244,15 +245,22 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
if (msgbuf[0] == IXGBE_VF_RESET) {
unsigned char *vf_mac = adapter->vfinfo[vf].vf_mac_addresses;
- u8 *addr = (u8 *)(&msgbuf[1]);
+ new_mac = (u8 *)(&msgbuf[1]);
e_info(probe, "VF Reset msg received from vf %d\n", vf);
adapter->vfinfo[vf].clear_to_send = false;
ixgbe_vf_reset_msg(adapter, vf);
adapter->vfinfo[vf].clear_to_send = true;
+ if (is_valid_ether_addr(new_mac) &&
+ !adapter->vfinfo[vf].pf_set_mac)
+ ixgbe_set_vf_mac(adapter, vf, vf_mac);
+ else
+ ixgbe_set_vf_mac(adapter,
+ vf, adapter->vfinfo[vf].vf_mac_addresses);
+
/* reply to reset with ack and vf mac address */
msgbuf[0] = IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK;
- memcpy(addr, vf_mac, IXGBE_ETH_LENGTH_OF_ADDRESS);
+ memcpy(new_mac, vf_mac, IXGBE_ETH_LENGTH_OF_ADDRESS);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -271,14 +279,16 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
switch ((msgbuf[0] & 0xFFFF)) {
case IXGBE_VF_SET_MAC_ADDR:
- {
- u8 *new_mac = ((u8 *)(&msgbuf[1]));
- if (is_valid_ether_addr(new_mac) &&
- !adapter->vfinfo[vf].pf_set_mac)
- ixgbe_set_vf_mac(adapter, vf, new_mac);
- else
- ixgbe_set_vf_mac(adapter,
- vf, adapter->vfinfo[vf].vf_mac_addresses);
+ new_mac = ((u8 *)(&msgbuf[1]));
+ if (is_valid_ether_addr(new_mac) &&
+ !adapter->vfinfo[vf].pf_set_mac) {
+ ixgbe_set_vf_mac(adapter, vf, new_mac);
+ } else if (memcmp(adapter->vfinfo[vf].vf_mac_addresses,
+ new_mac, ETH_ALEN)) {
+ e_warn(drv, "VF %d attempted to override "
+ "administratively set MAC address\nReload "
+ "the VF driver to resume operations\n", vf);
+ retval = -1;
}
break;
case IXGBE_VF_SET_MULTICAST:
@@ -295,7 +305,15 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
add = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK)
>> IXGBE_VT_MSGINFO_SHIFT;
vid = (msgbuf[1] & IXGBE_VLVF_VLANID_MASK);
- retval = ixgbe_set_vf_vlan(adapter, add, vid, vf);
+ if (adapter->vfinfo[vf].pf_vlan) {
+ e_warn(drv, "VF %d attempted to override "
+ "administratively set VLAN configuration\n"
+ "Reload the VF driver to resume operations\n",
+ vf);
+ retval = -1;
+ } else {
+ retval = ixgbe_set_vf_vlan(adapter, add, vid, vf);
+ }
break;
default:
e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]);
--
1.7.3.4
^ permalink raw reply related
* [net-next-2.6 11/15] igbvf: add support for i350 VF device
From: jeffrey.t.kirsher @ 2010-12-25 6:06 UTC (permalink / raw)
To: davem, davem; +Cc: Williams, Mitch A, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1293257174-15498-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Williams, Mitch A <mitch.a.williams@intel.com>
Add support to igbvf for the new i350 virtual function device.
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igbvf/igbvf.h | 1 +
drivers/net/igbvf/netdev.c | 9 +++++++++
drivers/net/igbvf/vf.h | 2 ++
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h
index 9d4d63e..990c329 100644
--- a/drivers/net/igbvf/igbvf.h
+++ b/drivers/net/igbvf/igbvf.h
@@ -97,6 +97,7 @@ struct igbvf_adapter;
enum igbvf_boards {
board_vf,
+ board_i350_vf,
};
struct igbvf_queue_stats {
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 4fb023b..6352c81 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -64,8 +64,16 @@ static struct igbvf_info igbvf_vf_info = {
.init_ops = e1000_init_function_pointers_vf,
};
+static struct igbvf_info igbvf_i350_vf_info = {
+ .mac = e1000_vfadapt_i350,
+ .flags = 0,
+ .pba = 10,
+ .init_ops = e1000_init_function_pointers_vf,
+};
+
static const struct igbvf_info *igbvf_info_tbl[] = {
[board_vf] = &igbvf_vf_info,
+ [board_i350_vf] = &igbvf_i350_vf_info,
};
/**
@@ -2865,6 +2873,7 @@ static struct pci_error_handlers igbvf_err_handler = {
static DEFINE_PCI_DEVICE_TABLE(igbvf_pci_tbl) = {
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_VF), board_vf },
+ { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_VF), board_i350_vf },
{ } /* terminate list */
};
MODULE_DEVICE_TABLE(pci, igbvf_pci_tbl);
diff --git a/drivers/net/igbvf/vf.h b/drivers/net/igbvf/vf.h
index c36ea21..d7ed58f 100644
--- a/drivers/net/igbvf/vf.h
+++ b/drivers/net/igbvf/vf.h
@@ -39,6 +39,7 @@
struct e1000_hw;
#define E1000_DEV_ID_82576_VF 0x10CA
+#define E1000_DEV_ID_I350_VF 0x1520
#define E1000_REVISION_0 0
#define E1000_REVISION_1 1
#define E1000_REVISION_2 2
@@ -133,6 +134,7 @@ struct e1000_adv_tx_context_desc {
enum e1000_mac_type {
e1000_undefined = 0,
e1000_vfadapt,
+ e1000_vfadapt_i350,
e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
};
--
1.7.3.4
^ permalink raw reply related
* [net-next-2.6 10/15] igbvf: force link checking when mailbox timeout has occurred
From: jeffrey.t.kirsher @ 2010-12-25 6:06 UTC (permalink / raw)
To: davem, davem; +Cc: Alexander Duyck, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1293257174-15498-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change forces the link down when a mailbox timeout has occurred.
Previously it was possible for a mailbox timeout to occur but for the
interface to stay up. The problem with this was that it became possible
for an interface to stay up and miss multiple requests resulting in a
possible issue since the interface will be running in an unknown state.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igbvf/vf.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/igbvf/vf.c b/drivers/net/igbvf/vf.c
index 0cc13c6..74486a8 100644
--- a/drivers/net/igbvf/vf.c
+++ b/drivers/net/igbvf/vf.c
@@ -362,8 +362,8 @@ static s32 e1000_check_for_link_vf(struct e1000_hw *hw)
* or a virtual function reset
*/
- /* If we were hit with a reset drop the link */
- if (!mbx->ops.check_for_rst(hw))
+ /* If we were hit with a reset or timeout drop the link */
+ if (!mbx->ops.check_for_rst(hw) || !mbx->timeout)
mac->get_link_status = true;
if (!mac->get_link_status)
--
1.7.3.4
^ 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