<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/rdma/ib_mad.h, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-02-08T23:24:44Z</updated>
<entry>
<title>IB/core: Don't register each MAD agent for LSM notifier</title>
<updated>2019-02-08T23:24:44Z</updated>
<author>
<name>Daniel Jurgens</name>
<email>danielj@mellanox.com</email>
</author>
<published>2019-02-02T09:09:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c66f67414c1f88554485bb2a0abf8b5c0d741de7'/>
<id>urn:sha1:c66f67414c1f88554485bb2a0abf8b5c0d741de7</id>
<content type='text'>
When creating many MAD agents in a short period of time, receive packet
processing can be delayed long enough to cause timeouts while new agents
are being added to the atomic notifier chain with IRQs disabled.  Notifier
chain registration and unregstration is an O(n) operation. With large
numbers of MAD agents being created and destroyed simultaneously the CPUs
spend too much time with interrupts disabled.

Instead of each MAD agent registering for it's own LSM notification,
maintain a list of agents internally and register once, this registration
already existed for handling the PKeys. This list is write mostly, so a
normal spin lock is used vs a read/write lock. All MAD agents must be
checked, so a single list is used instead of breaking them down per
device.

Notifier calls are done under rcu_read_lock, so there isn't a risk of
similar packet timeouts while checking the MAD agents security settings
when notified.

Signed-off-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Reviewed-by: Parav Pandit &lt;parav@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Acked-by: Paul Moore &lt;paul@paul-moore.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Eliminate a hole in MAD agent struct</title>
<updated>2019-02-08T23:24:44Z</updated>
<author>
<name>Daniel Jurgens</name>
<email>danielj@mellanox.com</email>
</author>
<published>2019-02-02T09:09:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=805b754d492f6227e1646001bdf85ad4bb819e55'/>
<id>urn:sha1:805b754d492f6227e1646001bdf85ad4bb819e55</id>
<content type='text'>
Move the security related fields above the u8s to eliminate a hole in the
struct.

pahole before:
struct ib_mad_agent {
...
u32                        hi_tid;               /*    48     4 */
u32                        flags;                /*    52     4 */
u8                         port_num;             /*    56     1 */
u8                         rmpp_version;         /*    57     1 */

/* XXX 6 bytes hole, try to pack */

/* --- cacheline 1 boundary (64 bytes) --- */
void *                     security;             /*    64     8 */
bool                       smp_allowed;          /*    72     1 */
bool                       lsm_nb_reg;           /*    73     1 */

/* XXX 6 bytes hole, try to pack */

struct notifier_block      lsm_nb;               /*    80    24 */

/* XXX last struct has 4 bytes of padding */

/* size: 104, cachelines: 2, members: 14 */
...
};

pahole after:
struct ib_mad_agent {
...
u32                        hi_tid;               /*    48     4 */
u32                        flags;                /*    52     4 */
void *                     security;             /*    56     8 */
/* --- cacheline 1 boundary (64 bytes) --- */
struct notifier_block      lsm_nb;               /*    64    24 */

/* XXX last struct has 4 bytes of padding */

u8                         port_num;             /*    88     1 */
u8                         rmpp_version;         /*    89     1 */
bool                       smp_allowed;          /*    90     1 */
bool                       lsm_nb_reg;           /*    91     1 */

/* size: 96, cachelines: 2, members: 14 */
...
};

Signed-off-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Reviewed-by: Parav Pandit &lt;parav@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Add CapabilityMask2 to port attributes</title>
<updated>2018-12-11T20:06:20Z</updated>
<author>
<name>Michael Guralnik</name>
<email>michaelgur@mellanox.com</email>
</author>
<published>2018-12-09T09:49:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1e8f43b7fb25aa7a85db1e81b4689dd394e23b35'/>
<id>urn:sha1:1e8f43b7fb25aa7a85db1e81b4689dd394e23b35</id>
<content type='text'>
CapabilityMask2 was added in IB Spec 1.3 under PortInfo attribute.  The
new Capapbility mask is needed in order to expose the new 2X width and HDR
speed.

Signed-off-by: Michael Guralnik &lt;michaelgur@mellanox.com&gt;
Reviewed-by: Majd Dibbiny &lt;majd@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
</content>
</entry>
<entry>
<title>RDMA: Fix storage of PortInfo CapabilityMask in the kernel</title>
<updated>2018-07-10T17:06:45Z</updated>
<author>
<name>Jason Gunthorpe</name>
<email>jgg@mellanox.com</email>
</author>
<published>2018-07-04T12:57:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2f944c0fbf58b1f390e5e61affd98ba0061214c6'/>
<id>urn:sha1:2f944c0fbf58b1f390e5e61affd98ba0061214c6</id>
<content type='text'>
The internal flag IP_BASED_GIDS was added to a field that was being used
to hold the port Info CapabilityMask without considering the effects this
will have. Since most drivers just use the value from the HW MAD it means
IP_BASED_GIDS will also become set on any HW that sets the IBA flag
IsOtherLocalChangesNoticeSupported - which is not intended.

Fix this by keeping port_cap_flags only for the IBA CapabilityMask value
and store unrelated flags externally. Move the bit definitions for this to
ib_mad.h to make it clear what is happening.

To keep the uAPI unchanged define a new set of flags in the uapi header
that are only used by ib_uverbs_query_port_resp.port_cap_flags which match
the current flags supported in rdma-core, and the values exposed by the
current kernel.

Fixes: b4a26a27287a ("IB: Report using RoCE IP based gids in port caps")
Signed-off-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Signed-off-by: Artemy Kovalyov &lt;artemyko@mellanox.com&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Enforce security on management datagrams</title>
<updated>2017-05-23T16:27:21Z</updated>
<author>
<name>Daniel Jurgens</name>
<email>danielj@mellanox.com</email>
</author>
<published>2017-05-19T12:48:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=47a2b338fe63200d716d2e24131cdb49f17c77da'/>
<id>urn:sha1:47a2b338fe63200d716d2e24131cdb49f17c77da</id>
<content type='text'>
Allocate and free a security context when creating and destroying a MAD
agent.  This context is used for controlling access to PKeys and sending
and receiving SMPs.

When sending or receiving a MAD check that the agent has permission to
access the PKey for the Subnet Prefix of the port.

During MAD and snoop agent registration for SMI QPs check that the
calling process has permission to access the manage the subnet  and
register a callback with the LSM to be notified of policy changes. When
notificaiton of a policy change occurs recheck permission and set a flag
indicating sending and receiving SMPs is allowed.

When sending and receiving MADs check that the agent has access to the
SMI if it's on an SMI QP.  Because security policy can change it's
possible permission was allowed when creating the agent, but no longer
is.

Signed-off-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Acked-by: Doug Ledford &lt;dledford@redhat.com&gt;
[PM: remove the LSM hook init code]
Signed-off-by: Paul Moore &lt;paul@paul-moore.com&gt;
</content>
</entry>
<entry>
<title>IB/SA: Add support to query OPA path records</title>
<updated>2017-05-01T18:39:02Z</updated>
<author>
<name>Dasaratharaman Chandramouli</name>
<email>dasaratharaman.chandramouli@intel.com</email>
</author>
<published>2017-04-27T23:06:02Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4c33bd1926ccbfad362d22208c23cc045c5c82af'/>
<id>urn:sha1:4c33bd1926ccbfad362d22208c23cc045c5c82af</id>
<content type='text'>
When the bit 26 of capmask2 field in OPA classport info
query is set, SA will query for OPA path records instead
of querying for IB path records. Note that OPA
path records can only be queried by kernel ULPs.
Userspace clients continue to query IB path records.

Reviewed-by: Don Hiatt &lt;don.hiatt@intel.com&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Signed-off-by: Dasaratharaman Chandramouli &lt;dasaratharaman.chandramouli@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Move opa_class_port_info definition to header file</title>
<updated>2017-04-28T22:10:05Z</updated>
<author>
<name>Dasaratharaman Chandramouli</name>
<email>dasaratharaman.chandramouli@intel.com</email>
</author>
<published>2017-04-28T21:47:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=aa4656d9a4292018c9746dbad1dad5488e575232'/>
<id>urn:sha1:aa4656d9a4292018c9746dbad1dad5488e575232</id>
<content type='text'>
Both opa_vnic and the hfi driver use the same opa_classport_info
definition. We will also have ib_sa capable of querying opa class
port info and would need this definition. Move it to ib_mad.h
for everyone to use.

Signed-off-by: Dasaratharaman Chandramouli &lt;dasaratharaman.chandramouli@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>IB/core: change the return type to void</title>
<updated>2017-04-25T19:30:26Z</updated>
<author>
<name>Zhu Yanjun</name>
<email>yanjun.zhu@oracle.com</email>
</author>
<published>2017-04-01T03:42:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8d2216be285135c7281e09dc07738b62782fad9c'/>
<id>urn:sha1:8d2216be285135c7281e09dc07738b62782fad9c</id>
<content type='text'>
The function ib_unregister_mad_agent always returns zero. And
this returned value is not checked. As such, chane the return
type to void.

CC: Joe Jin &lt;joe.jin@oracle.com&gt;
CC: Junxiao Bi &lt;junxiao.bi@oracle.com&gt;
Signed-off-by: Zhu Yanjun &lt;yanjun.zhu@oracle.com&gt;
Reviewed-by: Yuval Shaia &lt;yuval.shaia@oracle.com&gt;
Reviewed-by: Hal Rosenstock &lt;hal@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>IB/mad: Eliminate redundant SM class version defines for OPA</title>
<updated>2016-12-14T16:01:58Z</updated>
<author>
<name>Hal Rosenstock</name>
<email>hal@dev.mellanox.co.il</email>
</author>
<published>2016-10-18T17:20:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9fa240bbfc4200b080c8fad12579659c2c2f36b5'/>
<id>urn:sha1:9fa240bbfc4200b080c8fad12579659c2c2f36b5</id>
<content type='text'>
and rename class version define to indicate SM rather than SMP or SMI

Signed-off-by: Hal Rosenstock &lt;hal@mellanox.com&gt;
Reviewed-by: Ira Weiny &lt;ira.weiny@intel.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>IB/core: Introduce capabilitymask2 field in ClassPortInfo mad</title>
<updated>2016-05-25T19:39:02Z</updated>
<author>
<name>Erez Shitrit</name>
<email>erezsh@mellanox.com</email>
</author>
<published>2016-05-25T19:02:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=507f6afa3ab6c9473d81c8091be0d1b859509a6d'/>
<id>urn:sha1:507f6afa3ab6c9473d81c8091be0d1b859509a6d</id>
<content type='text'>
Change struct ib_class_port_info to conform to IB Spec 1.3
That in order to get specific capability mask from ClassPortInfo mad.

&gt;From the IB Spec, ClassPortInfo section:
        "CapabilityMask2 Bits 0-26: Additional class-specific capabilities...
         RespTimeValue the rest 5 bits"

The new struct now has one field for capabilitymask2 (previously was the
reserved field) and the resp_time field.

And it fixes up qib and srpt, use of the field repurposed to be used as
capabilitymask2:
IB/qib: Change pma_get_classportinfo
IB/srpt: Adjust the use of ib_class_port_info

Signed-off-by: Erez Shitrit &lt;erezsh@mellanox.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Reviewed-by: Hal Rosenstock &lt;hal@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
</feed>
