DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/txgbe: remove warning functions
@ 2020-11-06  2:10 Jiawen Wu
  2020-11-06 12:39 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Jiawen Wu @ 2020-11-06  2:10 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu

Remove rte_panic(), and use rte_atomic_thread_fence()
instead of rte_smp_[r/w]mb.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_osdep.h | 2 +-
 drivers/net/txgbe/txgbe_rxtx.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_osdep.h b/drivers/net/txgbe/base/txgbe_osdep.h
index f3d443ad3..756eb50eb 100644
--- a/drivers/net/txgbe/base/txgbe_osdep.h
+++ b/drivers/net/txgbe/base/txgbe_osdep.h
@@ -27,7 +27,7 @@
 
 #define ASSERT(x) do {			\
 	if (!(x))			\
-		rte_panic("TXGBE: x");	\
+		PMD_DRV_LOG(ERR, "TXGBE: %d", x);	\
 } while (0)
 
 #define usec_delay(x) rte_delay_us(x)
diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index 00214b48f..82dde509a 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -1145,7 +1145,7 @@ txgbe_rx_scan_hw_ring(struct txgbe_rx_queue *rxq)
 		for (j = 0; j < LOOK_AHEAD; j++)
 			s[j] = rte_le_to_cpu_32(rxdp[j].qw1.lo.status);
 
-		rte_smp_rmb();
+		rte_atomic_thread_fence(__ATOMIC_ACQUIRE);
 
 		/* Compute how many status bits were set */
 		for (nb_dd = 0; nb_dd < LOOK_AHEAD &&
-- 
2.21.0.windows.1




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/txgbe: remove warning functions
  2020-11-06  2:10 [dpdk-dev] [PATCH] net/txgbe: remove warning functions Jiawen Wu
@ 2020-11-06 12:39 ` Ferruh Yigit
  2020-11-09  7:32   ` Jiawen Wu
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2020-11-06 12:39 UTC (permalink / raw)
  To: Jiawen Wu, dev; +Cc: Thomas Monjalon

On 11/6/2020 2:10 AM, Jiawen Wu wrote:
> Remove rte_panic(), and use rte_atomic_thread_fence()
> instead of rte_smp_[r/w]mb.
> 
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/main, thanks.


The remaining fix is :
	Using compiler attribute directly

I can see two instances are used:
1)
drivers/net/txgbe/base/txgbe_dummy.h
10:#define TUP(x) x##_unused __attribute__((unused))

2)
drivers/net/txgbe/base/txgbe_osdep.h
152:#define __rte_weak __attribute__((__weak__))


I think 2) simple can be removed completely, since it is not used at all.


For 1) can it be moved to osdep.h? like:

#define TUP(x) x##_unused txgbe_unused
txgbe_osdep.h: #define txgbe_unused __rte_unused

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/txgbe: remove warning functions
  2020-11-06 12:39 ` Ferruh Yigit
@ 2020-11-09  7:32   ` Jiawen Wu
  0 siblings, 0 replies; 3+ messages in thread
From: Jiawen Wu @ 2020-11-09  7:32 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: Thomas Monjalon

On Friday, November 6, 2020 8:39 PM, Ferruh Yigit wrote:
> On 11/6/2020 2:10 AM, Jiawen Wu wrote:
> > Remove rte_panic(), and use rte_atomic_thread_fence() instead of
> > rte_smp_[r/w]mb.
> >
> > Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> Applied to
> dpdk-next-net/main, thanks.
> 
> 
> The remaining fix is :
> 	Using compiler attribute directly
> 
> I can see two instances are used:
> 1)
> drivers/net/txgbe/base/txgbe_dummy.h
> 10:#define TUP(x) x##_unused __attribute__((unused))
> 
> 2)
> drivers/net/txgbe/base/txgbe_osdep.h
> 152:#define __rte_weak __attribute__((__weak__))
> 
> 
> I think 2) simple can be removed completely, since it is not used at all.
> 
> 
> For 1) can it be moved to osdep.h? like:
> 
> #define TUP(x) x##_unused txgbe_unused
> txgbe_osdep.h: #define txgbe_unused __rte_unused

Thanks Ferruh,

It's a good way to deal with the remaining warning.
There will also be a patch to fix it.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-09  7:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06  2:10 [dpdk-dev] [PATCH] net/txgbe: remove warning functions Jiawen Wu
2020-11-06 12:39 ` Ferruh Yigit
2020-11-09  7:32   ` Jiawen Wu

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git