[lustre-devel] prevent lustre from using specific ports for socket connections

"Defazio, Gian-Carlo" <[email protected]> Thu, 6 Mar 2025 22:15:10 +0000
Newsgroups org.lustre.lists.lustre-devel
Message-ID <SJ0PR09MB638165AB4F27BA6F6F65BD2EE3CA2@SJ0PR09MB6381.namprd09.prod.outlook.com>
--===============4188690189340432758==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_SJ0PR09MB638165AB4F27BA6F6F65BD2EE3CA2SJ0PR09MB6381namp_"

--_000_SJ0PR09MB638165AB4F27BA6F6F65BD2EE3CA2SJ0PR09MB6381namp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

Is it possible to prevent lustre from using specific ports when establishin=
g a socket connection?
We have the situation where lustre may use a port (1022) and then a service=
 that needs to use that port fails to start.

Our current solution is a local patch to check the port values being iterat=
ed through in lnet/lnet/acceptor.c:lnet_connect() and to just skip over 102=
2.

Is there already a way to avoid certain ports for lustre? Either in lustre =
or via some kernel mechanism that would affect lustre?

We're considering making a more general patch that would allow specifying p=
orts to avoid by adding a module parameter to lnet but aren't sure what a g=
ood design would be. So far, the basic idea is that the user supplies a str=
ing of numbers/ranges such as "512,513-515,1022" and then a list or bitmap =
or some other data structure of ports to avoid is created and then lnet_con=
nect() checks that data structure when selecting ports.

Thanks,
Gian-Carlo

--_000_SJ0PR09MB638165AB4F27BA6F6F65BD2EE3CA2SJ0PR09MB6381namp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Aptos;
	panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	font-size:12.0pt;
	font-family:"Aptos",sans-serif;
	mso-ligatures:standardcontextual;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Aptos",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style>
</head>
<body lang=3D"EN-US" link=3D"#467886" vlink=3D"#96607D" style=3D"word-wrap:=
break-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Hi,<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p>&nbsp;</o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Is it possible to p=
revent lustre from using specific ports when establishing a socket connecti=
on?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">We have the situati=
on where lustre may use a port (1022) and then a service that needs to use =
that port fails to start.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p>&nbsp;</o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Our current solutio=
n is a local patch to check the port values being iterated through in lnet/=
lnet/acceptor.c:lnet_connect() and to just skip over 1022.<o:p></o:p></span=
></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p>&nbsp;</o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Is there already a =
way to avoid certain ports for lustre? Either in lustre or via some kernel =
mechanism that would affect lustre?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p>&nbsp;</o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">We're considering m=
aking a more general patch that would allow specifying ports to avoid by ad=
ding a module parameter to lnet but aren't sure what a good design would be=
. So far, the basic idea is that the
 user supplies a string of numbers/ranges such as &quot;512,513-515,1022&qu=
ot; and then a list or bitmap or some other data structure of ports to avoi=
d is created and then lnet_connect() checks that data structure when select=
ing ports.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p>&nbsp;</o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Thanks,<o:p></o:p><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Gian-Carlo <o:p></o=
:p></span></p>
</div>
</body>
</html>

--_000_SJ0PR09MB638165AB4F27BA6F6F65BD2EE3CA2SJ0PR09MB6381namp_--

--===============4188690189340432758==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
lustre-devel mailing list
[email protected]
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

--===============4188690189340432758==--