]> www.infradead.org Git - users/jedix/linux-maple.git/commit
be2net: move rss_flags field in rss_info to ensure proper alignment
authorIvan Vecera <cera@cera.cz>
Tue, 10 Jul 2018 20:59:48 +0000 (22:59 +0200)
committerBrian Maly <brian.maly@oracle.com>
Sat, 11 May 2019 03:43:30 +0000 (23:43 -0400)
commit2c71f851fd09676754f1363efd5e3aa5049d74fb
tree474dfeebddbcd5fa0b5e8f1e2d1feb27c8f4d709
parent07fc6570025157d0c7b9992edd38f7f9e9c18045
be2net: move rss_flags field in rss_info to ensure proper alignment

Orabug: 29475071

The current position of .rss_flags field in struct rss_info causes
that fields .rsstable and .rssqueue (both 128 bytes long) crosses
cache-line boundaries. Moving it at the end properly align all fields.

Before patch:
struct rss_info {
        u64                        rss_flags;            /*     0     8 */
        u8                         rsstable[128];        /*     8   128 */
        /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */
        u8                         rss_queue[128];       /*   136   128 */
        /* --- cacheline 4 boundary (256 bytes) was 8 bytes ago --- */
        u8                         rss_hkey[40];         /*   264    40 */
};

After patch:
struct rss_info {
        u8                         rsstable[128];        /*     0   128 */
        /* --- cacheline 2 boundary (128 bytes) --- */
        u8                         rss_queue[128];       /*   128   128 */
        /* --- cacheline 4 boundary (256 bytes) --- */
        u8                         rss_hkey[40];         /*   256    40 */
        u64                        rss_flags;            /*   296     8 */
};

Signed-off-by: Ivan Vecera <cera@cera.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reviewed-by: John Donnelly <John.p.donnelly@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/emulex/benet/be.h