mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
netdev-dpdk: Add comment about variables naming convention.
It'll be nice to document current naming convention for variables of
the following types used in netdev-dpdk:
* netdev
* netdev_dpdk
* netdev_rxq
* netdev_rxq_dpdk
to be sure that we will not return to chaos which was before
commit d46285a220
("netdev-dpdk: Consistent variable naming.").
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
This commit is contained in:
committed by
Ian Stokes
parent
3d0d5ab153
commit
b2e72a9c9d
@@ -330,6 +330,23 @@ enum dpdk_hw_ol_features {
|
||||
NETDEV_RX_CHECKSUM_OFFLOAD = 1 << 0,
|
||||
};
|
||||
|
||||
/*
|
||||
* In order to avoid confusion in variables names, following naming convention
|
||||
* should be used, if possible:
|
||||
*
|
||||
* 'struct netdev' : 'netdev'
|
||||
* 'struct netdev_dpdk' : 'dev'
|
||||
* 'struct netdev_rxq' : 'rxq'
|
||||
* 'struct netdev_rxq_dpdk' : 'rx'
|
||||
*
|
||||
* Example:
|
||||
* struct netdev *netdev = netdev_from_name(name);
|
||||
* struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
|
||||
*
|
||||
* Also, 'netdev' should be used instead of 'dev->up', where 'netdev' was
|
||||
* already defined.
|
||||
*/
|
||||
|
||||
struct netdev_dpdk {
|
||||
PADDED_MEMBERS_CACHELINE_MARKER(CACHE_LINE_SIZE, cacheline0,
|
||||
dpdk_port_t port_id;
|
||||
|
Reference in New Issue
Block a user