Skip to content

Commit 14a4bb7

Browse files
committed
[API break] link: Remove LinkAttribute::Weight as not used
The linux kernel 6.5.8 has no code using IFLA_WEIGHT, only has type definition there, no dump or set function for it. Hence removing. Signed-off-by: Gris Ge <[email protected]>
1 parent b3574e2 commit 14a4bb7

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/link/attribute.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ const IFLA_MTU: u16 = 4;
2828
const IFLA_LINK: u16 = 5;
2929
const IFLA_QDISC: u16 = 6;
3030
const IFLA_STATS: u16 = 7;
31-
// No kernel is using IFLA_COST
31+
// No kernel code is using IFLA_COST
3232
// const IFLA_COST: u16 = 8;
33-
// No kernel is using IFLA_PRIORITY
33+
// No kernel code is using IFLA_PRIORITY
3434
// const IFLA_PRIORITY: u16 = 9;
3535
const IFLA_MASTER: u16 = 10;
3636
const IFLA_WIRELESS: u16 = 11;
3737
const IFLA_PROTINFO: u16 = 12;
3838
const IFLA_TXQLEN: u16 = 13;
3939
const IFLA_MAP: u16 = 14;
40-
const IFLA_WEIGHT: u16 = 15;
40+
// No kernel code is using IFLA_WEIGHT
41+
// const IFLA_WEIGHT: u16 = 15;
4142
const IFLA_OPERSTATE: u16 = 16;
4243
const IFLA_LINKMODE: u16 = 17;
4344
const IFLA_LINKINFO: u16 = 18;
@@ -91,7 +92,6 @@ const IFLA_DEVLINK_PORT: u16 = 62;
9192
#[derive(Debug, PartialEq, Eq, Clone)]
9293
#[non_exhaustive]
9394
pub enum LinkAttribute {
94-
Weight(Vec<u8>),
9595
VfInfoList(Vec<u8>),
9696
VfPorts(Vec<u8>),
9797
PortSelf(Vec<u8>),
@@ -157,8 +157,7 @@ pub enum LinkAttribute {
157157
impl Nla for LinkAttribute {
158158
fn value_len(&self) -> usize {
159159
match self {
160-
Self::Weight(bytes)
161-
| Self::VfInfoList(bytes)
160+
Self::VfInfoList(bytes)
162161
| Self::VfPorts(bytes)
163162
| Self::PortSelf(bytes)
164163
| Self::PhysPortId(bytes)
@@ -219,8 +218,7 @@ impl Nla for LinkAttribute {
219218

220219
fn emit_value(&self, buffer: &mut [u8]) {
221220
match self {
222-
Self::Weight(bytes)
223-
| Self::VfInfoList(bytes)
221+
Self::VfInfoList(bytes)
224222
| Self::VfPorts(bytes)
225223
| Self::PortSelf(bytes)
226224
| Self::PhysPortId(bytes)
@@ -289,7 +287,6 @@ impl Nla for LinkAttribute {
289287

290288
fn kind(&self) -> u16 {
291289
match self {
292-
Self::Weight(_) => IFLA_WEIGHT,
293290
Self::VfInfoList(_) => IFLA_VFINFO_LIST,
294291
Self::VfPorts(_) => IFLA_VF_PORTS,
295292
Self::PortSelf(_) => IFLA_PORT_SELF,
@@ -357,7 +354,6 @@ impl<'a, T: AsRef<[u8]> + ?Sized>
357354
) -> Result<Self, DecodeError> {
358355
let payload = buf.value();
359356
Ok(match buf.kind() {
360-
IFLA_WEIGHT => Self::Weight(payload.to_vec()),
361357
IFLA_VFINFO_LIST => Self::VfInfoList(payload.to_vec()),
362358
IFLA_VF_PORTS => Self::VfPorts(payload.to_vec()),
363359
IFLA_PORT_SELF => Self::PortSelf(payload.to_vec()),

0 commit comments

Comments
 (0)