Message ID | 20190905132109.24678-1-ktraynor@redhat.com |
---|---|
State | Accepted |
Commit | 0976ef00a5e5a1e79ce74f8bbb2e9243851c4c00 |
Headers | show |
Series | [ovs-dev,branch-2.12] netdev-dpdk: Fix padding info comment. | expand |
On 05.09.2019 16:21, Kevin Traynor wrote: > The comment was incorrectly updated. Fix it to the > correct value of 32 pad bytes. > > /* --- cacheline 5 boundary (320 bytes) --- */ > union { > struct { > struct netdev_stats stats; /* 320 336 */ > /* --- cacheline 5 boundary (320 bytes) was 16 bytes ago --- */ > uint64_t tx_retries; /* 656 8 */ > rte_spinlock_t stats_lock; /* 664 4 */ > }; /* 352 */ > uint8_t pad52[384]; /* 384 */ > }; /* 320 384 */ > > Fixes: c161357d5d96 ("netdev-dpdk: Add custom stat for vhost tx retries.") > Reported-by: Ilya Maximets <i.maximets@samsung.com> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com> > --- > lib/netdev-dpdk.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c > index 48057835f..a53db0eed 100644 > --- a/lib/netdev-dpdk.c > +++ b/lib/netdev-dpdk.c > @@ -452,5 +452,5 @@ struct netdev_dpdk { > /* Protects stats */ > rte_spinlock_t stats_lock; > - /* 4 pad bytes here. */ > + /* 32 pad bytes here. */ Should be 36. See my comment here: https://mail.openvswitch.org/pipermail/ovs-dev/2019-September/362427.html Best regards, Ilya Maximets.
On 9/6/2019 2:20 PM, Ilya Maximets wrote: > On 05.09.2019 16:21, Kevin Traynor wrote: >> The comment was incorrectly updated. Fix it to the >> correct value of 32 pad bytes. >> >> /* --- cacheline 5 boundary (320 bytes) --- */ >> union { >> struct { >> struct netdev_stats stats; /* 320 336 */ >> /* --- cacheline 5 boundary (320 bytes) was 16 bytes ago --- */ >> uint64_t tx_retries; /* 656 8 */ >> rte_spinlock_t stats_lock; /* 664 4 */ >> }; /* 352 */ >> uint8_t pad52[384]; /* 384 */ >> }; /* 320 384 */ >> >> Fixes: c161357d5d96 ("netdev-dpdk: Add custom stat for vhost tx retries.") >> Reported-by: Ilya Maximets <i.maximets@samsung.com> >> Signed-off-by: Kevin Traynor <ktraynor@redhat.com> >> --- >> lib/netdev-dpdk.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c >> index 48057835f..a53db0eed 100644 >> --- a/lib/netdev-dpdk.c >> +++ b/lib/netdev-dpdk.c >> @@ -452,5 +452,5 @@ struct netdev_dpdk { >> /* Protects stats */ >> rte_spinlock_t stats_lock; >> - /* 4 pad bytes here. */ >> + /* 32 pad bytes here. */ > > Should be 36. > See my comment here: > https://mail.openvswitch.org/pipermail/ovs-dev/2019-September/362427.html Seems minor enough to be done on commit, confirmed with pahole that its 36 as well, wasn't aware of the un-named struct adding 4 either so spent sometime re-calculating myself to confirm, good catch. Applied to 2.12. Thanks Ian
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 48057835f..a53db0eed 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -452,5 +452,5 @@ struct netdev_dpdk { /* Protects stats */ rte_spinlock_t stats_lock; - /* 4 pad bytes here. */ + /* 32 pad bytes here. */ );
The comment was incorrectly updated. Fix it to the correct value of 32 pad bytes. /* --- cacheline 5 boundary (320 bytes) --- */ union { struct { struct netdev_stats stats; /* 320 336 */ /* --- cacheline 5 boundary (320 bytes) was 16 bytes ago --- */ uint64_t tx_retries; /* 656 8 */ rte_spinlock_t stats_lock; /* 664 4 */ }; /* 352 */ uint8_t pad52[384]; /* 384 */ }; /* 320 384 */ Fixes: c161357d5d96 ("netdev-dpdk: Add custom stat for vhost tx retries.") Reported-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Kevin Traynor <ktraynor@redhat.com> --- lib/netdev-dpdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)