* Re: [PATCH net-next] inet: add rfc 3168 extract in front of INET_ECN_encapsulate()
From: David Miller @ 2011-10-22 5:26 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1319260268.6180.12.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 22 Oct 2011 07:11:08 +0200
> INET_ECN_encapsulate() is better understood if we can read the official
> statement.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: Linux 3.1-rc10
From: Valdis.Kletnieks @ 2011-10-22 5:31 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Linux Kernel Mailing List
In-Reply-To: <CA+55aFzLTjB+CwB7MQNh+p0pjSrFd=pBFDcA=GxMY4HJhQokUg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]
On Sat, 22 Oct 2011 06:08:31 +0300, Linus Torvalds said:
> It's ALWAYS that easy. Your argument is totally flawed. The only one
> who should be busy during the merge window is *me*. If you're busy
> during th emerge window, you're doing something wrong.
Actually, the question was "Are there enough Linus cycles to do KS
and all the merges in 2 weeks?". ;)
(And when I wrote "and everybody will be busy at KS", I didn't mean "Ted T'So
won't have his tree ready to pull", I meant "Linus finally gets back to his
hotel room and tries to merge Ted's tree, hits some really weird merge issue,
and Ted's not answering his e-mail or his phone because he's still discussing
something over beer and pizza down at the hotel bar, so that's *another* merge
that waits till the next day..."
> Seriously. I'm not going to extend the merge window at all. Because we
> extended the time when you could do your actual work already - if you
> waited until the merge window to do work, then I don't want to see
> your pull request ANYWAY. I'll take it the *next* merge window, thank
> you very much.
OK, so Linus will get some sleep after -rc1, which will be the customary
2 weeks. I can deal with that answer. ;)
[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply
* [Qemu-devel] buildbot failure in qemu on ppc-next_x86_64_debian_6_0
From: qemu @ 2011-10-22 6:03 UTC (permalink / raw)
To: agraf, gollub, lcapitulino, qemu-devel
The Buildbot has detected a new failure on builder ppc-next_x86_64_debian_6_0 while building qemu.
Full details are available at:
http://buildbot.b1-systems.de/qemu/builders/ppc-next_x86_64_debian_6_0/builds/68
Buildbot URL: http://buildbot.b1-systems.de/qemu/
Buildslave for this Build: yuzuki
Build Reason: The Nightly scheduler named 'nightly_ppc-next' triggered this build
Build Source Stamp: [branch ppc-next] HEAD
Blamelist:
BUILD FAILED: failed configure
sincerely,
-The Buildbot
^ permalink raw reply
* [RFC v2 PATCH 0/4] Support sending gratuitous by guest
From: Jason Wang @ 2011-10-22 5:38 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
We only track primary mac address in qemu and send rarp packets after
migration to notify the switch to update its mac address table. This
may not works when guest have complicated network configurations such
as tagged vlan or ipv6, those connection may lost or stall after
migration.
One method to handle them is snooping the network traffic in qemu and
recording use of mac, but this method would hurt performance and is
impossible for network backend such as vhost.
So in order to solve this issue, the best method is to let guest
instead of qemu to send gratuitous packet. This series first add a
model specific fucntion which can let nic model to implement its own
announce function and then implement a virtio-net specific function to
let guest send the gratitous packet.
Only basic test were done.
Comments are welcomed.
Thanks
---
Jason Wang (4):
announce self after vm start
net: export announce_self_create()
net: model specific announcing support
virtio-net: notify guest to annouce itself
hw/virtio-net.c | 20 +++++++++++++++++++-
hw/virtio-net.h | 2 ++
migration.c | 1 -
net.c | 31 +++++++++++++++++++++++++++++++
net.h | 3 +++
savevm.c | 40 +++++-----------------------------------
vl.c | 1 +
7 files changed, 61 insertions(+), 37 deletions(-)
--
Jason Wang
^ permalink raw reply
* [Qemu-devel] [RFC v2 PATCH 0/4] Support sending gratuitous by guest
From: Jason Wang @ 2011-10-22 5:38 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
We only track primary mac address in qemu and send rarp packets after
migration to notify the switch to update its mac address table. This
may not works when guest have complicated network configurations such
as tagged vlan or ipv6, those connection may lost or stall after
migration.
One method to handle them is snooping the network traffic in qemu and
recording use of mac, but this method would hurt performance and is
impossible for network backend such as vhost.
So in order to solve this issue, the best method is to let guest
instead of qemu to send gratuitous packet. This series first add a
model specific fucntion which can let nic model to implement its own
announce function and then implement a virtio-net specific function to
let guest send the gratitous packet.
Only basic test were done.
Comments are welcomed.
Thanks
---
Jason Wang (4):
announce self after vm start
net: export announce_self_create()
net: model specific announcing support
virtio-net: notify guest to annouce itself
hw/virtio-net.c | 20 +++++++++++++++++++-
hw/virtio-net.h | 2 ++
migration.c | 1 -
net.c | 31 +++++++++++++++++++++++++++++++
net.h | 3 +++
savevm.c | 40 +++++-----------------------------------
vl.c | 1 +
7 files changed, 61 insertions(+), 37 deletions(-)
--
Jason Wang
^ permalink raw reply
* [RFC v2 PATCH 1/4] announce self after vm start
From: Jason Wang @ 2011-10-22 5:38 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
In-Reply-To: <20111022053540.21526.61249.stgit@dhcp-8-146.nay.redhat.com>
We send gratituous packets to let switch to update its mac address
table, this is only done after migration currently because guest may
move to the host with another port connect to switch.
Unfortunately this kind of notification is also needed for continue a
stopped vm as the mac address table entry may not existed because of
aging. This patch solve this by call qemu_announce_self() in
vm_start() instead of in process_incoming_migration(). Through this,
gratituous packets were sent each time when vm starts.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
migration.c | 1 -
vl.c | 1 +
2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/migration.c b/migration.c
index 77a51ad..3326b02 100644
--- a/migration.c
+++ b/migration.c
@@ -67,7 +67,6 @@ void process_incoming_migration(QEMUFile *f)
fprintf(stderr, "load of migration failed\n");
exit(0);
}
- qemu_announce_self();
DPRINTF("successfully loaded vm state\n");
if (autostart) {
diff --git a/vl.c b/vl.c
index dbf7778..e4408e0 100644
--- a/vl.c
+++ b/vl.c
@@ -1262,6 +1262,7 @@ void vm_start(void)
vm_state_notify(1, RUN_STATE_RUNNING);
resume_all_vcpus();
monitor_protocol_event(QEVENT_RESUME, NULL);
+ qemu_announce_self();
}
}
^ permalink raw reply related
* [Qemu-devel] [RFC v2 PATCH 1/4] announce self after vm start
From: Jason Wang @ 2011-10-22 5:38 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
In-Reply-To: <20111022053540.21526.61249.stgit@dhcp-8-146.nay.redhat.com>
We send gratituous packets to let switch to update its mac address
table, this is only done after migration currently because guest may
move to the host with another port connect to switch.
Unfortunately this kind of notification is also needed for continue a
stopped vm as the mac address table entry may not existed because of
aging. This patch solve this by call qemu_announce_self() in
vm_start() instead of in process_incoming_migration(). Through this,
gratituous packets were sent each time when vm starts.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
migration.c | 1 -
vl.c | 1 +
2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/migration.c b/migration.c
index 77a51ad..3326b02 100644
--- a/migration.c
+++ b/migration.c
@@ -67,7 +67,6 @@ void process_incoming_migration(QEMUFile *f)
fprintf(stderr, "load of migration failed\n");
exit(0);
}
- qemu_announce_self();
DPRINTF("successfully loaded vm state\n");
if (autostart) {
diff --git a/vl.c b/vl.c
index dbf7778..e4408e0 100644
--- a/vl.c
+++ b/vl.c
@@ -1262,6 +1262,7 @@ void vm_start(void)
vm_state_notify(1, RUN_STATE_RUNNING);
resume_all_vcpus();
monitor_protocol_event(QEVENT_RESUME, NULL);
+ qemu_announce_self();
}
}
^ permalink raw reply related
* [Qemu-devel] [RFC v2 PATCH 2/4] net: export announce_self_create()
From: Jason Wang @ 2011-10-22 5:38 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
In-Reply-To: <20111022053540.21526.61249.stgit@dhcp-8-146.nay.redhat.com>
Export and move announce_self_create() to net.c in order to be used by model
specific announcing function.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net.c | 31 +++++++++++++++++++++++++++++++
net.h | 1 +
savevm.c | 32 --------------------------------
3 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/net.c b/net.c
index d05930c..516ff9e 100644
--- a/net.c
+++ b/net.c
@@ -42,6 +42,37 @@ static QTAILQ_HEAD(, VLANClientState) non_vlan_clients;
int default_net = 1;
+#ifndef ETH_P_RARP
+#define ETH_P_RARP 0x8035
+#endif
+#define ARP_HTYPE_ETH 0x0001
+#define ARP_PTYPE_IP 0x0800
+#define ARP_OP_REQUEST_REV 0x3
+
+int announce_self_create(uint8_t *buf, uint8_t *mac_addr)
+{
+ /* Ethernet header. */
+ memset(buf, 0xff, 6); /* destination MAC addr */
+ memcpy(buf + 6, mac_addr, 6); /* source MAC addr */
+ *(uint16_t *)(buf + 12) = htons(ETH_P_RARP); /* ethertype */
+
+ /* RARP header. */
+ *(uint16_t *)(buf + 14) = htons(ARP_HTYPE_ETH); /* hardware addr space */
+ *(uint16_t *)(buf + 16) = htons(ARP_PTYPE_IP); /* protocol addr space */
+ *(buf + 18) = 6; /* hardware addr length (ethernet) */
+ *(buf + 19) = 4; /* protocol addr length (IPv4) */
+ *(uint16_t *)(buf + 20) = htons(ARP_OP_REQUEST_REV); /* opcode */
+ memcpy(buf + 22, mac_addr, 6); /* source hw addr */
+ memset(buf + 28, 0x00, 4); /* source protocol addr */
+ memcpy(buf + 32, mac_addr, 6); /* target hw addr */
+ memset(buf + 38, 0x00, 4); /* target protocol addr */
+
+ /* Padding to get up to 60 bytes (ethernet min packet size, minus FCS). */
+ memset(buf + 42, 0x00, 18);
+
+ return 60; /* len (FCS will be added by hardware) */
+}
+
/***********************************************************/
/* network device redirectors */
diff --git a/net.h b/net.h
index 9f633f8..4943d4b 100644
--- a/net.h
+++ b/net.h
@@ -178,5 +178,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
int net_handle_fd_param(Monitor *mon, const char *param);
+int announce_self_create(uint8_t *buf, uint8_t *mac_addr);
#endif
diff --git a/savevm.c b/savevm.c
index bf4d0e7..8293ee6 100644
--- a/savevm.c
+++ b/savevm.c
@@ -85,38 +85,6 @@
#define SELF_ANNOUNCE_ROUNDS 5
-#ifndef ETH_P_RARP
-#define ETH_P_RARP 0x8035
-#endif
-#define ARP_HTYPE_ETH 0x0001
-#define ARP_PTYPE_IP 0x0800
-#define ARP_OP_REQUEST_REV 0x3
-
-static int announce_self_create(uint8_t *buf,
- uint8_t *mac_addr)
-{
- /* Ethernet header. */
- memset(buf, 0xff, 6); /* destination MAC addr */
- memcpy(buf + 6, mac_addr, 6); /* source MAC addr */
- *(uint16_t *)(buf + 12) = htons(ETH_P_RARP); /* ethertype */
-
- /* RARP header. */
- *(uint16_t *)(buf + 14) = htons(ARP_HTYPE_ETH); /* hardware addr space */
- *(uint16_t *)(buf + 16) = htons(ARP_PTYPE_IP); /* protocol addr space */
- *(buf + 18) = 6; /* hardware addr length (ethernet) */
- *(buf + 19) = 4; /* protocol addr length (IPv4) */
- *(uint16_t *)(buf + 20) = htons(ARP_OP_REQUEST_REV); /* opcode */
- memcpy(buf + 22, mac_addr, 6); /* source hw addr */
- memset(buf + 28, 0x00, 4); /* source protocol addr */
- memcpy(buf + 32, mac_addr, 6); /* target hw addr */
- memset(buf + 38, 0x00, 4); /* target protocol addr */
-
- /* Padding to get up to 60 bytes (ethernet min packet size, minus FCS). */
- memset(buf + 42, 0x00, 18);
-
- return 60; /* len (FCS will be added by hardware) */
-}
-
static void qemu_announce_self_iter(NICState *nic, void *opaque)
{
uint8_t buf[60];
^ permalink raw reply related
* [RFC v2 PATCH 2/4] net: export announce_self_create()
From: Jason Wang @ 2011-10-22 5:38 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
In-Reply-To: <20111022053540.21526.61249.stgit@dhcp-8-146.nay.redhat.com>
Export and move announce_self_create() to net.c in order to be used by model
specific announcing function.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net.c | 31 +++++++++++++++++++++++++++++++
net.h | 1 +
savevm.c | 32 --------------------------------
3 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/net.c b/net.c
index d05930c..516ff9e 100644
--- a/net.c
+++ b/net.c
@@ -42,6 +42,37 @@ static QTAILQ_HEAD(, VLANClientState) non_vlan_clients;
int default_net = 1;
+#ifndef ETH_P_RARP
+#define ETH_P_RARP 0x8035
+#endif
+#define ARP_HTYPE_ETH 0x0001
+#define ARP_PTYPE_IP 0x0800
+#define ARP_OP_REQUEST_REV 0x3
+
+int announce_self_create(uint8_t *buf, uint8_t *mac_addr)
+{
+ /* Ethernet header. */
+ memset(buf, 0xff, 6); /* destination MAC addr */
+ memcpy(buf + 6, mac_addr, 6); /* source MAC addr */
+ *(uint16_t *)(buf + 12) = htons(ETH_P_RARP); /* ethertype */
+
+ /* RARP header. */
+ *(uint16_t *)(buf + 14) = htons(ARP_HTYPE_ETH); /* hardware addr space */
+ *(uint16_t *)(buf + 16) = htons(ARP_PTYPE_IP); /* protocol addr space */
+ *(buf + 18) = 6; /* hardware addr length (ethernet) */
+ *(buf + 19) = 4; /* protocol addr length (IPv4) */
+ *(uint16_t *)(buf + 20) = htons(ARP_OP_REQUEST_REV); /* opcode */
+ memcpy(buf + 22, mac_addr, 6); /* source hw addr */
+ memset(buf + 28, 0x00, 4); /* source protocol addr */
+ memcpy(buf + 32, mac_addr, 6); /* target hw addr */
+ memset(buf + 38, 0x00, 4); /* target protocol addr */
+
+ /* Padding to get up to 60 bytes (ethernet min packet size, minus FCS). */
+ memset(buf + 42, 0x00, 18);
+
+ return 60; /* len (FCS will be added by hardware) */
+}
+
/***********************************************************/
/* network device redirectors */
diff --git a/net.h b/net.h
index 9f633f8..4943d4b 100644
--- a/net.h
+++ b/net.h
@@ -178,5 +178,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
int net_handle_fd_param(Monitor *mon, const char *param);
+int announce_self_create(uint8_t *buf, uint8_t *mac_addr);
#endif
diff --git a/savevm.c b/savevm.c
index bf4d0e7..8293ee6 100644
--- a/savevm.c
+++ b/savevm.c
@@ -85,38 +85,6 @@
#define SELF_ANNOUNCE_ROUNDS 5
-#ifndef ETH_P_RARP
-#define ETH_P_RARP 0x8035
-#endif
-#define ARP_HTYPE_ETH 0x0001
-#define ARP_PTYPE_IP 0x0800
-#define ARP_OP_REQUEST_REV 0x3
-
-static int announce_self_create(uint8_t *buf,
- uint8_t *mac_addr)
-{
- /* Ethernet header. */
- memset(buf, 0xff, 6); /* destination MAC addr */
- memcpy(buf + 6, mac_addr, 6); /* source MAC addr */
- *(uint16_t *)(buf + 12) = htons(ETH_P_RARP); /* ethertype */
-
- /* RARP header. */
- *(uint16_t *)(buf + 14) = htons(ARP_HTYPE_ETH); /* hardware addr space */
- *(uint16_t *)(buf + 16) = htons(ARP_PTYPE_IP); /* protocol addr space */
- *(buf + 18) = 6; /* hardware addr length (ethernet) */
- *(buf + 19) = 4; /* protocol addr length (IPv4) */
- *(uint16_t *)(buf + 20) = htons(ARP_OP_REQUEST_REV); /* opcode */
- memcpy(buf + 22, mac_addr, 6); /* source hw addr */
- memset(buf + 28, 0x00, 4); /* source protocol addr */
- memcpy(buf + 32, mac_addr, 6); /* target hw addr */
- memset(buf + 38, 0x00, 4); /* target protocol addr */
-
- /* Padding to get up to 60 bytes (ethernet min packet size, minus FCS). */
- memset(buf + 42, 0x00, 18);
-
- return 60; /* len (FCS will be added by hardware) */
-}
-
static void qemu_announce_self_iter(NICState *nic, void *opaque)
{
uint8_t buf[60];
^ permalink raw reply related
* [RFC v2 PATCH 3/4] net: model specific announcing support
From: Jason Wang @ 2011-10-22 5:38 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
In-Reply-To: <20111022053540.21526.61249.stgit@dhcp-8-146.nay.redhat.com>
This patch introduce a function pointer in NetClientInfo which is
called during self announcement to do the model specific announcement
such as sending gratuitous packet. Previous method is kept when model
specific announcing fails or without it.
The first user would be virtio-net.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net.h | 2 ++
savevm.c | 8 +++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/net.h b/net.h
index 4943d4b..1845f01 100644
--- a/net.h
+++ b/net.h
@@ -46,6 +46,7 @@ typedef ssize_t (NetReceive)(VLANClientState *, const uint8_t *, size_t);
typedef ssize_t (NetReceiveIOV)(VLANClientState *, const struct iovec *, int);
typedef void (NetCleanup) (VLANClientState *);
typedef void (LinkStatusChanged)(VLANClientState *);
+typedef int (NetAnnounce)(VLANClientState *);
typedef struct NetClientInfo {
net_client_type type;
@@ -57,6 +58,7 @@ typedef struct NetClientInfo {
NetCleanup *cleanup;
LinkStatusChanged *link_status_changed;
NetPoll *poll;
+ NetAnnounce *announce;
} NetClientInfo;
struct VLANClientState {
diff --git a/savevm.c b/savevm.c
index 8293ee6..de6a01a 100644
--- a/savevm.c
+++ b/savevm.c
@@ -89,10 +89,12 @@ static void qemu_announce_self_iter(NICState *nic, void *opaque)
{
uint8_t buf[60];
int len;
+ NetAnnounce *func = nic->nc.info->announce;
- len = announce_self_create(buf, nic->conf->macaddr.a);
-
- qemu_send_packet_raw(&nic->nc, buf, len);
+ if (func == NULL || func(&nic->nc) != 0) {
+ len = announce_self_create(buf, nic->conf->macaddr.a);
+ qemu_send_packet_raw(&nic->nc, buf, len);
+ }
}
^ permalink raw reply related
* [Qemu-devel] [RFC v2 PATCH 3/4] net: model specific announcing support
From: Jason Wang @ 2011-10-22 5:38 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
In-Reply-To: <20111022053540.21526.61249.stgit@dhcp-8-146.nay.redhat.com>
This patch introduce a function pointer in NetClientInfo which is
called during self announcement to do the model specific announcement
such as sending gratuitous packet. Previous method is kept when model
specific announcing fails or without it.
The first user would be virtio-net.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net.h | 2 ++
savevm.c | 8 +++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/net.h b/net.h
index 4943d4b..1845f01 100644
--- a/net.h
+++ b/net.h
@@ -46,6 +46,7 @@ typedef ssize_t (NetReceive)(VLANClientState *, const uint8_t *, size_t);
typedef ssize_t (NetReceiveIOV)(VLANClientState *, const struct iovec *, int);
typedef void (NetCleanup) (VLANClientState *);
typedef void (LinkStatusChanged)(VLANClientState *);
+typedef int (NetAnnounce)(VLANClientState *);
typedef struct NetClientInfo {
net_client_type type;
@@ -57,6 +58,7 @@ typedef struct NetClientInfo {
NetCleanup *cleanup;
LinkStatusChanged *link_status_changed;
NetPoll *poll;
+ NetAnnounce *announce;
} NetClientInfo;
struct VLANClientState {
diff --git a/savevm.c b/savevm.c
index 8293ee6..de6a01a 100644
--- a/savevm.c
+++ b/savevm.c
@@ -89,10 +89,12 @@ static void qemu_announce_self_iter(NICState *nic, void *opaque)
{
uint8_t buf[60];
int len;
+ NetAnnounce *func = nic->nc.info->announce;
- len = announce_self_create(buf, nic->conf->macaddr.a);
-
- qemu_send_packet_raw(&nic->nc, buf, len);
+ if (func == NULL || func(&nic->nc) != 0) {
+ len = announce_self_create(buf, nic->conf->macaddr.a);
+ qemu_send_packet_raw(&nic->nc, buf, len);
+ }
}
^ permalink raw reply related
* [Qemu-devel] [RFC v2 PATCH 4/4] virtio-net: notify guest to annouce itself
From: Jason Wang @ 2011-10-22 5:39 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
In-Reply-To: <20111022053540.21526.61249.stgit@dhcp-8-146.nay.redhat.com>
It's hard to track all mac address and its usage (vlan, bondings,
ipv6) in qemu to send gratituous packet in qemu side, so the better
choice is let guest do it.
The patch introduces a new rw config status bit of virtio-net,
VIRTIO_NET_S_ANNOUNCE which is used to notify guest to announce itself
( such as sending gratituous packets ) through config update
interrupt. When gust have done the annoucement, it should clear that
bit.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/virtio-net.c | 20 +++++++++++++++++++-
hw/virtio-net.h | 2 ++
2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 8c2f460..7f844e7 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -95,6 +95,10 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
memcpy(n->mac, netcfg.mac, ETH_ALEN);
qemu_format_nic_info_str(&n->nic->nc, n->mac);
}
+
+ if (memcmp(&netcfg.status, &n->status, sizeof(n->status))) {
+ memcpy(&n->status, &netcfg.status, sizeof(n->status));
+ }
}
static bool virtio_net_started(VirtIONet *n, uint8_t status)
@@ -227,7 +231,7 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features)
{
VirtIONet *n = to_virtio_net(vdev);
- features |= (1 << VIRTIO_NET_F_MAC);
+ features |= (1 << VIRTIO_NET_F_MAC | 1 << VIRTIO_NET_F_GUEST_ANNOUNCE);
if (peer_has_vnet_hdr(n)) {
tap_using_vnet_hdr(n->nic->nc.peer, 1);
@@ -983,6 +987,19 @@ static void virtio_net_cleanup(VLANClientState *nc)
n->nic = NULL;
}
+static int virtio_net_announce(VLANClientState *nc)
+{
+ VirtIONet *n = DO_UPCAST(NICState, nc, nc)->opaque;
+
+ if (n->vdev.guest_features & (0x1 << VIRTIO_NET_F_GUEST_ANNOUNCE)) {
+ n->status |= VIRITO_NET_S_ANNOUNCE;
+ virtio_notify_config(&n->vdev);
+ return 0;
+ }
+
+ return 1;
+}
+
static NetClientInfo net_virtio_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
@@ -990,6 +1007,7 @@ static NetClientInfo net_virtio_info = {
.receive = virtio_net_receive,
.cleanup = virtio_net_cleanup,
.link_status_changed = virtio_net_set_link_status,
+ .announce = virtio_net_announce,
};
VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf,
diff --git a/hw/virtio-net.h b/hw/virtio-net.h
index 4468741..c47bd52 100644
--- a/hw/virtio-net.h
+++ b/hw/virtio-net.h
@@ -44,8 +44,10 @@
#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
+#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce itself */
#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
+#define VIRITO_NET_S_ANNOUNCE 2 /* Announcement is needed */
#define TX_TIMER_INTERVAL 150000 /* 150 us */
^ permalink raw reply related
* [RFC v2 PATCH 4/4] virtio-net: notify guest to annouce itself
From: Jason Wang @ 2011-10-22 5:39 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
In-Reply-To: <20111022053540.21526.61249.stgit@dhcp-8-146.nay.redhat.com>
It's hard to track all mac address and its usage (vlan, bondings,
ipv6) in qemu to send gratituous packet in qemu side, so the better
choice is let guest do it.
The patch introduces a new rw config status bit of virtio-net,
VIRTIO_NET_S_ANNOUNCE which is used to notify guest to announce itself
( such as sending gratituous packets ) through config update
interrupt. When gust have done the annoucement, it should clear that
bit.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/virtio-net.c | 20 +++++++++++++++++++-
hw/virtio-net.h | 2 ++
2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 8c2f460..7f844e7 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -95,6 +95,10 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
memcpy(n->mac, netcfg.mac, ETH_ALEN);
qemu_format_nic_info_str(&n->nic->nc, n->mac);
}
+
+ if (memcmp(&netcfg.status, &n->status, sizeof(n->status))) {
+ memcpy(&n->status, &netcfg.status, sizeof(n->status));
+ }
}
static bool virtio_net_started(VirtIONet *n, uint8_t status)
@@ -227,7 +231,7 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features)
{
VirtIONet *n = to_virtio_net(vdev);
- features |= (1 << VIRTIO_NET_F_MAC);
+ features |= (1 << VIRTIO_NET_F_MAC | 1 << VIRTIO_NET_F_GUEST_ANNOUNCE);
if (peer_has_vnet_hdr(n)) {
tap_using_vnet_hdr(n->nic->nc.peer, 1);
@@ -983,6 +987,19 @@ static void virtio_net_cleanup(VLANClientState *nc)
n->nic = NULL;
}
+static int virtio_net_announce(VLANClientState *nc)
+{
+ VirtIONet *n = DO_UPCAST(NICState, nc, nc)->opaque;
+
+ if (n->vdev.guest_features & (0x1 << VIRTIO_NET_F_GUEST_ANNOUNCE)) {
+ n->status |= VIRITO_NET_S_ANNOUNCE;
+ virtio_notify_config(&n->vdev);
+ return 0;
+ }
+
+ return 1;
+}
+
static NetClientInfo net_virtio_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
@@ -990,6 +1007,7 @@ static NetClientInfo net_virtio_info = {
.receive = virtio_net_receive,
.cleanup = virtio_net_cleanup,
.link_status_changed = virtio_net_set_link_status,
+ .announce = virtio_net_announce,
};
VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf,
diff --git a/hw/virtio-net.h b/hw/virtio-net.h
index 4468741..c47bd52 100644
--- a/hw/virtio-net.h
+++ b/hw/virtio-net.h
@@ -44,8 +44,10 @@
#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
+#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce itself */
#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
+#define VIRITO_NET_S_ANNOUNCE 2 /* Announcement is needed */
#define TX_TIMER_INTERVAL 150000 /* 150 us */
^ permalink raw reply related
* Re: [PATCH 0/7] writeback: avoid touching dirtied_when on blocked inodes
From: Wu Fengguang @ 2011-10-22 5:38 UTC (permalink / raw)
To: Jan Kara
Cc: linux-fsdevel@vger.kernel.org, Dave Chinner, Christoph Hellwig,
Andrew Morton, LKML
In-Reply-To: <20111022031135.GA4823@localhost>
On Sat, Oct 22, 2011 at 11:11:35AM +0800, Wu Fengguang wrote:
> > > btw, with the I_SYNC case converted, it's actually no longer necessary
> > > to keep a standalone b_more_io_wait. It should still be better to keep
> > > the list and the above error check for catching possible errors and
> > > the flexibility of adding policies like "don't retry possible blocked
> > > inodes in N seconds as long as there are other inodes to work with".
> > >
> > > The below diff only intends to show the _possibility_ to remove
> > > b_more_io_wait:
> > Good observation. So should we introduce b_more_io_wait in the end? We
> > could always introduce it when the need for some more complicated policy
> > comes...
> >
>
> I have no problem removing it if you liked it more. Anyway, let me
> test the idea out first (just kicked off the tests).
When removing b_more_io_wait, performance is slightly dropped
comparing to the full more_io_wait patchset.
3.1.0-rc9-ioless-full-more_io_wait-next-20111014+ 3.1.0-rc9-ioless-full-more_io_wait-x-next-20111014+
------------------------ ------------------------
45.30 +6.3% 48.14 thresh=1G/ext3-1dd-4k-8p-4096M-1024M:10-X
48.23 -2.0% 47.27 thresh=1G/ext4-100dd-4k-8p-4096M-1024M:10-X
54.21 -2.6% 52.80 thresh=1G/ext4-10dd-4k-8p-4096M-1024M:10-X
56.07 -0.3% 55.91 thresh=1G/ext4-1dd-4k-8p-4096M-1024M:10-X
45.12 -5.8% 42.49 thresh=1G/xfs-100dd-4k-8p-4096M-1024M:10-X
53.94 -1.2% 53.27 thresh=1G/xfs-10dd-4k-8p-4096M-1024M:10-X
55.66 -0.1% 55.63 thresh=1G/xfs-1dd-4k-8p-4096M-1024M:10-X
358.53 -0.8% 355.51 TOTAL write_bw
I'll try to reduce the changes and retest.
In general it looks better we first root case the "decreasing wrote
pages by writeback_single_inode() over time" problem before looking
into further steps..
Thanks,
Fengguang
^ permalink raw reply
* [RFC v2 PATCH 5/4 PATCH] virtio-net: send gratuitous packet when needed
From: Jason Wang @ 2011-10-22 5:43 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
This make let virtio-net driver can send gratituous packet by a new
config bit - VIRTIO_NET_S_ANNOUNCE in each config update
interrupt. When this bit is set by backend, the driver would schedule
a workqueue to send gratituous packet through NETDEV_NOTIFY_PEERS.
This feature is negotiated through bit VIRTIO_NET_F_GUEST_ANNOUNCE.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/virtio_net.c | 31 ++++++++++++++++++++++++++++++-
include/linux/virtio_net.h | 2 ++
2 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b8225f3..1cdecf7 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -71,6 +71,9 @@ struct virtnet_info {
/* Work struct for refilling if we run low on memory. */
struct delayed_work refill;
+ /* Work struct for send gratituous packet. */
+ struct work_struct announce;
+
/* Chain pages by the private ptr. */
struct page *pages;
@@ -507,6 +510,13 @@ static void refill_work(struct work_struct *work)
schedule_delayed_work(&vi->refill, HZ/2);
}
+static void announce_work(struct work_struct *work)
+{
+ struct virtnet_info *vi = container_of(work, struct virtnet_info,
+ announce);
+ netif_notify_peers(vi->dev);
+}
+
static int virtnet_poll(struct napi_struct *napi, int budget)
{
struct virtnet_info *vi = container_of(napi, struct virtnet_info, napi);
@@ -923,11 +933,22 @@ static void virtnet_update_status(struct virtnet_info *vi)
&v, sizeof(v));
/* Ignore unknown (future) status bits */
- v &= VIRTIO_NET_S_LINK_UP;
+ v &= VIRTIO_NET_S_LINK_UP | VIRTIO_NET_S_ANNOUNCE;
if (vi->status == v)
return;
+ if (v & VIRTIO_NET_S_ANNOUNCE) {
+ if ((v & VIRTIO_NET_S_LINK_UP) &&
+ virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE))
+ schedule_work(&vi->announce);
+ v &= ~VIRTIO_NET_S_ANNOUNCE;
+ vi->vdev->config->set(vi->vdev,
+ offsetof(struct virtio_net_config,
+ status),
+ &v, sizeof(v));
+ }
+
vi->status = v;
if (vi->status & VIRTIO_NET_S_LINK_UP) {
@@ -937,6 +958,7 @@ static void virtnet_update_status(struct virtnet_info *vi)
netif_carrier_off(vi->dev);
netif_stop_queue(vi->dev);
}
+
}
static void virtnet_config_changed(struct virtio_device *vdev)
@@ -1016,6 +1038,8 @@ static int virtnet_probe(struct virtio_device *vdev)
goto free;
INIT_DELAYED_WORK(&vi->refill, refill_work);
+ if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ANNOUNCE))
+ INIT_WORK(&vi->announce, announce_work);
sg_init_table(vi->rx_sg, ARRAY_SIZE(vi->rx_sg));
sg_init_table(vi->tx_sg, ARRAY_SIZE(vi->tx_sg));
@@ -1077,6 +1101,8 @@ static int virtnet_probe(struct virtio_device *vdev)
unregister:
unregister_netdev(dev);
cancel_delayed_work_sync(&vi->refill);
+ if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE))
+ cancel_work_sync(&vi->announce);
free_vqs:
vdev->config->del_vqs(vdev);
free_stats:
@@ -1118,6 +1144,8 @@ static void __devexit virtnet_remove(struct virtio_device *vdev)
unregister_netdev(vi->dev);
cancel_delayed_work_sync(&vi->refill);
+ if(virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE))
+ cancel_work_sync(&vi->announce);
/* Free unused buffers in both send and recv, if any. */
free_unused_bufs(vi);
@@ -1144,6 +1172,7 @@ static unsigned int features[] = {
VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO,
VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ,
VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN,
+ VIRTIO_NET_F_GUEST_ANNOUNCE,
};
static struct virtio_driver virtio_net_driver = {
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 970d5a2..44a38d6 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -49,8 +49,10 @@
#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
+#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can send gratituous packet */
#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
+#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
struct virtio_net_config {
/* The config defining mac address (if VIRTIO_NET_F_MAC) */
^ permalink raw reply related
* [Qemu-devel] [RFC v2 PATCH 5/4 PATCH] virtio-net: send gratuitous packet when needed
From: Jason Wang @ 2011-10-22 5:43 UTC (permalink / raw)
To: aliguori, quintela, jan.kiszka, mst, qemu-devel, blauwirbel
Cc: pbonzini, rusty, kvm, netdev
This make let virtio-net driver can send gratituous packet by a new
config bit - VIRTIO_NET_S_ANNOUNCE in each config update
interrupt. When this bit is set by backend, the driver would schedule
a workqueue to send gratituous packet through NETDEV_NOTIFY_PEERS.
This feature is negotiated through bit VIRTIO_NET_F_GUEST_ANNOUNCE.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/virtio_net.c | 31 ++++++++++++++++++++++++++++++-
include/linux/virtio_net.h | 2 ++
2 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b8225f3..1cdecf7 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -71,6 +71,9 @@ struct virtnet_info {
/* Work struct for refilling if we run low on memory. */
struct delayed_work refill;
+ /* Work struct for send gratituous packet. */
+ struct work_struct announce;
+
/* Chain pages by the private ptr. */
struct page *pages;
@@ -507,6 +510,13 @@ static void refill_work(struct work_struct *work)
schedule_delayed_work(&vi->refill, HZ/2);
}
+static void announce_work(struct work_struct *work)
+{
+ struct virtnet_info *vi = container_of(work, struct virtnet_info,
+ announce);
+ netif_notify_peers(vi->dev);
+}
+
static int virtnet_poll(struct napi_struct *napi, int budget)
{
struct virtnet_info *vi = container_of(napi, struct virtnet_info, napi);
@@ -923,11 +933,22 @@ static void virtnet_update_status(struct virtnet_info *vi)
&v, sizeof(v));
/* Ignore unknown (future) status bits */
- v &= VIRTIO_NET_S_LINK_UP;
+ v &= VIRTIO_NET_S_LINK_UP | VIRTIO_NET_S_ANNOUNCE;
if (vi->status == v)
return;
+ if (v & VIRTIO_NET_S_ANNOUNCE) {
+ if ((v & VIRTIO_NET_S_LINK_UP) &&
+ virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE))
+ schedule_work(&vi->announce);
+ v &= ~VIRTIO_NET_S_ANNOUNCE;
+ vi->vdev->config->set(vi->vdev,
+ offsetof(struct virtio_net_config,
+ status),
+ &v, sizeof(v));
+ }
+
vi->status = v;
if (vi->status & VIRTIO_NET_S_LINK_UP) {
@@ -937,6 +958,7 @@ static void virtnet_update_status(struct virtnet_info *vi)
netif_carrier_off(vi->dev);
netif_stop_queue(vi->dev);
}
+
}
static void virtnet_config_changed(struct virtio_device *vdev)
@@ -1016,6 +1038,8 @@ static int virtnet_probe(struct virtio_device *vdev)
goto free;
INIT_DELAYED_WORK(&vi->refill, refill_work);
+ if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ANNOUNCE))
+ INIT_WORK(&vi->announce, announce_work);
sg_init_table(vi->rx_sg, ARRAY_SIZE(vi->rx_sg));
sg_init_table(vi->tx_sg, ARRAY_SIZE(vi->tx_sg));
@@ -1077,6 +1101,8 @@ static int virtnet_probe(struct virtio_device *vdev)
unregister:
unregister_netdev(dev);
cancel_delayed_work_sync(&vi->refill);
+ if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE))
+ cancel_work_sync(&vi->announce);
free_vqs:
vdev->config->del_vqs(vdev);
free_stats:
@@ -1118,6 +1144,8 @@ static void __devexit virtnet_remove(struct virtio_device *vdev)
unregister_netdev(vi->dev);
cancel_delayed_work_sync(&vi->refill);
+ if(virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE))
+ cancel_work_sync(&vi->announce);
/* Free unused buffers in both send and recv, if any. */
free_unused_bufs(vi);
@@ -1144,6 +1172,7 @@ static unsigned int features[] = {
VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO,
VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ,
VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN,
+ VIRTIO_NET_F_GUEST_ANNOUNCE,
};
static struct virtio_driver virtio_net_driver = {
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 970d5a2..44a38d6 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -49,8 +49,10 @@
#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
+#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can send gratituous packet */
#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
+#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
struct virtio_net_config {
/* The config defining mac address (if VIRTIO_NET_F_MAC) */
^ permalink raw reply related
* [Qemu-devel] buildbot failure in qemu on ppc-next_i386_debian_6_0
From: qemu @ 2011-10-22 6:03 UTC (permalink / raw)
To: agraf, gollub, lcapitulino, qemu-devel
The Buildbot has detected a new failure on builder ppc-next_i386_debian_6_0 while building qemu.
Full details are available at:
http://buildbot.b1-systems.de/qemu/builders/ppc-next_i386_debian_6_0/builds/68
Buildbot URL: http://buildbot.b1-systems.de/qemu/
Buildslave for this Build: yuzuki
Build Reason: The Nightly scheduler named 'nightly_ppc-next' triggered this build
Build Source Stamp: [branch ppc-next] HEAD
Blamelist:
BUILD FAILED: failed configure
sincerely,
-The Buildbot
^ permalink raw reply
* [PATCH 00/36] Staging: cx25821: Clean up patch series
From: Leonid V. Fedorenchik @ 2011-10-22 5:43 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Mauro Carvalho Chehab, Namhyung Kim, Palash Bandyopadhyay,
Joe Perches, Ilia Mirkin, Youquan Song, Leonid V. Fedorenchik,
devel, linux-kernel
This patch series fixes some style issues in drivers/staging/cx25821
Mostly I was hoping to improve readability and fix some issues found by
checkpatch.pl script.
There is one question, however, in patch no. 18:
I deleted part of the comment that contradicts to the code and in this
case maybe I should edit the code to match the comment instead. I am not
sure if in this case it makes sense to check if width > 0.
Leonid V. Fedorenchik (36):
Staging: cx25821: cx25821-alsa.c: Line up comments
Staging: cx25821: cx25821-alsa.c: Add braces to else clause
Staging: cx25821: cx25821-alsa.c: Fix indent
Staging: cx25821: cx25821-alsa.c: Change line endings
Staging: cx25821: cx25821-audio-upstream.c: Fix indent
Staging: cx25821: cx25821-audio-upstream.c: Move operators
Staging: cx25821: cx25821-audio-upstream.c: Change line endings
Staging: cx25821: cx25821-audio.h: Line up defines
Staging: cx25821: cx25821-audio.h: Fix multiline defines
Staging: cx25821: cx25821-cards.c: Fix indent
Staging: cx25821: cx25821-core.c: Delete empty line
Staging: cx25821: cx25821-core.c: Fix indent
Staging: cx25821: cx25821-core.c: Change line endings
Staging: cx25821: cx25821-i2c.c: Change line endings
Staging: cx25821: cx25821-medusa-defines.h: Fix typo
Staging: cx25821: cx25821-medusa-defines.h: Line up defines
Staging: cx25821: cx25821-medusa-reg.h: Line up defines
Staging: cx25821: cx25821-medusa-video.c: Fix comment
Staging: cx25821: cx25821-medusa-video.c: Move operators
Staging: cx25821: cx25821-medusa-video.c: Change line endings
Staging: cx25821: cx25821-video-upstream-ch2.c: Line up comments
Staging: cx25821: cx25821-video-upstream-ch2.c: Fix indent
Staging: cx25821: cx25821-video-upsstream-ch2.c: Move operators
Staging: cx25821: cx25821-video-upstream-ch2.c: Remove braces
Staging: cx25821: cx25821-video-upstream-ch2.c: Change line endings
Staging: cx25821: cx25821-video-upstream.c: Remove braces
Staging: cx25821: cx25821-video-upstream.c: Fix indent
Staging: cx25821: cx25821-video-upstream.c: Change line endings
Staging: cx25821: cx25821-video.c: Delete empty line
Staging: cx25821: cx25821-video.c: Change spaces
Staging: cx25821: cx25821-video.c: Fix assignment
Staging: cx25821: cx25821-video.c: Fix definitions
Staging: cx25821: cx25821-video.c: Move operators
Staging: cx25821: cx25821-video.c: Fix indent
Staging: cx25821: cx25821-video.c: Change line endings
Staging: cx25821: cx25821.h: Line up defines
drivers/staging/cx25821/cx25821-alsa.c | 73 ++--
drivers/staging/cx25821/cx25821-audio-upstream.c | 102 ++--
drivers/staging/cx25821/cx25821-audio.h | 39 +-
drivers/staging/cx25821/cx25821-cards.c | 2 +-
drivers/staging/cx25821/cx25821-core.c | 57 +--
drivers/staging/cx25821/cx25821-i2c.c | 10 +-
drivers/staging/cx25821/cx25821-medusa-defines.h | 6 +-
drivers/staging/cx25821/cx25821-medusa-reg.h | 518 ++++++++++----------
drivers/staging/cx25821/cx25821-medusa-video.c | 410 ++++++----------
.../staging/cx25821/cx25821-video-upstream-ch2.c | 126 ++---
drivers/staging/cx25821/cx25821-video-upstream.c | 146 +++----
drivers/staging/cx25821/cx25821-video.c | 145 +++---
drivers/staging/cx25821/cx25821.h | 4 +-
13 files changed, 745 insertions(+), 893 deletions(-)
^ permalink raw reply
* [PATCH 01/36] Staging: cx25821: cx25821-alsa.c: Line up comments
From: Leonid V. Fedorenchik @ 2011-10-22 5:43 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Mauro Carvalho Chehab, Namhyung Kim, Palash Bandyopadhyay,
Joe Perches, Ilia Mirkin, Youquan Song, Leonid V. Fedorenchik,
devel, linux-kernel
In-Reply-To: <1319262236-6498-1-git-send-email-leonidsbox@gmail.com>
Line up comments to the same column.
Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
---
drivers/staging/cx25821/cx25821-alsa.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/cx25821/cx25821-alsa.c b/drivers/staging/cx25821/cx25821-alsa.c
index ebdba7c..8d5fdd5 100644
--- a/drivers/staging/cx25821/cx25821-alsa.c
+++ b/drivers/staging/cx25821/cx25821-alsa.c
@@ -234,15 +234,15 @@ static int _cx25821_stop_audio_dma(struct cx25821_audio_dev *chip)
*/
static char *cx25821_aud_irqs[32] = {
"dn_risci1", "up_risci1", "rds_dn_risc1", /* 0-2 */
- NULL, /* reserved */
+ NULL, /* reserved */
"dn_risci2", "up_risci2", "rds_dn_risc2", /* 4-6 */
- NULL, /* reserved */
- "dnf_of", "upf_uf", "rds_dnf_uf", /* 8-10 */
- NULL, /* reserved */
- "dn_sync", "up_sync", "rds_dn_sync", /* 12-14 */
- NULL, /* reserved */
- "opc_err", "par_err", "rip_err", /* 16-18 */
- "pci_abort", "ber_irq", "mchg_irq" /* 19-21 */
+ NULL, /* reserved */
+ "dnf_of", "upf_uf", "rds_dnf_uf", /* 8-10 */
+ NULL, /* reserved */
+ "dn_sync", "up_sync", "rds_dn_sync", /* 12-14 */
+ NULL, /* reserved */
+ "opc_err", "par_err", "rip_err", /* 16-18 */
+ "pci_abort", "ber_irq", "mchg_irq" /* 19-21 */
};
/*
--
1.7.0.4
^ permalink raw reply related
* [PATCH 02/36] Staging: cx25821: cx25821-alsa.c: Add braces to else clause
From: Leonid V. Fedorenchik @ 2011-10-22 5:43 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Mauro Carvalho Chehab, Namhyung Kim, Palash Bandyopadhyay,
Joe Perches, Ilia Mirkin, Youquan Song, Leonid V. Fedorenchik,
devel, linux-kernel
In-Reply-To: <1319262236-6498-1-git-send-email-leonidsbox@gmail.com>
Add curly braces around else clause because corresponding if has them.
Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
---
drivers/staging/cx25821/cx25821-alsa.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/cx25821/cx25821-alsa.c b/drivers/staging/cx25821/cx25821-alsa.c
index 8d5fdd5..41a3b9c 100644
--- a/drivers/staging/cx25821/cx25821-alsa.c
+++ b/drivers/staging/cx25821/cx25821-alsa.c
@@ -317,8 +317,9 @@ static irqreturn_t cx25821_irq(int irq, void *dev_id)
cx25821_aud_irq(chip, audint_status,
audint_mask);
break;
- } else
+ } else {
goto out;
+ }
}
handled = 1;
--
1.7.0.4
^ permalink raw reply related
* [PATCH 03/36] Staging: cx25821: cx25821-alsa.c: Fix indent
From: Leonid V. Fedorenchik @ 2011-10-22 5:43 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Mauro Carvalho Chehab, Namhyung Kim, Palash Bandyopadhyay,
Joe Perches, Ilia Mirkin, Youquan Song, Leonid V. Fedorenchik,
devel, linux-kernel
In-Reply-To: <1319262236-6498-1-git-send-email-leonidsbox@gmail.com>
Delete unnecessary space before indented statement.
Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
---
drivers/staging/cx25821/cx25821-alsa.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/cx25821/cx25821-alsa.c b/drivers/staging/cx25821/cx25821-alsa.c
index 41a3b9c..e700365 100644
--- a/drivers/staging/cx25821/cx25821-alsa.c
+++ b/drivers/staging/cx25821/cx25821-alsa.c
@@ -687,7 +687,7 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)
}
err = snd_card_create(index[devno], id[devno], THIS_MODULE,
- sizeof(struct cx25821_audio_dev), &card);
+ sizeof(struct cx25821_audio_dev), &card);
if (err < 0) {
pr_info("DEBUG ERROR: cannot create snd_card_new in %s\n",
__func__);
--
1.7.0.4
^ permalink raw reply related
* [PATCH 04/36] Staging: cx25821: cx25821-alsa.c: Change line endings
From: Leonid V. Fedorenchik @ 2011-10-22 5:43 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Mauro Carvalho Chehab, Namhyung Kim, Palash Bandyopadhyay,
Joe Perches, Ilia Mirkin, Youquan Song, Leonid V. Fedorenchik,
devel, linux-kernel
In-Reply-To: <1319262236-6498-1-git-send-email-leonidsbox@gmail.com>
Change obscure line endings to less obscure ones. (improve readability)
Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
---
drivers/staging/cx25821/cx25821-alsa.c | 52 +++++++++++++-------------------
1 files changed, 21 insertions(+), 31 deletions(-)
diff --git a/drivers/staging/cx25821/cx25821-alsa.c b/drivers/staging/cx25821/cx25821-alsa.c
index e700365..00fda93 100644
--- a/drivers/staging/cx25821/cx25821-alsa.c
+++ b/drivers/staging/cx25821/cx25821-alsa.c
@@ -176,8 +176,7 @@ static int _cx25821_start_audio_dma(struct cx25821_audio_dev *chip)
/* Set the input mode to 16-bit */
tmp = cx_read(AUD_A_CFG);
- cx_write(AUD_A_CFG,
- tmp | FLD_AUD_DST_PK_MODE | FLD_AUD_DST_ENABLE |
+ cx_write(AUD_A_CFG, tmp | FLD_AUD_DST_PK_MODE | FLD_AUD_DST_ENABLE |
FLD_AUD_CLK_ENABLE);
/*
@@ -188,9 +187,8 @@ static int _cx25821_start_audio_dma(struct cx25821_audio_dev *chip)
*/
/* Enables corresponding bits at AUD_INT_STAT */
- cx_write(AUD_A_INT_MSK,
- FLD_AUD_DST_RISCI1 | FLD_AUD_DST_OF | FLD_AUD_DST_SYNC |
- FLD_AUD_DST_OPC_ERR);
+ cx_write(AUD_A_INT_MSK, FLD_AUD_DST_RISCI1 | FLD_AUD_DST_OF |
+ FLD_AUD_DST_SYNC | FLD_AUD_DST_OPC_ERR);
/* Clean any pending interrupt bits already set */
cx_write(AUD_A_INT_STAT, ~0);
@@ -200,8 +198,8 @@ static int _cx25821_start_audio_dma(struct cx25821_audio_dev *chip)
/* Turn on audio downstream fifo and risc enable 0x101 */
tmp = cx_read(AUD_INT_DMA_CTL);
- cx_set(AUD_INT_DMA_CTL,
- tmp | (FLD_AUD_DST_A_RISC_EN | FLD_AUD_DST_A_FIFO_EN));
+ cx_set(AUD_INT_DMA_CTL, tmp |
+ (FLD_AUD_DST_A_RISC_EN | FLD_AUD_DST_A_FIFO_EN));
mdelay(100);
return 0;
@@ -220,9 +218,8 @@ static int _cx25821_stop_audio_dma(struct cx25821_audio_dev *chip)
/* disable irqs */
cx_clear(PCI_INT_MSK, PCI_MSK_AUD_INT);
- cx_clear(AUD_A_INT_MSK,
- AUD_INT_OPC_ERR | AUD_INT_DN_SYNC | AUD_INT_DN_RISCI2 |
- AUD_INT_DN_RISCI1);
+ cx_clear(AUD_A_INT_MSK, AUD_INT_OPC_ERR | AUD_INT_DN_SYNC |
+ AUD_INT_DN_RISCI2 | AUD_INT_DN_RISCI1);
return 0;
}
@@ -258,10 +255,8 @@ static void cx25821_aud_irq(struct cx25821_audio_dev *chip, u32 status,
cx_write(AUD_A_INT_STAT, status);
if (debug > 1 || (status & mask & ~0xff))
- cx25821_print_irqbits(dev->name, "irq aud",
- cx25821_aud_irqs,
- ARRAY_SIZE(cx25821_aud_irqs), status,
- mask);
+ cx25821_print_irqbits(dev->name, "irq aud", cx25821_aud_irqs,
+ ARRAY_SIZE(cx25821_aud_irqs), status, mask);
/* risc op code error */
if (status & AUD_INT_OPC_ERR) {
@@ -270,8 +265,7 @@ static void cx25821_aud_irq(struct cx25821_audio_dev *chip, u32 status,
cx_clear(AUD_INT_DMA_CTL,
FLD_AUD_DST_A_RISC_EN | FLD_AUD_DST_A_FIFO_EN);
cx25821_sram_channel_dump_audio(dev,
- &cx25821_sram_channels
- [AUDIO_SRAM_CHANNEL]);
+ &cx25821_sram_channels[AUDIO_SRAM_CHANNEL]);
}
if (status & AUD_INT_DN_SYNC) {
pr_warn("WARNING %s: Downstream sync error!\n", dev->name);
@@ -362,9 +356,8 @@ static int dsp_buffer_free(struct cx25821_audio_dev *chip)
*/
#define DEFAULT_FIFO_SIZE 384
static struct snd_pcm_hardware snd_cx25821_digital_hw = {
- .info = SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_INTERLEAVED |
- SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID,
+ .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_48000,
@@ -397,8 +390,8 @@ static int snd_cx25821_pcm_open(struct snd_pcm_substream *substream)
return -ENODEV;
}
- err =
- snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS);
+ err = snd_pcm_hw_constraint_pow2(runtime, 0,
+ SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
goto _error;
@@ -469,8 +462,7 @@ static int snd_cx25821_hw_params(struct snd_pcm_substream *substream,
dma = &buf->dma;
videobuf_dma_init(dma);
ret = videobuf_dma_init_kernel(dma, PCI_DMA_FROMDEVICE,
- (PAGE_ALIGN(chip->dma_size) >>
- PAGE_SHIFT));
+ (PAGE_ALIGN(chip->dma_size) >> PAGE_SHIFT));
if (ret < 0)
goto error;
@@ -478,10 +470,8 @@ static int snd_cx25821_hw_params(struct snd_pcm_substream *substream,
if (ret < 0)
goto error;
- ret =
- cx25821_risc_databuffer_audio(chip->pci, &buf->risc, dma->sglist,
- chip->period_size, chip->num_periods,
- 1);
+ ret = cx25821_risc_databuffer_audio(chip->pci, &buf->risc, dma->sglist,
+ chip->period_size, chip->num_periods, 1);
if (ret < 0) {
pr_info("DEBUG: ERROR after cx25821_risc_databuffer_audio()\n");
goto error;
@@ -712,8 +702,8 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)
IRQF_SHARED | IRQF_DISABLED, chip->dev->name, chip);
if (err < 0) {
- pr_err("ERROR %s: can't get IRQ %d for ALSA\n",
- chip->dev->name, dev->pci->irq);
+ pr_err("ERROR %s: can't get IRQ %d for ALSA\n", chip->dev->name,
+ dev->pci->irq);
goto error;
}
@@ -731,8 +721,8 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)
chip->iobase, chip->irq);
strcpy(card->mixername, "CX25821");
- pr_info("%s/%i: ALSA support for cx25821 boards\n",
- card->driver, devno);
+ pr_info("%s/%i: ALSA support for cx25821 boards\n", card->driver,
+ devno);
err = snd_card_register(card);
if (err < 0) {
--
1.7.0.4
^ permalink raw reply related
* [PATCH 05/36] Staging: cx25821: cx25821-audio-upstream.c: Fix indent
From: Leonid V. Fedorenchik @ 2011-10-22 5:43 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Mauro Carvalho Chehab, Namhyung Kim, Palash Bandyopadhyay,
Joe Perches, Ilia Mirkin, Youquan Song, Leonid V. Fedorenchik,
devel, linux-kernel
In-Reply-To: <1319262236-6498-1-git-send-email-leonidsbox@gmail.com>
Change wrong indent (with spaces and less than 7 columns) of statements
to tabs.
Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
---
drivers/staging/cx25821/cx25821-audio-upstream.c | 42 +++++++++++-----------
1 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/cx25821/cx25821-audio-upstream.c b/drivers/staging/cx25821/cx25821-audio-upstream.c
index 50e56a6..d7d3a2f 100644
--- a/drivers/staging/cx25821/cx25821-audio-upstream.c
+++ b/drivers/staging/cx25821/cx25821-audio-upstream.c
@@ -107,7 +107,7 @@ static __le32 *cx25821_risc_field_upstream_audio(struct cx25821_dev *dev,
{
unsigned int line;
struct sram_channel *sram_ch =
- dev->channels[dev->_audio_upstream_channel].sram_channels;
+ dev->channels[dev->_audio_upstream_channel].sram_channels;
int offset = 0;
/* scan lines */
@@ -193,7 +193,7 @@ int cx25821_risc_buffer_upstream_audio(struct cx25821_dev *dev,
/* Recalculate virtual address based on frame index */
rp = dev->_risc_virt_addr + RISC_SYNC_INSTRUCTION_SIZE / 4 +
- (AUDIO_RISC_DMA_BUF_SIZE * (frame + 1) / 4);
+ (AUDIO_RISC_DMA_BUF_SIZE * (frame + 1) / 4);
}
return 0;
@@ -218,7 +218,7 @@ void cx25821_free_memory_audio(struct cx25821_dev *dev)
void cx25821_stop_upstream_audio(struct cx25821_dev *dev)
{
struct sram_channel *sram_ch =
- dev->channels[AUDIO_UPSTREAM_SRAM_CHANNEL_B].sram_channels;
+ dev->channels[AUDIO_UPSTREAM_SRAM_CHANNEL_B].sram_channels;
u32 tmp = 0;
if (!dev->_audio_is_running) {
@@ -286,14 +286,14 @@ int cx25821_get_audio_data(struct cx25821_dev *dev,
} else {
if (!(myfile->f_op)) {
pr_err("%s(): File has no file operations registered!\n",
- __func__);
+ __func__);
filp_close(myfile, NULL);
return -EIO;
}
if (!myfile->f_op->read) {
pr_err("%s(): File has no READ operations registered!\n",
- __func__);
+ __func__);
filp_close(myfile, NULL);
return -EIO;
}
@@ -312,7 +312,7 @@ int cx25821_get_audio_data(struct cx25821_dev *dev,
&& dev->_audiodata_buf_virt_addr != NULL) {
memcpy((void *)(dev->_audiodata_buf_virt_addr +
frame_offset / 4), mybuf,
- vfs_read_retval);
+ vfs_read_retval);
}
file_offset += vfs_read_retval;
@@ -345,7 +345,7 @@ static void cx25821_audioups_handler(struct work_struct *work)
if (!dev) {
pr_err("ERROR %s(): since container_of(work_struct) FAILED!\n",
- __func__);
+ __func__);
return;
}
@@ -370,19 +370,19 @@ int cx25821_openfile_audio(struct cx25821_dev *dev,
if (IS_ERR(myfile)) {
const int open_errno = -PTR_ERR(myfile);
pr_err("%s(): ERROR opening file(%s) with errno = %d!\n",
- __func__, dev->_audiofilename, open_errno);
+ __func__, dev->_audiofilename, open_errno);
return PTR_ERR(myfile);
} else {
if (!(myfile->f_op)) {
pr_err("%s(): File has no file operations registered!\n",
- __func__);
+ __func__);
filp_close(myfile, NULL);
return -EIO;
}
if (!myfile->f_op->read) {
pr_err("%s(): File has no READ operations registered!\n",
- __func__);
+ __func__);
filp_close(myfile, NULL);
return -EIO;
}
@@ -454,7 +454,7 @@ static int cx25821_audio_upstream_buffer_prepare(struct cx25821_dev *dev,
if (!dev->_risc_virt_addr) {
printk(KERN_DEBUG
- pr_fmt("ERROR: pci_alloc_consistent() FAILED to allocate memory for RISC program! Returning\n"));
+ pr_fmt("ERROR: pci_alloc_consistent() FAILED to allocate memory for RISC program! Returning\n"));
return -ENOMEM;
}
/* Clear out memory at address */
@@ -469,7 +469,7 @@ static int cx25821_audio_upstream_buffer_prepare(struct cx25821_dev *dev,
if (!dev->_audiodata_buf_virt_addr) {
printk(KERN_DEBUG
- pr_fmt("ERROR: pci_alloc_consistent() FAILED to allocate memory for data buffer! Returning\n"));
+ pr_fmt("ERROR: pci_alloc_consistent() FAILED to allocate memory for data buffer! Returning\n"));
return -ENOMEM;
}
/* Clear out memory at address */
@@ -485,7 +485,7 @@ static int cx25821_audio_upstream_buffer_prepare(struct cx25821_dev *dev,
dev->_audio_lines_count);
if (ret < 0) {
printk(KERN_DEBUG
- pr_fmt("ERROR creating audio upstream RISC programs!\n"));
+ pr_fmt("ERROR creating audio upstream RISC programs!\n"));
goto error;
}
@@ -533,9 +533,9 @@ int cx25821_audio_upstream_irq(struct cx25821_dev *dev, int chan_num,
if (dev->_risc_virt_start_addr != NULL) {
risc_phys_jump_addr =
- dev->_risc_phys_start_addr +
- RISC_SYNC_INSTRUCTION_SIZE +
- AUDIO_RISC_DMA_BUF_SIZE;
+ dev->_risc_phys_start_addr +
+ RISC_SYNC_INSTRUCTION_SIZE +
+ AUDIO_RISC_DMA_BUF_SIZE;
rp = cx25821_risc_field_upstream_audio(dev,
dev->_risc_virt_start_addr + 1,
@@ -632,7 +632,7 @@ static void cx25821_wait_fifo_enable(struct cx25821_dev *dev,
/* 10 millisecond timeout */
if (count++ > 1000) {
pr_err("ERROR: %s() fifo is NOT turned on. Timeout!\n",
- __func__);
+ __func__);
return;
}
@@ -726,7 +726,7 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
if (!dev->_irq_audio_queues) {
printk(KERN_DEBUG
- pr_fmt("ERROR: create_singlethread_workqueue() for Audio FAILED!\n"));
+ pr_fmt("ERROR: create_singlethread_workqueue() for Audio FAILED!\n"));
return -ENOMEM;
}
@@ -764,8 +764,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
_line_size, 0);
dev->audio_upstream_riscbuf_size =
- AUDIO_RISC_DMA_BUF_SIZE * NUM_AUDIO_PROGS +
- RISC_SYNC_INSTRUCTION_SIZE;
+ AUDIO_RISC_DMA_BUF_SIZE * NUM_AUDIO_PROGS +
+ RISC_SYNC_INSTRUCTION_SIZE;
dev->audio_upstream_databuf_size = AUDIO_DATA_BUF_SZ * NUM_AUDIO_PROGS;
/* Allocating buffers and prepare RISC program */
@@ -773,7 +773,7 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
_line_size);
if (retval < 0) {
pr_err("%s: Failed to set up Audio upstream buffers!\n",
- dev->name);
+ dev->name);
goto error;
}
/* Start RISC engine */
--
1.7.0.4
^ permalink raw reply related
* [PATCH 06/36] Staging: cx25821: cx25821-audio-upstream.c: Move operators
From: Leonid V. Fedorenchik @ 2011-10-22 5:43 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Mauro Carvalho Chehab, Namhyung Kim, Palash Bandyopadhyay,
Joe Perches, Ilia Mirkin, Youquan Song, Leonid V. Fedorenchik,
devel, linux-kernel
In-Reply-To: <1319262236-6498-1-git-send-email-leonidsbox@gmail.com>
Move operator of complex expression to the end of the lines to preserve
consistency.
Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
---
drivers/staging/cx25821/cx25821-audio-upstream.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/cx25821/cx25821-audio-upstream.c b/drivers/staging/cx25821/cx25821-audio-upstream.c
index d7d3a2f..b2cd794 100644
--- a/drivers/staging/cx25821/cx25821-audio-upstream.c
+++ b/drivers/staging/cx25821/cx25821-audio-upstream.c
@@ -398,9 +398,9 @@ int cx25821_openfile_audio(struct cx25821_dev *dev,
vfs_read_retval =
vfs_read(myfile, mybuf, line_size, &pos);
- if (vfs_read_retval > 0
- && vfs_read_retval == line_size
- && dev->_audiodata_buf_virt_addr != NULL) {
+ if (vfs_read_retval > 0 &&
+ vfs_read_retval == line_size &&
+ dev->_audiodata_buf_virt_addr != NULL) {
memcpy((void *)(dev->
_audiodata_buf_virt_addr
+ offset / 4), mybuf,
--
1.7.0.4
^ permalink raw reply related
* [PATCH 07/36] Staging: cx25821: cx25821-audio-upstream.c: Change line endings
From: Leonid V. Fedorenchik @ 2011-10-22 5:43 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Mauro Carvalho Chehab, Namhyung Kim, Palash Bandyopadhyay,
Joe Perches, Ilia Mirkin, Youquan Song, Leonid V. Fedorenchik,
devel, linux-kernel
In-Reply-To: <1319262236-6498-1-git-send-email-leonidsbox@gmail.com>
Change obscure line endings to less obscure ones. (improve readability)
Signed-off-by: Leonid V. Fedorenchik <leonidsbox@gmail.com>
---
drivers/staging/cx25821/cx25821-audio-upstream.c | 54 ++++++++++------------
1 files changed, 24 insertions(+), 30 deletions(-)
diff --git a/drivers/staging/cx25821/cx25821-audio-upstream.c b/drivers/staging/cx25821/cx25821-audio-upstream.c
index b2cd794..7eefc05 100644
--- a/drivers/staging/cx25821/cx25821-audio-upstream.c
+++ b/drivers/staging/cx25821/cx25821-audio-upstream.c
@@ -175,10 +175,8 @@ int cx25821_risc_buffer_upstream_audio(struct cx25821_dev *dev,
}
rp = cx25821_risc_field_upstream_audio(dev, rp,
- dev->
- _audiodata_buf_phys_addr
- + databuf_offset, bpl,
- fifo_enable);
+ dev->_audiodata_buf_phys_addr + databuf_offset,
+ bpl, fifo_enable);
if (USE_RISC_NOOP_AUDIO) {
for (i = 0; i < NUM_NO_OPS; i++)
@@ -305,8 +303,8 @@ int cx25821_get_audio_data(struct cx25821_dev *dev,
for (i = 0; i < dev->_audio_lines_count; i++) {
pos = file_offset;
- vfs_read_retval =
- vfs_read(myfile, mybuf, line_size, &pos);
+ vfs_read_retval = vfs_read(myfile, mybuf, line_size,
+ &pos);
if (vfs_read_retval > 0 && vfs_read_retval == line_size
&& dev->_audiodata_buf_virt_addr != NULL) {
@@ -328,8 +326,8 @@ int cx25821_get_audio_data(struct cx25821_dev *dev,
if (i > 0)
dev->_audioframe_count++;
- dev->_audiofile_status =
- (vfs_read_retval == line_size) ? IN_PROGRESS : END_OF_FILE;
+ dev->_audiofile_status = (vfs_read_retval == line_size) ?
+ IN_PROGRESS : END_OF_FILE;
set_fs(old_fs);
filp_close(myfile, NULL);
@@ -340,8 +338,8 @@ int cx25821_get_audio_data(struct cx25821_dev *dev,
static void cx25821_audioups_handler(struct work_struct *work)
{
- struct cx25821_dev *dev =
- container_of(work, struct cx25821_dev, _audio_work_entry);
+ struct cx25821_dev *dev = container_of(work, struct cx25821_dev,
+ _audio_work_entry);
if (!dev) {
pr_err("ERROR %s(): since container_of(work_struct) FAILED!\n",
@@ -395,8 +393,8 @@ int cx25821_openfile_audio(struct cx25821_dev *dev,
for (i = 0; i < dev->_audio_lines_count; i++) {
pos = offset;
- vfs_read_retval =
- vfs_read(myfile, mybuf, line_size, &pos);
+ vfs_read_retval = vfs_read(myfile, mybuf,
+ line_size, &pos);
if (vfs_read_retval > 0 &&
vfs_read_retval == line_size &&
@@ -423,8 +421,8 @@ int cx25821_openfile_audio(struct cx25821_dev *dev,
break;
}
- dev->_audiofile_status =
- (vfs_read_retval == line_size) ? IN_PROGRESS : END_OF_FILE;
+ dev->_audiofile_status = (vfs_read_retval == line_size) ?
+ IN_PROGRESS : END_OF_FILE;
set_fs(old_fs);
myfile->f_pos = 0;
@@ -444,9 +442,8 @@ static int cx25821_audio_upstream_buffer_prepare(struct cx25821_dev *dev,
cx25821_free_memory_audio(dev);
- dev->_risc_virt_addr =
- pci_alloc_consistent(dev->pci, dev->audio_upstream_riscbuf_size,
- &dma_addr);
+ dev->_risc_virt_addr = pci_alloc_consistent(dev->pci,
+ dev->audio_upstream_riscbuf_size, &dma_addr);
dev->_risc_virt_start_addr = dev->_risc_virt_addr;
dev->_risc_phys_start_addr = dma_addr;
dev->_risc_phys_addr = dma_addr;
@@ -461,9 +458,8 @@ static int cx25821_audio_upstream_buffer_prepare(struct cx25821_dev *dev,
memset(dev->_risc_virt_addr, 0, dev->_audiorisc_size);
/* For Audio Data buffer allocation */
- dev->_audiodata_buf_virt_addr =
- pci_alloc_consistent(dev->pci, dev->audio_upstream_databuf_size,
- &data_dma_addr);
+ dev->_audiodata_buf_virt_addr = pci_alloc_consistent(dev->pci,
+ dev->audio_upstream_databuf_size, &data_dma_addr);
dev->_audiodata_buf_phys_addr = data_dma_addr;
dev->_audiodata_buf_size = dev->audio_upstream_databuf_size;
@@ -480,9 +476,8 @@ static int cx25821_audio_upstream_buffer_prepare(struct cx25821_dev *dev,
return ret;
/* Creating RISC programs */
- ret =
- cx25821_risc_buffer_upstream_audio(dev, dev->pci, bpl,
- dev->_audio_lines_count);
+ ret = cx25821_risc_buffer_upstream_audio(dev, dev->pci, bpl,
+ dev->_audio_lines_count);
if (ret < 0) {
printk(KERN_DEBUG
pr_fmt("ERROR creating audio upstream RISC programs!\n"));
@@ -661,9 +656,9 @@ int cx25821_start_audio_dma_upstream(struct cx25821_dev *dev,
/* Set the input mode to 16-bit */
tmp = cx_read(sram_ch->aud_cfg);
- tmp |=
- FLD_AUD_SRC_ENABLE | FLD_AUD_DST_PK_MODE | FLD_AUD_CLK_ENABLE |
- FLD_AUD_MASTER_MODE | FLD_AUD_CLK_SELECT_PLL_D | FLD_AUD_SONY_MODE;
+ tmp |= FLD_AUD_SRC_ENABLE | FLD_AUD_DST_PK_MODE | FLD_AUD_CLK_ENABLE |
+ FLD_AUD_MASTER_MODE | FLD_AUD_CLK_SELECT_PLL_D |
+ FLD_AUD_SONY_MODE;
cx_write(sram_ch->aud_cfg, tmp);
/* Read and write back the interrupt status register to clear it */
@@ -678,12 +673,11 @@ int cx25821_start_audio_dma_upstream(struct cx25821_dev *dev,
tmp = cx_read(sram_ch->int_msk);
cx_write(sram_ch->int_msk, tmp |= _intr_msk);
- err =
- request_irq(dev->pci->irq, cx25821_upstream_irq_audio,
+ err = request_irq(dev->pci->irq, cx25821_upstream_irq_audio,
IRQF_SHARED | IRQF_DISABLED, dev->name, dev);
if (err < 0) {
- pr_err("%s: can't get upstream IRQ %d\n",
- dev->name, dev->pci->irq);
+ pr_err("%s: can't get upstream IRQ %d\n", dev->name,
+ dev->pci->irq);
goto fail_irq;
}
--
1.7.0.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.