Discussion:
[Linuxptp-devel] [PATCH] sk: only display the type (Tx, Rx) that changed
Jacob Keller
2013-09-04 00:19:35 UTC
Permalink
This patch adds some checks on the prints in sk.c in order to only show what
the driver changed. This cleans up the output so that we don't see "Tx type 1
not 1" lines.

Signed-off-by: Jacob Keller <***@intel.com>
---
sk.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sk.c b/sk.c
index a13d14d..1cc5a6d 100644
--- a/sk.c
+++ b/sk.c
@@ -60,9 +60,15 @@ static int hwts_init(int fd, char *device, int rx_filter, int one_step)

if (memcmp(&cfg, &req, sizeof(cfg))) {

- pr_warning("driver changed our HWTSTAMP options");
- pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
- pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ if (cfg.tx_type != req.tx_type) {
+ pr_warning("driver changed our Tx HWTSTAMP options");
+ pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
+ }
+
+ if (cfg.rx_type != req.rx_type) {
+ pr_warning("driver changed our Rx HWTSTAMP options");
+ pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ }

if (cfg.tx_type != req.tx_type ||
(cfg.rx_filter != HWTSTAMP_FILTER_ALL &&
Richard Cochran
2013-09-04 16:10:42 UTC
Permalink
Post by Jacob Keller
This patch adds some checks on the prints in sk.c in order to only show what
the driver changed. This cleans up the output so that we don't see "Tx type 1
not 1" lines.
This is better, but...
Post by Jacob Keller
---
sk.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sk.c b/sk.c
index a13d14d..1cc5a6d 100644
--- a/sk.c
+++ b/sk.c
@@ -60,9 +60,15 @@ static int hwts_init(int fd, char *device, int rx_filter, int one_step)
if (memcmp(&cfg, &req, sizeof(cfg))) {
- pr_warning("driver changed our HWTSTAMP options");
- pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
- pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ if (cfg.tx_type != req.tx_type) {
+ pr_warning("driver changed our Tx HWTSTAMP options");
+ pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
+ }
+
+ if (cfg.rx_type != req.rx_type) {
There is no rx_type, just rx_filter.
Post by Jacob Keller
+ pr_warning("driver changed our Rx HWTSTAMP options");
+ pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ }
if (cfg.tx_type != req.tx_type ||
(cfg.rx_filter != HWTSTAMP_FILTER_ALL &&
Thanks,
Richard
Keller, Jacob E
2013-09-04 17:41:33 UTC
Permalink
Post by Richard Cochran
Post by Jacob Keller
This patch adds some checks on the prints in sk.c in order to only show what
the driver changed. This cleans up the output so that we don't see "Tx type 1
not 1" lines.
This is better, but...
Post by Jacob Keller
---
sk.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sk.c b/sk.c
index a13d14d..1cc5a6d 100644
--- a/sk.c
+++ b/sk.c
@@ -60,9 +60,15 @@ static int hwts_init(int fd, char *device, int rx_filter, int one_step)
if (memcmp(&cfg, &req, sizeof(cfg))) {
- pr_warning("driver changed our HWTSTAMP options");
- pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
- pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ if (cfg.tx_type != req.tx_type) {
+ pr_warning("driver changed our Tx HWTSTAMP options");
+ pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
+ }
+
+ if (cfg.rx_type != req.rx_type) {
There is no rx_type, just rx_filter.
Oh my. Sorry for that. Can't believe I didn't catch this..

Thanks Richard. I'll fix it.
Post by Richard Cochran
Post by Jacob Keller
+ pr_warning("driver changed our Rx HWTSTAMP options");
+ pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ }
if (cfg.tx_type != req.tx_type ||
(cfg.rx_filter != HWTSTAMP_FILTER_ALL &&
Thanks
Jacob Keller
2013-09-04 17:54:01 UTC
Permalink
This patch adds some checks on the prints in sk.c in order to only show what
the driver changed. This cleans up the output so that we don't see "Tx type 1
not 1" lines.

-v2-
* use rx_filter not rx_type

Signed-off-by: Jacob Keller <***@intel.com>
---
sk.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sk.c b/sk.c
index a13d14d..3b2f938 100644
--- a/sk.c
+++ b/sk.c
@@ -60,9 +60,15 @@ static int hwts_init(int fd, char *device, int rx_filter, int one_step)

if (memcmp(&cfg, &req, sizeof(cfg))) {

- pr_warning("driver changed our HWTSTAMP options");
- pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
- pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ if (cfg.tx_type != req.tx_type) {
+ pr_warning("driver changed our Tx HWTSTAMP options");
+ pr_warning("tx_type %d not %d", cfg.tx_type, req.tx_type);
+ }
+
+ if (cfg.rx_filter != req.rx_filter) {
+ pr_warning("driver changed our Rx HWTSTAMP options");
+ pr_warning("rx_filter %d not %d", cfg.rx_filter, req.rx_filter);
+ }

if (cfg.tx_type != req.tx_type ||
(cfg.rx_filter != HWTSTAMP_FILTER_ALL &&

Loading...