* Re: [net-next PATCH 2/3] dcb: add DCBX mode to event notifier attributes
From: David Miller @ 2011-10-06 19:50 UTC (permalink / raw)
To: john.r.fastabend; +Cc: netdev, gospo
In-Reply-To: <20111006185238.2781.36917.stgit@jf-dev1-dcblab>
From: John Fastabend <john.r.fastabend@intel.com>
Date: Thu, 06 Oct 2011 11:52:38 -0700
> Add DCBX mode to event notifiers so listeners can learn
> currently enabled mode.
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next PATCH 1/3] dcb: Use ifindex instead of ifname
From: David Miller @ 2011-10-06 19:50 UTC (permalink / raw)
To: john.r.fastabend; +Cc: netdev, gospo
In-Reply-To: <20111006185233.2781.80310.stgit@jf-dev1-dcblab>
From: John Fastabend <john.r.fastabend@intel.com>
Date: Thu, 06 Oct 2011 11:52:33 -0700
> From: Mark Rustad <mark.d.rustad@intel.com>
>
> Use ifindex instead of ifname in the DCB app ring. This makes for a smaller
> data structure and faster comparisons. It also avoids possible issues when
> a net device is renamed.
>
> Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH v2 2/2] virtio-net: Prevent NULL dereference
From: David Miller @ 2011-10-06 19:41 UTC (permalink / raw)
To: levinsasha928; +Cc: linux-kernel, rusty, mst, virtualization, netdev, kvm
In-Reply-To: <1317220855-9352-2-git-send-email-levinsasha928@gmail.com>
From: Sasha Levin <levinsasha928@gmail.com>
Date: Wed, 28 Sep 2011 17:40:55 +0300
> This patch prevents a NULL dereference when the user has passed a length
> longer than an actual buffer to virtio-net.
>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: virtualization@lists.linux-foundation.org
> Cc: netdev@vger.kernel.org
> Cc: kvm@vger.kernel.org
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Waiting for a respin of this patch with clarified comments.
^ permalink raw reply
* Re: [PATCH v2 1/2] virtio-net: Verify page list size before fitting into skb
From: David Miller @ 2011-10-06 19:41 UTC (permalink / raw)
To: levinsasha928; +Cc: linux-kernel, rusty, mst, virtualization, netdev, kvm
In-Reply-To: <1317220855-9352-1-git-send-email-levinsasha928@gmail.com>
From: Sasha Levin <levinsasha928@gmail.com>
Date: Wed, 28 Sep 2011 17:40:54 +0300
> This patch verifies that the length of a buffer stored in a linked list
> of pages is small enough to fit into a skb.
>
> If the size is larger than a max size of a skb, it means that we shouldn't
> go ahead building skbs anyway since we won't be able to send the buffer as
> the user requested.
>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: virtualization@lists.linux-foundation.org
> Cc: netdev@vger.kernel.org
> Cc: kvm@vger.kernel.org
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Applied to net-next
^ permalink raw reply
* Re: [PATCH] Break up the single NBD lock into one per NBD device
From: David Miller @ 2011-10-06 19:37 UTC (permalink / raw)
To: hkchu; +Cc: netdev
In-Reply-To: <1317080052-6052-1-git-send-email-hkchu@google.com>
From: "H.K. Jerry Chu" <hkchu@google.com>
Date: Mon, 26 Sep 2011 16:34:12 -0700
> From: Jerry Chu <hkchu@google.com>
>
> This patch breaks up the single NBD lock into one per
> disk. The single NBD lock has become a serious performance
> bottleneck when multiple NBD disks are being used.
>
> The original comment on why a single lock may be ok no
> longer holds for today's much faster NICs.
>
> Signed-off-by: H.K. Jerry Chu <hkchu@google.com>
Acked-by: David S. Miller <davem@davemloft.net>
Even though this is a "networking" block device, I think this change
should go through the Jens Axboe's block layer tree.
Thanks.
^ permalink raw reply
* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
From: David Miller @ 2011-10-06 19:28 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20111004041509.292932641@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 03 Oct 2011 21:14:46 -0700
> This is based on an earlier patch by Nick Carter with comments
> by David Lamparter but with some refinements. Thanks for their patience
> this is a confusing area with overlap of standards, user requirements,
> and compatibility with earlier releases.
>
> It adds a new sysfs attribute
> /sys/class/net/brX/bridge/group_fwd_mask
> that controls forwarding of frames with address of: 01-80-C2-00-00-0X
> The default setting has no forwarding to retain compatibility.
>
> One change from earlier releases is that forwarding of group
> addresses is not dependent on STP being enabled or disabled. This
> choice was made based on interpretation of tie 802.1 standards.
> I expect complaints will arise because of this, but better to follow
> the standard than continue acting incorrectly by default.
>
> The filtering mask is writeable, but only values that don't forward
> known control frames are allowed. It intentionally blocks attempts
> to filter control protocols. For example: writing a 8 allows
> forwarding 802.1X PAE addresses which is the most common request.
>
> Reported-by: David Lamparter <equinox@diac24.net>
> Original-patch-by: Nick Carter <ncarter100@gmail.com>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied to net-next.
^ permalink raw reply
* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
From: David Miller @ 2011-10-06 19:28 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20111004041509.191082289@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 03 Oct 2011 21:14:45 -0700
> This resolves a regression seen by some users of bridging.
> Some users use the bridge like a dummy device.
> They expect to be able to put an IPv6 address on the device
> with no ports attached. Although there are better ways of doing
> this, there is no reason to not allow it.
>
> Note: the bridge still will reflect the state of ports in the
> bridge if there are any added.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied to 'net' and queued up for -stable.
^ permalink raw reply
* Re: [PATCH] IPv6: DAD from bonding iface is treated as dup address from others
From: Jay Vosburgh @ 2011-10-06 19:05 UTC (permalink / raw)
To: Neil Horman
Cc: Yinglin Sun, David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
In-Reply-To: <20111006110047.GA22462@hmsreliant.think-freely.org>
Neil Horman <nhorman@tuxdriver.com> wrote:
>On Wed, Oct 05, 2011 at 08:59:10PM -0700, Yinglin Sun wrote:
>> Steps to reproduce this issue:
>> 1. create bond0 over eth0 and eth1, set the mode to balance-xor
>> 2. add an IPv6 address to bond0
>> 3. DAD packet is sent out from one slave and then is looped back from
>> the other slave. Therefore, it is treated as a duplicate address and
>> stays tentative afterwards:
>> kern.info:
>> Oct 5 11:50:18 testvm1 kernel: [ 129.224353] bond0: IPv6 duplicate address 1234::1 detected!
>>
>> Signed-off-by: Yinglin Sun <Yinglin.Sun@emc.com>
>> ---
>> net/ipv6/ndisc.c | 15 +++++++++++++--
>> 1 files changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
>> index 9da6e02..c82f4c7 100644
>> --- a/net/ipv6/ndisc.c
>> +++ b/net/ipv6/ndisc.c
>> @@ -809,9 +809,10 @@ static void ndisc_recv_ns(struct sk_buff *skb)
>>
>> if (ifp->flags & (IFA_F_TENTATIVE|IFA_F_OPTIMISTIC)) {
>> if (dad) {
>> + const unsigned char *sadr;
>> + sadr = skb_mac_header(skb);
>> +
>> if (dev->type == ARPHRD_IEEE802_TR) {
>> - const unsigned char *sadr;
>> - sadr = skb_mac_header(skb);
>> if (((sadr[8] ^ dev->dev_addr[0]) & 0x7f) == 0 &&
>> sadr[9] == dev->dev_addr[1] &&
>> sadr[10] == dev->dev_addr[2] &&
>> @@ -821,6 +822,16 @@ static void ndisc_recv_ns(struct sk_buff *skb)
>> /* looped-back to us */
>> goto out;
>> }
>> + } else if (dev->type == ARPHRD_ETHER) {
>> + if (sadr[6] == dev->dev_addr[0] &&
>> + sadr[7] == dev->dev_addr[1] &&
>> + sadr[8] == dev->dev_addr[2] &&
>> + sadr[9] == dev->dev_addr[3] &&
>> + sadr[10] == dev->dev_addr[4] &&
>> + sadr[11] == dev->dev_addr[5]) {
>> + /* looped-back to us */
>> + goto out;
>> + }
>> }
>>
>> /*
>> --
>> 1.7.4.1
>>
>Nack, This seems like it will just completely break DAD. What if theres another
>system out there with the same mac address. A response from that system would
>get dropped by this filter, instead of causing The local system to stop using
>the address. What you really want to do is modify
>bond_should_deliver_exact_match to detect this frame on the inactive slave or
>some such, and drop the frame there.
Also NACK; and adding a bit of information. The balance-xor
mode is nominally expecting to interact with a switch whose ports are
set for etherchannel ("static link aggregation"), in which case the
switch will not loop the packet back around.
If your switch can do etherchannel, then enable it and the
problem should go away. If your switch cannot do this, then you may
have other issues, because all of the multicast or broadcast packets
going out any bonding slave will loop around to another slave. You
could also use 802.3ad / LACP if you switch supports that.
For balance-xor (or balance-rr, for that matter) mode to a
non-etherchannel switch, it's going to be difficult, if not impossible,
to modify bond_should_deliver_exact_match, because there are no inactive
slaves. In this mode, bonding is expecting the switch to balance
incoming traffic across the ports, and not deliver looped back packets
or duplicates. There are no restrictions on what type of traffic
(mcast, bcast, ucast) may arrive on any given port.
I can't think of a way to make the non-etherchannel case work
for balance-xor (or balance-rr) without breaking the DAD functionality
in the case of an actual duplicate. I'm not aware of a way to
distinguish a looped back DAD probe from an actual duplicate address
probe elsewhere on the network.
-J
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
^ permalink raw reply
* [PATCH] fcoe: add DCB notifiers to set skb priority
From: John Fastabend @ 2011-10-06 18:56 UTC (permalink / raw)
To: devel; +Cc: john.r.fastabend, netdev, gospo, davem
Use DCB notifiers to set the skb priority to allow packets
to be steered and tagged correctly over DCB enabled drivers
that setup traffic classes.
This allows queue_mapping() routines to be removed in these
drivers that were previously inspecting the ethertype of
every skb to mark FCoE/FIP frames.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
drivers/scsi/fcoe/fcoe.c | 115 +++++++++++++++++++++++++++++++++++++++++
drivers/scsi/fcoe/fcoe_ctlr.c | 4 +
include/scsi/libfcoe.h | 3 +
3 files changed, 122 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 430b2cd..73d3459 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -32,6 +32,8 @@
#include <linux/sysfs.h>
#include <linux/ctype.h>
#include <linux/workqueue.h>
+#include <net/dcbnl.h>
+#include <net/dcbevent.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsicam.h>
#include <scsi/scsi_transport.h>
@@ -102,6 +104,8 @@ static int fcoe_ddp_done(struct fc_lport *, u16);
static int fcoe_ddp_target(struct fc_lport *, u16, struct scatterlist *,
unsigned int);
static int fcoe_cpu_callback(struct notifier_block *, unsigned long, void *);
+static int fcoe_dcb_app_notification(struct notifier_block *notifier,
+ ulong event, void *ptr);
static bool fcoe_match(struct net_device *netdev);
static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode);
@@ -130,6 +134,11 @@ static struct notifier_block fcoe_cpu_notifier = {
.notifier_call = fcoe_cpu_callback,
};
+/* notification function for DCB events */
+static struct notifier_block dcb_notifier = {
+ .notifier_call = fcoe_dcb_app_notification,
+};
+
static struct scsi_transport_template *fcoe_nport_scsi_transport;
static struct scsi_transport_template *fcoe_vport_scsi_transport;
@@ -1541,6 +1550,8 @@ int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)
skb_reset_network_header(skb);
skb->mac_len = elen;
skb->protocol = htons(ETH_P_FCOE);
+ skb->priority = port->priority;
+
if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN &&
fcoe->realdev->features & NETIF_F_HW_VLAN_TX) {
skb->vlan_tci = VLAN_TAG_PRESENT |
@@ -1765,6 +1776,7 @@ int fcoe_percpu_receive_thread(void *arg)
*/
static void fcoe_dev_setup(void)
{
+ register_dcbevent_notifier(&dcb_notifier);
register_netdevice_notifier(&fcoe_notifier);
}
@@ -1773,9 +1785,69 @@ static void fcoe_dev_setup(void)
*/
static void fcoe_dev_cleanup(void)
{
+ unregister_dcbevent_notifier(&dcb_notifier);
unregister_netdevice_notifier(&fcoe_notifier);
}
+static struct fcoe_interface *
+fcoe_hostlist_lookup_realdev_port(struct net_device *netdev)
+{
+ struct fcoe_interface *fcoe;
+ struct net_device *real_dev;
+
+ list_for_each_entry(fcoe, &fcoe_hostlist, list) {
+ if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN)
+ real_dev = vlan_dev_real_dev(fcoe->netdev);
+ else
+ real_dev = fcoe->netdev;
+
+ if (netdev == real_dev)
+ return fcoe;
+ }
+ return NULL;
+}
+
+static int fcoe_dcb_app_notification(struct notifier_block *notifier,
+ ulong event, void *ptr)
+{
+ struct dcb_app_type *entry = ptr;
+ struct fcoe_interface *fcoe;
+ struct net_device *netdev;
+ struct fcoe_port *port;
+ int prio;
+
+ if (entry->app.selector != DCB_APP_IDTYPE_ETHTYPE)
+ return NOTIFY_OK;
+
+ netdev = dev_get_by_index(&init_net, entry->ifindex);
+ if (!netdev)
+ return NOTIFY_OK;
+
+ fcoe = fcoe_hostlist_lookup_realdev_port(netdev);
+ dev_put(netdev);
+ if (!fcoe)
+ return NOTIFY_OK;
+
+ if (entry->dcbx & DCB_CAP_DCBX_VER_CEE)
+ prio = ffs(entry->app.priority) - 1;
+ else
+ prio = entry->app.priority;
+
+ if (prio < 0)
+ return NOTIFY_OK;
+
+ if (entry->app.protocol == ETH_P_FIP ||
+ entry->app.protocol == ETH_P_FCOE)
+ fcoe->ctlr.priority = prio;
+
+ if (entry->app.protocol == ETH_P_FCOE) {
+ port = lport_priv(fcoe->ctlr.lp);
+ port->priority = prio;
+ }
+
+ return NOTIFY_OK;
+}
+
/**
* fcoe_device_notification() - Handler for net device events
* @notifier: The context of the notification
@@ -1984,6 +2056,46 @@ static bool fcoe_match(struct net_device *netdev)
}
/**
+ * fcoe_dcb_create() - Initialize DCB attributes and hooks
+ * @netdev: The net_device object of the L2 link that should be queried
+ * @port: The fcoe_port to bind FCoE APP priority with
+ * @
+ */
+static void fcoe_dcb_create(struct fcoe_interface *fcoe)
+{
+#ifdef CONFIG_DCB
+ int dcbx;
+ u8 fup, up;
+ struct net_device *netdev = fcoe->realdev;
+ struct fcoe_port *port = lport_priv(fcoe->ctlr.lp);
+ struct dcb_app app = {
+ .priority = 0,
+ .protocol = ETH_P_FCOE
+ };
+
+ /* setup DCB priority attributes. */
+ if (netdev && netdev->dcbnl_ops && netdev->dcbnl_ops->getdcbx) {
+ dcbx = netdev->dcbnl_ops->getdcbx(netdev);
+
+ if (dcbx & DCB_CAP_DCBX_VER_IEEE) {
+ app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE;
+ up = dcb_ieee_getapp_mask(netdev, &app);
+ app.protocol = ETH_P_FIP;
+ fup = dcb_ieee_getapp_mask(netdev, &app);
+ } else {
+ app.selector = DCB_APP_IDTYPE_ETHTYPE;
+ up = dcb_getapp(netdev, &app);
+ app.protocol = ETH_P_FIP;
+ fup = dcb_getapp(netdev, &app);
+ }
+
+ port->priority = ffs(up) ? ffs(up) - 1 : 0;
+ fcoe->ctlr.priority = ffs(fup) ? ffs(fup) - 1 : port->priority;
+ }
+#endif
+}
+
+/**
* fcoe_create() - Create a fcoe interface
* @netdev : The net_device object the Ethernet interface to create on
* @fip_mode: The FIP mode for this creation
@@ -2026,6 +2138,9 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)
/* Make this the "master" N_Port */
fcoe->ctlr.lp = lport;
+ /* setup DCB priority attributes. */
+ fcoe_dcb_create(fcoe);
+
/* add to lports list */
fcoe_hostlist_add(lport);
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index c74c4b8..e7522dc 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -320,6 +320,7 @@ static void fcoe_ctlr_solicit(struct fcoe_ctlr *fip, struct fcoe_fcf *fcf)
skb_put(skb, sizeof(*sol));
skb->protocol = htons(ETH_P_FIP);
+ skb->priority = fip->priority;
skb_reset_mac_header(skb);
skb_reset_network_header(skb);
fip->send(fip, skb);
@@ -474,6 +475,7 @@ static void fcoe_ctlr_send_keep_alive(struct fcoe_ctlr *fip,
}
skb_put(skb, len);
skb->protocol = htons(ETH_P_FIP);
+ skb->priority = fip->priority;
skb_reset_mac_header(skb);
skb_reset_network_header(skb);
fip->send(fip, skb);
@@ -566,6 +568,7 @@ static int fcoe_ctlr_encaps(struct fcoe_ctlr *fip, struct fc_lport *lport,
cap->fip.fip_dl_len = htons(dlen / FIP_BPW);
skb->protocol = htons(ETH_P_FIP);
+ skb->priority = fip->priority;
skb_reset_mac_header(skb);
skb_reset_network_header(skb);
return 0;
@@ -1911,6 +1914,7 @@ static void fcoe_ctlr_vn_send(struct fcoe_ctlr *fip,
skb_put(skb, len);
skb->protocol = htons(ETH_P_FIP);
+ skb->priority = fip->priority;
skb_reset_mac_header(skb);
skb_reset_network_header(skb);
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 8c1638b..6e4829d 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -147,6 +147,7 @@ struct fcoe_ctlr {
u8 map_dest;
u8 spma;
u8 probe_tries;
+ u8 priority;
u8 dest_addr[ETH_ALEN];
u8 ctl_src_addr[ETH_ALEN];
@@ -296,6 +297,7 @@ struct fcoe_percpu_s {
* @lport: The associated local port
* @fcoe_pending_queue: The pending Rx queue of skbs
* @fcoe_pending_queue_active: Indicates if the pending queue is active
+ * @priority: Packet priority (DCB)
* @max_queue_depth: Max queue depth of pending queue
* @min_queue_depth: Min queue depth of pending queue
* @timer: The queue timer
@@ -311,6 +313,7 @@ struct fcoe_port {
struct fc_lport *lport;
struct sk_buff_head fcoe_pending_queue;
u8 fcoe_pending_queue_active;
+ u8 priority;
u32 max_queue_depth;
u32 min_queue_depth;
struct timer_list timer;
^ permalink raw reply related
* is PACKET_TX_RING expected to work on loopback?
From: nick black @ 2011-10-06 18:37 UTC (permalink / raw)
To: Vitali Lovitch, Johann Baudy, David Miller; +Cc: linux-net
Hey there. I'm developing an application which makes use of PACKET_TX_RING
(http://dank.qemfd.net/dankwiki/index.php/Omphalos), one mmap'd RX and TX
socket per interface. When I transmit on wireless/ethernet devices, the
packets flow out fine, and I get responses.
When I transmit on loopback, I can see the packets using tcpdump -i lo,
send() returns 0, and the frame is set back to TP_STATUS_AVAILABLE.
Checksums are properly set and the packets appear well-formed in Wireshark.
I can't seem to read the packets, however; neither the intended DNS server
(verified via dnsmasq -d and strace) nor my own socat udp-listen process
seem to get the packets.
Is PACKET_TX_RING expected to work on loopback?
Thanks!
--
nick black <nblack@nvidia.com>
"A main cause of the Roman Empire's fall was that–lacking zero–they had
no way to indicate successful termination of their C programs."
^ permalink raw reply
* [net-next PATCH 3/3] dcb: Add stub routines for !CONFIG_DCB
From: John Fastabend @ 2011-10-06 18:52 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev, gospo
In-Reply-To: <20111006185233.2781.80310.stgit@jf-dev1-dcblab>
To avoid ifdefs in the other code that supports DCB notifiers
add stub routines. This method seems popular in other net code
for example 8021Q.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
include/net/dcbevent.h | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h
index bc1e7ef..443626e 100644
--- a/include/net/dcbevent.h
+++ b/include/net/dcbevent.h
@@ -24,8 +24,26 @@ enum dcbevent_notif_type {
DCB_APP_EVENT = 1,
};
+#ifdef CONFIG_DCB
extern int register_dcbevent_notifier(struct notifier_block *nb);
extern int unregister_dcbevent_notifier(struct notifier_block *nb);
extern int call_dcbevent_notifiers(unsigned long val, void *v);
+#else
+static inline int
+register_dcbevent_notifier(struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline int unregister_dcbevent_notifier(struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline int call_dcbevent_notifiers(unsigned long val, void *v)
+{
+ return 0;
+}
+#endif /* CONFIG_DCB */
#endif
^ permalink raw reply related
* [net-next PATCH 2/3] dcb: add DCBX mode to event notifier attributes
From: John Fastabend @ 2011-10-06 18:52 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev, gospo
In-Reply-To: <20111006185233.2781.80310.stgit@jf-dev1-dcblab>
Add DCBX mode to event notifiers so listeners can learn
currently enabled mode.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
include/net/dcbnl.h | 1 +
net/dcb/dcbnl.c | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index 263aa3a..2cd66d0 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -26,6 +26,7 @@ struct dcb_app_type {
int ifindex;
struct dcb_app app;
struct list_head list;
+ u8 dcbx;
};
int dcb_setapp(struct net_device *, struct dcb_app *);
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index e508593..9bfbc1d 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -2075,6 +2075,8 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new)
event.ifindex = dev->ifindex;
memcpy(&event.app, new, sizeof(event.app));
+ if (dev->dcbnl_ops->getdcbx)
+ event.dcbx = dev->dcbnl_ops->getdcbx(dev);
spin_lock(&dcb_lock);
/* Search for existing match and replace */
@@ -2152,6 +2154,8 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new)
event.ifindex = dev->ifindex;
memcpy(&event.app, new, sizeof(event.app));
+ if (dev->dcbnl_ops->getdcbx)
+ event.dcbx = dev->dcbnl_ops->getdcbx(dev);
spin_lock(&dcb_lock);
/* Search for existing match and abort if found */
@@ -2196,6 +2200,8 @@ int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del)
event.ifindex = dev->ifindex;
memcpy(&event.app, del, sizeof(event.app));
+ if (dev->dcbnl_ops->getdcbx)
+ event.dcbx = dev->dcbnl_ops->getdcbx(dev);
spin_lock(&dcb_lock);
/* Search for existing match and remove it. */
^ permalink raw reply related
* [net-next PATCH 1/3] dcb: Use ifindex instead of ifname
From: John Fastabend @ 2011-10-06 18:52 UTC (permalink / raw)
To: davem; +Cc: john.r.fastabend, netdev, gospo
From: Mark Rustad <mark.d.rustad@intel.com>
Use ifindex instead of ifname in the DCB app ring. This makes for a smaller
data structure and faster comparisons. It also avoids possible issues when
a net device is renamed.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
include/net/dcbnl.h | 2 +-
net/dcb/dcbnl.c | 24 ++++++++++++------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index f5aa399..263aa3a 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -23,7 +23,7 @@
#include <linux/dcbnl.h>
struct dcb_app_type {
- char name[IFNAMSIZ];
+ int ifindex;
struct dcb_app app;
struct list_head list;
};
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 3cb56af..e508593 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1255,7 +1255,7 @@ static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)
spin_lock(&dcb_lock);
list_for_each_entry(itr, &dcb_app_list, list) {
- if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0) {
+ if (itr->ifindex == netdev->ifindex) {
err = nla_put(skb, DCB_ATTR_IEEE_APP, sizeof(itr->app),
&itr->app);
if (err) {
@@ -1412,7 +1412,7 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
goto dcb_unlock;
list_for_each_entry(itr, &dcb_app_list, list) {
- if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0) {
+ if (itr->ifindex == netdev->ifindex) {
struct nlattr *app_nest = nla_nest_start(skb,
DCB_ATTR_APP);
if (!app_nest)
@@ -2050,7 +2050,7 @@ u8 dcb_getapp(struct net_device *dev, struct dcb_app *app)
list_for_each_entry(itr, &dcb_app_list, list) {
if (itr->app.selector == app->selector &&
itr->app.protocol == app->protocol &&
- (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) {
+ itr->ifindex == dev->ifindex) {
prio = itr->app.priority;
break;
}
@@ -2073,7 +2073,7 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new)
struct dcb_app_type *itr;
struct dcb_app_type event;
- memcpy(&event.name, dev->name, sizeof(event.name));
+ event.ifindex = dev->ifindex;
memcpy(&event.app, new, sizeof(event.app));
spin_lock(&dcb_lock);
@@ -2081,7 +2081,7 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new)
list_for_each_entry(itr, &dcb_app_list, list) {
if (itr->app.selector == new->selector &&
itr->app.protocol == new->protocol &&
- (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) {
+ itr->ifindex == dev->ifindex) {
if (new->priority)
itr->app.priority = new->priority;
else {
@@ -2101,7 +2101,7 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new)
}
memcpy(&entry->app, new, sizeof(*new));
- strncpy(entry->name, dev->name, IFNAMSIZ);
+ entry->ifindex = dev->ifindex;
list_add(&entry->list, &dcb_app_list);
}
out:
@@ -2127,7 +2127,7 @@ u8 dcb_ieee_getapp_mask(struct net_device *dev, struct dcb_app *app)
list_for_each_entry(itr, &dcb_app_list, list) {
if (itr->app.selector == app->selector &&
itr->app.protocol == app->protocol &&
- (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) {
+ itr->ifindex == dev->ifindex) {
prio |= 1 << itr->app.priority;
}
}
@@ -2150,7 +2150,7 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new)
struct dcb_app_type event;
int err = 0;
- memcpy(&event.name, dev->name, sizeof(event.name));
+ event.ifindex = dev->ifindex;
memcpy(&event.app, new, sizeof(event.app));
spin_lock(&dcb_lock);
@@ -2159,7 +2159,7 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new)
if (itr->app.selector == new->selector &&
itr->app.protocol == new->protocol &&
itr->app.priority == new->priority &&
- (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) {
+ itr->ifindex == dev->ifindex) {
err = -EEXIST;
goto out;
}
@@ -2173,7 +2173,7 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new)
}
memcpy(&entry->app, new, sizeof(*new));
- strncpy(entry->name, dev->name, IFNAMSIZ);
+ entry->ifindex = dev->ifindex;
list_add(&entry->list, &dcb_app_list);
out:
spin_unlock(&dcb_lock);
@@ -2194,7 +2194,7 @@ int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del)
struct dcb_app_type event;
int err = -ENOENT;
- memcpy(&event.name, dev->name, sizeof(event.name));
+ event.ifindex = dev->ifindex;
memcpy(&event.app, del, sizeof(event.app));
spin_lock(&dcb_lock);
@@ -2203,7 +2203,7 @@ int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del)
if (itr->app.selector == del->selector &&
itr->app.protocol == del->protocol &&
itr->app.priority == del->priority &&
- (strncmp(itr->name, dev->name, IFNAMSIZ) == 0)) {
+ itr->ifindex == dev->ifindex) {
list_del(&itr->list);
kfree(itr);
err = 0;
^ permalink raw reply related
* Re: [net-next 0/9][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2011-10-06 18:33 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
In-Reply-To: <1317898959-16550-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 6 Oct 2011 04:02:30 -0700
> The following series contains updates to e1000e, igb and ixgbe. Here
> is a quick summary:
> - e1000e: fixes for 2 WoL issues
> - igb: fix for I2C, and 2 Alt. MAC address updates
> - ixgbe: fix dependencies for 8 traffic classes, add X540 traffic
> class support and a fix for PFC mask generation
>
> The following are changes since commit f0cd7bdc042310b6b104f133bbfd520a72b3c08a:
> bnx2x: remove some dead code
> and are available in the git repository at
> git://github.com/Jkirsher/net-next.git
Pulled, thanks Jeff.
^ permalink raw reply
* Re: [PATCH net] mscan: zero accidentally copied register content
From: Marc Kleine-Budde @ 2011-10-06 18:25 UTC (permalink / raw)
To: Oliver Hartkopp
Cc: Wolfgang Grandegger, Wolfram Sang, Linux Netdev List,
Andre Naujoks
In-Reply-To: <4E8C78E8.3010605@hartkopp.net>
[-- Attachment #1: Type: text/plain, Size: 896 bytes --]
On 10/05/2011 05:34 PM, Oliver Hartkopp wrote:
> Due to the 16 bit access to mscan registers there's too much data copied to
> the zero initialized CAN frame when having an odd number of bytes to copy.
> This patch clears the data byte read from the invalid register entry.
>
> Reported-by: Andre Naujoks <nautsch@gmail.com>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This problem have some other drivers, too, e.g. the at91 and the flexcan
driver both copy unconditionally all 8 bytes from the hardware. However,
I don't know if the hardware sets the remaining bytes to zero.
cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply
* Re: [PATCH net] mscan: zero accidentally copied register content
From: Wolfgang Grandegger @ 2011-10-06 18:24 UTC (permalink / raw)
To: Andre Naujoks; +Cc: Oliver Hartkopp, Wolfram Sang, Linux Netdev List
In-Reply-To: <CAOCMmufQ77Vz4XTSTZTVSMiOA4QtWkZEvWHjGXip5-JK20E=QA@mail.gmail.com>
On 10/06/2011 05:03 PM, Andre Naujoks wrote:
> 2011/10/6 Oliver Hartkopp <socketcan@hartkopp.net>:
>> On 10/06/11 11:09, Wolfgang Grandegger wrote:
>>
>>> On 10/06/2011 09:02 AM, Oliver Hartkopp wrote:
>>>>
>>>> I think if one would like to rework the 16bit register access (which is used
>>>> in the rx path /and/ in the tx path also) this should go via net-next after
>>>> some discussion and testing.
>>>
>>> Why do you want to change 16-bit accesses in general? They are faster
>>> than two 8 bit accesses.
>>>
>>>> IMHO this fix is small and clear and especially not risky. I wonder if
>>>> reworking the 16 bit register access is worth the effort?
>>>
>>> I would prefer:
>>>
>>> if (!(frame->can_id & CAN_RTR_FLAG)) {
>>> void __iomem *data = ®s->rx.dsr1_0;
>>> u16 *payload = (u16 *)frame->data;
>>>
>>> for (i = 0; i < frame->can_dlc / 2; i++) {
>>> *payload++ = in_be16(data);
>>> data += 2 + _MSCAN_RESERVED_DSR_SIZE;
>>> }
>>> /* copy remaining byte */
>>> if (frame->can_dlc & 1)
>>> frame->data[frame->can_dlc - 1] = in_8(data);
>>> }
>>
>>
>> Besides the fact that Andre is going to test this idea from Wolfgang now, are
>> you really sure that it must be
>>
>> in_8(data)
That should be the right byte.
>>
>> and not
>>
>> in_8(data+1)
>>
>> ???
>>
>> And that data definitely points to the right place?
>>
>> I would prefer to be really cautious with these big endian 16 bit registers!
>>
>> Therefore my fix with
>>
>> + /* zero accidentally copied register content at odd DLCs */
>> + if (frame->can_dlc & 1)
>> + frame->data[frame->can_dlc] = 0;
>>
>> only repairing the result looks much more defensive to me.
>
> First things first: Both ways seem to work correctly. At least on the
> MPC5200 I have here.
>
> But I am with Oliver on this one. The solution looks much simpler and
> endianess errors are not possible. If the few CPU cycles are worth it
> on the other hand, then Wolfgangs version is probably preferable. I
> don't have access to this kind of hardware on a little endian machine
> to test it, though.
Well, copying just the relevant bytes seem much more straight-forward
than removing accidentally copied bytes later-on. You do not need to
care about little endian. The MSCAN is only available on PowerPC SOCs,
which are big endian.
I'm going to test and post a patch tomorrow.
Wolfgang.
^ permalink raw reply
* Cannot delete a bridge using 'ip' netlink interface
From: Sridhar Samudrala @ 2011-10-06 17:18 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
On a linux 3.1.0-rc9 system using the latest iproute2, i tried
creating a bridge and deleting it with an attached interface.
Here is the sequence of steps i tried
ip link add br0 type bridge
ip link set dev eth1 master br0
ip link set br0 up
ip link del br0
The last command hangs with the following kernel messages
kernel:unregister_netdevice: waiting for br0 to become free. Usage count = 1
I see the same behavior even if the bridge is brought down
before trying to delete the bridge.
brctl delbr fails with an error message if the bridge is up.
But it succeeds if the bridge is brought down before doing a delbr
even if it has interfaces attached.
Thanks
Sridhar
^ permalink raw reply
* Re: [PATCH 1/3] net/phy: added autocross feature for forced links on VSC82x4
From: Madalin Bucur @ 2011-10-06 17:04 UTC (permalink / raw)
To: netdev, davem; +Cc: afleming, Madalin Bucur
Please ignore this set of 3 patches, they do not apply as they are based on a modified tree.
I'll update and resend.
^ permalink raw reply
* Re: bnx2 rxhash
From: Michael Chan @ 2011-10-06 16:52 UTC (permalink / raw)
To: Jasper Spaans; +Cc: netdev@vger.kernel.org
In-Reply-To: <4E8D7B85.7060702@fox-it.com>
On Thu, 2011-10-06 at 02:57 -0700, Jasper Spaans wrote:
> The data I'm processing consists of (almost 100% tcp) traffic between an
> ssl-offloader and a cluster of webservers, so the range of mac-addresses
> is rather limited. This ssl-offloader does preserve the IP-address and
> tcp ports of the clients, so if the rxhash is based on that data, it
> should be distributed evenly.
>
> Is there anything I can do about this?
>
Can you send me a small tcpdump/wireshark trace of the incoming packets?
I just need to see the tuple values in the packet headers. Thanks.
^ permalink raw reply
* [PATCH 3/3] net/phy: abort genphy_read_status when link changes during speed and duplex reading
From: Madalin Bucur @ 2011-10-06 16:48 UTC (permalink / raw)
To: netdev, davem; +Cc: afleming, Madalin Bucur
If the link changes during speed and duplex reading the values may be out of sync;
abort the update if the link state changes during the read
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
---
drivers/net/phy/phy_device.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index a1e132c..e88f49a 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -824,6 +824,16 @@ int genphy_read_status(struct phy_device *phydev)
lpa &= adv;
+ err = phy_read(phydev, MII_BMSR);
+
+ if (err < 0)
+ return err;
+
+ /* if the link changed while reading speed and duplex
+ * abort the speed and duplex update */
+ if (((err & BMSR_LSTATUS) == 0) != (phydev->link == 0))
+ return 0;
+
phydev->speed = SPEED_10;
phydev->duplex = DUPLEX_HALF;
phydev->pause = phydev->asym_pause = 0;
--
1.7.0.1
^ permalink raw reply related
* [PATCH 2/3] net/phy: avoid reaching an unsupported speed and duplex combination
From: Madalin Bucur @ 2011-10-06 16:48 UTC (permalink / raw)
To: netdev, davem; +Cc: afleming, Madalin Bucur
- phy_force_reduction() may get the interface into a speed and duplex combination
that is not supported by the device;
- wait PHY_FORCE_TIMEOUT before each speed/duplex reduction in forced mode
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
---
drivers/net/phy/phy.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 79268f6..31d6519 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -6,7 +6,7 @@
*
* Author: Andy Fleming
*
- * Copyright (c) 2004 Freescale Semiconductor, Inc.
+ * Copyright (c) 2004,2011 Freescale Semiconductor, Inc.
* Copyright (c) 2006, 2007 Maciej W. Rozycki
*
* This program is free software; you can redistribute it and/or modify it
@@ -479,6 +479,10 @@ static void phy_force_reduction(struct phy_device *phydev)
idx = phy_find_valid(idx, phydev->supported);
+ /* Avoid reaching an invalid speed and duplex combination */
+ if (!(settings[idx].setting & phydev->supported))
+ return;
+
phydev->speed = settings[idx].speed;
phydev->duplex = settings[idx].duplex;
@@ -869,6 +873,8 @@ void phy_state_machine(struct work_struct *work)
if (0 == phydev->link_timeout--) {
phy_force_reduction(phydev);
needs_aneg = 1;
+ phydev->link_timeout =
+ PHY_FORCE_TIMEOUT;
}
}
--
1.7.0.1
^ permalink raw reply related
* [PATCH 1/3] net/phy: added autocross feature for forced links on VSC82x4
From: Madalin Bucur @ 2011-10-06 16:48 UTC (permalink / raw)
To: netdev, davem; +Cc: afleming, Madalin Bucur
Added auto MDI/MDI-X capability for forced (autonegotiation disabled)
10/100 Mbps speeds on Vitesse VSC82x4 PHYs.
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
---
drivers/net/phy/phy_device.c | 5 ++-
drivers/net/phy/vitesse.c | 67 ++++++++++++++++++++++++++++++++++++++++--
include/linux/phy.h | 3 +-
3 files changed, 69 insertions(+), 6 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 7216e68..a1e132c 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -6,7 +6,7 @@
*
* Author: Andy Fleming
*
- * Copyright (c) 2004-2006, 2008-2010 Freescale Semiconductor, Inc.
+ * Copyright (c) 2004-2006, 2008-2011 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -637,7 +637,7 @@ EXPORT_SYMBOL(gen10g_config_advert);
* to the values in phydev. Assumes that the values are valid.
* Please see phy_sanitize_settings().
*/
-static int genphy_setup_forced(struct phy_device *phydev)
+int genphy_setup_forced(struct phy_device *phydev)
{
int err;
int ctl = 0;
@@ -656,6 +656,7 @@ static int genphy_setup_forced(struct phy_device *phydev)
return err;
}
+EXPORT_SYMBOL(genphy_setup_forced);
int gen10g_setup_forced(struct phy_device *phydev)
{
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index d0f36a1..ae87c1c 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -3,7 +3,7 @@
*
* Author: Kriston Carson
*
- * Copyright (c) 2005, 2009 Freescale Semiconductor, Inc.
+ * Copyright (c) 2005, 2009, 2011 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -45,6 +45,10 @@
/* Vitesse Auxiliary Control/Status Register */
#define MII_VSC8244_AUX_CONSTAT 0x1c
+#define MII_VSC82X4_EXT_PAGE_16E 0x10
+#define MII_VSC82X4_EXT_PAGE_17E 0x11
+#define MII_VSC82X4_EXT_PAGE_18E 0x12
+#define MII_VSC82X4_EXT_PAGE_ACCESS 0x1f
#define MII_VSC8244_AUXCONSTAT_INIT 0x0000
#define MII_VSC8244_AUXCONSTAT_DUPLEX 0x0020
#define MII_VSC8244_AUXCONSTAT_SPEED 0x0018
@@ -140,6 +144,63 @@ static int vsc82xx_config_intr(struct phy_device *phydev)
return err;
}
+/* vsc82x4_config_autocross_enable - Enable auto MDI/MDI-X for forced links
+ * @phydev: target phy_device struct
+ *
+ * Enable auto MDI/MDI-X when in 10/100 forced link speeds by writing
+ * special values in the VSC8234/VSC8244 extended reserved registers
+ *
+ */
+static int vsc82x4_config_autocross_enable(struct phy_device *phydev)
+{
+ int result;
+
+ if (AUTONEG_ENABLE == phydev->autoneg || phydev->speed > SPEED_100)
+ return 0;
+
+ result = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x52b5);
+ if (result >= 0)
+ result = phy_write(phydev, MII_VSC82X4_EXT_PAGE_18E, 0x0012);
+ if (result >= 0)
+ result = phy_write(phydev, MII_VSC82X4_EXT_PAGE_17E, 0x2803);
+ if (result >= 0)
+ result = phy_write(phydev, MII_VSC82X4_EXT_PAGE_16E, 0x87fa);
+ if (result >= 0)
+ result = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000);
+ else
+ phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000);
+
+ return result;
+}
+
+/**
+ * vsc82x4_config_aneg - restart auto-negotiation or write BMCR
+ * @phydev: target phy_device struct
+ *
+ * Description: If auto-negotiation is enabled, we configure the
+ * advertising, and then restart auto-negotiation. If it is not
+ * enabled, then we write the BMCR and also start the auto
+ * MDI/MDI-X feature
+ *
+ */
+static int vsc82x4_config_aneg(struct phy_device *phydev)
+{
+ int result;
+
+ /* Enable auto MDI/MDI-X when in 10/100 forced link speeds by
+ * writing special values in the VSC8234 extended reserved registers */
+ if (AUTONEG_ENABLE != phydev->autoneg && SPEED_100 >= phydev->speed) {
+ result = genphy_setup_forced(phydev);
+
+ if (result < 0) /* error */
+ return result;
+
+ return vsc82x4_config_autocross_enable(phydev);
+ }
+
+ return genphy_config_aneg(phydev);
+}
+
/* Vitesse 824x */
static struct phy_driver vsc8244_driver = {
.phy_id = PHY_ID_VSC8244,
@@ -148,7 +209,7 @@ static struct phy_driver vsc8244_driver = {
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_init = &vsc824x_config_init,
- .config_aneg = &genphy_config_aneg,
+ .config_aneg = &vsc82x4_config_aneg,
.read_status = &genphy_read_status,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr,
@@ -163,7 +224,7 @@ static struct phy_driver vsc8234_driver = {
.features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT,
.config_init = &vsc824x_config_init,
- .config_aneg = &genphy_config_aneg,
+ .config_aneg = &vsc82x4_config_aneg,
.read_status = &genphy_read_status,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr,
diff --git a/include/linux/phy.h b/include/linux/phy.h
index d2d2fa4..3610a5e 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -6,7 +6,7 @@
*
* Author: Andy Fleming
*
- * Copyright (c) 2004-2010 Freescale Semiconductor, Inc.
+ * Copyright (c) 2004-2011 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -533,6 +533,7 @@ static inline int phy_read_status(struct phy_device *phydev) {
return phydev->drv->read_status(phydev);
}
+int genphy_setup_forced(struct phy_device *phydev);
int genphy_restart_aneg(struct phy_device *phydev);
int genphy_config_aneg(struct phy_device *phydev);
int genphy_update_link(struct phy_device *phydev);
--
1.7.0.1
^ permalink raw reply related
* Re: [PATCH 1/8] vxge: convert to SKB paged frag API.
From: Ian Campbell @ 2011-10-06 16:00 UTC (permalink / raw)
To: Michał Mirosław, David Miller; +Cc: netdev@vger.kernel.org, Jon Mason
In-Reply-To: <1317884756.24742.13.camel@dagon.hellion.org.uk>
On Thu, 2011-10-06 at 08:05 +0100, Ian Campbell wrote:
> On Wed, 2011-10-05 at 22:03 +0100, Michał Mirosław wrote:
> > 2011/10/5 Ian Campbell <ian.campbell@citrix.com>:
> > [...]
> > > --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
> > > +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
> > > @@ -923,9 +923,9 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
> > > if (!frag->size)
> > > continue;
> > >
> > > - dma_pointer = (u64) pci_map_page(fifo->pdev, frag->page,
> > > - frag->page_offset, frag->size,
> > > - PCI_DMA_TODEVICE);
> > > + dma_pointer = (u64)skb_frag_dma_map(&fifo->pdev->dev, frag,
> > > + 0, frag->size,
> > > + PCI_DMA_TODEVICE);
> >
> > This should be DMA_TO_DEVICE instead of PCI_DMA_TODEVICE.
> >
> > >
> > > if (unlikely(pci_dma_mapping_error(fifo->pdev, dma_pointer)))
> > > goto _exit2;
> >
> > I would also change this to dma_mapping_error() in one go.
> >
> > Just a random patch check.
>
> Thanks Michał.
>
> I'm sure I must have made the same mistakes in a whole bunch of patches
> which have already been applied. I'll knock up a fixup patch.
Here it is. David, if you want N separate patches (or a git pull
request?) let me know.
8<---------------------------------------------
From 755028af197868cc63ac71248742b3bc3eefaf37 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Thu, 6 Oct 2011 11:10:48 +0100
Subject: [PATCH] net: use DMA_x_DEVICE and dma_mapping_error with skb_frag_dma_map
When I converted some drivers from pci_map_page to skb_frag_dma_map I
neglected to convert PCI_DMA_xDEVICE into DMA_x_DEVICE and
pci_dma_mapping_error into dma_mapping_error.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
drivers/infiniband/hw/amso1100/c2.c | 3 +--
drivers/infiniband/hw/nes/nes_nic.c | 4 ++--
drivers/net/ethernet/alteon/acenic.c | 2 +-
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +-
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 2 +-
drivers/net/ethernet/atheros/atlx/atl1.c | 2 +-
drivers/net/ethernet/broadcom/bnx2.c | 2 +-
drivers/net/ethernet/broadcom/tg3.c | 4 ++--
drivers/net/ethernet/chelsio/cxgb/sge.c | 2 +-
drivers/net/ethernet/chelsio/cxgb3/sge.c | 2 +-
drivers/net/ethernet/cisco/enic/enic_main.c | 4 ++--
drivers/net/ethernet/marvell/skge.c | 2 +-
drivers/net/ethernet/marvell/sky2.c | 8 ++++----
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +-
drivers/net/ethernet/natsemi/ns83820.c | 2 +-
drivers/net/ethernet/neterion/s2io.c | 2 +-
drivers/net/ethernet/nvidia/forcedeth.c | 4 ++--
drivers/net/ethernet/pasemi/pasemi_mac.c | 4 ++--
.../net/ethernet/qlogic/netxen/netxen_nic_main.c | 4 ++--
drivers/net/ethernet/qlogic/qla3xxx.c | 4 ++--
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 ++--
drivers/net/ethernet/qlogic/qlge/qlge_main.c | 4 ++--
drivers/net/ethernet/sfc/tx.c | 6 +++---
drivers/net/ethernet/sun/cassini.c | 2 +-
drivers/net/ethernet/sun/sungem.c | 2 +-
drivers/net/ethernet/tehuti/tehuti.c | 2 +-
drivers/net/ethernet/via/via-velocity.c | 2 +-
drivers/net/vmxnet3/vmxnet3_drv.c | 2 +-
drivers/staging/et131x/et1310_tx.c | 2 +-
29 files changed, 43 insertions(+), 44 deletions(-)
diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c
index 6a8f36e..6e85a75 100644
--- a/drivers/infiniband/hw/amso1100/c2.c
+++ b/drivers/infiniband/hw/amso1100/c2.c
@@ -803,8 +803,7 @@ static int c2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
maplen = frag->size;
mapaddr = skb_frag_dma_map(&c2dev->pcidev->dev, frag,
- 0, maplen,
- PCI_DMA_TODEVICE);
+ 0, maplen, DMA_TO_DEVICE);
elem = elem->next;
elem->skb = NULL;
elem->mapaddr = mapaddr;
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 96cb35a..7cb7f29 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -445,7 +445,7 @@ static int nes_nic_send(struct sk_buff *skb, struct net_device *netdev)
&skb_shinfo(skb)->frags[skb_fragment_index];
bus_address = skb_frag_dma_map(&nesdev->pcidev->dev,
frag, 0, frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
wqe_fragment_length[wqe_fragment_index] =
cpu_to_le16(skb_shinfo(skb)->frags[skb_fragment_index].size);
set_wqe_64bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_FRAG0_LOW_IDX+(2*wqe_fragment_index),
@@ -566,7 +566,7 @@ tso_sq_no_longer_full:
tso_bus_address[tso_frag_count] =
skb_frag_dma_map(&nesdev->pcidev->dev,
frag, 0, frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
}
tso_frag_index = 0;
diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index 8794cf8..b1a4e82 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -2487,7 +2487,7 @@ restart:
mapping = skb_frag_dma_map(&ap->pdev->dev, frag, 0,
frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
flagsize = (frag->size << 16);
if (skb->ip_summed == CHECKSUM_PARTIAL)
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 2b9f925..12a0b30 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -2183,7 +2183,7 @@ static void atl1c_tx_map(struct atl1c_adapter *adapter,
buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev,
frag, 0,
buffer_info->length,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY);
ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_PAGE,
ATL1C_PCIMAP_TODEVICE);
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 7e27eb3..97c45a4b 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -1769,7 +1769,7 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
frag,
(i * MAX_TX_BUF_LEN),
tx_buffer->length,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_PAGE);
use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
use_tpd->word2 = (use_tpd->word2 & (~TPD_BUFLEN_MASK)) |
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index edf826a..43511ab 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -2285,7 +2285,7 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
buf_len -= buffer_info->length;
buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev,
frag, i * ATL1_MAX_TX_BUF_LEN,
- buffer_info->length, PCI_DMA_TODEVICE);
+ buffer_info->length, DMA_TO_DEVICE);
if (++next_to_use == tpd_ring->count)
next_to_use = 0;
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 21bdda3..ad24d8c 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -6539,7 +6539,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
len = frag->size;
mapping = skb_frag_dma_map(&bp->pdev->dev, frag, 0, len,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
if (dma_mapping_error(&bp->pdev->dev, mapping))
goto dma_error;
dma_unmap_addr_set(&txr->tx_buf_ring[ring_prod], mapping,
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 26c6bd4..3abcb4d 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -6779,12 +6779,12 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
len = frag->size;
mapping = skb_frag_dma_map(&tp->pdev->dev, frag, 0,
- len, PCI_DMA_TODEVICE);
+ len, DMA_TO_DEVICE);
tnapi->tx_buffers[entry].skb = NULL;
dma_unmap_addr_set(&tnapi->tx_buffers[entry], mapping,
mapping);
- if (pci_dma_mapping_error(tp->pdev, mapping))
+ if (dma_mapping_error(tp->pdev, mapping))
goto dma_error;
if (tg3_tx_frag_set(tnapi, &entry, &budget, mapping,
diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c
index 7cde425..0a511c4a 100644
--- a/drivers/net/ethernet/chelsio/cxgb/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb/sge.c
@@ -1278,7 +1278,7 @@ static inline void write_tx_descs(struct adapter *adapter, struct sk_buff *skb,
}
mapping = skb_frag_dma_map(&adapter->pdev->dev, frag, 0,
- frag->size, PCI_DMA_TODEVICE);
+ frag->size, DMA_TO_DEVICE);
desc_mapping = mapping;
desc_len = frag->size;
diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c
index a0baaa0..2f46b37 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
@@ -980,7 +980,7 @@ static inline unsigned int make_sgl(const struct sk_buff *skb,
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
mapping = skb_frag_dma_map(&pdev->dev, frag, 0, frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
sgp->len[j] = cpu_to_be32(frag->size);
sgp->addr[j] = cpu_to_be64(mapping);
j ^= 1;
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index aeab6cd..1bc908f 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -607,7 +607,7 @@ static inline void enic_queue_wq_skb_cont(struct enic *enic,
enic_queue_wq_desc_cont(wq, skb,
skb_frag_dma_map(&enic->pdev->dev,
frag, 0, frag->size,
- PCI_DMA_TODEVICE),
+ DMA_TO_DEVICE),
frag->size,
(len_left == 0), /* EOP? */
loopback);
@@ -726,7 +726,7 @@ static inline void enic_queue_wq_skb_tso(struct enic *enic,
(unsigned int)WQ_ENET_MAX_DESC_LEN);
dma_addr = skb_frag_dma_map(&enic->pdev->dev, frag,
offset, len,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
enic_queue_wq_desc_cont(wq, skb,
dma_addr,
len,
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index a0a6471..32db4c8 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -2777,7 +2777,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
map = skb_frag_dma_map(&hw->pdev->dev, frag, 0,
- frag->size, PCI_DMA_TODEVICE);
+ frag->size, DMA_TO_DEVICE);
e = e->next;
e->skb = skb;
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 338b10c..7baff3e 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -1229,9 +1229,9 @@ static int sky2_rx_map_skb(struct pci_dev *pdev, struct rx_ring_info *re,
re->frag_addr[i] = skb_frag_dma_map(&pdev->dev, frag, 0,
frag->size,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
- if (pci_dma_mapping_error(pdev, re->frag_addr[i]))
+ if (dma_mapping_error(pdev, re->frag_addr[i]))
goto map_page_error;
}
return 0;
@@ -1936,9 +1936,9 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
mapping = skb_frag_dma_map(&hw->pdev->dev, frag, 0,
- frag->size, PCI_DMA_TODEVICE);
+ frag->size, DMA_TO_DEVICE);
- if (pci_dma_mapping_error(hw->pdev, mapping))
+ if (dma_mapping_error(hw->pdev, mapping))
goto mapping_unwind;
upper = upper_32_bits(mapping);
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 8bf6034..2663727 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -2928,7 +2928,7 @@ again:
frag_idx++;
len = frag->size;
bus = skb_frag_dma_map(&mgp->pdev->dev, frag, 0, len,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
dma_unmap_addr_set(&tx->info[idx], bus, bus);
dma_unmap_len_set(&tx->info[idx], len, len);
}
diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
index e0895e4..73616b9 100644
--- a/drivers/net/ethernet/natsemi/ns83820.c
+++ b/drivers/net/ethernet/natsemi/ns83820.c
@@ -1161,7 +1161,7 @@ again:
break;
buf = skb_frag_dma_map(&dev->pci_dev->dev, frag, 0,
- frag->size, PCI_DMA_TODEVICE);
+ frag->size, DMA_TO_DEVICE);
dprintk("frag: buf=%08Lx page=%08lx offset=%08lx\n",
(long long)buf, (long) page_to_pfn(frag->page),
frag->page_offset);
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index ef5b825..4ec7e3f 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -4193,7 +4193,7 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
txdp->Buffer_Pointer = (u64)skb_frag_dma_map(&sp->pdev->dev,
frag, 0,
frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size);
if (offload_type == SKB_GSO_UDP)
txdp->Control_1 |= TXD_UFO_EN;
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 4e39b8c..84baa59 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -2150,7 +2150,7 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
&np->pci_dev->dev,
frag, offset,
bcnt,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
np->put_tx_ctx->dma_len = bcnt;
np->put_tx_ctx->dma_single = 0;
put_tx->buf = cpu_to_le32(np->put_tx_ctx->dma);
@@ -2264,7 +2264,7 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
&np->pci_dev->dev,
frag, offset,
bcnt,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
np->put_tx_ctx->dma_len = bcnt;
np->put_tx_ctx->dma_single = 0;
put_tx->bufhigh = cpu_to_le32(dma_high(np->put_tx_ctx->dma));
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c
index 5322095..d247030 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
@@ -1506,9 +1506,9 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev)
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
map[i + 1] = skb_frag_dma_map(&mac->dma_pdev->dev, frag, 0,
- frag->size, PCI_DMA_TODEVICE);
+ frag->size, DMA_TO_DEVICE);
map_size[i+1] = frag->size;
- if (pci_dma_mapping_error(mac->dma_pdev, map[i+1])) {
+ if (dma_mapping_error(mac->dma_pdev, map[i + 1])) {
nfrags = i;
goto out_err_nolock;
}
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index dc9e21a..b061c07 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -1906,8 +1906,8 @@ netxen_map_tx_skb(struct pci_dev *pdev,
nf = &pbuf->frag_array[i+1];
map = skb_frag_dma_map(&pdev->dev, frag, 0, frag->size,
- PCI_DMA_TODEVICE);
- if (pci_dma_mapping_error(pdev, map))
+ DMA_TO_DEVICE);
+ if (dma_mapping_error(pdev, map))
goto unwind;
nf->dma = map;
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index 1871d88..8932265 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -2389,9 +2389,9 @@ static int ql_send_map(struct ql3_adapter *qdev,
}
map = skb_frag_dma_map(&qdev->pdev->dev, frag, 0, frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
- err = pci_dma_mapping_error(qdev->pdev, map);
+ err = dma_mapping_error(qdev->pdev, map);
if (err) {
netdev_err(qdev->ndev,
"PCI mapping frags failed with error: %d\n",
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 445956e..c9756e7 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2136,8 +2136,8 @@ qlcnic_map_tx_skb(struct pci_dev *pdev,
nf = &pbuf->frag_array[i+1];
map = skb_frag_dma_map(&pdev->dev, frag, 0, frag->size,
- PCI_DMA_TODEVICE);
- if (pci_dma_mapping_error(pdev, map))
+ DMA_TO_DEVICE);
+ if (dma_mapping_error(pdev, map))
goto unwind;
nf->dma = map;
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index ce6c6fe..094ac22 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -1432,9 +1432,9 @@ static int ql_map_send(struct ql_adapter *qdev,
}
map = skb_frag_dma_map(&qdev->pdev->dev, frag, 0, frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
- err = pci_dma_mapping_error(qdev->pdev, map);
+ err = dma_mapping_error(qdev->pdev, map);
if (err) {
netif_err(qdev, tx_queued, qdev->ndev,
"PCI mapping frags failed with error: %d.\n",
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index f2467a1..7f47efc 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -243,7 +243,7 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
/* Map for DMA */
unmap_single = false;
dma_addr = skb_frag_dma_map(&pci_dev->dev, fragment, 0, len,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
}
/* Transfer ownership of the skb to the final buffer */
@@ -926,8 +926,8 @@ static int tso_get_fragment(struct tso_state *st, struct efx_nic *efx,
skb_frag_t *frag)
{
st->unmap_addr = skb_frag_dma_map(&efx->pci_dev->dev, frag, 0,
- frag->size, PCI_DMA_TODEVICE);
- if (likely(!pci_dma_mapping_error(efx->pci_dev, st->unmap_addr))) {
+ frag->size, DMA_TO_DEVICE);
+ if (likely(!dma_mapping_error(efx->pci_dev, st->unmap_addr))) {
st->unmap_single = false;
st->unmap_len = frag->size;
st->in_len = frag->size;
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index 1206821..d9460d8 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -2830,7 +2830,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
len = fragp->size;
mapping = skb_frag_dma_map(&cp->pdev->dev, fragp, 0, len,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
tabort = cas_calc_tabort(cp, fragp->page_offset, len);
if (unlikely(tabort)) {
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index 2bfa171..6b62a73 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -1072,7 +1072,7 @@ static netdev_tx_t gem_start_xmit(struct sk_buff *skb,
len = this_frag->size;
mapping = skb_frag_dma_map(&gp->pdev->dev, this_frag,
- 0, len, PCI_DMA_TODEVICE);
+ 0, len, DMA_TO_DEVICE);
this_ctrl = ctrl;
if (frag == skb_shinfo(skb)->nr_frags - 1)
this_ctrl |= TXDCTRL_EOF;
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index 1151cf9..c77e3bf 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -1499,7 +1499,7 @@ bdx_tx_map_skb(struct bdx_priv *priv, struct sk_buff *skb,
db->wptr->len = frag->size;
db->wptr->addr.dma = skb_frag_dma_map(&priv->pdev->dev, frag,
0, frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
pbl++;
pbl->len = CPU_CHIP_SWAP32(db->wptr->len);
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
index 1ec32c4..b47bce1 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -2559,7 +2559,7 @@ static netdev_tx_t velocity_xmit(struct sk_buff *skb,
tdinfo->skb_dma[i + 1] = skb_frag_dma_map(&vptr->pdev->dev,
frag, 0,
frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
td_ptr->td_buf[i + 1].pa_low = cpu_to_le32(tdinfo->skb_dma[i + 1]);
td_ptr->td_buf[i + 1].pa_high = 0;
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 57e7c66..1694038 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -750,7 +750,7 @@ vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx,
tbi->map_type = VMXNET3_MAP_PAGE;
tbi->dma_addr = skb_frag_dma_map(&adapter->pdev->dev, frag,
0, frag->size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
tbi->len = frag->size;
diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
index 03e7a4e..e4f51e6 100644
--- a/drivers/staging/et131x/et1310_tx.c
+++ b/drivers/staging/et131x/et1310_tx.c
@@ -524,7 +524,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, struct tcb *tcb)
&frags[i - 1],
0,
frags[i - 1].size,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
}
}
--
1.7.2.5
^ permalink raw reply related
* Re: [PATCH 0/3] iproute2: various usage and doc fixes
From: Stephen Hemminger @ 2011-10-06 15:25 UTC (permalink / raw)
To: Petr Sabata; +Cc: netdev
In-Reply-To: <1317905134-23175-1-git-send-email-contyk@redhat.com>
On Thu, 6 Oct 2011 14:45:31 +0200
Petr Sabata <contyk@redhat.com> wrote:
> Petr Sabata (3):
> iproute2: ss - fix missing parameters
> iproute2: lnstat - fix typos
> iproute2: arpd - fix usage and manpage options
>
> man/man8/arpd.8 | 4 ++--
> man/man8/ss.8 | 4 ++--
> misc/arpd.c | 2 +-
> misc/lnstat.c | 4 ++--
> misc/ss.c | 6 ++++--
> 5 files changed, 11 insertions(+), 9 deletions(-)
>
All applied.
^ permalink raw reply
* Re: A new 40G Network driver ready to submit to the kernel tree
From: David @ 2011-10-06 15:06 UTC (permalink / raw)
To: Joyce Yu - System Software; +Cc: netdev@vger.kernel.org
In-Reply-To: <4E8CE4A0.4060202@oracle.com>
在 2011-10-6,7:13,Joyce Yu - System Software <joyce.yu@oracle.com> 写道:
>
>
> I have a new 40G Network driver ready to submit to the kernel tree. The driver has been ported to latest linux-3.0-rc5 and net-2.6-353e5c9 tree. The driver versions for 2.6.18 and 2.6.32 based kernel have been fully tested and released to the customer. Shall I just send the driverxx.c and driverxx.h for net-2.6-353e5c9 and linux-3.0-rc5 to this alias?
net tree and linux tree are just only for bug fix. New features or new drivers should be merged from net-next tree which locates at Github site.
Shan Wei
>
> Thanks,
> Joyce
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply
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