search for: _bit

Displaying 20 results from an estimated 23 matches for "_bit".

Did you mean: 8bit
2023 Jun 20
1
[Bridge] [PATCH net-next v2 2/3] bridge: Add a limit on learned FDB entries
...the learned status. > > + */ > > +static void __fdb_set_flag_not_learned(struct net_bridge *br, > > + struct net_bridge_fdb_entry *fdb, > > + long nr) > > +{ > > + WARN_ON_ONCE(!(BIT(nr) & BR_FDB_NOT_LEARNED_MASK)); > > Please use *_bit Can you tell me which *_bit helper you had in mind? The shortest option I could come up with the ones I found seemed needlessly verbose and wasteful: static const unsigned long br_fdb_not_learned_mask = BR_FDB_NOT_LEARNED_MASK; ... WARN_ON_ONCE(test_bit(nr, &br_fdb_not_learned_mask));...
2023 Jun 22
1
[Bridge] [PATCH net-next v2 2/3] bridge: Add a limit on learned FDB entries
...>> + */ >>> +static void __fdb_set_flag_not_learned(struct net_bridge *br, >>> + struct net_bridge_fdb_entry *fdb, >>> + long nr) >>> +{ >>> + WARN_ON_ONCE(!(BIT(nr) & BR_FDB_NOT_LEARNED_MASK)); >> >> Please use *_bit > > Can you tell me which *_bit helper you had in mind? The shortest option I could > come up with the ones I found seemed needlessly verbose and wasteful: > > static const unsigned long br_fdb_not_learned_mask = BR_FDB_NOT_LEARNED_MASK; > ... > WARN_ON_ONCE(test_bit(nr...
2014 Dec 12
2
[PATCH RFC v6 05/20] virtio: support more feature bits
...gt; } > diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h > index 070006c..81e5d0b 100644 > --- a/include/hw/qdev-properties.h > +++ b/include/hw/qdev-properties.h > @@ -6,6 +6,7 @@ > /*** qdev-properties.c ***/ > > extern PropertyInfo qdev_prop_bit; > +extern PropertyInfo qdev_prop_bit64; > extern PropertyInfo qdev_prop_bool; > extern PropertyInfo qdev_prop_uint8; > extern PropertyInfo qdev_prop_uint16; > @@ -51,6 +52,17 @@ extern PropertyInfo qdev_prop_arraylen; > .defval = (bool)_defval,...
2014 Dec 12
2
[PATCH RFC v6 05/20] virtio: support more feature bits
...gt; } > diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h > index 070006c..81e5d0b 100644 > --- a/include/hw/qdev-properties.h > +++ b/include/hw/qdev-properties.h > @@ -6,6 +6,7 @@ > /*** qdev-properties.c ***/ > > extern PropertyInfo qdev_prop_bit; > +extern PropertyInfo qdev_prop_bit64; > extern PropertyInfo qdev_prop_bool; > extern PropertyInfo qdev_prop_uint8; > extern PropertyInfo qdev_prop_uint16; > @@ -51,6 +52,17 @@ extern PropertyInfo qdev_prop_arraylen; > .defval = (bool)_defval,...
2014 Dec 12
0
[PATCH RFC v6 05/20] virtio: support more feature bits
...If you do not want to extend this for 64-bit right from the beginning, > I think you've got to use a temporary 32-bit variable to get this right. Hm... always store the old 32 bits here, then store the new 32 bits later? Should be able to get that compatible. > > +#define DEFINE_PROP_BIT64(_name, _state, _field, _bit, _defval) { \ > > + .name = (_name), \ > > + .info = &(qdev_prop_bit64), \ > > No need for the paranthesis around qdev_prop_bit64 here? Straight copy&paste...
2014 Dec 12
0
[PATCH RFC v6 05/20] virtio: support more feature bits
...If you do not want to extend this for 64-bit right from the beginning, > I think you've got to use a temporary 32-bit variable to get this right. Hm... always store the old 32 bits here, then store the new 32 bits later? Should be able to get that compatible. > > +#define DEFINE_PROP_BIT64(_name, _state, _field, _bit, _defval) { \ > > + .name = (_name), \ > > + .info = &(qdev_prop_bit64), \ > > No need for the paranthesis around qdev_prop_bit64 here? Straight copy&paste...
2014 Nov 30
1
[PATCH v7 01/46] virtio: add low-level APIs for feature bits
Add low level APIs to test/set/clear feature bits. For use by transports, to make it easier to write code independent of feature bit array format. Note: APIs is prefixed with __ and has _bit suffix to stress its low level nature. It's for use by transports only: drivers should use virtio_has_feature and never need to set/clear features. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- include/linux/virtio_config.h | 53 ++++++++++++++++++++++++++++++++++++++++---...
2014 Nov 30
1
[PATCH v7 01/46] virtio: add low-level APIs for feature bits
Add low level APIs to test/set/clear feature bits. For use by transports, to make it easier to write code independent of feature bit array format. Note: APIs is prefixed with __ and has _bit suffix to stress its low level nature. It's for use by transports only: drivers should use virtio_has_feature and never need to set/clear features. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- include/linux/virtio_config.h | 53 ++++++++++++++++++++++++++++++++++++++++---...
2014 Dec 01
0
[PATCH v8 01/50] virtio: add low-level APIs for feature bits
Add low level APIs to test/set/clear feature bits. For use by transports, to make it easier to write code independent of feature bit array format. Note: APIs is prefixed with __ and has _bit suffix to stress its low level nature. It's for use by transports only: drivers should use virtio_has_feature and never need to set/clear features. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck at de.ibm.com> --- include/linux/vir...
2014 Dec 01
0
[PATCH v8 01/50] virtio: add low-level APIs for feature bits
Add low level APIs to test/set/clear feature bits. For use by transports, to make it easier to write code independent of feature bit array format. Note: APIs is prefixed with __ and has _bit suffix to stress its low level nature. It's for use by transports only: drivers should use virtio_has_feature and never need to set/clear features. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck at de.ibm.com> --- include/linux/vir...
2006 Mar 30
3
[patch] bitops on irq_cpustat_t->__softirq_pending
As mentioned earlier, PowerPC''s atomic ops operate on longs, and we have made our *_bit() prototypes use long* (instead of void*) to warn us of problems at compile time. Here''s one caller that was flagged: test_and_set_bit(nr, &softirq_pending(cpu)) Accordingly, we need __softirq_pending to be long, not int. PowerPC is currently using a few files unmodified from the x8...
2014 Dec 02
0
[PATCH RFC v5 05/19] virtio: support more feature bits
...g(DeviceState *d, QEMUFile *f) static Property virtio_ccw_net_properties[] = { DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id), - DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features[0]), + DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_END_OF_LIST(), @@ -1486,7 +1494,7 @@ static const TypeInfo virtio_ccw_balloon = { static Property virtio_ccw_scsi_properties[] = { DEFINE_PROP_STRING("devno&qu...
2014 Dec 02
0
[PATCH RFC v5 05/19] virtio: support more feature bits
...g(DeviceState *d, QEMUFile *f) static Property virtio_ccw_net_properties[] = { DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id), - DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features[0]), + DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_END_OF_LIST(), @@ -1486,7 +1494,7 @@ static const TypeInfo virtio_ccw_balloon = { static Property virtio_ccw_scsi_properties[] = { DEFINE_PROP_STRING("devno&qu...
2014 Dec 11
0
[PATCH RFC v6 05/20] virtio: support more feature bits
...atic uint64_t get_features(VirtIODevice *vdev, uint64_t features) { VirtIOSerial *vser; diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 2e47f70..1b24818 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -125,6 +125,64 @@ PropertyInfo qdev_prop_bit = { .set = prop_set_bit, }; +/* Bit on a 64 bit value*/ + +static uint64_t qdev_get_prop_mask64(Property *prop) +{ + assert(prop->info == &qdev_prop_bit64); + return 0x1ULL << prop->bitnr; +} + +static void bit64_prop_set(DeviceState *dev, Property *props, bool val)...
2014 Dec 11
0
[PATCH RFC v6 05/20] virtio: support more feature bits
...atic uint64_t get_features(VirtIODevice *vdev, uint64_t features) { VirtIOSerial *vser; diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 2e47f70..1b24818 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -125,6 +125,64 @@ PropertyInfo qdev_prop_bit = { .set = prop_set_bit, }; +/* Bit on a 64 bit value*/ + +static uint64_t qdev_get_prop_mask64(Property *prop) +{ + assert(prop->info == &qdev_prop_bit64); + return 0x1ULL << prop->bitnr; +} + +static void bit64_prop_set(DeviceState *dev, Property *props, bool val)...
2011 May 19
2
[PATCHv2 0/2] virtio-net: 64 bit features, event index
OK, here's a patch that implements the virtio spec update that I sent earlier. It supercedes the PUBLISH_USED_IDX patches I sent out earlier. Support is added in both userspace and vhost-net. If you see issues or are just curious, you can turn the new feature off. For example: -global virtio-net-pci.event_idx=on -global virtio-blk-pci.event_idx=off Also, it's possible to try both
2011 May 19
2
[PATCHv2 0/2] virtio-net: 64 bit features, event index
OK, here's a patch that implements the virtio spec update that I sent earlier. It supercedes the PUBLISH_USED_IDX patches I sent out earlier. Support is added in both userspace and vhost-net. If you see issues or are just curious, you can turn the new feature off. For example: -global virtio-net-pci.event_idx=on -global virtio-blk-pci.event_idx=off Also, it's possible to try both
2011 May 04
4
[PATCH 0/3] virtio-net: 64 bit features, event index
OK, here's a patch that implements the virtio spec update that I sent earlier. It supercedes the PUBLISH_USED_IDX patches I sent out earlier. Support is added in both userspace and vhost-net. I see nice performance improvements: e.g. from 12 to 18 Gbit/s host to guest with netperf, but did not spend a lot of time testing performance. I hope others will try this out and report. Note: there
2011 May 04
4
[PATCH 0/3] virtio-net: 64 bit features, event index
OK, here's a patch that implements the virtio spec update that I sent earlier. It supercedes the PUBLISH_USED_IDX patches I sent out earlier. Support is added in both userspace and vhost-net. I see nice performance improvements: e.g. from 12 to 18 Gbit/s host to guest with netperf, but did not spend a lot of time testing performance. I hope others will try this out and report. Note: there
2014 Dec 02
24
[PATCH RFC v5 00/19] qemu: towards virtio-1 host support
Another iteration of virtio-1 patches for qemu, as always available on git://github.com/cohuck/qemu virtio-1 This one seems to work together with the current vhost-next patches (well, I can ping :) Changes from v4: - add helpers for feature bit manipulation and checking - use 64 bit feature bits instead of 32 bit arrays - infrastructure to allow devices to offer different sets of feature bits