lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202012100734.bev99ZnD-lkp@intel.com>
Date:   Thu, 10 Dec 2020 07:54:31 +0800
From:   kernel test robot <lkp@...el.com>
To:     Maxim Mikityanskiy <maximmi@...lanox.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>
Cc:     kbuild-all@...ts.01.org, netdev@...r.kernel.org,
        Saeed Mahameed <saeedm@...dia.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Tariq Toukan <tariqt@...lanox.com>,
        Maxim Mikityanskiy <maximmi@...dia.com>
Subject: Re: [PATCH net-next 4/4] net/mlx5e: Support HTB offload

Hi Maxim,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Maxim-Mikityanskiy/HTB-offload/20201210-000703
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git afae3cc2da100ead3cd6ef4bb1fb8bc9d4b817c5
config: x86_64-randconfig-s021-20201210 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-179-ga00755aa-dirty
        # https://github.com/0day-ci/linux/commit/2b06403da63c880ec87d0bcee80b8936116935c6
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Maxim-Mikityanskiy/HTB-offload/20201210-000703
        git checkout 2b06403da63c880ec87d0bcee80b8936116935c6
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>


"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c:135:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct mlx5e_txqsq **qos_sqs @@     got struct mlx5e_txqsq [noderef] __rcu ** @@
   drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c:135:17: sparse:     expected struct mlx5e_txqsq **qos_sqs
   drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c:135:17: sparse:     got struct mlx5e_txqsq [noderef] __rcu **
>> drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c:149:50: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c:149:50: sparse:    struct mlx5e_txqsq [noderef] __rcu *
>> drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c:149:50: sparse:    struct mlx5e_txqsq *
   drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c:211:50: sparse: sparse: incompatible types in comparison expression (different address spaces):
   drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c:211:50: sparse:    struct mlx5e_txqsq [noderef] __rcu *
   drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c:211:50: sparse:    struct mlx5e_txqsq *
--
>> drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:174:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct mlx5e_txqsq **qos_sqs @@     got struct mlx5e_txqsq [noderef] __rcu ** @@
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:174:17: sparse:     expected struct mlx5e_txqsq **qos_sqs
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:174:17: sparse:     got struct mlx5e_txqsq [noderef] __rcu **
>> drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:175:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:175:16: sparse:    struct mlx5e_txqsq [noderef] __rcu *
>> drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:175:16: sparse:    struct mlx5e_txqsq *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:225:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct mlx5e_txqsq **qos_sqs @@     got struct mlx5e_txqsq [noderef] __rcu ** @@
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:225:17: sparse:     expected struct mlx5e_txqsq **qos_sqs
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:225:17: sparse:     got struct mlx5e_txqsq [noderef] __rcu **
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:245:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:245:9: sparse:    struct mlx5e_txqsq [noderef] __rcu *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:245:9: sparse:    struct mlx5e_txqsq *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:301:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct mlx5e_txqsq **qos_sqs @@     got struct mlx5e_txqsq [noderef] __rcu ** @@
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:302:14: sparse: sparse: incompatible types in comparison expression (different address spaces):
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:302:14: sparse:    struct mlx5e_txqsq [noderef] __rcu *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:302:14: sparse:    struct mlx5e_txqsq *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:302:14: sparse: sparse: incompatible types in comparison expression (different address spaces):
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:302:14: sparse:    struct mlx5e_txqsq [noderef] __rcu *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:302:14: sparse:    struct mlx5e_txqsq *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:326:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:326:22: sparse:    struct mlx5e_txqsq [noderef] __rcu *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:326:22: sparse:    struct mlx5e_txqsq *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:423:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct mlx5e_txqsq **qos_sqs @@     got struct mlx5e_txqsq [noderef] __rcu ** @@
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:423:17: sparse:     expected struct mlx5e_txqsq **qos_sqs
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:423:17: sparse:     got struct mlx5e_txqsq [noderef] __rcu **
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:431:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:431:22: sparse:    struct mlx5e_txqsq [noderef] __rcu *
   drivers/net/ethernet/mellanox/mlx5/core/en/qos.c:431:22: sparse:    struct mlx5e_txqsq *

vim +135 drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c

   115	
   116	int mlx5e_napi_poll(struct napi_struct *napi, int budget)
   117	{
   118		struct mlx5e_channel *c = container_of(napi, struct mlx5e_channel,
   119						       napi);
   120		struct mlx5e_ch_stats *ch_stats = c->stats;
   121		struct mlx5e_xdpsq *xsksq = &c->xsksq;
   122		struct mlx5e_rq *xskrq = &c->xskrq;
   123		struct mlx5e_rq *rq = &c->rq;
   124		struct mlx5e_txqsq **qos_sqs;
   125		bool aff_change = false;
   126		bool busy_xsk = false;
   127		bool busy = false;
   128		int work_done = 0;
   129		u16 qos_sqs_size;
   130		bool xsk_open;
   131		int i;
   132	
   133		rcu_read_lock();
   134	
 > 135		qos_sqs = rcu_dereference(c->qos_sqs);
   136	
   137		xsk_open = test_bit(MLX5E_CHANNEL_STATE_XSK, c->state);
   138	
   139		ch_stats->poll++;
   140	
   141		for (i = 0; i < c->num_tc; i++)
   142			busy |= mlx5e_poll_tx_cq(&c->sq[i].cq, budget);
   143	
   144		if (unlikely(qos_sqs)) {
   145			smp_rmb(); /* Pairs with mlx5e_qos_alloc_queues. */
   146			qos_sqs_size = READ_ONCE(c->qos_sqs_size);
   147	
   148			for (i = 0; i < qos_sqs_size; i++) {
 > 149				struct mlx5e_txqsq *sq = rcu_dereference(qos_sqs[i]);
   150	
   151				if (sq)
   152					busy |= mlx5e_poll_tx_cq(&sq->cq, budget);
   153			}
   154		}
   155	
   156		busy |= mlx5e_poll_xdpsq_cq(&c->xdpsq.cq);
   157	
   158		if (c->xdp)
   159			busy |= mlx5e_poll_xdpsq_cq(&c->rq_xdpsq.cq);
   160	
   161		if (likely(budget)) { /* budget=0 means: don't poll rx rings */
   162			if (xsk_open)
   163				work_done = mlx5e_poll_rx_cq(&xskrq->cq, budget);
   164	
   165			if (likely(budget - work_done))
   166				work_done += mlx5e_poll_rx_cq(&rq->cq, budget - work_done);
   167	
   168			busy |= work_done == budget;
   169		}
   170	
   171		mlx5e_poll_ico_cq(&c->icosq.cq);
   172		if (mlx5e_poll_ico_cq(&c->async_icosq.cq))
   173			/* Don't clear the flag if nothing was polled to prevent
   174			 * queueing more WQEs and overflowing the async ICOSQ.
   175			 */
   176			clear_bit(MLX5E_SQ_STATE_PENDING_XSK_TX, &c->async_icosq.state);
   177	
   178		busy |= INDIRECT_CALL_2(rq->post_wqes,
   179					mlx5e_post_rx_mpwqes,
   180					mlx5e_post_rx_wqes,
   181					rq);
   182		if (xsk_open) {
   183			busy |= mlx5e_poll_xdpsq_cq(&xsksq->cq);
   184			busy_xsk |= mlx5e_napi_xsk_post(xsksq, xskrq);
   185		}
   186	
   187		busy |= busy_xsk;
   188	
   189		if (busy) {
   190			if (likely(mlx5e_channel_no_affinity_change(c))) {
   191				work_done = budget;
   192				goto out;
   193			}
   194			ch_stats->aff_change++;
   195			aff_change = true;
   196			if (budget && work_done == budget)
   197				work_done--;
   198		}
   199	
   200		if (unlikely(!napi_complete_done(napi, work_done)))
   201			goto out;
   202	
   203		ch_stats->arm++;
   204	
   205		for (i = 0; i < c->num_tc; i++) {
   206			mlx5e_handle_tx_dim(&c->sq[i]);
   207			mlx5e_cq_arm(&c->sq[i].cq);
   208		}
   209		if (unlikely(qos_sqs)) {
   210			for (i = 0; i < qos_sqs_size; i++) {
   211				struct mlx5e_txqsq *sq = rcu_dereference(qos_sqs[i]);
   212	
   213				if (sq) {
   214					mlx5e_handle_tx_dim(sq);
   215					mlx5e_cq_arm(&sq->cq);
   216				}
   217			}
   218		}
   219	
   220		mlx5e_handle_rx_dim(rq);
   221	
   222		mlx5e_cq_arm(&rq->cq);
   223		mlx5e_cq_arm(&c->icosq.cq);
   224		mlx5e_cq_arm(&c->async_icosq.cq);
   225		mlx5e_cq_arm(&c->xdpsq.cq);
   226	
   227		if (xsk_open) {
   228			mlx5e_handle_rx_dim(xskrq);
   229			mlx5e_cq_arm(&xsksq->cq);
   230			mlx5e_cq_arm(&xskrq->cq);
   231		}
   232	
   233		if (unlikely(aff_change && busy_xsk)) {
   234			mlx5e_trigger_irq(&c->icosq);
   235			ch_stats->force_irq++;
   236		}
   237	
   238	out:
   239		rcu_read_unlock();
   240	
   241		return work_done;
   242	}
   243	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (37905 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ