All of lore.kernel.org
 help / color / mirror / Atom feed
* [sashal-linux-stable:pending-5.13 51/176] drivers/infiniband/ulp/rtrs/rtrs-clt.c:1789:19: warning: result of comparison of constant 'MAX_SESS_QUEUE_DEPTH' (65536) with expression of type 'u16' (aka 'unsigned short') is always false
@ 2021-07-16  7:28 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-07-16  7:28 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 9522 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git pending-5.13
head:   9e20d32ceee869b30775be931beb33f561a4f955
commit: 6d51e8a0a9e776dcd01f15fa0ea6d3ba0861e8b3 [51/176] RDMA/rtrs: Change MAX_SESS_QUEUE_DEPTH
config: x86_64-randconfig-a015-20210716 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 5d5b08761f944d5b9822d582378333cc4b36a0a7)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/commit/?id=6d51e8a0a9e776dcd01f15fa0ea6d3ba0861e8b3
        git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
        git fetch --no-tags sashal-linux-stable pending-5.13
        git checkout 6d51e8a0a9e776dcd01f15fa0ea6d3ba0861e8b3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/infiniband/ulp/rtrs/rtrs-clt.c:1789:19: warning: result of comparison of constant 'MAX_SESS_QUEUE_DEPTH' (65536) with expression of type 'u16' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
                   if (queue_depth > MAX_SESS_QUEUE_DEPTH) {
                       ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +1789 drivers/infiniband/ulp/rtrs/rtrs-clt.c

6a98d71daea186 Jack Wang      2020-05-11  1753  
6a98d71daea186 Jack Wang      2020-05-11  1754  static int rtrs_rdma_conn_established(struct rtrs_clt_con *con,
6a98d71daea186 Jack Wang      2020-05-11  1755  				       struct rdma_cm_event *ev)
6a98d71daea186 Jack Wang      2020-05-11  1756  {
6a98d71daea186 Jack Wang      2020-05-11  1757  	struct rtrs_clt_sess *sess = to_clt_sess(con->c.sess);
6a98d71daea186 Jack Wang      2020-05-11  1758  	struct rtrs_clt *clt = sess->clt;
6a98d71daea186 Jack Wang      2020-05-11  1759  	const struct rtrs_msg_conn_rsp *msg;
6a98d71daea186 Jack Wang      2020-05-11  1760  	u16 version, queue_depth;
6a98d71daea186 Jack Wang      2020-05-11  1761  	int errno;
6a98d71daea186 Jack Wang      2020-05-11  1762  	u8 len;
6a98d71daea186 Jack Wang      2020-05-11  1763  
6a98d71daea186 Jack Wang      2020-05-11  1764  	msg = ev->param.conn.private_data;
6a98d71daea186 Jack Wang      2020-05-11  1765  	len = ev->param.conn.private_data_len;
6a98d71daea186 Jack Wang      2020-05-11  1766  	if (len < sizeof(*msg)) {
6a98d71daea186 Jack Wang      2020-05-11  1767  		rtrs_err(clt, "Invalid RTRS connection response\n");
6a98d71daea186 Jack Wang      2020-05-11  1768  		return -ECONNRESET;
6a98d71daea186 Jack Wang      2020-05-11  1769  	}
6a98d71daea186 Jack Wang      2020-05-11  1770  	if (le16_to_cpu(msg->magic) != RTRS_MAGIC) {
6a98d71daea186 Jack Wang      2020-05-11  1771  		rtrs_err(clt, "Invalid RTRS magic\n");
6a98d71daea186 Jack Wang      2020-05-11  1772  		return -ECONNRESET;
6a98d71daea186 Jack Wang      2020-05-11  1773  	}
6a98d71daea186 Jack Wang      2020-05-11  1774  	version = le16_to_cpu(msg->version);
6a98d71daea186 Jack Wang      2020-05-11  1775  	if (version >> 8 != RTRS_PROTO_VER_MAJOR) {
6a98d71daea186 Jack Wang      2020-05-11  1776  		rtrs_err(clt, "Unsupported major RTRS version: %d, expected %d\n",
6a98d71daea186 Jack Wang      2020-05-11  1777  			  version >> 8, RTRS_PROTO_VER_MAJOR);
6a98d71daea186 Jack Wang      2020-05-11  1778  		return -ECONNRESET;
6a98d71daea186 Jack Wang      2020-05-11  1779  	}
6a98d71daea186 Jack Wang      2020-05-11  1780  	errno = le16_to_cpu(msg->errno);
6a98d71daea186 Jack Wang      2020-05-11  1781  	if (errno) {
6a98d71daea186 Jack Wang      2020-05-11  1782  		rtrs_err(clt, "Invalid RTRS message: errno %d\n",
6a98d71daea186 Jack Wang      2020-05-11  1783  			  errno);
6a98d71daea186 Jack Wang      2020-05-11  1784  		return -ECONNRESET;
6a98d71daea186 Jack Wang      2020-05-11  1785  	}
6a98d71daea186 Jack Wang      2020-05-11  1786  	if (con->c.cid == 0) {
6a98d71daea186 Jack Wang      2020-05-11  1787  		queue_depth = le16_to_cpu(msg->queue_depth);
6a98d71daea186 Jack Wang      2020-05-11  1788  
6a98d71daea186 Jack Wang      2020-05-11 @1789  		if (queue_depth > MAX_SESS_QUEUE_DEPTH) {
6a98d71daea186 Jack Wang      2020-05-11  1790  			rtrs_err(clt, "Invalid RTRS message: queue=%d\n",
6a98d71daea186 Jack Wang      2020-05-11  1791  				  queue_depth);
6a98d71daea186 Jack Wang      2020-05-11  1792  			return -ECONNRESET;
6a98d71daea186 Jack Wang      2020-05-11  1793  		}
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1794  		if (sess->queue_depth > 0 && queue_depth != sess->queue_depth) {
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1795  			rtrs_err(clt, "Error: queue depth changed\n");
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1796  
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1797  			/*
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1798  			 * Stop any more reconnection attempts
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1799  			 */
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1800  			sess->reconnect_attempts = -1;
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1801  			rtrs_err(clt,
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1802  				"Disabling auto-reconnect. Trigger a manual reconnect after issue is resolved\n");
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1803  			return -ECONNRESET;
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1804  		}
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1805  
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1806  		if (!sess->rbufs) {
6a98d71daea186 Jack Wang      2020-05-11  1807  			kfree(sess->rbufs);
6a98d71daea186 Jack Wang      2020-05-11  1808  			sess->rbufs = kcalloc(queue_depth, sizeof(*sess->rbufs),
6a98d71daea186 Jack Wang      2020-05-11  1809  					      GFP_KERNEL);
6a98d71daea186 Jack Wang      2020-05-11  1810  			if (!sess->rbufs)
6a98d71daea186 Jack Wang      2020-05-11  1811  				return -ENOMEM;
6a98d71daea186 Jack Wang      2020-05-11  1812  		}
6a98d71daea186 Jack Wang      2020-05-11  1813  		sess->queue_depth = queue_depth;
6a98d71daea186 Jack Wang      2020-05-11  1814  		sess->max_hdr_size = le32_to_cpu(msg->max_hdr_size);
6a98d71daea186 Jack Wang      2020-05-11  1815  		sess->max_io_size = le32_to_cpu(msg->max_io_size);
6a98d71daea186 Jack Wang      2020-05-11  1816  		sess->flags = le32_to_cpu(msg->flags);
6a98d71daea186 Jack Wang      2020-05-11  1817  		sess->chunk_size = sess->max_io_size + sess->max_hdr_size;
6a98d71daea186 Jack Wang      2020-05-11  1818  
6a98d71daea186 Jack Wang      2020-05-11  1819  		/*
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1820  		 * Global IO size is always a minimum.
6a98d71daea186 Jack Wang      2020-05-11  1821  		 * If while a reconnection server sends us a value a bit
6a98d71daea186 Jack Wang      2020-05-11  1822  		 * higher - client does not care and uses cached minimum.
6a98d71daea186 Jack Wang      2020-05-11  1823  		 *
6a98d71daea186 Jack Wang      2020-05-11  1824  		 * Since we can have several sessions (paths) restablishing
6a98d71daea186 Jack Wang      2020-05-11  1825  		 * connections in parallel, use lock.
6a98d71daea186 Jack Wang      2020-05-11  1826  		 */
6a98d71daea186 Jack Wang      2020-05-11  1827  		mutex_lock(&clt->paths_mutex);
84d3b0760dfc0d Md Haris Iqbal 2021-05-28  1828  		clt->queue_depth = sess->queue_depth;
6a98d71daea186 Jack Wang      2020-05-11  1829  		clt->max_io_size = min_not_zero(sess->max_io_size,
6a98d71daea186 Jack Wang      2020-05-11  1830  						clt->max_io_size);
6a98d71daea186 Jack Wang      2020-05-11  1831  		mutex_unlock(&clt->paths_mutex);
6a98d71daea186 Jack Wang      2020-05-11  1832  
6a98d71daea186 Jack Wang      2020-05-11  1833  		/*
6a98d71daea186 Jack Wang      2020-05-11  1834  		 * Cache the hca_port and hca_name for sysfs
6a98d71daea186 Jack Wang      2020-05-11  1835  		 */
6a98d71daea186 Jack Wang      2020-05-11  1836  		sess->hca_port = con->c.cm_id->port_num;
6a98d71daea186 Jack Wang      2020-05-11  1837  		scnprintf(sess->hca_name, sizeof(sess->hca_name),
6a98d71daea186 Jack Wang      2020-05-11  1838  			  sess->s.dev->ib_dev->name);
6a98d71daea186 Jack Wang      2020-05-11  1839  		sess->s.src_addr = con->c.cm_id->route.addr.src_addr;
03e9b33a0fd677 Md Haris Iqbal 2021-02-12  1840  		/* set for_new_clt, to allow future reconnect on any path */
03e9b33a0fd677 Md Haris Iqbal 2021-02-12  1841  		sess->for_new_clt = 1;
6a98d71daea186 Jack Wang      2020-05-11  1842  	}
6a98d71daea186 Jack Wang      2020-05-11  1843  
6a98d71daea186 Jack Wang      2020-05-11  1844  	return 0;
6a98d71daea186 Jack Wang      2020-05-11  1845  }
6a98d71daea186 Jack Wang      2020-05-11  1846  

:::::: The code at line 1789 was first introduced by commit
:::::: 6a98d71daea186247005099758af549e6afdd244 RDMA/rtrs: client: main functionality

:::::: TO: Jack Wang <jinpu.wang@cloud.ionos.com>
:::::: CC: Jason Gunthorpe <jgg@mellanox.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 44471 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-16  7:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16  7:28 [sashal-linux-stable:pending-5.13 51/176] drivers/infiniband/ulp/rtrs/rtrs-clt.c:1789:19: warning: result of comparison of constant 'MAX_SESS_QUEUE_DEPTH' (65536) with expression of type 'u16' (aka 'unsigned short') is always false kernel test robot

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.